Skip to content

Commit ebc3e1e

Browse files
author
Marco Sulla
committed
added deepfreeze, register, unregister to __init__.pyi (resolves #99)
1 parent 66259cd commit ebc3e1e

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

src/frozendict/__init__.pyi

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
from __future__ import annotations
22

3-
from typing import TypeVar, overload, Optional, Union
3+
from typing import (
4+
TypeVar,
5+
overload,
6+
Optional,
7+
Union,
8+
Any,
9+
Dict,
10+
Callable,
11+
)
12+
13+
from collections.abc import Hashable
414

515
try:
616
from typing import Mapping, Iterable, Iterator, Tuple, Type
@@ -91,3 +101,23 @@ class FreezeError(Exception): pass
91101

92102

93103
class FreezeWarning(UserWarning): pass
104+
105+
# PyCharm complains about returning Hashable, because
106+
# it's not subscriptable
107+
def deepfreeze(
108+
o: Any,
109+
custom_converters: Optional[Dict[Any, Callable[[Any], Hashable]]] = None,
110+
custom_inverse_converters: Optional[Dict[Any, Callable[[Any], Any]]] = None
111+
) -> Any: ...
112+
113+
def register(
114+
to_convert: Any,
115+
converter: Callable[[Any], Any],
116+
*,
117+
inverse: bool = False
118+
) -> None: ...
119+
120+
def unregister(
121+
type: Any,
122+
inverse: bool = False
123+
) -> None: ...

0 commit comments

Comments
 (0)