[–] 6 points 7 months ago (1 child)

Hahaha this is false. I am from the EU, live in the EU, and have travelled all over the EU, and I can categorically and confidently say that there are people this obese in Europe. I have no idea how common this is in the USA, and it probably is way more common than in Europe, but it does happen here too.

  • source
  • parent
  • context
  • [–] 2 points 1 year ago (4 children)

    You just cannot do it, I'm afraid. Python is an interpreted language, and requires de CPython library to be translated into machine code so that it can then be run, but that requires an underlying OS that makes the calls. The closest thing would be micropython, which can be run inside the Linux kernel, but that's about it. The only thing I can think of is using a custom compiler that would generate either C/C++ or assembly code from a Python script, and then compile it using a standard C/C++/assembly compiler.

  • source
  • parent
  • context
  • [–] 4 points 1 year ago (3 children)

    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
  • parent
  • context
  • view more: next β€Ί