It would be a disaster if the base class's slot descriptors would be broken by that though, so the implementation of slot descriptors would have to become more complicated. (It's worth understanding how __slots__ works. the interpreter first finds the slot on the class and then calls its __get__ method to retrieve the actual value from the instance. Each slot descriptor, in the current implementation, knows the offset of its slot within the instance.
On Tue, Apr 29, 2014 at 11:48 PM, Greg Ewing <greg.ew...@canterbury.ac.nz>wrote: > Paul Sokolovsky wrote: > > Well, here it itches to ask if C++-like offsetting of subclass to base >> class "this" pointer was considered, >> > > I suppose in theory it would be possible to build a new > set of __slot__ descriptors for the subclass. It mightn't > even be all that difficult. My guess would be that it > wasn't considered worth the effort, if it was considered > at all. > > -- > Greg > > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/ > guido%40python.org > -- --Guido van Rossum (python.org/~guido)
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com