Python Conference APAC 2024

The power of Python's type hints: Case studies focusing on famous libraries
10-26, 13:00–13:30 (Asia/Jakarta), CLASS #2
Language: English

In recent years, Python has been actively enhanced with type hints, with useful features being added with each major update.
In addition, a number of libraries and tools that use type hints have been increased and are popular in the community.

Often when people think of the use of 'typing' in programming languages, the first thing that comes to mind is static analysis to detect type inconsistencies and reduce bugs or run-time errors.
However, the Python ecosystem uses type hints to flesh out various ideas.
Concrete examples include the following

  • FastAPI
    • Automatic generation of API documentation 
    • Dependency Injection
  • Pydantic
    • Data validation
  • SQLAlchemy 2.0
    • Determining data types or constraints in databases

This session will show how these libraries implement the ideas.

I believe that type hints in Python still has a lot of potential.
Through this session, you will be able to use type hints more conveniently and flesh out new ideas by yourself.

I'm Rei Suyama, a software engineer at RevComm.