Artwork

内容由Michael Kennedy and Brian Okken提供。所有播客内容(包括剧集、图形和播客描述)均由 Michael Kennedy and Brian Okken 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal
Player FM -播客应用
使用Player FM应用程序离线!

#412 Closing the loop

26:00
 
分享
 

Manage episode 453264984 series 1305988
内容由Michael Kennedy and Brian Okken提供。所有播客内容(包括剧集、图形和播客描述)均由 Michael Kennedy and Brian Okken 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal
Topics covered in this episode:
Watch on YouTube
About the show

Sponsored by us! Support our work through:

Connect with the hosts

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: Loop targets

  • Ned Batchelder
  • I don’t think I would have covered this had it not been the surprising opposition to Ned’s code.
  • Here’s the snippet:

    params = { "query": QUERY, "page_size": 100, } *# Get page=0, page=1, page=2, ...* **for** params["page"] in itertools.count(): data = requests.get(SEARCH_URL, params).json() **if** not data["results"]: **break** ... 
  • Ned is utilizing the assignment in the for loop to use the value of count() and store it into the params["page"].

  • The article includes another version with a temp variable page_num, which I think the naysayers would prefer.
  • But frankly, I think both are fine. Why not put the value right where you want it?

Michael #2: asyncstdlib

  • The asyncstdlib library re-implements functions and classes of the Python standard library to make them compatible with async callables, iterables and context managers.
  • It is fully agnostic to async event loops and seamlessly works with asyncio, third-party libraries such as trio, as well as any custom async event loop.
  • Full set of async versions of advantageous standard library helpers, such as zip, map, enumerate, functools.reduce, itertools.tee, itertools.groupby and many others.
  • Safe handling of async iterators to ensure prompt cleanup, as well as various helpers to simplify safely using custom async iterators.
  • Small but powerful toolset to seamlessly integrate existing sync code into async programs and libraries.

Brian #3: Bagels: TUI Expense Tracker

  • Jax Tam
  • “Bagels expense tracker is a TUI application where you can track and analyse your money flow, with convenience oriented features and a complete interface.

  • Why an expense tracker in the terminal? I found it easier to build a habit and keep an accurate track of my expenses if I do it at the end of the day, instead of on the go. So why not in the terminal where it's fast, and I can keep all my data locally?”

  • Who hasn’t wanted to write their own expense tracker?

  • This implementation is fun for lots of reasons
    • It’s still new and pretty small, so forking it for your own uses should be easy
    • Built on textual is fun
    • install instructions based on uv tool seems to be the new normal:
      • uv tool install --python 3.13 bagels
    • test suite started
    • pretty useful as is, actually
    • Nice that it includes a roadmap of future goals
    • Would be a fun project to help out with for anyone looking for anyone looking for a shiny new codebase to contribute to.

Michael #4: rloop: An AsyncIO event loop implemented in Rust

  • An AsyncIO event loop implemented in Rust
  • From Giovanni Barillari, Creator of Granian
  • RLoop is an AsyncIO event loop implemented in Rust on top of the mio crate.
  • Disclaimer: This is a work in progress and definitely not ready for production usage.
  • Run asyncio.set_event_loop_policy(rloop.EventLoopPolicy()) and done.
  • Similar to uvloop.

Extras

Brian:

Michael:

Joke: CTRL + X onion

  continue reading

420集单集

Artwork

#412 Closing the loop

Python Bytes

1,826 subscribers

published

icon分享
 
Manage episode 453264984 series 1305988
内容由Michael Kennedy and Brian Okken提供。所有播客内容(包括剧集、图形和播客描述)均由 Michael Kennedy and Brian Okken 或其播客平台合作伙伴直接上传和提供。如果您认为有人在未经您许可的情况下使用您的受版权保护的作品,您可以按照此处概述的流程进行操作https://zh.player.fm/legal
Topics covered in this episode:
Watch on YouTube
About the show

Sponsored by us! Support our work through:

Connect with the hosts

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: Loop targets

  • Ned Batchelder
  • I don’t think I would have covered this had it not been the surprising opposition to Ned’s code.
  • Here’s the snippet:

    params = { "query": QUERY, "page_size": 100, } *# Get page=0, page=1, page=2, ...* **for** params["page"] in itertools.count(): data = requests.get(SEARCH_URL, params).json() **if** not data["results"]: **break** ... 
  • Ned is utilizing the assignment in the for loop to use the value of count() and store it into the params["page"].

  • The article includes another version with a temp variable page_num, which I think the naysayers would prefer.
  • But frankly, I think both are fine. Why not put the value right where you want it?

Michael #2: asyncstdlib

  • The asyncstdlib library re-implements functions and classes of the Python standard library to make them compatible with async callables, iterables and context managers.
  • It is fully agnostic to async event loops and seamlessly works with asyncio, third-party libraries such as trio, as well as any custom async event loop.
  • Full set of async versions of advantageous standard library helpers, such as zip, map, enumerate, functools.reduce, itertools.tee, itertools.groupby and many others.
  • Safe handling of async iterators to ensure prompt cleanup, as well as various helpers to simplify safely using custom async iterators.
  • Small but powerful toolset to seamlessly integrate existing sync code into async programs and libraries.

Brian #3: Bagels: TUI Expense Tracker

  • Jax Tam
  • “Bagels expense tracker is a TUI application where you can track and analyse your money flow, with convenience oriented features and a complete interface.

  • Why an expense tracker in the terminal? I found it easier to build a habit and keep an accurate track of my expenses if I do it at the end of the day, instead of on the go. So why not in the terminal where it's fast, and I can keep all my data locally?”

  • Who hasn’t wanted to write their own expense tracker?

  • This implementation is fun for lots of reasons
    • It’s still new and pretty small, so forking it for your own uses should be easy
    • Built on textual is fun
    • install instructions based on uv tool seems to be the new normal:
      • uv tool install --python 3.13 bagels
    • test suite started
    • pretty useful as is, actually
    • Nice that it includes a roadmap of future goals
    • Would be a fun project to help out with for anyone looking for anyone looking for a shiny new codebase to contribute to.

Michael #4: rloop: An AsyncIO event loop implemented in Rust

  • An AsyncIO event loop implemented in Rust
  • From Giovanni Barillari, Creator of Granian
  • RLoop is an AsyncIO event loop implemented in Rust on top of the mio crate.
  • Disclaimer: This is a work in progress and definitely not ready for production usage.
  • Run asyncio.set_event_loop_policy(rloop.EventLoopPolicy()) and done.
  • Similar to uvloop.

Extras

Brian:

Michael:

Joke: CTRL + X onion

  continue reading

420集单集

所有剧集

×
 
Loading …

欢迎使用Player FM

Player FM正在网上搜索高质量的播客,以便您现在享受。它是最好的播客应用程序,适用于安卓、iPhone和网络。注册以跨设备同步订阅。

 

快速参考指南

边探索边听这个节目
播放