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/2008-February/077007.html below:

[Python-Dev] small Grammar questions

[Python-Dev] small Grammar questionsBrett Cannon brett at python.org
Wed Feb 20 05:37:09 CET 2008
On Feb 19, 2008 6:15 PM, Steve Holden <steve at holdenweb.com> wrote:
> Steve Holden wrote:
> [...]
> > The one that surprised me was the legality of
> >
> >      def eggs((a, )=c):
> >          pass
> >
> > That just seems like unpacking-abuse to me.
> >
> Needless to say, a call that tries to *use* the default value fails
> horribly, as the parameter form does require an iterable:
>
>  >>> def eggs((a, )=2.1):
> ...   pass
> ...
>  >>> eggs()
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>    File "<stdin>", line 1, in eggs
> TypeError: 'float' object is not iterable
>  >>> eggs((2.1, ))
>
>  >>>

And this is another reason why they will not appear in Python 3.0.

-Brett
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