Question: PyObjc 3.0 -> 3.3: anything effecting runtime speed for release app?

Issue #190 resolved
Marc Van Olmen
created an issue

Just upgraded from PyObjc 3.0 -> 3.3

I notice now that it requires a more stricter PyObjc objects, and it prevents the app from running, so after 190 edits, i have our complete app complying. Actually this made me find like 5 mistakes that were important to fix. (thanks!)

Our app is pretty big, with 150 view controllers and 25 views (this used to be 250, but most of them converted to Objective-c by now),

Is there anything we have to watch out for 3.3. for example this conformance checking is that something optional for a release build?

thanks again for the handwork over those many years.


Comments (3)

  1. Ronald Oussoren repo owner

    The checking is non-optional, and is only done during startup. The speed of checking hasn't changed from previous versions, there just has been a change in the default signature for python method. That is, you're probably affected by a change in PyObjC 3.2 (quoted from the release notes):

    Version 3.2

    Backward compatibility note: Due to a change in the way the default method signature is calculated PyObjC is now more strict in enforcing the Python<->Objective-C mapping for selectors and a number of code patterns that were allowed before are no longer allowed, in particular the following method definitions raise objc.BadPrototypeError:

       class MyObject (NSObject):
          def mymethod(self, a, b): ...
          def method_arg_(self, a, b, c): ...

    If these methods are only used from Python and are never used from Objective-C the error can be avoided by decorating these methods with objc.python_method:

       class MyObject (NSObject):
          def mymethod(self, a, b): ...

    This cannnot be used for methods used from Objective-C, for those you will have to rename the method or you will have to provide an appropriate selector explictly.

    P.S. 3.3a0 is (as the version indicates a development snapshot, there are some small changes w.r.t. 3.2 but nothing really big. I'll probably push out the 3.3 release later this week, just to get the latest bug fixes out to users.

  2. Log in to comment