py: Implement long int parsing in int(...).

Addresses issue #627.