Improved handling of arbitary data types for the Python 3 implementation