Replies: 2 comments 4 replies
-
Could you please provide your code sample in text form either here or in the pyright playground so I don't need to retype it from a screen shot? |
Beta Was this translation helpful? Give feedback.
4 replies
-
hello eric, yeah sure import typing
@typing.final
class Foo(typing.TypedDict, total=False):
a: int
b: int
c: list[str]
a: Foo = {'a': 1, 'b': 2, 'c': ['a', 'b']}
a.clear()
a.popitem() btw thank you for replying this promptly :D |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
pyright version: 1.1.387
python version: 3.12.7
vscode version: 1.95.0
I have searched for this issue on internet and I have found #4794 which suggests that this got fixed back in 2023 in pyright but I can reproduce this now so can someone please guide me here on what changed in pyright since then to cause this?
If I missed something else useful of context on this then please do let me know.
I have also checked the two issues mentioned in the above issue,
as well as I have also read the rationale mentioned on:
as to why
TypedDict
generally do not allowclear()
methods to safeguard us for potential aspect of destructive operations,however
my use cases of
TypedDict
in my small projects are casual enough so I do not have to account for such rationales so is there any way I can.clear()
in peace or is this a valid bug report w.r.t. pyright?Thanks for reading and have a nice day!
Beta Was this translation helpful? Give feedback.
All reactions