11import re
22from abc import ABCMeta
3- from typing import Iterator , Mapping , Optional , Pattern
3+ from typing import Iterator , Mapping , Optional , Pattern , List
44
55
66class Atom ():
@@ -36,7 +36,7 @@ def resolve(self, env: Mapping[str, Optional[str]]) -> str:
3636
3737
3838class Variable (Atom ):
39- def __init__ (self , name : str , default : Optional [Iterator [Atom ]]) -> None :
39+ def __init__ (self , name : str , default : Optional [List [Atom ]]) -> None :
4040 self .name = name
4141 self .default = default
4242
@@ -52,7 +52,6 @@ def __hash__(self) -> int:
5252 return hash ((self .__class__ , self .name , self .default ))
5353
5454 def resolve (self , env : Mapping [str , Optional [str ]]) -> str :
55- # default = self.default if self.default is not None else ""
5655 default = "" .join (atom .resolve (env ) for atom in self .default ) if self .default is not None else ""
5756 result = env .get (self .name , default )
5857 return result if result is not None else ""
@@ -76,7 +75,7 @@ def resolve(self, env: Mapping[str, Optional[str]]) -> str:
7675def parse_variables (value : str ) -> Iterator [Atom ]:
7776 cursor = 0
7877
79- starts = []
78+ starts : List [ int ] = []
8079 esc = False
8180 for i in range (len (value )):
8281 if esc :
0 commit comments