-
Notifications
You must be signed in to change notification settings - Fork 239
Closed
Closed
Copy link
Labels
Description
Describe the Bug
The following program raises an unexpected error:
from typing import ClassVar
import dataclasses
@dataclasses.dataclass
class MyDataClass:
replace: ClassVar = dataclasses.replace
# ERROR Missing argument `replace` in function `MyDataClass.__init__` [missing-argument]
MyDataClass(x=0)Since the replace attribute is annotated as ClassVar it should not be considered for __init__. I see that ClassVar is handed correctly in some cases (e.g. if I remove the assignment or use an assignment like = 5), but it seems that specifically assigning a function throws it off.
Sandbox Link
(Only applicable for extension issues) IDE Information
No response