From stackoverflow [1]

  # metaprepare.py
  class Meta1(type):
      @classmethod
      def __prepare__(mcs, name, bases):
          print('call prepare')
          return {}
      def __new__(mcs, name, bases, parameters):
          return super().__new__(mcs, name, bases, parameters)

  class A(metaclass=Meta1):
      pass

  type('C', (A, ), {})

output is:

  call prepare

(just the once, not twice)

The behavior of `type()` not calling `__prepare__()` has been constant since 
3.3.

Is it a bug?


--
~Ethan~


[1] https://stackoverflow.com/q/62128254/208880
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/CQTD7WFOIDBF5PSD77AALBTWJQ67UPM5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to