3 ms·
I'm not the same person, but there's not much in operator module that can't be done by simply using an operator symbol. It's useful to use in e.g. map(), but yo
by Etherlord87 4y ago
I'm not the same person, but there's not much in operator module that can't be done by simply using an operator symbol. It's useful to use in e.g. map(), but you could use lambdas instead (for some performance overhead as mentioned).
operator.countOf() is perhaps the hardest to reimplement in lambda, as it's more reliable than lambda x: x.count() - for example it will work for dictionary.values() as well.