@@ -32,7 +32,7 @@ def __init__(self, scope: "ConnectionScope", guid: str) -> None:
3232
3333 async def send (self , method : str , params : dict = None ) -> Any :
3434 if params is None :
35- params = dict ()
35+ params = {}
3636 result = await self ._scope .send_message_to_server (self ._guid , method , params )
3737 # Protocol now has named return values, assume result is one level deeper unless
3838 # there is explicit ambiguity.
@@ -47,7 +47,7 @@ async def send(self, method: str, params: dict = None) -> Any:
4747
4848 def send_no_reply (self , method : str , params : dict = None ) -> None :
4949 if params is None :
50- params = dict ()
50+ params = {}
5151 self ._scope .send_message_to_server_no_reply (self ._guid , method , params )
5252
5353
@@ -74,8 +74,8 @@ def __init__(
7474 self ._connection : "Connection" = connection
7575 self ._loop : asyncio .AbstractEventLoop = connection ._loop
7676 self ._guid : str = guid
77- self ._children : List ["ConnectionScope" ] = list ()
78- self ._objects : Dict [str , ChannelOwner ] = dict ()
77+ self ._children : List ["ConnectionScope" ] = []
78+ self ._objects : Dict [str , ChannelOwner ] = {}
7979 self ._parent = parent
8080
8181 def create_child (self , guid : str ) -> "ConnectionScope" :
@@ -138,12 +138,12 @@ def __init__(
138138 ) -> None :
139139 self ._transport = Transport (input , output , loop )
140140 self ._transport .on_message = lambda msg : self ._dispatch (msg )
141- self ._waiting_for_object : Dict [str , Any ] = dict ()
141+ self ._waiting_for_object : Dict [str , Any ] = {}
142142 self ._last_id = 0
143143 self ._loop = loop
144- self ._objects : Dict [str , ChannelOwner ] = dict ()
145- self ._scopes : Dict [str , ConnectionScope ] = dict ()
146- self ._callbacks : Dict [int , ProtocolCallback ] = dict ()
144+ self ._objects : Dict [str , ChannelOwner ] = {}
145+ self ._scopes : Dict [str , ConnectionScope ] = {}
146+ self ._callbacks : Dict [int , ProtocolCallback ] = {}
147147 self ._root_scope = self .create_scope ("" , None )
148148 self ._object_factory = object_factory
149149
@@ -212,7 +212,7 @@ def _replace_channels_with_guids(self, payload: Any) -> Any:
212212 if isinstance (payload , Channel ):
213213 return dict (guid = payload ._guid )
214214 if isinstance (payload , dict ):
215- result = dict ()
215+ result = {}
216216 for key in payload :
217217 result [key ] = self ._replace_channels_with_guids (payload [key ])
218218 return result
@@ -226,7 +226,7 @@ def _replace_guids_with_channels(self, payload: Any) -> Any:
226226 if isinstance (payload , dict ):
227227 if payload .get ("guid" ) in self ._objects :
228228 return self ._objects [payload ["guid" ]]._channel
229- result = dict ()
229+ result = {}
230230 for key in payload :
231231 result [key ] = self ._replace_guids_with_channels (payload [key ])
232232 return result
0 commit comments