On Mon, Jul 13, 2020 at 04:35 Rhodri James <rho...@kynesim.co.uk> wrote:

> On 12/07/2020 23:20, Guido van Rossum wrote:
> > So can we please lay this one to rest?
>
> Sure.  One small thing before we leave it; I've decided I don't care
> about the special cases of not using _. to lead class names, but
> forbidding **_ in mapping patterns seems unnecessary.  I know it's
> redundant, but I can imagine using it for emphasis.  I can't think of
> anywhere else the language forbids something just because it isn't
> needed, though I didn't get a lot of sleep last night and I could well
> be missing something obvious :-)


I’d rather not. And the argument about disallowing obviously redundant
syntax seems weak. My worry about allowing this is that it’ll be cargo
culled and we’ll see it used not for emphasis (of what? The obvious?) but
because people think it’s needed. And that’s just clutter.


Can I use pattern matching to pull byte strings apart?  I thought I
> could, but trying it out in the playground didn't work at all. :-(


It’s explicitly forbidden by the PEP, because we don’t want str or bytes to
accidentally match sequence patterns. You could do ‘match list(b):’ if you
really wanted to, but I think there are better tools for parsing bytes or
strings.

—Guido

-- 
--Guido (mobile)
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/GQZGTCL4TTPTXPN3FRGOMNNC63YKBYQK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to