【发布时间】:2011-01-11 10:42:52
【问题描述】:
>>> class BOOL(bool):
... print "why?"
...
why?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Error when calling the metaclass bases
type 'bool' is not an acceptable base type
我认为 Python 信任程序员。
【问题讨论】:
-
是否要添加 FileNotFound 值?
-
Google 搜索或 SO 搜索“组合与继承”可能在这里有用。
标签: python boolean restriction