What is `scipy.i`?

Due to an accidental keyboard break, I noticed that there is a variable in SciPy called i , which is assigned to the string '6' . (May differ on other machines?)

I tried using the built-in helper functions, but nothing was assigned to scipy.i , since it only refers to a string.

I also searched for documents and google, but nothing worked.

Maybe this is due to version control or something like that? By the way, I am using Enthought Python for Windows 7 (both 64 bits).

This is far from a critical question, I'm just curious!

+7
source share
1 answer

Oh, that's cute. From scipy __init__.py :

 # Emit a warning if numpy is too old majver, minver = [float(i) for i in _num.version.version.split('.')[:2]] 

In Python 2, list the "leak" of your loop variables in the scope. And thus:

 >>> import numpy as _num >>> _num.version.version '1.6.2' >>> _num.version.version.split('.')[:2] ['1', '6'] >>> majver, minver = [float(i) for i in _num.version.version.split('.')[:2]] >>> i '6' 
+10
source

All Articles