one-time factory in python for an experienced java guy

phonky phonky at europe.com
Tue Jul 14 10:34:30 EDT 2009


Stefan, thanks first of all

> Use a global variable in the module.

I have an account_number_generator variable in the module,
I got that hint from searching the web.

But where my stubborn java mind doesn't release me:
what does the variable contain? Do I create the actual
IncrementalGenerator object there? Or the super class?
Or just a string, which a factory method takes to
create the actual object?

What I especially don't get:
How will an external module overwrite that variable?

I fail to see, python being interpreted, how I can ensure
that a future module is being executed later, thus
overwriting the variable.

Thanks again.




More information about the Python-list mailing list