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/030295.html below:

[Python-Dev] dict() enhancement idea?

[Python-Dev] dict() enhancement idea? [Python-Dev] dict() enhancement idea?Just van Rossum just@letterror.com
Thu, 21 Nov 2002 17:10:02 +0100
Barry A. Warsaw wrote:

>     name1 = foo()
>     name2 = foo()
>     x = _(template)
> 
> Where _() does a sys._getframe() and automatically sucks the locals
> and globals for interpolation.  Works great, but it gives pychecker
> fits. :)

You, my friend, are a sick man! But then again, I already knew that ;-)

> I like both the **kws addition as well as the keywords-as-attributes
> conveniences.

I wouldn't propose the latter seriously as an enhancement to the dict object:
imagine all the c.l.py posts we'll get of people who do

  >>> d = {}
  >>> d.keys = <whatever>

and wonder why it blows up later... What Oren posted is a great hack in cases
where you more or less know the kind of keys you're going to expect, but it
isn't as great as a general feature of dicts.

Just



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