We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

oct

oct(x)

Converts an integer number (of any size) to an octal string. The result is a valid Python expression.

To make this function work on your own classes, implement the __oct__ method.

Changed in version 2.4: Formerly only returned an unsigned literal.