In article <mailman.5570.1389849928.18130.python-l...@python.org>, Chris Angelico <ros...@gmail.com> wrote:
> On Thu, Jan 16, 2014 at 2:46 PM, Roy Smith <r...@panix.com> wrote: > > So, I figured I would write a meta-test, which used introspection to > > find all the methods in the class, extract the strings from them (they > > are all assigned to a variable named RECEIPT), and check to make sure > > they're all different. >> [...] > But you might be able to shortcut it enormously. You say the strings > are "about 2500 characters long, hex-encoded". What are the chances of > having another constant, somewhere in the test function, that also > happens to be roughly that long and hex-encoded? The chances are exactly zero. > If the answer is "practically zero", then skip the code, skip > co_names, and just look through co_consts. That sounds like it should work, thanks! > Of course, this whole theory goes out the > window if your test functions can reference another test's RECEIPT; No, they don't do that. -- https://mail.python.org/mailman/listinfo/python-list