Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
030d6581
Commit
030d6581
authored
Oct 22, 2009
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder __slots__ fine print and add a clarification.
parent
c5026f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+4
-4
No files found.
Doc/reference/datamodel.rst
View file @
030d6581
...
...
@@ -1675,15 +1675,15 @@ Notes on using *__slots__*
*__slots__*; otherwise, the class attribute would overwrite the descriptor
assignment.
* The action of a *__slots__* declaration is limited to the class where it is
defined. As a result, subclasses will have a *__dict__* unless they also define
*__slots__* (which must only contain names of any *additional* slots).
* If a class defines a slot also defined in a base class, the instance variable
defined by the base class slot is inaccessible (except by retrieving its
descriptor directly from the base class). This renders the meaning of the
program undefined. In the future, a check may be added to prevent this.
* The action of a *__slots__* declaration is limited to the class where it is
defined. As a result, subclasses will have a *__dict__* unless they also define
*__slots__*.
* Nonempty *__slots__* does not work for classes derived from "variable-length"
built-in types such as :class:`long`, :class:`str` and :class:`tuple`.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment