We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7795c9b commit 37d9b3cCopy full SHA for 37d9b3c
Lib/test/test_dataclasses/__init__.py
@@ -2532,6 +2532,17 @@ class D:
2532
{"d": "list[undefined]", "return": "None"}
2533
)
2534
2535
+ # Check that __annotate__ is not replaced on non-generated __init__ functions
2536
+ @dataclass
2537
+ class E:
2538
+ x: str
2539
+ def __init__(self, x: int) -> None:
2540
+ self.x = x
2541
+
2542
+ self.assertEqual(
2543
+ annotationlib.get_annotations(E.__init__), {"x": int, "return": None}
2544
+ )
2545
2546
2547
class TestRepr(unittest.TestCase):
2548
def test_repr(self):
0 commit comments