summaryrefslogtreecommitdiff
path: root/doc/data/messages/s/self-cls-assignment
diff options
context:
space:
mode:
Diffstat (limited to 'doc/data/messages/s/self-cls-assignment')
-rw-r--r--doc/data/messages/s/self-cls-assignment/bad.py9
-rw-r--r--doc/data/messages/s/self-cls-assignment/details.rst1
-rw-r--r--doc/data/messages/s/self-cls-assignment/good.py10
3 files changed, 18 insertions, 2 deletions
diff --git a/doc/data/messages/s/self-cls-assignment/bad.py b/doc/data/messages/s/self-cls-assignment/bad.py
new file mode 100644
index 000000000..64541405f
--- /dev/null
+++ b/doc/data/messages/s/self-cls-assignment/bad.py
@@ -0,0 +1,9 @@
+class Fruit:
+ @classmethod
+ def list_fruits(cls):
+ cls = 'apple' # [self-cls-assignment]
+
+ def print_color(self, *colors):
+ self = "red" # [self-cls-assignment]
+ color = colors[1]
+ print(color)
diff --git a/doc/data/messages/s/self-cls-assignment/details.rst b/doc/data/messages/s/self-cls-assignment/details.rst
deleted file mode 100644
index ab8204529..000000000
--- a/doc/data/messages/s/self-cls-assignment/details.rst
+++ /dev/null
@@ -1 +0,0 @@
-You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !
diff --git a/doc/data/messages/s/self-cls-assignment/good.py b/doc/data/messages/s/self-cls-assignment/good.py
index c40beb573..ae8b172fa 100644
--- a/doc/data/messages/s/self-cls-assignment/good.py
+++ b/doc/data/messages/s/self-cls-assignment/good.py
@@ -1 +1,9 @@
-# This is a placeholder for correct code for this message.
+class Fruit:
+ @classmethod
+ def list_fruits(cls):
+ fruit = 'apple'
+ print(fruit)
+
+ def print_color(self, *colors):
+ color = colors[1]
+ print(color)