Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 5 days agoModern Programminglemmy.zipexternal-linkmessage-square76fedilinkarrow-up1583arrow-down18
arrow-up1575arrow-down1external-linkModern Programminglemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 5 days agomessage-square76fedilink
minus-squarelime!@feddit.nulinkfedilinkEnglisharrow-up6·edit-24 days agono, the linked table shows how python also returns the first non-falsey result of an a or b expression rather than just giving a boolean. it’s useful for initialising optional reference args: def foo(a: list = None) a = a or [] works with and as well.
no, the linked table shows how python also returns the first non-falsey result of an
a or b
expression rather than just giving a boolean. it’s useful for initialising optional reference args:works with
and
as well.