On 12/3/2016 7:31 PM, Chris Angelico wrote:
On Sun, Dec 4, 2016 at 11:10 AM, Terry Reedy <tjre...@udel.edu> wrote:
But the expression result isn't even used. So this is better written:

matplotlib.pyplot.xlabel sets x-axis scaling, with no documented return
value.
http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.xlabel
If, as seems reasonable to assume, it returns None, the value of the
expression is 'None if x else None', which is to say, None.

Hardly matters what the return value is, given that the code ignores it.

I was not clear enough. To me, a 'conditional expression' that has an unconditional value is a bit confusing. So I think the conditional side-effect would be better written the way you did regardless of the use or not of the value. If the unconditional value were not ignored, I think it would be better used by itself.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to