{"id":6102,"library":"pyobjc-framework-executionpolicy","title":"PyObjC Framework ExecutionPolicy","description":"PyObjC is a bridge between Python and Objective-C, enabling Python scripts to interact with macOS frameworks and Cocoa libraries. This specific package, `pyobjc-framework-executionpolicy`, provides Python bindings for Apple's ExecutionPolicy framework. It is actively maintained with releases frequently updated to support new macOS SDKs and Python versions. The current version is 12.1.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","cocoa","bindings","framework","pyobjc","executionpolicy"],"install":[{"cmd":"pip install pyobjc-framework-executionpolicy","lang":"bash","label":"Install pyobjc-framework-executionpolicy"}],"dependencies":[{"reason":"Provides the core Python to Objective-C bridge functionality that all framework wrappers rely on.","package":"pyobjc-core"}],"imports":[{"note":"Framework classes, functions, and constants are imported directly from the package named after the framework.","symbol":"ExecutionPolicy","correct":"from ExecutionPolicy import *"}],"quickstart":{"code":"import objc\nfrom Foundation import NSString, NSLog\nfrom ExecutionPolicy import *\n\ndef main():\n    # Example using Foundation, as direct ExecutionPolicy framework usage\n    # often requires specific macOS context and knowledge of its APIs.\n    hello_string = NSString.stringWithString_(\"Hello from PyObjC and ExecutionPolicy context!\")\n    NSLog(\"%@\", hello_string)\n\n    # To interact with the ExecutionPolicy framework, you would typically\n    # call specific functions or instantiate classes from the 'ExecutionPolicy'\n    # module, according to Apple's documentation for the framework.\n    # For example, if a function 'EPCopyAssessmentInfo' exists:\n    # try:\n    #     info = EPCopyAssessmentInfo(\"/Applications/Safari.app\")\n    #     NSLog(\"Assessment Info: %@\", info)\n    # except Exception as e:\n    #     NSLog(\"Could not get assessment info: %@\", str(e))\n\nif __name__ == \"__main__\":\n    main()","lang":"python","description":"This quickstart demonstrates the general PyObjC import pattern for a framework, using `Foundation` for a simple interaction. To utilize the `ExecutionPolicy` framework specifically, you would import its relevant classes and functions and interact with them as per Apple's ExecutionPolicy API documentation."},"warnings":[{"fix":"Upgrade your Python environment to Python 3.10 or a later supported version.","message":"PyObjC 12.0 dropped support for Python 3.9. Projects using older Python versions must upgrade to 3.10 or newer.","severity":"breaking","affected_versions":">=12.0"},{"fix":"Upgrade your Python environment to Python 3.9 or a later supported version.","message":"PyObjC 11.0 dropped support for Python 3.8. Projects using this version must upgrade their Python environment.","severity":"breaking","affected_versions":">=11.0, <12.0"},{"fix":"Review any custom Objective-C initializer methods implemented in Python subclasses to ensure correct reference handling in line with ARC principles.","message":"PyObjC 11.1 aligned its Automatic Reference Counting (ARC) behavior for 'init' family methods to strictly follow `clang`'s documentation. This change affects how references to 'self' are managed by initializer methods, which now steal a reference to self and return a new one.","severity":"breaking","affected_versions":">=11.1"},{"fix":"Be aware that KVO functionality will not be available for Python-defined `NSProxy` subclasses. Implement custom observation mechanisms if needed.","message":"PyObjC automatically disables Key-Value Observing (KVO) for subclasses of `NSProxy` defined in Python.","severity":"gotcha","affected_versions":">=12.1"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}