[utils] improve dump_class by copying back original class doc and module name
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 12 Mar 2010 10:52:04 +0100
changeset 4881 39fc30001a20
parent 4880 fa6671e83639
child 4882 4a42d700c52d
[utils] improve dump_class by copying back original class doc and module name
utils.py
--- a/utils.py	Fri Mar 12 10:51:30 2010 +0100
+++ b/utils.py	Fri Mar 12 10:52:04 2010 +0100
@@ -46,9 +46,9 @@
     # type doesn't accept unicode name
     # return type.__new__(type, str(clsname), (cls,), {})
     # __autogenerated__ attribute is just a marker
-    return type(str(clsname), (cls,), {'__autogenerated__': True})
-
-
+    return type(str(clsname), (cls,), {'__autogenerated__': True,
+                                       '__doc__': cls.__doc__,
+                                       '__module__': cls.__module__})
 
 
 # use networkX instead ?