IFT-510 Use example with shorter warning description in the Python Editor Coding Assistance lesson

GitOrigin-RevId: d61c65000f4438c5fb79299da60967702d141f6e
This commit is contained in:
Konstantin Hudyakov
2023-11-01 16:42:05 +02:00
committed by intellij-monorepo-bot
parent bfd585611d
commit f8397c28f2
2 changed files with 9 additions and 5 deletions

View File

@@ -4,13 +4,17 @@ import random
class Cat:
happiness = math.exp(3)
def say_meow(self):
print("meow")
def meow(self, words):
for word in words:
print(word)
def eat(self):
self.happiness += random.randint(5, 20)
cat = Cat()
cat.say_meow("meow")
cat.eat()
words = ("I'm", "very", "happy")
if cat.happiness < 30:
words[1] = "not"
cat.meow(words)

View File

@@ -22,10 +22,10 @@ class PythonEditorCodingAssistanceLesson(sample: LessonSample) :
private val errorAlternateIntentionText: String
get() = PyPsiBundle.message("QFIX.auto.import.import.this.name")
override val warningIntentionText: String
get() = PyPsiBundle.message("QFIX.NAME.remove.argument")
get() = PyPsiBundle.message("QFIX.NAME.make.list")
override val errorFixedText: String = "import math"
override val warningFixedText: String = "cat.say_meow()"
override val warningFixedText: String = """["I'm", "very", "happy"]"""
override val variableNameToHighlight: String = "happiness"