![Mastering Objectoriented Python](https://wfqqreader-1252317822.image.myqcloud.com/cover/948/36704948/b_36704948.jpg)
上QQ阅读APP看书,第一时间看更新
Tip
Factory functions encapsulate complexity
There's a trade-off that occurs between sophisticated __init__()
methods and factory functions. It's often better to stick with more direct but less programmer-friendly __init__()
methods and push the complexity into factory functions. A factory function works well if you wish to wrap and encapsulate the construction complexities.