A python class that acts like dict

前端 未结 9 2076

I want to write a custom class that behaves like dict - so, I am inheriting from dict.

My question, though, is: Do I need to create a priva

9条回答
  •  青春惊慌失措
    2020-11-30 18:22

    Check the documentation on emulating container types. In your case, the first parameter to add should be self.

提交回复
热议问题