Repository navigation
Adds support for NamedTuple subtyping - #11162
Conversation
JukkaL
left a comment
There was a problem hiding this comment.
I agree with Jelle that this is a bit questionable, since NamedTuple is not a real type, but I guess it could be useful in some cases. We can mark this as an experimental feature and see what users think about it.
Can you add a test case to pythoneval.test that uses the full stdlib stubs? Try accessing various attributes that might be useful in the test case. The new behavior depends on how NamedTuple is defined in typeshed.
Also, this would have to be documented since this is a non-standard extension.
|
@JukkaL I've added both |
|
I need this change in my new semantic analyzer for namedtuples #11047 😞 |
JukkaL
left a comment
There was a problem hiding this comment.
Sorry for the late review! A few more minor comments.
|
Done! Docs and tests are improved 👍 |
|
@JukkaL thank you 🎉 🎉 |
Closes #11160