次のクラスを取得しました:
class ConstraintFailureSet(dict, Exception) :
"""
Container for constraint failures. It act as a constraint failure itself
but can contain other constraint failures that can be accessed with a dict syntax.
"""
def __init__(self, **failures) :
dict.__init__(self, failures)
Exception.__init__(self)
print isinstance(ConstraintFailureSet(), Exception)
True
raise ConstraintFailureSet()
TypeError: exceptions must be classes, instances, or strings (deprecated), not ConstraintFailureSet
一体何?
そして最悪なのは、例外が古いベースのクラスであるため、super() を試すことができないことです...
編集:そして、はい、継承/初期化の順序を切り替えようとしました。
EDIT2:Ubuntu8.10でCPython 2.4を使用しています。この種の情報が役立つことを最近知っています;-)。とにかく、この小さななぞなぞは、3 人の同僚の口を閉ざしてしまいました。あなたは今日の私の親友になるでしょう...