(lambda file:(lambda file, pos: [len(file.read(1)) == 0, file.seek(pos)][0])(file, file.tell()))
Lambda returns if file is at eof
#How it works:
len(file.read(1)) == 0
Trys to read one character and checks if the returned string has a length of 0 (if you read a file at eof you get a zero length string).
lambda file, pos: [len(file.read(1)) == 0, file.seek(pos)][0]
Creates a lambda that takes file and a position to seek back to. It creates an array of the expression above (if the file is at eof) and the return value of the seek command(moving the file position back to where it was). The lambda then returns the first value from the array (if the file is at eof).
(lambda file:(lambda file, pos: [len(file.read(1)) == 0, file.seek(pos)][0])(file, file.tell()))
The previous lambda is wrapped in a lambda which just takes file and calls the previous lambda with file and the current file position before reading.