[Python-ideas] the optional "as" statement inside "if" statements

Masklinn masklinn at masklinn.net
Sat Jul 7 18:15:35 CEST 2012


On 2012-07-07, at 18:03 , Matt Joiner wrote:
> 
> Haskell also lets  you name expressions like:
> 
> someFunc y at x:xs = ...

as-patterns have very little relation with what was described in the
thread, as they're about keeping the "packed" version of a
pattern-matched expression.

Guards are probably closer:

    case someFunc val of
        x | x > 3 -> …




More information about the Python-ideas mailing list