[Python-ideas] pattern matching proof-of-concept

Michael Selik michael.selik at gmail.com
Mon May 30 18:22:24 EDT 2016


On Mon, May 30, 2016 at 4:48 PM Pavol Lisy <pavol.lisy at gmail.com> wrote:

> I prefer to enable multiple matches.
>

Ok. Preventing rebinding was inspired by Erlang, but I can see why you
might want to match multiple cases. I'll move that feature to a
FreezeBinding class; I figure it'll be helpful in multithreading.


> But if you really like to forbid it then you would probably like to
> change next line ->
>     raise BindError(fmt.format(name=name, value=value))
> to line ->
>     raise BindError(fmt.format(name=name, value=getattr(self, name)))
>

Fixed.


> Anyway I really like your proof of concept! :)
>

Thanks for reading.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160530/cbf5042a/attachment.html>


More information about the Python-ideas mailing list