通过练习学 Python 的生成器/协程

原文: PyCoder's Weekly - Issue #451

pycoder

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

In this tutorial, you’ll learn how to use Python’s bitwise operators to manipulate individual bits of data at the most granular level. With the help of hands-on examples, you’ll see how you can apply bitmasks and overload bitwise operators to control binary data in your code.

(是也乎:

Bitwise

回到汇编 ;-)

)

What if mypy could warn you about possible problems at “compile time”? In this article, you’ll learn a little trick to get mypy to fail when a value in an enumeration type is left unhandled.

Every software developer, data scientist, and sysadmin must, at some point, schedule jobs to run. In this article, you’ll learn how to do this with Python. You’ll encounter a number of methods for scheduling jobs, from using the standard library to leveraging third-party packages.

(是也乎:

嚓, 这口气大了, 也的确需要

)

The Python object system is one of the most important parts of the Python language. Mastering it is essential to mastering the Python language. Learn how the object system works by examining the CPython source code in this detailed tutorial.

(是也乎:

灵魂追问了, 从代码上看, 老爹也一直在纠结ing....

)

In this article, you’ll get an overview of the discipline of data engineering. You’ll learn what is and isn’t part of a data engineer’s job, who data engineers work with, and why data engineers play a crucial role in many industries.

(是也乎:

DataE

扫盲贴 ;-)

)

Help the PSF recover funds lost due to COVID-19.

(是也乎:

等等, 哪儿? 俺也得捐.

)

(是也乎:

嚓了, 真.活久见

)

探讨/吐糟

Discussions

The docs for the .iadd() special method don’t make it clear why it works for collections like lists and dictionaries. Time to peruse some CPython source code!

文章/教程/嗯哼

Articles, Tutorials and Talks

Follow the saga of PEP 622 which proposes to add a new structural pattern matching feature to Python. There have been a number of updates to the PEP, as well as some animated discussion in the Python-dev mailing list.

Have you started to use generators in Python? Are you unsure why you would even use one over a regular function? How do you use the special “send” method and the “yield from” syntax? This week on the show, we have Reuven Lerner to talk about his PyCon Africa 2020 talk titled “Generators, coroutines, and nanoservices.”

(是也乎:

podcast )

In this step-by-step course, you’ll learn the basics of Python programming with the help of a simple and interactive Python library called turtle. If you’re a beginner to Python, then this course will definitely help you on your journey as you take your first steps into the world of programming.

(是也乎:

永远的小乌龟 ;-)

不过, 针对儿童吧, 对成人感觉没什么帮助, 刺激点不对.

)

After writing JSON-REST APIs for a number of years, Philip Jones noticed that there were shortcomings with documenting API structure and validating data sent and received. In this article, Philip discusses how he solved both of these issues with the quart-schema package.

In part one of this series, you’ll get a quickstart guide to creating web maps with the Python-based web framework Django using its module GeoDjango, the SQLite database with its spatial extension SpatiaLite and Leaflet, a JavaScript library for interactive maps.

(是也乎:

虽然, Pg 们内置了强大的 GEO 系列能力, 但是, 反应到 Django 框架中, 还得有个反应时期...

)

Rust’s dbg macro is a useful expression printer that adds the source line to what is printed. In this article, Raphael shows you how to implement a similar function in Python and discusses many of the intricacies involved with inspecting code states.

(是也乎:

来了, 反正流行什么, fans 就住 Python 中 mix 什么. 而且都成功了.

)

Learn what concurrency means in Python and why you might want to use it. You’ll see a simple, non-concurrent approach and then look into why you’d want threading, asyncio, or multiprocessing.

(是也乎:

Concurrency

反正,就是要快...

)

Learn how to set up a GraphQL authorization layer between Graphene and SQLAlchemy using oso’s open-source authorization library and the sqlalchemy-oso package.

好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

来自 毛里求斯

)

(是也乎:

策略工程

哗, 这 Bigger 突破天际.

)

📆🐍 活动/大会

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

(是也乎:

硬广, 但是, 足够有趣 ;-)

)

PyCon2020中国

(是也乎:

PyCon20深圳 大妈 暖场小单口

并实锤可用神器: NixOS - NixOS Linux

nix 可以跨语言非Docker 将开发和运行时环境精确锁定.

以及 PyCon19广州 的坑终于填上了:

基于Django的无代码Admin + 低代码开发框架

)

DAMA

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

None

PS:


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

投稿/反馈邮箱:

askdama@googlegroups.com

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


ZoomQuiet/大妈

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

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

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

NN 4229

RPP


Comments



自怼圈/年度番新

DU21.7
关于 ~ DebugUself with DAMA ;-)

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

追问

任何问题, 随时邮件提问可也:
askdama@googlegroups.com


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

**2021.01.11** 因大妈再次创业暂停定期开设, 转换为预约触发:
  • + 扫描预约入群, 学员每满 42 人即启动新一期训练营 ;-)
  • 101camp21.7
  • + 任何问题, 随时邮件提问可也:
    askdama@googlegroups.com