On Wed, 10 Feb 2021 at 14:33, Anders Munch <a...@flonidan.dk> wrote:
>
> On Tue, 9 Feb 2021 at 16:52, Anders Munch <a...@flonidan.dk> wrote:
> >> How about swapping around "locale" and None?  That is, make "locale" the 
> >> new default that emits a warning, and encoding=None emits no warning.  
> >> That has the advantage that old code can be updated to say encoding=None, 
> >> and then it will work on both old and new Pythons without warning.
> Paul Moore [mailto:p.f.mo...@gmail.com]
> > I don't understand why working code should have to change *twice*.
>
> The idea is to make is so that working code only needs to change once, even 
> when supporting multiple Python versions.
> That one change is to add either an explicit encoding=None (for 
> backwards-compatibility) or an explicit encoding='utf-8' (because that was 
> intended all along).  No twice about it, one change.

But then people who added an explicit utf-8 encoding need to remove
the encoding argument again once the default value changes. Your
proposal leads to a situation where no-one leaves the encoding
argument to default. If we're going to permanently discourage omitting
the encoding argument, we should just make it mandatory (a change that
I'll argue against, but no-one is currently proposing it, luckily).

Paul
_______________________________________________
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/QBX375BJCACY726YHZOXVUOWCG2EH3GI/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to