On Sat, 2007-09-01 at 13:50 +1200, Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Carsten
> Haese wrote:
> > has_key() will go away, period. It has been made obsolete by "in", which
> > is faster and more concise.
> 
> And is also a backdoor way of introducing non-virtual methods into Python,
> is it not.

If by that you mean that "in" tests can't be overridden, that's not
true:

>>> class LyingDict(dict):
...   def __contains__(self, key): return False
... 
>>> d = LyingDict()
>>> d[1] = 42
>>> 1 in d
False

If you mean something else, please clarify.

-- 
Carsten Haese
http://informixdb.sourceforge.net


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to