Maven (famous)@lemmy.zip to Programmer Humor@programming.dev · 1 month agoModern Programminglemmy.zipimagemessage-square39linkfedilinkarrow-up1525arrow-down17
arrow-up1518arrow-down1imageModern Programminglemmy.zipMaven (famous)@lemmy.zip to Programmer Humor@programming.dev · 1 month agomessage-square39linkfedilink
minus-squarelime!@feddit.nulinkfedilinkEnglisharrow-up5·edit-21 month 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.