Replies: 1 comment
-
Hi Rob, Inheriting from Testing the standard exceptions in I think you could safely ignore multiple inheritance here and go with something like this: The important part being that Depending on how strict you're being with your port, you could instead choose to follow Jackson's example and use a "missing" object to indicate the absence of a node instead of throwing exceptions, a bit like Cheers, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In exceptions.py JSONPointerIndexError, JSONPointerKeyError, and JSONPointerTypeError use multiple inheritance to extend from both JSONPointerResolutionError, and IndexError, KeyError, and TypeError respectively.
Java doesn't have multiple class inheritance. I could get tricky with using interfaces to try to duplicate this, but first I wanted to ask what is your design goal with this class hierarchy? In test_json_pointer.py, you're catching the Python built-ins and not your custom Error classes. Is there a reason you are not just catching JSONPointerIndexError, JSONPointerKeyError, and JSONPointerTypeError?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions