Skip to content

Commit 44e32ba

Browse files
Added message example for return-in-init (#6245)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
1 parent e31ce35 commit 44e32ba

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Sum:
2+
3+
def __init__(self, a, b): # [return-in-init]
4+
return a + b
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class Sum:
2+
3+
def __init__(self, a, b) -> None:
4+
self.result = a + b
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- `__init__ method documentation <https://docs.python.org/3/reference/datamodel.html#object.__init__>`_

0 commit comments

Comments
 (0)