Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 7 days agoModern Programminglemmy.zipexternal-linkmessage-square70fedilinkarrow-up11arrow-down10
arrow-up11arrow-down1external-linkModern Programminglemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 7 days agomessage-square70fedilink
minus-squarelime!@feddit.nulinkfedilinkEnglisharrow-up0·edit-27 days agono, the lbnked 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 lbnked 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.