Skip to content

Commit 6b0ae85

Browse files
committed
fix: typing error in variables.py and its test
1 parent 7d2c82a commit 6b0ae85

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/dotenv/variables.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22
from abc import ABCMeta
3-
from typing import Iterator, Mapping, Optional, Pattern
3+
from typing import Iterator, Mapping, Optional, Pattern, List
44

55

66
class Atom():
@@ -36,7 +36,7 @@ def resolve(self, env: Mapping[str, Optional[str]]) -> str:
3636

3737

3838
class 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:
7675
def 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

Comments
 (0)