beeware / batavia

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

Update tests for isinstance to use the two argument base and fix the error messages #785

Closed martica closed 5 years ago

martica commented 5 years ago

isinstance takes two args, the existing tests were just testing that it always returned an error about the arg count.

isinstance now expects to receive arguments that are types. The normal type names are in the global scope as builtin functions, but not types. Prior to the update to the argument validation, isinstance returned False for things like isinstance(1, int), but true for isinstance(1, type(1)).

The next step here is to make int == type(1) and such for all the type names.

PR Checklist: