Serhiy Storchaka added the comment:
Good point Ammar.
Seems there is also a missing corner case in the definition of a physical line:
https://docs.python.org/3.8/reference/lexical_analysis.html#physical-lines
"""
A physical line is a sequence of characters terminated by an end-of-line sequence. In source files, any of the standard platform line termination sequences can be used - the Unix form using ASCII LF (linefeed), the Windows form using the ASCII sequence CR LF (return followed by linefeed), or the old Macintosh form using the ASCII CR (return) character. All of these forms can be used equally, regardless of platform.
"""
It misses a case when a physical line is terminated by the end of file.
----------
assignee: -> docs@python
components: +Documentation -Interpreter Core
nosy: +docs@python, gvanrossum
versions: +Python 2.7 -Python 3.5
_______________________________________
Python tracker
https://bugs.python.org/issue33766
_______________________________________