Terry J. Reedy <tjre...@udel.edu> added the comment:

It seems to me that the underlying (design) flaw is having duplicate slots in 
the C type structure*.  I presume that having two different functions in 
num-add and seq-add (concat) (I know, not quite the proper names), etc, is an 
error. I also assume that changing the structure is out, whether frozen in the 
ABI or not, as disabling every extention type.

But could we change how the slots are handled? For instance, when class is 
created, if nun-add is absent and seq-add is present, copy seq-add to num-add 
and thereafter only use num-add and treat seq-add as a dummy left for back 
compatibility.  In other words, merge the duplicate slots in their effect, so 
there is a proper 1-1 relationship between syntax operators and methods, as 
there is for Python-coded classes.

*I am guessing that this was for convenience -- making a number? fill in num 
slots; making a sequence? fill in seq slots. Or perhaps Guido once had some 
idea of possibly separating the operators/functions at the Python level. Does 
not matter at present.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11477>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to