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

Type annotations issues with documentation #11

Open
1 of 2 tasks
McSinyx opened this issue Jan 9, 2020 · 1 comment
Open
1 of 2 tasks

Type annotations issues with documentation #11

McSinyx opened this issue Jan 9, 2020 · 1 comment
Labels
blocked Not our fault that this cannot be done (yet) documentation Improvements or additions to documentation

Comments

@McSinyx
Copy link
Owner

McSinyx commented Jan 9, 2020

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.

@McSinyx McSinyx added documentation Improvements or additions to documentation blocked Not our fault that this cannot be done (yet) labels Jan 9, 2020
@McSinyx
Copy link
Owner Author

McSinyx commented Mar 19, 2020

(1) can be solved by switching Cython binding on, once sphinx-doc/sphinx#7331 and bpo-39990 are fixed.

Edit: With the Sphinx issue being fixed, palace 0.1 will be shipped with bindings (yay!).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Not our fault that this cannot be done (yet) documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant