Loosen requirements from List to Sequence

This commit is contained in:
Jan Petykiewicz 2020-09-18 19:07:14 -07:00
parent 64fbd08cac
commit 5f72fe318f
2 changed files with 6 additions and 6 deletions

View File

@ -50,7 +50,7 @@ path_cap_map = {
}
def build(patterns: Union[Pattern, List[Pattern]],
def build(patterns: Union[Pattern, Sequence[Pattern]],
meters_per_unit: float,
logical_units_per_unit: float = 1,
library_name: str = 'masque-gdsii-write',
@ -136,7 +136,7 @@ def build(patterns: Union[Pattern, List[Pattern]],
return lib
def write(patterns: Union[Pattern, List[Pattern]],
def write(patterns: Union[Pattern, Sequence[Pattern]],
stream: io.BufferedIOBase,
*args,
**kwargs):
@ -154,7 +154,7 @@ def write(patterns: Union[Pattern, List[Pattern]],
lib.save(stream)
return
def writefile(patterns: Union[List[Pattern], Pattern],
def writefile(patterns: Union[Sequence[Pattern], Pattern],
filename: Union[str, pathlib.Path],
*args,
**kwargs,

View File

@ -50,7 +50,7 @@ path_cap_map = {
#TODO implement properties
#TODO implement more shape types?
def build(patterns: Union[Pattern, List[Pattern]],
def build(patterns: Union[Pattern, Sequence[Pattern]],
units_per_micron: int,
layer_map: Optional[Dict[str, Union[int, Tuple[int, int]]]] = None,
*,
@ -156,7 +156,7 @@ def build(patterns: Union[Pattern, List[Pattern]],
return lib
def write(patterns: Union[List[Pattern], Pattern],
def write(patterns: Union[Sequence[Pattern], Pattern],
stream: io.BufferedIOBase,
*args,
**kwargs):
@ -174,7 +174,7 @@ def write(patterns: Union[List[Pattern], Pattern],
lib.write(stream)
def writefile(patterns: Union[List[Pattern], Pattern],
def writefile(patterns: Union[Sequence[Pattern], Pattern],
filename: Union[str, pathlib.Path],
*args,
**kwargs,