-
-
Couldn't load subscription status.
- Fork 33.2k
Closed
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class Foo[T]:
pass
foo = Foo() # this line works
foo = Foo[int]() # this one does notTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.12/typing.py", line 1142, in __call__
result.__orig_class__ = self
^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 5, in __setattr__
TypeError: super(type, obj): obj must be an instance or subtype of typePython 3.12.2 (main, Feb 21 2024, 00:00:00) [GCC 13.2.1 20231205 (Red Hat 13.2.1-6)]
CPython versions tested on:
3.12
Operating systems tested on:
Linux
iskyd and MarcoMazzoni
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error