Skip to content

Python 各版本可以退场的代码 #59685

Closed as not planned
Closed as not planned

Description

@SigureMo

我们在开发过程中难免会有一些版本兼容代码,但这些代码应当在旧版本退场时进行清理,这里记录一些我个人阅读代码、开发过程中所了解到的一些版本兼容代码,欢迎大家补充

已退场版本

Python 3.7

Python 3.8

Python 3.9

Python 3.10

Python 3.11

Python 3.12

  • SOT NULL fn 布局的处理,Python 3.13 中全部使用 fn NULL 布局,包括 NullVariable 的 __call__、gen_load_null_variable 等操作应该也不具备实际意义,均可清理

Python 3.13

  • PEP 563 from __future__ import annotations2,Python 3.14 中已经被 PEP 6493 所取代
  • test/sot/test_26_t_string.py 奇怪的写法可以修改下了,用正常的写法即可

Footnotes

  1. PEP 584 – Add Union Operators To dict ↩

  2. PEP 563 – Postponed Evaluation of Annotations ↩

  3. PEP 649 – Deferred Evaluation Of Annotations Using Descriptors ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions