-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed as duplicate of#142214
Closed as duplicate of#142214
Copy link
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-dataclassestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Reproducible with:
from dataclasses import dataclass
@dataclass(init=False, slots=True)
class SomeClass:
test: intStack trace:
Traceback (most recent call last):
File ".../reproduce_issue.py", line 4, in <module>
@dataclass(init=False, slots=True)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/[email protected]/3.14.1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/dataclasses.py", line 1426, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
frozen, match_args, kw_only, slots,
weakref_slot)
File "/opt/homebrew/Cellar/[email protected]/3.14.1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/dataclasses.py", line 1234, in _process_class
cls = _add_slots(cls, frozen, weakref_slot, fields)
File "/opt/homebrew/Cellar/[email protected]/3.14.1/Frameworks/Python.framework/Versions/3.14/lib/python3.14/dataclasses.py", line 1401, in _add_slots
init_annotate = newcls.__init__.__annotate__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'wrapper_descriptor' object has no attribute '__annotate__'. Did you mean: '__getstate__'?
CPython versions tested on:
3.14
Operating systems tested on:
macOS
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-dataclassestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error