Public
Authored by Waffle

stringify everything :P

Пример вывода:

>>> class A:
...     def __init__(self, a, b):
...         self.a = a
...         self.b = b
... 
>>> a = A(1, A(A(3, 4), A(["11", "8"], "hello")))
>>> obj_to_str(a)
{
 a: <class 'int'> 1
 b: {
   a: {
     a: <class 'int'> 3
     b: <class 'int'> 4
    }
   b: {
     a: ( <class 'str'> 11, <class 'str'> 8)
     b: <class 'str'> hello
    }
  }
}
stringify.py 1.1 KB
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment