Op 07-04-16 om 23:08 schreef Ben Finney: > Antoon Pardon <antoon.par...@rece.vub.ac.be> writes: > >> With this method I have to traverse the two tuples almost always >> twice. Once to find out if they are equal and if not a second time to >> find out which is greater. > You are essentially describing the new internal API of comparison > operators. That's pretty much unavoidable.
And nobody thought about this kind of cases or found them important enough? > If you want to avoid repeating an expensive operation – the computation > of the comparison value for an object – you could add an LRU cache to > that function. See ‘functools.lru_cache’. I'll have a look. -- Antoon -- https://mail.python.org/mailman/listinfo/python-list