Question about __getattribute__/__getattr__

Joao Prado Maia jpm at papercut.org
Tue Oct 1 15:40:56 CEST 2002


On Tue, 1 Oct 2002, Jeff Epler wrote:

> On Tue, Oct 01, 2002 at 09:23:22AM -0400, Joao Prado Maia wrote:
> > A dictionary approach is not good enough for my needs, as it will 
> > eventually hold too much data in memory. As I explained before, saving the 
> > method return values in md5()'ed named files is the best solution I can 
> > think of.
> 
> Then why not use "shelve" to store the data?  You'll have to conver
> items to strings when used as keys, but the values can be arbitrary
> Python objects which can survive pickling.  You can prototype now with
> dicts, and make the switch when you need to.  Or, if you don't like
> "shelve", you can write your own mapping class which will use the
> files-with-md5()-names.
> 
> The point is that you can worry about this aspect later and use a dict
> now.  You can then drop in different disk storage "back-ends" as
> necessary, as long as you can make them act like a Python mapping.
> 

Sure. I feel like we are getting side tracked (sp?) in this subject now. 
My main concern right now is being able to get the full list of arguments 
passed to a method from inside __getattr__ :)

Cheers,
Joao





More information about the Python-list mailing list