You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'm wondering if there's a direct way to exclude type hints within mutmut. For example, in the following code, I'm getting errors because mutmut tries to mutate the "|" operator to its counterpart "&":
@dataclass
class Specification:
filter: Criteria | None = None # Mutates to => Criteria & None = None
order: Order | None = None # Also happens in all of the cases below
limit: int | None = None
offset: int | None = None
Plus it becomes more complex in a scenario like this where I can't just whitelist the entire line:
user: User | None = self.repo.match(Specification(filter=Equals("email", user.email) | Equals("username", user.username)))
On the other hand, if mutmut cannot handle this right now in a straightforward manner, would it be possible for me to contribute to the repository by adding this functionality?
The text was updated successfully, but these errors were encountered:
Hmm. I guess in general it would be a good idea to ignore type hints totally, except they are used for behavior in stuff like pydantic.
I am very much open to a PR. Not sure what should be done though. The smallest change would be for the operator mutation for or to not trigger if inside an annotation. A big ugly but would fit this case.
Hi! I'm wondering if there's a direct way to exclude type hints within mutmut. For example, in the following code, I'm getting errors because mutmut tries to mutate the "|" operator to its counterpart "&":
Plus it becomes more complex in a scenario like this where I can't just whitelist the entire line:
On the other hand, if mutmut cannot handle this right now in a straightforward manner, would it be possible for me to contribute to the repository by adding this functionality?
The text was updated successfully, but these errors were encountered: