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

[Python-Dev] 2.4a2, and @decorators

[Python-Dev] 2.4a2, and @decoratorsMichael Hudson mwh at python.net
Fri Aug 6 13:42:46 CEST 2004
Gareth McCaughan <gmccaughan at synaptics-uk.com> writes:

> On Friday 2004-08-06 01:35, Greg Ewing wrote:
>> > >> class C(random.choice([dict, list])):
>> > >>     pass
>> > >>
>> > >> is my favourite example of this :-)
>> > >
>> > > Where is THAT monstrocity used!?
>> > 
>> > Well, it's not, I hope :-)
>> 
>> Hmmm... maybe if you had some algorithm that was more efficient
>> using either a list or a dict, depending on the input data, but
>> in a way that makes it difficult to tell ahead of time which
>> to use, and you want to improve the average behaviour...
>
> ... then you'd do better to find which out of (dict,list)
> does better on average, and always use that one. Sorry. :-)

By running the above code on a wide range of inputs? :-)

Cheers,
mwh

-- 
  To summarise the summary of the summary:- people are a problem.
                   -- The Hitch-Hikers Guide to the Galaxy, Episode 12
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