Using class attributes

Leo Breebaart leo at lspace.org
Thu Feb 18 08:27:30 EST 2010


Arnaud Delobelle <arnodel at googlemail.com> writes:

> > One observation: if I implement the descriptor solution as
> > given above, the code works perfectly, but running the code
> > through pychecker now causes an error, because that again
> > causes an attempt to read from the non-existant base class
> > template file "Foo.tmpl"...

It's not just pychecker that doesn't like the descriptor
solution: pydoc now also crashes with the same IOError. :-)


> As someone said before, you could just provide a dummy Foo.tmpl
> file.

A pragmatic solution, but one that smells bad to me. All this
started because I didn't want my program to read files more than
once, but I also don't want it to read files it doesn't have to
read (and that don't even need to exist) in the first place!

I'll just go back to the original instance-based lazy evaluation
and caching solution now -- I never really had a big problem with
that.

My thanks again to all of you for helping me out with this.

-- 
Leo Breebaart  <leo at lspace.org>



More information about the Python-list mailing list