[issue1717] Get rid of more references to __cmp__

2021-05-26 Thread Brett Cannon


Brett Cannon  added the comment:

> Has there been any resolution regarding `sortTestMethodsUsing`?

My suspicion is if the docs don't suggest there's something else then nothing 
has been changed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2021-05-26 Thread Nils Kattenbeck


Nils Kattenbeck  added the comment:

Has there been any resolution regarding `sortTestMethodsUsing`? See 
https://bugs.python.org/msg77261

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?

--
nosy: +Nils Kattenbeck

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2013-08-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 64e004737837 by R David Murray in branch '3.3':
#18324: set_payload now correctly handles binary input.
http://hg.python.org/cpython/rev/64e004737837

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-03-31 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Documentation updated in r70863.

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-03-05 Thread Benjamin Peterson

Changes by Benjamin Peterson benja...@python.org:


--
priority: release blocker - normal

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-16 Thread Anthony Tuininga

Anthony Tuininga anthony.tuini...@gmail.com added the comment:

Removing cmp() breaks distutils. I get the following exception, for
example using the just released version 3.0.1:

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

--
nosy: +atuining

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-16 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
priority: normal - release blocker

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-16 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Fixed in r69682.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-16 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Darn.  That's really very annoying.  Apologies for missing this one.

Thanks for the quick fix, Benjamin.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-08 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Deprecation warning for types that implement tp_compare but not 
tp_richcompare added in r69431, r69432.

Just the doc fixes in Doc/extending/newtypes.rst left.  Assigning to Georg  
and reducing priority.

--
assignee:  - georg.brandl
priority: release blocker - normal
versions: +Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

All relevant changes from the py3k-issue1717 branch have now been merged into 
the py3k 
branch (and from there into the 3.0 maintenance branch), in a series of 
revisions.  
Here they are, listed in py3k/release30-maint pairs:

r69188, r69189,
r69190, r69191,
r69192, r69193,
r69214, r69215,
r69218, r69221,
r69224, r69225.

The idea to raise TypeError on non-NULL tp_compare was abandoned after Martin 
pointed 
out that it would be a binary incompatible change _[1], but Nick Coghlan 
suggested a 
DeprecationWarning when tp_compare is non-NULL and tp_richcompare is NULL _[2], 
and 
remarked that the warning should also be implemented for Python 2.7 when run 
with the -
3 option.

Still to do before this can be closed:

 - fix up Doc/extending/newtypes.rst;  I think Georg has said he'll
   take care of this, so once everything else is done I'll just reassign
   this issue to him and let him get on with it.

 - add Nick Coghlan's suggested DeprecationWarning.

 - grep through the sources looking for tp_compare, __cmp__, cmpfunc,
   PyObject_Cmp, PyObject_Compare and cmp, and check all remaining
   references are legitimate.

 - update pybench;  there's a separate issue already open for this.
   (issue 4704), and it looks like Antoine and Marc-André are on the
   case.

 - anything else that I've forgotten.

Thanks everyone for your help so far, especially Christian for much of
the original code and Antoine for code and review.

[1] http://mail.python.org/pipermail/python-dev/2009-February/085797.html
[2] http://mail.python.org/pipermail/python-dev/2009-February/085809.html

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-02-01 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

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 
(release30-maint).

There's still the rename of the tp_compare slot to deal with, and a fair 
amount of cleaning up and documentation fixing to do.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-30 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Here's stage 2:  remove uses of tp_compare from Objects and Modules, and
replace uses of PyObject_Compare with PyObject_RichCompareBool.
PyObject_Compare, cmp and friends still haven't been removed at this
stage.

In detail:
  - for cell objects, method wrapper objects, PyTclObjects, and
PyST_Objects (in the parser module), remove the defined tp_compare
methods and implement tp_richcompare instead.
  - add tests for cell comparisons and PyST_Object comparisons;  
reenable
tests for method wrapper comparisons.  There are no tests for the
PyTclObject comparisons.
  - remove tp_compare method from sets (all it did was emit an error
message about the nonsensicality of doing order comparisons on sets)
  - in Objects/rangeobject.c and ElementTree, replace uses of
PyObject_Compare with PyObject_RichCompareBool

Added file: http://bugs.python.org/file12895/1717_stage2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I haven't stared very closely but it looks ok.
(spanish armada might be replaced with spanish inquisition, though)

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I'm not going to get more time to work on this before
the weekend, so if anyone else wants to take over please
feel free.

Still to do for stage 2:  cell objects and slot
wrapper objects need to have tp_richcompare
implemented, to replace the tp_compare slots that
are being removed.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

For 3.0, are you going to keep tp_compare slot in existence and just
assert that it is NULL?  Then in 3.1, remove the slot entirely?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

If I understand Christian's plan correctly, it was to:

(1) raise TypeError for non-NULL tp_compare, and
(2) rename tp_compare to tp_reserved (with type void *).

and both of these would happen with 3.0.1, so no difference between
3.0.1 and 3.1.0.

It seems to me that if tp_compare is actually going to be removed then
that should be done in 3.0.1;  else third-party stuff that works with
3.0.x will fail with 3.1, due to the various tp_* fields being out of sync.

It would be nice not to have tp_reserved hanging around for the duration
of 3.x.  (Similarly for nb_reserved.)

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Actually, I would like to repurpose tp_compare as tp_bytes for the
__bytes__ method.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

On Thu, Jan 29, 2009 at 07:30, Benjamin Peterson rep...@bugs.python.org wrote:

 Benjamin Peterson benja...@python.org added the comment:

 Actually, I would like to repurpose tp_compare as tp_bytes for the
 __bytes__ method.

Repurposing would be extremely bad as that would mean it is possible
for people to actually compile code with a busted __bytes__
implementation.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

On Thu, Jan 29, 2009 at 2:39 PM, Brett Cannon rep...@bugs.python.org wrote:

 Brett Cannon br...@python.org added the comment:

 On Thu, Jan 29, 2009 at 07:30, Benjamin Peterson rep...@bugs.python.org 
 wrote:

 Benjamin Peterson benja...@python.org added the comment:

 Actually, I would like to repurpose tp_compare as tp_bytes for the
 __bytes__ method.

 Repurposing would be extremely bad as that would mean it is possible
 for people to actually compile code with a busted __bytes__
 implementation.

Wasn't there another case of an old slot being reused?

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-29 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

 On Thu, Jan 29, 2009 at 07:30, Benjamin Peterson rep...@bugs.python.org 
 wrote:

 Benjamin Peterson benja...@python.org added the comment:

 Actually, I would like to repurpose tp_compare as tp_bytes for the
 __bytes__ method.

 Repurposing would be extremely bad as that would mean it is possible
 for people to actually compile code with a busted __bytes__
 implementation.

 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.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-28 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Can anyone who uses tkinter give me some advice?  Does PyTclObject in 
_tkinter.c need to have its tp_richcompare method implemented?  And if so, 
how do I go about testing the implementation?  It seems that PyTclObjects 
aren't directly exposed to Python under 'import tkinter'.

I'll hold off on any more checkins until the 3.0.1 thread on python-dev 
has resolved itself.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-28 Thread Guilherme Polo

Guilherme Polo ggp...@gmail.com added the comment:

Mark,

I'm not a very huge user of tkinter, but I can tell you it would be
tricky to try getting a PyTclObject. It needs to be exposed if you want
to test it without relying on Tcl, but, to me they are just a
temporary object that serves to indicate the caller that it needs to
be converted to something else since _tkinter itself wasn't able to do
it. For this reason I would actually prefer to them not be comparable.

--
nosy: +gpolo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-28 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks, Guilherme.

 For this reason I would actually prefer to them not be comparable.

That's fine with me, so long as we can be sure that there's no existing 
code that depends on them being comparable.  I can't figure out whether 
there's any legitimate way that the tp_compare slot (which is currently 
implemented) of a PyTclObject could ever be called.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-27 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Stage 1 committed in r69025 (py3k) and r69026 (release30-maint).

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-25 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I'm wondering how to move forward with this issue.  Might it make sense to 
break the current monster patch into a series of more-easily reviewed 
patches?  I was thinking of something like:

 - patch 1 (Python code): remove all uses of cmp from std. lib. and tests
 - patch 2 (C code): remove all uses of tp_compare from Modules and 
Objects
 - patch 3 : rename tp_compare to tp_reserved in all Modules and Objects 
(should be a very simple patch, but touches a lot of files)
 - patch 4 : fix docs, and look for any other loose ends that need
   cleaning up.

Here's patch 1: remove uses of cmp from library and tests (and also from 
Tools/unicode/makeunicodedata.py).  It involves essentially no user-
visible changes.  (At least, assuming that users aren't trying to access 
e.g., UserString.__cmp__ directly.)

The patch is against py3k.  All tests pass on my machine with this patch 
applied.

Anyone interested in reviewing this?

Added file: http://bugs.python.org/file12852/1717_stage1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-25 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Quick comments on your patch:
- two files have unwanted modifications on non-ASCII characters
(Lib/heapq.py and Lib/sqlite3/test/hooks.py)
- you haven't renamed __cmp__ to _cmp in Lib/xmlrpc/client.py:
deliberate?
- in Lib/heapq.py, there's a _cmp__ which should be _cmp

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-25 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks, Antoine.  Here's a new patch.

 - two files have unwanted modifications on non-ASCII characters
 (Lib/heapq.py and Lib/sqlite3/test/hooks.py)

Fixed, I think.  Could you double check?

 - you haven't renamed __cmp__ to _cmp in Lib/xmlrpc/client.py:
 deliberate?

Not deliberate!  This __cmp__ should simply be removed, I think---the rich 
comparison methods are already present.

 - in Lib/heapq.py, there's a _cmp__ which should be _cmp

Replaced _cmp__ (which was in a comment) with comparison.

Added file: http://bugs.python.org/file12853/1717_stage1_v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-25 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Fixed, I think.  Could you double check?

It's ok!

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1717] Get rid of more references to __cmp__

2009-01-03 Thread Martin v. Löwis

Changes by Martin v. Löwis mar...@v.loewis.de:


--
title: Get rid of more refercenes to __cmp__ - Get rid of more references to 
__cmp__

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1717
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com