A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-November/030316.html below:

[Python-Dev] dict() enhancement idea?

[Python-Dev] dict() enhancement idea? [Python-Dev] dict() enhancement idea?Brett Cannon bac@OCF.Berkeley.EDU
Thu, 21 Nov 2002 18:00:51 -0800 (PST)
[Just van Rossum]

> I sometimes use an idiom like
>
>   def dictfromkeywords(**kwargs):
>       return kwargs
>
>   d = dictfromkeywords(
>           akey = 12,
>           anotherkey = "foo",
>           ...etc.
>   )
>

+1

So far everyone who has responded to this idea has admitted they have code
somewhere the operates like this.

> to conveniently build dicts with literal keys. I think I've seen Alex Martelli
> advertise it, too. Don't know how well known it is otherwise, but it is extremly
> handy.
>

I think Alex has it in the Cookbook.

-Brett




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4