Re: [sage-devel] Re: DiGraph, int vs. sage Integer

2015-08-10 Thread Jori Mäntysalo
On Mon, 10 Aug 2015, Vincent Delecroix wrote: But sage: G = Graph() sage: G.add_vertices(range(100)) sage: set(type(x) for x in G.vertices()) {} I guess you meant G.add_vertices(IntegerRange(100)). But still true, so it goes. And also G.add_vertices(IntegerRange(1,100)) gives 'Integer' and

Re: [sage-devel] Re: DiGraph, int vs. sage Integer

2015-08-10 Thread Vincent Delecroix
On 10/08/15 09:40, Jori Mäntysalo wrote: On Mon, 10 Aug 2015, Vincent Delecroix wrote: Sounds reasonable. However, it seems to optimize only numbers from 0 to 9. Here is a test code: No. You are wrong. You can just have a look to the code publicly available. It is the class CGraphBackend i

Re: [sage-devel] Re: DiGraph, int vs. sage Integer

2015-08-10 Thread Jori Mäntysalo
On Mon, 10 Aug 2015, Vincent Delecroix wrote: Sounds reasonable. However, it seems to optimize only numbers from 0 to 9. Here is a test code: No. You are wrong. You can just have a look to the code publicly available. It is the class CGraphBackend in the file src/sage/graphs/base/c_graph.pyx

Re: [sage-devel] Re: DiGraph, int vs. sage Integer

2015-08-10 Thread Vincent Delecroix
On 10/08/15 09:19, Jori Mäntysalo wrote: On Sun, 9 Aug 2015, Nathann Cohen wrote: Is this a bug? If not, what is the rationale behind this? What I know is that it was done deliberately, and I do not know the rationale. I can "guess" that it was because "you pay for labels", and that Robert M

Re: [sage-devel] Re: DiGraph, int vs. sage Integer

2015-08-10 Thread Jori Mäntysalo
On Sun, 9 Aug 2015, Nathann Cohen wrote: Is this a bug? If not, what is the rationale behind this? What I know is that it was done deliberately, and I do not know the rationale. I can "guess" that it was because "you pay for labels", and that Robert Miller thought that there was no reason to