I'm reading a tutorial about python for very beginners and at some point the author define some ways to work with files. My doubt is related to memory management and file arrays.
#open a file for reading
file = open(filename, 'r')
#this turns the file into an array.
lines = file.readlines() `
Python is smart enough to check the file size? What happens if the file has about 1 GB of data? Python will throw the entire file to the memory (array)? Or this is a lazy operation, just like C/C++ does!
Thanks in advance.