Feature suggestion -- return if true
zildjohn01
zildjohn01 at gmail.com
Mon Apr 11 19:17:25 EDT 2011
More information about the Python-list mailing list
Mon Apr 11 19:17:25 EDT 2011
- Previous message (by thread): [Feature Request] dict.setdefault()
- Next message (by thread): Feature suggestion -- return if true
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This is an idea I've had bouncing around in my head for a long time
now. I propose the following syntax:
return? expr
be expanded to
_temp = expr
if _temp: return _temp
It's a pattern I use all the time in my code, and although it's a bit
unorthodox, IMO it's concise, readable, and easily understandable.
Thoughts?
- Previous message (by thread): [Feature Request] dict.setdefault()
- Next message (by thread): Feature suggestion -- return if true
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list