跳转至

571-580

Issue #571 Maze Solvers, Conference Talks, Text Processing, and More April 4, 2023

死去的pep突然攻击我?

Issue #572 Python 3.12 Error Messages, Monorepos, Effective Packaging, and More April 11, 2023

Cite

Python 3.12 Preview: Ever Better Error Messages
Python 3.12 will be released in October 2023. In this tutorial, you’ll preview one of its upcoming features: even more precise error messages that’ll help you debug your code more efficiently. REAL PYTHON

Did you mean: "Python 3.12" ?

Cite

Syntactic Sugar
“In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language ‘sweeter’ for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer.” BRETT CANNON

博客还可以,有其他的内容

Issue #573 Self-Healing Code, Pandas 2.0 Performance, Automation, and More April 18, 2023

继续加强类型声明

Cite

PEP 711: Standard Format for Distributing Python Binaries
This PEP proposes a way of packaging pre-build interpreters “like wheels, but for python interpreters”. The intent is to re-use existing packaging standards as much as possible. PYTHON.ORG

直接把Python解释器都给打包进去了可还行

Issue #574 PyPI Trusted Publishers, Namespaces, ChatGPT REPL, and More April 25, 2023

Cite

PyPI Introduces “Trusted Publishers”
PyPI package maintainers can adopt a new, more secure “OIDC authenticated” publishing method that does not require long-lived passwords or API tokens to be shared with external systems. PYPI.ORG

1

可以,但没必要

Cite

Dependency Injection in Python
“Dependency Injection (DI) is a design pattern that encourages loose coupling, maintainability, and testability within software applications.” Though more often associated with statically typed languages, the pattern can be applied with Python. PATRICK KALKMAN

依赖注入是一种强大的设计模式,可以促进松耦合、可维护性和可测试性。但是由于Python的动态性,依赖注入用的并不常见

Issue #575 Object Oriented Python, PyCon 2023, Mastodon Bot, and More May 2, 2023

Cite

Python Classes: The Power of Object-Oriented Programming
In this tutorial, you’ll learn how to create and use full-featured classes in your Python code. Classes provide a great way to solve complex programming problems by approaching them through models that represent real-world objects. REAL PYTHON

Python类的各种使用,内容还是比较全面而且简明的

很多的包只有一个对外的接口,这个pep提议给包一个可以调用的方式,更加有利于阅读。感觉是个不错的提议,尤其是很多的第三方包,确实只有一个接口

提供了高层次的api,这不直接把requests给干死了

import urllib3

resp = urllib3.request("GET", "https://example.com")

print(resp.status)
# 200
print(resp.headers.get("Content-Type"))
# text/html; charset=UTF-8

仓库在https://github.com/mitsuhiko/rye,看功能包括了Python安装、环境管理、依赖管理,是个大而全的工具,star很多,issue很少

Cite

Debugging a Mixed Python and C Language Stack
Debugging is difficult. Debugging across multiple languages is especially challenging, and debugging across devices often requires a team with varying skill. This article describes the process one team uses to debug across a mixed Python/C stack. ENTSCHEV & ZAITLEN

记录了一次debug的过程,还是很有意思的,最后发现是numba的bug,由于把Python的函数当做回调函数传给了cuda,cuda在回调的时候又拿不到GIL导致的死锁,debug主要用的是gdb,用法学起来肯定不难, 难的是要对Python、Python解释器、Cuda啥的都有了解才能debug。Python和C混合编程确实要注意很多,debug也要更加注意

Issue #576 SOLID OOP, Mojo, PyCon Keynote, and More May 9, 2023

Cite

How Do You Install Python?
BOB BELDERBOS • Shared by Bob

1

Cite

TQDM: Tracking the Progress of Your Python Program
This article introduces you to TQDM, a console based progress bar library. It shows you how to use it within your software including ways of customizing its appearance. SIDDIQI

简单介绍,简单使用

Issue #577 Faster CPython at PyCon, Trusted Publishing, Packaging, and More May 16, 2023

Cite

Faster CPython at PyCon
This article summarizes the report the Faster CPython team gave at PyCon 2023. It gives information on PEP 659 Specializing Adaptive Interpreter and other performance improvements on the roadmap. JAKE EDGE

关于CPython的加速计划,已经有一部分功能在3.11中放出来了,

Cite

How to Write Tests That Need a Lot of Data?
Imagine you work on a Django project. You want to test your application with unit tests and integrations tests. Your application has lots of database tables, which need to be filled with realistic data for each test case. This article explains 3 techniques that will help you to fill the database with a lot of data for each test case. SANDER KOOIJMANS

搁这拿工作周报当技术博客,我以为是怎么解决测试数据太大的问题,正好我需要,但是只是介绍了一些测试数据的生成

Cite

The Contradictions in ‘The Zen of Python’
This is a summary of Christopher Neugebauer’s talk at PyCascades reminding attendees how foolish consistency can be a hobgoblin to productivity. DAVID CASSEL

总有人觉得他比作者懂得多

Cite

Dependency Issues Checker
GITHUB.COM/FPGMAAS • Shared by Florian

检测项目中的依赖问题,比如用了没有声明,或者声明了但是没有用,或者版本不对等等

Issue #578 Coding With ChatGPT, Pydantic's Future, Properties, and More May 23, 2023

Cite

Faster CPython at PyCon, Part Two
This is the second part of an article describing the conversations at PyCon around CPython optimizations and performance improvements being worked on as part of the Faster CPython project. JAKE EDGE

一些更新和优化的进展

Issue #579 Using call(), Django Custom Sorts, Decorators, and More May 30, 2023

Cite

The Power of Bit Manipulation
In this article, you learn about bit manipulation and how to solve problems efficiently using it in Python. ANURAG VERMA

关于位运算的各种操作和例子,写的还是很不错的

Cite

unimport: Remove Unused Import Statements in Your Code
GITHUB.COM/HAKANCELIKDEV • Shared by Hakan Çelik

可以去除没有用的import语句然后格式化

Issue #580 Facial Recognition, PyPI 2FA, Kivy, and More June 6, 2023

Cite

Python 3.13 Removes 20 Stdlib Modules
Core developers are busy working on PEP 594, removing dead batteries from Python 3.13. This long post in the discussion forum highlights what work has been completed so far. VICTOR STINNER

删除了一些早就废弃不用的标准库模块,看了一下确实都是没用过的了,就是看第三方库受影响的程度吧

Cite

The Many Problems With Celery
“Celery is the de facto solution for background workers and cron jobs in the Python ecosystem, but it’s full of footguns.” This article describes the problems and offers some solutions. STEVE DIGNAM

很好的一篇文章,主要介绍了Celery的一些问题,同时还贴心的给出了怎么解决(虽然大部分都解决不了,只能忍受或者自己搞),正好最近打算用Celery做个算法任务调度的系统。 确实文章中说的一些问题是存在的,而且有的比较坑,但是确实Celery现在是Python领域的消息队列事实标准,没有更好的选择了,像其他的消息队列框架功能又 太少,完全是玩具状态没法用。所以当前这个时间节点来看,也只能凑合用Celery,遇到具体的问题再去想办法解决吧。强烈建议写代码之前先看一遍Celery的配置文档, 多多少少能提前看到一些坑。

评论