Fix type annotation for selectors (#430)

This commit is contained in:
Adam Urbańczyk
2020-08-12 08:58:35 +02:00
committed by GitHub
parent 7a15fc84a5
commit 83ad6ebd19

View File

@ -699,7 +699,7 @@ class Workplane(object):
def _selectObjects( def _selectObjects(
self, self,
objType: Any, objType: Any,
selector: Optional[Selector] = None, selector: Optional[Union[Selector, str]] = None,
tag: Optional[str] = None, tag: Optional[str] = None,
) -> "Workplane": ) -> "Workplane":
""" """
@ -730,7 +730,7 @@ class Workplane(object):
return self.newObject(toReturn) return self.newObject(toReturn)
def vertices( def vertices(
self, selector: Optional[Selector] = None, tag: Optional[str] = None self, selector: Optional[Union[Selector, str]] = None, tag: Optional[str] = None
) -> "Workplane": ) -> "Workplane":
""" """
Select the vertices of objects on the stack, optionally filtering the selection. If there Select the vertices of objects on the stack, optionally filtering the selection. If there
@ -765,7 +765,7 @@ class Workplane(object):
return self._selectObjects("Vertices", selector, tag) return self._selectObjects("Vertices", selector, tag)
def faces( def faces(
self, selector: Optional[Selector] = None, tag: Optional[str] = None self, selector: Optional[Union[Selector, str]] = None, tag: Optional[str] = None
) -> "Workplane": ) -> "Workplane":
""" """
Select the faces of objects on the stack, optionally filtering the selection. If there are Select the faces of objects on the stack, optionally filtering the selection. If there are
@ -801,7 +801,7 @@ class Workplane(object):
return self._selectObjects("Faces", selector, tag) return self._selectObjects("Faces", selector, tag)
def edges( def edges(
self, selector: Optional[Selector] = None, tag: Optional[str] = None self, selector: Optional[Union[Selector, str]] = None, tag: Optional[str] = None
) -> "Workplane": ) -> "Workplane":
""" """
Select the edges of objects on the stack, optionally filtering the selection. If there are Select the edges of objects on the stack, optionally filtering the selection. If there are
@ -836,7 +836,7 @@ class Workplane(object):
return self._selectObjects("Edges", selector, tag) return self._selectObjects("Edges", selector, tag)
def wires( def wires(
self, selector: Optional[Selector] = None, tag: Optional[str] = None self, selector: Optional[Union[Selector, str]] = None, tag: Optional[str] = None
) -> "Workplane": ) -> "Workplane":
""" """
Select the wires of objects on the stack, optionally filtering the selection. If there are Select the wires of objects on the stack, optionally filtering the selection. If there are
@ -863,7 +863,7 @@ class Workplane(object):
return self._selectObjects("Wires", selector, tag) return self._selectObjects("Wires", selector, tag)
def solids( def solids(
self, selector: Optional[Selector] = None, tag: Optional[str] = None self, selector: Optional[Union[Selector, str]] = None, tag: Optional[str] = None
) -> "Workplane": ) -> "Workplane":
""" """
Select the solids of objects on the stack, optionally filtering the selection. If there are Select the solids of objects on the stack, optionally filtering the selection. If there are
@ -893,7 +893,7 @@ class Workplane(object):
return self._selectObjects("Solids", selector, tag) return self._selectObjects("Solids", selector, tag)
def shells( def shells(
self, selector: Optional[Selector] = None, tag: Optional[str] = None self, selector: Optional[Union[Selector, str]] = None, tag: Optional[str] = None
) -> "Workplane": ) -> "Workplane":
""" """
Select the shells of objects on the stack, optionally filtering the selection. If there are Select the shells of objects on the stack, optionally filtering the selection. If there are
@ -917,7 +917,7 @@ class Workplane(object):
return self._selectObjects("Shells", selector, tag) return self._selectObjects("Shells", selector, tag)
def compounds( def compounds(
self, selector: Optional[Selector] = None, tag: Optional[str] = None self, selector: Optional[Union[Selector, str]] = None, tag: Optional[str] = None
) -> "Workplane": ) -> "Workplane":
""" """
Select compounds on the stack, optionally filtering the selection. If there are multiple Select compounds on the stack, optionally filtering the selection. If there are multiple