Update locals() / resolved
holger krekel
pyth at devel.trillke.net
Sun Apr 28 17:26:57 EDT 2002
On Sun, Apr 28, 2002 at 09:06:05PM +0000, Magnus Lie Hetland wrote:
> In article <PNFy8.28407$8D3.758650 at news1.tin.it>, Alex Martelli wrote:
> >holger krekel wrote:
> > ...
> >> ok. i found a nice workaround (if one dare call it that:-)
> >>
> >> class dictlookup(type({})):
>
> Why use type({}) when you can use dict?
1. because i didn't know.
2. I remembered from PEP253 that objects and types
are/should be 'unified'. So using type({}) somehow
made sense to me because it expresses
'this object inherits behaviour from the {}-type'
3. And 'dict' is something i often use in local definitions
when working with dictionaries.
holger
More information about the Python-list
mailing list