On Fri, May 15, 2020 at 09:56:03AM -0400, Paul Ganssle wrote: > I'm on the fence about using a separate function vs. a keyword argument > (I think there is merit to both), but one thing to note about the > separate function suggestion is that it makes it easier to write > backwards compatible code that doesn't rely on version checking. With > `itertools.zip_strict`, you can do some graceful degradation like so: > > try: > from itertools import zip_strict > except ImportError: > zip_strict = zip
This is just a special case of a much broader case: a separate function, or method, is a first class object that can be passed around to other functions, used in lists, etc. https://softwareengineering.stackexchange.com/questions/39742/when-is-a-feature-considered-a-first-class-citizen-in-a-programming-language-p Using a mode switch or flag makes the zip strict a second class citizen. -- Steven _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/KYEOWALI7EQEP6N2GZSSA5NUCW5KDQLW/ Code of Conduct: http://python.org/psf/codeofconduct/