Opened 4 years ago

Closed 4 years ago

#26937 closed defect (fixed)

Word_class compares using < if == is requested

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.6
Component: combinatorics Keywords:
Cc: chapoton Merged in:
Authors: Jeroen Demeyer Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 7dda4ac (Commits, GitHub, GitLab) Commit: 7dda4ac6209a3b86ee0d042c2aa358d53f1d9f29
Dependencies: Stopgaps:

Status badges

Description

This is bad because it compares using < and > even if the user only wanted to know if two things were equal:

                    if key_cs < key_co:
                        return rich_to_bool(op, -1)
                    elif key_cs > key_co:
                        return rich_to_bool(op, 1)

Instead, richcmp_item should probably be used here.

Change History (4)

comment:1 Changed 4 years ago by jdemeyer

  • Branch set to u/jdemeyer/word_class_compares_using___if____is_requested

comment:2 Changed 4 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Commit set to 7dda4ac6209a3b86ee0d042c2aa358d53f1d9f29
  • Status changed from new to needs_review

New commits:

7dda4acUse richcmp_item to compare Word_class

comment:3 Changed 4 years ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

The error in geometry/cone.py seems unrelated. So LGTM.

comment:4 Changed 4 years ago by vbraun

  • Branch changed from u/jdemeyer/word_class_compares_using___if____is_requested to 7dda4ac6209a3b86ee0d042c2aa358d53f1d9f29
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.