I’ve uploaded PyObjC 10.1 to PyPI. This primarily adds support for new APIs in macOS 14.2, but also fix some issues in support for older macOS versions and the current Python 3.13 alpha release.
I’ve uploaded PyObjC 10.1 to PyPI. This primarily adds support for new APIs in macOS 14.2, but also fix some issues in support for older macOS versions and the current Python 3.13 alpha release.
Sigh, receiving a signal while the signal handler is being changed can crash on macOS (FB13453490, github.com/python/cp…)
import objc; l = objc.getClassList(); from Cocoa import CFLocaleCopyCommonISOCurrencyCodes, NSArray; isinstance(CFLocaleCopyCommonISOCurrencyCodes(), NSArray)
. This passes on macOS 13, but fails on macOS 14 beta’s due to rewriting parts of Cocoa in Swift. Narrowing this down took some time…
PyObjC 9.2 is uploading to PyPI. This contains a number of bugfixes, as well as support for Python 3.12 (tested with beta 1).
PyObjC will now also warn about code that uses argumentless super()
when super
doesn’t resolve to PyObjC’s objc.super
. Using builtin.super
for resolving superclass attributes for Objective-C classes can result in subtle errors. Using objc.super
instead fixes those errors, and is safe to use with regular python classes as well.
The correct code pattern is:
from Foundation import NSObject
from objc import super # Use ``objc.super`` instead of ``builtin.super``
class MyObject(NSObject):
def init(self):
self = super().init()
if self is None:
return None
...
return self
I’ve uploaded new versions of py2app and modulegraph that target both the (very) old and the new: Both now support the current Python 3.12 beta, and contain fixes for Python 2.7 support.
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.