how to count lines in a file ?

Christopher A. Craig list-python at ccraig.org
Mon Jul 29 00:25:59 EDT 2002


bokr at oz.net (Bengt Richter) writes:

> I like this, but I think I would rather see timely finalization
> subsumed under a general event-handling mechanism for objects. Thus
> ref count going to zero would be a standard event that you could
> write a handler for.

You're still assuming that the standard deals with such a thing as a
reference count.  One of the points of this whole thread (to my mind)
has been that, though it is well known that CPython uses reference
counts for garbage collection (and people mistakenly depend on this),
the actual language standard does not require it.  This means that any
code that depends on reference counts, in any way, is not only not
portable to Jython (or any other non-CPython compiler), it's not
necessarily compatible with all future versions of CPython.

So if Guido decides today that reference counts were a dumb idea and
he would be better off with a simple mark-and-sweep GC, he can
implement one and not lose too much sleep over the weeping and
gnashing of teeth from those that depended on the behavior of the
current compiler. <.8 wink>

--  
Christopher A. Craig <ccraig at ccraig.org> 
The use of COBOL cripples the mind; its teaching should, therefore, 
be regarded as a criminal offense -- Edsger Dijkstra 




More information about the Python-list mailing list