On Fri, May 17, 2013 at 9:17 AM, Matt Newell <newe...@blur.com> wrote:
> I don't really understand what the fixup_slot_dispatchers function is doing,
> but it does seem like there must be a bug either in what it's doing, or in
> PyNumber_InPlaceAdd's handling of a NotImplemented return value from
> sq_inplace_concat.

I didn't read your post in detail, but operand precedence in CPython
is known to be broken for types which only populate the sq_* slots
without also populating the corresponding nb_* slots:
http://bugs.python.org/issue11477

The bug doesn't affect types implemented in Python, as the interpreter
always populates both slots (I believe Cython also populated both
slots for types defined that way).

I made one attempt at fixing it (by changing the fallback handling in
abstract.c) but it turned out to be completely unmaintainable (and
didn't really work right anyway). There's another suggested approach
that would likely work better (automatically populating the nb_* slots
with delegation wrappers and losing the fallback code in abstract.c
entirely), but it still needs a patch (the test cases from my failed
attempt may still prove useful, though).

Cheers,
Nick.

--
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to