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 8980c84 commit fcd3e0aCopy full SHA for fcd3e0a
test-data/unit/check-dataclasses.test
@@ -2544,3 +2544,18 @@ class Base:
2544
class Child(Base):
2545
y: int
2546
[builtins fixtures/dataclasses.pyi]
2547
+
2548
+[case testDataclassDisallowAny]
2549
+# flags: --disallow-any-explicit --disallow-any-decorated
2550
2551
+from dataclasses import dataclass
2552
+from typing import Any
2553
2554
+# Ensures that when Any-typed fields end up in synthetic functions,
2555
+# those functions are not flagged since there's nothing the user can do about that
2556
+@dataclass
2557
+class C:
2558
+ a: Any # E: Explicit "Any" is not allowed
2559
2560
+[typing fixtures/typing-full.pyi]
2561
+[builtins fixtures/dataclasses.pyi]
0 commit comments