[Patches] [Patch #102652] Reference implementation for PEP 208 (coercion)

noreply@sourceforge.net noreply@sourceforge.net
Tue, 19 Dec 2000 05:49:00 -0800


Patch #102652 has been updated. 

Project: python
Category: core (C code)
Status: Open
Submitted by: nascheme
Assigned to : nascheme
Summary: Reference implementation for PEP 208 (coercion)

Follow-Ups:

Date: 2000-Dec-19 05:49
By: gvanrossum

Comment:
Neil, I may not get to reviewing this again before January, 2nd.  A quick scan suggests that you're definitely on the right way.  If you feel brave, go check it in, warts and all (and also the coercion/comparison tests you submitted as a separate patch) -- the rest of the bleeding-edge developers will help you debug it then.

-------------------------------------------------------

Date: 2000-Dec-16 16:42
By: nascheme

Comment:
Rewrote PyObject_Compare yet again. I think it finally works now.
Converted PyLongObject to use new style operations. Can someone check
the reference counting in long_pow? Its pretty tricky and I'm not sure I
got it right. Converting longs allowed PyNumber_Multiply to be changed
to allow number types other than longs and ints to repeat sequences.
PyNumber_InPlaceMultiply still needs to be fixed (easy). Fixed lots
of small bugs and optimized things (eg. don't dispatch on the second
operand if its type is the same as the first). Numbers no longer compare
smaller than non-number types.
-------------------------------------------------------

Date: 2000-Dec-11 12:39
By: gvanrossum

Comment:
I'm now actively reviewing Neil's code (while at the same time trying to figure out how to fit in rich comparisons).

-------------------------------------------------------

Date: 2000-Dec-11 11:14
By: nascheme

Comment:
Operations on instances now call __coerce__ if it exists.  I
think the patch is now complete.  Converting other builtin types
to "new style numbers" can be done with a separate patch.

-------------------------------------------------------

Date: 2000-Dec-04 18:45
By: nascheme

Comment:
This patch is a little rough yet but I guess its better here
than on my website.  The major source of ugliness PyObject_Compare.
-------------------------------------------------------

Date: 2000-Dec-06 08:00
By: nascheme

Comment:
Cleaned up PyObject_Compare() (still needs to be optimized).
__coerce__ on instances needs be to sorted out.  It should
probably be called if it exists for backwards compatibility. 
Longs and complex types still need to be converted to new
style numbers.
-------------------------------------------------------

Date: 2000-Dec-07 18:34
By: nascheme

Comment:
Fix some reference counts.   Make use of macros to reduce
duplicate code.  Remove some unused code in classobject.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://sourceforge.net/patch/?func=detailpatch&patch_id=102652&group_id=5470