On Sun, Jul 3, 2016 at 10:02 AM, Steven D'Aprano <st...@pearwood.info> wrote: > If I then try it against two identical (apart from their names) classes, I > get these results: > > > py> @process > ... class K: > ... x = 1 > ... > ['__dict__', '__doc__', '__module__', '__weakref__', 'x'] > py> class Q(metaclass=process): > ... x = 1 > ... > ['__module__', '__qualname__', 'x'] > Now if I check the newly created Q, I see the same keys K has: > > py> sorted(Q.__dict__.keys()) > ['__dict__', '__doc__', '__module__', '__weakref__', 'x'] > > > Is there any documentation for exactly what keys are added to classes when?
I'm only aware of the sequence defined at https://docs.python.org/3/reference/datamodel.html#customizing-class-creation. Based on that, I'm surprised to even see __module__ and __qualname__ in there at the point when the metaclass is handling it. -- https://mail.python.org/mailman/listinfo/python-list