syntax difference
Jim Lee
jlee54 at gmail.com
Mon Jun 18 14:34:40 EDT 2018
On 06/18/2018 11:18 AM, Chris Angelico wrote:
> What, fundamentally, is the difference between type hints and
> assertions, such that - in
> your view - one gets syntax and the other is just comments?
Type hints are just that - hints. They have no syntactic meaning to the
parser, and do not affect the execution path in any way. Therefore, they
are effectively and actually comments. The way they have been
implemented, though, causes noise to be interspersed with live code and,
as others have said, are difficult to remove or ignore.
-Jim
More information about the Python-list
mailing list