refactor singleton instance of BECDispatcher
Instead of:
def BECDispatcher():
global _bec_dispatcher
if _bec_dispatcher is None:
parser = argparse.ArgumentParser()
parser.add_argument("--bec-client", default=None)
args, _ = parser.parse_known_args()
_bec_dispatcher = _BECDispatcher(args.bec_client)
return _bec_dispatcher
to use more idiomatic approach with __new__
as in BECClient
.
Edited by wyzula_j