File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,11 +58,17 @@ class DC2:
5858 z : Desc2 [str ] = Desc2 ()
5959
6060
61- assert_type (DC2 .x , list [int ])
62- assert_type (DC2 .y , list [str ])
63- assert_type (DC2 .z , list [str ])
64-
65- dc2 = DC2 (Desc2 (), Desc2 (), Desc2 ())
66- assert_type (dc2 .x , int )
67- assert_type (dc2 .y , str )
68- assert_type (dc2 .z , str )
61+ # Runtime behavior involving non-data descriptors in dataclasses is
62+ # currently under-specified and differs across type checkers and runtime
63+ # implementations.
64+ #
65+ # In particular:
66+ # - DC2.x and DC2.y raise AttributeError at runtime because no descriptor
67+ # instance is stored in the class dictionary for those fields.
68+ # - dc2.x and dc2.y evaluate to the stored Desc2 instances because
69+ # non-data descriptors are shadowed by instance attributes.
70+ # - The behavior for z is also subtle because dataclasses access the
71+ # descriptor during default extraction.
72+ #
73+ # These cases are therefore omitted from the conformance suite until the
74+ # expected behavior is specified more clearly.
You can’t perform that action at this time.
0 commit comments