File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " taskiq-dependencies"
3- version = " 1.1.1 "
3+ version = " 1.1.2 "
44description = " FastAPI like dependency injection implementation"
55authors = [" Pavel Kirilin <win10@list.ru>" ]
66readme = " README.md"
Original file line number Diff line number Diff line change 1+ import uuid
12from typing import ( # noqa: WPS235
23 Any ,
34 AsyncGenerator ,
@@ -107,13 +108,14 @@ def __init__( # noqa: WPS234
107108 use_cache : bool = True ,
108109 kwargs : Optional [Dict [str , Any ]] = None ,
109110 ) -> None :
111+ self ._id = uuid .uuid4 ()
110112 self .dependency = dependency
111113 self .use_cache = use_cache
112114 self .param_name = ""
113115 self .kwargs = kwargs or {}
114116
115117 def __hash__ (self ) -> int :
116- return hash (( self .dependency , self . use_cache , tuple ( self . kwargs . keys ())) )
118+ return hash (self ._id )
117119
118120 def __eq__ (self , rhs : object ) -> bool :
119121 """
@@ -127,8 +129,4 @@ def __eq__(self, rhs: object) -> bool:
127129 """
128130 if not isinstance (rhs , Dependency ):
129131 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