Skip to content

Commit

Permalink
Added message example for return-in-init (#6245)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
matusvalo and Pierre-Sassoulas committed Apr 9, 2022
1 parent e31ce35 commit 44e32ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/data/messages/r/return-in-init/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Sum:

def __init__(self, a, b): # [return-in-init]
return a + b
4 changes: 4 additions & 0 deletions doc/data/messages/r/return-in-init/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Sum:

def __init__(self, a, b) -> None:
self.result = a + b
1 change: 1 addition & 0 deletions doc/data/messages/r/return-in-init/related.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `__init__ method documentation <https://docs.python.org/3/reference/datamodel.html#object.__init__>`_

0 comments on commit 44e32ba

Please sign in to comment.