[Numpy-discussion] ma's maximum_fill_value function in 1.1.0

Robert Kern robert.kern@gmail....
Thu Jun 19 19:45:40 CDT 2008


On Thu, Jun 19, 2008 at 19:38, Pierre GM <pgmdevlist@gmail.com> wrote:
> On Thursday 19 June 2008 20:28:46 Robert Kern wrote:
>> On Thu, Jun 19, 2008 at 19:15, Pierre GM <pgmdevlist@gmail.com> wrote:
>> > Your question raises a good point: is there any consensus on using
>> > __all__ instead of the module namespace ?
>>
>> I'm not sure what you mean. Can you clarify?
>
>  __all__ is used on a regular basis in numpy instead of using modules
> namespace: why ?

The contents of numpy.core.foo, etc., are typically exposed at a
higher level, like in numpy.core.__init__ and numpy.__init__. Defining
numpy.core.foo.__all__ lets the __init__.py files just "from
numpy.core.foo import *" and have a nearly-sensible namespace.

Even if you aren't catering to the "from ... import *" use case,
including a name in __all__ is a strong and useful signal about what
is part of the public API for your module.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco


More information about the Numpy-discussion mailing list