All window bindings (most significantly resize and move) call the _alertBindings method. This method makes extensive use of hasattr and Window is a subclass of NSObject. In the past, hasattr has been a major performance issue for PyObjC when used in code that is called frequently. During move and resize, this will be called very frequently.
We should figure out a way to eliminate the hasattr use. The _alertBindings method has notes about why hasattr is used, but looking at it many years later, I wonder if the solution may be to simply establish the bindings dict before the window delegate is set.
All window bindings (most significantly resize and move) call the _alertBindings method. This method makes extensive use of
hasattr
andWindow
is a subclass ofNSObject
. In the past,hasattr
has been a major performance issue for PyObjC when used in code that is called frequently. During move and resize, this will be called very frequently.We should figure out a way to eliminate the
hasattr
use. The_alertBindings
method has notes about whyhasattr
is used, but looking at it many years later, I wonder if the solution may be to simply establish the bindings dict before the window delegate is set.