This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients Ondřej Medek, r.david.murray, vinay.sajip, xiang.zhang
Date 2016-09-02.15:03:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472828582.02.0.405569235839.issue27937@psf.upfronthosting.co.za>
In-reply-to
Content
Parens do not cause lazy evaluation unless what is parenthesized is a generator comprehension.  An expanded if solution is the correct one.  

If Vinay prefers a one liner, I think you could also write:

   _levelToName.get(level) or _nameToLevel.get(level) or ("Level %s" % level)

Because we know we get back either a True string or None, I don't think there's any ambiguity there.
History
Date User Action Args
2016-09-02 15:03:02r.david.murraysetrecipients: + r.david.murray, vinay.sajip, xiang.zhang, Ondřej Medek
2016-09-02 15:03:02r.david.murraysetmessageid: <1472828582.02.0.405569235839.issue27937@psf.upfronthosting.co.za>
2016-09-02 15:03:02r.david.murraylinkissue27937 messages
2016-09-02 15:03:01r.david.murraycreate