PyObjC 9.1 is one of the rare times that I’m publishing explicit beta releases. PyObjC 9.1b1 is available on PyPI (pip install pyobjc-9.1b1
).
This release contains the usual SDK updates (macOS 13.3) and minor bugfixes, but more importantly it contains some major changes to pyobjc-core. Because of this I kindly request that you test this beta release and let me know about any problems.
First of all the code that transforms class attributes, and in particular translates Python functions to objc.selector
objects, was rewritten from C to Python. This change should be transparant for users, other than some error cases and intentation changes:
The new code is smarter about recognizing if a method is intended to be used as an Objetive-C selector and will not translate multi-word PEP8 compatable names (e.g. “my_,method”). This reduces the need to use the python_selector decorator.
Coroutings (async methods, iterators) are no longer translated to a selector
The new code will translate all callables, which may lead to needing to use the python_method decorator in some cases (e.g. when using a builtin function as a class attribute)
It is now possible to use varargs in a selector method when the implied number or arguments can be represented.
Furthermore the python_method
and informal_protocol
classes are now implemented in Python instead of Objective-C. Those should have no user-visible changes in behaviour.
Lastly a number of classes are now created using PyType_FromSpec
instead of using static PyTypeObject
definitions. That results in minor change in behaviour when using Python 3.9 or earlier: In those versions it is not possible to make these classes immutable. Don’t rely on this behaviour.
As always the full changelog can be seen at https://pyobjc.readthedocs.io/en/latest/changelog.html.