Closed has2k1 closed 3 months ago
This PR fixes the issue where class variables are recognised as class parameters.
This definition
from dataclasses import dataclass from typing import ClassVar @dataclass class Point: x: float y: float z: ClassVar[float] = 3
is equivalent to
class Point: z: float = 3 def __init__(self, x: float, y: float): self.x = x self.y = y
The signature is Point(x, y) and neither Point(x, y, z) or Point(x, y, z=3).
Point(x, y)
Point(x, y, z)
Point(x, y, z=3)
This PR fixes the issue where class variables are recognised as class parameters.
This definition
is equivalent to
The signature is
Point(x, y)
and neitherPoint(x, y, z)
orPoint(x, y, z=3)
.