为毛 Python 还在增长?

原文: PyCoder's Weekly - Issue #567

pycoder

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

Python Enhancement Proposal 709 covers a change to how comprehensions are handled. Currently they are compiled as nested functions. Benchmarking shows that treating list, dict, and set comprehensions as in-line code can result in a 2x speedup on the comprehension.

In this tutorial, you’ll learn what iterators and iterables are in Python. You’ll learn how they differ and when to use them in your code. You’ll also learn how to create your own iterators and iterables to make data processing more efficient.

(是也乎:

Iterations

嗯哼, 怎么说呢? 同样是迭代处理,对比一下 Rust 最常见的:

rs

这种链式闭包联级处理, 也是 Elixir/Haskell/LISP/...函数式语言常见的形式, 这在 Python 中还很难日用起来...

)

This article details the changes in the Pandas 2.0 release, with emphasis on the underlying adoption of Apache Arrow.


探讨/吐糟

Discussions

Last week’s issue of PyCoders included a link to Python’s multiprocessing performance problem which now has a Hacker News conversation to go along with it.

(是也乎:

Why

好问题哪, 老爹都退休了...其它同期语言都佛了...

作为 GitHub: Codespaces + Copilot 的硬广是没问题的,

只是囧的,没好意思说 Ruby ...

~> GitHub Codespaces Documentation - GitHub Docs ... GitHub工程团队已经转移到Codespaces:实现开发环境的秒级启用_架构_Cory Wilkerson_InfoQ精选文章

PS: Codespaces 这么火, 国内的 Coding 应该发财了?

)


文章/教程/嗯哼

Articles, Tutorials and Talks

The articles discusses whether Python is as slow as so many authors claim. When doing so, it mentions highly optimized Python frameworks for numerical computation, efficient compilers - but also coding time as opposed to execution time. All in all, Python is much faster than most think.

In this introductory tutorial, you will build a recurrent neural network (RNN) with PyTorch. The RNN will be trained to read names and it will output the natural language they belong to. This is a modern spin on a tutorial from the PyTorch documentation.

(是也乎:

可惜没办法拿来当成礼物送女神们哪...

)

In this video course, you’ll learn what Python’s namedtuple is and how to use it in your code. You’ll also learn about the main differences between named tuples and other data structures, such as dictionaries, data classes, and typed named tuples.

(是也乎:

namedtuple

不是, 听起来已经不象是真人讲解的了...

不过, 这个低调的模块: collections — Container datatypes — Python 3.11.2 documentation

早已在 sqlite3 等等其它关键模块中深入用起来了...

)

In this tutorial, you’ll learn how to use NumPy reshape() to rearrange the data in an array. You’ll learn to increase and decrease the number of dimensions and to configure the data in the new array to suit your requirements.

(是也乎:

NumPy

)

Flask is approaching its 13th birthday, and to celebrate, Phillip has written 13 tips for writing modern Flask apps. It covers dealing with JSON, environment based configuration, auto-generated docs, and more.

There are many speed improvements in CPython 3.11, but that doesn’t mean the Python alternatives don’t still have some advantages. Pyston and PyPy are still better in some cases.

(是也乎:

Pyston & PyPy 又没有历史包袱...怎么浪怎么来就好...

)

This tutorial shows you how to build a system that takes a question template and writes a resume as output. The example is built on Streamlit and OpenAI.

(是也乎:

等于自动帮你对比全球成功获得 offer 的简历, 进行对应优化...

)

Elixir is a functional based programming language with similarities to Ruby and Python. This article is an intro guide for programmers who know Python.

(是也乎:

所以? Python 其实成了IT世界的英语? 先会 Python ,然后, 其它的水到渠成?

)

Python’s addition of typing has created “two” languages: typed and untyped Python. Tin tells you why that’s a great thing.

(是也乎:

c'est la vie (´-ι_-`)

不过, 不用类型提示的应该永远支持, 这毕竟是更加直觉的一类...

)

This step-by-step tutorial shows you how to build a rust tool and deliver it through Python packaging mechanisms.

(是也乎:

嗯哼? 这个赞的哪...刚刚学会如何用 Rust 快速开发 CLI, 和 invoke/Click/... 相比, 还是复杂了点儿..

已经发布的小工具: ZoomQuiet crates.io: Rust Package Registry

部分根本就是照着原先 Python 版本逐行迁移过去的...

)

Quick instructions on using nox with parameters to test multiple versions of Python against your test suite.


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

这种教程的趋势是先越来越短,现在不行不越来越长? 21天精通XXXX 流行了几年, 后来就是一天掌握XXX...

)

(是也乎:

实话, 都在内存里了,想性能低一点儿, 反而难的卟?

)

(是也乎:

LLVM 成名后, LL 也变成了热词...

)

(是也乎:

所以, 和 OpenAPI 有什么差别?

)

(是也乎:

嗯哼? 还以为是对物质世界进行索引, 没想到只是扫描进来再管理...

)


📆🐍 活动/大会

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


DAMA

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


PS:

Happy Pythoning!

Copyright © 2023 PyCoder’s Weekly, All rights reserved.

PPS:

不觉中蟒周刊快译已经到了第10+2个年头

开始有小伙伴加入承担 pythonisa 周刊的翻译, 从来没提醒过, 可就这么默默坚持下来了...

问为什么:

[皱眉]每周新闻资讯 怎么能错过 
看看有什么新东西 
当有新的发现时:
    what f**k 还能这样玩? 还有这东西?
    每周开彩蛋[吃瓜]

无法同意更多... 很多社区贡献看起来辛苦, 其实受益最多的, 就是主动承担者也.

所以++> 锈周刊 -> Weekly :: China


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

投稿/反馈邮箱:

askdama@googlegroups.com

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


ZoomQuiet/大妈

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

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

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


Comments


大妈的多重宇宙 - YouTube

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

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


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


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

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