Skip to content

Commit b2ff25e

Browse files
committed
Intermediate changes
commit_hash:6a1c19eb4925f3dd59db5299f1072962932c057b
1 parent 4013e61 commit b2ff25e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

yt/python/yt/common.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import sys
3939
import time
4040
import types
41+
import typing
4142
import string
4243
import warnings
4344

@@ -47,6 +48,8 @@
4748

4849
YT_NULL_TRANSACTION_ID = "0-0-0-0"
4950

51+
_T = typing.TypeVar('_T')
52+
5053

5154
# Deprecation stuff.
5255
class YtDeprecationWarning(DeprecationWarning):
@@ -620,7 +623,7 @@ def require(condition, exception_func):
620623
raise exception_func()
621624

622625

623-
def update_inplace(object, patch):
626+
def update_inplace(object: _T, patch) -> _T:
624627
"""Apply patch to object inplace"""
625628
if isinstance(patch, Mapping) and isinstance(object, Mapping):
626629
for key, value in iteritems(patch):
@@ -639,7 +642,7 @@ def update_inplace(object, patch):
639642
return object
640643

641644

642-
def update(object, patch):
645+
def update(object: _T, patch) -> _T:
643646
"""Apply patch to object without modifying original object or patch"""
644647
if patch is None:
645648
return copy.deepcopy(object)

0 commit comments

Comments
 (0)