mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
Co-authored-by: Heinz-Alexander Fuetterer <35225576+afuetterer@users.noreply.github.com>
This commit is contained in:
parent
8c7fadb9bf
commit
a023de65fc
5 changed files with 5 additions and 5 deletions
|
@ -1233,7 +1233,7 @@ These can be used as types in annotations. They all support subscription using
|
||||||
completely disables typechecking for a function or class.
|
completely disables typechecking for a function or class.
|
||||||
|
|
||||||
The responsibility of how to interpret the metadata
|
The responsibility of how to interpret the metadata
|
||||||
lies with the the tool or library encountering an
|
lies with the tool or library encountering an
|
||||||
``Annotated`` annotation. A tool or library encountering an ``Annotated`` type
|
``Annotated`` annotation. A tool or library encountering an ``Annotated`` type
|
||||||
can scan through the metadata elements to determine if they are of interest
|
can scan through the metadata elements to determine if they are of interest
|
||||||
(e.g., using :func:`isinstance`).
|
(e.g., using :func:`isinstance`).
|
||||||
|
|
|
@ -921,7 +921,7 @@ and improves their substitutability for lists.
|
||||||
Docstrings produced by :func:`~collections.namedtuple` can now be updated::
|
Docstrings produced by :func:`~collections.namedtuple` can now be updated::
|
||||||
|
|
||||||
Point = namedtuple('Point', ['x', 'y'])
|
Point = namedtuple('Point', ['x', 'y'])
|
||||||
Point.__doc__ += ': Cartesian coodinate'
|
Point.__doc__ += ': Cartesian coordinate'
|
||||||
Point.x.__doc__ = 'abscissa'
|
Point.x.__doc__ = 'abscissa'
|
||||||
Point.y.__doc__ = 'ordinate'
|
Point.y.__doc__ = 'ordinate'
|
||||||
|
|
||||||
|
|
|
@ -1980,7 +1980,7 @@ order (MRO) for bases """
|
||||||
ns = {}
|
ns = {}
|
||||||
exec(code, ns)
|
exec(code, ns)
|
||||||
number_attrs = ns["number_attrs"]
|
number_attrs = ns["number_attrs"]
|
||||||
# Warm up the the function for quickening (PEP 659)
|
# Warm up the function for quickening (PEP 659)
|
||||||
for _ in range(30):
|
for _ in range(30):
|
||||||
self.assertEqual(number_attrs(Numbers()), list(range(280)))
|
self.assertEqual(number_attrs(Numbers()), list(range(280)))
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ class TestIncompleteFrameAreInvisible(unittest.TestCase):
|
||||||
sneaky_frame_object = None
|
sneaky_frame_object = None
|
||||||
gc.enable()
|
gc.enable()
|
||||||
next(g)
|
next(g)
|
||||||
# g.gi_frame should be the the frame object from the callback (the
|
# g.gi_frame should be the frame object from the callback (the
|
||||||
# one that was *requested* second, but *created* first):
|
# one that was *requested* second, but *created* first):
|
||||||
self.assertIs(g.gi_frame, sneaky_frame_object)
|
self.assertIs(g.gi_frame, sneaky_frame_object)
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -162,7 +162,7 @@ class TestCornerCases(unittest.TestCase):
|
||||||
ns = {}
|
ns = {}
|
||||||
exec(code, ns)
|
exec(code, ns)
|
||||||
unpack_400 = ns["unpack_400"]
|
unpack_400 = ns["unpack_400"]
|
||||||
# Warm up the the function for quickening (PEP 659)
|
# Warm up the function for quickening (PEP 659)
|
||||||
for _ in range(30):
|
for _ in range(30):
|
||||||
y = unpack_400(range(400))
|
y = unpack_400(range(400))
|
||||||
self.assertEqual(y, 399)
|
self.assertEqual(y, 399)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue