Opened 4 years ago

Closed 4 years ago

#23273 closed enhancement (fixed)

py3: deprecate use of cmp for comparison of symbolic expressions

Reported by: chapoton Owned by:
Priority: major Milestone: sage-8.0
Component: python3 Keywords:
Cc: rws, mforets Merged in:
Authors: Frédéric Chapoton Reviewers: Ralf Stephan
Report Upstream: N/A Work issues:
Branch: b66c9ff (Commits, GitHub, GitLab) Commit: b66c9fff9845faf6da071a4d3fdb956e1e25a367
Dependencies: Stopgaps:

Status badges

Description

because "cmp" is going to disappear in py3

currently, symbolic expressions use "cmp" for something that tries to define a total order on expressions.

Let us deprecate this. People needing this kind of thing can either

  • call "mixed_order" directly
  • or try to use something like "bool(a <= b)"

Change History (10)

comment:1 Changed 4 years ago by chapoton

  • Authors set to Frédéric Chapoton
  • Branch set to u/chapoton/23273
  • Cc rws mforets added
  • Commit set to 63d5340d7996f46940aa2c8a286d1116e07d9a8e

New commits:

acb843fcorrect a few broken links in the doc (wrong rst syntax)
63d5340trac 23273 deprecation of cmp for symbolics

comment:2 Changed 4 years ago by git

  • Commit changed from 63d5340d7996f46940aa2c8a286d1116e07d9a8e to 1d6ade7010bc5ba0b56fcd879f917f71df863394

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

1d6ade7trac 23273 deprecation of cmp for symbolics

comment:3 Changed 4 years ago by rws

  • Reviewers set to Ralf Stephan

From testing selected modules:

sage -t --warn-long 36.9 src/sage/symbolic/random_tests.py  # 1 doctest failed
sage -t --warn-long 36.9 src/sage/symbolic/comparison.pyx  # 1 doctest failed

comment:4 follow-up: Changed 4 years ago by chapoton

Not yet ready for review, indeed. But do you agree on the principle ?

comment:5 in reply to: ↑ 4 Changed 4 years ago by rws

Replying to chapoton:

Not yet ready for review, indeed. But do you agree on the principle ?

Sure thing! One could offer a method for Expression, definitely not named cmp, but it's not important.

comment:6 Changed 4 years ago by git

  • Commit changed from 1d6ade7010bc5ba0b56fcd879f917f71df863394 to ec646d3f2e71a3bf1420094875187a703daa86f3

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

ec646d3trac 23273 correct failing doctests, add some doc

comment:7 Changed 4 years ago by git

  • Commit changed from ec646d3f2e71a3bf1420094875187a703daa86f3 to b66c9fff9845faf6da071a4d3fdb956e1e25a367

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

b66c9fftrac 23273 better doctest

comment:8 Changed 4 years ago by chapoton

  • Status changed from new to needs_review

green bot, please review

comment:9 Changed 4 years ago by rws

  • Status changed from needs_review to positive_review

LGTM, thanks for your work on this.

comment:10 Changed 4 years ago by vbraun

  • Branch changed from u/chapoton/23273 to b66c9fff9845faf6da071a4d3fdb956e1e25a367
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.