I would like to create a class that is able to do the following
class Test: # code here test = Test() test["test"] = 1 test.test # returns 1
Is this possible in Python using magic methods (e.g. not inheriting from dict
)? Related question here
没有评论:
发表评论