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/2003-October/038544.html below:

[Python-Dev] Efficient predicates for the standard library

[Python-Dev] Efficient predicates for the standard libraryGareth McCaughan gmccaughan at synaptics-uk.com
Mon Oct 6 08:06:18 EDT 2003
I said:

>>     def any(pred, *iterables):
>>
>> I think the ability to work with multiple sequences (and
>> not to have to use the argument order iter1, pred, iter2, ...)
>> is more important than the ability to avoid typing "bool,".

Chris Stork replied:

> Raymond would tell you to use either chain() or izip() on your
> *iterables.  ;-)  This would also make clear what is actually meant.

Ugh. :-)

>> Another option would be
>>
>>     def any(*iterables, pred=bool):
>>>> def any(*iterables, pred=bool):
>
> ------------------------------------------------------------
>    File "<stdin>", line 1
>      def any(*iterables, pred=bool):
>                             ^
> SyntaxError: invalid syntax

Aieee! I was so sure you could do that, I didn't bother
checking. In fact my thoughts went like this: "Hang on;
can you do that? ... Yes, of course you can. I'm just
thinking of Lisp, where you can't because of the way
keyword args work there. That's a nice benefit of
Python's less minimal syntax, isn't it?". How annoying.

-- 
g



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