Dictionary Enhancement?

Rich Harkins rharkins at thinkronize.com
Thu Oct 31 11:37:20 EST 2002


On Thu, 2002-10-31 at 11:30, Emile van Sebille wrote:
> Rich Harkins:
[ snip ]
> 
> Did you see Pearu Peterson's post of his lazy dict module?  It says, in
> part:
> 
> "lazy" mode means that the following statement
>     dict[<name>] = func(<name>)
> is executed whenever dict has no key <name>.
> 
> Here's the ref:
> http://groups.google.com/groups?selm=Pine.LNX.4.10.10012310238260.2303-1
> 00000%40kev.ioc.ee
> 
> --
> 
> Emile van Sebille
> emile at fenx.com
> 
> ---------

Nope, hadn't seen that one -- thanks for the pointer.  That looks more
like what I was looking for -- other than it requires more goop to set
it up (although that can be done in the base class).  Has this sort of
thing been examined for a PEP yet?  It would seem a fairly minor change
to the dictionary built-in type (although I haven't researched it
completely yet).

Thanks!
Rich






More information about the Python-list mailing list