Avoid sharing default dictionary argument across all instances of class
This commit is contained in:
parent
c92bade815
commit
d0c8b7d8af
|
@ -19,7 +19,11 @@ class Multiselect(IMultiselectMuxer):
|
|||
|
||||
handlers: Dict[TProtocol, StreamHandlerFn]
|
||||
|
||||
def __init__(self, default_handlers: Dict[TProtocol, StreamHandlerFn] = {}) -> None:
|
||||
def __init__(
|
||||
self, default_handlers: Dict[TProtocol, StreamHandlerFn] = None
|
||||
) -> None:
|
||||
if not default_handlers:
|
||||
default_handlers = {}
|
||||
self.handlers = default_handlers
|
||||
|
||||
def add_handler(self, protocol: TProtocol, handler: StreamHandlerFn) -> None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user