cover of episode #410 Entering the Django core

#410 Entering the Django core

2024/11/18
logo of podcast Python Bytes

Python Bytes

AI Deep Dive AI Chapters Transcript
People
B
Brian
Python 开发者和播客主持人,专注于测试和软件开发教育。
M
Michael
帮助医生和高收入专业人士管理财务的金融教育者和播客主持人。
Topics
Brian 讨论了 Carlton Gibson 关于 Django 核心与插件之间平衡的观点。Gibson 强调了 Django 核心保持精简的重要性,以及插件生态系统如何增强框架的活力。文章探讨了 Django 的可持续性问题,指出核心团队规模小,维护这样一个被广泛使用的框架是一个挑战。Django 核心功能更新缓慢,而插件可以更快地迭代和发展,这为框架的长期发展提供了灵活性。文章还提到了 Django 核心团队在支持插件生态系统和避免扼杀竞争之间需要找到平衡点,并指出为初学者提供插件选择指南是一个挑战。

Deep Dive

Chapters
Carlton Gibson discusses Django's core versus plugins, sustainability, and the release cycle, emphasizing the importance of a small core and a vibrant plugin ecosystem.
  • Django will be 20 years old next year.
  • The core team is small, with only a few people maintaining the framework.
  • The ecosystem is built on a plug-in architecture, allowing for a wide range of functionalities without bloating the core.

Shownotes Transcript

Topics covered in this episode:

- **[Thoughts on Django’s Core](https://buttondown.com/carlton/archive/thoughts-on-djangos-core/?featured_on=pythonbytes))**

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: Thoughts on Django’s Core)

  • Carlton Gibson

  • Great discussion on

  • Django and Core vs Plugins

  • Sustainability with limited people

  • Keeping core small

  • The release cycle

  • eembrace plugins vs endorsing plugins.

Michael #2: futurepool)

  • via Pat Decker

  • Takes the concept of multiprocessing Pool to the async/await world.

Create a pool then delegate the work:

`async with FuturePool(2) as fp:
  result = await fp.map(async_pool_fn, range(10))
`

- I would LOVE to see something like this in a broader background asyncio worker pool concept.

  • But that concept doesn’t exist in asyncio in Python and that’s a failing of the framework IMO.

Brian #3: Don't return named tuples in new APIs)

  • Brett Cannon

  • First off, I’m grateful for any post that talks about APIs and the API is a module, class, or package API and not a Web/REST API. The term API existed long before the internet.

  • “e.g., get_mouse_position() very likely has a two-item tuple of X and Y coordinates of the screen”

  • “it actually makes your API more complex for both you and your users to use. For you, it doubles the data access API surface for your return type as you have to now support index-based and attribute-based data access forever (or until you choose to break your users and change your return type so it doesn't support both approaches)”

  • “… you probably don't want people doing with your return type, like slicing, iterating over all the items …”

  • Alternatives

  • class

  • dataclass

  • dictionary

  • TypedDict

  • SimpleNamespace

  • “My key point in all of this is to prefer readability and ergonomics over brevity in your code. That means avoiding named tuples except where you are expanding to tweaking an existing API where the named tuple improves over the plain tuple that's already being used.”

Michael #4: Ziglang: Migrating from AWS to Self-Hosting)

  • The Rust Foundation for example, reports that they spent $404,400 on infrastructure costs in 2023.

  • Zig lang has decided to use a single big cloud machine + mirrors

Extras

Brian:

  • Changing the Python Test community

  • Was started to answer questions for Test & Code listeners years ago.

  • Primarily pytest questions

  • Used to be Slack. Then moved to Podia forum.

  • Now I’m trying to work out a Discord solution that is both sustainable and usable.

Michael:

Joke: Breaking: JavaScript Developer Commits to Framework for Record-Breaking 3 Weeks)