It's been like this in the academia (Mathematics in particular) since ever.
Also, some people say that it makes for easier (less ambiguous?) parsing.
But the -> part is a bit weird. It "shouldn't" be
def factorial(x: int) -> int:
but it "should" be def factorial(x: int): int =
Maybe it's that way because of Python?