mirror of
https://github.com/python/cpython.git
synced 2025-09-08 18:01:44 +00:00
#3229 fix typo and expand notes a little
This commit is contained in:
parent
ed25b2c358
commit
f04779b59a
1 changed files with 7 additions and 6 deletions
|
@ -569,12 +569,13 @@ is equivalent to ::
|
|||
Foo = f1(arg)(f2(Foo))
|
||||
|
||||
**Programmer's note:** Variables defined in the class definition are class
|
||||
can be set in a method with ``self.name = value``. Both class and instance
|
||||
variables are accessible through the notation "``self.name``", and an instance
|
||||
variable hides a class variable with the same name when accessed in this way.
|
||||
Class variables can be used as defaults for instance variables, but using
|
||||
mutable values there can lead to unexpected results. Descriptors can be used
|
||||
to create instance variables with different implementation details.
|
||||
variables; they are shared by instances. Instance variables can be set in a
|
||||
method with ``self.name = value``. Both class and instance variables are
|
||||
accessible through the notation "``self.name``", and an instance variable hides
|
||||
a class variable with the same name when accessed in this way. Class variables
|
||||
can be used as defaults for instance variables, but using mutable values there
|
||||
can lead to unexpected results. Descriptors can be used to create instance
|
||||
variables with different implementation details.
|
||||
|
||||
.. XXX add link to descriptor docs above
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue