@@ -112,7 +112,7 @@ different, updated answers each time::
112112Besides showing how descriptors can run computations, this example also
113113reveals the purpose of the parameters to :meth: `__get__ `. The *self *
114114parameter is *size *, an instance of *DirectorySize *. The *obj * parameter is
115- either *g * or *s *, an instance of *Directory *. It is *obj * parameter that
115+ either *g * or *s *, an instance of *Directory *. It is the *obj * parameter that
116116lets the :meth: `__get__ ` method learn the target directory. The *objtype *
117117parameter is the class *Directory *.
118118
@@ -183,7 +183,7 @@ logged, but that the regular attribute *name* is not logged::
183183 INFO:root:Accessing 'age' giving 40
184184 40
185185
186- One major issue with this example is the private name *_age * is hardwired in
186+ One major issue with this example is that the private name *_age * is hardwired in
187187the *LoggedAgeAccess * class. That means that each instance can only have one
188188logged attribute and that its name is unchangeable. In the next example,
189189we'll fix that problem.
@@ -192,7 +192,7 @@ we'll fix that problem.
192192Customized names
193193----------------
194194
195- When a class uses descriptors, it can inform each descriptor about what
195+ When a class uses descriptors, it can inform each descriptor about which
196196variable name was used.
197197
198198In this example, the :class: `Person ` class has two descriptor instances,
@@ -233,7 +233,7 @@ be recorded, giving each descriptor its own *public_name* and *private_name*::
233233
234234An interactive session shows that the :class: `Person ` class has called
235235:meth: `__set_name__ ` so that the field names would be recorded. Here
236- we call :func: `vars ` to lookup the descriptor without triggering it::
236+ we call :func: `vars ` to look up the descriptor without triggering it::
237237
238238 >>> vars(vars(Person)['name'])
239239 {'public_name': 'name', 'private_name': '_name'}
@@ -614,8 +614,8 @@ Sometimes it is desirable for a descriptor to know what class variable name it
614614was assigned to. When a new class is created, the :class: `type ` metaclass
615615scans the dictionary of the new class. If any of the entries are descriptors
616616and if they define :meth: `__set_name__ `, that method is called with two
617- arguments. The *owner * is the class where the descriptor is used, the * name *
618- is class variable the descriptor was assigned to.
617+ arguments. The *owner * is the class where the descriptor is used, and the
618+ * name * is the class variable the descriptor was assigned to.
619619
620620The implementation details are in :c:func: `type_new() ` and
621621:c:func: `set_names() ` in :source: `Objects/typeobject.c `.
@@ -703,7 +703,7 @@ Properties
703703----------
704704
705705Calling :func: `property ` is a succinct way of building a data descriptor that
706- triggers function calls upon access to an attribute. Its signature is::
706+ triggers a function call upon access to an attribute. Its signature is::
707707
708708 property(fget=None, fset=None, fdel=None, doc=None) -> property
709709
@@ -803,7 +803,7 @@ roughly equivalent to::
803803
804804To support automatic creation of methods, functions include the
805805:meth: `__get__ ` method for binding methods during attribute access. This
806- means that functions are non-data descriptors which return bound methods
806+ means that functions are non-data descriptors that return bound methods
807807during dotted lookup from an instance. Here's how it works::
808808
809809 class Function:
@@ -1016,7 +1016,7 @@ attributes stored in ``__slots__``::
10161016
10171017 class Immutable:
10181018
1019- __slots__ = ('_dept', '_name') # Replace instance dictionary
1019+ __slots__ = ('_dept', '_name') # Replace the instance dictionary
10201020
10211021 def __init__(self, dept, name):
10221022 self._dept = dept # Store to private attribute
@@ -1086,7 +1086,7 @@ by member descriptors::
10861086
10871087The :meth: `type.__new__ ` method takes care of adding member objects to class
10881088variables. The :meth: `object.__new__ ` method takes care of creating instances
1089- that have slots instead of a instance dictionary. Here is a rough equivalent
1089+ that have slots instead of an instance dictionary. Here is a rough equivalent
10901090in pure Python::
10911091
10921092 class Type(type):
0 commit comments