-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP use typed version of namedtuple #40531
New issue
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
Comments
better to use a dataclass |
Is that always true? Immutability is a nice property, I'd have thought we wouldn't want to lose that |
Im also waiting for pandas to adopt |
at the time of writing, I wasn't aware that dataclasses could use |
take |
Hi @franslarsson - still working on this? |
Hi @MarcoGorelli |
* TYP: Replace namedtuple with dataclass #40531 * Fixes from pre-commit [automated commit] * noop Co-authored-by: MarcoGorelli <[email protected]>
…3107) * TYP: Replace namedtuple with dataclass pandas-dev#40531 * Fixes from pre-commit [automated commit] * noop Co-authored-by: MarcoGorelli <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Instead of
we can do
The advantage is that like this we can add type hints to the various elements, such as
See https://docs.python.org/3/library/typing.html#typing.NamedTuple for reference
The text was updated successfully, but these errors were encountered: