3.12: 值得尝试的酷炫新功能

原文: PyCoder's Weekly - Issue #597

pycoder

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

In this tutorial, you’ll learn about the new features in Python 3.12. You’ll explore how the new release extends the better error messages and faster code execution found in the previous version, and you’ll try out the improvements to f-strings and type variable syntax.

(是也乎:

3.12

)

In this tutorial, you’ll see the new static typing features in Python 3.12. You’ll learn about the new syntax for type variables, making generics simpler to define. You’ll also see how @override lets you model inheritance and how you use typed dictionaries to annotate variable keyword arguments.

(是也乎:

Static

)

In this tutorial, you’ll see one of the new features of Python 3.12 and a proposed change to Python 3.13, addressing how subinterpreters work in the CPython program. The changes are described in PEP 684 and PEP 554.

(是也乎:

Subinterpreters

)

(是也乎:

Wow 3.12 时代正式到来

)


探讨/吐糟

Discussions

Folks at Microsoft participated in an Ask-Me-Anything session on the new Python in Excel over Azure feature. See also the Slashdot post which has a good summary.

User studies were conducted on on PEP 722 – Dependency specification for single-file scripts and PEP 723 – Embedding pyproject.toml in single-file scripts , this discussion summarizes the results.


文章/教程/嗯哼

Articles, Tutorials and Talks

What can you learn from feeding an entire book on Python programming into ChatGPT-4 and asking it to provide a technical review? What are the potential pitfalls of using an LLM as a learning tool? This week on the show, author Al Sweigart talks about his recent experiments using ChatGPT and Python.

(是也乎:

ChatGPT

)

This article covers a Mandelbrot-based benchmark of Python, variations of Numba, and the newly available Mojo. Although Mojo is fast it takes a lot more work than the author expected to translate Python to it, and with the right parameters Numba still beats it.

Explores how to programmatically find eligible answers for a Wordle game using Python, based on some guess-score pairs. Works through various bugs and subtleties, showing how to infer tighter constraints and explain why words were rejected.

“In a recent study titled Usage and Attribution of Stack Overflow Code Snippets in GitHub Projects, an answer I wrote almost a decade ago was found to be the most copied snippet on Stack Overflow. Ironically it happens to be buggy.”

(是也乎:

等等, 这是必然的哪, 别人的场景不可能正好吻合自己当前所有条件的哪... 但是, 可用, 可参考就足够了...

)

This article talks about the release of the “Scientific-Python Development Guide” which documents Python package development. It includes cookie-cutter templates and repo tools.

(是也乎:

不是科学的开发 Python, 而是科学家如何用 Python 折腾...

)

This blog post summarizes three recent uses where the author has applied HTMX to his websites, and how they simplified his process.

Miloslav wanted to properly type-hint a decorator. Turns out, it wasn’t the easiest thing to do. Read on for his solution.

A comprehensive deep dive on AB Testing including the math behind knowing whether your tests are significant.

(是也乎:

AB

是的, 你得有一点儿概率的控制计算...

)

Write some Python to explore the data objects Git uses to store your content.

(是也乎:

所以, Rust 社区将这堆东西变成了 SQL 就....爆了...

)


好物/妙品/...

Interesting Projects, Tools and Libraries, Projects & Code

(是也乎:

Piano

一眼就看到中央C

)


📆🐍 活动/大会

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


历史上这周


DAMA

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

         _~∽&~~_
     \/ /  ◴ ◴  \ (/
       '_   ♢   _'
       | '--#--' |

...act by ferris-actor v0.2.4 (built on 23.0303.201916)

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/大妈

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

全职嗯哼: 大妈的多重宇宙 - https://www.youtube.com/@Chaos42DAMA
私自嗯哼: ZoomQuiet (订阅号: ZoomQuiet42)
公开社群: 蟒营 (订阅号: Mainium)

as 创始组织者:
    CPyUG (mailling-list: python-cn@googlegroups.com)
    PyChina (订阅号: PyChinaOrg)
    本地社区: 
        GDG珠海 (订阅号: GDG-ZhuHai)
        AIGC珠海 


Comments


大妈的多重宇宙 - YouTube

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

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


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


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

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