diff options
author | Matus Valo <matusvalo@users.noreply.github.com> | 2022-04-09 23:16:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-09 23:16:58 +0200 |
commit | 44e32baadff87a61f4052c4135030f3112a0a8f3 (patch) | |
tree | d6b1e6991b00bc98b30885f46e1f9326a4e90aaa | |
parent | e31ce35905811d2dcb958023aedf98f1484549fa (diff) | |
download | pylint-git-44e32baadff87a61f4052c4135030f3112a0a8f3.tar.gz |
Added message example for return-in-init (#6245)
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
-rw-r--r-- | doc/data/messages/r/return-in-init/bad.py | 4 | ||||
-rw-r--r-- | doc/data/messages/r/return-in-init/good.py | 4 | ||||
-rw-r--r-- | doc/data/messages/r/return-in-init/related.rst | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/doc/data/messages/r/return-in-init/bad.py b/doc/data/messages/r/return-in-init/bad.py new file mode 100644 index 000000000..70fc2d0fd --- /dev/null +++ b/doc/data/messages/r/return-in-init/bad.py @@ -0,0 +1,4 @@ +class Sum: + + def __init__(self, a, b): # [return-in-init] + return a + b diff --git a/doc/data/messages/r/return-in-init/good.py b/doc/data/messages/r/return-in-init/good.py new file mode 100644 index 000000000..ef8e6e09b --- /dev/null +++ b/doc/data/messages/r/return-in-init/good.py @@ -0,0 +1,4 @@ +class Sum: + + def __init__(self, a, b) -> None: + self.result = a + b diff --git a/doc/data/messages/r/return-in-init/related.rst b/doc/data/messages/r/return-in-init/related.rst new file mode 100644 index 000000000..ad537990e --- /dev/null +++ b/doc/data/messages/r/return-in-init/related.rst @@ -0,0 +1 @@ +- `__init__ method documentation <https://docs.python.org/3/reference/datamodel.html#object.__init__>`_ |