gzz-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gzz] Oct 14th (vegai)


From: Tuomas Lukka
Subject: Re: [Gzz] Oct 14th (vegai)
Date: Mon, 14 Oct 2002 20:28:14 +0300
User-agent: Mutt/1.4i

On Mon, Oct 14, 2002 at 07:44:36PM +0300, Vesa Kaihlavirta wrote:
> 
> Solved the minor problem of file access in jython. Apparently python's
> and jython's differences in GC causes different behaviour in such
> piece of code:
> 
> def bar():
>  a = open('foo')
>  a.write('guu')
> 
> Closing the file-handle explicitly -- a.close() in the example -- solved
> the problem (probably better style in regular CPython as well).
> 
> {slightly distressing, that simple stuff like this causes trouble
> in jython}

Not really, this is well documented: while CPython does reference counting,
Jython uses Java's garbage collection. 

I actually think that python's language definition does not specify
when a will be deleted so the fact that it works in C is just luck.

        Tuomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]