jsonpointer 3.7__py3-none-any.whl → 3.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jsonpointer
3
- Version: 3.7
3
+ Version: 3.9
4
4
  Summary: Identify specific nodes in a JSON document (RFC 6901)
5
5
  Home-page: https://github.com/stefankoegl/python-json-pointer
6
6
  Author: Stefan Kögl
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
22
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
23
23
  Classifier: Topic :: Software Development :: Libraries
24
24
  Classifier: Topic :: Utilities
25
+ Classifier: Typing :: Typed
25
26
  Requires-Python: >=3.10
26
27
  Description-Content-Type: text/markdown
27
28
  License-File: LICENSE.txt
@@ -0,0 +1,9 @@
1
+ jsonpointer.py,sha256=SMdpngkGz28E7DZDVru0OPRNehQI_1PB_WhIVC59XNQ,14561
2
+ jsonpointer-3.9.data/scripts/jsonpointer,sha256=XYDDaXnhkb3nANXqdn9OUKtVwSqsOZ8TDgXeawe_O7Y,4102
3
+ jsonpointer-3.9.dist-info/licenses/AUTHORS,sha256=TVgxnQ9ZyHvvWwez_k2w8ZwtfVVFsDTGv3tXyJu-9X8,113
4
+ jsonpointer-3.9.dist-info/licenses/LICENSE.txt,sha256=2LJPFdRyiF94ii1umFhQ8mRie4YBKhe7JCyD8xDZB-U,1413
5
+ jsonpointer-stubs/__init__.pyi,sha256=gHlnw0_btYmRw5m0UutGmAjNdvzS_E_yumlvm8rMX48,1920
6
+ jsonpointer-3.9.dist-info/METADATA,sha256=OXLqFxxk0a_pssU1BVff3yFHew-XbtK8nbrwc_Rs--o,2666
7
+ jsonpointer-3.9.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
8
+ jsonpointer-3.9.dist-info/top_level.txt,sha256=qkC_MNB0W-Hw6fCuc2X4V_xpd0WzjwHRObTmphI1SkM,30
9
+ jsonpointer-3.9.dist-info/RECORD,,
@@ -0,0 +1,2 @@
1
+ jsonpointer
2
+ jsonpointer-stubs
@@ -0,0 +1,63 @@
1
+ from collections.abc import Iterable, Iterator
2
+ from re import Pattern
3
+ from typing import Any, Final, TypeVar
4
+
5
+ from typing_extensions import Self
6
+
7
+ _T = TypeVar("_T")
8
+
9
+ __author__: Final[str]
10
+ __version__: Final[str]
11
+ __website__: Final[str]
12
+ __license__: Final[str]
13
+
14
+ VERBOSE_EXCEPTIONS: bool
15
+
16
+ def set_pointer(
17
+ doc: Any,
18
+ pointer: str,
19
+ value: Any,
20
+ inplace: bool = True,
21
+ create: bool = False,
22
+ ) -> Any: ...
23
+ def resolve_pointer(doc: Any, pointer: str, default: Any = ...) -> Any: ...
24
+ def pairwise(iterable: Iterable[_T]) -> Iterator[tuple[_T, _T]]: ...
25
+
26
+ class JsonPointerException(Exception): ...
27
+
28
+ class EndOfList:
29
+ list_: Any
30
+ def __init__(self, list_: Any) -> None: ...
31
+
32
+ class JsonPointer:
33
+ _RE_ARRAY_INDEX: Pattern[str]
34
+ _RE_INVALID_ESCAPE: Pattern[str]
35
+ parts: list[str]
36
+ def __init__(self, pointer: str) -> None: ...
37
+ def to_last(self, doc: Any) -> tuple[Any, str | int | None]: ...
38
+ def resolve(self, doc: Any, default: Any = ...) -> Any: ...
39
+ def get(self, doc: Any, default: Any = ...) -> Any: ...
40
+ def set(
41
+ self,
42
+ doc: Any,
43
+ value: Any,
44
+ inplace: bool = True,
45
+ create: bool = False,
46
+ ) -> Any: ...
47
+ @classmethod
48
+ def get_part(cls, doc: Any, part: str | int) -> str | int: ...
49
+ def get_parts(self) -> list[str]: ...
50
+ def walk(self, doc: Any, part: str | int) -> Any: ...
51
+ def contains(self, ptr: JsonPointer) -> bool: ...
52
+ def __contains__(self, item: JsonPointer) -> bool: ...
53
+ def join(self, suffix: JsonPointer | str | Iterable[object]) -> Self: ...
54
+ def __truediv__(self, suffix: JsonPointer | str | Iterable[object]) -> Self: ...
55
+ @property
56
+ def path(self) -> str: ...
57
+ def __eq__(self, other: object) -> bool: ...
58
+ def __hash__(self) -> int: ...
59
+ @classmethod
60
+ def from_parts(cls, parts: Iterable[object]) -> Self: ...
61
+
62
+ def escape(s: str) -> str: ...
63
+ def unescape(s: str) -> str: ...
jsonpointer.py CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  # Will be parsed by setup.py to determine package metadata
34
34
  __author__ = 'Stefan Kögl <stefan@skoegl.net>'
35
- __version__ = '3.7'
35
+ __version__ = '3.9'
36
36
  __website__ = 'https://github.com/stefankoegl/python-json-pointer'
37
37
  __license__ = 'Modified BSD License'
38
38
 
@@ -275,8 +275,9 @@ class JsonPointer:
275
275
  elif isinstance(parent, Sequence) and part == '-':
276
276
  try:
277
277
  parent.append(value)
278
- except AttributeError as e:
279
- # immutable sequences, such as tuples, can't be appended to
278
+ except (AttributeError, TypeError) as e:
279
+ # Immutable sequences can't be appended to; typed sequences
280
+ # can reject the value just like an indexed assignment.
280
281
  raise JsonPointerException("Invalid assignment target: %s" % (e,))
281
282
  else:
282
283
  try:
@@ -1,8 +0,0 @@
1
- jsonpointer.py,sha256=4TOqZJXwWYuWlVzJZXjMn2Uss7lJVMVtIf0DozdsOYE,14476
2
- jsonpointer-3.7.data/scripts/jsonpointer,sha256=XYDDaXnhkb3nANXqdn9OUKtVwSqsOZ8TDgXeawe_O7Y,4102
3
- jsonpointer-3.7.dist-info/licenses/AUTHORS,sha256=TVgxnQ9ZyHvvWwez_k2w8ZwtfVVFsDTGv3tXyJu-9X8,113
4
- jsonpointer-3.7.dist-info/licenses/LICENSE.txt,sha256=2LJPFdRyiF94ii1umFhQ8mRie4YBKhe7JCyD8xDZB-U,1413
5
- jsonpointer-3.7.dist-info/METADATA,sha256=WIVhLh9Vp1aquJuk449r0ydERhPbLNCoTvuv2qeSKX4,2638
6
- jsonpointer-3.7.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
7
- jsonpointer-3.7.dist-info/top_level.txt,sha256=BsUcar_C0nZzPGV2ackrJ9CpVU8_0W_pHYKwpdnWddM,12
8
- jsonpointer-3.7.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- jsonpointer