Skip to content

Commit

Permalink
[ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCensi committed Oct 30, 2024
1 parent 5660ef3 commit 9e8a715
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/contracts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# from .library import (CheckCallable, Extension, SeparateContext,
# identifier_expression)
def check_contracts(contracts: List[str], values: List[object], context_variables=None):
def check_contracts(contracts: list[str], values: list[object], context_variables=None):
"""
Checks that the values respect the contract.
Not a public function -- no friendly messages.
Expand Down
16 changes: 8 additions & 8 deletions src/contracts/test_registrar.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
from typing import List, Tuple, Union
from typing import Union

good_examples: List[Tuple[Union[str, List[str]], object, bool]] = []
syntax_fail_examples: List[str] = []
semantic_fail_examples: List[Tuple[Union[str, List[str]], object, bool]] = []
contract_fail_examples: List[Tuple[Union[str, List[str]], object, bool]] = []
good_examples: list[tuple[Union[str, list[str]], object, bool]] = []
syntax_fail_examples: list[str] = []
semantic_fail_examples: list[tuple[Union[str, list[str]], object, bool]] = []
contract_fail_examples: list[tuple[Union[str, list[str]], object, bool]] = []


# If exact is True, we are providing a canonical form
# for the expression and we want it back.
def good(a: Union[str, List[str]], b: object, exact: bool = True):
def good(a: Union[str, list[str]], b: object, exact: bool = True):
good_examples.append((a, b, exact))


def semantic_fail(a: Union[str, List[str]], b: object, exact=True):
def semantic_fail(a: Union[str, list[str]], b: object, exact=True):
semantic_fail_examples.append((a, b, exact))


def syntax_fail(s: str):
syntax_fail_examples.append(s)


def fail(a: Union[str, List[str]], b: object, exact: bool = True):
def fail(a: Union[str, list[str]], b: object, exact: bool = True):
contract_fail_examples.append((a, b, exact))

0 comments on commit 9e8a715

Please sign in to comment.