
class BaseClass():

    # 单例模式
    __instance = None

    def __new__(self, *args, **kwargs):
        if not self.__instance:
            self.__instance = super(BaseClass, self).__new__(self, *args, **kwargs)
        return self.__instance


# class stu1(base):
#     __name = ''
#
# class stu2():
#     __name=''
#
# s1 = stu1()
# s2 = stu1()
#
# a1 = stu2()
# a2 = stu2()
#
# print(id(s1) == id(s2))
#
# print(id(a1)  == id(a2))