【发布时间】:2013-02-28 18:29:39
【问题描述】:
我发现以下两项都有效:
class Foo():
def a(self):
print "hello"
class Foo(object):
def a(self):
print "hello"
所有 Python 类都应该扩展对象吗?不扩展对象有什么潜在的问题吗?
【问题讨论】:
-
class Foo():和class Foo:有区别吗?正如我所观察到的,两者都适用于 Python 3。
标签: python inheritance