Replace a module variable with a function call

Carsten Haese carsten at uniqsys.com
Mon Feb 6 14:03:42 EST 2006


On Mon, 2006-02-06 at 13:54, gabriel.becedillas at gmail.com wrote:
> I have a module that defines a variable with a constant value and now I
> need to make that value dynamic, without affecting module clients. In
> other words, I need to call a function witout using parenthesis.
> Example:
> 
> mymod.py----------------------
> 
> def value():
>     return "hi"
> 
> client.py--------------------------
> import mymod
> 
> print mymod.value
> 
> Is there a way to do this ?

If you're not passing any arguments to this "function call", what is
this "dynamic" value supposed to depend on? The phase of the moon?

-Carsten





More information about the Python-list mailing list