Download Latest Version v12.2 source code.tar.gz (14.9 MB)
Email in envelope

Get an email when there's a new version of PyObjC

Home / v12.2
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-05-29 7.0 kB
v12.2 source code.tar.gz 2026-05-29 14.9 MB
v12.2 source code.zip 2026-05-29 18.0 MB
Totals: 3 Items   32.9 MB 1
  • Update framework bindings for macOS 26.5 SDK

  • The following code failed at the last line in previous versions:

```python class MyObject(NSObject): pass

obj = MyObject()
obj.alloc = MyObject.alloc
print(obj.alloc) # Raised AttributeError
```
  • Backward incompatible changes: CFBagCreate and CFBagCreateMutable now match the API in Objective-C, that is, a value for the callbacks argument must be passed (must be kCFTypeBagCallBacks).

  • #663: Fix retain count management for the callbacks registered with DARegisterDiskEjectApprovalCallback, DARegisterDiskMountApprovalCallback, and DARegisterDiskUnmountApprovalCallback in DiskArbitration bindings.

  • “Hidden” instance methods were not hidden when looking them up as an attribute on the class, but found an unbound method as if the method was not hidden.

  • “Hidden” instance methods were visible in dir(SomeClass).

  • #664: Fix anObject.methodForSelector_(some_selector) resolving to a class method IMP when a bound selector object for some_selector is a class attribute.

  • Fixed some memory leaks on unlikely error paths.

  • #637: numbers.Number values are proxies as an NSNumber value.

  • #665: the new of Objective-C classes now also support keyword arguments derived from class selectors of the form valueWithKey1:key2: (with an arbitrary prefix instead of value).

The following calls are now possible (as examples):

  • Foundation.NSHost(address="www.python.org"), returns Foundation.NSHost.hostWithAddress_("www.python.org").

  • AppKit.NSImage(systemSymbolName="multiply.circle.fill", accessibilityDescription="multiply icon"), returns AppKit.NSColor.colorWithSystemSymbolName_accessibilityDescription_("multiply.circle.fill", "multiply icon").

  • Add NSMutableData.take_bytes on Python 3.15 to mirror the new bytearray method of the same name.

  • Rewrite the construction of objects representing method and function metadata, this should result in (slightly) less memory usage.

  • This release gets the testsuite for pyobjc-core to a point where there is comprehensive test coverage for the entire bridge. All extension modules now have 100% test coverage according to lcov, although with use for exclusion comments to ignore code blocks that cannot be reached for various reasons (e.g. PyDict_New can fail, but that only happens when running out of memory and it not preproducable during testing).

  • This enables refactoring the code in pyobjc-core with more confidence that this won’t result in unexpected changes in behaviour.

  • Fix error message for invalid argument to a callable with a variable length output buffer argument.

  • Fix error handlign for incomplete struct encodings.

  • Raise better error when specifying a negative array size for (Objective-)C arguments where the size of a buffer is passed as one of the arguments to a method or function.

  • A side effect of this is that a number of manual bindings no longer support passing -1 as the size of a buffer to derive the size from the Python sequence.

  • A Python implementation for a method that returns void and has a single output parameter used to leak a reference to the return value.

  • Fix crash when a Python implementation with a pass-by-reference output argument or return value returns an Objective-C instance that is no longer referenced in Python when the function returns, e.g.:

python @objc.objc_method(signature=b"@@:o^@") def myOutput_(self, a): return (1, NSObject.alloc().init())

  • The bridge could pass a null pointer for a function pointer argument in some (unlikely) edge cases instead of raising an error.

  • Fix various crashes related to edge cases in pass-by-reference argument handling (none of which happen are used in bindings for Cocoa frameworks)

  • Metadata with a tuple as the value for c_array_length_in_arg for an output argument is now honored for methods implemented in Python.

  • Fix crash when c_array_length_in_arg metadata refers to an non-existing argument.

  • Fix handling of transient proxy value, such as when Objective-C calls a Python method when the object is kept alive from Objective-C (no active reference in Python).

Edge case found while debugging an unexpected crash in the free-threaded build which uncovered a bug that also affected the regular build (but was not triggered there in the test suite).

  • aValue.methodForSelector_ now works when the selector is implemented in Python, the result will be the Python callable (not wrapped in an objc.IMP (pyobjc.readthedocs.io) value).

  • #644: A number of constants in the CoreAudio bindings evaluated to byte strings, while the framework expects regular strings.

  • Foundation.NSDecimalNumber can no longer be subclassed in Python.

Subclasses was possible in older versions, but this is something that isn’t supported in Objective-C and has unexpected behaviour.

  • The cobject and c_void_p arguments for opaque pointer types and objc.objc_object are now keyword only.

This should not affect user code because passing these values by value isn’t useful (esp. because the c_void_p argument is the only one that’s useful for interop with 3th-party code).

  • #668: “frozendict” is supported with Python 3.15a7 and later.

  • Instances roundtrip to Objective-C objects similarly as the dict type, including for keyed archiving. For non-keyed archiving a frozendict value is read back as a plain dict.

  • The metadata method on objc.function (pyobjc.readthedocs.io), objc.selector (pyobjc.readthedocs.io), and objc.IMP (pyobjc.readthedocs.io) now returns a frozendict instead of a regular dict to indicate that changing the value has no effect.

  • #674: Drop GIL when sending KVO notifications

PR by github user Tim Clem.

PR by github user Max Bélanger.Update framework bindings for macOS 26.5 SDK

Source: README.md, updated 2026-05-29