State of Python 2021, Testing Tools, and PyInstrument
Episode Overview
This episode of Python Bytes covers the 2021 JetBrains developer ecosystem survey, highlighting Python's growth and industry usage. The discussion also features practical tools for testing and profiling Python applications, including a farewell to academia and transition into industry.
Key Tools Discussed
• Cornell: A record and replay mock server designed for end-to-end testing, utilizing VCRPy to simplify mock management.
• Factory Boy: A powerful library for mocking complex objects in tests, particularly helpful when working with Pydantic and Faker to generate test data.
• PiInstrument: A high-performance statistical profiler for Python that provides clear, readable output in the terminal, including support for async/await code.
• Time Machine: A library that patches C-level timing calls in Python, solving performance issues often encountered when using Freezegun for mocking datetime.
Notable Insights
"I like coding a lot and I felt at some point that I was enjoying more the coding part of being a physicist than the physics part."
• Developer Trends: While JavaScript remains popular, Python is increasingly adopted for data analysis and general-purpose scripting.
• Security Awareness: A reminder to the community regarding recent malicious packages found in PyPI distributing malware via obfuscated code.
• Python 3.10: Excitement builds for the upcoming 3.10 release, featuring structural pattern matching and improved type hinting syntax.