Convert namedtuples to class syntax#3321
Conversation
|
I don't know why pytype tests fail in files that have not been changed. Cc @rchen152 |
|
As Guido pointed out in the mypy issue, we need to make sure other type checkers support this syntax in stubs first. |
|
Missing support could be the reason why pytype fails, although the error messages are a bit weird. |
|
I'll investigate the pytype failures. My first guess would be that pytype expects |
|
I have created a "deferred" label and tagged this PR with it. |
For python/typeshed#3321. PiperOrigin-RevId: 273980958
|
I've changed the pytype parser to support this syntax, but our release process is a little backed up right now - I'll update again when the change is released. |
Yesterday's release contains a number of pyi parser fixes, such as support for the syntax in #3321.
Yesterday's release contains a number of pyi parser fixes, such as support for the syntax in #3321.
JelleZijlstra
left a comment
There was a problem hiding this comment.
Looks good, but since both pytype and mypy had to do manual work to support this, we should also confirm that other consumers of typeshed support this syntax—pyre, PyCharm, and I think pyright.
|
I just checked PyCharm, and it is supported. There is also the Microsoft language server for Visual Studio Code. Cc @mrkmndz @msfterictraut Do pyre and pyright support class-based NamedTuple syntax? |
|
Yup that's supported in Pyre |
|
VSCode also supports it. |
|
It's supported in pyright also. |
|
It seems to be supported by all type checkers. Merging. |
No description provided.