Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 7 additions and 1 deletion.
  1. +7 −1 jsonpointer.py
View
8 jsonpointer.py
@@ -36,7 +36,7 @@
# Will be parsed by setup.py to determine package metadata
__author__ = 'Stefan Kögl <stefan@skoegl.net>'
-__version__ = '0.4'
+__version__ = '0.5'
__website__ = 'https://github.com/stefankoegl/python-json-pointer'
__license__ = 'Modified BSD License'
@@ -265,6 +265,12 @@ def walk(self, doc, part):
+ def contains(self, ptr):
+ """" Returns True if self contains the given ptr """
+ return len(self.parts) > len(ptr.parts) and \
+ self.parts[:len(ptr.parts)] == ptr.parts
+
+
def pairwise(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
a, b = tee(iterable)

No commit comments for this range

Something went wrong with that request. Please try again.