Skip to content

Commit 72827fc

Browse files
authored
Use Self type for Immutable (#1603)
1 parent 7a0e87b commit 72827fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

returns/primitives/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Any, Dict, NoReturn
22

3+
from typing_extensions import Self
4+
35
from returns.primitives.exceptions import ImmutableStateError
46

57

@@ -29,11 +31,11 @@ class Immutable(object):
2931

3032
__slots__ = ()
3133

32-
def __copy__(self) -> 'Immutable':
34+
def __copy__(self) -> Self:
3335
"""Returns itself."""
3436
return self
3537

36-
def __deepcopy__(self, memo: Dict[Any, Any]) -> 'Immutable':
38+
def __deepcopy__(self, memo: Dict[Any, Any]) -> Self:
3739
"""Returns itself."""
3840
return self
3941

0 commit comments

Comments
 (0)