Comment on The C programming language is like debating a philosopher and Python is like debating someone who ate an edible

<- View Parent
cooligula@sh.itjust.works ⁨4⁩ ⁨days⁩ ago

You can in fact statically type in Python. For example, defining variables:

six: int = 6
hello_world: str = "Hello World!"

Or defining functions:

def foo(x: int) -> int:
    return x**2

If you only want to use static Python, you can use the mypy static checker:

# Install mypy if you don’t have it
pip install mypy

# Run the checker on the file (e.g., example.py)
mypy example.py

source
Sort:hotnewtop