Apr-02-2017, 01:29 AM
both dictionary and sequence have .pop that gets a value (indexed according to the behavior/methods of the type/class) then removes it from the source.
but there is a difference.
dict.pop() also supports a default value. seq.pop() does not. OTOH, defaults when indexing sequences is not needed much in classic logic. but why not have it for consistency?
also there is dict.get() (with arguments like dict.pop()) but no seq.get(). without a default argument, class.get() is just class[]. i'd like to see a 2nd optional argument of default added to seq.pop() and seq.get() with a 2nd optional argument of default added to sequences.
but there is a difference.
dict.pop() also supports a default value. seq.pop() does not. OTOH, defaults when indexing sequences is not needed much in classic logic. but why not have it for consistency?
also there is dict.get() (with arguments like dict.pop()) but no seq.get(). without a default argument, class.get() is just class[]. i'd like to see a 2nd optional argument of default added to seq.pop() and seq.get() with a 2nd optional argument of default added to sequences.
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.