Skip to content

commutativity test #33757

@videlec

Description

@videlec

In several places the commutativity of a ring is tested via isinstance(base_ring, sage.rings.ring.CommutativeRing) rather than base_ring in sage.categories.commutative_rings.CommutativeRings(). This makes it impossible to have a nicely interacting ring that would just inherit from Parent.

Note that the answers from ring.is_commutative() and ring in CommutativeRings() could be different : the former tests the category initialization whether the second could involve some (possibly costly) checks.

The same remark applies to

  • integral domains
  • fields
  • ...

See also #32810

CC: @mantepse @tscrim @xcaruso

Component: algebra

Author: Frédéric Chapoton

Branch/Commit: b9e410d

Reviewer: Travis Scrimshaw

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions