Re: filecmp.cmp() cache

2007-02-15 Thread Steve Holden
Peter Otten wrote: > Mattias Brändström wrote: > >> On Feb 15, 5:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >>> You can clear the cache with >>> >>> filecmp._cache = {} >>> >>> as a glance into the filecmp module would have shown. >> You are right, a quick glance would have enlighten me. Next t

Re: filecmp.cmp() cache

2007-02-15 Thread Mattias Brändström
On Feb 15, 11:43 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Mattias Brändström wrote: > > Just one small tought/question. How likely am I to run into trouble > > because of this? I mean, by setting _cache to another value I'm > > mucking about in filecmp's implementation details. Is this generall

Re: filecmp.cmp() cache

2007-02-15 Thread Peter Otten
Mattias Brändström wrote: > On Feb 15, 5:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> You can clear the cache with >> >> filecmp._cache = {} >> >> as a glance into the filecmp module would have shown. > > You are right, a quick glance would have enlighten me. Next time I > will RTFS first. :-

Re: filecmp.cmp() cache

2007-02-15 Thread Mattias Brändström
On Feb 15, 5:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > You can clear the cache with > > filecmp._cache = {} > > as a glance into the filecmp module would have shown. You are right, a quick glance would have enlighten me. Next time I will RTFS first. :-) > If you don't want to use the cache

Re: filecmp.cmp() cache

2007-02-15 Thread Peter Otten
Mattias Brändström wrote: > I have a question about filecmp.cmp(). The short code snippet blow > does not bahave as I would expect: > > import filecmp > > f0 = "foo.dat" > f1 = "bar.dat" > > f = open(f0, "w") > f.write("1:2") > f.close() > > f = open(f1, "w") > f.write("1:2") > f.close() > >

filecmp.cmp() cache

2007-02-15 Thread Mattias Brändström
Hello! I have a question about filecmp.cmp(). The short code snippet blow does not bahave as I would expect: import filecmp f0 = "foo.dat" f1 = "bar.dat" f = open(f0, "w") f.write("1:2") f.close() f = open(f1, "w") f.write("1:2") f.close() print "cmp 1: " + str(filecmp.cmp(f0, f1, False)) f