Re: [Python-Dev] doctest, exec and __module__

2008-06-25 Thread Martijn Faassen
Fred Drake wrote: On Jun 25, 2008, at 2:45 PM, Martijn Faassen wrote: This places new key/value pairs into a dictionary, in this case test.globs. Unfortunately when the execution results in a class definition, it'll have its __module__ attribute set to '__builtin__'. Try as I might, I couldn't

Re: [Python-Dev] doctest, exec and __module__

2008-06-25 Thread Fred Drake
On Jun 25, 2008, at 2:45 PM, Martijn Faassen wrote: This places new key/value pairs into a dictionary, in this case test.globs. Unfortunately when the execution results in a class definition, it'll have its __module__ attribute set to '__builtin__'. Try as I might, I couldn't convince exec t

[Python-Dev] doctest, exec and __module__

2008-06-25 Thread Martijn Faassen
Hi there, I've just witnessed an interesting consequence of the way doctest works. I ran into an issue when doctesting an aspect of SQLAlchemy, where the following guard clause tripped me up: # In the normal call flow, a request for any of the 3 basic collection # types is transformed