[Python-ideas] Module name [was Re: Pre-PEP: adding a statistics module to Python]
Nick Coghlan
ncoghlan at gmail.com
Tue Aug 6 07:42:39 CEST 2013
On 6 August 2013 15:31, Joshua Landau <joshua at landau.ws> wrote:
> On 6 August 2013 06:22, Michele Lacchia <michelelacchia at gmail.com> wrote:
>>
>> Il giorno 06/ago/2013 02:12, "Alexander Belopolsky" <alexander.belopolsky at gmail.com> ha scritto:
>>>
>>> On Mon, Aug 5, 2013 at 8:01 PM, MRAB <python at mrabarnett.plus.com> wrote:
>>>>
>>>> Well, "statistics" is no longer than "subprocess" anyway.
>>>
>>> Right, but subprocess was never intended for use in the "calculator mode."
>>
>> What about the fraction module? It could be in math but it isn't. It could also be frac or fracs, but it is not. For consistency the module name IMHO should be statistics.
>
> To be fair that's a false analogy as math is module for mathematical
> functions (of which statistics is a subset) and fractions contains
> numeric types.
>
> Additionally, whether things are inside other modules hasn't been very
> constant over time -- there are several cases where modules were
> combined and spliced although mostly in the Python 2 to 3 border.
The main reason we've switched to nesting things inside other
namespaces is when a name is somewhat ambiguous on its own, or risks a
name clash with a PyPI project.
concurrent.futures is so named to help avoid confusion with the
finance industry notion of "futures"
unittest.mock avoids colliding with the PyPI original
In this case, since Steven's module doesn't handle complex numbers (as
I understand it), putting it inside the "math" namespace helps make
that clear. If it does handle complex numbers where appropriate, then
the top level name would make more sense.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list