Stef Mientki a écrit :
> Bruno Desthuilliers wrote:
>
>> Stef Mientki a écrit :
>>
>>> Bruno Desthuilliers wrote:
>>>
stef a écrit :
>>
>> (snip)
>>
> but tell them that they are going to loose all their globals ???
It's a feature. Globals are definitively a BadThing(tm).
>>>
>>
Stef Mientki wrote:
> Bruno Desthuilliers wrote:
>> Unless you clearly explain the benefits... Any code relying on the
>> existence of a global is:
>> 1/ dependent on the existence of this global
>> 2/ harder to understand
> And you think physicians will believe that ?
> And suppose they believe
stef wrote:
>> Change a=1 to amodule.a=1
>> If you find yourself doing tricks with the module globals, think about
>> redesigning your application.
>>
> Of course I completely agree with you.
>
> But ...
> if you're moving from MatLab to Python,
> and want to show your collegaes,
> with how littl
At Thursday 11/1/2007 11:55, stef wrote:
>Of course I completely agree with you.
>
>But ...
>if you're moving from MatLab to Python,
>and want to show your collegaes,
>with how little effort they can reuse all their existing MatLab routines
>in Python,
>then the global issue is a real pain !!
>
>Y
Bruno Desthuilliers wrote:
> Stef Mientki a écrit :
>> Bruno Desthuilliers wrote:
>>
>>> stef a écrit :
> (snip)
You can explain your collegaes, that
- the startindex of arrays changes from 1 to 0
- slices are upto, instead of including the final border
- indention is thé key
>>
Stef Mientki a écrit :
> Bruno Desthuilliers wrote:
>
>> stef a écrit :
(snip)
>>> You can explain your collegaes, that
>>> - the startindex of arrays changes from 1 to 0
>>> - slices are upto, instead of including the final border
>>> - indention is thé key
>>> And tell them about all beautiful t
Bruno Desthuilliers wrote:
> stef a écrit :
>>
>>>
>>> Change a=1 to amodule.a=1
>>> If you find yourself doing tricks with the module globals, think
>>> about redesigning your application.
>>>
>> Of course I completely agree with you.
>>
>> But ...
>> if you're moving from MatLab to Python,
>> an
Bruno Desthuilliers wrote:
> stef a écrit :
>>
>>>
>>> Change a=1 to amodule.a=1
>>> If you find yourself doing tricks with the module globals, think
>>> about redesigning your application.
>>>
>> Of course I completely agree with you.
>>
>> But ...
>> if you're moving from MatLab to Python,
>> an
stef a écrit :
>
>>
>> Change a=1 to amodule.a=1
>> If you find yourself doing tricks with the module globals, think about
>> redesigning your application.
>>
> Of course I completely agree with you.
>
> But ...
> if you're moving from MatLab to Python,
> and want to show your collegaes,
> with
>
> Change a=1 to amodule.a=1
> If you find yourself doing tricks with the module globals, think about
> redesigning your application.
>
Of course I completely agree with you.
But ...
if you're moving from MatLab to Python,
and want to show your collegaes,
with how little effort they can reuse a
Gabriel Genellina wrote:
> Change a=1 to amodule.a=1
I have multiple command line programs creating 'a' and amodule using it.
Plus some import sequence dependency. So it would not work. Currently
the solution in amodule is:
import __main__
print __main__.a
> If you find yourself doing tricks
At Thursday 11/1/2007 01:11, alf wrote:
How can I have global globals without cyclical import?
You can't. Globals are module globals. You need to qualify *which*
module `a` belongs to.
amodule.py:
def f():
global a
print a
main.py:
import
Hi,
executing main.py reulsts in following:
[EMAIL PROTECTED] andy]$ python main.py
Traceback (most recent call last):
File "main.py", line 4, in ?
amodule.f()
File "/raid/home/andy/amodule.py", line 3, in f
print a
NameError: global name 'a' is not defined
How can I have global
13 matches
Mail list logo