Minor bug in tempfile module (possibly __doc__ error)

James T. Dennis jadestar at idiom.com
Thu May 10 02:41:16 EDT 2007


Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
> On Wed, 09 May 2007 06:50:38 -0000, "James T. Dennis"
> <jadestar at idiom.com> declaimed the following in comp.lang.python:


>>  In fact I realized, after reading through tempfile.py in /usr/lib/...
>>  that the following also doesn't "work" like I'd expect:
>>
>        No idea of the tempfile problem, but...
> 
>>       # foo.py
>>       tst = "foo"
>>       def getTst(arg):
>>               return "foo-%s" % arg

>        This return is using a literal "foo-". Change it to

>                return "%s-%s" % (tst, arg)

	Sorry that was a retyping bug in my posting ... not in
	my sample code which was on another system.

> and try again.

	Try it yourself.  As I said ... the value of tst in your
	name space will be changed, but the value returned by functions
	in the imported module will still use the old value!


-- 
Jim Dennis,
Starshine: Signed, Sealed, Delivered




More information about the Python-list mailing list