Ticket #12543 (closed enhancement: fixed)
improve import_statements
| Reported by: | aschilling | Owned by: | sage-combinat |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.8 |
| Component: | misc | Keywords: | import_statements, development |
| Cc: | sage-combinat | Work issues: | |
| Report Upstream: | N/A | Reviewers: | Nicolas M. Thiéry |
| Authors: | Vincent Delecroix | Merged in: | sage-5.8.beta3 |
| Dependencies: | Stopgaps: |
Description (last modified by nthiery) (diff)
Currently, import_statements yields a name error if the class is not imported in the Sage interpreter namespace. For example.
sage: import_statements(ClonableIntArray) NameError: name 'ClonableIntArray' is not defined
With this patch, one can specify the object as a string, and the object is looked up in all (imported) Sage modules.
sage: import_statements("ClonableIntArray")
See the documentation for more examples.
This patch implements several heuristics to better handle ambiguous names.
Attachments
Change History
comment:1 Changed 5 months ago by vdelecroix
- Status changed from new to needs_review
- Description modified (diff)
- Authors changed from Nicolas Thiery to Vincent Delecroix
- Component changed from combinatorics to misc
- Summary changed from import_statementss combined with search_def to improve import_statements
- Keywords import_statements, development added
Note: See
TracTickets for help on using
tickets.

