mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-38605: Revert making 'from __future__ import annotations' the default (GH-25490)
This reverts commits044a1048ca
and1be456ae9d
, adapting the code to changes that happened after it.
This commit is contained in:
parent
d35eef3b90
commit
b0544ba77c
32 changed files with 436 additions and 523 deletions
|
@ -617,7 +617,7 @@ class TestUpdateWrapper(unittest.TestCase):
|
|||
|
||||
|
||||
def _default_update(self):
|
||||
def f(a: int):
|
||||
def f(a:'This is a new annotation'):
|
||||
"""This is a test"""
|
||||
pass
|
||||
f.attr = 'This is also a test'
|
||||
|
@ -634,7 +634,7 @@ class TestUpdateWrapper(unittest.TestCase):
|
|||
self.assertEqual(wrapper.__name__, 'f')
|
||||
self.assertEqual(wrapper.__qualname__, f.__qualname__)
|
||||
self.assertEqual(wrapper.attr, 'This is also a test')
|
||||
self.assertEqual(wrapper.__annotations__['a'], 'int')
|
||||
self.assertEqual(wrapper.__annotations__['a'], 'This is a new annotation')
|
||||
self.assertNotIn('b', wrapper.__annotations__)
|
||||
|
||||
@unittest.skipIf(sys.flags.optimize >= 2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue