[sage-devel] Re: Lollipop vs. Barbell

2017-02-03 Thread David Coudert
Le mardi 29 novembre 2016 17:42:51 UTC+1, Peleg Michaeli a écrit : > > Dear list members, > > I was wondering what really makes the difference between the graph > generators in `basic.py` and those in `families.py`. > When we created the directory `generators` to split a big file with plenty

Re: [sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Travis Scrimshaw
Minor note, Cython code will still use xrange, but it can (often?) optimize calls to range. Best, Travis On Wednesday, December 7, 2016 at 5:00:56 AM UTC-6, Thierry (sage-googlesucks@xxx) wrote: > > On Wed, Dec 07, 2016 at 01:05:47AM -0800, Peleg Michaeli wrote: > > I can wrap it with list

Re: [sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Thierry
On Wed, Dec 07, 2016 at 01:05:47AM -0800, Peleg Michaeli wrote: > I can wrap it with list indeed. I know that six.moves.range is an iterator > - in Python 2, it is simply xrange. But I was thinking that perhaps Graph's > constructor should be able to understand xrange (or rather, iterators in >

[sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Dima Pasechnik
It would be great to let Graph accept iterators. You are most welcome to work on this. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[sage-devel] Re: Lollipop vs. Barbell

2016-12-07 Thread Peleg Michaeli
I can wrap it with list indeed. I know that six.moves.range is an iterator - in Python 2, it is simply xrange. But I was thinking that perhaps Graph's constructor should be able to understand xrange (or rather, iterators in general) instead of lists when the data is a dictionary of neighbours.

[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Sébastien Labbé
Frédéric, Peleg is a new contributor to Sage that we met in recent Sage Days 79. I am sure he can understand the general move toward Python 3 if we are pedagogical. So thanks for your second reply that appeared while I am writting this. I know that you have been working hard on the -> Python

[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Frédéric Chapoton
The new (python3 or six) range is an iterator. You just have to wrap it with list( ) to get back to the python2 behaviour if needed. Le mardi 6 décembre 2016 17:31:20 UTC+1, Frédéric Chapoton a écrit : > > DO NOT TOUCH the import of range from six.moves ! This is part of our > general move

[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Frédéric Chapoton
DO NOT TOUCH the import of range from six.moves ! This is part of our general move toward python3 ! And do never use xrange, this is now forbidden. Frederic Le mardi 6 décembre 2016 16:26:12 UTC+1, Peleg Michaeli a écrit : > > I actually think that this is an unwanted behaviour of `six`. > >

[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Peleg Michaeli
I actually think that this is an unwanted behaviour of `six`. Anyway, we may let `Graph` handle xrange lists of neighbours if we want to keep it that way. On Tuesday, 6 December 2016 17:18:29 UTC+2, Peleg Michaeli wrote: > > I have tried to move LollipopGraph into families, but there was a

[sage-devel] Re: Lollipop vs. Barbell

2016-12-06 Thread Peleg Michaeli
I have tried to move LollipopGraph into families, but there was a problem. In families, there's the following import: from six.moves import range This overrides Python's range. I don't know why. The original implementation of Lollipop graph uses Python's range, and when it tries to use

[sage-devel] Re: Lollipop vs. Barbell

2016-11-29 Thread Dima Pasechnik
On Tuesday, November 29, 2016 at 4:42:51 PM UTC, Peleg Michaeli wrote: > > Dear list members, > > I was wondering what really makes the difference between the graph > generators in `basic.py` and those in `families.py`. > > For one concrete example, I was wondering why `LollipopGraph` appears