On 23.04.2018 19:31, Tim Peters wrote:
Surely you're joking.  This is math.gcd(), which is expensive for
multi-thousand bit integers, and the interpreter knows nothing about
it.  Adding a cache of _any_ kind (LRU or otherwise) would make it
even slower.
Alright, if that problem is just about performance, then there must be a better way to resolve it rather than inventing a new syntax. Btw. storing the result in a local var is also a cache IMHO. And if gcd is immutable, I think Python can do a great job here of optimizing.

Anyway, your example is the best one I've seen so far.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to