类型提示如何兼容多 Python 版本?
原文: PyCoder's Weekly - Issue #522
- 220427 Zoom.Quiet(大妈) 用时 13 分钟 完成快译
- 220427 Zoom.Quiet(大妈) 用时 37 分钟 完成格式转抄.
- 兼容多 Python 版本的类型提示
- ADAM JOHNSON
The typing module continues to evolve, with new features in every Python version. This can make it tricky if you’re trying to type code that supports multiple Python versions. Learn just what you can do when you need to support Type Hints in multiple versions.
(是也乎:
是的,必须精密区分运行时版本...
Py 代码就象 Adnroid 要兼容越来越多设备尺寸...
)
- PyCon US 2022: 充分利用您的会议访问
- REAL PYTHON
Tips for getting the most out of your visit to PyCon US, the world’s biggest Python conference taking place April 27, 2022 to May 3, 2022 in Salt Lake City, Utah. Whether you’re a first-timer or a seasoned attendee, this guide will help you get ready to have a great PyCon. If you’re attending, stop by the Real Python booth and say hello! :)
(是也乎:
白妹主持, 黑人接待, 黄/红/棕/黑 来拜...
非常政治正确.
)
- 在 Python 中为枚举成员添加附加属性
- REDOWAN DELOWAR
Sometimes you want your Enum objects to reference more than just a single piece of data. You can use a tuple but then you have to de-reference it. This article shows a technique used in http.HTTPStatus that you can do in your own code.
- 构建 Django 用户管理系统
- REAL PYTHON
- COURSE
In this video course, you’ll learn how to extend your Django application with a user management system, complete with email sending and third-party authentication.
(是也乎:
其实, 嘦不是给 User 看的, 内置 Admin 足够用了
)
- PyOhio 提案征集开放至 5 月 2 日
- PYOHIO.ORG
- • Shared by Dave Forgac
(是也乎:
Ohio ~ 俄亥俄
)
探讨/吐糟
Discussions
- Python 的"类型提示" 有点儿小失望
- HACKER NEWS
(是也乎
:
执念, 日常是否用不重要, 重要的是有没有...
)
- 在哪里可以看到大型 S/W 架构的示例?
- HACKER NEWS
文章/教程/嗯哼
Articles, Tutorials and Talks
- 从 30 行代码到 11 行代码/Python 中的石头剪刀布
- DAVIDAMOS.DEV
- • Shared by David Amos
When you’re a beginner you need projects that allow you to practice basic concepts. But do you ever revisit those projects as a more advanced developer? This article looks at one common beginner Python project — implementing Rock Paper Scissors in Python — and how you could approach the game logic from a more advanced perspective.
(是也乎:
即便是 bug 密度不变, 代码减少 ⅔ 也就是 bug 减少了大半.
)
- Python 双向字典
- CHRISTOPHER TAO
Learn about the Bidict library, a bi-directional dictionary where your keys and your values can both be used to look up an item. This can be a useful tool when dealing with mapped data like country code to country name where you want to look up either side of the relationship.
(是也乎:
终于有了, 以往都是构建/维护两个字典
)
- 模型训练期间使用 Python 发送通知
- BRADEN RIGGS
We’ve all been there. Whether you are experimenting with a new fun model or grinding for that Kaggle competition prize pool, it can be hard to leave your models running in peace. Learn how to use Twilio’s API to notify you during your model training.
(是也乎:
叕一个想和自己聊的短信游戏...
)
- 什么是合成数据?
- GRETEL.AI
- • Shared by Mason Egger
Synthetic data is artificially annotated information that is generated by computer algorithms or simulations, commonly used as an alternative to real-world data. Learn where it can be useful and how it helps train your machine learning algorithms.
(是也乎:
从现实世界收集数据总是有成本的, 那么根据真实数据合成出肉来一样有营养的...吧?
)
- Python 3.11 预览:任务和异常组
- REAL PYTHON
Python 3.11 will be released in October 2022. In this tutorial, you’ll install the latest alpha release of Python 3.11 in order to preview task and exception groups and learn about how they can improve your asynchronous programming in Python.
(是也乎:
终于追上热点了, 以往 RealPython 都是抄冷饭...
)
- 用 Pandas 和 hvPlot 创建交互式仪表板
- SOPHIA YANG
This article will show you the easiest way to create an interactive dashboard in Python from any Pandas DataFrame. If you already know some Pandas, you can almost immediately use hvPlot .interactive and turn your data into a dashboard.
(是也乎:
俺说怎么这么眼熟...是对 Bokeh 的可用化...
)
- 如何将 Zapier 集成到我的 Django 项目中
- AIDAS BENDORAITIS
Zapier is a no-code tool that takes input from a wide variety of web applications and connects their output to other applications. This article walks you through what you need to do to integrate Zapier with your Django project.
(是也乎:
Zapier 就是 Yahoo! 当年的 Pipes, 或是 PaaS 版本的 IFTTT, 类似的还有 Microsoft Flow/Automate.io/Workflow/Huginn/...
其实, 这种 PipePaaS 成立的前提是有足够多的专用服务, 以及对应服务有足够开放/稳定的接口...
)
- 用 Selenium 和 Docker Swarm 进行并发 Web 抓取
- MICHAEL HERMAN
This tutorial shows you how to use Python and Selenium Grid to build a parallel web scraper. By packaging it up in Docker and executing it in a swarm, you can scrape all the things!
Bas’s top 10 VSCode extensions for Python, including tools for indentation management, comments, tests, type hints, docstrings, and more.
(是也乎:
VScode 正式替代 Vim 了嘛? 毕竟, 即便在 linux 也可以通过 VScode srv. 回到桌面来嗯哼...
反正除了 M$ 那个, 其它都可以安装... 最讨厌 coding 时, 各种提醒了...
)
- Common Python Anti-Patterns to Watch Out For
- KOUSHIK THOTA
Fifteen code patterns that are problematic in Python and what alternatives to use instead.
(是也乎:
实例讲解, 越来越 Pythonic 的代码
)
好物/妙品/...
Interesting Projects, Tools and Libraries, Projects & Code
- memray: Python 的内存分析器
- GITHUB.COM/BLOOMBERG
(是也乎:
有认真设计 VI 的项目, 一般都是想作大的, 其实, Py 开发效率高, 也有越来越多项目增长起来了, 有对应优化工具, 值得关注的...
)
- git-gud: 学习 git 的命令行游戏
- GITHUB.COM/BENTHAYER
(是也乎:
真万物可游戏化, 当年 SQL 的推广可没这种游戏....
)
- dunk: 更漂亮的 Git 差异
- GITHUB.COM/DARRENBURNS
(是也乎:
看起来很美, 就是太过早期
Slame Dunk <- 这个梗儿用的好...
)
-
pandera: Pandas Dataframes 的数据验证库
- GITHUB.COM/PANDERA-DEV
-
- GITHUB.COM/PYPYR
(是也乎:
就象 Ansible , 只是专注 Py 执行, 优先本地嗯哼...
混合 cms+py 简直了..
)
📆🐍 活动/大会
Events, MeetUp 真的是全球线下活动组织中心
- PyCon US 2022
- April 27 to May 6, 2022
(是也乎:
来了来了, 每年都有神仙项目发布...
)
-
- April 27, 2022
-
- April 27, 2022
-
- April 28, 2022
DAMA
❤️ Happy Pythonic ;-(
大妈私人无责任播报
)
- Zoom.Quiet’s Chaos42 | Substack
- 古早:新闻组式写作
- 欢迎订阅
(是也乎:
谈崩了, 之前通过 ACM 会员可以每年 $25 享受 O'REILLY 在线图书馆服务...现在没了
)
PS:
PPS:
不觉中蟒周刊快译已经到了第10个年头
去年开始有小伙伴加入承担 pythonisa
周刊的翻译,
从来没提醒过, 可就这么默默坚持下来了...
问为什么:
[皱眉]每周新闻资讯 怎么能错过
看看有什么新东西
当有新的发现时:
what f**k 还能这样玩? 还有这东西?
每周开彩蛋[吃瓜]
无法同意更多
...
很多社区贡献看起来辛苦,
其实受益最多的,
就是主动承担者也.
好文笔,感叹号年度配额: 1/3
投稿/反馈邮箱:
askdama@googlegroups.com
(邮件列表地址, 当成正常邮件发送邮件就好, 不用注册, 不用翻越...)
ZoomQuiet/大妈
就是四处 是也乎,( ̄▽ ̄)
的那个大妈:
私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开课程: 蟒营 (订阅号: Mainium)
历史吐糟: Chaos42 (订阅号 PythoniCamp)
as 创始组织者:
PyChina (订阅号: PyChinaOrg)
本地社区:
GDG珠海 (订阅号: GDG-ZhuHai)
TFUG珠海 (订阅号: ZH_TFUG)
Comments