This summer, JetBrains, Meta, and Microsoft collaborated to conduct a comprehensive survey on the state of Python typing*. The survey aimed to understand how developers in the open source community are using type hints, the challenges they face, and the tools they rely on. Over 1,000 people took the survey and we are delighted to share the findings. Despite the positive typing sentiment, we received fantastic (even if a little biting at times) feedback about the type system. We’ll give a summary of the findings including usage statistics, overall sentiment and takeaways that can improve Python developer tooling.
Overall findings
- 88% of respondents “Always” or “Often” use Types in their Python code.
- IDE tooling, documentation, and catching bugs are drivers for the high adoption of types in survey responses,
- The usability of types and ability to express complex patterns still are challenges that leave some code unchecked.
- Latency in tooling and lack of types in popular libraries are limiting the effectiveness of type checkers.
- Inconsistency in type check implementations and poor discoverability of the documentation create friction in onboarding types into a project and seeking help when using the tools.
Survey methodology
A survey about types is likely to attract a lot of typing enthusiasts, so we don’t take this to be an unbiased nor representative view of everyone in the community. We did our best to distribute to as many developers as possible and aimed for easy-to-understand questions for all skill levels. We created questions that would give a picture of developer profiles, tools, and overall sentiment towards typed Python. Beyond metrics, we wanted to get a sense of the current mood and are thankful for the detailed and candid feedback.
Developer cohorts
As a general purpose language, it was not surprising to see Python types used across many fields. Scripting/automation, web development, data analysis, AI/ML, devOps and teaching all had large representation. One surprising finding was the value Python types are demonstrating outside of collaborative environments. A significant portion of respondents use Python types in personal projects (66% of respondents who only use Python personally “Always” or “Often” use types, compared to 78% of only “Professional” developers) and without CI (29.6% respondents don’t have type checking in CI use types “Always” or “Often”).
IDEs and type checkers
When it comes to development environments, Visual Studio (VS) Code emerged as the most popular choice. The most popular configuration of IDE plus type checker was VS Code with Mypy followed by PyCharm with Mypy. Mypy remains the most popular type checker, with 67% of respondents using it and 38% using Pyright (24% use both). Emacs or NeoVIM also has a strong user base at 11% combined. The community’s preference for both IDE and type checker tooling is still quite varied. While not a static type checker, 62% of developers use Pydantic and 14% only use Pydantic, showing the use of the type system extending into runtime use cases.
What people love
Despite the challenges, developers appreciate the enhanced autocompletion and improved code clarity that type hints provide. “Better IDE Support” was the most useful feature (59%) followed by “Preventing Bugs” (49.8%) and “Documentation” (49.2%). They value the ability to catch potential bugs early and the ease of refactoring code. The optional nature of typing allows for gradual adoption, which many find beneficial.
“It finds real bugs. It often points to design flaws when typing is hard or impossible.”
Common issues with type system documentation and usability
We gave developers the opportunity to provide freeform feedback and saw several issues with the current type system come up repeatedly. The most common concerns are the complexity of the type system of expressing dynamic features (29 responses), the slow performance of type checkers like Mypy (22 responses), and the inconsistencies across different type checkers (21 responses). Lack of clarity in documentation, especially for advanced constructs, was also a pain point (10 responses).
“Numerous libraries lack any type annotations, hindering code analysis and potentially leading to runtime errors.”
“The hoops you sometimes have to jump through to at least somewhat correctly express runtime dynamic features, and even then they are often not correctly covered.”
Why developers don’t use types
Among respondents, 321 (29%) of developers cited the following reasons for not using types in their Python code. The primary reason for not using types is, “Not required for my projects,” which accounted for 11% of total survey responses. Interestingly, among the 321 developers who cited this reason, the majority (60%) still reported using types “Always” or “Often.” This is 28 points below the overall survey average, yet it remains a substantial proportion.
Recommendations for Python language maintainers and tooling authors
Developers are asking for better standardization and consistency across tools. Improving support for dynamic and complex patterns, as well as enhancing runtime type checking, are all key areas for further thought. Better type checker performance was a common pain point cited by developers in all cohorts. Beyond features and performance, the accessibility and discoverability of Python documentation was mentioned numerous times. The Python 3 typing docs were the most popular way for people to learn about types or get help with issues. There was consistent feedback asking for better documentation, particularly for advanced typing features that included examples. “Lack of familiarity” was the second highest reason (8% of all responses) people are not using types. There is an opportunity to improve discoverability and usability of documentation.
Thank you! Let’s do this again!
Thanks to everyone who helped create and share the survey. An extra big thanks for everyone who filled out the survey and gave honest, detailed feedback. We had more responses than expected! It’s encouraging to see so much engagement from the community, and look forward to incorporating the feedback into discussions around the future of Python type checking and tools.
We hope to run the survey again in summer 2025 to see how sentiment changes and the adoption of tooling grows. We have a few ideas for how to improve the survey for next year. We want to ensure that many opinions across the community are heard and that we can capture typing sentiment from folks of different ranges of experience and levels of enthusiasm for typing.
What would you like to see in the survey next year? How can the Python Type System evolve to meet your needs? Join the conversation on discourse. You can also explore the data yourself through this tool and comment below with your insights.
*Based on an online survey conducted among 1,083 people distributed through X, LinkedIn, Reddit,and other social media platforms for targeting Python developers. The research was conducted by Meta, Microsoft and JetBrains. Data was collected between 07/29/2024 and 10/08/2024.