On Fri, May 17, 2013 at 1:38 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > 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
Oops, I meant to state that one of the consequences of the bug is that returning NotImplemented from the sq_* methods doesn't work at all - it's never checked and thus never turned into a TypeError. That's why changing to delegation from the nb_* slots is the most promising approach - all that handling is there and correct for the numeric types, but pure sequence types (which can only be created from C code) bypass that handling. I *did* read enough of the original post to know that was the symptom you were seeing, I just failed to mention that in my initial reply... 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