how to count lines in a file ?

Tim Peters tim.one at comcast.net
Thu Jul 25 22:35:11 EDT 2002


[Richard Jones]
> ...
> But something has changed - files aren't closed reliably in
> Jython when they are in CPython.

That isn't "a change", though.  These three have always been true, and still
are:

1. CPython uses refcounting.

2. Jython doesn't.

3. Python's Language Reference manual doesn't define when unreachable
   objects are collected, and explicitly warns that an implementation
   may even choose never to collect unreachable objects; it "strongly
   recommends" to invoke close()-like methods rather than just hope.

None of those are likely to change, either <wink>.





More information about the Python-list mailing list