Dictionary Enhancement?

Michael Hudson mwh at python.net
Thu Oct 31 12:49:35 EST 2002


Rich Harkins <rharkins at thinkronize.com> writes:

> Not quite - __makeitem__ will be called (and its value generated)
> whether it needs to be or not - this is my basic objection to
> setdefault() as an approach.  I did reply to myself with an example
> Python class but I guess I would really like to see this become either a
> default built-in behavior or a separate, but built-in, C type to manage
> this sort of thing.

Not that my opinion is the one that really counts, but: no chance.

>  The pure Python version will have poor performance characteristics
> if __getitem__ is called frequently.

Why can't you write your own C type?  I don't think this is a common
enough need to be added to the core.

Cheers,
M.

-- 
  I really hope there's a catastrophic bug insome future e-mail
  program where if you try and send an attachment it cancels your
  ISP account, deletes your harddrive, and pisses in your coffee
                                                         -- Adam Rixey



More information about the Python-list mailing list