I currently have a deep object, and it is all unicode (sadly).
I am to a point where a variable is either going to be a dict, or a bool. In this case, I do
if type( my_variable ) is BooleanType:
But this is not triggered because the type is actually Unicode for all values.
How do I convert this unicode object to a normal object so I can correctly read the type, without destroying the data?
Thanks!
Here is the result of print(repr(variable)). It shows the Bools as not being unicode (unlike what I first though) but still giving me troubles.
{u'forms': {u'financing': {u'view': True, u'delete': True}, u'employment': {u'view': True, u'delete': True}, u'service': {u'view': True, u'delete': True}}, u'content': {u'articles': {u'edit': True, u'add': True, u'view': True, u'delete': True}, u'slideshow': {u'edit': True, u'view': True}, u'pages': {u'edit': True, u'add': True, u'view': True, u'delete': True}}, u'people': {u'edit': True, u'sort-staff': True, u'sort-riders': True, u'add': True, u'delete': True, u'view': True}, u'events': {u'edit': True, u'add': True, u'view': True, u'delete': True}, u'settings': {u'edit': True, u'view': True}}