Chris Angelico writes:
> ## New "unless" construct for list displays and argument lists ##
>
> Inside a list/dict/set/tuple display, or inside an argument list,
> elements can be conditionally omitted by providing a predicate.
>
> lst = [f1(), f3() unless f2(), f4()]
Not a fan of this in
On 6/3/2019 8:57 PM, James Lu wrote:
`if-unless` expressions in Python
if condition1 expr unless condition2
is an expression that roughly reduces to
expr if condition1 and not condition2 else EMPTY
An expression MUST evaluate to a value. EMPTY is spelled None in
Python. No need
On Mon, Jun 03, 2019 at 08:57:22PM -0400, James Lu wrote:
> `if-unless` expressions in Python
>
> if condition1 expr unless condition2
>
> is an expression that roughly reduces to
>
> expr if condition1 and not condition2 else EMPTY
Then the "unless" clause is superfluorous and we can w
On Tue, Jun 4, 2019 at 10:58 AM James Lu wrote:
>
> `if-unless` expressions in Python
>
> if condition1 expr unless condition2
>
> is an expression that roughly reduces to
>
> expr if condition1 and not condition2 else EMPTY
>
> This definition means that expr is only evaluated if `conditi
On 2019-06-04 01:57, James Lu wrote:
`if-unless` expressions in Python
if condition1 expr unless condition2
is an expression that roughly reduces to
expr if condition1 and not condition2 else EMPTY
This definition means that expr is only evaluated if `condition1 and not
condition2
`if-unless` expressions in Python
if condition1 expr unless condition2
is an expression that roughly reduces to
expr if condition1 and not condition2 else EMPTY
This definition means that expr is only evaluated if `condition1 and not
condition2` evaluates to true. It also means `not co