🇨🇳
99 的博客
  • 久韭
  • Python
    • 你真的“创建”了类吗?
    • MRO 三定律
    • 描述器学习指南
    • 描述器实现 property
    • 如何做一个好中介
    • PEP 阅读清单
    • Python 双刃剑
    • 类型标注
    • “类”的渐进式剖析
  • Network
    • IPv6
    • 大道至简
    • DNS 根域
    • RFC 阅读清单
    • 基础公共服务
      • DNS
      • NTP
    • MAC 地址厂商信息
    • 点对点的中介
  • Windows
    • Windows 使用小技巧
  • Linux
    • SSH 技高一筹
    • nftables 速成
    • Linux 30 周年
    • 新时代 Linux 命令
    • 树莓派实时性优化
    • Bash DEBUG 一行搞定
  • 佳作收藏
    • 美文
      • 短篇
        • 爱
        • 弟弟
        • 暗途
        • 噩梦
        • 想象
        • 底线
        • 疯人
        • 雪兔
        • 夺妻
        • 闹钟
        • 虐猫
        • 做起来
        • 陈小手
        • 道德极限
        • 符号控制
        • 与人为友
        • 消失的人
        • 时间旅行
        • 情债肉偿
        • 铁血恋爱
        • 太阳黑子
        • 蚂蚁人生
        • 风骚和魅力
        • 我只要一种
        • 不朽的失眠
        • 秋天的怀念
        • 午夜的汽笛
        • 多美的故事
        • 相信不相信
        • 清晨的变故
        • 真实的高贵
        • 神秘领奖人
        • 幸福的夜晚
        • 幸福的生日
        • 我有事找你
        • 我是个窃贼
        • 最担心的是你
        • 客厅里的爆炸
        • 假如是你的话
        • 愿你慢慢长大
        • 民意与伪民意
        • 婚姻中没有天堂
        • 一种深久的不安
        • 非走不可的弯路
        • 单调产生的快乐
        • 我只是讨厌屈服
        • 跳槽只为“软福利”
        • 你的阅读造就了你
        • 聪明人和傻子和奴才
        • 你永远有做不完的事
        • 精神病院里的年轻人
        • 一位短跑运动员的孤独
        • 那些你所不知道的大事
        • 穿过大半个中国去睡你
        • 我觉得自己会永远生猛下去
      • 长篇
        • 早餐
        • 波心
        • 老王
        • 翻浆
        • 小猫
        • 良娼
        • 自信
        • 黑羊
        • 猫人
        • 斜眼
        • 识人
        • 身价
        • 肯肯舞
        • 狗和猫
        • 热包子
        • 黄裙子
        • 老江湖
        • 逃脱术
        • 侯银匠
        • 太原诅咒
        • 死亡花朵
        • 罗马惊艳
        • 刺青时代
        • 好嘴杨巴
        • 扼杀胎儿
        • 纪念照片
        • 紫色人形
        • 天外飞石
        • 戒烟公司
        • 蔡二少爷
        • 女人的星球
        • 一千张糖纸
        • 爱情与投资
        • 赌徒的遗书
        • 飞越流水线
        • 跟踪狂入门
        • 一桩自杀案
        • 机舱里的钟声
        • 桌子还是桌子
        • 一小时的故事
        • 不存在的女友
        • 谁在编造历史
        • 父亲坐在黑暗中
        • 一个小小的建议
        • 彬彬有礼的强盗
        • 18 本画册的爱恋
        • 河流最蓝的地方
        • 好人总会有人疼
        • 偷听谈话的妙趣
        • 公主整夜不能睡
        • 他们那时多有趣
        • 布莱克·沃兹沃斯
        • 坐在路边鼓掌的人
        • 最伟大的科幻小说
        • 你丈夫是干什么的
        • 谁也看不见的阳台
        • 上午打瞌睡的女孩
    • 段子
      • 程序员段子
      • 二次元段子
      • 大老师片段
      • 金句
      • 喝痰
      • 数学家
      • 牛子
      • 男 ♂ 语
      • 甲方乙方
      • 新编故事四则
      • 没人知道大东为何在此舞蹈
  • 日常随记
    • 坑
    • 豆知识
    • 逻辑推断
    • 观影后记
    • LaMDA 有意识吗?
    • VS Code Vim 速记
    • QQ 空间表情符号
    • ZEN of DEBUG
    • 数据收集的途径
    • 呼叫转移设置方式
    • 空中浩劫 ACI 经典
    • 联机海难特色简述
    • 智能家居入门指南
    • 财政学笔记
    • 行为与实验经济学笔记
    • 电商管理学笔记
由 GitBook 提供支持
在本页
  • PEP 0 -- IndePEPx of Python Enhancement Proposals (PEPs)
  • Python 增强建议(PEP)的索引
  • PEP 索引
  • 【浏览】
  • PEP 1 -- PEP Purpose and Guidelines
  • PEP 目的和指南
  • 内容简述
  • 【浏览】
  • PEP 8 -- Style Guide for Python Code
  • Python 代码样式指南
  • 代码样式
  • 【理解】:美观简洁,可阅读性
  • PEP 20 -- The Zen of Python
  • Python 之禅
  • import this
  • 【浏览】
  • PEP 230 -- Warning Framework
  • 警告框架
  • warning.warn(message [,category [,stacklevel]]) warnings.filterwarnings(message, category, module, lineno, action)
  • 【理解】:多用 DeprecationWarning 提醒用户过期的内容
  • PEP 249 -- Python Database API Specification v2.0
  • Python 数据库 API 规范 v2.0
  • 数据库 API 2.0
  • 【浏览】
  • PEP 255 -- Simple Generators
  • 简单生成器
  • 生成器的来源
  • 【理解】:世纪大突破啊!
  • PEP 318 -- Decorators for Functions and Methods
  • 函数和方法的装饰器
  • 函数前 @
  • 【理解】:装饰器就是个返回函数的函数
  • PEP 328 – Imports: Multi-Line and Absolute/Relative
  • 导入:多行和绝对/相对形式
  • from .a import b
  • 【理解】:from ... import 默认为相对导入,import 默认为绝对导入
  • PEP 342 -- Coroutines via Enhanced Generators
  • 基于拓展生成器的协程
  • send() throw() close()
  • 【理解】:yield 由语句变为表达式,生成器扩展了新方法
  • PEP 343 -- The "with" Statement
  • “with”声明
  • with @contextmanager
  • 【理解】:@contextmmanager 装饰的函数中包围 yield 的 try 仍线性执行
  • PEP 380 -- Syntax for Delegating to a Subgenerator
  • 委派子生成器的语法
  • yield from
  • 【理解】:yield from 生成的链中异常的处理(可以 throw 到底层)
  • PEP 479 -- Change StopIteration handling inside generators
  • 更改生成器内部的 StopIteration 处理
  • 生成器中主动抛出的 StopIteration 被包装为 RuntimeError
  • 【理解】:防止 yield 链的隐式意外中断
  • PEP 483 -- The Theory of Type Hints
  • typing
  • 【浏览】:就是你把鬼子(静态类型标注)引进村的吗?
  • PEP 484 -- Type Hints
  • 类型提示
  • typing
  • 【浏览】:终究还是躲不开类型
  • PEP 487 -- Simpler customisation of class creation
  • 简化类创建的自定义
  • __set_name__ __init_subclass__
  • 【理解】:__new__ 中先后增添 __set_name__ __init_subclass__
  • PEP 492 -- Coroutines with async and await syntax
  • 具有异步和等待语法的协程
  • async await
  • 【浏览】
  • PEP 508 -- Dependency specification for Python Software Packages
  • Python 软件包依赖关系规范
  • 内容简述
  • 【待阅】
  • PEP 514 -- Python registration in the Windows registry
  • Windows 注册表中的 Python 注册
  • 内容简述
  • 【待阅】
  • PEP 520 -- Preserving Class Attribute Definition Order
  • 保留类属性的定义顺序
  • __definition_order__
  • 【理解】:3.6 中 compact dict 已经替代了 definition_order,字典默认保留插入顺序
  • PEP 525 -- Asynchronous Generators
  • 异步生成器
  • 内容简述
  • 【浏览】
  • PEP 526 -- Syntax for Variable Annotations
  • 变量标注的语法
  • :
  • 【理解】:PEP 484 基础上的变量标注
  • PEP 544 -- Protocols: Structural subtyping (static duck typing)
  • 协议:结构性分型(静态鸭式 typing)
  • 内容简述
  • 【待阅】
  • PEP 557 -- Data Classes
  • 数据类
  • @dataclass
  • 【理解】:collections.namdetuple() 从此有了大个的傻弟弟
  • PEP 560 -- Core support for typing module and generic types
  • 键入模块和泛型类型的核心支持
  • typing
  • 【待阅】
  • PEP 563 Postponed Evaluation of Annotations
  • 延迟的标注求值
  • a: a = ...
  • 【理解】:注解中的前向引用不必再用 ""
  • PEP 572 -- Assignment Expressions
  • 赋值表达式
  • :=
  • 【理解】:之前仅有语句可赋值,现在表达式也可赋值
  • PEP 614 -- Relaxing Grammar Restrictions On Decorators
  • 放宽对装饰器的语法限制
  • @Anything
  • 【理解】:解放装饰器,@ 可跟任意表达式
  • PEP 617 -- New PEG parser for CPython
  • 用于 CPython 的新 PEG 解析器
  • 新的语法解析器
  • 【浏览】
  • PEP 634 -- Structural Pattern Matching: Specification
  • 结构化模式匹配:规范
  • match ... case:
  • 【理解】:as | literal capture _ value () sequence mapping class(__match_args)
  • PEP 635 -- Structural Pattern Matching: Motivation and Rationale
  • 结构化模式匹配:动机和理由
  • match ... case: 的设计考虑
  • 【理解】:构造与获取(匹配)的对称
  • PEP 636 -- Structural Pattern Matching: Tutorial
  • 结构化模式匹配:教程
  • match ... case: 的教程
  • 【理解】:Pythonic 的 switch,使用很便利
  • PEP 680 – tomllib: Support for Parsing TOML in the Standard Library
  • 支持在标准库中解析 TOML
  • tomllib.load tomllib.loads
  • 【理解】:标准库工具需要读 TOML,但是写操作具有复杂的自由度,所以只读不写
  • PEP 3107 -- Function Annotations
  • 函数标注
  • __annotations__
  • 【理解】:identifier [: expression] [= expression]
  • PEP 3115 -- Metaclasses in Python 3000
  • Python 3000 中的元类
  • __prepare__()
  • 【理解】:搭配 3.6 引入的 compact dict 可控制类属性创建顺序
  • PEP 3119 -- Introducing Abstract Base Classes
  • 介绍抽象基类
  • abc
  • 【理解】:抽象基类相关,便于检查具体接口实现情况
  • PEP 3129 -- Class Decorators
  • 类装饰器
  • 类前 @
  • 【理解】:PEP 318 @ 只能用在函数和方法前,这里扩展到类
  • PEP 3134 – Exception Chaining and Embedded Tracebacks
  • 异常链接和嵌入式回溯
  • PEP 3135 -- New Super
  • 新 super
  • super() __class__
  • 【理解】:方法内可以直接用 __class__,且 super() 可省略参数
  • PEP 3153 -- Asynchronous IO support
  • 异步 IO 支持
  • asyncio
  • 【待阅】
  • PEP 3333 -- Python Web Server Gateway Interface v1.0.1
  • Python Web 服务器网关接口 v1.0.1
  • WSGI
  • 【浏览】
  • 模板
  • 标题翻译
  • 内容简述
  • 【待阅】【浏览】【理解】
在GitHub上编辑
  1. Python

PEP 阅读清单

Python Enhancement Proposals

上一页如何做一个好中介下一页Python 双刃剑

最后更新于2年前

只是一份简单的清单,只看右侧目录即可获得所有信息。

PEP 0 -- IndePEPx of Python Enhancement Proposals (PEPs)

Python 增强建议(PEP)的索引

PEP 索引

【浏览】

PEP 1 -- PEP Purpose and Guidelines

PEP 目的和指南

内容简述

【浏览】

PEP 8 -- Style Guide for Python Code

Python 代码样式指南

代码样式

【理解】:美观简洁,可阅读性

PEP 20 -- The Zen of Python

Python 之禅

import this

【浏览】

PEP 230 -- Warning Framework

警告框架

warning.warn(message [,category [,stacklevel]]) warnings.filterwarnings(message, category, module, lineno, action)

【理解】:多用 DeprecationWarning 提醒用户过期的内容

PEP 249 -- Python Database API Specification v2.0

Python 数据库 API 规范 v2.0

数据库 API 2.0

【浏览】

PEP 255 -- Simple Generators

简单生成器

生成器的来源

【理解】:世纪大突破啊!

PEP 318 -- Decorators for Functions and Methods

函数和方法的装饰器

函数前 @

【理解】:装饰器就是个返回函数的函数

PEP 328 – Imports: Multi-Line and Absolute/Relative

导入:多行和绝对/相对形式

from .a import b

【理解】:from ... import 默认为相对导入,import 默认为绝对导入

PEP 342 -- Coroutines via Enhanced Generators

基于拓展生成器的协程

send() throw() close()

【理解】:yield 由语句变为表达式,生成器扩展了新方法

PEP 343 -- The "with" Statement

“with”声明

with @contextmanager

【理解】:@contextmmanager 装饰的函数中包围 yield 的 try 仍线性执行

PEP 380 -- Syntax for Delegating to a Subgenerator

委派子生成器的语法

yield from

【理解】:yield from 生成的链中异常的处理(可以 throw 到底层)

PEP 479 -- Change StopIteration handling inside generators

更改生成器内部的 StopIteration 处理

生成器中主动抛出的 StopIteration 被包装为 RuntimeError

【理解】:防止 yield 链的隐式意外中断

PEP 483 -- The Theory of Type Hints

类型提示的理论

typing

【浏览】:就是你把鬼子(静态类型标注)引进村的吗?

PEP 484 -- Type Hints

类型提示

typing

【浏览】:终究还是躲不开类型

PEP 487 -- Simpler customisation of class creation

简化类创建的自定义

__set_name__ __init_subclass__

【理解】:__new__ 中先后增添 __set_name__ __init_subclass__

PEP 492 -- Coroutines with async and await syntax

具有异步和等待语法的协程

async await

【浏览】

PEP 508 -- Dependency specification for Python Software Packages

Python 软件包依赖关系规范

内容简述

【待阅】

PEP 514 -- Python registration in the Windows registry

Windows 注册表中的 Python 注册

内容简述

【待阅】

PEP 520 -- Preserving Class Attribute Definition Order

保留类属性的定义顺序

__definition_order__

【理解】:3.6 中 compact dict 已经替代了 definition_order,字典默认保留插入顺序

PEP 525 -- Asynchronous Generators

异步生成器

内容简述

【浏览】

PEP 526 -- Syntax for Variable Annotations

变量标注的语法

:

【理解】:PEP 484 基础上的变量标注

PEP 544 -- Protocols: Structural subtyping (static duck typing)

协议:结构性分型(静态鸭式 typing)

内容简述

【待阅】

PEP 557 -- Data Classes

数据类

@dataclass

【理解】:collections.namdetuple() 从此有了大个的傻弟弟

PEP 560 -- Core support for typing module and generic types

键入模块和泛型类型的核心支持

typing

【待阅】

PEP 563 Postponed Evaluation of Annotations

延迟的标注求值

a: a = ...

【理解】:注解中的前向引用不必再用 ""

PEP 572 -- Assignment Expressions

赋值表达式

:=

【理解】:之前仅有语句可赋值,现在表达式也可赋值

PEP 614 -- Relaxing Grammar Restrictions On Decorators

放宽对装饰器的语法限制

@Anything

【理解】:解放装饰器,@ 可跟任意表达式

PEP 617 -- New PEG parser for CPython

用于 CPython 的新 PEG 解析器

新的语法解析器

【浏览】

PEP 634 -- Structural Pattern Matching: Specification

结构化模式匹配:规范

match ... case:

【理解】:as | literal capture _ value () sequence mapping class(__match_args)

PEP 635 -- Structural Pattern Matching: Motivation and Rationale

结构化模式匹配:动机和理由

match ... case: 的设计考虑

【理解】:构造与获取(匹配)的对称

PEP 636 -- Structural Pattern Matching: Tutorial

结构化模式匹配:教程

match ... case: 的教程

【理解】:Pythonic 的 switch,使用很便利

PEP 680 – tomllib: Support for Parsing TOML in the Standard Library

支持在标准库中解析 TOML

tomllib.load tomllib.loads

【理解】:标准库工具需要读 TOML,但是写操作具有复杂的自由度,所以只读不写

PEP 3107 -- Function Annotations

函数标注

__annotations__

【理解】:identifier [: expression] [= expression]

PEP 3115 -- Metaclasses in Python 3000

Python 3000 中的元类

__prepare__()

【理解】:搭配 3.6 引入的 compact dict 可控制类属性创建顺序

PEP 3119 -- Introducing Abstract Base Classes

介绍抽象基类

abc

【理解】:抽象基类相关,便于检查具体接口实现情况

PEP 3129 -- Class Decorators

类装饰器

类前 @

【理解】:PEP 318 @ 只能用在函数和方法前,这里扩展到类

PEP 3134 – Exception Chaining and Embedded Tracebacks

异常链接和嵌入式回溯

PEP 3135 -- New Super

新 super

super() __class__

【理解】:方法内可以直接用 __class__,且 super() 可省略参数

PEP 3153 -- Asynchronous IO support

异步 IO 支持

asyncio

【待阅】

PEP 3333 -- Python Web Server Gateway Interface v1.0.1

Python Web 服务器网关接口 v1.0.1

WSGI

【浏览】

模板

标题翻译

内容简述

【待阅】【浏览】【理解】

https://www.python.org/dev/peps/