Add some text that Talin suggested.

This commit is contained in:
Guido van Rossum 2007-04-23 23:37:29 +00:00
parent 56b10379a9
commit f9b3dff1fb
1 changed files with 13 additions and 3 deletions

View File

@ -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