3434 overload ,
3535)
3636
37- from ._compat import Lock , ordered_dict
37+ from ._compat import Lock
3838from ._models import NodeConfig
3939from ._node import BaseNode
4040
@@ -182,8 +182,8 @@ def __init__(
182182 self ._node_class = node_class
183183 self ._node_selector = node_selector_class (node_configs )
184184
185- # Maintain insert order
186- self ._all_nodes : Dict [NodeConfig , BaseNode ] = ordered_dict ()
185+ # _all_nodes relies on dict insert order
186+ self ._all_nodes : Dict [NodeConfig , BaseNode ] = {}
187187 for node_config in node_configs :
188188 self ._all_nodes [node_config ] = self ._node_class (node_config )
189189
@@ -196,11 +196,11 @@ def __init__(
196196
197197 # Collection of currently-alive nodes. This is an ordered
198198 # dict so round-robin actually works.
199- self ._alive_nodes : Dict [NodeConfig , BaseNode ] = ordered_dict (self ._all_nodes )
199+ self ._alive_nodes : Dict [NodeConfig , BaseNode ] = dict (self ._all_nodes )
200200
201201 # PriorityQueue for thread safety and ease of timeout management
202202 self ._dead_nodes : PriorityQueue [Tuple [float , BaseNode ]] = PriorityQueue ()
203- self ._dead_consecutive_failures : Dict [NodeConfig , int ] = defaultdict (lambda : 0 )
203+ self ._dead_consecutive_failures : Dict [NodeConfig , int ] = defaultdict (int )
204204
205205 # Nodes that have been marked as 'removed' to be thread-safe.
206206 self ._removed_nodes : Set [NodeConfig ] = set ()
0 commit comments