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

[Python-Dev] PEP 318 - generality of list; restrictions on elements

[Python-Dev] PEP 318 - generality of list; restrictions on elementsAahz aahz at pythoncraft.com
Mon Mar 8 15:32:13 EST 2004
On Mon, Mar 08, 2004, Fred L. Drake, Jr. wrote:
> On Monday 08 March 2004 03:05 pm, Skip Montanaro wrote:
>>
>> Must take a single argument, which itself must be a callable, right?
> 
> If I write:
> 
>     def foo() [w1, w2]:
>         pass
> 
> I'd expect w2() to be passed whatever w1() returns, regardless of
> whether it's callable.  It should raise an exception if it gets
> something it can't handle.

No, that's not right.  If

    def foo() [w1, w2]: pass

is valid, this must also always be valid:

    def foo() [w2]: pass

I'm not sure to what extent we can/should enforce this, but I'm -1 on
any proposal for which this isn't the documented behavior.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Do not taunt happy fun for loops. Do not change lists you are looping over."
--Remco Gerlich, comp.lang.python

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