The only precedent that jumps out for me is itertools.chain() and itertools.chain.from_iterable(). It's quite likely that something I don't use much has used the same pattern though.
On Wed, May 6, 2020, 8:17 PM Christopher Barker firstname.lastname@example.org wrote:
On Wed, May 6, 2020 at 10:31 AM Alex Hall email@example.com wrote: zip.shortest(...) # same as zip(...) zip.longest(...) zip.checksame(...)
I presume that zip() would keep its current behavior, yes?
I kind of like this -- is there any precedent for it in the standard library?
The PEP seems to reject this saying:
The actual zip type is an undocumented implementation detail. Adding
additional methods or constructors is really a much larger change that is not necessary to achieve the stated goal.
well, yes and no -- the first part indicates that we could totally change the type of the zip, as long as it's a collable that returns an iterator.
Whether adding additional methods is too large a change -- that's totally a matter of opinion.
Having these alternative 'methods' would be similar to having different
functions in itertools, indeed -- same idea, different namepace.
-- Christopher Barker, PhD
Python Language Consulting
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython
Python-ideas mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://firstname.lastname@example.org/message/5EC4BL... Code of Conduct: http://python.org/psf/codeofconduct/