mirror of
https://github.com/github/codeql.git
synced 2026-01-14 06:54:48 +01:00
30 lines
704 B
XML
30 lines
704 B
XML
<!DOCTYPE qhelp PUBLIC
|
|
"-//Semmle//qhelp//EN"
|
|
"qhelp.dtd">
|
|
<qhelp>
|
|
<overview>
|
|
<p>
|
|
Subclasses should not set attributes that are set in the superclass.
|
|
Doing so may violate invariants in the superclass. </p>
|
|
|
|
</overview>
|
|
<recommendation>
|
|
|
|
<p>
|
|
If you did not intend to override the attribute value set in the superclass,
|
|
then rename the subclass attribute.
|
|
If you do want to be able to set a new value for the attribute of the superclass,
|
|
then convert the superclass attribute to a property.
|
|
Otherwise the value should be passed as a parameter to the superclass
|
|
<code>__init__</code> method.
|
|
</p>
|
|
|
|
</recommendation>
|
|
<example>
|
|
<sample src="OverwritingAttributeInSuperClass.py" />
|
|
|
|
|
|
|
|
</example>
|
|
</qhelp>
|