Message393607
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 actually defined).
Note that none of the example snippets actually *create* Point instances. Rather, some of the patterns *match* Point instances... which is sort of the opposite of instantiation.
As the Point class is currently written, instantiation would probably look like:
>>> 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? |
|
Date |
User |
Action |
Args |
2021-05-13 21:21:44 | brandtbucher | set | recipients:
+ brandtbucher, docs@python, ahmetveburak |
2021-05-13 21:21:44 | brandtbucher | set | messageid: <1620940904.47.0.667096703.issue44109@roundup.psfhosted.org> |
2021-05-13 21:21:44 | brandtbucher | link | issue44109 messages |
2021-05-13 21:21:44 | brandtbucher | create | |
|