Skip to content

Feature: Generate .pyi files #10

@ronaldoussoren

Description

@ronaldoussoren

This first needs a design, but it should be possible to generate .pyi files for mypy and code completion.

The hard part is how to represent objective protocols, those aren't named objects in the bindings and aren't really types. This might need a mypy plugin...

Mypy doesn't understand metaclasses, and especially not those implemented in C. A good enough solution is to use regular classes in the stub files, with "@classmethod" decorators for class methods. This causes a conflict when a class has both a class and instance method of the same name, but there shouldn't be many of those.

One other possible issue: the generated files will be huge (and will get larger when the annotations get more precise), I have no idea if that will cause problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions