-
Notifications
You must be signed in to change notification settings - Fork 354
Open
Labels
devops 🚀An issue related to CI/CD.An issue related to CI/CD.good first issue 👶A place to get started.A place to get started.help wanted 👋Looking for takers.Looking for takers.
Description
In #1119 @erichulburd noticed that make typecheck
was failing with mypy 0.750 and so pinned our mypy dependency to 0.740 as a workaround.
The type errors on mypy 0.750 stem from the definition of ExpressionDesignator
in quilatom.py
, which is a nested Union
type like so:
ExpressionValueDesignator = Union[int, float, complex]
ExpressionDesignator = Union['Expression', ExpressionValueDesignator]
Long story short, mypy 0.750 doesn't like the nested ExpressionValueDesignator
.
As a workaround, flattening the Union
like so resolves the issue:
ExpressionValueDesignator = Union[int, float, complex]
-ExpressionDesignator = Union['Expression', ExpressionValueDesignator]
+ExpressionDesignator = Union['Expression', int, float, complex]
I've opened a mypy issue upstream.
For now we should just keep mypy pinned to 0.740, but when/if the above mypy issue is addressed, we me might consider upgrading, or else apply the above patch if the mypy issue is resolved as "wont fix".
karalekas
Metadata
Metadata
Assignees
Labels
devops 🚀An issue related to CI/CD.An issue related to CI/CD.good first issue 👶A place to get started.A place to get started.help wanted 👋Looking for takers.Looking for takers.