Re: [Python-Dev] issue with itertools leads the crash

2014-04-09 Thread Steven D'Aprano
On Wed, Apr 09, 2014 at 02:40:21PM -0400, Geoffrey Spear wrote: > Of course, this raises the question of whether making slice assignment > not go into an infinite loop when the programmer asks it to is a > bugfix or a new feature. Definitely a new feature. > Calling: > > list(itertools.cycl

Re: [Python-Dev] issue with itertools leads the crash

2014-04-09 Thread Geoffrey Spear
On Wed, Apr 9, 2014 at 1:53 PM, MRAB wrote: > On 2014-04-09 14:26, Mark Lawrence wrote: >> >> On 08/04/2014 17:30, MRAB wrote: >>> >>> On 2014-04-08 16:31, Brett Cannon wrote: >>> >>> Something for Python 3.5, maybe? :-) >>> >>> It's not going to happen in Python 2.7; that's the end of the Python

Re: [Python-Dev] issue with itertools leads the crash

2014-04-09 Thread Ryan Gonzalez
2015!?!? I was hoping it was a tad further off...the PyPy team is going to have to start freaking out in about 12 months. On Wed, Apr 9, 2014 at 8:26 AM, Mark Lawrence wrote: > On 08/04/2014 17:30, MRAB wrote: > >> On 2014-04-08 16:31, Brett Cannon wrote: >> >> Something for Python 3.5, maybe? :

Re: [Python-Dev] issue with itertools leads the crash

2014-04-09 Thread MRAB
On 2014-04-09 14:26, Mark Lawrence wrote: On 08/04/2014 17:30, MRAB wrote: On 2014-04-08 16:31, Brett Cannon wrote: Something for Python 3.5, maybe? :-) It's not going to happen in Python 2.7; that's the end of the Python 2 series, and it's getting security fixes only. According to http://le

Re: [Python-Dev] issue with itertools leads the crash

2014-04-09 Thread Mark Lawrence
On 08/04/2014 17:30, MRAB wrote: On 2014-04-08 16:31, Brett Cannon wrote: Something for Python 3.5, maybe? :-) It's not going to happen in Python 2.7; that's the end of the Python 2 series, and it's getting security fixes only. According to http://legacy.python.org/dev/peps/pep-0373/ the fina

Re: [Python-Dev] issue with itertools leads the crash

2014-04-08 Thread Chris Angelico
On Wed, Apr 9, 2014 at 3:30 AM, Larry Hastings wrote: > On 04/08/2014 12:50 PM, Chris Angelico wrote: > > It would be nice to have a simple notation that fetches what it needs > and ignores any extras. > > a, b, c, * = x.split("-") > > Bomb if there aren't two hyphens in x, but if there are more,

Re: [Python-Dev] issue with itertools leads the crash

2014-04-08 Thread Larry Hastings
On 04/08/2014 12:50 PM, Chris Angelico wrote: It would be nice to have a simple notation that fetches what it needs and ignores any extras. a, b, c, * = x.split("-") Bomb if there aren't two hyphens in x, but if there are more, just take the first three and ignore the rest. Would work with inf

Re: [Python-Dev] issue with itertools leads the crash

2014-04-08 Thread Chris Angelico
On Wed, Apr 9, 2014 at 2:40 AM, Eric Snow wrote: > On Apr 8, 2014 10:31 AM, "MRAB" wrote: >> If the RHS yields too few, e.g. 3, you'll get: >> >> ValueError: attempt to assign sequence of size 3 to extended slice of size 4 >> >> If it yields too many, e.g. 10, you'll get: >> >> ValueError: attemp

Re: [Python-Dev] issue with itertools leads the crash

2014-04-08 Thread Eric Snow
On Apr 8, 2014 10:31 AM, "MRAB" wrote: > If the RHS yields too few, e.g. 3, you'll get: > > ValueError: attempt to assign sequence of size 3 to extended slice of size 4 > > If it yields too many, e.g. 10, you'll get: > > ValueError: attempt to assign sequence of size 10 to extended slice of size 4

Re: [Python-Dev] issue with itertools leads the crash

2014-04-08 Thread MRAB
On 2014-04-08 16:31, Brett Cannon wrote: Please a file a bug at bugs.python.org , otherwise this is most likely going to get lost track of. On Tue Apr 08 2014 at 11:30:15 AM, Kirill mailto:kir_...@rambler.ru>> wrote: issue with itertools leads the crash

[Python-Dev] issue with itertools leads the crash

2014-04-08 Thread Brett Cannon
Please a file a bug at bugs.python.org, otherwise this is most likely going to get lost track of. On Tue Apr 08 2014 at 11:30:15 AM, Kirill wrote: > issue with itertools leads the crash > > The following code leads to system failure and crash on Ubuntu 12.04.3 > with Python 2.7.6. > > import

[Python-Dev] issue with itertools leads the crash

2014-04-08 Thread Kirill
issue with itertools leads the crash The following code leads to system failure and crash on Ubuntu 12.04.3 with Python 2.7.6. import itertools r = range (1,10) r[1:9:2] = itertools.cycle([0]) Kirill . ___ Python-Dev mailing list Python-Dev@