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

Direct link https://gist.github.com/Nurdok/4096182

'oct' should also be added:

    >>> oct(45)
    '055'
One caveat: Python doesn't assume the leading '0' indicates that the number is octal, so you must specify radix 8:

    >>> int('055', 8)
    45


I would rather call that cause to celebrate than a caveat. The design of octal literals in C is ridiculous.

In fact you almost can't write a program without using them inadvertently. :)


Wouldn't it be better to comment on the direct link, where the author is more likely to see it?


Valid point, comment submitted. I assumed the author submitted this to HN in the first place




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

Search: