[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-dev] Relay Dashboard Code Review



>>   def get_websockets(ws_type = None):
>>     websocket = WEBSOCKETS.get(ws_type, [])
>>     return websocket if websocket else None
>
> How about just:
>
>     def get_websockets(ws_type=None):
>         return WEBSOCKETS.get(ws_type, None)

Thanks meejah for the additional feedback! For this last one as I
understand it WEBSOCKETS contains values that are empty lists, and he
wants this function to return None when that's the case. That's why I
did it the way above.
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev