Skip to content

Commit

Permalink
Added example for attribute-defined-outside-init
Browse files Browse the repository at this point in the history
Co-authored-by: Vladyslav Krylasov <vladyslav.krylasov@gmail.com>
  • Loading branch information
2 people authored and DanielNoord committed Mar 26, 2022
1 parent 57c6ea8 commit 3356ed4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/data/messages/a/attribute-defined-outside-init/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Student:
def register(self):
self.is_registered = True # [attribute-defined-outside-init]
6 changes: 6 additions & 0 deletions doc/data/messages/a/attribute-defined-outside-init/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Student:
def __init__(self):
self.is_registered = False

def register(self):
self.is_registered = True

0 comments on commit 3356ed4

Please sign in to comment.