File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 38
38
import sys
39
39
import time
40
40
import types
41
+ import typing
41
42
import string
42
43
import warnings
43
44
47
48
48
49
YT_NULL_TRANSACTION_ID = "0-0-0-0"
49
50
51
+ _T = typing .TypeVar ('_T' )
52
+
50
53
51
54
# Deprecation stuff.
52
55
class YtDeprecationWarning (DeprecationWarning ):
@@ -620,7 +623,7 @@ def require(condition, exception_func):
620
623
raise exception_func ()
621
624
622
625
623
- def update_inplace (object , patch ):
626
+ def update_inplace (object : _T , patch ) -> _T :
624
627
"""Apply patch to object inplace"""
625
628
if isinstance (patch , Mapping ) and isinstance (object , Mapping ):
626
629
for key , value in iteritems (patch ):
@@ -639,7 +642,7 @@ def update_inplace(object, patch):
639
642
return object
640
643
641
644
642
- def update (object , patch ):
645
+ def update (object : _T , patch ) -> _T :
643
646
"""Apply patch to object without modifying original object or patch"""
644
647
if patch is None :
645
648
return copy .deepcopy (object )
You can’t perform that action at this time.
0 commit comments