Steve Howell skrev:
def firstIsCapitalized(word):
return 'A' = word[0] = 'Z'
For someone who is worried about the impact of non-ascii identifiers,
you are making surprising assumptions about the contents of data.
Nis
--
http://mail.python.org/mailman/listinfo/python-list
--- Nis Jørgensen [EMAIL PROTECTED] wrote:
Steve Howell skrev:
def firstIsCapitalized(word):
return 'A' = word[0] = 'Z'
For someone who is worried about the impact of
non-ascii identifiers,
you are making surprising assumptions about the
contents of data.
The function there,
says Newbie question - better way to do this. I was
hinting at a better way to do what you did, which was supposedly a
better way of doing what the newbie wanted.
I disagree that word.istitle is the correct idiom - from the naming of
the function in the original example, I would guess word[0
--- Nis Jørgensen [EMAIL PROTECTED] wrote:
I disagree that word.istitle is the correct idiom -
from the naming of
the function in the original example, I would guess
word[0].isupper
would do the trick.
nitpick
That would return something like this:
built-in method isupper of str
I have some working code, but I realized it is just the way I would
write it in C, which means there is probably a better (more pythonic)
way of doing it.
Here's the section of code:
accumulate = firstIsCaps = False
accumStart = i = 0
while i len(words):
firstIsCaps =
En Sun, 27 May 2007 10:44:01 -0300, Eric [EMAIL PROTECTED] escribió:
I have some working code, but I realized it is just the way I would
write it in C, which means there is probably a better (more pythonic)
way of doing it.
Here's the section of code:
accumulate = firstIsCaps = False
On Sun, 27 May 2007 06:44:01 -0700, Eric wrote:
words is a big long array of strings. What I want to do is find
consecutive sequences of words that have the first letter capitalized,
and then call doSomething on them. (And you can ignore the fact that
it won't find a sequence at the very
--- Eric [EMAIL PROTECTED] wrote:
I have some working code, but I realized it is just
the way I would
write it in C, which means there is probably a
better (more pythonic)
way of doing it.
Here's the section of code:
accumulate = firstIsCaps = False
accumStart = i = 0
On May 28, 12:46 am, Steven D'Aprano
[EMAIL PROTECTED] wrote:
On Sun, 27 May 2007 06:44:01 -0700, Eric wrote:
words is a big long array of strings. What I want to do is find
consecutive sequences of words that have the first letter capitalized,
and then call doSomething on them. (And you
--- John Machin [EMAIL PROTECTED] wrote:
(And you can
ignore the fact that
it won't find a sequence at the very end of
words, that is fine for my
purposes).
[...]
Bzzzt. Needs the following code at the end:
if accumulator:
doSomething(accumulator)
FWIW the OP already
On Sun, 27 May 2007 14:55:42 -0700, John Machin wrote:
On May 28, 12:46 am, Steven D'Aprano
[EMAIL PROTECTED] wrote:
On Sun, 27 May 2007 06:44:01 -0700, Eric wrote:
words is a big long array of strings. What I want to do is find
consecutive sequences of words that have the first letter
--- Steven D'Aprano wrote:
On Sun, 27 May 2007 14:55:42 -0700, John Machin
wrote:
Bzzzt.
Bzzzt!
Can we please refrain from buzzer sounds in this
mostly civil forum, even if one beep deserves another?
Eric [EMAIL PROTECTED] writes:
words is a big long array of strings. What I want to do is find
consecutive sequences of words that have the first letter capitalized,
and then call doSomething on them. (And you can ignore the fact that
it won't find a sequence at the very end of words, that
13 matches
Mail list logo