File tree 2 files changed +5
-7
lines changed 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
[tool .poetry ]
2
2
name = " taskiq-dependencies"
3
- version = " 1.1.1 "
3
+ version = " 1.1.2 "
4
4
description = " FastAPI like dependency injection implementation"
5
5
authors = [" Pavel Kirilin <win10@list.ru>" ]
6
6
readme = " README.md"
Original file line number Diff line number Diff line change
1
+ import uuid
1
2
from typing import ( # noqa: WPS235
2
3
Any ,
3
4
AsyncGenerator ,
@@ -107,13 +108,14 @@ def __init__( # noqa: WPS234
107
108
use_cache : bool = True ,
108
109
kwargs : Optional [Dict [str , Any ]] = None ,
109
110
) -> None :
111
+ self ._id = uuid .uuid4 ()
110
112
self .dependency = dependency
111
113
self .use_cache = use_cache
112
114
self .param_name = ""
113
115
self .kwargs = kwargs or {}
114
116
115
117
def __hash__ (self ) -> int :
116
- return hash (( self .dependency , self . use_cache , tuple ( self . kwargs . keys ())) )
118
+ return hash (self ._id )
117
119
118
120
def __eq__ (self , rhs : object ) -> bool :
119
121
"""
@@ -127,8 +129,4 @@ def __eq__(self, rhs: object) -> bool:
127
129
"""
128
130
if not isinstance (rhs , Dependency ):
129
131
return False
130
- return (self .dependency , self .use_cache , self .kwargs ) == (
131
- rhs .dependency ,
132
- rhs .use_cache ,
133
- rhs .kwargs ,
134
- )
132
+ return self ._id == rhs ._id # noqa: WPS437
You can’t perform that action at this time.
0 commit comments