On Sat, Dec 17, 2011 at 12:53, Maciej Fijalkowski <fij...@gmail.com> wrote: > Note that unlike some other more advanced approaches, slots do change > semantics. There are many cases out there where people would stuff > arbitrary things on stdlib objects and this works fine without > __slots__, but will stop working as soon as you introduce them. A > change from no slots to using slots is not only a performance issue.
Yeah... This whole idea reeks of polymorphic inline caches (called "shapes" or "hidden classes" in SpiderMonkey and v8, respectively), where they dynamically try to infer what kind of class an object has, such that the __slots__ optimization can be done without making it visible in the semantics. The Unladen Swallow guys mention in their ProjectPlan that the overhead of opcode fetch/dispatch makes that hard, though. Cheers, Dirkjan _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com