Skip to content

Commit c03e347

Browse files
MichaelBroughtontonybruguier
authored andcommitted
1 parent 8f0f4d5 commit c03e347

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cirq-core/cirq/protocols/pow_protocol.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Any, overload, TYPE_CHECKING, TypeVar, Union
15+
from typing import Any, cast, overload, TYPE_CHECKING, TypeVar, Union, Callable
1616

1717
if TYPE_CHECKING:
1818
import cirq
@@ -81,7 +81,7 @@ def pow(val: Any, exponent: Any, default: Any = RaiseTypeErrorIfNotProvided) ->
8181
TypeError: `val` doesn't have a __pow__ method (or that method returned
8282
NotImplemented) and no `default` value was specified.
8383
"""
84-
raiser = getattr(val, '__pow__', None)
84+
raiser = cast(Union[None, Callable], getattr(val, '__pow__', None))
8585
result = NotImplemented if raiser is None else raiser(exponent)
8686
if result is not NotImplemented:
8787
return result
+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
-r flynt.txt
22
black==21.12b0
3+
click<=8.0.4

0 commit comments

Comments
 (0)