Skip to content
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
README: Updates re NamedTuple and TypedDict
Followup to #150
  • Loading branch information
AlexWaygood authored Apr 24, 2023
commit 566e370063c569876974f1f0c8c000385b9d0a9a
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