Skip to content

Commit 9bdc146

Browse files
Fix forward type annotations
1 parent aec5488 commit 9bdc146

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/commercetools/testing/predicates.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def tokenize(self, program):
5353
def __next__(self):
5454
return next(self._iterator)
5555

56-
def _get_tokens(self, program) -> typing.Generator[Symbol, None, None]:
56+
def _get_tokens(self, program) -> typing.Generator["Symbol", None, None]:
5757
buf: typing.List[str] = []
5858
for match in token_pat.finditer(program):
5959
value, identifier, symbol = match.groups()
@@ -203,7 +203,7 @@ def led(self, left: Symbol):
203203
def __repr__(self):
204204
return "<'%s'>(%s, %s)" % (self.value, self.first, self.second)
205205

206-
def ast(self, context: Context):
206+
def ast(self, context: "Context"):
207207
lhs = self.first.ast(context)
208208
if self.second:
209209
rhs = self.second.ast(context)
@@ -294,7 +294,7 @@ def nud(self):
294294
else:
295295
return self.first[0]
296296

297-
def ast(self, context: Context):
297+
def ast(self, context: "Context"):
298298
if not self.second:
299299
return ast.Tuple(
300300
elts=[item.ast(context) for item in self.first], ctx=ast.Load()
@@ -316,7 +316,7 @@ class LiteralToken(Symbol):
316316
def nud(self):
317317
return self
318318

319-
def ast(self, context: Context):
319+
def ast(self, context: "Context"):
320320
if self.value.isdigit():
321321
return ast.Num(n=int(self.value))
322322
if self.value in ["true", "false"]:
@@ -343,7 +343,7 @@ class NameToken(Symbol):
343343
def nud(self):
344344
return self
345345

346-
def ast(self, context: Context):
346+
def ast(self, context: "Context"):
347347
return ast.Name(id=self.value, ctx=ast.Load())
348348

349349

@@ -354,7 +354,7 @@ class Constant(Symbol):
354354
def nud(self):
355355
return self
356356

357-
def ast(self, context: Context):
357+
def ast(self, context: "Context"):
358358
return ast.Constant(value=None, ctx=ast.Load())
359359

360360

@@ -365,7 +365,7 @@ def nud(self):
365365
self.first = self.parser.expression(2000)
366366
return self
367367

368-
def ast(self, context: Context):
368+
def ast(self, context: "Context"):
369369
node = self.first.ast()
370370
node.elts.insert(0, ast.Str(s=self.value))
371371
return node

0 commit comments

Comments
 (0)