id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	work_issues	upstream	reviewer	author	merged	dependencies	stopgaps
11003	Improve support for lazy_import inside classes	nthiery	jason	"Currently, one can do:

{{{
    sage: class foo(object):
    ...       bar = LazyImport('sage.bar', 'bar')
    sage: foo.bar
    bar
}}}

and this works (assuming sage.bar.bar exists of course). As a
syntactic sugar, it would be nice to have lazy_import work as well, if
possible with the automatic back-insertion of the object into the
class after the actual import occurred:

{{{
    sage: class foo(object):
    ...       lazy_import('sage.bar', 'bar')
    sage: type(foo.bar)
    <type 'sage.misc.lazy_import.LazyImport'>
    sage: foo.bar
    bar
    sage: type(foo.bar)
    <type 'bar_type>
}}}

'''Apply:''' [attachment:trac_11003-folded.patch]"	enhancement	closed	major	sage-5.0	misc	fixed	Cernay2012	rishi jason rlm rbradshaw		N/A	Nicolas M. Thiéry, Florent Hivert	Mike Hansen	sage-5.0.beta4		
