New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of more references to __cmp__ #46058
Comments
Should I apply this? There are more places that reference __cmp__ in |
__cmp__ is not coming back. |
Bumping priority. |
Ping |
Can someone other than me test and apply this? It seems still relevant, |
Additionally, there are still lots of references to __cmp__ in the |
Bumping priority even further. This shouldn't make it past rc. |
Guido's patch breaks these tests: test_descr test_hash test_long test_richcmp test_set |
Since we are making 3.0 issues deferred blockers dropping the priority. |
It looks like all these are easily fixed: all these tests were making Here's a patch that fixes these tests. One other detail: In test_descr.py, there are tests for 'overridden behavior for static |
Thanks, Mark! Applied in r66920. |
The library still has __cmp__ functions defined here and there, e.g. in |
Presumably any nonzero entries for tp_compare in type initializers I see nonzero tp_compare entries in: |
Let's lower the priority on this. |
Stage 1 committed in r69025 (py3k) and r69026 (release30-maint). |
Can anyone who uses tkinter give me some advice? Does PyTclObject in I'll hold off on any more checkins until the 3.0.1 thread on python-dev |
Mark, I'm not a very huge user of tkinter, but I can tell you it would be |
Thanks, Guilherme.
That's fine with me, so long as we can be sure that there's no existing |
I'm not going to get more time to work on this before Still to do for stage 2: cell objects and slot |
For 3.0, are you going to keep tp_compare slot in existence and just |
If I understand Christian's plan correctly, it was to: (1) raise TypeError for non-NULL tp_compare, and and both of these would happen with 3.0.1, so no difference between It seems to me that if tp_compare is actually going to be removed then It would be nice not to have tp_reserved hanging around for the duration |
Instead of tp_reserved, the name should be tp_deprecated_compare. There should be a python-dev discussion around when to actually remove 3.0.1 -- binary incompatibility between minor releases (BAD) |
Actually, I would like to repurpose tp_compare as tp_bytes for the |
On Thu, Jan 29, 2009 at 07:30, Benjamin Peterson <report@bugs.python.org> wrote:
Repurposing would be extremely bad as that would mean it is possible |
On Thu, Jan 29, 2009 at 2:39 PM, Brett Cannon <report@bugs.python.org> wrote:
Wasn't there another case of an old slot being reused? |
Not that I can remember, but I'm sure someone will correct me if I'm wrong. |
Here's stage 2: remove uses of tp_compare from Objects and Modules, and In detail:
|
I haven't stared very closely but it looks ok. |
Thanks for the review, Antoine. Stage 2 applied to py3k in r69181, merged to 3.0 in r69182. cmp, PyObject_Cmp and PyObject_Compare removed in r69184 (py3k) and r69185 There's still the rename of the tp_compare slot to deal with, and a fair |
All relevant changes from the py3k-issue1717 branch have now been merged into the py3k r69188, r69189, The idea to raise TypeError on non-NULL tp_compare was abandoned after Martin pointed Still to do before this can be closed:
Thanks everyone for your help so far, especially Christian for much of [1] http://mail.python.org/pipermail/python-dev/2009-February/085797.html |
Deprecation warning for types that implement tp_compare but not Just the doc fixes in Doc/extending/newtypes.rst left. Assigning to Georg |
Removing cmp() breaks distutils. I get the following exception, for Traceback (most recent call last):
File "setup.py", line 318, in <module>
classifiers = classifiers)
File "c:\Python30\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "c:\Python30\lib\distutils\dist.py", line 942, in run_commands
self.run_command(cmd)
File "c:\Python30\lib\distutils\dist.py", line 962, in run_command
cmd_obj.run()
File "c:\Python30\lib\distutils\command\build.py", line 128, in run
self.run_command(cmd_name)
File "c:\Python30\lib\distutils\cmd.py", line 317, in run_command
self.distribution.run_command(command)
File "c:\Python30\lib\distutils\dist.py", line 962, in run_command
cmd_obj.run()
File "c:\Python30\lib\distutils\command\build_ext.py", line 306, in run
force=self.force)
File "c:\Python30\lib\distutils\ccompiler.py", line 1110, in new_compiler
return klass(None, dry_run, force)
File "c:\Python30\lib\distutils\cygwinccompiler.py", line 314, in __init__
if self.gcc_version <= "2.91.57":
File "c:\Python30\lib\distutils\version.py", line 64, in __le__
c = self._cmp(other)
File "c:\Python30\lib\distutils\version.py", line 341, in _cmp
return cmp(self.version, other.version)
NameError: global name 'cmp' is not defined |
Fixed in r69682. |
Darn. That's really very annoying. Apologies for missing this one. Thanks for the quick fix, Benjamin. |
Documentation updated in r70863. |
New changeset 64e004737837 by R David Murray in branch '3.3': |
Has there been any resolution regarding I spend a decent time and read the documentation thrice before realizing it received an old-style compare function. Brett's proposal for a new attribute seems like a sane way to do this without breaking backwards compatibility. Or will this continue using an old-style compare function for the foreseeable future? |
My suspicion is if the docs don't suggest there's something else then nothing has been changed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: