[issue42316] Walrus Operator in list index

2020-11-16 Thread Lysandros Nikolaou
Lysandros Nikolaou added the comment: New changeset cae60187cf7a7b26281d012e1952fafe4e2e97e9 by Lysandros Nikolaou in branch 'master': bpo-42316: Allow unparenthesized walrus operator in indexes (GH-23317) https://github.com/python/cpython/commit/cae60187cf7a7b26281d012e1952fafe4e2e97e9

[issue42316] Walrus Operator in list index

2020-11-16 Thread Lysandros Nikolaou
Change by Lysandros Nikolaou : -- nosy: +lys.nikolaou nosy_count: 3.0 -> 4.0 pull_requests: +22208 pull_request: https://github.com/python/cpython/pull/23317 ___ Python tracker

[issue42316] Walrus Operator in list index

2020-11-14 Thread Terry J. Reedy
Change by Terry J. Reedy : -- keywords: +patch pull_requests: +22182 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23291 ___ Python tracker ___

[issue42316] Walrus Operator in list index

2020-11-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: PEP 572 does not saw much of anything about when parens are needed. Nor does the low priority itself. Looking through the grammar of expressions, an assignment_expression is also a starred_expression, a positional_item (in calls), and the first part of a

[issue42316] Walrus Operator in list index

2020-11-10 Thread Brandon
not a top-level assignment nor is it a list comprehension so I would expect it to work in the first example. -- components: asyncio messages: 380691 nosy: Brando753, asvetlov, yselivanov priority: normal severity: normal status: open title: Walrus Operator in list index versions:

Re: Button press event - event handling and picking: IndexError: list index out of range

2020-06-09 Thread Cousin Stanley
Caledonian26 wrote: > However, I keep getting the error: > > IndexError: list index out of range. > > Could anyone give me a helping hand > as to where I am going wrong? > I appended a single arbitrary value for limits since the limits list ha

Re: Button press event - event handling and picking: IndexError: list index out of range

2020-06-07 Thread DL Neil via Python-list
On 8/06/20 10:38 AM, MRAB wrote: On 2020-06-07 23:24, DL Neil via Python-list wrote: On 8/06/20 7:06 AM, Caledonian26 wrote: ... However, I keep getting the error: IndexError: list index out of range. Could anyone give me a helping hand as to where I am going wrong? When things go wrong

Re: Button press event - event handling and picking: IndexError: list index out of range

2020-06-07 Thread MRAB
On 2020-06-07 23:24, DL Neil via Python-list wrote: On 8/06/20 7:06 AM, Caledonian26 wrote: ... However, I keep getting the error: IndexError: list index out of range. Could anyone give me a helping hand as to where I am going wrong? When things go wrong, Python tries to be helpful

Re: Button press event - event handling and picking: IndexError: list index out of range

2020-06-07 Thread DL Neil via Python-list
On 8/06/20 7:06 AM, Caledonian26 wrote: ... However, I keep getting the error: IndexError: list index out of range. Could anyone give me a helping hand as to where I am going wrong? When things go wrong, Python tries to be helpful by providing a "traceback". Please copy-paste

Button press event - event handling and picking: IndexError: list index out of range

2020-06-07 Thread Caledonian26
ow() 4. Here, a different colour is assigned to each bar in the bar chart depending on the values in the column 'colourofbars'. I then try to plot a legend showing this colour gradient scale. However, I keep getting the error: IndexError: list index out of range. Could anyone give me a helping hand as to where I am going wrong? -- https://mail.python.org/mailman/listinfo/python-list

[issue40109] List index doesn't work with multiple assignment

2020-03-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: Python doesn't have multiple assignment, just tuple unpacking. Consider the order of evaluation here: 1. tmp = (6, x[2]) (i.e., (6, 2)) 2. x[2] = tmp[0] 3. tmp2 = x.index(6) (= 2) 4. x[tmp2] = tmp[1] (i.e., x[2] = 2) -- nosy: +benjamin.peterson

[issue40109] List index doesn't work with multiple assignment

2020-03-29 Thread Nathan Brooks
] print(x) [1,2,6,4,5,3,7] -- messages: 365289 nosy: Nathan Brooks priority: normal severity: normal status: open title: List index doesn't work with multiple assignment ___ Python tracker <https://bugs.python.org/issue40

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2018-10-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +9223 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: What's an elegant way to test for list index existing?

2018-09-30 Thread Alister via Python-list
On Sun, 30 Sep 2018 11:45:21 +0100, Bart wrote: > On 30/09/2018 11:14, Chris Green wrote: >> Chris Angelico wrote: >>> On Sat, Sep 29, 2018 at 12:21 PM Chris Green wrote: I have a list created by:- fld = shlex.split(ln) It may contain 3, 4 or 5 entries

Re: What's an elegant way to test for list index existing?

2018-09-30 Thread Chris Green
Bart wrote: > On 30/09/2018 11:14, Chris Green wrote: > > Chris Angelico wrote: > >> On Sat, Sep 29, 2018 at 12:21 PM Chris Green wrote: > >>> > >>> I have a list created by:- > >>> > >>> fld = shlex.split(ln) > >>> > >>> It may contain 3, 4 or 5 entries according to data read into ln. >

Re: What's an elegant way to test for list index existing?

2018-09-30 Thread Chris Green
Chris Angelico wrote: > On Sat, Sep 29, 2018 at 12:21 PM Chris Green wrote: > > > > I have a list created by:- > > > > fld = shlex.split(ln) > > > > It may contain 3, 4 or 5 entries according to data read into ln. > > What's the neatest way of setting the fourth and fifth entries to an > >

Re: What's an elegant way to test for list index existing?

2018-09-30 Thread Chris Green
Glen D souza wrote: > i have a approach, it may not be best > > fld = [ ] > for data in shlex.split(ln): >fld.append(data) > It's certainly simple! :-) I (OP) have actually done something quite similar:- fld = shlex.split(ln) fld.append(999) fld.append(999) It means I

Re: What's an elegant way to test for list index existing?

2018-09-30 Thread Peter Otten
Glen D souza wrote: > fld = [ ] > data = shlex.split(ln) > for item in data: >fld.append(item) > fld = fld + [0] * (5 - len(data)) There's no need to make a copy of data, one item at the time. It's a tedious way to build a new list, and you are throwing it away in the next line anyway,

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
i have a approach, it may not be best fld = [ ] for data in shlex.split(ln): fld.append(data) On Sat, 29 Sep 2018 at 07:52, wrote: > On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: > > I have a list created by:- > > > > fld = shlex.split(ln) > > > > It may

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
fld = [ ] data = shlex.split(ln) for item in data: fld.append(item) fld = fld + [0] * (5 - len(data)) On Sat, 29 Sep 2018 at 11:03, Glen D souza wrote: > i have a approach, it may not be best > > fld = [ ] > for data in shlex.split(ln): >fld.append(data) > > > > On Sat, 29 Sep

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Chris Angelico
On Sat, Sep 29, 2018 at 12:21 PM Chris Green wrote: > > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. > What's the neatest way of setting the fourth and fifth entries to an > empty string if they don't (yet) exist?

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Alister via Python-list
On Fri, 28 Sep 2018 19:00:29 +0100, Chris Green wrote: > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. What's > the neatest way of setting the fourth and fifth entries to an empty > string if they don't (yet) exist?

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Dan Sommers
On 9/28/18 2:00 PM, Chris Green wrote: I have a list created by:- fld = shlex.split(ln) It may contain 3, 4 or 5 entries according to data read into ln. What's the neatest way of setting the fourth and fifth entries to an empty string if they don't (yet) exist? Using 'if len(fld) < 4:'

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Peter Otten
Ben Finney wrote: > Ben Finney writes: > >> You can use a comprehension, iterating over the full range of index you >> want:: >> >> words = shlex.split(line) >> padding_length = 5 >> words_padded = [ >> (words[index] if index < len(words)) >> for index in

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Ben Finney
Ben Finney writes: > You can use a comprehension, iterating over the full range of index you > want:: > > words = shlex.split(line) > padding_length = 5 > words_padded = [ > (words[index] if index < len(words)) > for index in range(padding_length)] That omits the

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Chris Green
Thanks all, several possible ways of doing it there. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Peter Otten
jlada...@itu.edu wrote: > On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: >> I have a list created by:- >> >> fld = shlex.split(ln) >> >> It may contain 3, 4 or 5 entries according to data read into ln. >> What's the neatest way of setting the fourth and fifth entries

Re: What's an elegant way to test for list index existing?

2018-09-28 Thread Ben Finney
Chris Green writes: > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. Because of what an index means for the 'list' type, that's equivalent to saying "the result of `len(fld)` may be 3, 4, or 5". > What's the neatest

Re: What's an elegant way to test for list index existing?

2018-09-28 Thread jladasky
On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: > I have a list created by:- > > fld = shlex.split(ln) > > It may contain 3, 4 or 5 entries according to data read into ln. > What's the neatest way of setting the fourth and fifth entries to an > empty string if they

What's an elegant way to test for list index existing?

2018-09-28 Thread Chris Green
I have a list created by:- fld = shlex.split(ln) It may contain 3, 4 or 5 entries according to data read into ln. What's the neatest way of setting the fourth and fifth entries to an empty string if they don't (yet) exist? Using 'if len(fld) < 4:' feels clumsy somehow. -- Chris Green · --

[issue33415] When add_mutually_exclusive_group is built without argument, the help breaks with "IndexError: list index out of range"

2018-09-22 Thread paul j3
paul j3 added the comment: This is duplicate of https://bugs.python.org/issue26952 - argparse help formatter crashes The same issue - a mutually exclusive group without arguments. It also deals with issue of nesting groups. -- resolution: -> duplicate stage: -> resolved status:

[issue33415] When add_mutually_exclusive_group is built without argument, the help breaks with "IndexError: list index out of range"

2018-05-04 Thread paul j3
paul j3 added the comment: The usage formatter is brittle, especially the part that adds mutually exclusive markings to the normal usage string. I don't think I've seen this error before, but I'm not surprised. A real fix requires a rewrite of the usage formatter, which

[issue33415] When add_mutually_exclusive_group is built without argument, the help breaks with "IndexError: list index out of range"

2018-05-03 Thread Ariel Otilibili Anieli
New submission from Ariel Otilibili Anieli <arielani...@yahoo.fr>: Hello, When add_mutually_exclusive_group is built without argument, the help breaks with "IndexError: list index out of range". Indeed this snippet: actions_ = parser.add_argument_group('Actions') act

Re: python list index - an easy question

2016-12-20 Thread BartC
On 20/12/2016 00:49, Steve D'Aprano wrote: On Mon, 19 Dec 2016 03:21 am, BartC wrote: On 18/12/2016 10:59, Paul Götze wrote: Hi John, there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list.

Re: python list index - an easy question

2016-12-19 Thread Steve D'Aprano
On Mon, 19 Dec 2016 03:21 am, BartC wrote: > On 18/12/2016 10:59, Paul Götze wrote: >> Hi John, >> >> there is a nice short article by E. W. Dijkstra about why it makes sense >> to start numbering at zero (and exclude the upper given bound) while >> slicing a list. Might give a bit of additional

Re: python list index - an easy question

2016-12-19 Thread Gregory Ewing
BartC wrote: But if you needed a table of the frequencies of letters A to Z... An N-based array can simply have bounds of ord('A') to ord('Z') inclusive. That's fine if your language lets you have arrays with arbitrary lower bounds. But if the language only allows a fixed lower bound, and

Re: python list index - an easy question

2016-12-19 Thread Ben Bacarisse
Jussi Piitulainen writes: > Ben Bacarisse writes: > >> BartC writes: >> >>> You need to take your C hat off, I think. >> >> It's a computing hat. Indexes are best seen as offsets (i.e. as a >> measured distances from some origin or base). It's a model that grew

Re: python list index - an easy question

2016-12-19 Thread BartC
On 19/12/2016 13:48, Ben Bacarisse wrote: BartC writes: You need to take your C hat off, I think. It's a computing hat. Indexes are best seen as offsets (i.e. as a measured distances from some origin or base). A 1-based or N-based index can still be seen as an offset

Re: python list index - an easy question

2016-12-19 Thread Jussi Piitulainen
Ben Bacarisse writes: > BartC writes: > >> You need to take your C hat off, I think. > > It's a computing hat. Indexes are best seen as offsets (i.e. as a > measured distances from some origin or base). It's a model that grew > out of machine addressing and assembler address modes many, many >

Re: python list index - an easy question

2016-12-19 Thread Ben Bacarisse
BartC writes: > On 19/12/2016 01:10, Ben Bacarisse wrote: >> BartC writes: >> >>> On 18/12/2016 10:59, Paul Götze wrote: there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given

Re: python list index - an easy question

2016-12-19 Thread Ned Batchelder
On Sunday, December 18, 2016 at 11:21:38 AM UTC-5, BartC wrote: > On 18/12/2016 10:59, Paul Götze wrote: > > Hi John, > > > > there is a nice short article by E. W. Dijkstra about why it makes sense > > to start numbering at zero (and exclude the upper given bound) while > > slicing a list. Might

Re: python list index - an easy question

2016-12-19 Thread BartC
On 19/12/2016 01:10, Ben Bacarisse wrote: BartC writes: On 18/12/2016 10:59, Paul Götze wrote: there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list. Might give a bit of

Re: python list index - an easy question

2016-12-18 Thread Ben Bacarisse
BartC writes: > On 18/12/2016 10:59, Paul Götze wrote: >> there is a nice short article by E. W. Dijkstra about why it makes sense >> to start numbering at zero (and exclude the upper given bound) while >> slicing a list. Might give a bit of additional understanding. >> >>

Re: python list index - an easy question

2016-12-18 Thread BartC
On 18/12/2016 22:21, BartC wrote: On 18/12/2016 21:04, Michael Torrie wrote: On 12/18/2016 09:21 AM, BartC wrote: So if you wanted a simple list giving the titles of the chapters in a book or on a DVD, on the colour of the front doors for each house in a street, usually you wouldn't be able

Re: python list index - an easy question

2016-12-18 Thread BartC
On 18/12/2016 21:04, Michael Torrie wrote: On 12/18/2016 09:21 AM, BartC wrote: So if you wanted a simple list giving the titles of the chapters in a book or on a DVD, on the colour of the front doors for each house in a street, usually you wouldn't be able to use element 0. It also depends

Re: python list index - an easy question

2016-12-18 Thread Cameron Simpson
On 18Dec2016 16:21, BartC wrote: On 18/12/2016 10:59, Paul Götze wrote: there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list. Might give a bit of additional understanding.

Re: python list index - an easy question

2016-12-18 Thread Michael Torrie
On 12/18/2016 09:21 AM, BartC wrote: > On 18/12/2016 10:59, Paul Götze wrote: >> Hi John, >> >> there is a nice short article by E. W. Dijkstra about why it makes sense >> to start numbering at zero (and exclude the upper given bound) while >> slicing a list. Might give a bit of additional

Re: python list index - an easy question

2016-12-18 Thread alister
On Sun, 18 Dec 2016 16:21:20 +, BartC wrote: > On 18/12/2016 10:59, Paul Götze wrote: >> Hi John, >> >> there is a nice short article by E. W. Dijkstra about why it makes >> sense to start numbering at zero (and exclude the upper given bound) >> while slicing a list. Might give a bit of

Re: python list index - an easy question

2016-12-18 Thread BartC
On 18/12/2016 10:59, Paul Götze wrote: Hi John, there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list. Might give a bit of additional understanding.

Re: python list index - an easy question

2016-12-18 Thread Paul Götze
Hi John, there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list. Might give a bit of additional understanding. http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF - paul

Re: python list index - an easy question

2016-12-18 Thread alister
On Sat, 17 Dec 2016 11:10:22 -0800, John wrote: > Hi, > >I am new to Python, and I believe it's an easy question. I know R and >Matlab. > > x=[1,2,3,4,5,6,7] x[0] > 1 x[1:5] > [2, 3, 4, 5] * > > My question is: what does x[1:5] mean? By

Re: python list index - an easy question

2016-12-17 Thread BartC
On 17/12/2016 19:10, John wrote: Hi, I am new to Python, and I believe it's an easy question. I know R and Matlab. x=[1,2,3,4,5,6,7] x[0] 1 x[1:5] [2, 3, 4, 5] * My question is: what does x[1:5] mean? x[A:B] means the slice consisting of x[A], x[A+1],...

Re: python list index - an easy question

2016-12-17 Thread Terry Reedy
On 12/17/2016 2:10 PM, John wrote: Hi, I am new to Python, and I believe it's an easy question. I know R and Matlab. x=[1,2,3,4,5,6,7] x[0] 1 x[1:5] [2, 3, 4, 5] * My question is: what does x[1:5] mean? The subsequence between slice positions 1 and 5,

Re: python list index - an easy question

2016-12-17 Thread Peter Otten
John wrote: > Hi, > >I am new to Python, and I believe it's an easy question. I know R and >Matlab. > > x=[1,2,3,4,5,6,7] x[0] > 1 x[1:5] > [2, 3, 4, 5] > * > > My question is: what does x[1:5] mean? By Python's convention, the > first

Re: python list index - an easy question

2016-12-17 Thread boB Stepp
On Sat, Dec 17, 2016 at 1:10 PM, John wrote: > > Hi, > >I am new to Python, and I believe it's an easy question. I know R and > Matlab. > > > >>> x=[1,2,3,4,5,6,7] > >>> x[0] > 1 > >>> x[1:5] > [2, 3, 4, 5] > * > > My question is: what does

python list index - an easy question

2016-12-17 Thread John
Hi, I am new to Python, and I believe it's an easy question. I know R and Matlab. >>> x=[1,2,3,4,5,6,7] >>> x[0] 1 >>> x[1:5] [2, 3, 4, 5] * My question is: what does x[1:5] mean? By Python's convention, the first element of a list is indexed as "0". Doesn't

Re: IndexError: list index out of range

2016-12-13 Thread Elnaz
On Tuesday, December 13, 2016 at 12:45:49 PM UTC+3:30, Peter Otten wrote: > Elnaz wrote: > > > hi > > i am begginer in python. I have written a code and given this error: > > IndexError: list index out of range > > > > In my program, I have h=32 bits input

Re: IndexError: list index out of range

2016-12-13 Thread Peter Otten
Elnaz wrote: > hi > i am begginer in python. I have written a code and given this error: > IndexError: list index out of range > > In my program, I have h=32 bits input. i divide this 32 bits to 4*8 block > and every 8-block is n. so n=0:7;(h=int(n/4)) I want to rotate 0 to 7

IndexError: list index out of range

2016-12-12 Thread Elnaz
hi i am begginer in python. I have written a code and given this error: IndexError: list index out of range In my program, I have h=32 bits input. i divide this 32 bits to 4*8 block and every 8-block is n. so n=0:7;(h=int(n/4)) I want to rotate 0 to 7 bits for 2 bits: 0,1,2,3,4,5,6,7

Re: list index out of range Error , need to fix it or ignore it

2016-02-28 Thread Oscar Benjamin
On 27 February 2016 at 16:50, Ganesh Pal wrote: > Iam on python 2.6 and Linux , I need input on the below program , > here is the spinet of my program It would be much better if you presented a complete program here. Otherwise the missing parts will confuse people. See:

Re: list index out of range Error , need to fix it or ignore it

2016-02-28 Thread Steven D'Aprano
On Sun, 28 Feb 2016 03:50 am, Ganesh Pal wrote: > Iam on python 2.6 and Linux , I need input on the below program , > here is the spinet of my program > > > filename='/tmp2/2.txt' > > def check_file(): > """ > Run the command parallel on all the machines , if there is a > file named

Re: list index out of range Error , need to fix it or ignore it

2016-02-28 Thread Ganesh Pal
>> > what is run(...) > The run (_ is a wrapper it uses suprocess.Popen and returns stdout ,error and extitcod e > not a good idea to have catchall exception how to fix this ? > >> > return False >> > if __name__ == '__main__': >> > main() >> > >> -- >> > copy and paste your

Re: list index out of range Error , need to fix it or ignore it

2016-02-27 Thread Joel Goldstick
On Sat, Feb 27, 2016 at 12:01 PM, Ganesh Pal wrote: > changed baddr="" to file ="" in the example program , sorry for the typo > > > filename='/tmp2/2.txt' > > > > def check_file(): > don't use global filename. just pass filename into check_file def check_file(filename):

Re: list index out of range Error , need to fix it or ignore it

2016-02-27 Thread Ganesh Pal
changed baddr="" to file ="" in the example program , sorry for the typo > filename='/tmp2/2.txt' > > def check_file(): > """ > Run the command parallel on all the machines , if there is a > file named /tmp/file2.txt extract file2.txt > > """ > global filename > file = '' >

list index out of range Error , need to fix it or ignore it

2016-02-27 Thread Ganesh Pal
Iam on python 2.6 and Linux , I need input on the below program , here is the spinet of my program filename='/tmp2/2.txt' def check_file(): """ Run the command parallel on all the machines , if there is a file named /tmp/file2.txt extract file2.txt """ global filename

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread Yury Selivanov
Yury Selivanov added the comment: I think this is a duplicate of http://bugs.python.org/issue26280... -- ___ Python tracker ___

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: > I think this is a duplicate of http://bugs.python.org/issue26280... Oh, I missed this one. I didn't understand "[]" in the title. I didn't understand the purpose of optimizing BUILD_LIST :-D -- resolution: -> duplicate status: open -> closed

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
59708 nosy: haypo, rhettinger, yselivanov priority: normal severity: normal status: open title: ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR type: performance versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <htt

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
STINNER Victor added the comment: (Oops, I attached the wrong patch, fixed in patch v2.) Quick & dirty micro-benchmark: Original: $ ./python -m timeit -s 'lst=list("hello")' 'lst[2]' 1000 loops, best of 3: 0.0261 usec per loop Patched: $ ./python -m timeit -s 'lst=list("hello")'

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file41833/binary_subscr.patch ___ Python tracker ___

[issue26301] ceval.c: reintroduce fast-path for list[index] in BINARY_SUBSCR

2016-02-05 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file41833/binary_subscr.patch ___ Python tracker

[issue16811] email.message.Message flatten dies of list index out of range

2015-11-20 Thread R. David Murray
R. David Murray added the comment: Please open a new issue and provide a reproducer. Thanks. -- ___ Python tracker ___

[issue16811] email.message.Message flatten dies of list index out of range

2015-11-20 Thread Jan Malte
Jan Malte added the comment: seems like this happens still, if the CC header starts with a new line character. Python 3.4.3 -- nosy: +janmalte ___ Python tracker

Re: indexerror: list index out of range??

2013-07-01 Thread Joshua Landau
On 29 June 2013 15:30, Mark Lawrence breamore...@yahoo.co.uk wrote: On 29/06/2013 14:44, Dave Angel wrote: Since you're using the arrogant and buggy GoogleGroups, this http://wiki.python.org/moin/GoogleGroupsPython. Please don't make comments like this, you'll upset the Python Mailing List

Re: indexerror: list index out of range??

2013-07-01 Thread Robert Kern
On 2013-06-29 16:52, Joshua Landau wrote: On 29 June 2013 15:30, Mark Lawrence breamore...@yahoo.co.uk wrote: On 29/06/2013 14:44, Dave Angel wrote: Since you're using the arrogant and buggy GoogleGroups, this http://wiki.python.org/moin/GoogleGroupsPython. Please don't make comments like

Re: indexerror: list index out of range??

2013-07-01 Thread Steven D'Aprano
On Mon, 01 Jul 2013 09:45:52 +0100, Robert Kern wrote: On 2013-06-29 16:52, Joshua Landau wrote: On 29 June 2013 15:30, Mark Lawrence breamore...@yahoo.co.uk wrote: On 29/06/2013 14:44, Dave Angel wrote: Since you're using the arrogant and buggy GoogleGroups, this

Re: indexerror: list index out of range??

2013-06-29 Thread Dave Angel
On 06/28/2013 11:35 PM, Titiksha wrote: On Friday, June 28, 2013 8:20:28 PM UTC-5, Titiksha wrote: SNIP double-spaced nonsense m=['631138', '601034', '2834', '2908', '64808'] SNIP more double-spaced nonsense ['LAKEFLD 3227,631138\n', 'NOBLES 3013,601034\n']

Re: indexerror: list index out of range??

2013-06-29 Thread Mark Lawrence
On 29/06/2013 14:44, Dave Angel wrote: On 06/28/2013 11:35 PM, Titiksha wrote: Since you're using the arrogant and buggy GoogleGroups, this http://wiki.python.org/moin/GoogleGroupsPython. Please don't make comments like this, you'll upset the Python Mailing List Police. -- Steve is going

indexerror: list index out of range??

2013-06-28 Thread Titiksha Joshi
Hi, I am working on the following code but am getting the error: list index out of range. I surfed through the group but somehow I am not able to fix my error.Please guide.Structure is given below: m is a list of 5 elements. I have to match elements of m from fields in file ALL_BUSES_FINAL.cvs

Re: indexerror: list index out of range??

2013-06-28 Thread Chris Angelico
On Sat, Jun 29, 2013 at 11:20 AM, Titiksha Joshi joshi.titiksh...@gmail.com wrote: Hi, I am working on the following code but am getting the error: list index out of range. I surfed through the group but somehow I am not able to fix my error.Please guide.Structure is given below: m

Re: indexerror: list index out of range??

2013-06-28 Thread Dave Angel
On 06/28/2013 09:20 PM, Titiksha Joshi wrote: Hi, I am working on the following code but am getting the error: list index out of range. I surfed through the group but somehow I am not able to fix my error.Please guide.Structure is given below: m is a list of 5 elements. I have to match

Re: indexerror: list index out of range??

2013-06-28 Thread Titiksha
On Friday, June 28, 2013 8:20:28 PM UTC-5, Titiksha wrote: Hi, I am working on the following code but am getting the error: list index out of range. I surfed through the group but somehow I am not able to fix my error.Please guide.Structure is given below: m is a list of 5 elements. I

[issue16811] email.message.Message flatten dies of list index out of range

2013-02-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4553dfcafac7 by R David Murray in branch '3.3': News item for issue #16811 fix. http://hg.python.org/cpython/rev/4553dfcafac7 New changeset 68be406e76e1 by R David Murray in branch 'default': Merge: News item for issue #16811 fix.

[issue16811] email.message.Message flatten dies of list index out of range

2013-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset e64b74227198 by R David Murray in branch '3.3': #16811: Fix folding of headers with no value in provisional policies. http://hg.python.org/cpython/rev/e64b74227198 New changeset fe7f3e2e49ce by R David Murray in branch 'default': Merge #16811: Fix

[issue16811] email.message.Message flatten dies of list index out of range

2013-02-04 Thread R. David Murray
R. David Murray added the comment: Fixed, thanks. There are some other issues with folding values consisting of only blanks, but I'll deal with that in the context of other issues. With this fix the new folding algorithm works at least as well as the old folding algorithm on blank values.

[issue16811] email.message.Message flatten dies of list index out of range

2012-12-29 Thread Helmut Jarausch
, line 176, in _fold (len(lines[0])+len(name)+2 maxlen or IndexError: list index out of range If I strip the '\n' from the lines feeded to the Parser, the bug does not occur. Thanks for looking into it, Helmut. This is with Python 3.3.0+ 3.3:ccc372b37fbb+ -- components: Library

[issue16811] email.message.Message flatten dies of list index out of range

2012-12-29 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- components: +email nosy: +barry, r.david.murray stage: - needs patch type: crash - behavior versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16811

[issue16811] email.message.Message flatten dies of list index out of range

2012-12-29 Thread R. David Murray
R. David Murray added the comment: Thanks for the report. We thought we fixed this once already (in issue 11401). It looks like that only fixed the old folding algorithm, and that the new one has the same bug. I thought the test ran against both algorithms, but I must have made a mistake.

[issue7252] list().index() should provide better error reporting

2011-11-07 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: FWIW, quickly grepping through the raises of ValueErrors in the 2.6 stdlib doesn't bring up any other usage of repeat-with-fake-variable-x. #13349 begs to differ :) -- nosy: +eric.araujo ___ Python

List index out of range, but list has enough elements

2010-11-09 Thread Costin Gamenț
statement works, but print i[0] returns IndexError: list index out of range. Am I missing something? -- http://mail.python.org/mailman/listinfo/python-list

Re: List index out of range, but list has enough elements

2010-11-09 Thread Stefan Behnel
print i[0] the print j statement works, but print i[0] returns IndexError: list index out of range. Am I missing something? Are you sure the output you get from the print j is from the same loop iteration as the print i[0]? Try adding i to the output. Stefan -- http

Re: List index out of range, but list has enough elements

2010-11-09 Thread Peter Otten
print i[0] the print j statement works, but print i[0] returns IndexError: list index out of range. Am I missing something? Change print i[0] to print i You'll see that there are empty rows in your data. You cannot detect these rows with for j in i: print j because you get zero

Re: List index out of range, but list has enough elements

2010-11-09 Thread Costin Gamenț
works, but print i[0] returns IndexError: list index out of range. Am I missing something? Are you sure the output you get from the print j is from the same loop iteration as the print i[0]? Try adding i to the output. Stefan -- http://mail.python.org/mailman/listinfo/python-list -- http

Re: List index out of range, but list has enough elements

2010-11-09 Thread Nitin Pawar
: csvfile = csv.reader(datastr.split('\n'), delimiter=';') r = '' for i in csvfile: for j in i: print j print i[0] the print j statement works, but print i[0] returns IndexError: list index out of range. Am I missing

Re: List index out of range, but list has enough elements

2010-11-09 Thread Costin Gamenț
. Here's my code:        csvfile = csv.reader(datastr.split('\n'), delimiter=';')        r = ''        for i in csvfile:                for j in i:                        print j                print i[0] the print j statement works, but print i[0] returns IndexError: list index out

Re: List index out of range, but list has enough elements

2010-11-09 Thread Stefan Behnel
. Here's my code: csvfile = csv.reader(datastr.split('\n'), delimiter=';') r = '' for i in csvfile: for j in i: print j print i[0] the print j statement works, but print i[0] returns IndexError: list index out of range

Re: inspect.stack() or inspect.currentframe() gives list index out of range error

2010-09-25 Thread deluxstar
, inspect.currentframe() or inspect.stack() function gives List index out of range error. When I googled, I found only one clue of copying pyc files: http://forum.webfaction.com/viewtopic.php?pid=16808 Why inspect modules gives this error? OR Is there another way to get the caller objects variable value

Re: inspect.stack() or inspect.currentframe() gives list index out of range error

2010-09-25 Thread Steven D'Aprano
[-] File /usr/lib/python2.6/inspect.py, line 568, in findsource 2010-09-25 10:50:38+0300 [-] if pat.match(lines[lnum]): break 2010-09-25 10:50:38+0300 [-] IndexError: list index out of range I'm going to take a wild guess here. My guess is that you've copied the .pyc file onto the server

Re: inspect.stack() or inspect.currentframe() gives list index out of range error

2010-09-25 Thread Wolfgang Rohdewald
On Samstag 25 September 2010, Steven D'Aprano wrote: My guess is that you've copied the .pyc file onto the server, BUT there is also an older version of the .py file there as well. Because the modification date is older than that of the .pyc file, Python executes the compiled code from the

Re: inspect.stack() or inspect.currentframe() gives list index out of range error

2010-09-25 Thread Terry Reedy
/python2.6/inspect.py, line 568, in findsource 2010-09-25 10:50:38+0300 [-] if pat.match(lines[lnum]): break 2010-09-25 10:50:38+0300 [-] IndexError: list index out of range It is hard to reproduce the error with a script. I will work and send if I success. If the traceback tells smth, please tell me

  1   2   3   >