Skip to content

Commit 5440128

Browse files
committed
Simplify/reduce verbosity of class in test_full_non_function_annotate()
1 parent 3bfd2e0 commit 5440128

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

Lib/test/test_annotationlib.py

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,29 +1637,13 @@ def __call__(self, format=None, *, _self=None):
16371637
return {"w": unknown, "x": MyClass, "y": int, "z": local}
16381638
raise NotImplementedError
16391639

1640-
@property
1641-
def __globals__(self):
1642-
return {"MyClass": MyClass}
1640+
__globals__ = {"MyClass": MyClass}
1641+
__builtins__ = {"int": int}
1642+
__closure__ = (types.CellType(str),)
1643+
__defaults__ = (None,)
16431644

1644-
@property
1645-
def __builtins__(self):
1646-
return {"int": int}
1647-
1648-
@property
1649-
def __closure__(self):
1650-
return (types.CellType(str),)
1651-
1652-
@property
1653-
def __defaults__(self):
1654-
return (None,)
1655-
1656-
@property
1657-
def __kwdefaults__(self):
1658-
return {"_self": self}
1659-
1660-
@property
1661-
def __code__(self):
1662-
return self.__call__.__code__
1645+
__kwdefaults__ = property(lambda self: dict(_self=self))
1646+
__code__ = property(lambda self: self.__call__.__code__)
16631647

16641648
return Annotate()
16651649

0 commit comments

Comments
 (0)