[Tutor] Any Tutor there ? Removing redundant parameters in a models file having include files.

Karim Liateni karim.liateni at free.fr
Mon Mar 1 21:07:57 CET 2010


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.liateni at 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,
>



More information about the Tutor mailing list