Opened 9 years ago

Closed 8 years ago

#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 Merged in: sage-5.8.beta3
Authors: Vincent Delecroix Reviewers: Nicolas M. Thiéry
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by nthiery)

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 (1)

trac_12543-import_statements-vd.patch (10.7 KB) - added by nthiery 8 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 9 years ago by vdelecroix

  • Authors changed from Nicolas Thiery to Vincent Delecroix
  • Component changed from combinatorics to misc
  • Description modified (diff)
  • Keywords import_statements development added
  • Status changed from new to needs_review
  • Summary changed from import_statementss combined with search_def to improve import_statements

comment:2 Changed 9 years ago by vdelecroix

Now, all function in the module are documented...

Changed 8 years ago by nthiery

comment:3 Changed 8 years ago by nthiery

  • Description modified (diff)
  • Reviewers set to Nicolas M. Thiéry
  • Status changed from needs_review to positive_review

I did some improvements with Vincent watching over my shoulder.

Positive review! Thanks Vincent :-)

comment:4 Changed 8 years ago by jdemeyer

  • Merged in set to sage-5.8.beta3
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.