Skip to content

v8.4

Compare
Choose a tag to compare
@ronaldoussoren ronaldoussoren released this 07 Mar 21:42
· 556 commits to master since this release
  • The bindings for the Message and ServerNotification frameworks,
    which were removed in macOS 10.9, will be removed in PyObjC 9.

  • Added bindings for ScreenCaptureKit (new in macOS 12.3)

  • Updated framework bindings for the macOS 12.3 SDK.

    Based on Xcode 13.3 beta 3

  • Reverted a change in 8.3: It is once again not possible to
    use the "is" operator to check if two proxies for an NSString
    refer to the same Cocoa object.

    The change in 8.3 changed long standng behaviour for mutable
    strings and may have caused unintended problems.

  • #418: Added :class:typing.NewType definitions to the
    various framework bindings for all enum types in Cocoa
    (such as NSComparisonResult).

    Using this it is now possible to annotate methods returning
    such types, although it is not yet possible to type check
    this.

    For example:

    .. sourcecode:: python

    class MyObject(NSObject):
    def compare_(self, other: NSObject) -> NSComparisonResult:
    return NSOrderSame

    The actual representation of enum types is provisional
    and might change in the future.

  • #440: Added :class:typing.NewType definitions to the
    various framework bindings for all NS_STRING_ENUM,
    NS_TYPED_ENUM and NS_TYPED_EXTENSIBLE_ENUM types in Cocoa.

  • #432: Fix compatibility check when a class implements protocol NSObject.

    The following code used to fail the protocol implementation check:

    .. sourcecode:: python

    class AppDelegate( Cocoa.NSObject, protocols=[objc.protocolNamed("NSApplicationDelegate")]):
    pass

    The reason for this is that the type encodings for (at least) -[NSObject respondsToSelector:]
    in the Objective-C runtime doesn't match the type encoding in @protocol(NSObject) (the
    former returns char, the latter bool). The compatibility check now handles trivial
    differences like this.

  • #428: Class NSData now implements the API from :class:bytes. The methods that
    return bytes in :class:bytes also return bytes in NSData. This may change in a
    future version.

    Class NSMutableData now implements the API from :class:bytearray as far as this
    doesn't conflict with the native API. In particular, NSMutableData.copy() returns
    an immutable copy (instance of NSData), use NSMutableData.mutableCopy() to
    create a mutable copy.

    .. note::

    The implementation is mostly suitable for fairly small amounts of data as
    the Cocoa value is first copied into a Python value.

  • NSData([1,2,3]) and NSMutableData([1,2,3]) now work the same
    as bytes([1,2,3]) and bytearray([1,2,3]).

  • #334: Workaround for catetory on NSMutableArray that introduces a conflicting pop method

    Some class in Cocoa can at times introduce an (undocumented) selector -pop
    on subclasses of NSArray, which conflicts with a convenience method that
    emulates :meth:list.pop. The version introduces a workaround for this by
    adding the convenience method to all (statically known) subclasses of NSArray.

    This is far from perfect, but fixes the problem for now.

  • Fix memory manager API misuse

    PyObjC's :class:str subclass used the python allocator API incorrectly,
    causing an assertion failure when running tests with "python3 -Xdev",
    as well as a hard crash due to using the API without holding the GIL.

  • #445: Workaround for Python 3.11 support

    Workaround for BPO-46891 <https://bugs.python.org/issue46891 >_, which causes
    a hard crash in the PyObjC testsuite. With this workaround the tests for
    pyobjc-core pass with python 3.11a5, but this does result into adding some
    implementation internals to the __dict__ of framework wrappers when using
    Python 3.11

  • Fix build error on macOS 10.9

  • Fix :class:str implementation invariant in the :class:objc.pyobjc_unicode
    subclass. With this fix the string consistency checks in debug builds of
    CPython pass.

  • Fix exception handling when passing a bytes object to a C function
    with a byte buffer "inout" argument.