type annotation updates

This commit is contained in:
Jan Petykiewicz 2024-07-28 19:44:04 -07:00
commit 9d5b1ef5e6
15 changed files with 28 additions and 28 deletions

View file

@ -138,7 +138,7 @@ class Builder(PortList):
@classmethod
def interface(
cls,
cls: type['Builder'],
source: PortList | Mapping[str, Port] | str,
*,
library: ILibrary | None = None,
@ -276,7 +276,7 @@ class Builder(PortList):
logger.error('Skipping plug() since device is dead')
return self
if not isinstance(other, (str, Abstract, Pattern)):
if not isinstance(other, str | Abstract | Pattern):
# We got a Tree; add it into self.library and grab an Abstract for it
other = self.library << other
@ -348,7 +348,7 @@ class Builder(PortList):
logger.error('Skipping place() since device is dead')
return self
if not isinstance(other, (str, Abstract, Pattern)):
if not isinstance(other, str | Abstract | Pattern):
# We got a Tree; add it into self.library and grab an Abstract for it
other = self.library << other

View file

@ -175,7 +175,7 @@ class Pather(Builder):
@classmethod
def from_builder(
cls,
cls: type['Pather'],
builder: Builder,
*,
tools: Tool | MutableMapping[str | None, Tool] | None = None,
@ -195,7 +195,7 @@ class Pather(Builder):
@classmethod
def interface(
cls,
cls: type['Pather'],
source: PortList | Mapping[str, Port] | str,
*,
library: ILibrary | None = None,

View file

@ -128,7 +128,7 @@ class RenderPather(PortList):
@classmethod
def interface(
cls,
cls: type['RenderPather'],
source: PortList | Mapping[str, Port] | str,
*,
library: ILibrary | None = None,