Download Latest Version v11.1 source code.tar.gz (24.3 MB)
Email in envelope

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

Home / v11.0
Name Modified Size InfoDownloads / Week
Parent folder
PyObjC 11_ Support for macOS 15 source code.tar.gz 2025-01-12 24.9 MB
PyObjC 11_ Support for macOS 15 source code.zip 2025-01-12 29.0 MB
README.md 2025-01-12 5.1 kB
Totals: 3 Items   53.9 MB 0

Version 11.0

The major change in this release is experimental support for free-threading (PEP 703 <https://peps.python.org/pep-0703/>_) which was introduced as an experimental feature in Python 3.13.

This required fairly significant changes in the core of PyObjC to change C Python API use and PyObjC internal APIs (mostly related to the use of borrowed references).

  • Dropped support for Python 3.8. PyObjC 11 supports Python 3.9 and later.

  • Updated metadata for the macOS 15.2 SDK, including bindings for the following frameworks:

  • MediaExtension

  • DeviceDiscoveryExtension

  • :issue:249: Added minimal bindings to the Carbon framework.

At this time only some functions and constants related to hotkeys are available. Please file an issue if you have a usecase for other APIs.

  • :issue:249: Added minimal bindings to the Carbon framework.

At this time only some functions and constants related to hotkeys are available. Please file an issue if you have a usecase for other APIs.

  • :issue:615: Struct wrappers now support a number of functions from :mod:copy: :func:copy.replace (new in Python 3.13), :func:copy.copy and :func:copy.deepcopy.

  • The __pyobjc_copy__ method has been removed from struct wrappers. This was never a public API. Use :func:copy.deepcopy instead.

  • :meth:`objc.FSRef.from_pathnow supportsos.PathLike`` values as its arguments (as well as strings).

  • :issue:608: Experimental support for the free-threading mode introduced in Python 3.13.

The core bridge and framework bindings claim compatibility with free-threading as introduced as an experimental feature in Python 3.13.

The support in PyObjC is also an experimental feature: I've reviewed code for free-threading issues and adjusted it where needed, but the code has seen only light testing w.r.t. concurrency.

Some functionality that's explicitly not thread-safe:

  • Defining an Objective-C class with the same name in multiple threads concurrently.

  • Splitting calls to alloc and init and calling init multiple times concurrently. E.g.:

    .. sourcecode:: python

    import threading
    from Cocoa import NSObject
    
    v = NSObject.alloc()
    
    t_list = []
    for _ in range(2):
        t = threading.Thread(target=lambda: v.init())
        t_list.append(t)
        t.start()
    
    for t in t_list:
        t.join()
    
  • The internal mapping from Python values to their active Objective-C proxy value now uses weak references. This should not affect user code, other than being a bit more efficient.

  • The internal interfaces for updating this mapping, and the reverse mapping from Objective-C values to their active Python proxy was changed to remove a small race condition. This was required for free threading support, but could in theory also bit hit when using the GIL.

  • The data structure for mapping Python values to their Objective-C proxy has been rewritten to support free threading. This also simplifies the code, and should be small performance improvement for the regular build of Python.

  • The :exc:TypeError raised when passing a non-sequence value to some APIs implemented in C now has a __cause__ with more detailed information.

This is a side effect of dropping the use of PySequence_Fast in the implementation of PyObjC.

  • Removed objc.options._nscoding_version, a private option that is no longer used.

  • Changing the __block_signature__ of a block value when the current value of the signature is not None is no longer possible.

Please file an issue if you have a use case for changing the signature of a block.

  • Fix compatibility with Python 3.14 (alpha 3)

  • Removed private function objc._sizeOfType because its unused.

  • Fix memory leak when using Python callables as blocks.

The memory leak also resulted in leaking a reference to the callable (and hence anything kept alive by that reference).

  • The generic __new__ implementation now works as intended when registering methods that other than init... methods.

  • Dropped '%n' support in handling printf-format strings for variadic functions and methods.

Two reasons for that: 1) supporting this properly should return the value writing to the %n location (requiring significant changes) and 2) Apple's libraries require using static strings for '%n' to work (at least on some platforms and versions of the OS)

  • :issue:633: Fix manual bindings for AVAudioPCMBuffer methods for getting channel data (floatChannelData, int16ChannelData and int32ChannelData)

  • :issue:632: fix broken bindings for CGWindowListCreateImageFromArray.

  • The private __is_magic attribute on :class:objc.objc_object has been renamed to __pyobjc_magic_coookie__.

  • Various fixes to edge case behaviour that were found while improving test coverage.

Source: README.md, updated 2025-01-12