Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TestPositionalsNargsOptional adapted from test_argparse.py gives an e…
…rror 'AssertionError: {} deepEqual {"foo":null}' A dozen other classes in the py test file give similar errors. The problem is that the JS Namespace class treads null differently than the python None. Python gives every 'dest' at least a None value. The JS Namespace tries to treat a null value as the same as undefined. However, because sometimes values are set with Namespace.set(), and other times with ordinary object assignment, sometimes a null value appears in a namespace. These tests do pass if a modified deepEqual is used, one that ignores differences between {bar: null} and {} Python has a special Namespace class because its base Object class does not directly accept attributes. It also defines a nice display method. The resulting class is essentially the same as the Javascript object. To better match the Python: - change namespace.isset() to use _.has() instead of !! (!!null is false) - remove the null test in namespace.set() - the _.extend() alternative is not used. - namespace.get() is not used
- Loading branch information