Message 389277 - Python tracker (original) (raw)

On Mon, Mar 22, 2021 at 04:34:32AM +0000, Tim Peters wrote:

For example, setting up a module global _gcd name for math.gcd

Looking on the stdlib, I would just import gcd.

default _gcd=math.gcd arguments to the methods? Then it's even faster (& uglier, of course).

... and less readable.

Not sure if speedup will be noticeable. But more important is that I see no such micro-optimizations across the stdlib. Probably, this will be the reason for rejection.

Or wrt changing properties to private attributes, that speeds some things but slows others - and, unless I missed it, nobody who wrote that code to begin with said a word about why it was done that way.

Yes, I'll dig into the history. Commen^WDocstring doesn't explain this (for me).

Opening a BPO report is a trivial effort.

Sure, but such report will require patch to be discussed, anyway.