Autocomplete for PyObjC in PyCharm

Answered

I have a number of reports that PyCharm autocomplete does not work for PyObjC (Python bindings for Apple Objective-C frameworks on macOS) and I wonder what I can do to ensure working autocomplete for my users.

There are two things that complicate matters:

1. The framework bindings create classes and their methods dynamically at runtime, so there is nothing that PyCharm can inspect statically to gather completion information.

2. Class methods in PyObjC's framework wrappers are not "@classmethod" descriptors on the class, but are regular methods on a meta class (primarily because Objective-C classes can have instance and class methods with the same name)

What is the best way to provide information that helps PyCharm in providing correct autocomplete information?  I'd prefer a solution that is not specific to PyCharm, for example shipping stub files for mypy, 

2 comments

Hi,

There is indeed no support for pyobjc in PyCharm. There is a corresponding feature request for it in our issue tracker https://youtrack.jetbrains.com/issue/PY-3154, please vote for it and follow for updates.

0

I've added a comment to the issue. 

Note that I'm the maintainer of PyObjC and am willing to make changes to PyObjC to make it easier to provide autocomplete support.

0

Please sign in to leave a comment.