Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate documentation for number field elements_of_norm #32860

Closed
JohnCremona opened this issue Nov 12, 2021 · 10 comments
Closed

Inaccurate documentation for number field elements_of_norm #32860

JohnCremona opened this issue Nov 12, 2021 · 10 comments

Comments

@JohnCremona
Copy link
Member

For a number field K and an integer n,
the function K.elements_of_norm(n) returns
a list of integral elements of K with norm n,
up to multiplication by units of positive norm.
The docstring says that n should be an "integer
in this number field", which is wrong (and makes
no sense): it must be a rational integer.

If you give the function something else (e.g. a
non-integral rational or an element of K (even
K(0)), a PariError is raised, and it would be
better for Sage to check the input, say by trying
n = ZZ(n) first.

CC: @slel

Component: number fields

Keywords: number field norm

Author: Frédéric Chapoton

Branch/Commit: 59e2efa

Reviewer: John Cremona

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

@slel

This comment has been minimized.

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton
Copy link
Contributor

New commits:

59e2efafix doc for elements_of_norm

@fchapoton
Copy link
Contributor

Commit: 59e2efa

@fchapoton
Copy link
Contributor

Branch: u/chapoton/32860

@fchapoton
Copy link
Contributor

comment:3

here is a minimal branch

@JohnCremona
Copy link
Member Author

comment:4

Thanks. I report things and then simply forget.

I'm not familiar with the syntax --> list in the function header. Is that a new python thing?

@fchapoton
Copy link
Contributor

comment:5

This is a "type annotation". This means that it is a declaration stating that the output is a list.

This kind of annotation (optional) has been introduced in recent versions of python. It allows some tools (mypy) to check consistency inside the code. Also useful for refined tab completions, in principle.

The lights are green, so the branch is ready for review.

@JohnCremona
Copy link
Member Author

Reviewer: John Cremona

@vbraun
Copy link
Member

vbraun commented Jan 4, 2022

Changed branch from u/chapoton/32860 to 59e2efa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants