Skip to content

characteristic() should be an integer #12988

@saraedum

Description

@saraedum

Currently characteristic() does not return an Integer for some rings:

sage: type(ZZ.characteristic())
<type 'int'>

This is annoying because one cannot for example do:

sage: ZZ.characteristic().is_prime()
AttributeError: 'int' object has no attribute 'is_prime'

I don't see a good reason not to make characteristic always an Integer. The minimal performance loss should not be an issue in any computation that I can imagine.

Depends on #13043

Component: algebra

Keywords: ZZ characteristic sd40.5

Author: Julian Rueth

Reviewer: David Roe, Jeroen Demeyer

Merged: sage-5.1.beta2

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions