Skip to content

Commit 2b73ab3

Browse files
committed
Some type hinting
1 parent b6bc7d2 commit 2b73ab3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

dpath/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class MergeType(IntFlag):
1515

1616

1717
# Type alias for dict path segments where integers are explicitly casted
18-
IntAwareSegment = Union[int, Any]
18+
PathSegment = Union[int, str]
1919

2020

21-
def _split_path(path: str, separator: str) -> Union[List[IntAwareSegment], IntAwareSegment]:
21+
def _split_path(path: str, separator: str) -> Union[List[PathSegment], PathSegment]:
2222
"""
2323
Given a path and separator, return a tuple of segments. If path is
2424
already a non-leaf thing, return it.
@@ -45,7 +45,7 @@ def _split_path(path: str, separator: str) -> Union[List[IntAwareSegment], IntAw
4545
return split_segments
4646

4747

48-
def new(obj, path, value, separator='/', creator=None):
48+
def new(obj: Dict, path: str, value, separator="/", creator=None):
4949
"""
5050
Set the element at the terminus of path to value, and create
5151
it if it does not exist (as opposed to 'set' that can only

0 commit comments

Comments
 (0)