Steven Bethard wrote:
first, iterable = peek(iterable)
I really like this as a general solution to a problem that bothers me
occasionally. IMHO it's much better than having UndoFiles or similar
things lying about for every use case.
Thanks!
--
Michael Hoffman
--
http://mail.python.org/mailman/li
Nick Coghlan wrote:
Nick Coghlan wrote:
Chris Lasher wrote:
Hello,
I really like the finditer() method of the re module. I'm having
difficulty at the moment, however, because finditer() still creates a
callable-iterator oject, even when no match is found. This is
undesirable in cases where I would
Nick Coghlan wrote:
Chris Lasher wrote:
Hello,
I really like the finditer() method of the re module. I'm having
difficulty at the moment, however, because finditer() still creates a
callable-iterator oject, even when no match is found. This is
undesirable in cases where I would like to circumvent e
Chris Lasher wrote:
Hello,
I really like the finditer() method of the re module. I'm having
difficulty at the moment, however, because finditer() still creates a
callable-iterator oject, even when no match is found. This is
undesirable in cases where I would like to circumvent execution of code
mea
Chris Lasher wrote:
Is there any way to request a feature like
this from the RE module keepers, whomever they may be?
The most direct way would be to go to Python at sourceforge[1] and make
a feature request to add peek to itertools. (This is probably the most
reasonable location for it.) Reque
Thanks Steve,
That's odd that there's no built-in method to do this. It seems like
it would be a common task. Is there any way to request a feature like
this from the RE module keepers, whomever they may be?
In the meantime, may I use your code, with accredation to you?
Thanks,
Chris
--
http://ma
Chris Lasher wrote:
I know that if I place a finditer() object in an iterative for loop,
the loop will not execute, but is there some way I can test to see if
the object contains no matches in the first place?
Basically, you want to peek into an interable. See my recipes:
http://aspn.activestate.c
Hello,
I really like the finditer() method of the re module. I'm having
difficulty at the moment, however, because finditer() still creates a
callable-iterator oject, even when no match is found. This is
undesirable in cases where I would like to circumvent execution of code
meant to parse out data