How to set a python property in __init__

后端 未结 2 1418
星月不相逢
星月不相逢 2020-12-15 03:41

I have a class with an attribute I wish to turn into a property, but this attribute is set within __init__. Not sure how this should be done. Without setting th

2条回答
  •  一生所求
    2020-12-15 04:14

    I do not see any real problem with your code. In __init__, the class is fully created and thus the properties accessible.

提交回复
热议问题