Add some text that Talin suggested.
This commit is contained in:
parent
56b10379a9
commit
f9b3dff1fb
16
pep-3119.txt
16
pep-3119.txt
|
@ -101,9 +101,19 @@ certain features of that object to an external inspector. Tests are
|
|||
done using isinstance(), and the presence of a particular ABC means
|
||||
that the test has passed.
|
||||
|
||||
In addition, the ABCs define a minimal set of methods that establish
|
||||
the characteristic behavior of the type. Code that discriminates
|
||||
objects based on their ABC type can trust that those methods will
|
||||
always be present. Each of these methods are accompanied by an
|
||||
generalized abstract semantic definition that is described in the
|
||||
documentation for the ABC. These standard semantic definitions are
|
||||
not enforced, but are strongly recommended.
|
||||
|
||||
Like all other things in Python, these promises are in the nature of a
|
||||
gentlemen's agreement - which means that the language does not attempt
|
||||
to enforce that these promises are kept.
|
||||
gentlemen's agreement, which in this case means that while the
|
||||
language does enforce some of the promises made in the ABC, it is up
|
||||
to the implementer of the concrete class to insure that the remaining
|
||||
ones are kept.
|
||||
|
||||
|
||||
Specification
|
||||
|
@ -150,7 +160,7 @@ ABCs:
|
|||
The exception raised when attempting to instantiate an abstract
|
||||
class. It derives from ``TypeError``.
|
||||
|
||||
**Open issues:**
|
||||
**Open issues:**
|
||||
|
||||
* Implementing the prohibition on instantiation may weigh down
|
||||
instance creation of popular built-in classes like ``tuple`` or
|
||||
|
|
Loading…
Reference in New Issue