But then it turns out that quite naturally we've used websocket as a variable name for a... websocket... and then we get a lint error on e.g. message = await websocket.get_message(). One option is to go through and rename each such instance to e.g. ws, but another would be to avoid emitting TRIO200 if the call is immediately awaited, because in these cases it's clearly not a blocking sync call after all.
One thing I just tried was configuring
websocket.*
as a known-sync call, in order to suggest https://pypi.org/project/trio-websocket/ over https://pypi.org/project/websocket/But then it turns out that quite naturally we've used
websocket
as a variable name for a... websocket... and then we get a lint error on e.g.message = await websocket.get_message()
. One option is to go through and rename each such instance to e.g.ws
, but another would be to avoid emittingTRIO200
if the call is immediately awaited, because in these cases it's clearly not a blocking sync call after all.