[Python-Dev] Re: PEP 622 and variadic positional-only args

2020-07-16 Thread Tobias Kohn
Hi Oscar On Wed, Jul 15, 2020 at 4:41 PM Oscar Benjamin wrote: I've taken a look through PEP 622 and I've been thinking about how it could be used with sympy. Thank you very much for taking the time to carefully elaborate an interesting possible use case.  I find this very helpful and a

[Python-Dev] Re: PEP 622 constant value syntax idea

2020-07-16 Thread Tobias Kohn
Hi Mohammad, In addition to what Rhodri James has already well pointed out, here are two additional thoughts on this. At the moment, the keyword `global` is a marker to say that the respective variable is /modified/ by a function.  Your suggestion would invert that meaning and might ther

[Python-Dev] Problems with python and Geany?

2020-07-16 Thread arajgure
So I have recently purchased a rapsberry pi in hope that it will ease me in to programming and learn a bit more about computing. I was reading an article in pc pro about creating a game using python so thought I would give it a shot. However, when I try to execute on Geany I keep getting the sam

[Python-Dev] Re: PEP 622 constant value syntax idea

2020-07-16 Thread Baptiste Carvello
Hello, Le 15/07/2020 à 13:37, Mohammad Foroughi via Python-Dev a écrit : > Hi, I had an idea regarding the pattern matching issue of comparing with > a previous constant variable instead of assigning to a new local > variable. I'm not sure if this has been brought up before but instead of > using

[Python-Dev] Re: Problems with python and Geany?

2020-07-16 Thread Eric V. Smith
This list is for the development of Python the language. For end-user help, you're better off using python-list, whose details are here: https://mail.python.org/mailman/listinfo/python-list Eric On 7/16/2020 8:00 AM, arajg...@sevenmentor.com wrote: So I have recently purchased a rapsberry pi

[Python-Dev] Re: PEP 622 constant value syntax idea

2020-07-16 Thread Eric Nieuwland
> From: Baptiste Carvello > Subject: [Python-Dev] Re: PEP 622 constant value syntax idea > > What about simply "is", which is already a keyword? > > AFAIK "is" has no meaning as a prefix operator as of now, so hopefully > it would not make the grammar ambiguous (how can one check that for sure?

[Python-Dev] PEP 622 idea: "match case object" to represent match patterns

2020-07-16 Thread Federico Salerno
Recent discussion on the store vs. load syntax issues of PEP 622 prompted a (yet unripe) idea that could hopefully spur some progress. What if cases required some sort of MatchCase (name pending) object which could be preconstructed by the user if needed, but also inferred on the fly if absent

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread Steve Holden
While I understand the point of view that says that match ... : should encapsulate a sequence of indented suites, it seems to me that match/case/case/.../else has a natural affinity with try/except/except/.../finally/else, and nobody seems to think that the excepts should be indented. Or the finall

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread Rhodri James
On 16/07/2020 17:37, Steve Holden wrote: While I understand the point of view that says that match ... : should encapsulate a sequence of indented suites, it seems to me that match/case/case/.../else has a natural affinity with try/except/except/.../finally/else, and nobody seems to think that th

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread MRAB
On 2020-07-16 17:37, Steve Holden wrote: While I understand the point of view that says that match ... : should encapsulate a sequence of indented suites, it seems to me that match/case/case/.../else has a natural affinity with try/except/except/.../finally/else, and nobody seems to think that

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread Federico Salerno
On 16/07/2020 19:00, Rhodri James wrote: On 16/07/2020 17:37, Steve Holden wrote: While I understand the point of view that says that match ... : should encapsulate a sequence of indented suites, it seems to me that match/case/case/.../else has a natural affinity with try/except/except/.../final

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread Chris Angelico
On Fri, Jul 17, 2020 at 3:25 AM Federico Salerno wrote: > Tools should adapt to the language, not the other way around. If things had > to be done the way they had always been done, without any change, for fear of > people not being used to it, we wouldn't even have Python at all. People > lear

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread Richard Damon
> On Jul 16, 2020, at 1:36 PM, Chris Angelico wrote: > > On Fri, Jul 17, 2020 at 3:25 AM Federico Salerno > wrote: >> Tools should adapt to the language, not the other way around. If things had >> to be done the way they had always been done, without any change, for fear >> of people not bei

[Python-Dev] Re: PEP 622 and variadic positional-only args

2020-07-16 Thread Oscar Benjamin
On Thu, 16 Jul 2020 at 02:09, Guido van Rossum wrote: > > On Wed, Jul 15, 2020 at 4:41 PM Oscar Benjamin > wrote: >> >> I've taken a look through PEP 622 and I've been thinking about how it >> could be used with sympy. >> >> In principle case/match and destructuring should be useful for sympy >>

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread MRAB
On 2020-07-16 19:05, Richard Damon wrote: On Jul 16, 2020, at 1:36 PM, Chris Angelico wrote: On Fri, Jul 17, 2020 at 3:25 AM Federico Salerno wrote: Tools should adapt to the language, not the other way around. If things had to be done the way they had always been done, without any change,

[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020-07-16 Thread Glenn Linderman
On 7/16/2020 10:00 AM, Rhodri James wrote: On 16/07/2020 17:37, Steve Holden wrote: While I understand the point of view that says that match ... : should encapsulate a sequence of indented suites, it seems to me that match/case/case/.../else has a natural affinity with try/except/except/.../fin

[Python-Dev] Another take on PEP 622

2020-07-16 Thread Tobias Kohn
Hi Everyone, I feel there are still quite a few misconceptions around concerning PEP 622 and the new pattern matching feature it proposes.  Please allow me therefore to take another attempt at explaining the ideas behind PEP 622 with a different approach.  Bear in mind that I naturally ca