Lépjen offline állapotba az Player FM alkalmazással!
#448 I'm Getting the BIOS Flavor
Manage episode 505286793 series 1305988
- * prek*
- * tinyio*
- * The power of Python’s print function*
- * Vibe Coding Fiasco: AI Agent Goes Rogue, Deletes Company's Entire Database*
- Extras
- Joke
About the show
Sponsored by us! Support our work through:
Connect with the hosts
- Michael: @[email protected] / @mkennedy.codes (bsky)
- Brian: @[email protected] / @brianokken.bsky.social
- Show: @[email protected] / @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 overpre-commit run
, such as:prek run --directory DIR
runs hooks for files in the specified directory, no need to usegit 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.
- Warm 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 withasyncio
. (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 thanawait
.
Brian #3: The power of Python’s print function
- Trey Hunner
- Several features I’m guilty of ignoring
- Multiple arguments, f-string embeddings often not needed
- Multiple positional arguments means you can unpack iterables right into print arguments
- So just use print instead of join
- Custom separator value,
sep
can be passed in- No need for
"print("\\n".join(stuff))
, just useprint(stuff, sep="\\n”)
- No need for
- 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 Forlini
- An 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 Settlement
- Search LibGen, the Pirated-Books Database That Meta Used to Train AI
- Simon Willison’s list of tools built with the help of LLMs
- Simon’s list of tools that he thinks are genuinely useful and worth highlighting
- AI 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:
452 epizódok
Manage episode 505286793 series 1305988
- * prek*
- * tinyio*
- * The power of Python’s print function*
- * Vibe Coding Fiasco: AI Agent Goes Rogue, Deletes Company's Entire Database*
- Extras
- Joke
About the show
Sponsored by us! Support our work through:
Connect with the hosts
- Michael: @[email protected] / @mkennedy.codes (bsky)
- Brian: @[email protected] / @brianokken.bsky.social
- Show: @[email protected] / @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 overpre-commit run
, such as:prek run --directory DIR
runs hooks for files in the specified directory, no need to usegit 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.
- Warm 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 withasyncio
. (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 thanawait
.
Brian #3: The power of Python’s print function
- Trey Hunner
- Several features I’m guilty of ignoring
- Multiple arguments, f-string embeddings often not needed
- Multiple positional arguments means you can unpack iterables right into print arguments
- So just use print instead of join
- Custom separator value,
sep
can be passed in- No need for
"print("\\n".join(stuff))
, just useprint(stuff, sep="\\n”)
- No need for
- 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 Forlini
- An 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 Settlement
- Search LibGen, the Pirated-Books Database That Meta Used to Train AI
- Simon Willison’s list of tools built with the help of LLMs
- Simon’s list of tools that he thinks are genuinely useful and worth highlighting
- AI 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:
452 epizódok
Alle episoder
×Üdvözlünk a Player FM-nél!
A Player FM lejátszó az internetet böngészi a kiváló minőségű podcastok után, hogy ön élvezhesse azokat. Ez a legjobb podcast-alkalmazás, Androidon, iPhone-on és a weben is működik. Jelentkezzen be az feliratkozások szinkronizálásához az eszközök között.