Opened 4 years ago

Last modified 4 years ago

#23109 closed enhancement

Move richcmp_by_eq_and_lt to structure/richcmp.pyx — at Version 4

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-8.0
Component: misc Keywords:
Cc: chapoton, dkrenn Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #23103 Stopgaps:

Status badges

Description (last modified by jdemeyer)

The function richcmp_by_eq_and_lt from src/sage/rings/asymptotic/misc.py should be moved to src/sage/structure/richcmp.pyx.

I would also like to change the semantics slightly: this would be more useful if the method names (i.e. _eq_ and _lt_) would be an argument like _richcmp_ = richcmp_by_eq_and_lt("_eq_", "_lt_"). This way, it can also be used with the standard Python methods __eq__ and __lt__.

Change History (4)

comment:1 in reply to: ↑ description Changed 4 years ago by dkrenn

Replying to jdemeyer:

The function richcmp_by_eq_and_lt from src/sage/rings/asymptotic/misc.py should be moved to src/sage/structure/richcmp.pyx.

+1 :)

comment:2 Changed 4 years ago by jdemeyer

I think this function should never have been put in src/sage/rings/asymptotic in the first place. When you write general functions, they should be put in a general place, not hidden in src/sage/rings/asymptotic.

comment:3 Changed 4 years ago by jdemeyer

For this reason, most of the contents of src/sage/rings/asymptotic/misc.py doesn't belong there. For example, why is transform_category not a method of Category? Hiding such general functions tends to encourage reinventing the wheel. Maybe people working on a completely different part of Sage need something like transform_category. Those people wouldn't know that it exists in rings/asymptotic, so they would need to reinvent it. Anyway, I'm not going to deal with that here, only with richcmp_by_eq_and_lt.

comment:4 Changed 4 years ago by jdemeyer

  • Description modified (diff)
Note: See TracTickets for help on using tickets.