[issue4479] True division is not smart -> proposing smart True division

Mark Dickinson report at bugs.python.org
Mon Dec 1 12:15:26 CET 2008


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Having different result types based on the input
> values would not be "smart" in my book, rather "incredibly fragile".

Well, there are precedents:

>>> type(2**3)
<type 'int'>
>>> type(2**-3)
<type 'float'>

My initial reaction to this was negative, but I'm struggling to think of 
situations where it would be bad.  I'm also struggling to think of 
situations where it would be useful.   Maybe Monday morning is just a 
bad time for thinking. :-)

Might be worth a discussion on python-ideas, at least?

To the OP:  you should be aware that getting this accepted into Python 
would likely be very hard.  You'd need at least a PEP explaining clearly 
the benefits of such a change, a working patch, and strong community 
support.  And even then it might have to wait for Python 4.0.  Which 
Guido has said probably won't happen...

----------
nosy: +marketdickinson

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4479>
_______________________________________


More information about the Python-bugs-list mailing list