We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From python/typeshed#3358, CI: https://travis-ci.org/python/typeshed/jobs/597311318
Please consider the following file foo.pyi:
foo.pyi
ExceptHookArgs = NamedTuple( "ExceptHookArgs", [ ("exc_type", Type[BaseException]), ("exc_value", Optional[BaseException]), ("exc_traceback", Optional[TracebackType]), ("thread", Optional[Thread]), ], )
pytype 2019.09.17 (Python 3.7.3) complains:
$ pytype-single --parse-pyi --module-name=foo -V3.6 foo.pyi Traceback (most recent call last): File "/home/srittau/Projekte/typeshed/.venv/lib/python3.7/site-packages/pytype/pyi/parser.py", line 430, in parse defs = parser_ext.parse(self, src) pytype.pyi.parser.ParseError: ParseError: syntax error, unexpected ',', expecting ')' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./.venv/bin/pytype-single", line 11, in <module> load_entry_point('pytype==2019.9.17', 'console_scripts', 'pytype-single')() File "/home/srittau/Projekte/typeshed/.venv/lib/python3.7/site-packages/pytype/main.py", line 88, in main return _run_pytype(options) File "/home/srittau/Projekte/typeshed/.venv/lib/python3.7/site-packages/pytype/main.py", line 96, in _run_pytype unused_ast = io.parse_pyi(options) File "/home/srittau/Projekte/typeshed/.venv/lib/python3.7/site-packages/pytype/io.py", line 263, in parse_pyi ast = loader.load_file(options.module_name, options.input) File "/home/srittau/Projekte/typeshed/.venv/lib/python3.7/site-packages/pytype/load_pytd.py", line 241, in load_file python_version=self.python_version) File "/home/srittau/Projekte/typeshed/.venv/lib/python3.7/site-packages/pytype/pyi/parser.py", line 1250, in parse_file src, name, filename) File "/home/srittau/Projekte/typeshed/.venv/lib/python3.7/site-packages/pytype/pyi/parser.py", line 440, in parse column=self._error_location[1], text=text) pytype.pyi.parser.ParseError: File: "foo.pyi", line 8 ], ^ ParseError: syntax error, unexpected ',', expecting ')'
I can work around this for now, but black will re-insert the comma, so that will cause us problems in the future.
The text was updated successfully, but these errors were encountered:
Remove dangling comma to make pytype happy
51efbb3
google/pytype#434
Fix pyi parser to handle trailing commas in namedtuple definitions.
cce80f8
Fixes #434. PiperOrigin-RevId: 274881013
3edfb3b
85fd958
rchen152
No branches or pull requests
From python/typeshed#3358, CI: https://travis-ci.org/python/typeshed/jobs/597311318
Please consider the following file
foo.pyi
:pytype 2019.09.17 (Python 3.7.3) complains:
I can work around this for now, but black will re-insert the comma, so that will cause us problems in the future.
The text was updated successfully, but these errors were encountered: