Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-14 Thread Developer Developer
itrou An: python-dev@python.org CC: Gesendet: 11:22 Dienstag, 12.Februar 2013 Betreff: Re: [Python-Dev] Question regarding: Lib/_markupbase.py Le Mon, 11 Feb 2013 11:02:04 -0800, Guido van Rossum a écrit : > Warning: see http://bugs.python.org/issue17170. Depending on the > length of

Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-12 Thread Antoine Pitrou
Le Mon, 11 Feb 2013 11:02:04 -0800, Guido van Rossum a écrit : > Warning: see http://bugs.python.org/issue17170. Depending on the > length of the string being scanned and the probability of finding the > specific character, the proposed change could actually be a > *pessimization*. OTOH if the cha

Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-11 Thread Guido van Rossum
Warning: see http://bugs.python.org/issue17170. Depending on the length of the string being scanned and the probability of finding the specific character, the proposed change could actually be a *pessimization*. OTOH if the character occurs many times, the slice will actually cause O(N**2) behavior

Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-11 Thread Oleg Broytman
On Mon, Feb 11, 2013 at 12:16:48PM +, Developer Developer wrote: > I was having a look at the file: Lib/_markupbase.py (@ 82151), function: > "_parse_doctype_element" and have seen something that has caught my attention: > > if '>' in rawdata[j:]: >     return rawdata.find(">", j) + 1 > >

Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-11 Thread Developer Developer
- > Von: Fred Drake > An: Developer Developer > CC: "python-dev@python.org" > Gesendet: 15:10 Montag, 11.Februar 2013 > Betreff: Re: [Python-Dev] Question regarding: Lib/_markupbase.py > > On Mon, Feb 11, 2013 at 7:16 AM, Developer Developer > wrote: > &g

Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-11 Thread R. David Murray
> Von: Fred Drake > An: Developer Developer > CC: "python-dev@python.org" > Gesendet: 15:10 Montag, 11.Februar 2013 > Betreff: Re: [Python-Dev] Question regarding: Lib/_markupbase.py > > On Mon, Feb 11, 2013 at 7:16 AM, Developer Developer > wrote: > > Would

Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-11 Thread Developer Developer
-- Ursprüngliche Message - Von: Fred Drake An: Developer Developer CC: "python-dev@python.org" Gesendet: 15:10 Montag, 11.Februar 2013 Betreff: Re: [Python-Dev] Question regarding: Lib/_markupbase.py On Mon, Feb 11, 2013 at 7:16 AM, Developer Developer wrote: > Wouldn't it

Re: [Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-11 Thread Fred Drake
On Mon, Feb 11, 2013 at 7:16 AM, Developer Developer wrote: > Wouldn't it be better to do the following? ... > Otherwise I think we are scanning rawdata[j:] twice. Yes, that would be better, and avoids a string object creation as well. -Fred -- Fred L. Drake, Jr. "A storm broke loose in

[Python-Dev] Question regarding: Lib/_markupbase.py

2013-02-11 Thread Developer Developer
Hello all, I was having a look at the file: Lib/_markupbase.py (@ 82151), function: "_parse_doctype_element" and have seen something that has caught my attention: if '>' in rawdata[j:]:     return rawdata.find(">", j) + 1 Wouldn't it be better to do the following? pos = rawdata.find(">", j) if