gh-106625 : Add missing code to tutorial 4.6 example (#106623)

* Added missing import statement.

* Update Doc/tutorial/controlflow.rst

* Update Doc/tutorial/controlflow.rst

* Update controlflow.rst

* Make point regular class with __init__.

---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
This commit is contained in:
RustyNail 2023-07-12 02:22:07 +09:00 committed by GitHub
parent 945d3cbf2e
commit d0b7e18262
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -307,8 +307,9 @@ you can use the class name followed by an argument list resembling a
constructor, but with the ability to capture attributes into variables::
class Point:
x: int
y: int
def __init__(self, x, y):
self.x = x
self.y = y
def where_is(point):
match point: