On Sun, Nov 22, 2020 at 5:03 PM Jim J. Jewett wrote:
> I think your changed constructor:
>
> class Car:
> def __init__(self, manufacturer, variant):
> self.brand = manufacturer
> self.model = variant
>
> is a particularly good example, and the PEP should specify whether:
>
On 11/22/20 5:00 PM, Jim J. Jewett wrote:
I think your changed constructor:
class Car:
def __init__(self, manufacturer, variant):
self.brand = manufacturer
self.model = variant
is a particularly good example, and the PEP should specify whether:
Car("Chrysler", "PT
I think your changed constructor:
class Car:
def __init__(self, manufacturer, variant):
self.brand = manufacturer
self.model = variant
is a particularly good example, and the PEP should specify whether:
Car("Chrysler", "PT Cruiser")
is matched by:
Others have replied with most of this covering my opinion but there's a
point I'd like to highlight here
On Fri, 20 Nov 2020 at 14:23, Mark Shannon wrote:
> Hi Daniel,
>
> On 20/11/2020 10:50 am, Daniel Moisset wrote:
> > (... snipping for brevity ...)
> >
> > 1. You mention a goal about
Regarding the difficulty which some people have respecting class patterns and
dictionary patterns, I would like to draw attention to a similar feature in
JavaScript, object destructuring. JavaScript does not have pattern matching but
object destructuring is closely related. Take the example of
Hi David and Steve,
There is hardly anything that needs to be added to your comments, of
course. However, I consider these explicitly named attributes in the
class pattern to be one of the most difficult aspects of our pattern
matching proposal, which is something I just want to briefly
Hi Steve,
Thank you very much for your comments here. This is certainly not the
first time I feel that you not only have an excellent insight into a
topic, but also manage to make your points very clearly and
succinctly. Your car example highlights the background of the
proposed
On Mon, Nov 16, 2020 at 6:41 AM Mark Shannon wrote:
> I believe that a pattern matching implementation must have the following
> properties:
>
> * The semantics must be precisely defined.
> * It must be implemented efficiently.
> * Failed matches must not pollute the enclosing namespace.
> *
If you don't want the overlapping with the existing syntax angle brackets
can be used:
match eggs:
case Spam: ...
On Sat, Nov 21, 2020 at 7:31 PM David Mertz wrote:
> On Sat, Nov 21, 2020 at 12:23 PM Steven D'Aprano
> wrote:
>
>> Clearly Spam(a=1, b=2) does not necessarily result in an
On Sat, Nov 21, 2020 at 12:23 PM Steven D'Aprano
wrote:
> Clearly Spam(a=1, b=2) does not necessarily result in an instance with
> attributes a and b. But the pattern `Spam(a=1, b=2)` is intended to be
> equivalent to (roughly):
>
> if (instance(obj, Spam)
> and getattr(obj, a) == 1
On Fri, Nov 20, 2020 at 02:23:45PM +, Mark Shannon wrote:
> Why force pattern matching onto library code that was not designed for
> pattern matching? It seems risky.
Can you give a concrete example of how this will "force" pattern
matching onto library code? I don't think that anyone has
On 20/11/2020 6:57 pm, Tobias Kohn wrote:
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
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
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
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
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
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
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
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
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
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 ;-)
> [...]
>
[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).
This is not an answer to the proposal (which I've read and helps me
contextualize) but to your points below and how they
Hi Guido,
On 16/11/2020 4:41 pm, Guido van Rossum wrote:
Thanks Mark, this is a helpful and valuable contribution.
I will try to understand and review it in the coming weeks (there is no
hurry since the decision is up to the next SC) but I encourage you to
just put it in PEP form and check
Thanks Mark, this is a helpful and valuable contribution.
I will try to understand and review it in the coming weeks (there is no
hurry since the decision is up to the next SC) but I encourage you to just
put it in PEP form and check it into the PEP repo.
Because I only skimmed very briefly, I
24 matches
Mail list logo