[Python-ideas] Default return values to int and float
Jan Kaliszewski
zuo at chopin.edu.pl
Thu Oct 6 23:54:51 CEST 2011
More information about the Python-ideas mailing list
Thu Oct 6 23:54:51 CEST 2011
- Previous message: [Python-ideas] Default return values to int and float
- Next message: [Python-ideas] Changing semantics of for-loop variable
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Michael Foord dixit (2011-10-03, 14:55): > http://msdn.microsoft.com/en-us/library/994c0zb1.aspx > > The pattern there is equivalent to returning an extra result as well as the > converted value - a boolean indicating whether or not the conversion > succeeded (with the "converted value" being 0.0 where conversion fails). A > Python version might look like: > > success, value = float.parse('thing') > if success: > ... Nice. +1 from me. *j
- Previous message: [Python-ideas] Default return values to int and float
- Next message: [Python-ideas] Changing semantics of for-loop variable
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list