Pyobjc

Latest version: v11.0

Safety actively analyzes 701302 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 11 of 18

3.0.1

-------------

* :issue:`86`: Fix installation issue with setuptools 3.6.

* :issue:`85`: Remove debug output from the wrapper for ``NSApplicationMain``.

* :issue:`82`: NSArray.__iter__ was accedently removed in PyObjC 3.0

* PyObjCTools.Debugging didn't work properly on recent OSX versions (at least OSX 10.9)
because ``/usr/bin/atos`` no longer worked.

3.0

-----------

* :issue:`50`: Accessing Objective-C methods on "magic cookie" variables,
like ``LaunchServices.kLSSharedFileListItemLast`` would crash the interpreter.

This affected code like::

from LaunchServices import kLSSharedFileListItemLast

kLSSharedFileListItemLast == kLSSharedFileListItemLast
dir(kLSSharedFileListItemLast)
kLSSharedFileListItemLast.compare_

* Added a decorator "python_method" than can be used to decorate methods that should
not be registered with the Objective-C runtime and should not be converted to a
Objective-C selector.

Usage::

class MyClass (NSObject):

python_method
classmethod
def fromkeys(self, keys):
pass

This makes it easier to add a more "pythonic" API to Objective-C subclasses without
being hindered by PyObjC's conventions for naming methods.

* :issue:`64`: Fix metadata for ``Quartz.CGEventKeyboardSetUnicodeString``
and ``Quartz.CGEventKeyboardGetUnicodeString``.

* :issue:`77`: Passing a bound selector as a block argument failed when the block
was actually called because the trampoline that calls back to Python accidentally
ignored the bound ``self`` argument.

* :issue:`76`: It is now possible to pass ``None`` to a method expecting a block
argument, as with normal object arguments the Objective-C method receives
a ``nil`` value.

* Python integer values with values between 2 ** 63 and 2**64 are now proxied
as plain NSNumber objects, not as using PyObjC specific subclass of NSNumber,
to avoid a problem with writing them to binary plist files.

This is a workaround and will likely be changed in some future version.

* ``inspect.signature`` works for all functions and methods implemented in C,
when using Python 3.4 or later.

* The module ``PyObjCTools.NibClassBuilder`` is not longer available. It only worked
with ancient versions of Interface Builder (pre-Xcode)

* The wrapper type for opaque pointers didn't have a "__module__" attribute,
which breaks code that (correctly) assumes that all types have such an attribute.

* Archiving now supports nested definitions and method references, similar
to the support of those added to pickle protocol 4 in Python 3.4.

Encoding nested classes requires support for the ``__qualname__`` attribute,
and hence requires Python 3.3. Decoding should work with earlier python
versions as well.

* Add ``objc.autorelease_pool``, a context manager for managing an
autorelease pool. Usage::

with objc.autorelease_pool():
pass


This is equivalent to::

_pool = NSAutoreleasePool.alloc().init()
try:
pass

finally:
del _pool

* Added ``objc.registerABCForClass`` to make it possible to register
a class with a number of ABC classes when the class becomes available.

* ``NSDecimalNumber`` can now be instantatiated as a normal Python object::

value = NSDecimalNumber(4)

* ``NSData`` and ``NSMutableData`` can now be instantiated as a normal
Python object::

value = NSData(someBytes)

or::

value = NSData()

* ``NSDecimal`` now coerces the other value to ``NSDecimal`` in coercions.
Because of you can now order instances of ``NSDecimal`` and ``int``.

* ``PyObjCTools.KeyValueCoding.ArrayOperators`` and
``PyObjCTools.KeyValueCoding.arrayOperators`` were accidentally public
names in previous releases, and are now removed. Use the array operators
in the KVC protocol instead.

* Restructured the "convenience" method code. This shouldn't have user
visible effects, but makes the code easier to maintain.

* ``objc.addConvienceForSelector`` no longer exists, it isn't possible
to provide this functionality with the current implementation of the
bridge.

* The build of pyobjc-core can now be configured by editing setup.cfg (or
providing arguments to the build_ext command), instead of editing the
setup.py file.

Currently the following options are available for the build_ext command:

* ``--use-system-libffi``: When this option is used the build will use
/usr/lib/libffi.dylib instead of the embedded copy of libffi. The latter
is the default is and is better tested.

* ``--deployment-target=VAL``: The value of ``MACOSX_DEPLOYMENT_TARGET`` to use,
defaults to the deployment target used for building Python itself

* ``--sdk-root=VAL``: Path to the SDK root used to build PyObjC, or "python" to
use the default SDK selected by distutils. The default is to use the
most recent SDK available.

* The lazy importer has smarter calculation of the ``__all__`` attribute,
which should speed up 'from Cocoa import \*'.

* BUGFIX: using a method definition with only ``*args`` and ``**kwds`` used
to crash the interpreter, the now once again raise a TypeError exception.

* The metadata for pyobjc-framework-Accounts was incomplete, fixed that.

* :func:`objc.callbackFor` now also adds a *__metadata__* method to decorated
functions. This is primarily to make it easier to test the metadata values.

* The *__typestr__* attribute of opaque pointer types is now a byte string,
in previous versions this was an instance of :class:`str` (this only affects
Python 3 support)

* The JavaScriptCore bindings (in pyobjc-framework-WebKit) are now more usable
because types like "JSValueRef" are now exposed to Python (they were missing
due to incomplete metadata).

* Exclude a number of keys from the metadata dictionary when they have the
default value (in the result from the *__metadata__()* method on methods
and functions)

* The "lazy" modules used by framework wrappers now always have a ``__loader__``
attribute (as required by PEP 302). The value can be :data:`None` when there
is no explicit loader (such as when importing from the filesystem in Python 3.2
or earlier).

* Method (and function) metadata is stored in a more compact manner, reducing the
memory use of PyObjC applications.

* Removed support for hiding "protected" methods, :func:`objc.setHideProtected` is gone,
it complicated the code without real advantages.

Reasons for this:

* There were some conflicts because a class implemented two selectors that caused
the same python method to be added to the class *__dict__*. Which one was added
was basically random.

* The functionality required PyObjC to maintain a full *__dict__* for classes, even
when most Cocoa methods were never called. Ensuring that the contents of *__dict__*
is correct in the face of Objective-C categories and class patches required some
*very* expensive code.

As a side effect of this some classes may no longer have the convenience methods they
had in earlier releases (in particular classes that are not mentioned in Apple's
documentation).

* :issue:`3`: The bridge now lazily looks for Objective-C methods as they are used from Python, instead
of trying to maintain a class *__dict__* that mirrors the method list of the Objective-C
class.

Maintaining the *__dict__* was *very* expensive, on every method call the bridge would
check if the method list had changed and there is no cheap way to perform that check.

.. note::
I haven't done performance tests at this time, it is not yet clear if this work will
make the bridge more efficient or that there are other more important bottlenecks.

* The default translation from a python name to a selector was slightly changed:

* double underscores inside the name are no translated to colons, that is 'foo__bar_' is translated to 'foo__bar:', not 'foo::bar:'

* if the Python name start with two uppercase letters and an underscore, that first underscore is not translated into
an colon. Two leading capitals are often used as a way to add some kind of namespacing
to selector names (and avoid conflicts when a method with the same name is added later by the library provider)

* Added *__new__* method to NSString, it is now possible to explicitly convert a python string to a Cocoa
string with ``NSString(someString)``

* Added *__eq__* and *__ne__* methods to native selector objects, which mean you can now
check if two method objects are the same using 'sel1 == sel2'. This works both for bound
and unbound selectors.

* NSData.bytes() could raise an exception on some version of Python 3 when the data object is empty.
The function now returns an empty bytes object instead.

* NSMutableData.mutableBytes() raises an exception when the data object has a 0-sized buffer.
(see also the previous bullet)

* Add attribute *__objclass__* to :class:`objc.selector` instances as an alias for *definingClass*. The name
*__objclass__* is used by builtin method objects for the same purpose as *definingClass*.

The new attribute is needed to ensure that ``help(NSObject)`` works (although all methods are shown as
data descriptors, not methods)

* :class`objc.selector` no longer implements *__set__*, which means it is now classified as a method
descriptor by the :mod:`inspec` module, which gives nicer output in :mod:`pydoc`.

This doesn't change any functionality beyond that, it is still possible to overwrite methods and not
possible to delete them.

* :class:`objc.native_selector` and :class:`objc.function` now have a (minimal) docstring with information
object. This makes :func:`help <pydoc.help>` for Cocoa classes and functions more useful.

As a side-effect of this the docstring is no longer writeable.

.. note::

The docstring show the interface of a block with a function prototype instead of the proper
C declaration, that makes the implementation slightly easier and the function prototype syntax
is slightly easier to read for users that aren't C experts.

* :class:`objc.selector`, :class:`objc.function` and :class:`objc.IMP` now have an implementation for
the "__signature__" property when using Python 3.3 or later. This makes it possible to use
:func:`inspect.signature` with these objects.

* It should now be possible to write tuples with more than INT_MAX elements to an NSArchive. Those archives
cannot be read back by older versions of PyObjC (or python running in 32-bit mode), but archives that
contain only smaller tuples can be read back by earlier versions.

* :issue:`38`: Struct wrappers and opaque pointer types now implement support for :func:`sys.getsizeof`,
as do :class:`objc.FSRef`, :class:`objc.FSSpec`, and Objective-C classes.

The size of Objective-C instances is not entirely correct, and cannot be. The :func:`sizeof <sys.sizeof>` function
only reports the size of the proxy object and the basic size of the Objective-C object. It does not
report additional buffers used by the object, which for example means that a too low size is reported
for Cocoa containers like NSArray.

* Opaque pointer objects now have a method "__c_void_p__" that returns a :class:`ctypes.void_p` for
the same pointer.

* Added an API to "pyobjc-api.h" that makes it easier to explicitly load function references in
manual function wrappers. This replaces the compiler support for weak linking, which was needed
because weak linking did not work properly with clang (Xcode 4.5.1). This also makes it possible
to compile in support for functions that aren't available on the build platform (in particular, when
building on 10.8 the Quartz bindings now contain support for some functions that were dropped in 10.8
and which will be available through pyobjc when deploying to 10.7)

* The framework wrappers no longer export a "protocols" submodule. Those submodules were deprecated in
2.4 and did not contain information that is useful for users of PyObjC.

* Dropped the "objc.runtime" attribute (which was deprecated in PyObjC 2.0)

* Dropped depcreated APIs *objc.pluginBundle*, *objc.registerPlugin*. Py2app has used a
different mechanism for years now.

* Dropped deprecated APIs: *objc.splitStruct*, *objc._loadFunctionList*. Both have
been replaced by newer APIs in PyObjC 2.4.

* Foundation's *NSDecimal* type is exposed in the objc module as well.

This was done to remove a dependency from the pyobjc-core package to pyobjc-framework-Cocoa.

* The type :class:`objc.NSDecimal` is now an immutable type, just like
:class:`decimal.Decimal` and other Python value types.

Because of this the interface of ``Foundation.NSScanner.scanDecimal_`` has changed, in
previous versions it is used as::

dec = Foundation.NSDecimal()
ok = scanner.scanDecimal_(dec)

In the current version it is called just like any other method with an output argument::

ok, dec = scanner.scanDecimal_(None)

* The C code is more careful about updating Python reference counts, in earlier versions
it was possible to trigger access to a field in a datastructure that was being deallocated
because the calls to :c:macro:`Py_DECREF` for the field happened before setting the
field to :c:data:`NULL` or a new value. This could then result in a hard crash due to
accessing freed memory.

* Bugfix: objc.NSDecimal(2.5) works with python 3 (caused a confusing
exception due to buggy code before).

* Bugfix: the support for :func:`round <__builtin__.round>` for :class:`objc.NSDecimal`
always rounded down, instead of using the normal rounding rules used by other
methods.

* PybjC no longer supports the CoreFoundation bindings in the "Carbon.CF" module
in the standard library for Python 2. The "Carbon.CF" module is not present
in Python 3, and is unmaintained in Python 2.

* The 'struct sockaddr' conversion code now understands the AF_UNIX address family.

* The function "objc.setSignatureForSelector" has been removed (and was deprecated
in 2.3), use the metadata system instead."

* The 'returnTypes' and 'argumentTypes' parameters for 'objc.selector' have
been removed (they were deprecated in version 2.5). These were an attempt
to use type encodings as used in :c:func:`Py_BuildValue` and AFAIK were never
used in real code.

* The header "pyobjc-api.h" has been cleaned up:

.. note::

"pyobjc-api.h" is used by extension modules in the PyObjC framework wrappers
but is not intended to be a public API. Please let me (Ronald) know if you
use this API, I'm trying to get the API as small as possible and that might
lead to its complete removal in a future version of PyObjC.

- Py_ARG_SIZE_T is no longer defined by pyobjc-api.h (use "n" instead)

- Removed the following functions from the API (PYOBJC_API_VERSION is now 20)
because they aren't used by PyObjC:

- PyObjC_PerformWeaklinking (and struct PyObjC_WeakLink)

- PyObjCRT_RemoveFieldNames

- PyObjC_is_ascii_string

- PyObjC_is_ascii_prefix

- PyObjCObject_Check

- PyObjCClass_Check

- PyObjCSelector_Check

- PyObjCObject_ClearObject

- PyObjCClass_New

- PyObjCErr_ToObjC

- PyObjC_RegisterSignatureMapping

- PyObjCRT_AlignOfType

- PyObjCRT_SELName

- PyObjCRT_SimplifySignature

- PyObjC_RegisterStructType

- PyObjCObject_IsUninitialized

- PyObjCObject_New

- PyObjCCreateOpaquePointerType

.. note::

There will be further cleanup of this API before the 3.0 release.

Added a *name* argument to PyObjCPointerWrapper_Register.

* The KVO implementation for Cocoa subclasses used to ignore exceptions
in the implementation of ``[obj willChangeValueForKey:]`` and
``[obj didChangeValueForKey:]`` and no longer does so.

One side effect of this is that ``willChangeForForKey_`` and
``didChangeValueForKey_`` can now cause user visible exceptions
when "__useKVO__" is true (the default) and these methods are implemented
in Python.

* PyObjC 3 requires a compiler that supports Objective-C with C99 as the base
language.

* PyObjC raises an exception instead of creating instances of
:class:`objc.PyObjCPointer` when you set :data:`objc.options.unknown_pointer_raises`
to :data:`True`.

The default is currently :data:`False`, that will be changed in a future version
and the entire `objc.ObjCPointer` class will likely be removed some releases
after that.

* Configuration options are now attributes of special object :data:`objc.options`.

The following functions are therefore now deprecated and will be removed
in PyObjC 3.1:

* :func:`objc.getVerbose`

* :func:`objc.setVerbose`

* :func:`objc.setUseKVOForSetAttr`

* :func:`objc.setStrBridgeEnabled`

* :func:`objc.getStrBridgeEnabled`

* Removed objc._setClassSetUpHook, an internal method that is not used
anymore.

* Removed +[OC_PythonObject setVersion:encoder:decoder:],
+[OC_PythonObject pythonifyStructTable], +[OC_PythonObject depythonifyTable].

All were private methods used by the core bridge and are no longer necessary.

* Added :func:`objc.registerSetType` and :func:`objc.registerDateType`, with
similar semantics as the already existing functions :func:`objc.registerMappingType`
and :func:`objc.registerListType`.

* Moved the logic for creating Objective-C proxies for Python objects from
class methods on OC_PythonObject, OC_PythonArray, OC_PythonDictionary,
OC_PythonSet and OC_PythonDate to a C function to simplify this logic and
make it easier to further optimize.

Because of this a number of (private) class methods are no longer
available. This shouldn't affect normal code because these methods aren't
part of the public API for PyObjC.

* Added bindings to the CoreWLAN framework (macOS 10.6 or later) in
package "pyobjc-framework-CoreWLAN"

* Added bindings to the AVFoundation framework (macOS 10.7 or later) in
package "pyobjc-framework-AVFoundation"

* The *__dict__* for ``anObject.pyobjc_instanceMethods`` and
``AClass.pyobjc_classMethods`` is now read-only instead of read-write.

Updates of *__dict__* already did not affect anything (the value is
calculated on access).

* Removed workarounds for KVO bugs in macOS 10.3.9, which means KVO
will likely not work properly anymore on that release of OS X.

* Earlier versions of PyObjC accidentally exposed ``-[NSObject respondsToSelector:]``
as ``NSObject.respondsToSelector()`` as well as the expected
``NSObject.respondsToSelector_()``. The first incorrect binding no
longer works.

* Python 3 only: NSKeyedArchives with a bytes object can now be read
back by a pure Objective-C program (that program will decode it
as an NSData object).

Because of this the encoding for method for OC_PythonData was changed,
archives created by PyObjC 3.0 can therefore not be read back
by earlier PyObjC versions (but PyObjC 3.0 can read archives created
by those older versions)

* NSKeyedArchives with a python list or tuple (but not subclasses) can
now be read back as NSArrays in Objective-C programs.

* NSKeyedArchives with a python set or frozenset (but not subclasses)
can now be read back as NSSets in Objective-C programs.

This required a change in the format used to create the archive,
which means that archives with a set or frozenset (but not subclasses)
cannot be read back by earlier versions of PyObjC.

* When writing instances of list, tuple, dict, set and frozenset to
an NSArchive, but not an NSKeyedArchiver, the objects are stored
with the same encoding as the corresponding Cocoa class.

This has two side effects: the archive can be read back by pure
Objective-C code and when you read back the archive using PyObjC you'll
get instances of Cocoa classes instead of the native python classes.

* ``-[OC_PythonEnumerator nextObject]`` now returns ``[NSNull null]`` instead
of ``nil``, to be compatible with the behavior of item getters/setters
and to avoid ending iteration premature when a Python sequence contains
:data:`None`.

* Fixed a number of issues with :data:`None` as a member of a set-like
object proxied by ``OC_PythonSet``. The easiest way to trigger the
issue in earlier versions::

assert {None} == NSSet.setWithArray([None])

These expose sets with the same members to ObjC code, but those objects
didn't compare equal.

* Python 2 only: NSDictionary instances now have the same internal
other as dict instances with the same value, that is
``cmp(anNSDict1, anNSDict2) == ``cmp(dict(anNSDict1), dict(anNSDict2))``.

* In previous versions of PyObjC instances of ``Foundation.NSDecimal`` behaved
as if they had the same methods as ``Foundation.NSDecimalNumber``. In 3.0
PyObjC no longer exposes these methods.

* Python blocks (that is, Python callables passed to a method/function that
expects an Objective-C block argument) now include an Objective-C
signature string (introduced in "ABI.2010.3.16").

* PyObjC now supports blocks that have a large struct as the return value
(for example a block that returns an NSRect structure).

* Reduced the number of unnecessary methods implemented by the various
OC_Python* classes, this might affect some Objective-C code that directly
uses these classes instead of just using the interface of their
superclasses.

* ``del NSObject.__version__`` crashed the interpreter because the setter
didn't guard against deletion attempts.

* ``del aSelector.isHidden`` crashed the interpreter (see above)

* Class :class:`objc.ObjCPointer` was not exposed in the :mod:`objc` module.

* The implementation of :class:`objc.ObjCPointer` didn't have a proper
implementation of *__getattribute__* and that made objects of this
class even more useless than they should have been.

* Values of :class:`objc.ObjCPointer` no longer have an unpack method
(the method has been inaccisible for several releases and its implementation
as unsafe)

* The *type* attribute of :class:`objc.ObjCPointer` now starts with
:data:`objc._C_PTR` (that is, the *type* attribute is the encoded type
of the pointer, instead of the encoded type of the pointed-to value).

* Framework wrappers no longer have a 'protocols' submodule, use
:func:`objc.protocolNamed` to access a protocol.

* ``-[OC_PythonObject valueForKeyPath:]`` and ``-[OC_PythonObject setValue:forKeyPath:]``
now call helper functions in :mod:`PyObjCTools.KeyValueCoding`, just
like ``-[OC_PythonObject valueForKey:]`` and ``-[OC_PythonObject setValue:forKey:]``.

This should give better results in some edge cases when dealing with
complicated keypaths.

2.5.2

-------------

- "easy_install pyobjc" always tried to install the FSEvents binding,
even when running on OSX 10.4 (where that API is not available).

- ``objc.ObjCPointer`` didn't implement *__getattribute__*.

(reported by private mail)

- Implementing a python method that has a block as one of its arguments
didn't work. It now works when there is metadata that describes the
method signature.

(reported by private mail)

- BUGFIX: a method definition like this now once again raises TypeError
instead of crashing the interpreter::

def myMethod(*args):
pass

(reported by private mail)

2.5.1

-------------

- PyObjC could crash when calling a method that is dynamically generated
(that is, the selector is not present in the class according to the
Objective-C runtime but the instance responds to it anyway).

The cases that used to crash now raise :exc:`objc.error` instead.

.. note::

It is highly unlikely that real code would run into this, found
while working on PyObjC 3.x.

- When writing a python unicode object to an NSArchiver or NSKeyedArchiver
the object is now stored exactly the same as a normal NSString, and will
be read back as such.

This increases interoperability with code that expects to read back a
non-keyed archive in a different process. An example of this is the use
of Growl (see issue :issue:`31`)

Instances of subclasses of unicode are not affected by this change, and
can only be read back by other PyObjC programs.

- :issue:`43`: It was no longer possible to create instances of
LaunchServices.LSLaunchURLSpec due to incomplete metadata.

- :issue:`41`: the 'install.py' script in the root of pyobjc repository
failed to perform an install when running in a clean checkout of the tree.

- :issue:`44`: the various Cocoa frameworks only export protocol definitions when
they happen to be used by code in the framework. Added extensions to the
various framework wrappers to ensure that all protocols are available to
python code.

- Opaque pointer types now can be constructed with a "c_void_p" keyword
argument that contains a :class:`ctypes.c_void_p` value for the pointer.

This is the reverse of the *__c_void_p__()* method that was added
earlier.

- :issue:`46`: It was not possible to use the Quartz.CoreGraphics module
on OSX 10.5 when the binary was build on 10.8 (and using a 10.5 deployment
target).

Similar issues may be present in some of the other framework wrappers,
there will be a more generic fix for this issue in a future release.

2.5

-----------

- Add conversion to/from ctypes.c_void_p to proxies for Cocoa objects.

To use::

anObject = NSArray.array()
void_p = anObject.__c_void_p__()
use void_p with ctypes

otherObject = NSObject(c_void_p=voip_p)
assert anObject is otherObject

Note that it is save to construct the python proxy from NSObject,
the class will return an instance of the correct proxy type (in this
example an instance of NSArray)

- Fixed problem where the result of ``anObject.__cobject__()`` could not be converted
back to a PyObjC object again.

- A number of framework wrappers have a "protocols" submodule containing
protocol objects (for example the module 'Foundation.protocol'). Use
of these modules is deprecated, they will be removed in PyObjC 3.0.

Use :func:`objc.protocolNamed` to access protocols instead.

- Instances of :class:`objc.ivar` now have slots for introspection:

- *__typestr__*: The type encoding

- *__name__*: The Objective-C name

- *__isOutlet__*: :data:`True` if the instance variable is an IBOutlet

- *__isSlot__*: :data:`True` if the instance variable is a Python slot

- Added implementation of '==' and '!=' for selectors defined in Python
that is slightly smarter than the default (identity based) implementation
in Python.

This is mostly done for the PyObjC unittests and shouldn't affect user
code.

- :issue:`30`: Explicitly check if the compiler works, and try to
fall back to clang if it doesn't. This uses a similar algorithm as
the fix for <https://bugs.python.org/issue13590> in Python's tracker.

- :issue:`22`: Reimplement support for bridgesupport files

This reintroduces ``objc.parseBridgeSupport`` and
``objc.initFrameworkWrapper``, both are reimplemented in Python
(previous version used C code)

.. note::

The implementation is currently barely tested and therefore likely
contains bugs.

- Struct types created by the framework wrappers once again create class
methods on :class:`objc.ivar` to generate instance variables of that type::

myLocation = objc.ivar.NSPoint()

This has the same result as::

myLocation = objc.ivar(typer=NSPoint.__typestr__)

- :func:`objc.IBAction` now raises TypeError when the argument is :data:`None`.

- :func:`objc.instancemethod` is now actually exported by the :mod:`objc` package.

- :func:`objc.accessor` and :func:`objc.typedAccessor` were not 64-bit safe.

- :func:`objc.accessor` and :func:`objc.typedAccessor` didn't support the entire
set of KVC accessors.

- Add methods "_asdict" and "_replace" and field "_fields" to the struct wrapper
types. These new attributes mirror the :class:`collections.namedtuple` interface.

.. note::

In the long run I'd like to make struct wrappers immutable to allow using
them as dictionary keys. This is a first step in that direction and makes
it possible to verify that immutable struct wrappers are usable.

- Added :func:`objc.createStructAlias`, and deprecated
:func:`objc.registerStructAlias`. The new function has a "name" argument
and can register types with the :class:`objc.ivar` type (see previous item)

- Add explicit deprecation warnings to ``objc.CFToObject`` and
``objc.ObjectToCF``. Both functions barely function at all and will
be removed with PyObjC 3.0.

- ``objc.CFToObject`` and ``objc.ObjectToCF`` are no longer available
when using Python 3.x, the APIs are used for MacPython support and
that part of the standard library is not available with Python 3.x.

- ``objc.splitStruct`` is renamed to ``objc.splitStructSignature``
and now actually works. The old name is temporarily available as
an alias.

- Fix refcounting leak in ``objc.splitSignature``.

- ``objc._loadFunctionList`` is renamed to ``objc.loadFunctionList``
and is fully documented. The old name is temporarily available as
an alias.

- Move (deprecated) decorator "signature" from objc._functions to objc._descriptors,
and remove the former module.

.. note::
The names op submodules of objc are implementation details, don't import
them directly.

- The optional argument for the decorator :func:`objc.selectorFor` was broken

- The :class:`PyObjCTools.KeyValueCoding.kvc` wrapper `__setattr__` wrapper
incorrectly set attributes on itself as well as on the wrapped object (the latter
using Key-Value Coding)

- Renamed (private) function injectSuffixes to inject_suffixes to match the
other code in objc._dyld.

- Slight restructuring of objc._pythonify to reduce code duplication between the
python 2.x and python 3.x cases.

- Removed deprecated methods from PyObjCTools.TestSupport

- :class:`collections.Sequence` objects are now automatically proxied as NSArray
instances

- :class:`collections.Mapping` objects are now automatically proxies as NSDictionary
instances

- Removed some objects and functions from objc._bridges that weren't public
and weren't used by PyObjC itself:

- *BRIDGED_STRUCTURES*: mapping of python type to proxy class
- *BRIDGED_STRUCTURES2*: mapping of python type to proxy class (not used at all)
- *BRIDGED_TYPES*: mapping of python type to proxy class
- *_bridgePythonTypes*: uses BRIDGED_STRUCTURES and BRIDGED_TYPES to update bridge data

*_bridgePythonTypes* was called unconditionally, but never did anything because
the data structures were empty and no code adds anything to them.

- Improved documentation

- For Objective-C blocks: try to extract the block signature from the (Objective-)C runtime
when there is no metadata for the block. The block signature is available only when the
code that creates the block is compiled using a recent enough compiler (although "recent
enough" is fairly old by now)

- Fixes some issues with :class:`objc.object_property` which were found by
improved unittests. In particular:

- The selector names for boolean properties were wrong

- Properties with a "depends_on" list didn't inherit properly

- Properties that were used in subclasses didn't generate the correct KVO
events when they were observed.

- KVO issues with computed (read-only) properties

- Fixed some issues with :class:`objc.array_property` and :class:`objc.set_property`
that were found by much improved unittests.

- Fixed issues with :mod:`PyObjCTools.KeyValueCoding` that were found by improved
unittests:

- ``getKey`` didn't work properly on dictionaries (dictionaries were treated as sequences)

- ``getKeyPath(list, "avg.field")`` didn't work when field wasn't a valid key for all
items in the list, and likewise for the 'sum', 'min', 'max' special keys.

- ``getKeyPath`` didn't raise the correct exception for empty key paths

- ``unionOfObjects`` and ``distinctUnionOfObjects`` operators for Python sequences
didn't raise an exception when the selected keypath didn't exist on an item of the sequence.

- ``unionOfArrays`` and ``distinctUnionOfArrays`` operators for Python sequences
didn't raise an exception when the selected keypath didn't exist on an item of the sequence.

- ``distinctUnionOfArrays`` and ``distinctUnionOfObjects`` didn't work properly when
the keypath pointed to objects that weren't hashable.

- ``distinctUnionOfSets`` operator was not present at all.

- 'PyObjCTools.KeyValueCoding.setKey' now sets keys in dictionaries, that is::

>>> a = {}
>>> setKey(a, 'foo', 42)
>>> a
{'foo': 42 }

- 'PyObjCTools.KeyValueCoding.setKey(object, 'key', value)' now sets attribute 'key' when
the object already has that attribute, before looking at '_key'. This avoids that ``setKey``
changes the underlying storage for a common Python property pattern::

class Record (object):
property
def prop(self):
return self._prop

prop.setter
def prop(self, value):
self._prop = calculate_using(value)

Until PyObjC 2.5 the property setter for 'prop' would not be called when using KeyValueCoding.

- Removed macOS 10.2 (!) compatibility from :mod:`PyObjCTools.KeyValueCoding`.

- PyObjCTools.KeyValueCoding has undocumented attributes 'ArrayOperators' and 'arrayOperators',
both will be removed in a future release.

- Using NSArchiver or NSKeyedArchiver to encode and then decode a python list or tuple could
result in an unexpected value. In particular, if any element of the sequence was :data:`None`
before archiving it would by ``NSNull.null()`` when read back.

- Using NSArchiver or NSKeyedArchiver to encode and decode (pure) python objects didn't always
work correctly. Found by improved unittests.

- Using NSArchiver or NSKeyedArchiver to encode and decode bytes objects in Python 3 would
result in an instance of NSData instead of bytes.

- The implementation of cmp() for NSSet instances now matches the behavior of regular python
sets, that is calling ``cmp(anNSSet, aValue)`` will raise a TypeError exception unless
both arguments are the same object (``anNSSet is aValue``).

- :issue:`36`: explicitly document that PyObjC does not support the Objective-C Garbage Collection
system (introduced in OSX 10.5, deprecated in OSX 10.8), and also mention this in the
documentation for the screen saver framework because the screen saver engine uses GC on
OSX 10.6 and 10.7.

- :issue:`37`: Fix runtime link error with EPD (Enthought Python Distribution),
which doesn't include the pymactoolbox functionality.

- Various improvements to the documentation

2.4.1

-------------

.. note:: 2.41 was never released, all bugfixes are in the 2.4 branch as well as the 2.5 release.

- Cocoa wrappers: fix metadata for ``copy``, ``mutableCopy``,
``copyWithZone:`` and ``mutableCopyWithZone:``

- Fix for issue 3585235 on SourceForge: the threading helper category on
NSObject didn't work due to a typo (defined in the Cocoa bindings)

Fix is based on a patch by "Kentzo" with further updates and tests by
Ronald.

- Rename ReadMe.txt to README.txt to work around misfeature in the
sdist command in distutils.

- :issue:`28`: Avoid crash when using CGEventTabProxy values.

- :issue:`33`: "easy_install pyobjc" no longer tries to install the
InterfaceBuilderKit bindings on OSX 10.7 or later.

Page 11 of 18

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.