Aug-19-2018, 11:04 PM
i often have statements like:
fail = result < 0to save true/false from a conditional until later, when the test can't readily be done again and/or the relevant variables may ha been changed. or there may be a variety of different tests for a common end result. today i was wanting to this for the truthfulness of a variable's value instead of an expression. the code today is:
doargs = True if ptargs else Falsein the above code ptargs is initialized to be an empty list and may have arguments appended to it. but the logic that depends on doargs (to decide whether to use the arguments or read input) is in a loop where that list gets changed or cleared. making a copy of it seems wasteful (although i'm sure i have enough memory for it) and all i need is its true/false, hence the way i set doargs. is there a better/simpler way to do this? would this work?
doargs = not not ptargsor is what i have, now, the best way to go?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.