3 ms·
Lists use (not infrequently) logic like the following; If one element do this one element thing else do this more than one element thing
by njharman 16y ago
Lists use (not infrequently) logic like the following;
If one element
do this one element thing
else
do this more than one element thing
- iron_ball 16y agoBut in that case, either your code is evidently in a branch where the list will have one item -- as in your example -- in which case the context makes it clear. And if there's no context, such as in a nested function call, then at some point you should be passing that lone list item into a function which takes the item as an argument.