class Local(dict):

    def get(self, key):
        try:
            return dict(self[key])
        except KeyError:
            raise exceptions.ResourceError("no such user")


local = Local()

重写 dict get() 方法

相关文章:

  • 2021-09-03
  • 2022-12-23
  • 2021-12-27
  • 2021-11-28
  • 2021-08-17
猜你喜欢
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案