On Sat, 2003-06-14 at 02:56, Martin v. Löwis wrote:
It is not. Shadowing may occur well after the module import, by inserting a name in the globals. If it were feasible, it would have been done long ago.
Somehow, when I dreamed all this up, I convinced myself that the byte-compiler could know whether the range() in globals was the builtin, and only do the optimization if it was.
Now, I can't even recall why I thought that. :)
Oh well. Thanks.