Python Bytes Podcast Por Michael Kennedy and Brian Okken capa

Python Bytes

Python Bytes

De: Michael Kennedy and Brian Okken
Ouça grátis

Sobre este título

Python Bytes is a weekly podcast hosted by Michael Kennedy and Brian Okken. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.Copyright 2016-2025 Política e Governo
Episódios
  • #455 Gilded Python and Beyond
    Oct 27 2025
    Topics covered in this episode: Cyclopts: A CLI library* The future of Python web services looks GIL-free** Free-threaded GC** Polite lazy imports for Python package maintainers*ExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: Cyclopts: A CLI library A CLI library that fixes 13 annoying issues in TyperMuch of Cyclopts was inspired by the excellent Typer library.Despite its popularity, Typer has some traits that I (and others) find less than ideal. Part of this stems from Typer's age, with its first release in late 2019, soon after Python 3.8's release. Because of this, most of its API was initially designed around assigning proxy default values to function parameters. This made the decorated command functions difficult to use outside of Typer. With the introduction of Annotated in python3.9, type-hints were able to be directly annotated, allowing for the removal of these proxy defaults.The 13: Argument vs OptionPositional or Keyword ArgumentsChoicesDefault CommandDocstring ParsingDecorator ParenthesesOptional ListsKeyword Multiple ValuesFlag NegationHelp DefaultsValidationUnion/Optional SupportAdding a Version FlagDocumentation Brian #2: The future of Python web services looks GIL-free Giovanni Barillari“Python 3.14 was released at the beginning of the month. This release was particularly interesting to me because of the improvements on the "free-threaded" variant of the interpreter. Specifically, the two major changes when compared to the free-threaded variant of Python 3.13 are: Free-threaded support now reached phase II, meaning it's no longer considered experimentalThe implementation is now completed, meaning that the workarounds introduced in Python 3.13 to make code sound without the GIL are now gone, and the free-threaded implementation now uses the adaptive interpreter as the GIL enabled variant. These facts, plus additional optimizations make the performance penalty now way better, moving from a 35% penalty to a 5-10% difference.”Lots of benchmark data, both ASGI and WSGILots of great thoughts in the “Final Thoughts” section, including “On asynchronous protocols like ASGI, despite the fact the concurrency model doesn't change that much – we shift from one event loop per process, to one event loop per thread – just the fact we no longer need to scale memory allocations just to use more CPU is a massive improvement. ”“… for everybody out there coding a web application in Python: simplifying the concurrency paradigms and the deployment process of such applications is a good thing.”“… to me the future of Python web services looks GIL-free.” Michael #3: Free-threaded GC The free-threaded build of Python uses a different garbage collector implementation than the default GIL-enabled build.The Default GC: In the standard CPython build, every object that supports garbage collection (like lists or dictionaries) is part of a per-interpreter, doubly-linked list. The list pointers are contained in a PyGC_Head structure.The Free-Threaded GC: Takes a different approach. It scraps the PyGC_Head structure and the linked list entirely. Instead, it allocates these objects from a special memory heap managed by the "mimalloc" library. This allows the GC to find and iterate over all collectible objects using mimalloc's data structures, without needing to link them together manually.The free-threaded GC does NOT support "generations”By marking all objects reachable from these known roots, we can identify a large set of objects that are definitely alive and exclude them from the more expensive cycle-finding part of the GC process.Overall speedup of the free-threaded GC collection is between 2 and 12 times faster than the 3.13 version. Brian #4: Polite lazy imports for Python package maintainers Will McGugan commented on a LI post by Bob Belderbos regarding lazy importing“I'm excited about this PEP. I wrote a lazy loading mechanism for Textual's widgets. Without it, the entire widget library would be imported even if you needed just one widget. Having this as a core language feature would make me very happy.” https://github.com/Textualize/textual/blob/main/src/textual/widgets/__init__.pyWell, I was excited about Will’s example for how to, essentially, allow users of your package to import only the part they need, when they need it.So...
    Exibir mais Exibir menos
    39 minutos
  • #454 It's some form of Elvish
    Oct 20 2025
    Topics covered in this episode: djrest2 - A small and simple REST library for Django based on class-based views.Github CLIcaniscrape - Know before you scrape. Analyze any website's anti-bot protections in seconds.🐴 GittyUpExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Brian #1: djrest2 - A small and simple REST library for Django based on class-based views. Emma LevitBased on an interesting blog post Why, in 2025, do we still need a 3rd party app to write a REST API with Django?As opposed to using DRF or Django Ninja - Michael #2: Github CLI GitHub’s official command line toolFeatures Checking out a pull request locallyYou can clone any repository using OWNER/REPO syntax: gh repo clone cli/cliCreate a pull request interactively: gh pr createSee all at cli.github.com/manual/examples Brian #3: caniscrape - Know before you scrape. Analyze any website's anti-bot protections in seconds. reddit announcement and discussioncaniscrape checks a website for common anti-bot mechanisms and reports: A difficulty score (0–10)Which protections are active (e.g., Cloudflare, Akamai, hCaptcha, etc.)What tools you’ll likely need (headless browsers, proxies, CAPTCHA solvers, etc.)Whether using a scraping API might be better This helps you decide the right scraping approach before you waste time building a bot that keeps getting blocked. Michael #4: 🐴 GittyUp Never forget to pull again: Automatically discover and update all your Git repositories with one command.Built initially to solve this problemRebuilt and published last week as part of my upcoming Agentic AI Programming for Python course. Get notified this week at training.talkpython.fm/getnotifiedUpdate everything in a folder tree with gittyupReview changes, blockers, etc with gittyup --explain Extras Brian: Three times faster with lazy imports - Hugo van KemenadeInteresting discussion on Hugo’s post - on MastodonUse lazy module imports now - Graham DumpletonGraham’s post uses wrapt, a “module for decorators, wrappers and monkey patching”, to simulate lazy importsHelpful comment from Adam Johnson on Graham’s post to actually do the import during type checking using if TYPE_CHECKING: import ... Michael: uvloop is back!pypi+ listened. :) https://www.reddit.com/r/Python/comments/1o9dey5/i_just_released_pypipluscom_20_offlineready/Feedback from my “Show me your ls” post. Joke: Some form of Elvish
    Exibir mais Exibir menos
    29 minutos
  • #453 Python++
    Oct 16 2025
    Topics covered in this episode: * PyPI+** uv-ship - a CLI-tool for shipping with uv** How fast is 3.14?** air - a new web framework built with FastAPI, Starlette, and Pydantic.*ExtrasJokeWatch on YouTube About the show Sponsored by us! Support our work through: Our courses at Talk Python TrainingThe Complete pytest CoursePatreon Supporters Connect with the hosts Michael: @mkennedy@fosstodon.org / @mkennedy.codes (bsky)Brian: @brianokken@fosstodon.org / @brianokken.bsky.socialShow: @pythonbytes@fosstodon.org / @pythonbytes.fm (bsky) Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Monday at 10am PT. Older video versions available there too. Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it. Michael #1: PyPI+ Very nice search and exploration tool for PyPIMinor but annoying bug: content-types ≠ content_types on PyPI+ but they are in Python itself. Minimum Python version seems to be interpreted as max Python version.See dependency graphs and moreExamples content-typesjinja-partialsfastapi-chameleon Brian #2: uv-ship - a CLI-tool for shipping with uv “uv-ship is a lightweight companion to uv that removes the risky parts of cutting a release. It verifies the repo state, bumps your project metadata and optionally refreshes the changelog. It then commits, tags & pushes the result, while giving you the chance to review every step.” Michael #3: How fast is 3.14? by Miguel GrinbergA big focus on threaded vs. non-threaded PythonSome times its faster, other times, it’s slower Brian #4: air - a new web framework built with FastAPI, Starlette, and Pydantic. An very new project in Alpha stage by Daniel & Audrey Felderoy, the “Two Scoops of Django” people.Air Tags are an interesting thing.Also Why? is amazing “Don't use AIR”“Every release could break your code! If you have to ask why you should use it, it's probably not for you.”“If you want to use Air, you can. But we don't recommend it.”“It'll likely infect you, your family, and your codebase with an evil web framework mind virus, , …” Extras Brian: Python 3.15a1 is available uv python install 3.15 already worksPython lazy imports you can use today - one of two blog posts I threatened to write recentlyTesting against Python 3.14 - the other oneFree Threading has some trove classifiers Michael: Blog post about the book: Talk Python in Production book is out! In particular, the extras are interesting.AI Usage TUIShow me your lsHelium Browser is interesting. But also has Python as a big role. GitHub says Languages Python 97.4% 👀Shell 1.9%Other 0.7%Smallest Python release? 3.13.9 Joke: An unforgivable crime
    Exibir mais Exibir menos
    36 minutos
Ainda não há avaliações