On Mon, Aug 28, 2017 at 01:04:02PM -0700, Nils Bruin wrote:
>    ... However,
>    finding out where that code might live seems to be nigh impossible
>    thanks to the category stuff:
>    sage: QQ.__getitem__??
>           ...
>            try:
>                meth = super(Parent, self).__getitem__
>            except AttributeError:
>                # needed when self is a Cython object
>                try:
>                    meth = self.getattr_from_category('__getitem__')
>                except AttributeError:
>                    return self.list()[n]
>            return meth(n)
>    so finding where this code needs to be made more robust for str/unicode
>    is very difficult.
>    MAINTAINABILITY REQUEST: make methods better introspectable in the face
>    of the category mro extensions.

I agree, it's a pain!

However the culprit is not the "category stuff", but the fact that we
still have too much cruft in Parent that predates categories. In
particular, the above implementation of __getitem__ does not belong
there: it should be moved to the appropriate categories to let
inheritance play nicely without having to play "super" tricks as
above.

Cheers,
                Nicolas
--
Nicolas M. Thiéry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to