The Real Python Podcast

Real Python
undefined
4 snips
Dec 16, 2022 • 1h

Start Using a Build System & Continuous Integration in Python

What advantages can a build system provide for a Python developer? What new skills are required when working with a team of developers? This week on the show, Benjy Weinberger from Toolchain is here to discuss the Pants build system and getting started with continuous integration (CI). Benjy is one of the core developers of the Pants build system. He talks about the software tools and processes that a build system simplifies. We discuss how an individual developer can take advantage of continuous integration. We also cover some of the expectations when moving into professional software development. Have you learned about or started to use tools like linters, code formatters, import sorters, type checkers, and packaging systems? A build system is designed to combine all of those tools into a simplified, one-step process to share your best code. Benjy explains concepts like implementing fine-grained invalidation, moving to a monorepo, and using a build system for data science projects. He also shares his tips for getting started with Pants and finding help within the community. Course Spotlight: Testing Your Code With pytest In this video course, you’ll learn how to take your testing to the next level with pytest. You’ll cover intermediate and advanced pytest features such as fixtures, marks, parameters, and plugins. With pytest, you can make your test suites fast, effective, and less painful to maintain. Topics: 00:00:00 – Introduction 00:03:19 – Working on Pants 00:05:24 – Background on Toolchain 00:08:26 – Individual developer using CI 00:11:04 – When did you start using these types of tools? 00:14:30 – Was the organization open to the development of CI tools? 00:15:45 – Having a foundation with Git 00:17:11 – Moving toward workflows 00:23:30 – Sponsor: InfluxDB 00:24:20 – What’s fine-grained invalidation? 00:29:32 – Setting up test coverage 00:33:07 – Moving into packaging and deployment 00:37:22 – Advantages of a monorepo 00:42:10 – Video Course Spotlight 00:43:36 – Reasons for deeper Python integration 00:47:40 – Using the build system with data science projects 00:52:21 – Getting started with Pants 00:55:47 – What are you excited about in the world of Python? 00:57:12 – What do you want to learn next? 00:58:41 – How can people follow your work online? 00:59:27 – Thanks and goodbye Show Links: Pants 2: The ergonomic build system GitHub - pantsbuild/pants: The Pantsbuild developer workflow system Toolchain Labs E387 Build All the Things with Pants Build System - Talk Python To Me Continuous Integration With Python: An Introduction – Real Python Introduction to Git and GitHub for Python Developers – Real Python Monorepo Explained pex - PyPI pantsbuild/example-python: An example repo to demonstrate Python support The Pants community Christopher Neugebauer - Presentation at PyCon 2022 Talk - Christopher Neugebauer: Fast and reproducible tests, packaging, and deploys with… - YouTube Rust Programming Language Benjy Weinberger (@benjy) / Twitter Pantsbuild (@pantsbuild) / Twitter Level up your Python skills with our expert-led courses: Continuous Integration With Python Testing Your Code With pytest Test-Driven Development With pytest Support the podcast & join our community of Pythonistas
undefined
Dec 9, 2022 • 54min

Package Python Code With pyproject.toml & Listing Files With pathlib

How do you start packaging your code with pyproject.toml? Would you like to join a conversation that gently walks you through setting up your Python projects to share? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects. We discuss a recent code conversation featuring Real Python team members Ian Currie and Geir Arne Hjelle. The video dives into the officially sanctioned way to configure your project using a pyproject.toml file. We cover how this relatively new approach will help you package your code for use on your system or for sharing with others. Christopher shares a Real Python tutorial about using pathlib to get a list of all the files within a directory. We’re both fans of pathlib and how it simplifies working with file paths. The tutorial digs into methods to recursively list all directory contents or create a conditional listing. We share several other articles and projects from the Python community, including an explanation of Python bytecode, an argument for always using [closed, open) intervals, a discussion about building the monolith before microservices, a way to parse natural language time and date expressions, and a project for posting on Mastodon. Course Spotlight: Using Python’s pathlib Module In this video course, you’ll learn how to effectively work with file system paths in Python 3 using the pathlib module in the standard library. Topics: 00:00:00 – Introduction 00:02:30 – Always Use [closed, open) Intervals 00:07:05 – Everyday Project Packaging With pyproject.toml 00:15:38 – Sponsor: InfluxDB 00:16:27 – How to Get a List of All Files in a Directory With Python 00:20:37 – Python Bytecode Explained 00:29:39 – Video Course Spotlight 00:30:48 – Build the Modular Monolith First 00:44:34 – toot - PyPI 00:49:58 – quickadd: Parse Natural Language Time and Date Expressions 00:53:09 – Thanks and goodbye Show Links: Always Use [closed, open) Intervals – “Intervals or ranges pop-up everywhere in the programming world. The classic example is picking a start and end date, like you would when booking an AirBnB or a flight. Have you ever wondered why they are always implemented as [closed, open) as opposed to [closed, closed]?” Everyday Project Packaging With pyproject.toml – In this Code Conversation video course, you’ll learn how to package your everyday projects with pyproject.toml. Playing on the same team as the import system means you can call your project from anywhere, ensure consistent imports, and have one file that’ll work for many build systems. How to Get a List of All Files in a Directory With Python – In this tutorial, you’ll be examining a couple of methods to get a list of files and folders in a directory with Python. You’ll also use both methods to recursively list directory contents. Finally, you’ll examine a situation that pits one method against the other. Python Bytecode Explained – When a Python program is run, the interpreter first parses your code and checks for syntax errors, then it translates it into bytecode instructions. This article explains some of the features of Python bytecode. Discussion: Build the Modular Monolith First – “Even talking about building a monolith today, is a bit taboo. It is all about microservices at the moment, and has been for a few years. But they aren’t a silver bullet.” Coding samples in the article aren’t Python, but the architectural advice is cross-language. Microservices and the First Law of Distributed Objects “I’m convinced that one of the biggest architectural mistakes of the past decade was going full microservice” Jason Warner - Twitter Projects: toot - PyPI quickadd: Parse Natural Language Time and Date Expressions Additional Links: Packaging Your Python Code With pyproject.toml | Complete Code Conversation - YouTube How to Publish an Open-Source Python Package to PyPI – Real Python Publishing Python Packages: Test, share, and automate your projects | Dane Hillard Episode #83: Ready to Publish Your Python Packages? – The Real Python Podcast Advanced Course on Python3 - MoserMichael - GitHub pyasmtool: Explores the Python bytecode, provides some tools to access it for fun and profit. - GitHub Episode #39: Generators, Coroutines, and Learning Python Through Exercises – The Real Python Podcast Episode #47: Unraveling Python’s Syntax to Its Core With Brett Cannon – The Real Python Podcast MVPy: Minimum Viable Python Episode #124: Exploring Recursion in Python With Al Sweigart – The Real Python Podcast Microservices and the First Law of Distributed Objects Mastodon for Python Devs - Talk Python #390 Mastodon is just blogs ActivityPub The Top 239 Activitypub Open Source Projects A 🦣 opportunity for developers - DEV Community 👩‍💻👨‍💻 Getting Started with Mastodon API in Python | Martin Heinz - Medium Christopher Trudeau (@cltrudeau) - Twitter Christopher Bailey | (@digiglean) - Twitter Christopher Bailey (@digiglean@fosstodon.org) - Fosstodon Real Python (@realpython@fosstodon.org) - Fosstodon Level up your Python skills with our expert-led courses: Lists and Tuples in Python Everyday Project Packaging With pyproject.toml Using Python's pathlib Module Support the podcast & join our community of Pythonistas
undefined
5 snips
Dec 2, 2022 • 58min

Preparing Data to Measure True Machine Learning Model Performance

How do you prepare a dataset for machine learning (ML)? How do you go beyond cleaning the data and move toward measuring how the model performs? This week on the show, Jodie Burchell, developer advocate for data science at JetBrains, returns to talk about strategies for better ML model performance. Jodie starts by defining some terms for the conversation. We talk about targets, features, and supervised learning. We discuss three common ways that data can alter model performance and which Python tools can help spot and avoid them. Jodie shares personal experiences of working through these pitfalls. We also share a healthy collection of resources to explore and learn more. Course Spotlight: Combining Data in pandas With concat() and merge() In this video course, you’ll learn two techniques for combining data in pandas: merge() and concat(). Combining Series and DataFrame objects in pandas is a powerful way to gain new insights into your data. Topics: 00:00:00 – Introduction 00:01:46 – Recent conference talks 00:03:24 – How to prepare your data for model performance 00:04:24 – Vocabulary: target, features, and supervised learning 00:06:28 – The curse of dimensionality 00:08:57 – Overfitting 00:11:08 – Underfitting 00:12:11 – Splitting the dataset 00:13:39 – K-fold cross validation 00:18:30 – Data leakage 00:21:36 – Checking for duplicates 00:26:23 – Applying transformations only after splitting data 00:31:16 – Imbalanced data 00:36:36 – Using ML to balance data 00:41:05 – Informing your model of the imbalance 00:42:56 – Video Course Spotlight 00:44:20 – Accuracy used as a measure 00:49:05 – Scikit-learn method classification_table 00:50:43 – Jet Brains blog post and conference talk 00:52:18 – How can people follow your work online? 00:54:39 – Upcoming webinars 00:56:20 – Thanks and goodbye Show Links: How to Prepare Your Dataset for Machine Learning and Analysis - The JetBrains Datalore Blog Curse of dimensionality - Wikipedia Overfitting vs. Underfitting: A Complete Example - Will Koehrsen A Gentle Introduction to k-fold Cross-Validation - MachineLearningMastery.com sklearn.model_selection.train_test_split — scikit-learn documentation Cross-validation: evaluating estimator performance — scikit-learn documentation sklearn.model_selection.cross_val_score — scikit-learn documentation Data Leakage And Its Effect On The Performance of An ML Model pandas.DataFrame.duplicated — pandas documentation pandas GroupBy: Your Guide to Grouping Data in Python – Real Python pandas.DataFrame.groupby — pandas documentation Difference between fit(), transform() and fit_transform() method in Scikit-learn - Aishwarya Chand: Nerd For Tech Imbalanced Data in Machine Learning - Google Developers Under-sampling — imbalanced-learn.org Over-sampling — imbalanced-learn.org Learn - Getting Started with Gretel.ai Classification on imbalanced data: Class weights - TensorFlow Core Tour of Evaluation Metrics for Imbalanced Classification - MachineLearningMastery.com CloudBrew - A two-day conference by AZUG, the Belgium Microsoft Azure User Group Jodie Burchell’s Blog - Standard error Jodie Burchell 🇦🇺🇩🇪 (@t_redactyl) - Twitter Jodie Burchell 🇦🇺🇩🇪 (@t_redactyl@fosstodon.org) - Fosstodon JetBrains: Essential tools for software developers and teams Level up your Python skills with our expert-led courses: Data Cleaning With pandas and NumPy Sneaky REST APIs With Django Ninja Combining Data in pandas With concat() and merge() Support the podcast & join our community of Pythonistas
undefined
24 snips
Nov 25, 2022 • 58min

Building Python REST APIs With Flask & Structuring Pull Requests

How do you build a REST API using the Flask web framework? How can you quickly add endpoints while automatically generating documentation? This week on the show, Real Python author Philipp Acsany is here to discuss his tutorial series “Python REST APIs With Flask, Connexion, and SQLAlchemy.” Christopher Trudeau is also here with another batch of PyCoder’s Weekly articles and projects. Philipp talks about updating a set of tutorials to use current libraries and best practices. The series takes you through building the base Flask project, defining endpoints, creating documentation, adding a persistent database, and implementing models with SQLAlchemy. Christopher shares an article about contributing to an existing internal or open-source project by properly preparing pull requests. The article is titled “Ten Tasty Ingredients for a Delicious Pull Request”. We share several other articles and projects from the Python community, including more suspicious PyPI packages using new tactics, method chaining in pandas, tools to find syntax errors without stopping, a library for searching text in videos using optical character recognition (OCR), a project for visualizing CPython’s specializing adaptive interpreter, and a library for building CLI applications based on type hints. Course Spotlight: The Pandas DataFrame: Working With Data Efficiently In this course, you’ll get started with pandas DataFrames, which are powerful and widely used two-dimensional data structures. You’ll learn how to perform basic operations with data, handle missing values, work with time-series data, and visualize data from a pandas DataFrame. Topics: 00:00:00 – Introduction 00:03:09 – Philipp’s background 00:05:37 – Python REST APIs With Flask, Connexion, and SQLAlchemy 00:14:35 – Ten Tasty Ingredients for a Delicious Pull Request 00:24:25 – Sponsor: InfluxDB 00:25:13 – Method Chaining in Pandas: Bad Form or a Recipe for Success? 00:31:35 – More Suspicious PyPI Packages 00:35:48 – Video Course Spotlight 00:37:01 – What Tools Find Syntax Errors Without Stopping? 00:47:29 – Perform OCR upon entire videos 00:49:49 – Visualize CPython 3.11’s Specializing, Adaptive Interpreter 00:54:08 – Typer, build great CLIs 00:56:29 – Thanks and goodbye Show Links: About Philipp Acsany – Real Python Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 1 Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 2 Python REST APIs With Flask, Connexion, and SQLAlchemy – Part 3 Ten Tasty Ingredients for a Delicious Pull Request – LB is a core team member of the open-source project Wagtail and, as such, has a lot of experience dealing with community contributions. This article talks about how to be a good contributor, whether for your next open-source software (OSS) PR or within your own organization. Method Chaining in Pandas: Bad Form or a Recipe for Success? – Python trainer Matt Harrison has been creating a bit of a stir. Some of his pandas examples have elicited criticism from different folks in the Twitterverse. Dave Amos interviews Matt to discuss the pros and cons of his approach. More Suspicious PyPI Packages – Researchers at Phylum have come across over a dozen new malicious uploads to PyPI. Many of them are copied and pasted versions of legitimate packages that have been renamed and had malicious code inserted. This detailed article shows some of the tactics used by the bad actors. Discussion: What Tools Find Syntax Errors Without Stopping? Projects: videocr: Perform OCR upon entire videos to look for credentials or similar Visualize CPython 3.11’s Specializing, Adaptive Interpreter Typer, build great CLIs Additional Links: What Percentage Of Websites Use WordPress In 2022? “Here’s a recipe to clean up the Ames housing dataset.” Matt Harrison - Twitter Idiomatic Pandas - Matt Harrison | Conf42 Python 2021 - YouTube Episode #103: Becoming More Effective at Manipulating Data With Pandas – The Real Python Podcast Getting started - Polars - User Guide py_compile — Compile Python source files — Python 3.11.0 documentation Build a Command-Line To-Do App With Python and Typer – Real Python Level up your Python skills with our expert-led courses: Deploy Your Python Script on the Web With Flask The pandas DataFrame: Working With Data Efficiently SQLite and SQLAlchemy in Python: Moving Your Data Beyond Flat Files Support the podcast & join our community of Pythonistas
undefined
Nov 18, 2022 • 45min

Moving Projects Away From Passwords With WebAuthn and Python

What if you didn’t have to worry about managing user passwords as a Python developer? That’s where the WebAuthn protocol and new hardware standards are heading. This week on the show, Dan Moore from FusionAuth returns to discuss a password-less future. WebAuthn is a way to authenticate users using biometric, secure authentication methods. Dan dives into passkeys, ceremonies, authenticators, and hardware standards. We also cover several projects and libraries that can help you get started with WebAuthn in Python. Course Spotlight: Refactoring: Prepare Your Code to Get Help In this Code Conversation video course, you’ll explore the steps you can take to get help when you’re stuck while coding. You’ll investigate how to clean up your code to focus on the question you have. Along the way, you’ll learn how to handle errors and use custom exceptions. Topics: 00:00:00 – Introduction 00:01:36 – Dan’s WebAuthn article 00:03:26 – FIDO and WebAuthn 00:05:53 – What’s a YubiKey? 00:07:57 – Phones with biometric systems 00:12:03 – Sponsor: CData Software 00:12:45 – Similarities to HTTPS 00:16:13 – A password-less future 00:24:31 – Where’s it being used? 00:30:53 – Video Course Spotlight 00:32:26 – Python WebAuthn projects and packages 00:34:52 – Does a developer need to set up additional auth methods? 00:37:31 – How are the third-party auth services implementing this? 00:39:50 – What are you excited about in the world of Python? 00:41:24 – What do you want to learn next? 00:43:20 – Thanks and goodbye Show Links: WebAuthn Explained - FusionAuth Episode #99: OAuth 2 and Authentication Choices for Your Python Project – The Real Python Podcast All about FIDO2, CTAP2 and WebAuthn - Microsoft Community Hub YubiKey - Hardware Security Keys Apple Adopts Passwordless Authentication Technology – Hideez 1Password is launching passkey support in early 2023 - The Verge duo-labs/py_webauthn: Pythonic WebAuthn python-webauthn: Server side handlers for WebAuthN with support for Apple’s FaceID, and the FIDO metadata service pywarp - PyPI webauthn-rp documentation Going Passwordless With py_webauthn - Duo Security django-webauth: Two Factor Authentication in Django using Web Authentication API (WebAuthn) django-webauthin - PyPI python-fido2 Python 3.11.0 Release - Python.org Real Food Fermentation by Alex Lewin - Amazon Auth. Built for Devs, by Devs - FusionAuth Level up your Python skills with our expert-led courses: Exploring HTTPS and Cryptography in Python Python Basics: Finding and Fixing Code Bugs Refactoring: Prepare Your Code to Get Help Support the podcast & join our community of Pythonistas
undefined
Nov 11, 2022 • 54min

Creating Tic-Tac-Toe With an AI Player & Shortcuts for Python Decorators

How do you create a computer opponent for a simple game within Python? Would you also like to learn how to adapt the game to run in a web browser or graphical user interface (GUI)? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects. Christopher shares a recent Real Python step-by-step project for creating a tic-tac-toe game engine. He talks about how to build the game engine and adapt it for different front ends. The tutorial also shows how to implement an unbeatable computer player using the minimax algorithm. We discuss an article about how to avoid repeating yourself when creating decorators with multiple parameters. We talk about how you can stop copying and pasting code several times by assigning the decorator to a new variable. We share several other articles and projects from the Python community, including a news roundup, a deep dive into Python’s doctest, several Python command line tricks, type annotations via automated refactoring, a new way to draw boxes in the terminal, a collection of projects for beginners with source code, a minimalist PDF creation library, and a tool for sensible logging in Python. Course Spotlight: Python Decorators 101 In this course on Python decorators, you’ll learn what they are and how to create and use them. Decorators provide a simple syntax for calling higher-order functions in Python. By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it. Topics: 00:00:00 – Introduction 00:02:25 – Python 3.12.0 Alpha 1 Released 00:02:45 – PyCon US 2023 Call for Proposals 00:03:27 – Python’s doctest: Document and Test Your Code at Once 00:13:59 – Build a Tic-Tac-Toe Game Engine With an AI Player in Python 00:22:12 – Sponsor: InfluxDB 00:22:59 – Python Command Line Tricks 00:30:50 – Type Annotation via Automated Refactoring 00:34:29 – A New (?) Way of Drawing Boxes in the Terminal 00:37:10 – Decorator Shortcuts 00:39:36 – Video Course Spotlight 00:41:02 – 190 Python Projects With Source Code 00:47:58 – fpdf2: Minimalist PDF Creation Library 00:50:04 – Simple, Sane, and Sensible Logging in Python 00:53:05 – Thanks and goodbye News: Python 3.12.0 Alpha 1 Released PyCon US 2023 Call for Proposals Topics: Python’s doctest: Document and Test Your Code at Once – In this tutorial, you’ll learn how to add usage examples to your code’s documentation and docstrings and how to use these examples to test your code. To run your usage examples as automated tests, you’ll use Python’s doctest module from the standard library. Build a Tic-Tac-Toe Game Engine With an AI Player in Python – In this step-by-step tutorial, you’ll build a universal game engine in Python with tic-tac-toe rules and two computer players, including an unbeatable AI player using the minimax algorithm. You’ll also create a text-based graphical front end for your library and explore two alternative front ends. Python Command Line Tricks – Using python -m you can do all sorts of things from the command line, including starting a webserver, opening a browser, parsing JSON, compressing files, and much more. Type Annotation via Automated Refactoring – Jimmy’s team at Carta decided they wanted to add type annotations to their large codebase, but doing so manually would’ve taken a very long time. This post shows you how they built automated refactoring tools to add type annotations to their code. A New (?) Way of Drawing Boxes in the Terminal – With clever use of some of the Unicode border characters, you can build a better box around your text, without any color bleeding. Decorator Shortcuts – “When using many decorators in code, there’s a shortcut you can use if you find yourself repeating them. They can be assigned to a variable just like any other Python expression.” Discussion: 190 Python Projects With Source Code Projects: fpdf2: Minimalist PDF Creation Library Simple, Sane, and Sensible Logging in Python – Get started with logging in Python or deploy advanced, flexible loggers without the boilerplate code. Learn all about log2d, a third-party wrapper for the Python logging library. Additional Links: Build Your Python Project Documentation With MkDocs – Real Python Episode #97: Improving Your Django and Python Developer Experience – The Real Python Podcast Python’s zipapp: Build Executable Zip Applications – Real Python Episode #80: Make Your Python App Interactive With a Text User Interface (TUI) – The Real Python Podcast Episode #20: Building PDFs in Python with ReportLab – The Real Python Podcast Links for Documentation FPDF and Other Ports PFython/log2d - GitHub Level up your Python skills with our expert-led courses: How to Work With a PDF in Python Python Inner Functions Python Decorators 101 Support the podcast & join our community of Pythonistas
undefined
Nov 4, 2022 • 1h 2min

Exploring the New Features of Python 3.11

Python 3.11 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to talk about the new version. Geir Arne wrote a series of preview tutorials earlier this year, and his annual piece, titled “Python 3.11: Cool New Features for You to Try,” was published on October 24. Christopher’s video course came out the next day, covering the topics from the tutorial with visual examples of Python 3.11 in action. Geir Arne and Christopher collaborated to create code examples for the new features. We discuss better error messages, faster code execution, task and exception groups, typing features, and native TOML support. We dive into the updates and offer advice about ways to incorporate them into your projects. We also consider when you should start running Python 3.11. Course Spotlight: Cool New Features in Python 3.11 – Real Python In this video course, you’ll explore what Python 3.11 brings to the table. You’ll learn how Python 3.11 is the fastest and most user-friendly version of CPython yet, and learn about improvements to the typing system and to the asynchronous features of Python. Topics: 00:00:00 – Introduction 00:02:19 – Preview series 00:03:50 – Faster CPython project 00:07:10 – Specializing adaptive interpreter 00:11:24 – Other performance stuff 00:16:07 – Sponsor: Deepgram 00:16:51 – Improved tracebacks 00:21:49 – Exception groups and notes 00:27:22 – Self type and additional type hints 00:36:14 – Video Course Spotlight 00:37:27 – asyncio and task groups 00:41:25 – TOML and tomllib 00:46:21 – ISO date parsing 00:50:09 – Negative zeros 00:53:38 – Dead battery deprecations 00:56:04 – Advice on upgrading 01:01:01 – Thanks and goodbye Show Links: Python 3.11: Cool New Features for You to Try – Real Python Cool New Features in Python 3.11 – Video Course faster-cpython/plan.md - GitHub PEP 659 – Specializing Adaptive Interpreter - peps.python.org Just-in-time compilation - Wikipedia Episode #381 Python Perf: Specializing, Adaptive Interpreter - Talk Python To Me Podcast Episode #339 Making Python Faster with Guido and Mark - Talk Python To Me Podcast “Zero cost” exception handling · Issue #84403 · python/cpython - GitHub Python 3.11 Preview: Task and Exception Groups – Real Python Faster Startup In Python 3.11 — Python 3.11.0 documentation Python 3.11 Preview: Even Better Error Messages – Real Python PEP 657 – Include Fine Grained Error Locations in Tracebacks - peps.python.org Episode #105: Creating Better Error Messages for Python 3.10 & 3.11 – The Real Python Podcast Exception Groups and except: Irit Katriel - YouTube PEP 673 – Self Type - peps.python.org PEP 646 – Variadic Generics - peps.python.org How Exception Groups Will Improve Error Handling in AsyncIO - Łukasz Langa | Power IT Conference - YouTube Neopythonic: Reasoning about asyncio.Semaphore PEP 680 – tomllib: Support for Parsing TOML in the Standard Library - peps.python.org TOML: Tom’s Obvious Minimal Language Python 3.11 Preview: TOML and tomllib – Real Python datetime — Basic date and time types — Python 3.11.0 documentation 13 Month Calendar Signed zero - Wikipedia PEP 594 – Removing dead batteries from the standard library - peps.python.org Level up your Python skills with our expert-led courses: Cool New Features in Python 3.10 Cool New Features in Python 3.11 Python Type Checking Support the podcast & join our community of Pythonistas
undefined
Oct 21, 2022 • 1h 9min

Fostering an Internal Python Community & Managing the 3.11 Release

Does your company have a plan for growing an internal Python community? What are the attributes to look for when bringing someone into your department? This week on the show, Pablo Galindo Salgado returns to talk about building community through the Python Guild at Bloomberg and managing the release of Python 3.11. Pablo describes how the Python Guild started and currently operates inside Bloomberg. We talk about how it fosters community and acts as a way to promote internally developed tools across disparate teams. We also discuss how work groups use it to find new internal candidates for their teams. Pablo talks about his role as release manager for Python 3.10 and 3.11. He shares the intense journey the team has had this year in preparing for the release of 3.11. He details updating testing strategies to work with the new specializing adaptive interpreter. Course Spotlight: Python Basics: Strings and String Methods In Python, collections of text are called strings. In this course, you’ll learn about this fundamental data type and the string methods that you can use to manipulate strings. Along the way, you’ll learn ways to work with strings of numbers, and how to format strings for printing. Topics: 00:00:00 – Introduction 00:02:13 – Python Guild inside of Bloomberg 00:13:31 – Finding candidates for the guild from other areas 00:19:11 – Sponsor: Platform.sh 00:19:47 – Considering eagerness to learn and excitement 00:29:44 – Structuring the guild into work groups 00:33:43 – How are things going as release manager? 00:38:25 – Testing for adaptive interpreters 00:44:02 – Working toward the feature freeze 00:50:39 – Changing the parser went smoothly 00:54:34 – Video Course Spotlight 00:55:55 – Where do you find the time? 00:59:51 – How’s the sweep picking coming along? 01:00:33 – What are you excited about in the world of Python? 01:01:29 – What do you want to learn next? 01:07:18 – How can people follow the work you do? 01:08:20 – Thanks and goodbye Show Links: Bloomberg publishes Memray, a new open source memory profiler for Python code - Bloomberg LP bloomberg/memray: Memray is a memory profiler for Python Pluralsight Tech Blog - Guilds at Pluralsight Lessons From Building a Community of Python Users Among Capital One’s Analysts - Capital One PEP 13 – Python Language Governance - peps.python.org Python Insider: Python 3.11.0rc2 is now available What’s New In Python 3.11 — Python 3.11.0rc2 documentation PEP 659 – Specializing Adaptive Interpreter - peps.python.org Andon (manufacturing) - Wikipedia Learn Rust - Rust Programming Language Swift - Apple raywenderlich.com - High quality programming tutorials: iOS, Android, Swift, Kotlin, Flutter, Server Side Swift, Unity, and more! Python Developers Survey 2022 pablogsal (Pablo Galindo Salgado) - GitHub Pablo Galindo Salgado (@pyblogsal) - Twitter Level up your Python skills with our expert-led courses: Python Basics: Strings and String Methods Cool New Features in Python 3.10 Python Basics: Code Your First Python Program Support the podcast & join our community of Pythonistas
undefined
Oct 14, 2022 • 57min

Using an Ellipsis in Python & Goals for CPython 3.12

Where should you use an ellipsis in Python? How does it behave as a placeholder in a script, project, or stub file? What are the next goals for the Faster CPython project? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder’s Weekly articles and projects. We talk about a Real Python article that covers when you should use an ellipsis in Python. We discuss the similarities with the pass keyword and how it’s used for type hints within stub files. Christopher shares resources covering the goals of the Faster CPython project. We’re on the cusp of the release of Python 3.11, but the project keeps moving forward as they look at ways to continue speeding up Python. We share several other articles and projects from the Python community, including a news roundup, alternatives for hosting Python-based applications, ways to create custom Python strings, a discussion about aging programmers, a structural diff that understands syntax, and a project for refurbishing and modernizing Python codebases. Course Spotlight: Providing Multiple Constructors in Your Python Classes In this video course, you’ll learn how to provide multiple constructors in your Python classes. To this end, you’ll learn different techniques, such as checking argument types, using default argument values, writing class methods, and implementing single-dispatch methods. Topics: 00:00:00 – Introduction 00:02:26 – Django security releases issued 00:02:44 – PEP 698: Override Decorator for Static Typing 00:03:37 – Heroku Alternatives for Python-Based Applications 00:14:34 – Python 3.12 Goals: Faster-CPython Ideas Wiki 00:20:29 – Sponsor: InfluxDB 00:21:19 – When Do You Use an Ellipsis in Python? 00:28:18 – Custom Python Strings: Inheriting From str vs UserString 00:32:52 – Aging Programmer 00:46:32 – Video Course Spotlight 00:47:48 – difftastic: A Structural Diff That Understands Syntax 00:50:44 – refurb: Refurbish and Modernize Python Codebases 00:55:44 – Thanks and goodbye News: Django security releases issued: 4.1.2, 4.0.8, and 3.2.16 | Weblog | Django PEP 698: Override Decorator for Static Typing – This Python Enhancement Proposal describes the use of a new decorator, @override, which would be used as a type hint for methods in a subclass that override a parent’s method. This type hint would introduce a level of safety if the parent method is refactored without corresponding changes to the child method. Show Links: Heroku Alternatives for Python-Based Applications – Learn about alternatives to Heroku and their pros and cons. Platforms discussed include Digital Ocean, Google App Engine, AWS, Azure, PythonAnywhere, and half a dozen more. Python 3.12 Goals: Faster-CPython Ideas Wiki – A summary of the goals for the Faster CPython initiative within the Python 3.12 release. Includes trace optimizations, shrinking object sizes, improving memory management overhead, and more. See also the associated Workflow for 3.12 cycle checklist. When Do You Use an Ellipsis in Python? – You may have seen three dots in Python scripts. Although this syntax may look odd, using an ellipsis is valid Python code. In this tutorial, you’ll learn when Python’s Ellipsis constant can come in handy for you. Custom Python Strings: Inheriting From str vs UserString – In this tutorial, you’ll learn how to create custom string-like classes in Python by inheriting from the built-in str class or by subclassing UserString from the collections module. Discussion: Aging Programmer Projects: difftastic: A Structural Diff That Understands Syntax refurb: Refurbish and Modernize Python Codebases Additional Links: Opalstack cookiecutter-python · PyPI typeshed/stubs at master · python/typeshed Why Can’t Programmers.. Program? Level up your Python skills with our expert-led courses: Sneaky REST APIs With Django Ninja Using Multiple Constructors in Your Python Classes Using Python Class Constructors Support the podcast & join our community of Pythonistas
undefined
Oct 7, 2022 • 1h 4min

Using a Memory Profiler in Python & What It Can Teach You

Have you used a memory profiler to gauge the performance of your Python application? Maybe you’re using it to troubleshoot memory issues when loading a large data science project. What could running a profiler show you about a codebase you’re learning? This week on the show, Pablo Galindo Salgado returns to talk about Memray, a powerful tracing memory profiler. Pablo developed Memray while working at Bloomberg to track memory allocations beyond Python code into native extensions and the interpreter itself. It’s a compelling tool that provides fine-grain reports to help you understand where memory is used. Pablo shares the reporting that Memray provides, including live mode, flame graphs, and a pytest plug-in. We also discuss how a tracing memory profiler can help you understand a new codebase. He walks through how he developed the first prototype internally and eventually moved the project into open source. This is the first part of my conversation with Pablo. In a couple of weeks, you’ll get the second part, where we talk about Python guilds inside large companies and his work as the release manager for Python 3.10 and 3.11. Course Spotlight: SQLite and SQLAlchemy in Python: Moving Your Data Beyond Flat Files In this video course, you’ll learn how to store and retrieve data using Python, SQLite, and SQLAlchemy as well as with flat files. Using SQLite with Python brings with it the additional benefit of accessing data with SQL. By adding SQLAlchemy, you can work with data in terms of objects and methods. Topics: 00:00:00 – Introduction 00:02:48 – When should you use a memory profiler? 00:05:13 – Fine-grain reporting 00:13:17 – Sampling profiler vs tracing profiler 00:19:46 – Sponsor: Deepgram 00:20:31 – What is a flame graph? 00:30:36 – Using Rich for terminal reporters 00:40:08 – Currently only Linux and macOS 00:41:13 – pytest plug-in 00:42:03 – Showing native allocation details 00:44:20 – Video Course Spotlight 00:45:52 – Using a profiler to learn a codebase 00:54:39 – Moving from internal project to open source 01:02:17 – Thanks and goodbye Show Links: memray: Memray is a memory profiler for Python - GitHub bloomberg/memray memray - PyPI Bloomberg publishes Memray, a new open source memory profiler for Python code - Bloomberg LP What is a Flame Graph? How it Works & Use Cases - Datadog Gantt chart - Wikipedia py-spy - PyPI scalene - PyPI Reduce your Python program’s memory usage with Fil fil: A Python memory profiler for data processing and scientific computing applications - GitHub pythonspeed/filprofiler Episode #24: Options for Packaging Your Python Application: Wheels, Docker, and More - The Real Python Podcast rich - PyPI Textualize Brendan Gregg Linux perf Examples Deepgram - Speech-to-Text for Developers & Enterprise Level up your Python skills with our expert-led courses: Debugging in Python With pdb SQLite and SQLAlchemy in Python: Moving Your Data Beyond Flat Files Testing Your Code With pytest 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