On Feb 21, 2:24 pm, rdmur...@bitdance.com wrote:
> odeits wrote:
> > On Feb 21, 12:47=A0am, "Gabriel Genellina"
> > wrote:
> > > En Sat, 21 Feb 2009 01:14:02 -0200, odeits escribi=F3:
>
> > > > On Feb 15, 11:31=A0pm, odeits wrote:
> > > >> It seems what you are actually testing for is if the in
odeits wrote:
> On Feb 21, 12:47=A0am, "Gabriel Genellina"
> wrote:
> > En Sat, 21 Feb 2009 01:14:02 -0200, odeits escribi=F3:
> >
> > > On Feb 15, 11:31=A0pm, odeits wrote:
> > >> It seems what you are actually testing for is if the intersection of
> > >> the two sets is not empty where the fi
On Feb 21, 12:47 am, "Gabriel Genellina"
wrote:
> En Sat, 21 Feb 2009 01:14:02 -0200, odeits escribió:
>
>
>
> > On Feb 15, 11:31 pm, odeits wrote:
> >> It seems what you are actually testing for is if the intersection of
> >> the two sets is not empty where the first set is the characters in
>
En Sat, 21 Feb 2009 01:14:02 -0200, odeits escribió:
On Feb 15, 11:31 pm, odeits wrote:
It seems what you are actually testing for is if the intersection of
the two sets is not empty where the first set is the characters in
your word and the second set is the characters in your defined strin
On Feb 15, 11:31 pm, odeits wrote:
> On Feb 15, 9:56 pm, Chris Rebert wrote:
>
>
>
> > On Sun, Feb 15, 2009 at 9:17 PM, wrote:
> > > I need to test strings to determine if one of a list of chars is in the
> > > string. A simple example would be to test strings to determine if they
> > > have
>
MRAB wrote:
Dennis Lee Bieber wrote:
On Wed, 18 Feb 2009 21:22:45 +0100, Peter Otten <__pete...@web.de>
declaimed the following in comp.lang.python:
Steve Holden wrote:
Jervis Whitley wrote:
What happens when you have hundreds of megabytes, I don't know.
I hope I never have to test a wor
Dennis Lee Bieber wrote:
On Wed, 18 Feb 2009 21:22:45 +0100, Peter Otten <__pete...@web.de>
declaimed the following in comp.lang.python:
Steve Holden wrote:
Jervis Whitley wrote:
What happens when you have hundreds of megabytes, I don't know.
I hope I never have to test a word that is hun
On Feb 19, 6:47 pm, Dennis Lee Bieber wrote:
> On Wed, 18 Feb 2009 21:22:45 +0100, Peter Otten <__pete...@web.de>
> declaimed the following in comp.lang.python:
>
> > Steve Holden wrote:
>
> > > Jervis Whitley wrote:
> > >>> What happens when you have hundreds of megabytes, I don't know.
>
> > >>
Steve Holden wrote:
> Jervis Whitley wrote:
>>> What happens when you have hundreds of megabytes, I don't know.
>>>
>>>
>> I hope I never have to test a word that is hundreds of megabytes long
>> for a vowel :)
>
> I see you don't speak German ;-)
I tried to come up with a funny way to point out
Steven D'Aprano wrote:
> On Wed, 18 Feb 2009 07:08:04 +1100, Jervis Whitley wrote:
>
>
>>> This moves the for-loop out of slow Python into fast C and should be
>>> much, much faster for very large input.
>>>
>>>
>> _Should_ be faster.
>
> Yes, Python's timing results are often unintuitive.
Ind
Jervis Whitley wrote:
>> What happens when you have hundreds of megabytes, I don't know.
>>
>>
> I hope I never have to test a word that is hundreds of megabytes long
> for a vowel :)
I see you don't speak German ;-)
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC
>
> What happens when you have hundreds of megabytes, I don't know.
>
>
I hope I never have to test a word that is hundreds of megabytes long
for a vowel :)
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 18 Feb 2009 07:08:04 +1100, Jervis Whitley wrote:
>> This moves the for-loop out of slow Python into fast C and should be
>> much, much faster for very large input.
>>
>>
> _Should_ be faster.
Yes, Python's timing results are often unintuitive.
> Here is my test on an XP system Python
>
> This moves the for-loop out of slow Python into fast C and should be much,
> much faster for very large input.
>
_Should_ be faster.
Here is my test on an XP system Python 2.5.4. I had similar results on
python 2.7 trunk.
WORD = 'g' * 100
WORD2 = 'g' * 50 + 'U'
BIGWORD = 'g' * 1 + 'U'
Nicolas Dandrimont wrote:
> I would go for something like:
>
> for char in word:
> if char in 'aeiouAEIUO':
> char_found = True
> break
> else:
> char_found = False
>
> (No, I did not forget to indent the else statement, see
> http://docs.python.org/reference/compound_stm
An entirely different approach would be to use a regular expression:
import re
if re.search("[abc]", "nothing expekted"):
print "a, b or c occurs in the string 'nothing expekted'"
if re.search("[abc]", "something expected"):
print "a, b or c occurs in the string 'something expected'"
Best
On Mon, 2009-02-16 at 00:28 -0500, Nicolas Dandrimont wrote:
> * pyt...@bdurham.com [2009-02-16 00:17:37 -0500]:
>
> > I need to test strings to determine if one of a list of chars is
> > in the string. A simple example would be to test strings to
> > determine if they have a vowel (aeiouAEIOU)
* pyt...@bdurham.com [2009-02-16 00:48:34 -0500]:
> Nicolas,
>
> > I would go for something like:
> >
> > for char in word:
> > if char in 'aeiouAEIUO':
> > char_found = True
> > break
> > else:
> > char_found = False
> >
> > It is clear (imo), and it is seems to be the
On Feb 15, 9:56 pm, Chris Rebert wrote:
> On Sun, Feb 15, 2009 at 9:17 PM, wrote:
> > I need to test strings to determine if one of a list of chars is in the
> > string. A simple example would be to test strings to determine if they have
> > a vowel (aeiouAEIOU) present.
>
> > I was hopeful that
On Sun, Feb 15, 2009 at 9:17 PM, wrote:
> I need to test strings to determine if one of a list of chars is in the
> string. A simple example would be to test strings to determine if they have
> a vowel (aeiouAEIOU) present.
>
> I was hopeful that there was a built-in method that operated similar
* pyt...@bdurham.com [2009-02-16 00:17:37 -0500]:
> I need to test strings to determine if one of a list of chars is
> in the string. A simple example would be to test strings to
> determine if they have a vowel (aeiouAEIOU) present.
> I was hopeful that there was a built-in method that operated
Nicolas,
> I would go for something like:
>
> for char in word:
> if char in 'aeiouAEIUO':
> char_found = True
> break
> else:
> char_found = False
>
> It is clear (imo), and it is seems to be the intended idiom for a
> search loop, that short-circuits as soon as a match
22 matches
Mail list logo