diff options
author | reivilibre <38398653+reivilibre@users.noreply.github.com> | 2021-09-10 17:03:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-10 17:03:18 +0100 |
commit | 524b8ead778e51adfd6667a33f2700f8e071c256 (patch) | |
tree | b19acba4d0e2aac7bc5515f0496c8af95a972edd /synapse/util/frozenutils.py | |
parent | Fix 2 typos in docs/log_contexts.md (#10795) (diff) | |
download | synapse-524b8ead778e51adfd6667a33f2700f8e071c256.tar.xz |
Add types to synapse.util. (#10601)
Diffstat (limited to 'synapse/util/frozenutils.py')
-rw-r--r-- | synapse/util/frozenutils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/util/frozenutils.py b/synapse/util/frozenutils.py index 2ac7c2913c..9c405eb4d7 100644 --- a/synapse/util/frozenutils.py +++ b/synapse/util/frozenutils.py @@ -11,11 +11,12 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from typing import Any from frozendict import frozendict -def freeze(o): +def freeze(o: Any) -> Any: if isinstance(o, dict): return frozendict({k: freeze(v) for k, v in o.items()}) @@ -33,7 +34,7 @@ def freeze(o): return o -def unfreeze(o): +def unfreeze(o: Any) -> Any: if isinstance(o, (dict, frozendict)): return {k: unfreeze(v) for k, v in o.items()} |