megaflo 29 Newbie Poster

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

Gribouillis commented: indeed +14
megaflo 29 Newbie Poster

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.

megaflo 29 Newbie Poster

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.

Gribouillis commented: good link +14
megaflo 29 Newbie Poster

Hint, overriding the str builtin isn't a very good idea.

megaflo 29 Newbie Poster

"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.

BustACode commented: You are correct. Thanks. +1
megaflo 29 Newbie Poster

There is a missing single quote around Ctrl+N on line 63. It's hard to run code with a syntax error :)