This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cjw296
Recipients Ramchandra Apte, cjw296, daniel.urban, docs@python, eric.araujo, ncoghlan, terry.reedy
Date 2013-02-18.08:14:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
Some background: I hit this problem when adding Python 3 compatibility 
to one of my libraries, where I had the following code:

from types import ClassType
class_ = ClassType(n, (sometype, ), dict(class_attr1='foo', 

It wasn't at all clear how to port this to Python 3, given that 
ClassType was gone.

types.new_class looks fair game, but the help is not exactly helpful:

new_class(name, bases=(), kwds=None, exec_body=None)
     Create a class object dynamically using the appropriate metaclass.

No indication there as to what type should be passed for kwds or exec_body.

I guessed and, by the sound of it, guessed wrong.
I'd certainly agree that the error message is very misleading.


Date User Action Args
2013-02-18 08:14:21cjw296setrecipients: + cjw296, terry.reedy, ncoghlan, eric.araujo, daniel.urban, docs@python, Ramchandra Apte
2013-02-18 08:14:21cjw296linkissue17179 messages
2013-02-18 08:14:20cjw296create