[SciPy-User] (pas de sujet)

Ralf Gommers ralf.gommers at googlemail.com
Fri Apr 1 17:33:43 EDT 2011


On Fri, Apr 1, 2011 at 11:17 PM, Robert Kern <robert.kern at gmail.com> wrote:
> On Fri, Apr 1, 2011 at 16:05, Ralf Gommers <ralf.gommers at googlemail.com> wrote:
>
>>>>> import io
>>>>> io.__file__
>> '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/io.pyc'
>>>>> from scipy import io
>>>>> io.__file__
>> '/Users/rgommers/Code/scipy/scipy/io/__init__.pyc'
>>
>> So there you do want sp.io. Perhaps the thinking was to make it
>> consistent in the docs by always prefixing with sp (I'm not saying
>> that's the best solution though).
>
> I think
>
>  import io
>  from scipy import io as spio # Name collision!
>  spio.whatever()
>
> is better than
>
>  import io
>  import scipy as ip
>  import scipy.io
>  sp.io.whatever()
>
> Honestly, that's just confusing. The only non-confusing use of "import
> scipy as sp" is to use it for all of the numpy symbols it imports,
> e.g. "sp.array()", but that's a practice I would like to squash down
> on hard.

True, that's useless. Do you feel like writing a patch for the
howto_document file?

Ralf



More information about the SciPy-User mailing list