Does anyone have the similar experience to print assigned information for different objects?
For instance, the following docstring printed from getattr(obj,'__doc__')
__doc__
Keyword arguments
-----------------
name : str
(default "")
description : str
(default "")
_id : str
(default "")
script : str
(default "")
dependencies : List[Dependency]
cyclic : bool
(default False)
feature : str
(default "")
index : int
(default -1)
or set it in a variable docstr
as
docstr = '\n Keyword arguments\n -----------------\n name : str\n (default "")\n description : str\n (default "")\n _id : str\n (default "")\n script : str\n (default "")\n dependencies : List[Dependency]\n cyclic : bool\n (default False)\n feature : str\n (default "")\n index : int\n (default -1)\n '
is to be converted to:
adict = {'name' : str,
'description' : str,
'_id' : str,
'script' : str,
'dependencies' : List[Dependency],
'cyclic' : bool,
'feature' : str,
'index' : int,
}