Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The result of the expression is not compared to an annotation if there isn't one, but that result absolutely has a type of its own.

And the objects inside an expression assuredly care about their types:

  >>> '1' + 1
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  TypeError: can only concatenate str (not "int") to str


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: