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/2004-April/044016.html below:

[Python-Dev] Re: PEP 318 bake-off?

[Python-Dev] Re: PEP 318 bake-off?Mark Russell marktrussell at btopenworld.com
Sun Apr 4 06:18:56 EDT 2004
On Sun, 2004-04-04 at 01:37, Josiah Carlson wrote:
> >     def __call__(self, *args, **kwds):
> >         key = (args, tuple(kwds.items())) # hope everything's hashable...
> >         return ( self.get(key)
> >                  or self.setdefault(key, self.func(*args, **kwds)) )
> 
> I believe that with standard dictionaries, kwds is not guaraneed to have
> any particular order.  Perhaps sorting kwds.items() makes sense?

Also the call to self.func() is needlessly repeated if the return value
is 0, None, or anything else that is treated as False.  I realise that
this is off the point slightly, but using "e1 or e2" like this is such
an attractive nuisance it warrants being stomped on wherever possible.

Mark Russell

More information about the Python-Dev mailing list

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