#18107: The codes collection should describe how to import it as a real module
-------------------------------------+-------------------------------------
       Reporter:  jsrn               |        Owner:
           Type:  enhancement        |       Status:  positive_review
       Priority:  major              |    Milestone:  sage-6.6
      Component:  coding theory      |   Resolution:
       Keywords:  sd66               |    Merged in:
        Authors:  Johan S. R.        |    Reviewers:  Nathann Cohen, Volker
  Nielsen                            |  Braun
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jsrn/18107_coding_module         |  28a26eac05663eabf6d79d93eb512082fde27ba8
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by vbraun):

 * status:  needs_review => positive_review
 * reviewer:  Nathann Cohen => Nathann Cohen, Volker Braun


Comment:

 Global variables in the repl are a tradeoff. Sure, globals are usually bad
 (which is why you have to explicitly import things in the Sage library
 code). But then its the commandline, so we want to have a useful set of
 defaults. The important fact is: you can always overwrite stuff in the
 global namespace with stuff from your preferred module and everything
 works:
 {{{
 $ python
 >>> list = 123      # why not
 >>> list([1,2])     # of course that doesn't work then any more
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: 'int' object is not callable

 >>> from __builtin__ import list    # get the old list back
 >>> list([1,2])
 [1, 2]
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/18107#comment:27>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to