Skip to content
This repository was archived by the owner on Nov 21, 2020. It is now read-only.
This repository was archived by the owner on Nov 21, 2020. It is now read-only.

Type annotations issues with documentation #11

Description

@McSinyx

There are two separate issues with the type hinting in the documentation at the moment (either generated by Python's help or Sphinx):

Until these get fixed upstream, there should be work-arounds (especially for number 2, whose fix is unlikely to be backported to, say, Python 3.6 which we want to support).

If time allows, we can try to patch the first one upstream. Cython codebase is huge to study but it is not impossible.

Edit: To elaborate, the first one is caused by the signature generated by Cython when embedsignatures compiler directive is set to True, which add prepend each docstring with the function's signature (which is otherwise missing due to, welp, that's common for extension types). To work around this, we can simply turn off this directive and add the signature manually, which I find ugly but not too ugly. Another choice is to set binding=True, but currently it wraps types in single quotes, e.g. query_extension(name: 'str') -> 'bool'. I have yet to find the issue documenting that bug, maybe it's time to file the issue on Cython. As described in PEP 563, query_extension(name: 'str') -> 'bool' is totally an excepted behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedNot our fault that this cannot be done (yet)documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions