`typing.NewType` docs: the future performance improvements are now in the past (#105354)

This commit is contained in:
Alex Waygood 2023-06-07 01:18:09 +01:00 committed by GitHub
parent 24af45172f
commit 5f65ff0370
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -236,9 +236,13 @@ See :pep:`484` for more details.
.. versionadded:: 3.5.2
.. versionchanged:: 3.10
``NewType`` is now a class rather than a function. There is some additional
runtime cost when calling ``NewType`` over a regular function. However, this
cost will be reduced in 3.11.0.
``NewType`` is now a class rather than a function. As a result, there is
some additional runtime cost when calling ``NewType`` over a regular
function.
.. versionchanged:: 3.11
The performance of calling ``NewType`` has been restored to its level in
Python 3.9.
Callable