diff options
author | Guido van Rossum <guido@python.org> | 2002-05-31 20:03:54 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-05-31 20:03:54 +0000 |
commit | a407300cd776309176087866698c580329f9fc1c (patch) | |
tree | 2049e61ad8469a41bcbd5a204e546cd3d6bd2505 /Lib/ftplib.py | |
parent | 32a7e7f6b65bd64f28daccaf05e906f93f2ef77e (diff) | |
download | cpython-git-a407300cd776309176087866698c580329f9fc1c.tar.gz |
Implement the intention of SF patch 472523 (but coded differently).
In the past, an object's tp_compare could return any value. In 2.2
the docs were tightened to require it to return -1, 0 or 1; and -1 for
an error.
We now issue a warning if the value is not in this range. When an
exception is raised, we allow -1 or -2 as return value, since -2 will
the recommended return value for errors in the future. (Eventually
tp_compare will also be allowed to return +2, to indicate
NotImplemented; but that can only be implemented once we know all
extensions return a value in [-2...1]. Or perhaps it will require the
type to set a flag bit.)
I haven't decided yet whether to backport this to 2.2.x. The patch
applies fine. But is it fair to start warning in 2.2.2 about code
that worked flawlessly in 2.2.1?
Diffstat (limited to 'Lib/ftplib.py')
0 files changed, 0 insertions, 0 deletions