[SciPy-Dev] Question about subpackage/submodule API

Robert Kern robert.kern at gmail.com
Sun Feb 20 12:40:27 EST 2011


On Sat, Feb 12, 2011 at 19:28, Ralf Gommers <ralf.gommers at googlemail.com> wrote:
>
> On Sun, Feb 13, 2011 at 5:05 AM, Pauli Virtanen <pav at iki.fi> wrote:
>>
>> On Sat, 12 Feb 2011 14:12:44 -0600, Travis Oliphant wrote:
>> > The policy in the past has been that the stable API is only one level
>> > down from the scipy namespace.
>> >
>> > So, developers should import the name from the top level namespace.
>
> Is this written down somewhere? As far as I understand this is not standard
> practice in Python (one should use underscores).

Actually, it is de facto standard practice. The presence of
underscores do mark something as private, but the absence of
underscores do not mark something as public. Almost no one prepends
underscores to module names regardless of whether they are considered
"public" or "private". The public API of a package is determined by
any number of conventions which may or may not be documented
explicitly. For scipy, the convention is that public functions are
exposed in the __init__.py.

-- 
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 SciPy-Dev mailing list