How to Lock Globar Variables across Modules?

William Djaja Tjokroaminata billtj at Glue.umd.edu
Thu Sep 28 10:03:05 EDT 2000


On Thu, 28 Sep 2000, Simon Brunning wrote:

> > From:	William Djaja Tjokroaminata [SMTP:billtj at y.glue.umd.edu]
> > In 1), typing 'main_module.sv' is more tedious than just typing 'sv'.  I
> > wish python had some macro just like in C/C++ with its pre-processor:
> > 
> >     #define sv main_module.sv
> > 
> sv = main_module.sv
> 
> Cheers,
> Simon Brunning
> TriSystems Ltd.
> sbrunning at trisystems.co.uk
> 
----------------------------------------------------------------------------

Hi, Simon

Thanks for your response.  But as I have written in my first posting, the
statement in other modules of

    sv = main_module.sv

only refers to the initial value of 'main_module.sv'.  When
'main_module.sv' is changed (to point to another object), sv is not
changed (still points to the original object).  That's why I wish python
has a reference feature like in C++ or Perl.


Regards,

Bill





More information about the Python-list mailing list