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-May/079115.html below:

[Python-Dev] PEP 8: Discourage named lambdas?

[Python-Dev] PEP 8: Discourage named lambdas? [Python-Dev] PEP 8: Discourage named lambdas?Antoine Pitrou solipsis at pitrou.net
Sun May 4 12:55:38 CEST 2008
Steven D'Aprano <steve <at> pearwood.info> writes:
> 
> I think you're exaggerating a tad here. Why would you be "very confused" 
> when you see TITLEPATTERN() or foo(callback=TITLEPATTERN)? What else 
> would TITLEPATTERN be but a callable when it's being used as a 
> callable?

The real problem is this example is not the fact that there is a lambda,
but that the variable name doesn't reflect it is a callable. It is common
practice to use verbs for callables, and nouns for non-callables.
Thus I'd expect the variable to be called something like make_title_pattern
rather than TITLEPATTERN (and what's with the ugly allcaps by the way?).


Antoine.


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