@@ -42,7 +42,7 @@ add new capabilities one by one.
4242Simple example: A descriptor that returns a constant
4343----------------------------------------------------
4444
45- The :class: ` Ten ` class is a descriptor whose :meth: `__get__ ` method always
45+ The `` Ten ` ` class is a descriptor whose :meth: `__get__ ` method always
4646returns the constant ``10 ``:
4747
4848.. testcode ::
@@ -215,8 +215,8 @@ Customized names
215215When a class uses descriptors, it can inform each descriptor about which
216216variable name was used.
217217
218- In this example, the :class: ` Person ` class has two descriptor instances,
219- *name * and *age *. When the :class: ` Person ` class is defined, it makes a
218+ In this example, the `` Person ` ` class has two descriptor instances,
219+ *name * and *age *. When the `` Person ` ` class is defined, it makes a
220220callback to :meth: `__set_name__ ` in *LoggedAccess * so that the field names can
221221be recorded, giving each descriptor its own *public_name * and *private_name *:
222222
@@ -253,7 +253,7 @@ be recorded, giving each descriptor its own *public_name* and *private_name*:
253253 def birthday(self):
254254 self.age += 1
255255
256- An interactive session shows that the :class: ` Person ` class has called
256+ An interactive session shows that the `` Person ` ` class has called
257257:meth: `__set_name__ ` so that the field names would be recorded. Here
258258we call :func: `vars ` to look up the descriptor without triggering it:
259259
@@ -337,7 +337,7 @@ any data, it verifies that the new value meets various type and range
337337restrictions. If those restrictions aren't met, it raises an exception to
338338prevent data corruption at its source.
339339
340- This :class: ` Validator ` class is both an :term: `abstract base class ` and a
340+ This `` Validator ` ` class is both an :term: `abstract base class ` and a
341341managed attribute descriptor:
342342
343343.. testcode ::
@@ -360,22 +360,22 @@ managed attribute descriptor:
360360 def validate(self, value):
361361 pass
362362
363- Custom validators need to inherit from :class: ` Validator ` and must supply a
364- :meth: ` validate ` method to test various restrictions as needed.
363+ Custom validators need to inherit from `` Validator ` ` and must supply a
364+ `` validate ` ` method to test various restrictions as needed.
365365
366366
367367Custom validators
368368-----------------
369369
370370Here are three practical data validation utilities:
371371
372- 1) :class: ` OneOf ` verifies that a value is one of a restricted set of options.
372+ 1) `` OneOf ` ` verifies that a value is one of a restricted set of options.
373373
374- 2) :class: ` Number ` verifies that a value is either an :class: `int ` or
374+ 2) `` Number ` ` verifies that a value is either an :class: `int ` or
375375 :class: `float `. Optionally, it verifies that a value is between a given
376376 minimum or maximum.
377377
378- 3) :class: ` String ` verifies that a value is a :class: `str `. Optionally, it
378+ 3) `` String ` ` verifies that a value is a :class: `str `. Optionally, it
379379 validates a given minimum or maximum length. It can validate a
380380 user-defined `predicate
381381 <https://en.wikipedia.org/wiki/Predicate_(mathematical_logic)> `_ as well.
@@ -873,7 +873,7 @@ care of lookups or updates:
873873 conn.execute(self.store, [value, obj.key])
874874 conn.commit()
875875
876- We can use the :class: ` Field ` class to define `models
876+ We can use the `` Field ` ` class to define `models
877877<https://en.wikipedia.org/wiki/Database_model> `_ that describe the schema for
878878each table in a database:
879879
@@ -1140,7 +1140,7 @@ to wrap access to the value attribute in a property data descriptor:
11401140 self.recalc()
11411141 return self._value
11421142
1143- Either the built-in :func: `property ` or our :func: ` Property ` equivalent would
1143+ Either the built-in :func: `property ` or our `` Property ` ` equivalent would
11441144work in this example.
11451145
11461146
0 commit comments