Skip to content

Commit

Permalink
gh-106625 : Add missing code to tutorial 4.6 example (#106623)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
RustyNail and terryjreedy authored Jul 11, 2023
1 parent 945d3cb commit d0b7e18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Doc/tutorial/controlflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d0b7e18

Please sign in to comment.