Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d0b7e18

Browse files
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 <[email protected]>
1 parent 945d3cb commit d0b7e18

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/tutorial/controlflow.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,9 @@ you can use the class name followed by an argument list resembling a
307307
constructor, but with the ability to capture attributes into variables::
308308

309309
class Point:
310-
x: int
311-
y: int
310+
def __init__(self, x, y):
311+
self.x = x
312+
self.y = y
312313

313314
def where_is(point):
314315
match point:

0 commit comments

Comments
 (0)