From 5ae5842fa02021e086d66218d326c708e6433318 Mon Sep 17 00:00:00 2001 From: Dani Alcala <112832187+clavedeluna@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:51:36 -0300 Subject: Add documentation some refactor messages (#7731) Co-authored-by: Pierre Sassoulas --- doc/data/messages/s/self-cls-assignment/bad.py | 9 +++++++++ doc/data/messages/s/self-cls-assignment/details.rst | 1 - doc/data/messages/s/self-cls-assignment/good.py | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 doc/data/messages/s/self-cls-assignment/bad.py delete mode 100644 doc/data/messages/s/self-cls-assignment/details.rst (limited to 'doc/data/messages/s/self-cls-assignment') 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 `_ ! 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) -- cgit v1.2.1