[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-20 Thread Terry Reedy
Mark, did you get the response I sent to hotpy.org 4 days ago? Is that a real address? I ask because the typos I reported are still there and trying to visit hotpy.org fails. -- Terry Jan Reedy ___ Python-Dev mailing list -- python-dev@python.org

[Python-Dev] Re: Questions about about the DLS 2020

2020-11-20 Thread Guido van Rossum
On Wed, Nov 18, 2020 at 11:39 AM Brett Cannon wrote: > Now obviously "practicality beats purity" as well, but the argument "other > languages do it this way" doesn't hold well for a language that doesn't use > curly braces for scoping delineation.  > I see your smiley, and I believe I've

[Python-Dev] Re: Questions about about the DLS 2020

2020-11-20 Thread Tobias Kohn
Hi Brett, Thanks for your replies. _> But you can write `123 .bit_length()`.  That's a parser limitation more than human understanding._ Touché.  I took this ambiguity of the dot so much for granted that I would not have thought of trying that. _> Yep, but PEP 634 not only changes the

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-20 Thread Tobias Kohn
Hi Daniel and Mark, Sorry for being slightly late to the party, but please let me add a few remarks of my own to the discussion here. 1. MUST HAVE PRECISELY DEFINED SEMANTICS Yes, there are some aspects that we left open intentionally.  Most prominently the question of how often the

[Python-Dev] Summary of Python tracker Issues

2020-11-20 Thread Python tracker
ACTIVITY SUMMARY (2020-11-13 - 2020-11-20) 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: open7593 (-35) closed 46562 (+103) total 54155 (+68) Open issues

[Python-Dev] Re: Questions about about the DLS 2020

2020-11-20 Thread Guido van Rossum
But none of those limitations are there under our proposal. You can write this if you want: match = 1 match match: case case: print(case, match) And you can use _(“...”) anywhere in the case block and even in the guard. Just not as a pattern, but you can’t use f(1) there either... On Fri,

[Python-Dev] Re: Questions about about the DLS 2020

2020-11-20 Thread Jim J. Jewett
Not being able to use a particular variable name (such as match or case) in the limited context of matching is only a minor wart. Unfortunately, _ for internationalization is already a well-established convention for something that you might well want to do within each separate case. It isn't

[Python-Dev] Preconditions for accepting any pattern matching PEP

2020-11-20 Thread Mark Shannon
Hi, I'd like to request that any pattern matching PEP and its implementation meet certain standards before acceptance. As one of the maintainers of the AST-to-bytecode part of the compiler and the bytecode interpreter, I don't want to be in the situation where we are forced to accept a

[Python-Dev] Matching syntax and semantics

2020-11-20 Thread Eric Nieuwland
Hi all, Some days back Mark Shannon posted his view/proposal pattern matching on github. While reading it I realised an intermediate step between matching and variable assignment might do away with part of the discussion. I wrote it in an issue with the view/proposal

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-20 Thread Mark Shannon
Hi Daniel, On 20/11/2020 10:50 am, Daniel Moisset wrote: Hello again Mark, I took some time looking in more detail at your proposal, and these are my thoughts. I'm writing with the assumption that this proposal describes some "internal" representation of match statements which is never

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-20 Thread Steve Holden
Fair enough. On Fri, Nov 20, 2020 at 11:45 AM Thomas Wouters wrote: > > > On Fri, Nov 20, 2020 at 8:38 AM Steve Holden wrote: > >> On Thu, Nov 19, 2020 at 8:08 PM Brett Cannon wrote: >> >> All I will say is just because we aren't *required* to implement it in >> __future__ that doesn't mean

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-20 Thread Thomas Wouters
On Fri, Nov 20, 2020 at 8:38 AM Steve Holden wrote: > On Thu, Nov 19, 2020 at 8:08 PM Brett Cannon wrote: > > All I will say is just because we aren't *required* to implement it in > __future__ that doesn't mean we can't or shouldn't. Everything should be > done to underline the tentative

[Python-Dev] Re: The semantics of pattern matching for Python

2020-11-20 Thread Daniel Moisset
Hello again Mark, I took some time looking in more detail at your proposal, and these are my thoughts. I'm writing with the assumption that this proposal describes some "internal" representation of match statements which is never exposed to the users (so I'd mostly steer away from

[Python-Dev] Re: Review patch fixing packed bitfields in ctypes struct/union

2020-11-20 Thread Simon Cross
The PR already has a fair amount of good review and discussion. Me doing a superficial review is not going to help get it merged. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org

[Python-Dev] Re: Review patch fixing packed bitfields in ctypes struct/union

2020-11-20 Thread Terry Reedy
On 11/20/2020 4:03 AM, Simon Cross wrote: Thank you for this [cttpes] patch! > I can't help land it, but it looks sane to me. If you have a github account, you can help by reviewing it. Check the spelling, grammar, and clarity of comments, docstrings, and news item. Can the code be

[Python-Dev] Re: Review patch fixing packed bitfields in ctypes struct/union

2020-11-20 Thread Simon Cross
Hello! Thank you for this patch! I can't help land it, but it looks sane to me. I fear you have discovered a fundamental truth about ctypes though -- it tries to mimic what C compilers do and this inevitably leads to many discrepancies. E.g. if a C structure you're trying to use is wrapped in an