Steven D'Aprano <[email protected]> writes:
> The compiler doesn't need to decide in advance whether or not the module
> attributes have been changed. It can decide that at runtime, just before
> actually looking up the attribute. In pseudo-code:
>
> if attribute might have changed:
> use the slow path just like today
> else:
> use the optimized fast path
if attribute might have changed:
check if attribute really did change
if it didn't:
reset means of determining if it might have changed
goto the optimized fast path
else:
use the slow path and/or maybe make a new fast path
else:
use the optimized fast path
And what if your optimization depends on _two_ things that might change?
Do you create one really fast path and two sort of fast paths?
--
https://mail.python.org/mailman/listinfo/python-list