Home / Companies / Dagster / Blog / Post Details
Content Deep Dive

Adding Types to a Large Python Codebase

Blog post from Dagster

Post Details
Company
Date Published
Author
Sean Mackesey
Word Count
2,945
Company Posts That Month
5
Language
English
Hacker News Points
3
Post removed?
No
Summary

Python, a popular programming language, faces challenges with dynamic typing at scale. Its lack of support for static analysis and refactoring tools makes it difficult to refactor large codebases. To address this issue, TypeScript, a statically typed variant of JavaScript, has taken the JavaScript world by storm. Similarly, Jukka Lehtosalo's mypy project aimed to bring similar benefits to Python. In 2012, mypy-inspired type annotations became a Python standard with PEP 484 in Python 3.5, and improvements were released in subsequent major versions. Today, there are various mature type-checking tools available for Python, including mypy, pyright, and pyre. These tools consume Python type annotations and are increasingly expected to provide typed public interfaces for libraries. The Dagster project, a large open-source library, has implemented these improvements to enhance development velocity and user experience. By following a 5-step process - configuring a language server, marking published packages with `py.typed`, formalizing public APIs, setting up CI, and annotating code - developers can prioritize fully typed public interfaces. The Dagster project's efforts aim to contribute to the adoption of Python type annotations and associated tooling in the open-source community.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Real-time 2 1,312 394 133 -2%
LLM 1 108 30 17 -17%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.