On Sun, 27 Jan 2013, Sven Schreiber wrote:

> Am 27.01.2013 18:48, schrieb Allin Cottrell:
>> On Sun, 27 Jan 2013, Sven Schreiber wrote:
>
>>> Well I don't want to call myself a guru, especially given the few hours
>>> I have spent with Python in recent months/years, but the namespace alias
>>> is optional. So you can always do 'import numpy' and then just use
>>> 'numpy.loadtxt' etc. For the few functions that gretl uses for it's
>>> tricks behind the scenes you could also write:
>>> 'from numpy import loadtxt, savetxt'
>>> without having to specify any new namespace label, then you just use
>>> 'loadtxt' and 'savetxt' directly (which is bad style in bigger contexts,
>>> but here I think it should be ok). It's no problem to do both this
>>> 'from' form for gretl's own needs, and then 'import numpy as <whatever>'
>>> for further use by the user in the foreign block.
>>
>> OK, that sounds like a good approach.
>
> BTW, it occurs to me that in the python spirit of "explicit is better
> than implicit" it could also be just left to the user to do the 'import
> numpy as <whatever>'. Then gretl doesn't have to bother at all with the
> style that the user prefers, and the user-written python code in the
> foreign block would be more self-contained (and explicit, as I said).

Fair enough, we could go with that.

Allin Cottrell

Reply via email to