On Monday, December 6, 2021 at 6:28:10 PM UTC-5 Steven D'Aprano wrote:
> On Mon, Dec 06, 2021 at 11:57:11AM -0800, Neil Girdhar wrote: > > > Has anyone done a survey of, say, the cpython library codebase to see > what > > proportion of arguments lists would significantly benefit from this PEP > > given as a proportion of the total codebase? In all the Python I've ever > > written or seen, I can only thing of one example of a custom sentinel > ever > > being needed. > > It is not just the *custom sentinels* that could be replaced with > late-bound defaults, but the good ol' `if param is None` sentinel as > well. Yes, but that's not a big win in my opinion. The None sentinels are not going away. They're baked into the type annotations, and decades of idiomatic usage. If None sentinels are slightly annoying, please let's consider pushing the none-aware operators. Also, I like passing None sentinels because it means that I don't have to edit custom argument dicts, as I mentioned in my other comment. Besides default constructed containers and custom sentinels, I don't see this feature as a big win. > > > > -- > Steve > _______________________________________________ > Python-ideas mailing list -- [email protected] > To unsubscribe send an email to [email protected] > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/[email protected]/message/OM723LFGG4KGJMRG7NHRVHCABO2QWTJN/ > > <https://mail.python.org/archives/list/[email protected]/message/OM723LFGG4KGJMRG7NHRVHCABO2QWTJN/> > > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/A6PV6HD775JF2C3LXPOOQLJ2UCHZV7Y5/ Code of Conduct: http://python.org/psf/codeofconduct/
