wechaty/python-wechaty-puppet-service

Move init_puppet() from __init__() to start()

huan opened this issue · 2 comments

huan commented

https://github.com/wechaty/python-wechaty-puppet-hostie/blob/b802e4b4c572adc67daca4bca0480be534dbc81f/src/wechaty_puppet_hostie/puppet.py#L92

Currently, we are initializing the GRPC inside __init__() which is an anti-pattern because it will make the module hard to test.

Please move the init_puppet() to the start() which it is a better place to do this job only after the start() was called.

The issue is resolved, it's ok to be closed.

huan commented

Great improvement, and thank you very much!