[Python-ideas] strings as iterables - from str.startswith taking any iterator instead of just tuple

Amber Yust amber.yust at gmail.com
Sun Jan 5 03:10:52 CET 2014


I'm thinking of it being analogous to the __getstate__ and __setstate__
dunders used by Pickle to allow customization of object creation.

On Sat Jan 04 2014 at 4:50:11 PM, Joshua Landau <joshua.landau.ws at gmail.com>
wrote:

> On Jan 5, 2014 12:08 AM, "Amber Yust" <amber.yust at gmail.com> wrote:
> >
> > __fromiter__, anyone?
>
> I'm unconvinced that it should be a dunder method. Do you expect it to be
> used like
>
>     fromiter(str, characters)
>
> ?
>
> However, +1 on the name, +0 on the idea.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140105/8e8cdac8/attachment.html>


More information about the Python-ideas mailing list