Can I store a function rather than its result to a dictionary value so that it is dynamically updated when the value is called?

前端 未结 0 1437
既然无缘
既然无缘 2021-02-02 01:49

Say I have a dictionary

mydict = {\'x\':val1,\'x2\':val2}

I would like to do something like

mydict[\'x3\'] = some_func(mydict[\'x1         


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