Skip to content

Commit

Permalink
[builtin/declare] Update type annotations of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Mar 21, 2020
1 parent 3a5eb65 commit 9e94f90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]

Expand All @@ -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):
Expand Down
1 change: 1 addition & 0 deletions osh/builtin_assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9e94f90

Please sign in to comment.