PEP 703:将GIL变成一个开关选项

原文: PyCoder's Weekly - Issue #560

pycoder

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

This PEP proposes changes to the CPython build process that would allow you to build a GIL-less interpreter. This kind of interpreter would not be ABI compatible with the GIL-based one, and the programmer would become responsible for some locking situations in C-extensions. If implemented, this would lead the way to being able to operate without the GIL in cases where backward compatibility issues are not important.

(是也乎:

嗯哼? 就象 Rust 中的 unsafe ?

)

Prototype pollution is a particular attack in JavaScript where the base Prototype object is modified having wide ranging effects. Unfortunately, similar things can be accomplished in Python by messing with class.base. Read on for details.

(是也乎:

Py 内部黑魔法, 如果不是撞上罕见问题一定要用这种解决方案, 一般没事别折腾...

)

Revisit some of your favorite Real Python tutorials and video courses from 2022. It’s been a busy year, with new materials on topics ranging from the basics to web development, machine learning, effective coding environments, and more.

(是也乎:

去年构建的最受欢迎的一系列结构化教程

)


探讨/吐糟

Discussions

(是也乎:

debugging in Python:
- `print()`s alone: too simple
- `import pdb; pdb.set_trace()`: too complex
- `import code; code.interact(local=locals())`: just right
simply drops you into interpreter, perfect for 95% of debugging

原文建议, 参考: Python Examples of code.interact

How To Debug Python with an Interactive Console | DigitalOcean

code --- 解释器基类 — Python 3.11.1 文档

除了不能交互,其它基本上可以解决大部分观察要求了

)


文章/教程/嗯哼

Articles, Tutorials and Talks

You’ll learn how to create web maps from data using folium. The package combines Python’s data wrangling strengths with the data visualization power of the JavaScript library Leaflet. In this tutorial, you’ll create and style a choropleth world map that shows the ecological footprint per country.

(是也乎:

Folium

)

How can you get more performance from your existing data science infrastructure? What if a DataFrame library could take advantage of your machine’s available cores and provide built-in methods for handling larger-than-RAM datasets? This week on the show, Liam Brannigan is here to discuss Polars.

(是也乎:

Polars

)

“No matter what kind of software you’re developing, you most definitely leverage logging to some extent, probably every single day.” This article outlines good cross-language logging practices making it easier to find bugs and understand what has happened in your software.

(是也乎:

0: 一定要用

1: 老实的用

2: 科学的用

)

One of the difficulties when comparing programming languages is that they sometimes use the same words to describe similar things, but always with differences. Sometimes the differences are large enough that we want to use different words, but often they are not.

(是也乎:

英文尽管已经尽力给所有概念都创建一个专用术语, 可惜, IT 行业习惯假借了...

所以, 计算机文档训诂学可能有必要发起

)

Sometimes you might need to use R. Sometimes you might need to use Python. Sometimes you need to use both at the same time. This blog post shows you how to combine R and Python code using {reticulate} and output the results using Quarto.

(是也乎:

哈, 可怜的 R

)

Structured logging is the idea of creating logs that are both human readable and easily machine parsable. This article introduces structured logging, its advantages, and the structlog package for Python.

(是也乎:

这是面向运营的日志了, 如果没有类似 ELK 的平台, 人眼看就难了..

)

As a data format, yaml is extremely complicated and it has many footguns. In this post Ruud explains some of those pitfalls by means of an example and suggests a few simpler and safer yaml alternatives.

(是也乎:

Docker 将 yaml 带到飞, 可惜太复杂了,手工撰写一定出错... TOML 已经从另外一个方向开始了反超...

)

Learn how to log users in with an email instead of a username with Django. This tutorial makes full use of Django’s built-in features to minimise custom code.

Tom got stung by a leaked AWS key a while back and decided to go hunting. This article shows you how he scanned PyPI and just how many leaked keys he found.

(是也乎:

所以, 这种才是暗网主要经济来源?

)


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

GPT 变成热词后, 新项目名不带这个缩写简直就没有关注了...

)

(是也乎:

数据标注工厂基础设施...

)

(是也乎:

还是要手工编写 HTML, 和 Flet 们相比, 缺少生产力吸引哪

)


📆🐍 活动/大会

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

(是也乎:

杜塞尔多夫(德语:Düsseldorf,德语:[ˈdʏsl̩dɔʁf] ),是德国北莱茵-威斯特法伦州首府,位于莱茵河畔。杜塞尔多夫市区人口约62万人,是德国广告、服装和通讯业的重要城市。 杜塞尔多夫也是19世纪德国诗人海因里希·海涅的出生地

)


DAMA

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


PS:

Happy Pythoning!

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

PPS:

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

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

问为什么:

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

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


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

投稿/反馈邮箱:

askdama@googlegroups.com

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


ZoomQuiet/大妈

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

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

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


Comments


大妈的多重宇宙 - YouTube

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

任何问题

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

-->