Open ShaheedHaque opened 6 years ago
I feel like the zip dict should be reversed to make lookup easier. {3: "<doctest README.rst[40]>"}
.
Also the zip thing isn't very expected.
Maybe we can borrow syntax from other such config systems, to stay familiar? I'm thinking about the object refs in openapi, or the yaml references.
Here is the patch I had in mind for #37. I've left the doctest's failing like this so you can see what the functional change is (and also because I'm not yet familiar enough with doctest :-)):
The basic change is that the co_filename, which often contains non-trivial filenames and duplicates too, stores an integer instead, and an extra "zip" dict at the top level provides the de-dupe service.
One other thing: for reasons I don't quite understand, on my dev system, though not in these tests, the
f_globals
dict also has a__file__
which I also took care of via "zip"...I don't understand why that field is not present here. It also stores the filename, and is a major cause of duplicates for my setup. (Yes, I'm baffled by this).