#19125: DeprecatedMethod wrapping is broken
-------------------------------------+-------------------------------------
Reporter: nbruin | Owner:
Type: defect | Status: needs_work
Priority: blocker | Milestone: sage-6.9
Component: misc | Resolution:
Keywords: | Merged in:
Authors: Nils Bruin | Reviewers: Vincent Delecroix
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/nbruin/ticket/19125 | 7f6cffe7e38835212a508f6fcf4f617e43c4103b
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by nbruin):
I think the name lookup is already broken. With the current change, we
make it worse, though:
Currently, for methods it does a name lookup by finding all dictionaries
that refer to the object in question and pick the first one that looks
like it's a class namespace and then take the first name under which this
object occurs. That sort-of seems to work most of the time.
Problem: the `unbound` instance variable introduced here, so it's a toss-
up whether you get the name reported as `unbound` or something else. We
could guard against that particular reference, but if several bound
instances exist at once, this gets painful (and you're really just trying
to make a buggy approach work a little more often)
We could probably do a little better: I think the __get__ gets as one
parameter an object from which we can find the dictionary in which the
reference is stored: I think `cls.__dict__` would be a good start, but I'm
afraid you'd have to walk the MRO of `cls` (and with overridden getattrs,
who knows where you should look?)
In any case, the code proposed at least should ensure that results are not
changed by wrapping, even if name printing is not entirely reliable.
--
Ticket URL: <http://trac.sagemath.org/ticket/19125#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.