[issue44109] missing dataclass decorator in match-statement example

2021-06-26 Thread Andrei Kulakov
Andrei Kulakov added the comment: Ahmet: once there's agreement on how to fix this, would you like to work on a patch? -- ___ Python tracker ___ _

[issue44109] missing dataclass decorator in match-statement example

2021-06-25 Thread Andrei Kulakov
Andrei Kulakov added the comment: I agree the example is confusing for all of the stated reasons. It seems to me it's better to use a plain class with a `__init__()` for two reason: - for people who are not familiar with namedtuples or dataclasses, it would be harder to learn two fairly com

[issue44109] missing dataclass decorator in match-statement example

2021-05-17 Thread Eric V. Smith
Eric V. Smith added the comment: I agree with Raymond: a more useful example would use dataclasses or typing.NamedTuple. The use of class variables is unusual, and it took me a while to understand how it would work. -- nosy: +eric.smith ___ Python

[issue44109] missing dataclass decorator in match-statement example

2021-05-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: > 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 ___

[issue44109] missing dataclass decorator in match-statement example

2021-05-13 Thread Brandt Bucher
Brandt Bucher added the comment: I don't really think there is anything wrong with the documentation. I can copy-and-paste all of the code from the PEP 634 section of the 3.10 What's New into the REPL without any issues (provided that named subjects like point/points/test_variable/color are

[issue44109] missing dataclass decorator in match-statement example

2021-05-13 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue44109] missing dataclass decorator in match-statement example

2021-05-11 Thread Ahmet Burak
New submission from Ahmet Burak : Using Point class as in the documentation example, raises TypeError: Point() takes no arguments https://docs.python.org/3.10/whatsnew/3.10.html#patterns-and-classes Also there is same example in the PEP 636's latests parts, Point class used with dataclass dec