On Fri, May 1, 2020 at 10:58 PM Andrew Barnert via Python-ideas < python-ideas@python.org> wrote:
> A separate function can be used in third-party libraries immediately, as > long as there’s an available backport (whether that’s more-iterools, or a > trivial zip39 or whatever) that they can require; a flag can’t be used in > libraries until they’re able to require Python 3.9 (unless they want to use > a backport that monkey patches or shadows the builtin, but I doubt you’d > suggest that, since you called it an antipattern elsewhere in the PEP). Specifically the PEP says: Another proposed idiom, per-module shadowing of the built-in zip with some > subtly different variant from itertools, is an anti-pattern that shouldn't > be encouraged. > I think the PEP is saying it'd be an antipattern to shadow zip with a version that is always strict. If you want both strict and non-strict in the same file, you're in trouble. But replacing zip with a zip that has an optional strict flag should be harmless. So a backport with a flag seems perfectly fine, whether it's used per module or it patches builtins for all modules.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/YBJITTC6ACDWH5CCJRSJGBVDYZAVP2G4/ Code of Conduct: http://python.org/psf/codeofconduct/