Some stupid mechanical changes, such as remove trailing whitespace,

double spaces between sentences.  Also fix a few typos, add an XXX
note, and change the URL for the implementation to be the patch
detail page instead of the download page.

I hope Neil doesn't mind.
This commit is contained in:
Guido van Rossum 2000-12-12 02:00:37 +00:00
parent a2abf8d660
commit 633ca5bb61
1 changed files with 62 additions and 61 deletions

View File

@ -20,10 +20,10 @@ Abstract
indicate it by returning a new singleton object. Types which do not
set the type flag are handled in a backwards compatible manner.
Allowing operations handle different types is often simpler, more
flexible, and faster then having the interpreter do coercion.
flexible, and faster than having the interpreter do coercion.
Rational
Rationale
When implementing numeric or other related operations, it is often
desirable to provide not only operations between operands of one type
@ -103,10 +103,10 @@ Specification
introduced. This layer takes care of all the different cases that need
to be taken into account when dealing with all the possible
combinations of old and new style numbers. It is implemented by the
two functions _PyNumber_BinaryOperation() and
_PyNumber_TernaryOperation(), which both are internal functions that
only the functions in Objects/abstract.c have access to. The numeric
API (PyNumber_*) is easy to adapt to this new layer.
two static functions binary_op() and ternary_op(), which are both
internal functions that only the functions in Objects/abstract.c
have access to. The numeric API (PyNumber_*) is easy to adapt to
this new layer.
As a side-effect all numeric slots can be NULL-checked (this has to be
done anyway, so the added feature comes at no extra cost).
@ -174,8 +174,9 @@ Specification
This slot should compare the two objects and return an integer object
stating the result. Currently, this result integer may only be -1, 0,
1. If the slot cannot handle the type combination, it may return a
reference to Py_NotImplemented. Note that this slot is still in flux
since it should take into account rich comparisons (ie. PEP 207).
reference to Py_NotImplemented. [XXX Note that this slot is still
in flux since it should take into account rich comparisons
(i.e. PEP 207).]
Numeric comparisons are handled by a new numeric protocol API:
@ -216,7 +217,7 @@ Copyright
References
[1] http://www.lemburg.com/files/python/mxDateTime.html
[2] http://sourceforge.net/patch/download.php?id=102652
[2] http://sourceforge.net/patch/?func=detailpatch&patch_id=102652&group_id=5470
[3] http://www.lemburg.com/files/python/CoercionProposal.html