Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess I don't mind it that much.

I went to check out the operation and it seems a on two ints returns an int if the power is a nonnegative int, and a float if it's negative nonzero, in both 2.7 and 3. I didn't expect this kind of inconsistency from python, really.

    >>> type(2 ** 1)
    <type 'int'>
    >>> type(2 ** -1)
    <type 'float'>
I guess it does follow the last line of the guidelines there, though. Looking at this power example, the division returning float now is actually an increase in consistency.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: