[issue44109] missing dataclass decorator in match-statement example
New submission from Ahmet Burak
Change by Brandt Bucher
Brandt Bucher
p = Point() p.x = 0 p.y = 0
Sure, it would help to have an __init__ defined in real code, but I sort of feel like adding it to this example would just distract (especially since the example doesn't actually *need* it).
Thoughts from others?
----------
_______________________________________
Python tracker
Raymond Hettinger
Thoughts from others?
As it stands, the Point class is weird and atypical by only using class variables. The example would be improved by adding @dataclass or inheriting from typing.NamedTuple.
----------
nosy: +rhettinger
_______________________________________
Python tracker
Eric V. Smith
Andrei Kulakov
Andrei Kulakov
participants (5)
-
Ahmet Burak
-
Andrei Kulakov
-
Brandt Bucher
-
Eric V. Smith
-
Raymond Hettinger