[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2016-08-03 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berker.peksag stage: -> patch review versions: +Python 3.5, Python 3.6 -Python 3.3, Python 3.4 ___ Python tracker

[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2015-07-21 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: -ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18334 ___ ___ Python-bugs-list

[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2014-05-18 Thread Ethan Furman
Changes by Ethan Furman et...@stoneleaf.us: -- nosy: +ethan.furman ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18334 ___ ___ Python-bugs-list

[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-07-01 Thread Nick Coghlan
Nick Coghlan added the comment: Unfortunately, it's not that simple, as calling type(name, bases, namespace) is *exactly* what a subclass will do as part of creating the type object. From inside the type implementation, we can't tell the difference between properly called from the child type

[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread Nikolaus Rath
New submission from Nikolaus Rath: When using the three parameter form of type to create a new class, and any of the base classes has a metaclass with a __prepare__ function, the __prepare__ function is not executed: class CustomMetaclass(type): ... @classmethod ...

[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread R. David Murray
R. David Murray added the comment: Intentional is not perhaps the exactly right term, but it is working as expected. There was a thread about this on python-dev (PEP 3115 compliant dynamic type creation and adding types.build_class for 3.3), that ultimately resulted in the addition of the

[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread Nick Coghlan
Nick Coghlan added the comment: I think we should actually go further, and explicitly defer to http://docs.python.org/3/library/types#dynamic-type-creation for dynamic type creation. Type shouldn't be called with arbitrary bases any more, precisely *because* doing so breaks __prepare__

[issue18334] type(name, bases, dict) does not call metaclass' __prepare__ attribute

2013-06-30 Thread Nikolaus Rath
Nikolaus Rath added the comment: In that cases, maybe type(name, cls, clsdict) should actually raise an error if there's a metaclass with __prepare__ involved? Presumably that would break only code that was already broken, but it would convert previously hidden behavioral bugs into an