File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ def transform(self) -> None:
149
149
]
150
150
151
151
existing_method = info .get (method_name )
152
- if existing_method is not None :
152
+ if existing_method is not None and not existing_method . plugin_generated :
153
153
assert existing_method .node
154
154
ctx .api .fail (
155
155
'You may not have a custom %s method when order=True' % method_name ,
Original file line number Diff line number Diff line change @@ -624,3 +624,21 @@ class C:
624
624
x: int = dataclasses.field(default=1)
625
625
y: str = dataclasses.field(metadata={"doc": "foo"}) # E: Attributes without a default cannot follow attributes with one
626
626
[builtins fixtures/dict.pyi]
627
+
628
+ [case testDataclassOrderingDeferred]
629
+ # flags: --python-version 3.6 --new-semantic-analyzer
630
+ from dataclasses import dataclass
631
+
632
+ defer: Yes
633
+
634
+ @dataclass(order=True)
635
+ class Application:
636
+ name: str
637
+ rating: int
638
+
639
+ a = Application('', 0)
640
+ b = Application('', 0)
641
+ a < b
642
+
643
+ class Yes: ...
644
+ [builtins fixtures/list.pyi]
You can’t perform that action at this time.
0 commit comments