Thanks to visit codestin.com
Credit goes to github.com

Skip to content

README: Updates re NamedTuple and TypedDict #155

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

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ Certain objects were changed after they were added to `typing`, and
about which (if any) keys are non-required in Python 3.8, and does not
honor the `total` keyword with old-style `TypedDict()` in Python
3.9.0 and 3.9.1. `TypedDict` also does not support multiple inheritance
with `typing.Generic` on Python <3.11.
with `typing.Generic` on Python <3.11, and `TypedDict` classes do not
consistently have the `__orig_bases__` attribute on Python <3.12. The
`typing_extensions` backport provides all of these features and bugfixes on
all Python versions.
- `get_origin` and `get_args` lack support for `Annotated` in
Python 3.8 and lack support for `ParamSpecArgs` and `ParamSpecKwargs`
in 3.9.
Expand All @@ -137,7 +140,9 @@ Certain objects were changed after they were added to `typing`, and
`typing_extensions.get_overloads()`, you must use
`@typing_extensions.overload`.
- `NamedTuple` was changed in Python 3.11 to allow for multiple inheritance
with `typing.Generic`.
with `typing.Generic`. Call-based `NamedTuple`s were changed in Python 3.12
so that they have an `__orig_bases__` attribute, the same as class-based
`NamedTuple`s.
- Since Python 3.11, it has been possible to inherit from `Any` at
runtime. `typing_extensions.Any` also provides this capability.
- `TypeVar` gains two additional parameters, `default=` and `infer_variance=`,
Expand Down