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/2012-February/116777.html below:

[Python-Dev] [Python-checkins] peps: Switch back to named functions, since the Ellipsis version degenerated badly

[Python-Dev] [Python-checkins] peps: Switch back to named functions, since the Ellipsis version degenerated badlyJim Jewett jimjjewett at gmail.com
Thu Feb 23 17:37:34 CET 2012
On Wed, Feb 22, 2012 at 10:22 AM, nick.coghlan
<python-checkins at python.org> wrote:
> +    in x = weakref.ref(target, report_destruction)
> +    def report_destruction(obj):
>         print("{} is being destroyed".format(obj))

> +If the repetition of the name seems especially annoying, then a throwaway
> +name like ``f`` can be used instead::

> +    in x = weakref.ref(target, f)
> +    def f(obj):
> +        print("{} is being destroyed".format(obj))


I still feel that the helper function (or class) is subordinate, and
should be indented.  Thinking of "in ..." as a decorator helps, but
makes it seem that the helper function is the important part (which it
sometimes is...)

I understand that adding a colon and indent has its own problems, but
... I'm not certain this is better, and I am certain that the desire
for indentation is strong enough to at least justify discussion in the
PEP.

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