一、classmethod装饰器
# 全局变量
ip = '192.168.13.98'
port = '3306'
class MySQL:
__instance = None
def __init__(self, ip, port):
self.ip = ip
self.port = port
@classmethod
def instance(cls, *args, **kwargs):
if args or kwargs:
cls.__instance = cls(*args, **kwargs)
return cls.__