Skip to content
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

py3: change doc for comparison in element classes #22890

Closed
fchapoton opened this issue Apr 27, 2017 · 14 comments
Closed

py3: change doc for comparison in element classes #22890

fchapoton opened this issue Apr 27, 2017 · 14 comments

Comments

@fchapoton
Copy link
Contributor

with suggestion to use _richcmp_

may help to fix one of the doctest failures in #22297

CC: @tscrim @jdemeyer @a-andre

Component: python3

Author: Frédéric Chapoton

Branch/Commit: df4c150

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/22890

@fchapoton fchapoton added this to the sage-8.0 milestone Apr 27, 2017
@fchapoton
Copy link
Contributor Author

Commit: 89d245d

@fchapoton
Copy link
Contributor Author

Branch: u/chapoton/22890

@fchapoton
Copy link
Contributor Author

New commits:

89d245dpy3: change doc for comparison in element classes

@jdemeyer
Copy link

comment:2

Why is _richcmp_ recommended?

@fchapoton
Copy link
Contributor Author

comment:3

Because most of the time, writing either a _cmp_ or a __cmp__ implies a call to cmp..

By the way, Jeroen, could you have a look at #22881, please ?

and maybe also to #22875, if you feel like..

@fchapoton

This comment has been minimized.

@fchapoton
Copy link
Contributor Author

comment:5

Jeroen, could you please say what you want here more precisely ?

@fchapoton
Copy link
Contributor Author

comment:6

ping ?

@jdemeyer
Copy link

comment:7

Replying to @fchapoton:

Because most of the time, writing either a _cmp_ or a __cmp__ implies a call to cmp..

I don't really follow this reasoning. It's obviously true that cmp() should be avoided because that doesn't work in Python 3. But just because some (or even most) implementations of _cmp_() call cmp(), that doesn't mean that _cmp_() should be avoided in general.

If you really want to say that cmp() should be avoided, then just say that instead of something else.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 14, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

da00b47Merge branch 'u/chapoton/22890' in 8.0.b6
df4c150trac 22890 better doc

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 14, 2017

Changed commit from 89d245d to df4c150

@fchapoton
Copy link
Contributor Author

comment:9

Better like that ?

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@vbraun
Copy link
Member

vbraun commented May 16, 2017

Changed branch from u/chapoton/22890 to df4c150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants