[issue32222] pygettext doesn't extract docstrings for functions with type annotated params
Change by Toby Harradine <tobyharrad...@gmail.com>: -- keywords: +patch pull_requests: +4648 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue3> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32222] pygettext doesn't extract docstrings for functions with type annotated params
Toby Harradine <tobyharrad...@gmail.com> added the comment: Another correction; I said that this is occurring for return type annotations; this is not true. This is only occurring for functions with annotated *arguments*. The cause of this issue is in pygettext's TokenEater.__suiteseen method. This method eats tokens until it sees a colon operator, after which it assumes a function docstring may follow. In the case of a function with annotated arguments, obviously this is incorrect, as colons would appear before the final colon of the 'suite'. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue3> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32222] pygettext doesn't extract docstrings for functions with type annotated params
Toby Harradine <tobyharrad...@gmail.com> added the comment: Correction for above: the type annotation syntax is actually from PEP 3107, not PEP 484. I should also point out that this behaviour is occurring for annotated return types of functions and methods as well. This is occurring on both Windows and Linux. -- Added file: https://bugs.python.org/file47318/test_returntypehinted_funcs.py ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue3> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32222] pygettext doesn't extract docstrings for functions with type annotated params
Change by Toby Harradine <tobyharrad...@gmail.com>: Added file: https://bugs.python.org/file47317/pygettext_output.pot ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue3> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32222] pygettext doesn't extract docstrings for functions with type annotated params
New submission from Toby Harradine <tobyharrad...@gmail.com>: ### Expected Behaviour When running pygettext with the -D CLI flag, all module, class, method and function docstrings should be extracted and outputted to the .pot file. ### Actual Behaviour In the case of functions whose parameters have PEP 484 type annotations, their docstrings are not being extracted. I have attached two files, one .py file and its corresponding .pot file, as examples of this behaviour. -- components: Demos and Tools files: test_typehinted_funcs.py messages: 307652 nosy: Toby Harradine priority: normal severity: normal status: open title: pygettext doesn't extract docstrings for functions with type annotated params type: behavior versions: Python 3.5, Python 3.6 Added file: https://bugs.python.org/file47316/test_typehinted_funcs.py ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue3> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com