Opened 5 years ago
Last modified 6 weeks ago
#25430 new defect
The set of all natural numbers
Reported by: | pelegm | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | coercion | Keywords: | natural numbers, Set, semiring |
Cc: | hivert, nthiery, slelievre | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
I tried to obtain a Set
of all natural numbers. One close method was to call PositiveIntegers()
, which is not a Set
(but something else which I could not understand), but may be coerced into Set
. This does not contain 0, so I used Set(PositiveIntegers()).union(Set([0]))
. The output is called Set-theoretic union of Set of elements of Positive integers and {0}
, instead of the more readable Set of all nonnegative integers
, but this is not the main issue I raise here.
One simpler way to obtain a set of all integers is by using Set(ZZ)
, which creates a Set
from the ring. Apparently, one cannot achieve the set of natural numbers in a similar fashion: Set(NN)
simply hangs, instead of creating a Set
from the semiring.
Tested on 8.2.rc4.
Change History (3)
comment:1 Changed 5 years ago by
Cc: | hivert nthiery slelievre added |
---|
comment:2 Changed 5 years ago by
comment:3 Changed 6 weeks ago by
Milestone: | sage-8.3 |
---|
My guess with
NN
is that it is an issue with unresolved lazy imports (#16522, #14357):So you can get a set of non-negative integers, but
NN
is just specifically broken due to a lazy import issue.