Re: accessors and lazy initialization

2006-03-10 Thread Neil Dunn
The second version seems the most sensible. Remeber this is python, properties are more sensible then getters and setters. -- http://mail.python.org/mailman/listinfo/python-list

Re: accessors and lazy initialization

2006-03-10 Thread Rene Pijlman
Bill: >In general I try to initialize the state of my objects as late as >possible, in the accessor. [...] >Is there a more Pythonic way of looking at this? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/131495 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/363602 -- René Pijlm

accessors and lazy initialization

2006-03-10 Thread Bill
Hello -- I'm a Java programmer who's slowly getting up to speed in Python. In general I try to initialize the state of my objects as late as possible, in the accessor. So if I have a member "_foo", my accessor is something like: public FooType getFoo() { if (_foo == null) { // initi