Skip to content

Commit 86da9b8

Browse files
committed
Include comment indicating the issue with VALUE annotations should ideally be resolved.
1 parent 30512bd commit 86da9b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_dataclasses/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,8 +2579,11 @@ def __init__(self, x: int) -> None:
25792579
self.assertFalse(hasattr(E.__init__.__annotate__, "_generated_by_dataclasses"))
25802580

25812581
def test_init_false_forwardref(self):
2582-
# Currently this raises a NameError even though the ForwardRef
2583-
# is not in the __init__ method
2582+
# Test forward references in fields not required for __init__ annotations.
2583+
2584+
# At the moment this raises a NameError for VALUE annotations even though the
2585+
# undefined annotation is not required for the __init__ annotations.
2586+
# Ideally this will be fixed but currently there is no good way to resolve this
25842587

25852588
@dataclass
25862589
class F:

0 commit comments

Comments
 (0)