diff --git a/core/state.py b/core/state.py index 401720bdcf..d2a473edc7 100644 --- a/core/state.py +++ b/core/state.py @@ -1388,7 +1388,7 @@ def GetVar(self, name, lookup_mode=scope_e.Dynamic): return value.Undef() def GetCell(self, name, lookup_mode = scope_e.Dynamic): - # type: (str) -> cell + # type: (str, scope_t) -> cell """For the 'repr' builtin.""" cell, _ = self._ResolveNameOnly(name, lookup_mode) return cell @@ -1498,7 +1498,7 @@ def GetAllVars(self): return result def GetAllCells(self, lookup_mode = scope_e.Dynamic): - # type: () -> Dict[str, cell] + # type: (scope_t) -> Dict[str, cell] """Get all variables and their values, for 'set' builtin. """ result = {} # type: Dict[str, str] @@ -1521,6 +1521,7 @@ def GetAllCells(self, lookup_mode = scope_e.Dynamic): return result def IsGlobalScope(self): + # type: () -> bool return len(self.var_stack) == 1 def SetLocalString(mem, name, s): diff --git a/osh/builtin_assign.py b/osh/builtin_assign.py index b8db85fed6..a2aae31950 100644 --- a/osh/builtin_assign.py +++ b/osh/builtin_assign.py @@ -27,6 +27,7 @@ def _PrintVariables(mem, cmd_val, arg, print_flags, readonly = False, exported = False): + # type: (Mem, value_t, Any, bool, bool, bool) -> int flag_g = getattr(arg, 'g', None) flag_n = getattr(arg, 'n', None) flag_r = getattr(arg, 'r', None)