#12958: Fix sageinspect to better support old style classes
-------------------------------------+--------------------------------------
Reporter: nthiery | Owner: mvngu
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.1
Component: documentation | Resolution:
Keywords: sageinspect | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Nicolas M. ThiƩry | Merged in:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------------------
Comment (by SimonKing):
I am not sure what the two doc tests are supposed to demonstrate, as they
just test against errors being raised.
Anyway, with #11791 (plus dependencies plus something more, so, someone
else should cross verify), I get
{{{
sage: from sage.misc.sageinspect import sage_getsourcelines
sage: class Foo: pass
....:
sage: sage_getsourcelines(Foo) # Is it intended to fix this?
Traceback (most recent call last):
...
IOError: could not find class definition
sage: import inspect
sage: inspect.findsource(Sets.ParentMethods) # Why is Python's inspect
module tested??
Traceback (most recent call last):
...
IOError: could not find class definition
sage: L = sage_getsourcelines(Sets.ParentMethods) # works just fine
sage: print ''.join(L[0])
class ParentMethods:
# # currently overriden by the default implementation in
sage.structure.Parent
# def __call__(self, *args, **options):
# return self.element_class(*args, **options)
# Todo: simplify the _element_constructor definition logic
...
"""
if category is None:
category = self.category()
from sage.combinat.free_module import CombinatorialFreeModule
return CombinatorialFreeModule(base_ring, self, category =
category.Algebras(base_ring))
}}}
The code line that is changed in your patch is not touched by #11791. So,
how does it actually change things?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12958#comment:4>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.