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/2005-September/056610.html below:

[Python-Dev] Adding a conditional expression in Py3.0

[Python-Dev] Adding a conditional expression in Py3.0 [Python-Dev] Adding a conditional expression in Py3.0Mark Russell mark.russell at redmoon.me.uk
Wed Sep 21 13:08:53 CEST 2005
On Wed, 2005-09-21 at 11:10, Michael Hudson wrote:
> My problem with this syntax is that it can be hard to read:
> 
> return if self.arg is None then default else self.arg
> 
> looks worryingly like
> 
> return NAME NAME.NAME NAME NAME NAME NAME NAME NAME.NAME
> 
> to me.

I think that requriing parens helps a lot with the list-of-names problem
- it nicely delimits the conditional expression for human readers:

      return (if self.arg is None then default else self.arg)

In particular it breaks up the misleading grouping "return if".

Mark Russell

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