{"id":6103,"library":"pyobjc-framework-extensionkit","title":"PyObjC ExtensionKit Framework","description":"This package provides Python wrappers for Apple's ExtensionKit framework on macOS. It is part of the broader PyObjC project, which acts as a bidirectional bridge allowing Python scripts to interact with Objective-C libraries, including macOS Cocoa frameworks. The current version is 12.1, and the project maintains a consistent release cadence, often aligning with new macOS SDKs and Python version support.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","cocoa","objective-c","framework","extensionkit","apple"],"install":[{"cmd":"pip install pyobjc-framework-extensionkit","lang":"bash","label":"Install pyobjc-framework-extensionkit"}],"dependencies":[{"reason":"Provides the core Python-Objective-C bridge functionality required by all PyObjC framework wrappers.","package":"pyobjc-core","optional":false},{"reason":"ExtensionKit often relies on fundamental types and services provided by the Cocoa framework.","package":"pyobjc-framework-Cocoa","optional":false}],"imports":[{"note":"PyObjC framework wrappers are typically imported as top-level modules named after the framework.","symbol":"ExtensionKit","correct":"import ExtensionKit"}],"quickstart":{"code":"import ExtensionKit\nimport objc\n\nprint(f\"Successfully imported ExtensionKit wrapper from PyObjC.\")\n\n# In a real macOS application development scenario, ExtensionKit types\n# (like EXExtension, EXExtensionContext) would be used within the context\n# of defining or interacting with an application extension (e.g., share extension,\n# custom UI extension). \n#\n# A direct Python-only example demonstrating meaningful ExtensionKit\n# functionality without an accompanying Xcode project and host application\n# is not straightforward. This quickstart primarily verifies the installation\n# and import of the Python bindings for the framework.\n#\n# To see available symbols, you could inspect the module:\n# print(dir(ExtensionKit))","lang":"python","description":"This quickstart verifies the successful installation and import of the `ExtensionKit` Python bindings. Practical use of `ExtensionKit` typically involves building a macOS application extension using Xcode and interacting with it programmatically, making a standalone Python-only example challenging without an external host application context."},"warnings":[{"fix":"Upgrade your Python environment to Python 3.10 or later for PyObjC 12.x. Always check `requires_python` on PyPI or the PyObjC changelog for specific version requirements.","message":"PyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped Python 3.8. Ensure your Python version is compatible with the PyObjC version you are installing.","severity":"breaking","affected_versions":"11.0, 12.0"},{"fix":"Review code that interacts with object initialization, especially custom subclasses or factory methods, to ensure correct reference handling. Explicit memory management is rarely needed in Python, but understanding the underlying Objective-C semantics is crucial for correct behavior.","message":"PyObjC 11.1 changed how initializer methods (`init` family) are modeled, now correctly reflecting that they 'steal' a reference to `self` and return a new one, as per clang's Automatic Reference Counting (ARC) documentation. This affects object lifecycle and reference counting.","severity":"breaking","affected_versions":">=11.1"},{"fix":"If experiencing issues with `__init__` and custom `__new__` implementations after upgrading to 10.3, ensure you are using 10.3.1 or later. Avoid relying on `__init__` if using PyObjC's provided `__new__` method, as detailed in the 10.3 release notes.","message":"Version 10.3 introduced a change affecting the use of `__init__` when a class or its superclasses implement a custom `__new__` method, causing it to break. This was partially reverted in version 10.3.1 to reintroduce the ability to use `__init__` in such cases.","severity":"gotcha","affected_versions":"10.3"},{"fix":"For `objc.classAddMethods`, ensure the added methods are appropriate for Objective-C method dispatch. Review and adapt code that uses `objc.classAddMethods` with complex callable types.","message":"`objc.classAddMethods` no longer supports arbitrary callable objects for adding methods to Objective-C classes.","severity":"breaking","affected_versions":">=12.1"},{"fix":"Stay informed about macOS framework deprecations. If migrating to a new macOS version, consult the PyObjC changelog for any removed framework bindings and update your application to use alternative APIs or frameworks.","message":"Entire framework bindings may be removed if Apple deprecates and removes the underlying macOS framework. For example, the `IMServicePlugIn` bindings were removed in PyObjC 10.0 because the framework was deprecated in macOS 10.13 and removed in macOS 14.","severity":"breaking","affected_versions":"Potentially all versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}