Skip to content

Commit 0273a6e

Browse files
authored
README: Updates re NamedTuple and TypedDict (#155)
Followup to #150
1 parent 1f98818 commit 0273a6e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ Certain objects were changed after they were added to `typing`, and
127127
about which (if any) keys are non-required in Python 3.8, and does not
128128
honor the `total` keyword with old-style `TypedDict()` in Python
129129
3.9.0 and 3.9.1. `TypedDict` also does not support multiple inheritance
130-
with `typing.Generic` on Python <3.11.
130+
with `typing.Generic` on Python <3.11, and `TypedDict` classes do not
131+
consistently have the `__orig_bases__` attribute on Python <3.12. The
132+
`typing_extensions` backport provides all of these features and bugfixes on
133+
all Python versions.
131134
- `get_origin` and `get_args` lack support for `Annotated` in
132135
Python 3.8 and lack support for `ParamSpecArgs` and `ParamSpecKwargs`
133136
in 3.9.
@@ -137,7 +140,9 @@ Certain objects were changed after they were added to `typing`, and
137140
`typing_extensions.get_overloads()`, you must use
138141
`@typing_extensions.overload`.
139142
- `NamedTuple` was changed in Python 3.11 to allow for multiple inheritance
140-
with `typing.Generic`.
143+
with `typing.Generic`. Call-based `NamedTuple`s were changed in Python 3.12
144+
so that they have an `__orig_bases__` attribute, the same as class-based
145+
`NamedTuple`s.
141146
- Since Python 3.11, it has been possible to inherit from `Any` at
142147
runtime. `typing_extensions.Any` also provides this capability.
143148
- `TypeVar` gains two additional parameters, `default=` and `infer_variance=`,

0 commit comments

Comments
 (0)