Re: [Python-Dev] [Python-checkins] cpython (2.7): allow "fake" filenames in findsource (closes #9284)
On Sun, Jun 12, 2011 at 6:56 AM, benjamin.peterson <python-checkins@python.org> wrote:
summary: allow "fake" filenames in findsource (closes #9284)
This allows findsource() to work in doctests.
A patch from Dirkjan Ochtman.
Either this exception should be mentioned in the inspect.getsource() documentation or else doctest should be monkeypatching inspect as well as linecache. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
2011/6/12 Nick Coghlan <ncoghlan@gmail.com>:
On Sun, Jun 12, 2011 at 6:56 AM, benjamin.peterson <python-checkins@python.org> wrote:
summary: allow "fake" filenames in findsource (closes #9284)
This allows findsource() to work in doctests.
A patch from Dirkjan Ochtman.
Either this exception should be mentioned in the inspect.getsource() documentation or else doctest should be monkeypatching inspect as well as linecache.
I should have made more clear in the message that this is actually a regression from 2.6. -- Regards, Benjamin
On Mon, Jun 13, 2011 at 1:31 AM, Benjamin Peterson <benjamin@python.org> wrote:
I should have made more clear in the message that this is actually a regression from 2.6.
Actually looking at the inspect docs, I'm not sure where such a note would fit anyway. I'll think about it a bit more - I have a suspicion there may be a flawed assumption in that inspect code and it should be passing more queries through to linecache rather than trying to second-guess it regarding what source code is available. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia
participants (2)
-
Benjamin Peterson
-
Nick Coghlan