Jan-10-2020, 01:19 AM
a function gets a likely iterable. how can i test if it really has a len == 2 when it does not support len(), such as a generator? how does
dict()
do it? would it be appropriate to just let dict()
do the test for me, in a try/except for cases where i need to run certain code when it has the wrong len, making a dictionary i might just throw away? oh wait, i might get an item #0 that is not valid as a dictionary key (cannot be hashed, such as a bytearray).
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.