On Wed, Feb 17, 2021 at 6:12 PM Chris Angelico <ros...@gmail.com> wrote:
> But if object() could get arbitrary attributes, then __slots__ wouldn't > work. > It seems to me that all you'd have to do is add a line or two to the add_dict logic in type_new so that instances of object get a dict. Then instances of object would get a dict, and nothing else would change. In languages like C++ where an instance of a class contains actual in-memory instances of all of its superclasses, that wouldn't work. In Python, where instances of different classes have a priori nothing to do with each other, I think it would work.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/2R4FMO5UH6MFTS25BRNJJQB34DKMAZHI/ Code of Conduct: http://python.org/psf/codeofconduct/