[Python-ideas] Adding some standalone iterator/sequence functions as methods of the iterator objects

Jae Kwon jkwon.work at gmail.com
Wed Aug 12 23:04:32 CEST 2009


i tried to google "site:http://mail.python.org/pipermail/python-ideas/  
itertools" and could not find anything.

also, i like this idea.

  - Jae

On Aug 12, 2009, at 1:48 PM, Manuel Alejandro Cerón Estrada wrote:

> Hello again.
> El 12 de agosto de 2009 15:12, Guido van Rossum<guido at python.org>  
> escribió:
>> That idea has also been considered and rejected, because of Python's
>> commitment to duck typing.
>> Really, please find the old discussion and read it rather than
>> rehashing old broken ideas.
> Sorry for getting back already discussed ideas. Finding old
> discussions can be very hard since the Python mailing lists have
> thousands of mails and some time you just don't use the correct
> keywords while searching.
> I understand why this has been rejected. However, I still think that
> the core idea of making the pipe-filter pattern and queries more
> readable is valuable.
> I'm thinking on implementing this as a third party wrapper module for
> itertools and others. An QueryIter wrapper class could help to this
> purpose and It would be very easy to implement. Could be something
> like this:
> pairs_tasks =  
> IterQuery(programmers).combinations(2).cycle().izip(tasks)
> Methods would be simple wrappers:
> def combinations(self, repeat):
>    return IterQuery(itertools.combinations(self, repeat))
> Manuel.
> -- 
> Manuel Alejandro Cerón Estrada
> http://ceronman.freaks-unidos.net

More information about the Python-ideas mailing list