Greg Ewing wrote: >As an aside, does anyone else think that it would be >useful to have a builtin which rounds and converts to >an int in one go? Whenever I use round(), I almost >always want the result as an int, and making me do >it in two steps seems unnecessarily bothersome. > > I think this would harm more than it would help. It more confusing to have several rounding-thingies to choose from than it is have an explicit two-step. BTW, I thought the traditional idiom (for positive numbers) was: int(x+.5) >Since automatic float->int coercion is being increasingly >disallowed, use cases for this are becoming more and more >common. > >-- >Greg >_______________________________________________ >Python-Dev mailing list >Python-Dev at python.org >http://mail.python.org/mailman/listinfo/python-dev >Unsubscribe: http://mail.python.org/mailman/options/python-dev/rhettinger%40ewtllc.com > >
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