From 566e370063c569876974f1f0c8c000385b9d0a9a Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 24 Apr 2023 14:12:06 -0600 Subject: [PATCH] README: Updates re NamedTuple and TypedDict Followup to #150 --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 59d5d3d0..d98027e9 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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=`,