Skip to content

Commit

Permalink
Merge pull request #409 from MatthiasJ1/location_type
Browse files Browse the repository at this point in the history
Fix Location.* typing
  • Loading branch information
gumyr authored Dec 1, 2023
2 parents 706c284 + e95ddc3 commit 4db8b6c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/build123d/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import json
import logging
from math import degrees, pi, radians
from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union, overload
from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union, overload, TypeVar

from OCP.Bnd import Bnd_Box, Bnd_OBB
from OCP.BRep import BRep_Tool
Expand Down Expand Up @@ -1165,7 +1165,8 @@ def __deepcopy__(self, _memo) -> Location:
"""Lib/copy.py deep copy"""
return Location(self.wrapped.Transformation())

def __mul__(self, other: Location) -> Location:
T = TypeVar("T", bound=Union["Location", "Shape"])
def __mul__(self, other: T) -> T:
"""Combine locations"""
if hasattr(other, "wrapped") and not isinstance(
other.wrapped, TopLoc_Location
Expand Down

0 comments on commit 4db8b6c

Please sign in to comment.