Should I be able to use getattr on any property found with dir()?

后端 未结 0 641
灰色年华
灰色年华 2020-12-18 21:17

So if I list the attributes on an object with

props= dir(my_obj) # returns [\'prop1\', \'prop2\'], should getattr(props[0]) always return so

相关标签:
回答
  • 消灭零回复
提交回复
热议问题