Changes between Version 1 and Version 3 of Ticket #14767


Ignore:
Timestamp:
Jun 24, 2013, 6:19:30 PM (9 years ago)
Author:
Vincent Delecroix
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14767

    • Property Status changed from new to needs_review
  • Ticket #14767 – Description

    v1 v3  
    1010That's because `NN` is a not-yet-resolved lazy imported object.
    1111
    12 However, it is able to answer correctly with a bit of help:
     12solution 1: the default value for ``lazy`` could possibly be set to True for lazy imported objects (original proposition of the ticket)
    1313
     14solution 2: if the object is a `LazyImport` then get the corresponding object with `._get_object`
     15(solution implemented in the ticket)
     16
     17With the patch applied
    1418{{{
    15 sage: import_statements('NN', lazy=True) 
    16 from sage.misc.lazy_import import lazy_import
    17 lazy_import('sage.misc.lazy_import', 'NN')
    18 sage: from sage.misc.lazy_import import lazy_import
    19 sage: lazy_import('sage.misc.lazy_import', 'NN'
     19sage: import_statements(NN)
     20from sage.rings.semirings.non_negative_integer_semiring import NN
     21sage: import_statements('NN')
     22from sage.rings.semirings.non_negative_integer_semiring import NN
    2023}}}
    21 
    22 By the way, the default value for ``lazy`` could possibly be set to
    23 True for lazy imported objects.