#22036 closed enhancement (fixed)
py3 remove cmp() in comparison of padics printing modes (pyx)
Reported by:  chapoton  Owned by:  

Priority:  major  Milestone:  sage7.6 
Component:  python3  Keywords:  
Cc:  tscrim, jdemeyer, aapitzsch  Merged in:  
Authors:  Frédéric Chapoton  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  ebc6d42 (Commits)  Commit:  
Dependencies:  Stopgaps: 
Description
as yet another infinitesimal step to py3
Change History (20)
comment:1 Changed 4 years ago by
 Branch set to u/chapoton/22036
 Commit set to fa5cf71569f3b1ef8c27ffb518e6a20a062f1267
 Status changed from new to needs_review
comment:2 Changed 4 years ago by
 Commit changed from fa5cf71569f3b1ef8c27ffb518e6a20a062f1267 to 83e491b90042142a7314ab985adb26e1333d0254
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
83e491b  py3 remove cmp() in comparison of padics printing modes

comment:4 Changed 4 years ago by
 Commit changed from 83e491b90042142a7314ab985adb26e1333d0254 to 6de5e273502deafdfca0736cd1984c890af8b79a
Branch pushed to git repo; I updated commit sha1. New commits:
6de5e27  trac 22036 trying to fix some doctests by switching to richcmp

comment:5 Changed 4 years ago by
still not ok, for some reason related to symbolic rings. Remains 2 failing doctests.
sage t src/sage/rings/padics/factory.py # 2 doctests failed
comment:6 Changed 4 years ago by
Let me summarize the problem:
sage: x = var('x') sage: X.<a> = Qq(27, modulus = x^3 + 2*x + 1) sage: P.<x> = ZZ[] sage: R.<a> = Qq(27, modulus = x^3 + 2*x + 1) sage: X == R False sage: X._cmp_(R) 1 sage: X.__richcmp__(R, 2) True
So the default behavior for ==
is apparently to call _cmp_
in Parent
which calls __cmp__
. Therefore one may have to change the behaviour in Parent to first call __richcmp__
before being able to handle this.
comment:7 Changed 4 years ago by
 Commit changed from 6de5e273502deafdfca0736cd1984c890af8b79a to 42d4ef609ece092b9a2daf7bc39f7ead455d6972
comment:8 Changed 4 years ago by
 Status changed from needs_work to needs_review
comment:10 Changed 4 years ago by
ping ?
comment:11 Changed 4 years ago by
PING ?
comment:12 Changed 4 years ago by
 Reviewers set to Travis Scrimshaw
 Status changed from needs_review to positive_review
LGTM.
comment:13 Changed 4 years ago by
 Milestone changed from sage7.5 to sage7.6
comment:15 Changed 4 years ago by
 Commit changed from 42d4ef609ece092b9a2daf7bc39f7ead455d6972 to ebc6d42cde90f73601a078ee3dc7ccc2ef237c24
Branch pushed to git repo; I updated commit sha1. New commits:
ebc6d42  Merge branches 'develop' in 7.6.b0

comment:16 Changed 4 years ago by
 Status changed from needs_work to positive_review
rebased on the latest beta, but there were no conflict
comment:17 Changed 4 years ago by
 Branch changed from u/chapoton/22036 to ebc6d42cde90f73601a078ee3dc7ccc2ef237c24
 Resolution set to fixed
 Status changed from positive_review to closed
comment:18 Changed 3 years ago by
 Commit ebc6d42cde90f73601a078ee3dc7ccc2ef237c24 deleted
WTF? You implemented __richcmp__
in a pure Python file? That doesn't do anything...
comment:19 Changed 3 years ago by
indeed.. :(
comment:20 Changed 3 years ago by
We put it there as a perfect usecase for #23102. :P
Last 10 new commits:
trac 15634 using sorting_key for dendriform operad also
Merge branch 'u/chapoton/15634' into 7.3.b6
trac 15634 correct doctest in C3controlled
Merge branch 'u/chapoton/15634' in 7.3.b7
Merge branch 'u/chapoton/15634' in 7.4.b6
trac 15634 modern imports
Merge branch 'u/chapoton/15634' in 7.5.b2
trac 15634 remove xrange, full doc
Merge branch 'u/chapoton/15634' in 7.5.b5
py3 remove cmp() in comparison of padics printing modes