The current version of conversions.py will convert a number to any base, though py65 only uses binary, hex, and decimal (see "Number Systems" in the docs). Also, this routine will not produce a warning if for some reason the base is given as, say, 17.
The changes replace this code with str.format() commands, making use of the faster built-in functions, simplifying the code to a single if-test, and throw a ValueError if the base is not binary, hex, or decimal. Hexadecimal characters are lowercase as in the original routine.
with Python 3.5.2 on Ubuntu 16.04.3 LTS. As I am unsure of the procedure here, I'd be grateful for further testing by somebody who, uh, actually knows what they are doing.
The current version of conversions.py will convert a number to any base, though py65 only uses binary, hex, and decimal (see "Number Systems" in the docs). Also, this routine will not produce a warning if for some reason the base is given as, say, 17.
The changes replace this code with str.format() commands, making use of the faster built-in functions, simplifying the code to a single if-test, and throw a ValueError if the base is not binary, hex, or decimal. Hexadecimal characters are lowercase as in the original routine.
The changes pass the included tests called as
with Python 3.5.2 on Ubuntu 16.04.3 LTS. As I am unsure of the procedure here, I'd be grateful for further testing by somebody who, uh, actually knows what they are doing.