Opened 6 years ago

Closed 6 years ago

#20836 closed enhancement (fixed)

Add new classify_elements() function to refine have_same_parent()

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-7.3
Component: coercion Keywords:
Cc: defeo Merged in:
Authors: Jeroen Demeyer Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: c41bc91 (Commits, GitHub, GitLab) Commit: c41bc91addb41f593e4509d3fd6e9ce7c5789b39
Dependencies: Stopgaps:

Status badges

Description (last modified by tmonteil)

The function have_same_parent(left, right) is useful and needed to support the coercion model. However, that function not only checks whether parent are equal, but also whether left and right are both Elements and whether they have the same type. This information is checked, but lost when have_same_parent returns.

Instead, let us have a function classify_elements(left, right) which does the same checks as have_same_parent() (so it should be equally efficient), but returns all information.

test.

Change History (9)

comment:1 Changed 6 years ago by jdemeyer

  • Branch set to u/jdemeyer/add_new_classify_elements___function_to_refine_have_same_parent__

comment:2 Changed 6 years ago by jdemeyer

  • Commit set to fb4b4952d04ff503fedf1609f9663ce471c876f7
  • Status changed from new to needs_review

New commits:

fb4b495classify_elements() function to refine have_same_parent()

comment:3 Changed 6 years ago by tmonteil

test.

comment:4 Changed 6 years ago by tmonteil

  • Description modified (diff)

comment:5 Changed 6 years ago by git

  • Commit changed from fb4b4952d04ff503fedf1609f9663ce471c876f7 to bcbc08c3d50dcd96169906873e9c6b38b395d17d

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

bcbc08cMinor fixes

comment:6 Changed 6 years ago by jdemeyer

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

comment:7 Changed 6 years ago by git

  • Commit changed from bcbc08c3d50dcd96169906873e9c6b38b395d17d to c41bc91addb41f593e4509d3fd6e9ce7c5789b39
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

c41bc91Use octal also in helper functions

comment:8 Changed 6 years ago by jdemeyer

  • Status changed from needs_review to positive_review

comment:9 Changed 6 years ago by vbraun

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