The Real Python Podcast

Real Python
undefined
Feb 11, 2022 • 50min

Improving Your Django and Python Developer Experience

How often have you thought about your Developer Experience (DX)? How do you improve your workflow, find documentation, and simplify code formatting? This week on the show, Adam Johnson is here to talk about his new book, “Boost Your Django DX.” Adam provides advice on improving your developer experience, specifically inside Django and within Python. We discuss tools to simplify code formatting and linting. Adam shares a couple of his own Django tools designed to simplify development and keep your projects updated. He also covers documentation resources for finding answers quickly. Course Spotlight: Django View Authorization: Restricting Access This course covers how to restrict your web pages to users with different roles through Django view authorization. You’ll learn about HttpRequest.user objects, decorators that authenticate views, and ways to notify your users with the Django messages framework. Topics: 00:00:00 – Introduction 00:01:53 – The Django Project Technical Board 00:04:08 – Change in the release cadence for Django 00:06:08 – Kaizen, continous improvement, and helping others improve 00:10:23 – Common ways to improve developer experience 00:14:06 – Sponsor: Scout APM 00:14:54 – Developer documentation tools 00:20:24 – Bang shortcuts when searching with DuckDuckGo 00:22:37 – Who is the intended audience for the book? 00:23:33 – Managing secrets and giving general advice 00:26:49 – Writing books to fill in the gaps 00:29:12 – Video Course Spotlight 00:30:24 – Topics for the blog, favicons, and type hints 00:39:22 – What are your recent Django-related projects? 00:42:05 – Sources for Django news 00:45:01 – What are you excited about in the world of Python? 00:45:59 – What do you want to learn next? 00:47:43 – Shout-outs and social connections 00:48:43 – Thanks and goodbye Show Links: Adam Johnson’s Home Page Boost Your Django DX “Boost Your Django DX” Released - Adam Johnson Django Software Foundation | Django Kaizen - Wikipedia black: The Uncompromising Code Formatter · PyPI isort: isort your imports, so you don’t have to. Flake8: Your Tool For Style Guide Enforcement — flake8 4.0.1 documentation DevDocs API Documentation DuckDuckGo !Bang Django Chat | Adam Johnson - Boost Your Django DX Podcast.__init__ - Improve Your Productivity By Investing In Developer Experience How to Add a Favicon to Your Django Site - Adam Johnson Favicon Generator for perfect icons on all browsers Introducing django-browser-reload: Automatically Reload Your Browser in Development - Adam Johnson django-browser-reload · PyPI django-upgrade · PyPI pyupgrade · PyPI Django News Learn more about Ableton Push | Ableton Level up your Python skills with our expert-led courses: Django View Authorization: Restricting Access Host Your Django Project on Heroku How to Set Up a Django Project Support the podcast & join our community of Pythonistas
undefined
Feb 4, 2022 • 59min

Manipulating and Analyzing Audio in Python

Would you like to experiment with analyzing or manipulating audio with Python? This week on the show, we have Braden Riggs from DolbyIO to discuss extracting audio features and Python libraries for reshaping audio. Braden shares techniques from his recent talk at PyData Global, “Unlocking More From Your Audio Data!” We share several articles, tutorials, and Python libraries to get you started working with audio. We begin with a quick introduction to audio digitization and feature extraction. After discussing modifying audio files, we share tools and techniques for exploring audio analysis through data science. Braden talks about speech-to-text conversion, sentiment analysis, and Natural Language Toolkit (NLTK). He also shares a valuable collection of audio technology resources for developers. Course Spotlight: Playing and Recording Sound in Python In this course, you’ll learn about libraries that can be used for playing and recording sound in Python, such as PyAudio and python-sounddevice. You’ll also see code snippets for playing and recording sound files and arrays, as well as for converting between different sound file formats. Topics: 00:00:00 – Introduction 00:02:46 – What is Dolby IO? 00:05:08 – Audio and data science background 00:08:17 – Digital audio basics 00:12:07 – Audio feature extraction 00:18:31 – Sponsor: Snyk - The Big Fix 00:19:17 – PyAudioAnalysis and processing audio files with Python 00:26:16 – Feature extraction and audio analysis talk at PyData Global 00:32:33 – Jupyter notebook of presentation and DolbyIO awesome audio list 00:34:13 – librosa - package for music analysis 00:37:55 – Video Course Spotlight 00:39:11 – Speech to text and NLTK 00:54:28 – What are you excited about in the world of Python? 00:55:49 – What do you want to learn next? 00:56:53 – Shout outs and social connections 00:58:04 – Thanks and goodbye Show Links: Dolby.io - High-fidelity Audio and Video For All Digital Audio Basics: Audio Sample Rate and Bit Depth Audio Feature Extraction pyAudioAnalysis Wiki Audio Handling Basics: Process Audio Files In Command-Line or Python | HackerNoon pydub: Manipulate audio with a simple and easy high level interface FFmpeg: Complete, cross-platform solution to record, convert and stream audio and video Improving Automated Ad Insertion with Audio Analysis at PyData Global 2021 - Dolby.io Demo notebooks presented at PyData Global 2021 for “Unlocking more from your audio data” librosa: Python package for music and audio analysis NLTK: The Natural Language Toolkit Documentation Natural Language Processing With Python’s NLTK Package – Real Python DolbyIO/awesome-audio: A curated list of awesome audio technology resources for developers PyConDE & PyData Berlin 2022 | PyCon.DE & PyData Berlin, 2022 Vue.js Flutter - Build apps for any screen Level up your Python skills with our expert-led courses: Learn Text Classification With Python and Keras The pandas DataFrame: Working With Data Efficiently Playing and Recording Sound in Python Support the podcast & join our community of Pythonistas
undefined
Jan 28, 2022 • 1h 7min

What Is a JIT and How Can Pyjion Speed Up Your Python?

How can you can speed up Python? Have you thought of using a JIT (Just-In-Time Compiler)? This week on the show, we have Real Python author and previous guest Anthony Shaw to talk about his project Pyjion, a drop-in JIT compiler for CPython 3.10. Anthony has been working on Pyjion over the past year and recently released version 1.0. He talks about how he took over the project from Brett Cannon and Dino Viehland. He covers the background on compilers and assembly that he needed to take on this project. We discuss where a tool like this can speed up your Python code, and we consider alternative solutions. We also talk about his desire to make the project as deeply compatible with Python code as possible. Anthony talks about how his dive into writing the CPython Internals book led him into the project. We talk about what type of developer would benefit from exploring the book. We also cover his recent Real Python article, titled “Advanced Visual Studio Code for Python Developers.” It’s an excellent resource that VS Code users should bookmark to revisit as they grow with the tool. Spotlight: CPython Internals Book: Your Guided Tour Through the Python 3 Interpreter Unlock the inner workings of the Python language, compile the Python interpreter from source code, and participate in the development of CPython. Topics: 00:00:00 – Introduction 00:02:15 – Cloud Developer Advocate at Microsoft 00:04:57 – Pyjion, a drop-in JIT compiler for CPython 00:07:52 – PyCon 2020 & 2021 talks and wanting to take on the project 00:12:46 – How Pyjion uses .NET 6 00:17:32 – Trying out Pyjion functionality online 00:21:43 – Sponsor: Honeybadger 00:22:28 – Portability of projects using Pyjion 00:29:55 – Focus on compatibility with Python code 00:33:07 – Choosing to make it based on Python 3.10 00:37:45 – What would be prerequisites to work on the project? 00:40:40 – Other ways to help with project 00:44:34 – CPython Internals: Who is the book for? 00:49:46 – What resources do you need to work through the book? 00:52:04 – Spotlight: CPython Internals Book 00:53:21 – Do you use an IDE or code editor? 00:56:12 – Why did you decide to write the book? 00:57:12 – Advanced Visual Studio Code for Python Developers 01:03:20 – What are you excited about in the world of Python? 01:04:03 – What do you want to learn next? 01:05:33 – Thanks and goodbye Show Links: Pyjion - A JIT for Python based upon CoreCLR Pyjion main documentation live.trypyjion.com Anthony Shaw - Why is Python slow? - YouTube Restarting Pyjion, a general purpose JIT for Python- is it worth it? - YouTube Common Language Runtime (CLR) overview - .NET | Microsoft Docs Writing Python Extensions in Assembly Beginning x64 Assembly Programming | SpringerLink Pyston | Python Performance PyPy facebookincubator/cinder: Instagram’s performance oriented fork of CPython. Welcome to Hypothesis! — Hypothesis 6.36.0 documentation CPython Internals Book – Real Python Advanced Visual Studio Code for Python Developers – Real Python vscode-pets: Adds playful pets 🦀🐱🐶 in your VS Code window What’s New In Python 3.11 — Python 3.11.0a4 documentation Compilers: Principles, Techniques, and Tools (Dragon Book) Level up your Python skills with our expert-led courses: Finding the Perfect Python Code Editor Debugging in Python With pdb Looping With Python enumerate() Support the podcast & join our community of Pythonistas
undefined
Jan 21, 2022 • 59min

Designing for Users and Building a Social Network With Django

Are you looking for a project to practice your Django skills? Designing the fundamental interactions of a social network is an instructive way to explore models and relationships while learning advanced Django skills. This week on the show, we talk with previous guest Martin Breuss about his new four-part series, “Build a Social Network With Django”. Martin talks about the design process and ways to include user-focused features. He shares a handy CSS library to make your front end look modern with minimal effort. We digress into a discussion of personal vs professional use of social networks. We also talk about the additional Real Python resources to help you build out the rest of your project. Course Spotlight: How to Set Up a Django Project In this course, you’ll learn the necessary steps that you’ll need to take to set up a new Django project. You’ll learn the basic setup for any new Django project, which needs to happen before programming the specific functionality of your project. Topics: 00:00:00 – Introduction 00:01:46 – Build a Social Network with Django series 00:04:05 – Setting project scope and constraints 00:09:09 – Why use Django for this project? 00:12:23 – Learning through errors 00:15:29 – Sponsor: Honeybadger 00:16:14 – Models and relationships 00:19:05 – Implementing a post-save hook 00:23:17 – Django front end with the Bulma CSS framework 00:28:42 – Templates and profile pages 00:31:03 – Following, posts, and thoughts on user-centric features 00:37:18 – Personal and professional use of social media 00:48:03 – Setting up redirects 00:49:08 – Video Course Spotlight 00:50:19 – Additional Real Python resources for Django, including a Learning Path 00:53:07 – What would you add if this were a portfolio project? 00:54:14 – What are you excited about in the world of Python? 00:56:36 – What do you want to learn next? 00:57:54 – Thanks and goodbye Show Links: Build a Social Network With Django – Part 1 – Real Python Build a Django Front End With Bulma – Part 2 – Real Python Build and Handle POST Requests in Django – Part 3 – Real Python Build and Submit HTML Forms With Django – Part 4 – Real Python Django for Web Development (Learning Path) – Real Python Episode #87: Building a Content Aggregator and Working With RSS in Python – The Real Python Podcast Episode #4: Learning Python Through Errors – The Real Python Podcast The Flask Mega-Tutorial Part I: Hello, World! - miguelgrinberg.com Bulma: Free, open source, and modern CSS framework based on Flexbox Writing your first Django app, part 1 | Django documentation Get Started With Django Part 1: Build a Portfolio App – Real Python Get Started With Django Part 2: Django User Management – Real Python Tweetbot 6 for iOS 300-page iPhone bill - Wikipedia ArcGIS API for Python | ArcGIS Developer Level up your Python skills with our expert-led courses: Getting Started With Django: Building a Portfolio App Host Your Django Project on Heroku How to Set Up a Django Project Support the podcast & join our community of Pythonistas
undefined
Jan 14, 2022 • 51min

Launching Python, Virtual Environments, and Locking Dependencies With Brett Cannon

Would you like a simple command to launch your Python programs using the newest version of the language installed on your machine? This week on the show, we continue our conversation with Brett Cannon. Brett discusses his project, the Python Launcher for Unix. We dive into Brett’s workflow to set up projects, virtual environments, and prepare for distribution. He shares some of the tools he employs and reasons for keeping things simple. We also talk about PEP 665, which specifies a file format to list an application’s Python package installation requirements. Brett shares why he co-authored the PEP and a bit of the community’s reaction. It leads to a deeper conversation about going beyond ‘requirements.txt’ to lock files. Course Spotlight: Data Visualization Interfaces in Python With Dash In this course, you’ll learn how to build a dashboard using Python and Dash. Dash is a framework for building data visualization interfaces. It helps data scientists build fully interactive web applications quickly. Topics: 00:00:00 – Introduction 00:01:43 – Python Launcher for Unix 00:09:36 – Hiding a virtual environment directory 00:13:30 – Sponsor: Scout APM 00:14:17 – Environment managers and being an editor vs an IDE person 00:17:32 – PEP 665, lock files, and Brett’s dependency workflow 00:20:56 – The hurdles of source distributions and version control repositories 00:25:07 – Drawbacks of requirements files and standardizing lock files 00:28:19 – Why PEP 665 is controversial and the changes to setuptools 00:33:48 – Video Course Spotlight 00:35:16 – Are these examples of growing pains? 00:37:51 – Unfair comparisons to packaging in Rust or other languages 00:42:35 – What are you excited about in the world of Python? 00:43:54 – What do you want to learn next? 00:49:23 – Thanks and goodbye Show Links: Introducing the Python Launcher for Unix brettcannon/python-launcher: Python launcher for Unix Python Extension for VSCode Why use Flit? — Flit 3.5.1 documentation pip-tools: A set of tools to keep your pinned Python dependencies fresh. PEP 665 – A file format to list Python dependencies for reproducibility of an application | Python.org venv — Creation of virtual environments — Python 3.10.1 documentation virtualenvwrapper · PyPI pdm - Python Development Master · PyPI pyflow - Streamlines working with Python projects and files · PyPI pipenv · PyPI Thoughts on where tools fit into a workflow What to do when you botch a release on PyPI Python Virtual Environments: A Primer – Real Python Why you shouldn’t invoke setup.py directly | Paul Ganssle python-wasm: Build scripts and configuration for building CPython for Emscripten Pyodide — A Python distribution for the browser and Node.js based on WebAssembly WebAssembly Programming Rust, 2nd Edition Brett Cannon on Twitter: “PEP 665 got rejected today 😞” Level up your Python skills with our expert-led courses: A Beginner's Guide to pip Data Visualization Interfaces in Python With Dash Working With Pipenv Support the podcast & join our community of Pythonistas
undefined
Jan 7, 2022 • 59min

Continuing to Unravel Python's Syntactic Sugar With Brett Cannon

A year ago, we had Brett Cannon on the show to discuss his blog series about unravelling Python’s syntactic sugar. Brett has written 15 more entries in the series, and he returns to the show this week to continue our conversation. We dive into unravelling ‘async’ and ‘await’ statements and their relationship with Python’s generators. While working through the series, he has uncovered some issues lying under the surface of CPython. We discuss a couple of these discoveries and how the core developers resolved them. Brett was recently re-elected to the Python Steering Council, and he talks about how the current direction of the council is shifting. We also discuss how Brett uses Twitter polls to gauge community sentiment and factors it into development decisions. This conversation covered so many topics that we split it into two episodes. Next week’s episode will continue our discussion. Course Spotlight: Speed Up Python With Concurrency Learn what concurrency means in Python and why you might want to use it. You’ll see a simple, non-concurrent approach and then look into why you’d want threading, asyncio, or multiprocessing. Topics: 00:00:00 – Introduction 00:01:54 – Python Steering Council Reelection 00:06:06 – Python Extension for VSCode and the Language Server Protocol (LSP) 00:10:38 – Using twitter polls to gauge sentiment 00:19:19 – Sponsor: Honeybadger 00:20:04 – Unravelling Python’s syntactic sugar series 00:25:30 – The desugar GitHub repo and unearthing problems in CPython 00:29:48 – Why have __iter__() for an iterator? 00:32:47 – Is discovering and showcasing these “issues” stressful? 00:35:19 – A reverse chronology of some Python features 00:38:34 – How the heck does async/await work in Python 00:51:29 – Video Course Spotlight 00:52:54 – Using “spam” vs “foo” and metasyntactic variables 00:57:30 – Goodbye Show Links: 2022 Python Steering Council Election Results - Python.org Official Page for Language Server Protocol Brett Cannon on Twitter: “If I were creating a protocol/interface for a spammy object, what naming convention would you expect?” Episode #88: Discussing Type Hints, Protocols, and Ducks in Python – The Real Python Podcast Brett Cannon - Twitter Poll: “Which of these ‘pip install’ flags to you usually specify?” Episode #47: Unraveling Python’s Syntax to Its Core With Brett Cannon – The Real Python Podcast Unravelling ‘break’ and ‘continue’ Unravelling ‘for’ statements GitHub - brettcannon/desugar: Unravelling Python source code A reverse chronology of some Python features What Color is Your Function? – journal.stuffwithstuff.com Unravelling ‘async’ and ‘await’ How the heck does async/await work in Python 3.5? Episode #39: Generators, Coroutines, and Learning Python Through Exercises – The Real Python Podcast How to Use Generators and yield in Python – Real Python Async IO in Python: A Complete Walkthrough – Real Python Level up your Python skills with our expert-led courses: For Loops in Python (Definite Iteration) Python Generators 101 Speed Up Python With Concurrency Support the podcast & join our community of Pythonistas
undefined
Dec 24, 2021 • 1h 4min

2021 Real Python Articles Wrap Up

It’s been a year of change at Real Python! The Real Python team has written, edited, curated, illustrated, and produced a mountain of Python articles this year. We also added many new members to the team, updated the site’s features, and created new styles of tutorials and projects. Two members of the Real Python team join us this week, Martin Breuss and Sadie Parker. We wanted to share a year-end wrap-up with a collection of articles and step-by-step projects that showcase what our team created this year. Sadie and Martin help to shepherd articles through the multi-stage editing process. Along with the rest of the team, they make sure these resources impart crucial Python knowledge and provide a thorough didactic experience. We hope you enjoy this review! Programming note, there won’t be an episode next week, but we will be back in January and look forward to bringing you a year full of great guests, articles, and topics. Course Spotlight: Using Pygame to Build an Asteroids Game in Python In this course, you’ll learn the basics of creating powerful web applications with In this course, you’ll build a clone of the Asteroids game in Python using Pygame. Step by step, you’ll add images, input handling, game logic, sounds, and text to your program. Topics: 00:00:00 – Introduction 00:02:24 – Changes at Real Python Over 2021 00:10:11 – Build a Platform Game in Python With Arcade 00:13:40 – Make Your First Python Game: Rock, Paper, Scissors! 00:20:00 – Build a Content Aggregator in Python 00:25:30 – Video Course Spotlight 00:26:45 – Python Inner Functions: What Are They Good For? 00:30:44 – Build a Personal Diary With Django and Python 00:34:14 – Hosting a Django Project on Heroku 00:42:00 – Python & APIs: A Winning Combo for Reading Public Data 00:46:03 – Beautiful Soup: Build a Web Scraper With Python 00:52:25 – Advanced Visual Studio Code for Python Developers 00:59:55 – A Few Special Mentions, Data Science, and More 01:02:33 – Thanks and goodbye Show Links: Build a Platform Game in Python With Arcade – Real Python Make Your First Python Game: Rock, Paper, Scissors! – Real Python Build a Content Aggregator in Python – Real Python Python Inner Functions: What Are They Good For? – Real Python Build a Personal Diary With Django and Python – Real Python Hosting a Django Project on Heroku – Real Python Python & APIs: A Winning Combo for Reading Public Data – Real Python Beautiful Soup: Build a Web Scraper With Python – Real Python Advanced Visual Studio Code for Python Developers – Real Python Python AI: How to Build a Neural Network & Make Predictions – Real Python Stochastic Gradient Descent Algorithm With Python and NumPy – Real Python Prettify Your Data Structures With Pretty Print in Python – Real Python Additional Links: Episode #60: Building a Platform Game With Arcade and Covering Python News Monthly – The Real Python Podcast The Python Arcade Library Arcade: A Primer on the Python Game Framework Rock, Paper, Scissors With Python: A Command Line Game – Video Course Build an Asteroids Game With Python and Pygame – Real Python Godot Engine - Free and open source 2D and 3D game engine Episode #87: Building a Content Aggregator and Working With RSS in Python – The Real Python Podcast Python Inner Functions – Video Course Host Your Django Project on Heroku – Video Course Finding the Perfect Python Code Editor – Video Course Episode #12: Web Scraping in Python: Tools, Techniques, and Legality – The Real Python Podcast Web Scraping With Beautiful Soup and Python – Video Course Level up your Python skills with our expert-led courses: Using Pygame to Build an Asteroids Game in Python Host Your Django Project on Heroku Web Scraping With Beautiful Soup and Python Support the podcast & join our community of Pythonistas
undefined
Dec 17, 2021 • 54min

A Python Journey: Cyber Security, Automating AWS, and TDD

The Python community continually grows, with many users coming from different languages and backgrounds. This week on the show, we talk with developer Hugh Tipping about his Python journey. Hugh is also a member of the Real Python community. Hugh has a background in programming C and Perl and started to use Python in a cyber security job. He explains the way he used Python to search for malware. Hugh provides some suggestions for security packages and tools. Recently Hugh has been working with Amazon Web Services (AWS) and using the Boto3 library to automate services and manage credentials. We also discuss his affinity for test-driven development and the use of pytest. Course Spotlight: Host Your Django Project on Heroku In this course, you’ll learn how to host your Django project in the cloud for free and with little hassle. You’ll use Heroku, which takes the burden of infrastructure management off your shoulders. Topics: 00:00:00 – Introduction 00:01:44 – How did you get introduced to Python? 00:05:52 – What types of tasks were you doing in cyber security? 00:10:21 – Why do you think Python is popular for cyber security? 00:14:57 – Python libraries to check for security vulnerabilities 00:18:07 – Sponsor: Cloudsmith 00:18:52 – Boto3 for managing AWS with Python 00:25:21 – What is your background with test-driven development? 00:33:58 – Video Course Spotlight 00:35:22 – Finding Real Python and learning about Python tools 00:41:42 – Getting involved in the Real Python community 00:45:45 – What are excited about in the world of Python? 00:47:32 – What do you want to learn next? 00:53:14 – Thanks and goodbye Show Links: An Introduction to the PyCQA — PyCQA Meta Documentation 1.0 documentation bandit · PyPI safety · PyPI Anchore • Container Security Solutions For DevSecOps Snyk | Develop fast. Stay secure. Single sign-on - Wikipedia Developer guide — Boto3 Docs 1.20.24 documentation AWS Developer Center | Python Tutorials, APIs, SDKs, Docs What is Apache Kafka? | AWS Test-driven development - Wikipedia pytest: helps you write better programs — pytest documentation Effective Python Testing With Pytest – Real Python Build a Content Aggregator in Python – Real Python pyenv/pyenv: Simple Python version management Managing Multiple Python Versions With pyenv – Real Python Poetry - Python dependency management and packaging made easy boltons — boltons 21.0.0 documentation Join the Real Python Community Slack – Real Python Level up your Python skills with our expert-led courses: Test-Driven Development With pytest Start Managing Multiple Python Versions With pyenv Host Your Django Project on Heroku Support the podcast & join our community of Pythonistas
undefined
Dec 10, 2021 • 57min

Solving Advent of Code Puzzles With Python

Are you ready to break open the first days of puzzles from the annual Advent of Code challenge? Advent of Code is an advent calendar of twenty-five programming puzzles published each December. Practicing solving puzzles is a great way to build your Python skills. This week on the show, we have previous guest and Real Python author Geir Arne Hjelle to discuss his recent article titled, “Advent of Code: Solving Your Puzzles With Python.” We discuss the history of this online Advent calendar and the creator Eric Wastl. Geir Arne covers techniques to help you organize your code and test when solving the puzzles. He shares additional Python tools for parsing text, managing puzzle data, and visualizing your program output. We also talk about even more places you can practice solving programming puzzles. Course Spotlight: Regular Expressions and Building Regexes in Python In this course, you’ll learn how to perform more complex string pattern matching using regular expressions, or regexes, in Python. You’ll also explore more advanced regex tools and techniques that are available in Python. Topics: 00:00:00 – Introduction 00:02:03 – Geir Arne’s new full-time role at Real Python 00:02:55 – Advent of Code: Solving Your Puzzles With Python 00:09:25 – Using different languages to solve the puzzles 00:12:21 – Different ways to approach the problems 00:16:31 – Sponsor: CData Software 00:17:12 – Organizing your code into reusable functions 00:19:38 – Unique user source data and managing puzzle data 00:24:40 – Additional Python tools that might be useful 00:31:13 – Video Course Spotlight 00:32:42 – Ways to enhance code output and visualization 00:34:50 – Leaderboards 00:37:52 – Real Python office hours discussion of Advent of Code 00:39:30 – Additional resources to practice solving puzzles with Python 00:50:15 – Supporting Advent of Code 00:50:40 – What are you excited about in the world of Python? 00:51:59 – What do you want to learn next? 00:55:52 – Thanks and goodbye Show Links: About Geir Arne Hjelle – Real Python Advent of Code: Solving Your Puzzles With Python – Real Python Advent of Code: Solving Puzzles With Python - Real Python Advent of Code 2021 Python Community Interview With Eric Wastl – Real Python Eric Wastl - Advent of Code: Behind The Scenes - Leetspeak 2019 - YouTube r/adventofcode: Visualizations - reddit.com About - Project Euler Exercism: 55 languages for you to master Codewars - Achieve mastery through coding practice and developer mentorship HackerRank TwilioQuest - Discover your power to change the world with code. Data Puzzles: Sharpen your Data Science skills makersacademy/clmystery: Command Line Murder Mystery Learn VIM while playing a game - VIM Adventures Support AoC - Advent of Code 2021 The Elixir programming language Live stream with José Valim, creator of Elixir, solving AoC - josevalim - Twitch Numerical Elixir (Nx) Level up your Python skills with our expert-led courses: Regular Expressions and Building Regexes in Python Test-Driven Development With pytest Strings and Character Data in Python Support the podcast & join our community of Pythonistas
undefined
Dec 3, 2021 • 1h 21min

Discussing Type Hints, Protocols, and Ducks in Python

There seem to be three kinds of Python developers: those unaware of type hints or have no opinion, ones that embrace them, and others who have an allergic reaction at the mention of them. Python is famously a dynamically typed language, but there are advantages to adding type hints to your code. This week on the show, we have Luciano Ramalho to discuss his recent talk titled, “Type hints, protocols, and good sense.” Luciano was not a fan of type hints. He’s only recently come around to their potential with the introduction of protocols in PEP 544. Python has adopted a gradual type system that is optional at all levels. We discuss the advantages, pitfalls, and recent developments around type hinting in Python. We also talk about the second edition of Luciano’s book Fluent Python. He researched type hints in-depth for the book, which led to his recent conference talks on the subject. He also shares his experience with adding opinionated asides to the book in a fun and unique way. Course Spotlight: Python Type Checking In this course, you’ll look at Python type checking. Traditionally, types have been handled by the Python interpreter in a flexible but implicit way. Recent versions of Python allow you to specify explicit type hints that can be used by different tools to help you develop your code more efficiently. Topics: 00:00:00 – Introduction 00:02:02 – Are you interested in creative uses for Python? 00:04:41 – Protocol: The keystone of type hints 00:08:14 – What is duck typing? 00:12:44 – Protocols declaring one method and emerging from a code base 00:17:04 – An example where type hint was too lax 00:21:20 – What if Python always had a strict type system? 00:33:23 – Sponsor: Cloudsmith 00:34:09 – Bias in companies using type hints, and projects that fail checking 00:40:27 – Background on personal use of type hints and added complexity 00:45:07 – Unsuitability of type hints for checking business rules 00:52:30 – Video Course Spotlight 00:53:46 – Fluent Python, 2nd edition 00:56:05 – Who is the intended developer for the book? 00:58:12 – Soapbox sections of the book 00:59:35 – What were things you were excited to update or add to the book? 01:05:46 – Metaprogramming portion of the book 01:08:17 – What are you excited about in the world of Python? 01:10:35 – What do you want to learn next? 01:18:41 – Shoutouts, plugs, and/or social connections 01:19:47 – Thanks and goodbye Show Links: Fluent Python, 2nd Edition Protocol: The keystone of type hints - Luciano Ramalho | PyCon US 2021 Type hints, protocols, and good sense: PyCon India 2021 - Speaker Deck Generate buzz with realtime FM audio synthesis - Łukasz Langa | PyCon US 2021 Garoa Hacker Clube Processing.py - Tutorials PEP 544 – Protocols: Structural subtyping (static duck typing) | Python.org typeshed: Collection of library stubs for Python, with static types Python Type Checking (Guide) – Real Python Protocols and structural subtyping — Mypy documentation Dependent type - Wikipedia microsoft/pyright: Static type checker for Python Welcome to mypy documentation! PEP 487 – Simpler customisation of class creation | Python.org PEP 636 – Structural Pattern Matching: Tutorial | Python.org What’s New In Python 3.10 — Better error messages Flutter - Build apps for any screen Ramalho.org/wiki Luciano Ramalho Twitter(@ramalhoorg) Level up your Python skills with our expert-led courses: Using Pygame to Build an Asteroids Game in Python Records and Sets: Selecting the Ideal Data Structure Python Type Checking Support the podcast & join our community of Pythonistas

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app