Python Byte-Sized Updates: Flask, Async, and Testing

·26m 52s
Shared point

Overview

This episode covers several essential topics for the Python developer community, ranging from open-source educational resources to best practices for web development and testing.

Economic Modeling with Quanticon

Quanticon.org is a NumFocus-sponsored, open-source project dedicated to supporting economic and econometric modeling.
• The platform offers a wealth of high-quality educational materials, including lectures, workshops, and Jupyter notebooks available in both Python and Julia.

Structuring Flask Applications

• Structuring Flask projects properly is crucial as apps grow, preventing issues like circular references.
• Best practices include separating concerns into sub-packages such as models, templates, and services.
• The hosts discuss using Flask Blueprints to keep view code organized and modular, making it easier to test.

Lambda Expressions and Python 3.7 Updates

• Trey Hunter explores the common pitfalls of overusing lambda expressions.
• Key advice: avoid using lambdas for simple function wrapping; instead, use built-in functions or the operator module for better performance.
• Discussion on Python 3.7: New changes to asyncio and the enforcement of async and await as reserved keywords.

"Async and await were valid parameter names in Python 3.5 and 3.6, but they're not in Python 3.7."

Testing and Community Tools

• A deep dive into Anthony Shaw's extensive guide, "Getting Started with Testing in Python," which covers everything from unit vs. integration tests to testing for security flaws.
• Proposal for a new pip thank subcommand to easily support and donate to open-source contributors.
• A fun project titled Hack Your Name that uses Python to generate unique startup names based on Hacker News content.

Topics

Chapters

7 chapters
Python Bytes
AI chat — answers grounded in episodes