我想
class MyClass(object):
_my_unique = ???? # if this were lisp, I would have written (cons nil nil) here
def myFunc (self, arg):
assert arg != _my_unique # this must never fail
...
用什么来代替???
确保assert
永不失败?
(使用 Lisp,我可以使用in 进行创建_my_unique
和(cons nil nil)
使用)。eq
assert
PS。用例:我将放入_my_unique
a dict
,因此我希望它与自身相等,但我不希望它与dict
从外部传入的任何东西相等(在碰撞意义上)。