@@ -32,7 +32,7 @@ def __init__(self, scope: "ConnectionScope", guid: str) -> None:
32
32
33
33
async def send (self , method : str , params : dict = None ) -> Any :
34
34
if params is None :
35
- params = dict ()
35
+ params = {}
36
36
result = await self ._scope .send_message_to_server (self ._guid , method , params )
37
37
# Protocol now has named return values, assume result is one level deeper unless
38
38
# there is explicit ambiguity.
@@ -47,7 +47,7 @@ async def send(self, method: str, params: dict = None) -> Any:
47
47
48
48
def send_no_reply (self , method : str , params : dict = None ) -> None :
49
49
if params is None :
50
- params = dict ()
50
+ params = {}
51
51
self ._scope .send_message_to_server_no_reply (self ._guid , method , params )
52
52
53
53
@@ -74,8 +74,8 @@ def __init__(
74
74
self ._connection : "Connection" = connection
75
75
self ._loop : asyncio .AbstractEventLoop = connection ._loop
76
76
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 ] = {}
79
79
self ._parent = parent
80
80
81
81
def create_child (self , guid : str ) -> "ConnectionScope" :
@@ -138,12 +138,12 @@ def __init__(
138
138
) -> None :
139
139
self ._transport = Transport (input , output , loop )
140
140
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 ] = {}
142
142
self ._last_id = 0
143
143
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 ] = {}
147
147
self ._root_scope = self .create_scope ("" , None )
148
148
self ._object_factory = object_factory
149
149
@@ -212,7 +212,7 @@ def _replace_channels_with_guids(self, payload: Any) -> Any:
212
212
if isinstance (payload , Channel ):
213
213
return dict (guid = payload ._guid )
214
214
if isinstance (payload , dict ):
215
- result = dict ()
215
+ result = {}
216
216
for key in payload :
217
217
result [key ] = self ._replace_channels_with_guids (payload [key ])
218
218
return result
@@ -226,7 +226,7 @@ def _replace_guids_with_channels(self, payload: Any) -> Any:
226
226
if isinstance (payload , dict ):
227
227
if payload .get ("guid" ) in self ._objects :
228
228
return self ._objects [payload ["guid" ]]._channel
229
- result = dict ()
229
+ result = {}
230
230
for key in payload :
231
231
result [key ] = self ._replace_guids_with_channels (payload [key ])
232
232
return result
0 commit comments