全新姿势来告知你 Python 代码很糟糕

原文: PyCoder's Weekly - Issue #489

pycoder

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

This draft PEP proposes a way for resolving conflicts between OS package managers (e.g. apt) and Python-specific package management tools (e.g. pip).

How should someone assess whether or not learning Python is a good investment of their time, how long it will take them, and what background factors they need to consider when planning their learning journey? This article attempts to clarify these common beginner questions.

(是也乎:

Learn

简单说, 42分钟到42年不等...

学习阶段

嗯哼? 对比俺之前的断言

Unknow Unknow 不知不知何 unconscious incompetence 无意识无能
Unknow Know   不知己知何 conscious incompetence 有意识的无能
Know Know     知己已知何 conscious competence 意识能力
Know Unknow   知己不知何 unconscious competence 无意识能力

)

With Datadog APM you can debug errors and bottlenecks in your code by tracing requests across web servers and services in your environment. Then correlate between distributed request traces, metrics, and logs to troubleshoot issues without switching tools or contexts. Try Datadog APM free →

This post introduces readers to a workflow for tracking their personal finances using only the Python ecosystem. The end result is extremely focused on data privacy, uses only open-source software, and is 100% self-hosted.

(是也乎:

等等, 首先私人资金要多少, 才值得上手段来进行金融管理?

)

How and why the author added two new linter rules to Pylint: consider-ternary-expression and while-used.

(是也乎:

圈复杂度的另类使用...?

)

A discussion of EAFP (“Easier to ask for forgiveness than permission”) vs LBYL (“Look before you leap”) code patterns in Python.

(是也乎:

嗯哼? 还有这种编程流派的?

)

Nuitka is a Python compiler written in Python, compatible with Python2 (2.6, 2.7) and Python3 (3.3–3.9). You feed Nuitka your Python source code and it generates an executable or extension module.

(是也乎:

淦...非官方编译器

)


探讨/吐糟

Discussions

(是也乎:

怎么都是 Django 相关的讨论?

Django 接下来重要问题和其它框架类似: 云原生, 开发速度, 运行速度

)

(是也乎:

hallo world
hello world
hollo world
hillo world
hullo world

)


文章/教程/嗯哼

Articles, Tutorials and Talks

How well do you know Python’s math module? Maybe you’ve used a few of the constants or arithmetic functions. You may be surprised by the amount of functionality hiding within this built-in library, and perhaps you don’t need to reach for an additional outside library for common use cases.

(是也乎:

podcast

老司机就是顺滑...

)

“NumPy is now foundational to Python scientific computing. Our efforts reach millions of developers each month. As our user base grows, we recognize that we are neglecting the disabled community by not having our website and documentation up to modern accessibility standards.”

”[…] retrofitting types is a cumbersome and error-prone process. To address this, we propose Type4Py, an ML-based type auto-completion for Python. It assists developers to gradually add type annotations to their codebases.”

Learn how to use ggplot in Python to build data visualizations with plotnine. You’ll discover what a grammar of graphics is and how it can help you create plots in a very concise and consistent way.

(是也乎:

ggplot

ggplot 和 matplotlib 简直天差地别, 完全两种思路/风格以及形式, 不过, 运行的快, 就象 Tk 和其它 GUI 框架的区别, 喜欢的值得深入;

)

“Build your own distributed crawler with custom parsers […] Discover new pages and store the exact content you need, all in less than 300 LOC.”

(是也乎:

其实多数是专项爬取, 并不值得上分布式..

)

“A simple neo4j tutorial about a Python tool that ingests information about all installed Python modules on your computer and visualizes it.”

(是也乎:

其实除非要求网页交互, 否则一个静态图片, 或是系列图片更好管理和使用

)

Learn how to create multiple types of graphs and add legends, titles and more in this tutorial about matplotlib and Python.

(是也乎:

其实, 官方教程就足够了, 有个 The Lifecycle of a Plot

简单道尽天机, 推荐常看 )

How Josh Triplett and his colleagues at Intel got the Python interpreter to run inside the GRUB boot loader.

An account of why the author prefers using the attrs library over Pydantic.


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

doctest 想法很神奇, 只是真要规模化使用, 还是不如集中管理测试案例来的工程化. 不过, 这种贴切的感觉令人怀念, 所以, 当然有改进...

)

(是也乎:

各种仿真测试/模拟 必备模块

)

(是也乎:

叕一个单文件服务, Bottle 早已证明, 一个文件也可以作到很爽

USENET/新闻组 服务, 上古神器, 当年的8卦都在其中流传的...

)

(是也乎:

prettymaps

WoW 风格化地图绘制器

MACAO )

(是也乎:

将环境管理提升到 jupyer 层面了...

)


📆🐍 活动/大会

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


DAMA

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

(是也乎:

独创 logging + debug 模块

)

(是也乎:

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

Bilibili

)


PS:

PPS:

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

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

问为什么:

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

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


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

投稿/反馈邮箱:

askdama@googlegroups.com

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


ZoomQuiet/大妈

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

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

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


Comments



自怼圈/年度番新

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

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

追问

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


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

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