mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
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:
parent
945d3cbf2e
commit
d0b7e18262
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue