beeware / batavia

A JavaScript implementation of the Python virtual machine.
http://pybee.org/batavia
Other
1.39k stars 424 forks source link

fixed implementation of hex() builtin - all tests pass #748

Closed nicklambourne closed 6 years ago

nicklambourne commented 6 years ago

Changes

Completed the implementation of hex for all input types. Had to introduce a dependency to the implementation (BigNumber - previously used in the implementation of the Integer type) due to the differences in how Python and Javascript handle large numbers. Unsupported types are now handled with Python-compliant errors.

Problem

The builtin function hex was failing for input from every builtin type, including Bool and Int, which it is supposed to support. Other types were failing with incorrect error types.

Fixes

Contributes to fixing #47

PR Checklist: