|
36 | 36 |
|
37 | 37 | # Will be parsed by setup.py to determine package metadata |
38 | 38 | __author__ = 'Stefan Kögl <stefan@skoegl.net>' |
39 | | -__version__ = '1.10' |
| 39 | +__version__ = '1.11' |
40 | 40 | __website__ = 'https://github.com/stefankoegl/python-json-pointer' |
41 | 41 | __license__ = 'Modified BSD License' |
42 | 42 |
|
43 | 43 |
|
44 | 44 | try: |
45 | 45 | from urllib import unquote |
46 | | - from itertools import izip |
47 | 46 | str = unicode |
48 | 47 | except ImportError: # Python 3 |
49 | 48 | from urllib.parse import unquote |
50 | | - izip = zip |
51 | 49 |
|
52 | 50 | try: |
53 | 51 | from collections.abc import Mapping, Sequence |
54 | 52 | except ImportError: # Python 3 |
55 | 53 | from collections import Mapping, Sequence |
56 | 54 |
|
57 | | -from itertools import tee |
58 | 55 | import re |
59 | 56 | import copy |
60 | 57 |
|
@@ -111,26 +108,6 @@ def resolve_pointer(doc, pointer, default=_nothing): |
111 | 108 | return pointer.resolve(doc, default) |
112 | 109 |
|
113 | 110 |
|
114 | | -def pairwise(iterable): |
115 | | - """ Transforms a list to a list of tuples of adjacent items |
116 | | -
|
117 | | - s -> (s0,s1), (s1,s2), (s2, s3), ... |
118 | | -
|
119 | | - >>> list(pairwise([])) |
120 | | - [] |
121 | | -
|
122 | | - >>> list(pairwise([1])) |
123 | | - [] |
124 | | -
|
125 | | - >>> list(pairwise([1, 2, 3, 4])) |
126 | | - [(1, 2), (2, 3), (3, 4)] |
127 | | - """ |
128 | | - a, b = tee(iterable) |
129 | | - for _ in b: |
130 | | - break |
131 | | - return izip(a, b) |
132 | | - |
133 | | - |
134 | 111 | class JsonPointerException(Exception): |
135 | 112 | pass |
136 | 113 |
|
|
0 commit comments