Building a Python Debugger & Preparing for NumPy 2.0
Jan 26, 2024
auto_awesome
Christopher Trudeau, Python developer and author, shares a tutorial on building a debugger in Python. They also discuss preparing for changes to NumPy, transitioning from R to Python, and optimizing font files and physical quantities in Python.
Building a debugger in Python requires less code than expected.
The upcoming changes to NumPy will require inspecting project dependencies and updating code.
Deep dives
Building a Debugger in Python
This podcast episode discusses the process of building a debugger from scratch using Python. The speaker emphasizes the simplicity of creating a debugger with less code than expected. They also mention an article about the upcoming changes to NumPy and provide advice for updating code to support the new version. Other articles and projects from the Python community are also shared, including topics like managing advice as a new developer, transitioning from art development to Python, generating readable nonsense with a Markov chain, and optimizing fonts on websites. The episode is sponsored by PositConnect, a data science tool for managing data science publishing.
Creating Readable Nonsense with a Markov Chain
This podcast episode explores using a Markov chain to generate readable nonsense. The speaker explains the concept of a Markov chain and how it can be used to generate text that is closer to being readable than randomly chosen words from a dictionary. They mention a Python implementation of the Markov chain and provide examples of how it can be applied to different texts. The episode highlights the usefulness of such techniques in text prediction and suggests experimenting with different data sets to get different results.
Transitioning from R to Python for Data Science
This podcast episode discusses tips and tools for those transitioning from R to Python for data science. The speaker recommends using tools like PyM for managing Python environments and VS Code as an IDE. They also suggest libraries like Pollers for data analysis and Seaborn for data visualization, which have a similar workflow and feel to those used in R. The episode highlights the importance of learning different programming languages and trying different types of coding early in one's career. It also suggests exploring resources like Julia Evans' talk on making hard things easy to gain new perspectives.
Understanding Debugging and Learning from Advice
In this podcast episode, the importance of using debuggers and learning from advice is discussed. The speaker recommends using debuggers for understanding how code flows and suggests a book titled 'Debugging: The Nine Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems' as a helpful resource. They also provide advice for new developers, including not worrying too much about learning the wrong thing, embracing different coding styles and languages, and taking walks to stimulate creative thinking. The episode emphasizes the changing nature of the field and the need for continuous learning and adaptability.
How does a debugger work? What can you learn about Python by building one from scratch? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
Christopher shares a two-part tutorial on building a debugger in Python? Creating a simple one requires less code than you might think.
We also talk about an article from Itamar Turner-Trauring about how to prepare for the upcoming changes to NumPy. The new version is not backward compatible and will require some inspection of your project dependencies. Itamar includes advice, techniques, and tools for updating your code.
We also share several other articles and projects from the Python community, including a couple of news items, a discussion about managing advice as a new developer, moving to Python as a former R developer, building a Markov chain to generate readable nonsense, optimizing fonts to individual glyphs on your website, and a project for working with units of measurement in Python.
This week’s episode is brought to you by Posit Connect.
In this video course, you’ll create a universal game engine in Python for tic-tac-toe with two computer players, one of which will be an AI player using the powerful minimax algorithm. You’ll give your game library a text-based graphical interface and explore two front ends.
Topics:
00:00:00 – Introduction
00:02:18 – DjangoCon Europe 2024 CFP Now Open
00:02:38 – Python Insider: Python 3.13.0 alpha 3 is now available
00:03:04 – NumPy 2 Is Coming: Preventing Breakage, Updating Your Code
00:07:37 – Using a Markov Chain to Generate Readable Nonsense
00:12:53 – Sponsor: Posit Connect
00:13:43 – Python Rgonomics
00:20:10 – Let’s Create a Python Debugger Together
00:23:49 – Video Course Spotlight
00:25:08 – Advice for New Devs Who’ve Read Other Advice Essays
00:42:44 – Fontimize: Optimize Fonts to the Glyphs on Your Site
Using a Markov Chain to Generate Readable Nonsense – Describes a simple Markov chain algorithm to generate reasonable-sounding but utterly nonsensical text, and presents some example outputs as well as a Python implementation in only 20 lines of code.
Python Rgonomics – If you’re coming to Python from R, this article outlines some libraries that have an R-like feel, helping you make the transition to Pythonic workflows.
Let’s Create a Python Debugger Together – Ever wondered how a debugger works? Implementing a simple one requires less code than you might think. Read on to find out how.