Class singleton without using metaclass?

前端 未结 0 463
时光说笑
时光说笑 2020-12-08 16:00

Why foo is printed twice?


class A:
    _instance = None

    def __new__(cls, *args, **kwargs):
        if cls._instance is None:
            cl         


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