- GOODIES
- Generator
- Named Tuple
- Modules
-
Type Checking
- APPLICATIONS
- Palindrome
- Word Search
- Conway Game
- Coin Flip
- SCHEDULER
- Time
- Multithreading
- Subprocess
- Logging
- PACKAGES
- Clipboard
- Socket
- Image
- Virtualenv
- Jupyter
- Icecream
- Anytree
- Watchdog
- Itertools
- Pywin32
- Fastapi
- FASTAPI
- Project Structure
- Enable Https
- Unit Testing
- Logging
- Service Wrapper
- Middleware
PYTHON PAGES - LEVEL 2
Type checking
""" Type hints are completely ignored at runtime, exactly like TypeScript types are erased
when compiling to JavaScript.
In VS Code, the TypeScript-like type checker is Pyright,
and it is already built into the default Python extension via Pylance.
At the top of a file add pyright comment (#pyrigh: strict)
Running the Python file will not enforce type hints.
Just like TypeScript, type checking happens before running the code.
"""
""" # pyright: strict
"""
def add(a: int, b: int) -> int:
return a + b
print(add("Hello ", "World"))