[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Joao S. O. Bueno
I just read your e-mail (before reading any follow up here), fired up Python 3.8 and typed in what I thought would be an ambiguous or confuse case, withut checking the PEP. the result: ``` Python 3.8.0b3+ (heads/3.8:ef0b81927a, Aug 6 2019, 20:30:57) Type 'copyright', 'credits' or 'license' for

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Guido van Rossum
On Fri, Aug 9, 2019 at 8:07 PM Chris Angelico wrote: > On Sat, Aug 10, 2019 at 12:56 PM Guido van Rossum > wrote: > > > > On Fri, Aug 9, 2019 at 11:06 AM Barry Warsaw wrote: > >> > >> Nick and I are now on the same page, so I don’t think we *have* to have > a formal SC vote. > > > > > > OK, I

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Chris Angelico
On Sat, Aug 10, 2019 at 12:56 PM Guido van Rossum wrote: > > On Fri, Aug 9, 2019 at 11:06 AM Barry Warsaw wrote: >> >> Nick and I are now on the same page, so I don’t think we *have* to have a >> formal SC vote. > > > OK, I agree. Let's remove TargetScopeError from the PEP and from the >

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Guido van Rossum
On Fri, Aug 9, 2019 at 11:06 AM Barry Warsaw wrote: > Nick and I are now on the same page, so I don’t think we *have* to have a > formal SC vote. > OK, I agree. Let's remove TargetScopeError from the PEP and from the implementation. Since that makes three SC members in favor the motion passes.

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Glenn Linderman
On 8/9/2019 3:56 PM, Steven D'Aprano wrote: I'm not trying to be confrontational, I'm trying to understand your use-case(s) and see if it would be broken by the planned change to string escapes. Yeah, that's fine. Sometimes it is hard to communicate via email (versus saying a lot). On Fri,

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Glenn Linderman
On 8/9/2019 4:08 PM, MRAB wrote: On 2019-08-09 23:56, Steven D'Aprano wrote: I'm not trying to be confrontational, I'm trying to understand your use-case(s) and see if it would be broken by the planned change to string escapes. On Fri, Aug 09, 2019 at 03:18:29PM -0700, Glenn Linderman wrote:

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Glenn Linderman
On 8/9/2019 4:07 PM, Gregory P. Smith wrote: On Fri, Aug 9, 2019 at 11:37 AM Eric V. Smith > wrote: On 8/9/2019 2:28 PM, Jonathan Goble wrote: > On Fri, Aug 9, 2019 at 12:34 PM Nick Coghlan mailto:ncogh...@gmail.com>> wrote: >> I find the "Our

[Python-Dev] Re: What is a public API?

2019-08-09 Thread Kyle Stanley
Kyle Stanley wrote: > It would also be appropriate to provide any user attempting to import > a module that is going to be prepended with an underscore with > warnings, and at least a couple of versions to update their code. Clarification: When I mentioned prepending a module with an underscore,

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Greg Ewing
Steven D'Aprano wrote: I find it difficult to imagine a more meaningful distinction than that between syntax and semantics. That may be so, but when specifying a programming language, there is often some flexibility as to whether language rules are considered part of the syntax or the

[Python-Dev] Re: What is a public API?

2019-08-09 Thread Kyle Stanley
Nick Coghlan wrote: > It's not an unwritten rule, as it already has its own subsection in > PEP 8: > https://www.python.org/dev/peps/pep-0008/#public-and-internal-interfaces > The main question in this thread is what to do about standard library > modules that were written before those documented

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Steven D'Aprano
On Fri, Aug 09, 2019 at 02:28:13PM -0400, Jonathan Goble wrote: > I am perplexed at the opinion, seemingly espoused by multiple people > in this thread, that because a major part of the problem is that the > warnings were not visible enough, somehow the proposed solution is > making them not

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread MRAB
On 2019-08-09 23:56, Steven D'Aprano wrote: I'm not trying to be confrontational, I'm trying to understand your use-case(s) and see if it would be broken by the planned change to string escapes. On Fri, Aug 09, 2019 at 03:18:29PM -0700, Glenn Linderman wrote: On 8/9/2019 2:53 PM, Steven

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Gregory P. Smith
On Fri, Aug 9, 2019 at 11:37 AM Eric V. Smith wrote: > On 8/9/2019 2:28 PM, Jonathan Goble wrote: > > On Fri, Aug 9, 2019 at 12:34 PM Nick Coghlan wrote: > >> I find the "Our deprecation warnings were even less visible than > >> normal" argument for extending the deprecation period compelling.

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Gregory P. Smith
On Fri, Aug 9, 2019 at 8:43 AM Guido van Rossum wrote: > This discussion looks like there's no end in sight. Maybe the Steering > Council should take a vote? > I've merged the PR reverting the behavior in 3.8 and am doing the same in the master branch. The sheer volume of email this is

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Steven D'Aprano
I'm not trying to be confrontational, I'm trying to understand your use-case(s) and see if it would be broken by the planned change to string escapes. On Fri, Aug 09, 2019 at 03:18:29PM -0700, Glenn Linderman wrote: > On 8/9/2019 2:53 PM, Steven D'Aprano wrote: > >On Fri, Aug 09, 2019 at

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Glenn Linderman
On 8/9/2019 2:53 PM, Steven D'Aprano wrote: On Fri, Aug 09, 2019 at 01:12:59PM -0700, Glenn Linderman wrote: The reason I never use raw strings is in the documentation, it is because \ still has a special meaning, and the first several times I felt the need for raw strings, it was for

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Steven D'Aprano
On Fri, Aug 09, 2019 at 01:12:59PM -0700, Glenn Linderman wrote: > The reason I never use raw strings is in the documentation, it is > because \ still has a special meaning, and the first several times I > felt the need for raw strings, it was for directory names that wanted to > end with \

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread brian . skinn
Nathaniel Smith wrote: > Unfortunately, their solution isn't a pytest incantation, it's a > separate 'compileall' invocation they run on their source tree. I'm > not sure how you'd convert this into a pytest feature, because I don't > think pytest always know which parts of your code are your code

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Nathaniel Smith
On Fri, Aug 9, 2019 at 12:07 PM wrote: > > Eric V. Smith wrote: > > Hopefully the warnings in 3.9 would be more visible that what we saw in > > 3.7, so that library authors can take notice and do something about it > > before 3.10 rolls around. > > Eric > > Apologies for the ~double-post on the

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Glenn Linderman
On 8/9/2019 9:08 AM, Nick Coghlan wrote: On Sat, 10 Aug 2019 at 01:44, Guido van Rossum wrote: This discussion looks like there's no end in sight. Maybe the Steering Council should take a vote? I find the "Our deprecation warnings were even less visible than normal" argument for extending

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread brian . skinn
Eric V. Smith wrote: > Hopefully the warnings in 3.9 would be more visible that what we saw in > 3.7, so that library authors can take notice and do something about it > before 3.10 rolls around. > Eric Apologies for the ~double-post on the thread, but: the SymPy team has figured out the

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Jonathan Goble
On Fri, Aug 9, 2019 at 2:36 PM Eric V. Smith wrote: > > On 8/9/2019 2:28 PM, Jonathan Goble wrote: > > On Fri, Aug 9, 2019 at 12:34 PM Nick Coghlan wrote: > >> I find the "Our deprecation warnings were even less visible than > >> normal" argument for extending the deprecation period compelling.

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Eric V. Smith
On 8/9/2019 2:28 PM, Jonathan Goble wrote: On Fri, Aug 9, 2019 at 12:34 PM Nick Coghlan wrote: I find the "Our deprecation warnings were even less visible than normal" argument for extending the deprecation period compelling. Outsider's 2 cents from reading this discussion (with no personal

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Jonathan Goble
On Fri, Aug 9, 2019 at 12:34 PM Nick Coghlan wrote: > > I find the "Our deprecation warnings were even less visible than > normal" argument for extending the deprecation period compelling. Outsider's 2 cents from reading this discussion (with no personal experience with this warning): I am

[Python-Dev] Summary of Python tracker Issues

2019-08-09 Thread Python tracker
ACTIVITY SUMMARY (2019-08-02 - 2019-08-09) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open7136 ( -3) closed 42419 (+61) total 49555 (+58) Open issues

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Barry Warsaw
Nick and I are now on the same page, so I don’t think we *have* to have a formal SC vote. Cheers, -Barry > On Aug 9, 2019, at 08:28, Guido van Rossum wrote: > > I don't see how this debate can avoid a vote in the Steering Council. > > -- > --Guido van Rossum (python.org/~guido) > Pronouns:

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Barry Warsaw
Thanks Nick. I find yours (and Eric’s) argument compelling. I’m totally aligned with using SyntaxError in 3.8 and thinking through the more general problem for 3.9. Cheers, -Barry > On Aug 9, 2019, at 06:44, Nick Coghlan wrote: > > Short version of my more detailed answer below: > > While

[Python-Dev] Re: What is a public API?

2019-08-09 Thread Barry Warsaw
Interesting idea! https://gitlab.com/warsaw/public/issues/3 -Barry > On Aug 9, 2019, at 09:55, Christian Tismer wrote: > > Signed PGP part > On 16.07.19 00:32, Barry Warsaw wrote: >> On Jul 13, 2019, at 19:09, Raymond Hettinger >> wrote: >>> >>> In some modules, we've been careful to use

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Paul Moore
On Fri, 9 Aug 2019 at 17:55, Steve Dower wrote: > > * change the SyntaxWarning into a default-silenced one that fires every > > time a .pyc is loaded (this is the hard part, but it's doable) > > * change pathlib.PureWindowsPath, os.fsencode and os.fsdecode to explicitly > > warn when the path

[Python-Dev] Re: What is a public API?

2019-08-09 Thread Christian Tismer
On 16.07.19 00:32, Barry Warsaw wrote: > On Jul 13, 2019, at 19:09, Raymond Hettinger > wrote: >> >> In some modules, we've been careful to use both __all__ and to use an >> underscore prefix to indicate private variables and helper functions >> (collections and random for example). IMO, when

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Steve Dower
On 09Aug2019 0905, Serhiy Storchaka wrote: 09.08.19 18:30, Guido van Rossum пише: This discussion looks like there's no end in sight. Maybe the Steering Council should take a vote? Possible options: 1. SyntaxWarning in 3.8+ (the current status). 2. DeprecationWarning in 3.8, SyntaxWarning in

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Nick Coghlan
On Sat, 10 Aug 2019 at 02:05, Eric V. Smith wrote: > > On 8/9/2019 11:41 AM, Tim Peters wrote: > > [Guido] > >> I don't see how this debate can avoid a vote in the Steering Council. > > > > FWIW, I found Nick's last post wholly persuasive: back off to > > SyntaxError for now, and think about

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Nick Coghlan
On Sat, 10 Aug 2019 at 01:44, Guido van Rossum wrote: > > This discussion looks like there's no end in sight. Maybe the Steering > Council should take a vote? I find the "Our deprecation warnings were even less visible than normal" argument for extending the deprecation period compelling. I

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Serhiy Storchaka
09.08.19 18:30, Guido van Rossum пише: This discussion looks like there's no end in sight. Maybe the Steering Council should take a vote? Possible options: 1. SyntaxWarning in 3.8+ (the current status). 2. DeprecationWarning in 3.8, SyntaxWarning in 3.9+ (revert changes in 3.8 only). 3.

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Christian Tismer
On 09.08.19 15:44, Nick Coghlan wrote: ... > However, a change like that would make the most sense when considered > independently of the specific case of assignment expressions - > instead, we would want to ask "What kinds of exceptions does the > symbol table analysis pass raise?", and then

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Eric V. Smith
On 8/9/2019 11:41 AM, Tim Peters wrote: [Guido] I don't see how this debate can avoid a vote in the Steering Council. FWIW, I found Nick's last post wholly persuasive: back off to SyntaxError for now, and think about adding a more specific exception later for _all_ cases (not just walrus) in

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Tim Peters
[Guido] > I don't see how this debate can avoid a vote in the Steering Council. FWIW, I found Nick's last post wholly persuasive: back off to SyntaxError for now, and think about adding a more specific exception later for _all_ cases (not just walrus) in which a scope conflict isn't allowed

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Guido van Rossum
This discussion looks like there's no end in sight. Maybe the Steering Council should take a vote? -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)*

[Python-Dev] Re: What is a public API?

2019-08-09 Thread Nick Coghlan
On Wed, 24 Jul 2019 at 06:32, Kyle Stanley wrote: > > Steve Dower wrote: > > So I apologise for mentioning that people care about import performance. > > Let's ignore them/that issue for now and worry instead about making sure > > people (including us!) know what the canonical reference for > >

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Guido van Rossum
I don't see how this debate can avoid a vote in the Steering Council. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him/his **(why is my pronoun here?)*

[Python-Dev] Core review is needed by bpo-34788

2019-08-09 Thread Sasha Pavlyuk
Hello 2019-06-03 I have created PR https://github.com/python/cpython/pull/13772 , which adds IPv6 scoped addresses support to ipaddress module. It is very critical to everyone, who is dealing with IPv6 networking. For example, in salt project they use patched module. So, it would be very nice to

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread brian . skinn
> This whole thread would be an excellent justification for following 3.9 > with 4.0. It's as near as we ever want to get to a breaking change, and a > major version number would indicate the need to review. If increasing > strictness of escape code interpretation in string literals is the only >

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Rob Cliffe via Python-Dev
On 09/08/2019 12:50:14, Steven D'Aprano wrote: On Thu, Aug 08, 2019 at 04:28:28PM -0700, Barry Warsaw wrote: I find it difficult to imagine a more meaningful distinction than that between syntax and semantics. The distinction between syntax and semantics can sometimes be blurred. Certainly in

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Nick Coghlan
Short version of my more detailed answer below: While my rationale is different from Barry's, I've convinced myself that the right thing to do for Python 3.8 is to remove the new TargetScopeError and have these cases all just raise SyntaxError. I do still see potential value in a new

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Chris Angelico
On Fri, Aug 9, 2019 at 11:22 PM Steven D'Aprano wrote: > > And this change won't fix that, because *good* paths that currently work > today will fail in the future, but *bad* paths that silently do the > wrong thing will continue to silently do the wrong thing. Except that many paths can be both

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread Steven D'Aprano
On Wed, Aug 07, 2019 at 07:47:45PM +1000, Chris Angelico wrote: > On Wed, Aug 7, 2019 at 7:33 PM Steven D'Aprano wrote: > > What's the rush? Let's be objective here: what benefit are we going to > > get from this change? Is there anyone hanging out desperately for "\d" > > and "\-" to become

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Steven D'Aprano
On Thu, Aug 08, 2019 at 04:28:28PM -0700, Barry Warsaw wrote: > On Aug 8, 2019, at 14:58, Steven D'Aprano wrote: > > > It's not a syntax error. There's nothing wrong with the syntax per-say: > > we still have ``target := expression``. There's a problem with the > > *semantics* not the syntax. >

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Steven D'Aprano
On Fri, Aug 09, 2019 at 01:16:16AM +0100, Rob Cliffe via Python-Dev wrote: > >The name is perfectly self-descriptive: TargetScopeError means that > >there's an error with the scope of the target. What else could it mean? > That's easy for an experienced programmer to say. Correct. Why should we

[Python-Dev] Re: typing: how to use names in result-tuples?

2019-08-09 Thread Ronald Oussoren via Python-Dev
> On 8 Aug 2019, at 17:42, Christian Tismer wrote: > > On 08.08.19 17:20, Ronald Oussoren via Python-Dev wrote: >> >> >>> On 8 Aug 2019, at 17:12, Christian Tismer >> > wrote: >>> >>> Hi Ronald, >>> >>> sure, the tuple is usually not very interesting; people

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Christian Tismer
On 09.08.19 03:53, Eric V. Smith wrote: > On 8/8/2019 7:28 PM, Barry Warsaw wrote: >> On Aug 8, 2019, at 14:58, Steven D'Aprano wrote: >> >>> It's not a syntax error. There's nothing wrong with the syntax per-say: >>> we still have ``target := expression``. There's a problem with the >>>

[Python-Dev] Re: PEP 572 TargetScopeError

2019-08-09 Thread Serhiy Storchaka
08.08.19 20:00, Barry Warsaw пише: Rather than just a vote, if you have a rationale for one over the other, I’d love to hear it. Feel free to weigh in here or on the issue. I do not have arguments for SyntaxError but the rationale for TargetScopeError does not look strong to me.