CPython implementation for issue #5.