On Wed, Jul 8, 2020 at 8:56 PM Inada Naoki <songofaca...@gmail.com> wrote: > > On Wed, Jul 8, 2020 at 6:14 PM Chris Angelico <ros...@gmail.com> wrote: > > > > > > These two I would be less averse to, but the trouble is that they make > > the semantics a bit harder to explain. "Dotted names are looked up if > > not already looked up, otherwise they use the same object from the > > previous lookup". If you have (say) "case > > socket.AddressFamily.AF_INET", does it cache "socket", > > "socket.AddressFamily", or both? > > > > I meant "It is implementation detail" and "User must not rely on side effects > of attribute access." >
Fair enough. I wouldn't mind that, it seems like a nice optimization that would only harm code that would be extremely confusing to read anyway. But only within one matching - caching beyond that seems more dangerous. ChrisA _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/XORPYNPF2ZNS6YX6AHXXBHMC6VQEYD5V/ Code of Conduct: http://python.org/psf/codeofconduct/