mirror of
https://github.com/github/codeql.git
synced 2025-12-19 10:23:15 +01:00
Python: Fix trailing whitespace in a single qhelp file
Since I edited already, why not get this little bonus? :D
This commit is contained in:
@@ -5,21 +5,21 @@
|
||||
|
||||
<overview>
|
||||
<p>The ability to override the class dictionary using a <code>__slots__</code> declaration
|
||||
is supported only by new-style classes. When you add a <code>__slots__</code> declaration to an
|
||||
is supported only by new-style classes. When you add a <code>__slots__</code> declaration to an
|
||||
old-style class it just creates a class attribute called <code>__slots__</code>.</p>
|
||||
|
||||
</overview>
|
||||
<recommendation>
|
||||
|
||||
<p>If you want to override the dictionary for a class, then ensure that the class is a new-style class.
|
||||
<p>If you want to override the dictionary for a class, then ensure that the class is a new-style class.
|
||||
You can convert an old-style class to a new-style class by inheriting from <code>object</code>.</p>
|
||||
|
||||
</recommendation>
|
||||
<example>
|
||||
<p>In the following example the <code>KeyedRef</code> class is an old-style class (no inheritance). The
|
||||
dictionary is unaffected. The <code>KeyedRef2</code> class is a new-style class so the
|
||||
<code>__slots__</code> declaration causes special compact attributes to be created for each name in
|
||||
<p>In the following example the <code>KeyedRef</code> class is an old-style class (no inheritance). The
|
||||
<code>__slots__</code> declaration in this class creates a class attribute called <code>__slots__</code>, the class
|
||||
dictionary is unaffected. The <code>KeyedRef2</code> class is a new-style class so the
|
||||
<code>__slots__</code> declaration causes special compact attributes to be created for each name in
|
||||
the slots list and saves space by not creating attribute dictionaries.</p>
|
||||
|
||||
<sample src="SlotsInOldStyleClass.py" />
|
||||
@@ -28,7 +28,7 @@ the slots list and saves space by not creating attribute dictionaries.</p>
|
||||
<references>
|
||||
|
||||
<li>Python Glossary: <a href="http://docs.python.org/glossary.html#term-new-style-class">New-style class</a>.</li>
|
||||
<li>Python Language Reference: <a href="http://docs.python.org/2/reference/datamodel.html#newstyle">New-style and classic
|
||||
<li>Python Language Reference: <a href="http://docs.python.org/2/reference/datamodel.html#newstyle">New-style and classic
|
||||
classes</a>,
|
||||
<a href="http://docs.python.org/reference/datamodel.html#__slots__">__slots__</a>.</li>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user