I suggest that you use actual sets instead of lists for your working data. That way I'd guess you could throw away 95% of the code by using standard set operations. See set-types
BustACode commented: You are correct. Thanks. +1
I suggest that you use actual sets instead of lists for your working data. That way I'd guess you could throw away 95% of the code by using standard set operations. See set-types
Please state precisely what your code is meant to achieve as I've no intention of making wild guesses or wading through it to try and find out.
Please put the shovel down before the hole gets too big and you can't climb out :) Regular expressions are not the way to go for something that is XML based. The simplest way is to grab libraries and play with them at a Python interactive prompt. Besides python-xbrl there is also http://arelle.org/documentation/api/ which seems popular. Give them a go and if you run into problems please get back to us with more detailed questions.
Hint, overriding the str builtin isn't a very good idea.
"Order is lost again" is incorrect. You've created an empty OrderDict() called d_Dict, then reassigned the name d_Dict to an ordinary dict() created by calling zip() on your lists of keys and values.
There is a missing single quote around Ctrl+N on line 63. It's hard to run code with a syntax error :)