Skip to content

Commit

Permalink
Fix ParamResolver.param_dict type (#2550)
Browse files Browse the repository at this point in the history
* fix type

* change Basic to Symbol

* change Symbol to Basic
  • Loading branch information
kevinsung authored Nov 14, 2019
1 parent 4ff38cf commit 23ce7ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cirq/study/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import cirq


ParamDictType = Dict[Union[str, sympy.Basic], Union[float, str, sympy.Symbol]]
ParamDictType = Dict[Union[str, sympy.Symbol], Union[float, str, sympy.Basic]]
document(
ParamDictType, # type: ignore
"""Dictionary from symbols to values.""")
Expand Down Expand Up @@ -57,9 +57,8 @@ def __init__(self,
return # Already initialized. Got wrapped as part of the __new__.

self._param_hash = None
self.param_dict = cast(
Dict[Union[str, sympy.Symbol], Union[float, str, sympy.Symbol]],
{} if param_dict is None else param_dict)
self.param_dict = cast(ParamDictType,
{} if param_dict is None else param_dict)

def value_of(self,
value: Union[sympy.Basic, float, str]) -> 'cirq.TParamVal':
Expand Down

0 comments on commit 23ce7ca

Please sign in to comment.