模式匹配在 Pythonic

原文: PyCoder's Weekly - Issue #464

pycoder

  • 210317 Zoom.Quiet(大妈) 用时 42 分钟 完成快译
  • 210317 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄.

Structural pattern matching is coming in Python 3.10. This article explores how to use it to write Pythonic code by searching for some of the best use cases for the match statement. Keep in mind that match is still in alpha, so, while unlikely, some things may still change before the final version of 3.10 is released.

(是也乎:

Pattern

在 Erlang 用老的形式, 终于进入 Python, 不过, 也只是刚刚开始, 远没浸入内核, 只能当成语法糖先.

)

There is a new version of Qt (version 6) and with it new versions of PyQt and PySide — now named PyQt6 & PySide6 respectively. Take a look at the latest versions of the libraries to identify the differences between them and find solutions for writing portable code.

(是也乎:

表兄弟有什么不同?

)

In this step-by-step project, you’ll build a minimal contact book application using Python, with PyQt to build the application’s GUI and SQLite to handle the database.

(是也乎:

Contact

真正上手项目, 可以立即让你反感 GUI 编程...

)

Learn how to usee htmx and Tailwind CSS with Flask to quickly build interactive front-ends.

(是也乎:

Mu

最萌 IDE 发布新版了

)


探讨/吐糟

Discussions

(是也乎:

等等? tar 只是打包又不压缩哪...

)

(是也乎:

tail ?

)


文章/教程/嗯哼

Articles, Tutorials and Talks

The pandas library provides easy-to-use data structures like pandas DataFrames as well as tools for data analysis. One issue with pandas is that it can be slow with large amounts of data. It wasn’t designed for analyzing 100 GB or 1 TB datasets. Fortunately, there is the Modin library which has benefits like the ability to scale your pandas workflows by changing one line of code.

(是也乎:

其实追加内存是最快的加速

)

What goes into the decision of how to host your Python code or application in the cloud? Which technology stack is the right size for your project? This week on the show, we have Calvin Hendryx-Parker. Calvin talks about cloud hosting options, infrastructure choices, and deployment tools.

(是也乎:

podcast )

Now that Python developers have Mypy and Python’s built-in Protocol, is zope.interface a thing of the past? Can you replace every zope.interface with a Protocol? See how these two approaches to abstract types compare, and when it might make sense to stick with zope.interface.

(是也乎:

界面和协议...嗯哼, 反转概念是习惯性动作了...

zope.interface 一直没过时, 可想当年 Zope 创造了多少好东西? 毕竟是 老爹亲自嗯哼的哈... )

Pablo Galindo is a physicist, Python core-dev, and member of the Python steering council. He’s also the release manager for Python 3.10 and 3.11. Learn how he got involved with Python and read about his thoughts on the role of the steering council and Python’s future.

(是也乎:

Galindo )

Learn about the built-in Python Boolean data type, which is used to represent the truth value of an expression. You’ll see how to use Booleans to compare values, check for identity and membership, and control the flow of your programs with conditionals.

(是也乎:

Booleans

中学知识..

等等, 真理的力量? 这个广告辞很力的. )

This article is less of a “my language is better than your” rant and more of an exploration into what idiomatic vs. optimized code looks like in various languages and where surprising bottlenecks lurk.

(是也乎:

每年都有的对比, 不过, 这次有 Forth 很前沿哪... )

Beanie is a new asynchronous Python ODM (Object Document Mappter) for MongoDB based on Motor and Pydantic. Learn how Beanie’s data model works and see it in action in a minimal web application.

(是也乎:

# Actual endpoint
@notes_router.get("/notes/{note_id}", response_model=Note)
async def get_note_by_id(
        # Helper usage with Depends annotation
        note: Note = Depends(get_note)
):
    return note

嗯哼, 这没什么变化哪...

)

Learn how Ewa Jodlowska, the executive director of the Python Software Foundation (PSF), started her tech journey and how COVID-19 affected the PSF and plans for PyCon US 2021.

(是也乎:

REAL

)


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

超参 是调参日常中最耗时间的一坨

)

(是也乎:

一般 deploy 工具都是反过来的哪...

)

(是也乎:

ORM 之后的 ODM ?

MongoDB 居然活过来了?

)


📆🐍 活动/大会

Events, MeetUp 真的是全球线下活动组织中心

(是也乎:

即便是线上的, 一样收费.

)

(是也乎:

其实, 非洲有过发达国家的... )

(是也乎:

以色列, 全球创新热点地区...

)

(是也乎:

反正很早都上 油管了, 随时可以 review, 当然, 这个随时, 随时了很多年都没刷光.

)


DAMA

❤️ Happy Pythonic ;-(大妈私人无责任播报)

(是也乎:

独创 logging + debug 模块

)

(是也乎:

老司机开新坑, 时隔10年, 沈游侠再次开声, 值得关注:

Bilibili

)

(是也乎:

私人初体验, 现在 http/https 资源混用浏览器越来越傲娇了, 最好有工具可以统一迁移...

)


PS:


好文笔,感叹号年度配额: 2/3

投稿/反馈邮箱:

askdama@googlegroups.com

(邮件列表地址, 当成正常邮件发送邮件就好, 不用注册, 不用翻越...)


ZoomQuiet/大妈

就是四处 是也乎,( ̄▽ ̄) 的那个大妈:

私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开课程: 蟒营 (订阅号: Mainium)
历史吐糟: Chaos42 (订阅号 PythoniCamp)

as 创始组织者:
    PyChina (订阅号: PyChinaOrg)
    本地社区: 
        GDG珠海 (订阅号: GDG-ZhuHai)
        TFUG珠海 (订阅号: ZH_TFUG)

NN 4320

RPP


Comments


大妈的多重宇宙 - YouTube

全新自媒体系列...科学幻想,读书,说故事...
点击注册~> 获得 100$ 体验券: DigitalOcean Referral Badge

订阅 substack 体验古早写作:
Zoom.Quiet’s Chaos42 | Substack


关注公众号, 持续获得相关各种嗯哼:
zoomquiet


蟒营®编程思维提高班Python版

**2021.01.11** 因大妈再次创业暂停定期开设, 转换为预约触发:
  • + 任何问题, 随时邮件提问可也:
    askdama@googlegroups.com
-->