How do I extend a python module? Adding new functionality to the `python-twitter` package

后端 未结 6 1266
逝去的感伤
逝去的感伤 2020-11-28 09:53

What are the best practices for extending an existing Python module – in this case, I want to extend the python-twitter package by adding new methods to the bas

6条回答
  •  囚心锁ツ
    2020-11-28 10:39

    Don't add them to the module. Subclass the classes you want to extend and use your subclasses in your own module, not changing the original stuff at all.

提交回复
热议问题