On 31Aug2010 23:38, MRAB <pyt...@mrabarnett.plus.com> wrote: | On 31/08/2010 23:11, Cameron Simpson wrote: | >On 31Aug2010 22:53, MRAB<pyt...@mrabarnett.plus.com> wrote: | >| There's still the possibility of some optimisation. If the resulting | >| set is never stored anywhere (bound to a name, for example) then it | >| could be created once. When the expression is evaluated there could be | >| a check so see whether 'set' is bound to the built-in class, and, if it | >| is, then just use the pre-created set. | > | >Wouldn't you need to repeat that check every time, otherwise "set" may | >no longer be the builtin? | | Isn't that what I said?
Yes. It's not what my brain decided to read to me. | My point is that if you have a set of constants which is created and | then discarded you can cache it and reuse it next time. You check every | time whether 'set' is bound to the set class. Ok then. I was thinking, for some reason, a JIT-like behaviour that didn't just reuse the previously made set but replaced the set([1,2,3]) itself, thus omitting the test you mentioned:-( Cheers, -- Cameron Simpson <c...@zip.com.au> DoD#743 http://www.cskk.ezoshosting.com/cs/ It's hard to make a man understand something when his livelihood depends on him not understanding it. - Upton Sinclair -- http://mail.python.org/mailman/listinfo/python-list