Hello,

On Tue, Jun 9, 2009 at 4:51 PM, kcrisman<kcris...@gmail.com> wrote:
>
>
>>
>> This means that you can either not have (semi)private functions in
>> your code or any code submissions to sage will be automatically
>> rejected due to the 100% doctest requirement, unless I am overlooking
>> something silly.
>>

The difference between the two is because of this (from
http://docs.python.org/reference/simple_stmts.html)

"The public names defined by a module are determined by checking the
module’s namespace for a variable named __all__; if defined, it must
be a sequence of strings which are names defined or imported by that
module. The names given in __all__ are all considered public and are
required to exist. If __all__ is not defined, the set of public names
includes all names found in the module’s namespace which do not begin
with an underscore character ('_'). __all__ should contain the entire
public API. It is intended to avoid accidentally exporting items that
are not part of the API (such as library modules which were imported
and used within the module)."

So functions which start with underscore aren't imported when you do
"from mymodule import *".  You can either explicitly import it, or can
define an __all__ variable appropriate for your module.

--Mike

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to