#20626: lazy_import'ed modules broken on introspection
---------------------------+------------------------
Reporter: nthiery | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-7.3
Component: misc | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------+------------------------
Comment (by vbraun):
Possibly related: documentation of lazy imports includes various
`lazy_import` stuff
{{{
}}}sage: %pinfo piecewise
Type: LazyImport
String form: piecewise
File: ~/Sage/src/sage/misc/lazy_import.pyx
Docstring:
Piecewise function <---- this section is the only one that is
correct
EXAMPLES:
sage: var('x, y')
(x, y)
sage: f = piecewise([((0,1), x^2*y), ([-1,0], -x*y^2)], var=x); f
piecewise(x|-->x^2*y on (0, 1), x|-->-x*y^2 on [-1, 0]; x)
sage: f(1/2)
1/4*y
sage: f(-1/2)
1/2*y^2
Class docstring:
EXAMPLES:
sage: from sage.misc.lazy_import import LazyImport
sage: my_integer = LazyImport('sage.rings.all', 'Integer')
sage: my_integer(4)
4
sage: my_integer('101', base=2)
5
sage: my_integer(3/2)
Traceback (most recent call last):
...
TypeError: no conversion of this rational to integer
Init docstring:
EXAMPLES:
sage: from sage.misc.lazy_import import LazyImport
sage: my_isprime = LazyImport('sage.all', 'is_prime')
sage: my_isprime(5)
True
sage: my_isprime(55)
False
Call docstring:
Calling self calls the wrapped object.
EXAMPLES:
sage: from sage.misc.lazy_import import LazyImport
sage: my_isprime = LazyImport('sage.all', 'is_prime')
sage: my_isprime(12)
False
sage: my_isprime(13)
True
--
Ticket URL: <http://trac.sagemath.org/ticket/20626#comment:2>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.