C扩展的隐藏性能开销

原文: PyCoder's Weekly - Issue #471

pycoder

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

It’s no secret that Python is slower than compiled languages like C, C++, and Rust. If you need a performance boost, you can write compiled Python C extensions. But there are some hidden performance costs that you should be aware of if you decide to do this. This article explains two ways that Python C extensions can actually be slower than pure Python and discusses some solutions and work around for them.

(是也乎:

是的, Py 内建模块是宝藏, 很少有人都用过的...

)

Jupyter Notebooks are great for exploratory data analysis. They’re also a good way to share results and analysis with other people, who can alter the notebook to further explore the data themselves. But there are some limitations to notebook interactivity. That’s where ipywidgets comes in! In this tutorial you’ll learn how to create widgets like check boxes, drop-down menus, sliders, and how to handle events like button clicks.

Datadog’s Continuous Profiler allows you to find the most resource-consuming parts in your production code all the time, at any scale, with minimal overhead. Debug and optimize your code, enhancing application performance before your customers notice. Try Datadog APM today →

Building games can be a fun way to learn new Python concepts and practice techniques you’ve already learned. Plus, they make for great projects to share! This step-by-step tutorial shows you how to build a platform game using the arcade library. You’ll learn techniques for designing levels, sourcing assets, and implementing advanced features.

(是也乎:

Platform

卷轴游戏, 现在有完备的开发/设计/调试环境了...

)

Python 3.8.10 and 3.9.5 have also been released.


探讨/吐糟

Discussions

Are you seeing warnings about scheme.data, scheme.platlib, and other scheme.* items when installing with pip? While these warnings don’t affect the pip installation, they are noisy and annoying. Fortunately, the pip team has fixed them in the latest patch release, so upgrading to pip 21.1.1 or later should get rid of them for you.

(是也乎:

随着 Python 的上升, pip 版本的高速变化. PyPi 不可用情况越来越多,

)

In a recent blog post, Stack Overflow analyzed data the obtained during an April Fools gag about how people copy and paste code from their platform. One of the results from the data set indicates that to most copied comment comes from an answer about resizing figures in Matplotlib.

(是也乎:

扎心了老铁...

)


文章/教程/嗯哼

Articles, Tutorials and Talks

In analog photography, you can achieve different “looks” for your photographs by selecting different kinds of film to shoot with. Digital camera manufacturers often include different presets to simulate different kinds of film. In this article, you’ll learn how to simulate different films on your own images using color lookup tables, or CLUTs, using NumPy and the Pillow image library.

(是也乎:

果断来了, 5年前就有中国团队作到了, 现在各种轮子都在出现, 可视化编程, 为什么不生成可实用的 py 代码? 当然可以的了

)

In this step-by-step course, you’ll learn how to create a cross-platform graphical user interface (GUI) using Python and PySimpleGUI. A graphical user interface is an application that has buttons, windows, and lots of other elements that the user can use to interact with your application.

(是也乎:

PySimpleGUI

PySimpleGUI 号称简单, 其实...

)

Validating user input is one of the most common programming tasks. There are a number of approaches to validation and a host of third-party Python packages available on PyPI. One of these approaches that is common in the functional programming paradigm is applicative-style validation, which the author of this article calls declarative validation. In this short-yet-informative article, you’ll learn how declarative validation works and how to cook up a small validation library.

(是也乎:

当年有效性检验模块, 多数是 PHP 社区给出来的, 后来是 JS, 现在 Py 也要重新来一遍...

)

April 2021 was an eventful month in the world of Python. In this article, you’ll get up to speed on everything that happened in the past month, including new sponsorships for the PSF, changes to Python error messages, and a community-led discussion over the future of type annotations.

(是也乎:

News

真蟒 版周刊.

)

FastAPI is quickly gaining popularity in the world of asynchronous Python web frameworks. With more and more users flocking to the framework, the demand for Dockerized development and production workflows is growing. In this step-by-step tutorial, you’ll learn how to dockerize a FastAPI application using Postgres, Uvicorn, and Traefik.

(是也乎:

越来越多人将 FastAPI 和 Flask 对比了, 这其实没什么可比性;

但是, 谁让他们都是 F 家族的呢?

)

This week’s episode of the Real Python podcast is a bit different. Take a look back in this rewind episode featuring highlights from the many interviews over the past year or so of the show.

(是也乎:

podcast

solo, 主持人没请到嘉宾, 于是自己回顾当年印象最深的嘉宾们

)


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

tablib

可以拿来作为各种数据源的输出端

)

(是也乎:

叕一个 WASM.py 方案, 其实, 早说过了, 就看哪家方案, 首先被 Chrome 接受并编译到内核了...

当然, 这个还是用 Rust 来完成最终编译的...

)

(是也乎:

...一种适合异构大数据系统的内存列存数据格式标准

天下大势: 分久必合, 合久必分

NoSQL 之后, 数据重新探索出各种形态, 现在, 又需要一个统一标准可以在内存中相互融合统计/计算, Apache 有很多项目都在尝试这个方向, 现在看 Arrow 是个共同方向了?

统一起来, 也方便 骇客 们嗯哼了...

)


📆🐍 活动/大会

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 4341

RPP


Comments


大妈的多重宇宙 - YouTube

全新自媒体系列...科学幻想,读书,说故事...

任何问题

随时邮件提问可也:
askdama@googlegroups.com

-->