Delaney, Timothy (Tim) wrote:
Bruno Desthuilliers wrote:
What I wonder here is why __iter__ has been added to lists and tuples
but not to strings (not that I'm complaining, it's just curiousity...)
Because someone got around to doing it.
Ok, so it's definitively a design decision, and
Terry Reedy wrote:
Bruno Desthuilliers [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
FWIW, the iterator protocol appeared with Python 2.2. Before this
version, the above solution was the only one that allowed iteration over
a container type.
Now if you wonder why string,
Bruno Desthuilliers wrote:
What I wonder here is why __iter__ has been added to lists and tuples
but not to strings (not that I'm complaining, it's just curiousity...)
Because someone got around to doing it.
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
Andy Dingley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
pluginVersionNeeded is a parameter passed into a method and it can
either be a simple scalar variable, or it can be a list of the same
variables.
The obvious question would be, is there a good reason why you don't
change
Andy Dingley wrote:
I seem to be writing the following fragment an awful lot, and I'm sure
it's not the best and Pythonic way to do things. Any advice on better
coding style?
pluginVersionNeeded is a parameter passed into a method and it can
either be a simple scalar variable, or it can be
Andy Dingley wrote:
I seem to be writing the following fragment an awful lot, and I'm sure
it's not the best and Pythonic way to do things. Any advice on better
coding style?
pluginVersionNeeded is a parameter passed into a method and it can
either be a simple scalar variable, or it can be
Bruno Desthuilliers wrote:
there's really no reason to
assume it should be a list - any iterable could - and IMHO should - be
accepted... expect of course for strings (royal PITA case, duh).
2/ test for pluginVersionsNeeded.__iter__ (an attribute of most
iterables except strings...):
Andy Dingley wrote:
Bruno Desthuilliers wrote:
there's really no reason to
assume it should be a list - any iterable could - and IMHO should - be
accepted... expect of course for strings (royal PITA case, duh).
2/ test for pluginVersionsNeeded.__iter__ (an attribute of most
iterables
Bruno Desthuilliers [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
FWIW, the iterator protocol appeared with Python 2.2. Before this
version, the above solution was the only one that allowed iteration over
a container type.
Now if you wonder why string, unicode and buffer don't