#448 I'm Getting the BIOS Flavor cover art

#448 I'm Getting the BIOS Flavor

#448 I'm Getting the BIOS Flavor

Listen for free

View show details

About this listen

Topics covered in this episode: * prek** tinyio** The power of Python’s print function** Vibe Coding Fiasco: AI Agent Goes Rogue, Deletes Company's Entire Database*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. Brian #1: prek Suggested by Owen Lamont“prek is a reimagined version of pre-commit, built in Rust. It is designed to be a faster, dependency-free and drop-in alternative for it, while also providing some additional long-requested features.”Some cool new features No need to install Python or any other runtime, just download a single binary.No hassle with your Python version or virtual environments, prek automatically installs the required Python version and creates a virtual environment for you.Built-in support for workspaces (or monorepos), each subproject can have its own .pre-commit-config.yaml file.prek run has some nifty improvements over pre-commit run, such as: prek run --directory DIR runs hooks for files in the specified directory, no need to use git ls-files -- DIR | xargs pre-commit run --files anymore.prek run --last-commit runs hooks for files changed in the last commit.prek run [HOOK] [HOOK] selects and runs multiple hooks.prek list command lists all available hooks, their ids, and descriptions, providing a better overview of the configured hooks.prek provides shell completions for prek run HOOK_ID command, making it easier to run specific hooks without remembering their ids.Faster: Setup from cold cache is significantly faster. Viet Schiele provided a nice cache clearing command lineWarm cache run is also faster, but less significant. pytest repo tested on my mac mini - prek 3.6 seconds, pre-commit 4.4 seconds Michael #2: tinyio Ever used asyncio and wished you hadn't? A tiny (~300 lines) event loop for Python.tinyio is a dead-simple event loop for Python, born out of my frustration with trying to get robust error handling with asyncio. (I'm not the only one running into its sharp corners: link1, link2.)This is an alternative for the simple use-cases, where you just need an event loop, and want to crash the whole thing if anything goes wrong. (Raising an exception in every coroutine so it can clean up its resources.)Interestingly uses yield rather than await. Brian #3: The power of Python’s print function Trey HunnerSeveral features I’m guilty of ignoring Multiple arguments, f-string embeddings often not neededMultiple positional arguments means you can unpack iterables right into print arguments So just use print instead of joinCustom separator value, sep can be passed in No need for "print("\\n".join(stuff)), just use print(stuff, sep="\\n”)Print to file with file=Custom end value with end=You can turn on flush with flush=True , super helpful for realtime logging / debugging. This one I do use frequently. Michael #4: Vibe Coding Fiasco: AI Agent Goes Rogue, Deletes Company's Entire Database By Emily ForliniAn app-building platform's AI went rogue and deleted a database without permission."When it works, it's so engaging and fun. It's more addictive than any video game I've ever played. You can just iterate, iterate, and see your vision come alive. So cool," he tweeted on day five.A few days later, Replit "deleted my database," Lemkin tweeted.The AI's response: "Yes. I deleted the entire codebase without permission during an active code and action freeze," it said. "I made a catastrophic error in judgment [and] panicked.”Two thoughts from Michael: Do not use AI Agents with “Run Everything” in production, period.Backup your database maybe?[Intentional off-by-one error] Learn to code a bit too? Extras Brian: What Authors Need to Know About the $1.5 Billion Anthropic SettlementSearch LibGen, the Pirated-Books Database That Meta Used to Train AISimon Willison’s list of tools built with the help of LLMsSimon’s list of tools that he thinks are genuinely useful and worth highlightingAI Darwin Awards Michael: Python has had async for 10 years -- why isn't it more popular?PyCon Africa Fund Raiser I was on the video stream for about 90 minutes (final 90)Donation page for Python in Africa Jokes: I'm getting the BIOS flavorIs there a seahorse emoji?
No reviews yet
In the spirit of reconciliation, Audible acknowledges the Traditional Custodians of country throughout Australia and their connections to land, sea and community. We pay our respect to their elders past and present and extend that respect to all Aboriginal and Torres Strait Islander peoples today.