-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Labels
stdlibStandard 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:
from dataclasses import dataclass
from fractions import Fraction
print(Fraction('30/1'))
dataclass(Fraction)
print(Fraction('30/1'))
If the dataclass
function is called with argument Fraction
, it brokes __init__
for Fraction
output is:
30
Traceback (most recent call last):
File "/Users/tiunovnn/git/video-compression-model/web/api/src/tasks/test.py", line 6, in <module>
print(Fraction('30/1'))
~~~~~~~~^^^^^^^^
TypeError: Fraction.__init__() takes 1 positional argument but 2 were given
expected output is:
30
30
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Metadata
Metadata
Assignees
Labels
stdlibStandard 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