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@python.org
>http://mail.python.org/mailman/listinfo/python-dev
>Unsubscribe: 
>http://mail.python.org/mailman/options/python-dev/rhettinger%40ewtllc.com
>  
>

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to