[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Jonathan Goble
On Tue, Feb 9, 2021 at 11:29 PM Terry Reedy wrote: > > On 2/9/2021 8:28 PM, Inada Naoki wrote: > > > Note that many Python users don't use consoles. > > Those of use who do may find it hard to imagine just how easy we have > made computing. > > My daughter minored in Computer Science about 6 years

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Terry Reedy
On 2/9/2021 8:28 PM, Inada Naoki wrote: Note that many Python users don't use consoles. Those of use who do may find it hard to imagine just how easy we have made computing. My daughter minored in Computer Science about 6 years ago. She never saw Command Prompt until the summer after her

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Inada Naoki
On Wed, Feb 10, 2021 at 5:50 AM Paul Moore wrote: > > On Tue, 9 Feb 2021 at 16:54, Inada Naoki wrote: > > > > On Tue, Feb 9, 2021 at 9:31 PM Paul Moore wrote: > > > > > > Personally, I'm not at all keen on the idea of making users always > > > specify encoding in the first place, even if it's "j

[Python-Dev] Re: Signature discrepancies between documentation and implementation

2021-02-09 Thread Petr Viktorin
On 2/9/21 9:15 PM, Serhiy Storchaka wrote: 09.02.21 12:22, Erlend Aasland пише: What's the recommended approach with issues like https://bugs.python.org/issue43094? Change the docs or the implementation? I did a quick search on bpo, but could not find similar past issues. If the documentatio

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Paul Moore
On Tue, 9 Feb 2021 at 16:54, Inada Naoki wrote: > > On Tue, Feb 9, 2021 at 9:31 PM Paul Moore wrote: > > > > Personally, I'm not at all keen on the idea of making users always > > specify encoding in the first place, even if it's "just for the > > transition". > > I agree with you. But as I wrote

[Python-Dev] Re: Signature discrepancies between documentation and implementation

2021-02-09 Thread Brett Cannon
On Tue., Feb. 9, 2021, 12:20 Serhiy Storchaka, wrote: > 09.02.21 12:22, Erlend Aasland пише: > > What's the recommended approach with issues like > https://bugs.python.org/issue43094? Change the docs or the > implementation? I did a quick search on bpo, but could not find similar > past issues. >

[Python-Dev] Re: Signature discrepancies between documentation and implementation

2021-02-09 Thread Serhiy Storchaka
09.02.21 12:22, Erlend Aasland пише: > What's the recommended approach with issues like > https://bugs.python.org/issue43094? Change the docs or the implementation? I > did a quick search on bpo, but could not find similar past issues. If the documentation and the C implemented function contradi

[Python-Dev] Re: PEP 647 (type guards) -- final call for comments

2021-02-09 Thread Terry Reedy
On 2/9/2021 11:21 AM, Guido van Rossum wrote: I think we have reached consensus on PEP 647 in typing-sig. We have implementations for mypy and pyright, not sure about the rest. This PEP does not affect CPython directly except for the addition of one special item (TypeGuard) to typing.py -- it w

[Python-Dev] Re: Signature discrepancies between documentation and implementation

2021-02-09 Thread Jakub Stasiak
> On 9 Feb 2021, at 11:22, Erlend Aasland wrote: > > Hi all, > > What's the recommended approach with issues like > https://bugs.python.org/issue43094? Change the docs or the implementation? I > did a quick search on bpo, but could not find similar past issues. > > > > Erlend To provide

[Python-Dev] python limited API missing PyCMethod_New on Windows for 3.9 and 3.10

2021-02-09 Thread Barry Scott
I raised https://bugs.python.org/issue43155 for the missing PyCMethod_New that was added in 3.9 but is missing from the python3.lib. Barry ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org ht

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Victor Stinner
On Tue, Feb 9, 2021 at 5:51 PM Anders Munch wrote: > Victor Stinner [mailto:vstin...@python.org] wrote: > > The warning can explicitly suggest to use encoding="utf8", it should work > > in almost all cases. > > The warning should also explain how to get backwards-compatible behaviour, > i.e. sug

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Inada Naoki
On Wed, Feb 10, 2021 at 1:46 AM Anders Munch wrote: > > > Inada Naoki wrote: > > This warning is opt-in warning like BytesWarning. > > What use is a warning that no-one sees? At least, I see. We can fix stdlib and tests first, and fix some major tools too. After that, `encoding="locale"` becom

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Paul Moore
On Tue, 9 Feb 2021 at 16:52, Anders Munch 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 wor

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Inada Naoki
On Tue, Feb 9, 2021 at 9:31 PM Paul Moore wrote: > > Personally, I'm not at all keen on the idea of making users always > specify encoding in the first place, even if it's "just for the > transition". I agree with you. But as I wrote in the PEP, omitted encoding caused much troubles already. Wind

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Anders Munch
Victor Stinner [mailto:vstin...@python.org] wrote: > The warning can explicitly suggest to use encoding="utf8", it should work in > almost all cases. The warning should also explain how to get backwards-compatible behaviour, i.e. suggest encoding="locale". Inada Naoki wrote: > This warning i

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Paul Moore
On Tue, 9 Feb 2021 at 16:28, Inada Naoki wrote: > > On Wed, Feb 10, 2021 at 1:19 AM Paul Moore wrote: > > > > But people who currently don't specify the encoding, and *don't* have > > any issue (because the system locale is correct) will be getting told > > to introduce a bug into their code, if

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Inada Naoki
On Wed, Feb 10, 2021 at 1:19 AM Paul Moore wrote: > > But people who currently don't specify the encoding, and *don't* have > any issue (because the system locale is correct) will be getting told > to introduce a bug into their code, if they follow that advice :-( > This warning is opt-in warning

[Python-Dev] PEP 647 (type guards) -- final call for comments

2021-02-09 Thread Guido van Rossum
I think we have reached consensus on PEP 647 in typing-sig. We have implementations for mypy and pyright, not sure about the rest. This PEP does not affect CPython directly except for the addition of one special item (TypeGuard) to typing.py -- it would be nice to get that in the 3.10 stdlib. I'm

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Paul Moore
But people who currently don't specify the encoding, and *don't* have any issue (because the system locale is correct) will be getting told to introduce a bug into their code, if they follow that advice :-( Paul On Tue, 9 Feb 2021 at 16:03, Victor Stinner wrote: > > On Tue, Feb 9, 2021 at 1:31 P

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Victor Stinner
On Tue, Feb 9, 2021 at 1:31 PM Paul Moore wrote: > If we can't provide a good recommendation > to the user on what to do, we shouldn't be warning them that what they > are currently doing is wrong. The warning can explicitly suggest to use encoding="utf8", it should work in almost all cases. Vic

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Paul Moore
On Tue, 9 Feb 2021 at 11:55, Inada Naoki wrote: > I think only we can do is documenting the option like this: > > """ > EncodingWarning is warning to find missing encoding="utf-8" option. It > is common pitfall that many Windows user > Don't try to fix them if you need to use locale specific enco

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Inada Naoki
On Tue, Feb 9, 2021 at 7:23 PM Victor Stinner wrote: > > I recall that something like 1 year ago, I basically tried to > implement something like your PEP, to see if the stdlib calls open() > without specifying an encoding. There were so many warnings, that the > output was barely readable. > > Th

[Python-Dev] Re: Signature discrepancies between documentation and implementation

2021-02-09 Thread Erlend Aasland
Hi Victor, and thanks for you reply. > On 9 Feb 2021, at 11:46, Victor Stinner wrote: > If there are applications relying on the parameter name, it's better > to trust the Python implementation, rather than the documentation. I feared that answer :) > It would be better to make these parameters

[Python-Dev] Re: Signature discrepancies between documentation and implementation

2021-02-09 Thread Victor Stinner
If there are applications relying on the parameter name, it's better to trust the Python implementation, rather than the documentation. It would be better to make these parameters positional only in the first place, but now it's too late for such backward incompatible change :-( Victor On Tue, F

[Python-Dev] Signature discrepancies between documentation and implementation

2021-02-09 Thread Erlend Aasland
Hi all, What's the recommended approach with issues like https://bugs.python.org/issue43094? Change the docs or the implementation? I did a quick search on bpo, but could not find similar past issues. Erlend ___ Python-Dev mailing list -- python-dev

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Victor Stinner
On Sat, Feb 6, 2021 at 3:26 PM Inada Naoki wrote: > I changed my mind. Since there is no plan to change the default > encoding for now, > no need to encourage `encoding="locale"` soon. > > Until users can drop Python 3.9 support, they can use EncodingWarning > only for finding missing `encoding="u