diff --git a/python/gherkin/ast_builder.py b/python/gherkin/ast_builder.py index 212f5156a..15a50a55c 100644 --- a/python/gherkin/ast_builder.py +++ b/python/gherkin/ast_builder.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import TypedDict, cast, TypeVar, Union, List +from typing import TypedDict, cast, TypeVar, Union from .ast_node import AstNode from .errors import AstBuilderException @@ -140,7 +140,7 @@ def get_description(node: AstNode) -> str: @staticmethod def get_steps(node: AstNode) -> list[Step]: - return cast(List[Step], node.get_items("Step")) + return cast(list[Step], node.get_items("Step")) def transform_node( self, node: AstNode @@ -247,7 +247,7 @@ def transform_node( examples_line = examples_node.get_token("ExamplesLine") description = self.get_description(examples_node) examples_table_rows = cast( - List[TableRow], examples_node.get_single("ExamplesTable") + list[TableRow], examples_node.get_single("ExamplesTable") ) table_header = examples_table_rows[0] if examples_table_rows else None table_body = examples_table_rows[1:] if examples_table_rows else [] diff --git a/python/gherkin/dialect.py b/python/gherkin/dialect.py index c637a0211..f52f15d7b 100644 --- a/python/gherkin/dialect.py +++ b/python/gherkin/dialect.py @@ -14,17 +14,17 @@ DialectSpec = TypedDict( "DialectSpec", { - "and": List[str], - "background": List[str], - "but": List[str], - "examples": List[str], - "feature": List[str], - "given": List[str], - "rule": List[str], - "scenario": List[str], - "scenarioOutline": List[str], - "then": List[str], - "when": List[str], + "and": list[str], + "background": list[str], + "but": list[str], + "examples": list[str], + "feature": list[str], + "given": list[str], + "rule": list[str], + "scenario": list[str], + "scenarioOutline": list[str], + "then": list[str], + "when": list[str], }, ) diff --git a/python/test/count_symbols_test.py b/python/test/count_symbols_test.py index 0d41f7553..b449ff49b 100644 --- a/python/test/count_symbols_test.py +++ b/python/test/count_symbols_test.py @@ -1,6 +1,3 @@ -# coding=utf-8 - - def test_count_length_of_astral_point_symbols_correctly(): string = "\U0001f63b" assert 1 == len(string) diff --git a/python/test/gherkin_test.py b/python/test/gherkin_test.py index ee3023b18..7f243cabc 100644 --- a/python/test/gherkin_test.py +++ b/python/test/gherkin_test.py @@ -1,4 +1,3 @@ -# coding=utf-8 from gherkin.token_scanner import TokenScanner from gherkin.token_matcher import TokenMatcher from gherkin.parser import Parser diff --git a/python/test/pickles_test/compiler_test.py b/python/test/pickles_test/compiler_test.py index 4c2702284..8081f767b 100644 --- a/python/test/pickles_test/compiler_test.py +++ b/python/test/pickles_test/compiler_test.py @@ -1,4 +1,3 @@ -# coding=utf-8 import json import textwrap