为什么下面的代码会出错?
class Foo:
def __new__(cls, *args, **kwargs):
print("Creating Instance")
instance = super(Foo, cls).__new__(cls,*args, **kwargs)
return instance
def __init__(self, a, b):
self.a = a
self.b = b
z= Foo(2,3)
Run Code Online (Sandbox Code Playgroud)
它给出了以下错误
TypeError: object.__new__() takes exactly one argument (the type to instantiate)
Run Code Online (Sandbox Code Playgroud) 我想使用 Eclipse 数据库工具连接到本地 MySql 8.0 数据库。但是在设置新的数据库连接配置文件时,我找不到 MySql 8.0 的驱动程序模板。该列表仅包含直至 MySql JDBC Driver 5.1 的模板配置文件。那么在我的例子中,如何使用 eclipse DTP 工具连接较新版本的 MySql(例如 8.0)