You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: make join() return self.__class__ to support subclassing #64
If join() (and probably other methods) instead returned instances of self.__class__ instead of JsonPointer normal behavior would stay the same while allowing subclasses to work as expected.
E.g. with join() as:
defjoin(self, suffix):
""" Returns a new JsonPointer with the given suffix append to this ptr """ifisinstance(suffix, self.__class__):
suffix_parts=suffix.partselifisinstance(suffix, str):
suffix_parts=self.__class__(suffix).partselse:
suffix_parts=suffixtry:
returnself.__class__.from_parts(chain(self.parts, suffix_parts))
except: # noqa E722raiseJsonPointerException("Invalid suffix")
Activity