diff options
author | RustyNail <takonoyawarakaage@yahoo.co.jp> | 2023-07-11 17:22:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-11 17:22:07 (GMT) |
commit | d0b7e18262e69dd4b8252e804e4f98fc9533bcd6 (patch) | |
tree | 52a84c5ee6027e759950e429ac0ff33949fa5731 /Doc/tutorial | |
parent | 945d3cbf2e8e756ed16c3ec51106e6157abb2698 (diff) | |
download | cpython-d0b7e18262e69dd4b8252e804e4f98fc9533bcd6.zip cpython-d0b7e18262e69dd4b8252e804e4f98fc9533bcd6.tar.gz cpython-d0b7e18262e69dd4b8252e804e4f98fc9533bcd6.tar.bz2 |
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>
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/controlflow.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index c9b3d98..4336bf5 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -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: |