Re: one-time factory in python for an experienced java guy

2009-07-14 Thread phonky
Thanks for all replies. I need to practice much more pythonese In fact I don't think to understand all of your suggestions, so I'll need to go through them and decide what approach I am going to take. Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: one-time factory in python for an experienced java guy

2009-07-14 Thread phonky
Thanks Paul, Ugh, just forget everything you ever knew about java. Do some Zen exercises to erase your mind. Then read a Python tutorial as if you're starting from nothing. Yeah, surely right, but easier said than done... I'm working on it. Taking your example. import itertools class

Re: one-time factory in python for an experienced java guy

2009-07-14 Thread phonky
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 o

one-time factory in python for an experienced java guy

2009-07-14 Thread phonky
Hi I have searched all over and haven't found the solution for my problem yet. I am new to python, and all the time realize I do program python in java, which is not great. Besides being a real-life problem, I want to solve it as elegant as I can, using it to also learn about python (I know I co