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

2020-11-19 Thread Steve Holden
On Thu, Nov 19, 2020 at 8:08 PM Brett Cannon wrote: > > > On Thu, Nov 19, 2020 at 5:16 AM Steve Holden wrote: > >> On Wed, Nov 18, 2020 at 7:04 PM Daniel Moisset >> wrote: >> >>> [sorry for the duplicate, meant to reply-all] >>> >>> Thank you for this approach, I find it really helpful to put t

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-19 Thread Jim J. Jewett
Nick Coghlan doesn't want to ever be having conversations about why "case True:" doesn't behave the same way as "case some.attr.referring.to.true:". Guido thinks that it strange enough that you won't see it. I agree that it is odd to define a complicated alias for True, but it isn't so odd to h

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

2020-11-19 Thread Filipe Laíns
Hi folks, I know this is a high-volume list so sorry for being yet another voice screaming into your mailbox, but I do not know how else to handle this. A few months ago, I opened a pull request fixing packed bitfields in ctypes struct/union, which right now are being incorrectly created. The off

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

2020-11-19 Thread Brett Cannon
On Thu, Nov 19, 2020 at 5:16 AM Steve Holden wrote: > On Wed, Nov 18, 2020 at 7:04 PM Daniel Moisset > wrote: > >> [sorry for the duplicate, meant to reply-all] >> >> Thank you for this approach, I find it really helpful to put the >> conversation in these terms (semantics and guiding principles

[Python-Dev] Re: How Cpython repository has a pre-commit hook ? (as in PEP8)

2020-11-19 Thread Brett Cannon
On Thu, Nov 19, 2020 at 10:47 AM Nilo César Teixeira < nilo.teixe...@gmail.com> wrote: > Hello, > > I'm not a Python contributor but I have a question which (I believe) can > be answered here, so I've subscribed. > > The question is at stackoverflow: > https://stackoverflow.com/questions/64912716/

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

2020-11-19 Thread Daniel Moisset
A notorious example here of the "not many" is this proposal (i.e. not part of the language yet) for C++: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1371r0.pdf . I think it's an interesting example given that this is a very mature language, not originally designed with pattern matching

[Python-Dev] How Cpython repository has a pre-commit hook ? (as in PEP8)

2020-11-19 Thread Nilo César Teixeira
Hello, I'm not a Python contributor but I have a question which (I believe) can be answered here, so I've subscribed. The question is at stackoverflow: https://stackoverflow.com/questions/64912716/are-pre-commit-hooks-clonable After some research the only thing similtar to a git pre-commit hook

[Python-Dev] Re: Why does "except Ex as x" not restore the previous value of x?

2020-11-19 Thread Steve Holden
On Wed, Nov 18, 2020 at 7:45 PM Brett Cannon wrote: > > > On Tue, Nov 17, 2020 at 10:16 PM Greg Ewing > wrote: > >> On 18/11/20 4:36 pm, Larry Hastings wrote: >> > >> > But, >> > the thinking went, you'd never want to examine the last value from a >> > list generator, so it was more convenient i

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

2020-11-19 Thread Steve Holden
On Wed, Nov 18, 2020 at 7:04 PM Daniel Moisset wrote: > [sorry for the duplicate, meant to reply-all] > > Thank you for this approach, I find it really helpful to put the > conversation in these terms (semantics and guiding principles). > > It does help to rationalise discussion ;-) > [...] > 4.

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-19 Thread Robin Becker
.. Also will matching ever extend into the Typing universe? In what way do you have in mind? With protocol support baked into PEP 634 that already ties into type hints. -Brett . thanks for the answers; the only one missing is whether there is an actual bestiary of example

[Python-Dev] Yet another idea for pattern matching syntax

2020-11-19 Thread Federico Salerno
I'm sorry, I've been skipping around the discussion a bit, but I'm fairly certain this suggestion hasn't been proposed yet. It's perhaps a bit too different from what has been proposed thus far but maybe that's exactly what's needed to convince the minds, since as far as I see it most of the parti