how to count lines in a file ?
Richard Jones
rjones at ekit-inc.com
Thu Jul 25 22:11:48 EDT 2002
On Fri, 26 Jul 2002 12:01 pm, Tim Peters wrote:
> [Richard Jones]
>
> > I think the major problem that we're running into here is that
> > before there was GC, the refcounting-based cleanup of objects was clear,
> > straight-forward and reliable. Now it's not clear when objects are
> > cleared up.
>
> Then you don't understand CPython's flavor of gc: refcounting didn't go
> away in CPython. [snip]
> Did you catch that the example was run under Jython? Jython never used
> refcounting.
Ah, this is my fundamental misunderstanding. So it's Jython that changed the
rules because it doesn't do refcounting. Righto, all clear now.
It's still a problem that I was completely unaware of - I should have paid
more attention to Jython, even though I didn't figure it'd have any impact on
things I wrote :(
> Yet it shouldn't be "a problem" at all. Nothing has changed except that you
> have fewer memory leaks.
But something has changed - files aren't closed reliably in Jython when they
are in CPython.
Richard
More information about the Python-list
mailing list