Thanks for this precision!
I'm using standard python so this is ok!
Why people use proprietary python ?
To have more trouble ? To be different from the rest of community ?
Anyway in opensource people do whatever they want but you know
multiple version that was the same before Common C or Lisp it was war fields. It's better to spent energy to participate with the core developers to make the
common langage evoluate.

Regards

Karim

Alan Gauld wrote:

"Karim Liateni" <karim.liat...@free.fr> wrote

def getLines(file):
try: lines = open(filename).readlines() ; return lines
except IOError: #handle error


but in the second 'lines = open(filename).readlines()'
I don't hold indirectly a reference to the file? Please, could you explain more this point?

Sure, the lines variable holds a reference to the list returned by readlines.
There is no variable referring to the file object so immediately after
readlines completes the file will be ready to be closed (at least in
CPython as already pointed out by Lie)

HTH,


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to