diff --git a/doc/data/messages/a/attribute-defined-outside-init/bad.py b/doc/data/messages/a/attribute-defined-outside-init/bad.py new file mode 100644 index 0000000000..e62884d497 --- /dev/null +++ b/doc/data/messages/a/attribute-defined-outside-init/bad.py @@ -0,0 +1,3 @@ +class Student: + def register(self): + self.is_registered = True # [attribute-defined-outside-init] diff --git a/doc/data/messages/a/attribute-defined-outside-init/good.py b/doc/data/messages/a/attribute-defined-outside-init/good.py new file mode 100644 index 0000000000..cc7d7acb18 --- /dev/null +++ b/doc/data/messages/a/attribute-defined-outside-init/good.py @@ -0,0 +1,6 @@ +class Student: + def __init__(self): + self.is_registered = False + + def register(self): + self.is_registered = True