Following system colour scheme - Python 增强提案 Selected dark colour scheme - Python 增强提案 Selected light colour scheme - Python 增强提案

Python 增强提案

PEP 200 – Python 2.0 发布日程

作者:
Jeremy Hylton <jeremy at alum.mit.edu>
状态:
最终版
类型:
信息性
主题:
发布
创建日期:
2000年7月12日
Python 版本:
2.0
发布历史:


目录

引言

本PEP描述了Python 2.0的发布日程,跟踪了主要新特性的状态和所有权,总结了邮件列表论坛中的讨论,并提供了进一步信息、补丁和其他未决问题的URL。此文件的CVS修订历史记录了明确的历史记录。

发布时间表

[2000年10月5日修订]

  • 2000年9月26日:2.0 beta 2
  • 2000年10月9日:2.0 发布候选版本 1 (2.0c1)
  • 2000年10月16日:2.0 最终版本

以前的里程碑

  • 2000年8月14日:所有2.0 PEP完成/功能冻结
  • 2000年9月5日:2.0 beta 1

什么是发布候选版本1?

我们相信发布候选版本1将修复所有我们打算在2.0最终版本中修复的已知错误。此版本应比之前的测试版本更稳定。我们希望在最终发布前进行更广泛的测试,因此我们正在发布此候选版本。除非测试人员发现任何阻碍性(或“褐皮书”)错误,否则最终版本将完全相同。

提交补丁和进行更改的指导方针

提交更改时请运用常识。你应该知道我们所说的常识是什么意思,否则我们不会给你提交权限 <0.5 眨眼>。一些常识的具体例子包括

  • 听从独裁者的一切指示。
  • 首先在 python-dev 上讨论任何有争议的更改。如果你收到大量 +1 票而没有 -1 票,则进行更改。如果你收到一些 -1 票,请三思;考虑询问 Guido 的意见。
  • 如果更改是你贡献的代码,那么由你来修复它可能更合理。
  • 如果更改影响到其他人编写的代码,那么最好先征求他或她的意见。
  • 你可以使用SF补丁管理器提交补丁并将其分配给某人进行审查。

任何重大的新功能都必须在PEP中描述并在被检入之前获得批准。

任何重要的代码添加,例如新模块或大型补丁,都必须包含回归测试的测试用例和文档。补丁在测试和文档准备好之前不应被检入。

如果你修复了一个错误,你应该编写一个能够捕获该错误的测试用例。

如果您从 SF 补丁管理器提交补丁或修复 Jitterbug 数据库中的错误,请务必在 CVS 日志消息中引用补丁/错误编号。同时,请务必更改补丁管理器或错误数据库中的状态(如果您有权访问错误数据库)。

任何已签入的代码导致回归测试失败都是不可接受的。如果签入导致失败,必须在24小时内修复,否则将被撤销。

所有贡献的C代码必须是ANSI C。如果可能,请使用两种不同的编译器检查,例如gcc和MSVC。

所有贡献的Python代码必须遵循Guido的Python风格指南。https://pythonlang.cn/doc/essays/styleguide.html

任何贡献的代码都将被理解为在开源许可下发布。如果不能以这种方式发布,请勿贡献代码。

失败的测试用例需要修复

我们需要快速解决回归测试套件中的错误。除非在应用更改后回归测试运行干净,否则不应将更改提交到CVS树。如果它失败了,代码中可能潜伏着错误。(无论如何,可能存在错误,但那是另一回事。)如果测试用例已知会失败,它们就没有任何用处。

test case         platform    date reported
---------         --------    -------------
test_mmap         Win ME      03-Sep-2000       Windows 2b1p2 prelease
    [04-Sep-2000 tim
     reported by Audun S. Runde mailto:audun@mindspring.com
     the mmap constructor fails w/
        WindowsError: [Errno 6] The handle is invalid
     since there are no reports of this failing on other
     flavors of Windows, this looks like to be an ME bug
    ]

开放项 – 在2.0最终版本发布前需要解决

决定是否默认启用循环垃圾回收。

解决核心xml包与XML-SIG XML包之间的兼容性问题。

更新 Tools/compiler,使其兼容列表推导式、import as 和其他新的语言特性。

提高测试套件的代码覆盖率。

完成为随2.0b1版本发布的功能编写PEP(!悲伤,但现实——我们会通过实践变得更好)。

一项重大努力是将错误数据库削减到合适的规模。我(tim)以前见过这种情况:如果你能让所有未解决的错误都在一个屏幕上显示,人们通常会保持这种状态。但如果让它在一个屏幕上溢出一个月,它就会一团糟(确实没有“可见的进展”!)。

已接受且正在进行中

  • 目前没有留下。[2000年9月4日 guido]

开放:已提出但尚未接受或拒绝

  • 又有一些未解决的补丁。我们需要尽快清理这些。

以前失败的测试用例

如果你发现一个测试在这部分和前一部分之间来回跳动,那么它正在测试的代码就有问题了!

test case         platform    date reported
---------         --------    -------------
test_fork1        Linux       26-Jul-2000
    [28-aug-2000 fixed by cgw; solution is to create copies of
    lock in child process]
    [19-Aug-2000 tim
     Charles Waldman whipped up a patch to give child processes a new
     "global lock":
     http://sourceforge.net/patch/?func=detailpatch&patch_id=101226&group_id=5470
     While this doesn't appear to address the symptoms we *saw*, it
     *does* so far appear to be fixing the failing cases anyway
    ]

test_parser       all         22-Aug-2000
test_posixpath    all         22-Aug-2000

test_popen2       Win32       26-Jul-2000
    [31-Aug-2000 tim
     This died again, but for an entirely different reason:  it uses a
     dict to map file pointers to process handles, and calls a dict
     access function during popen.close().  But .close releases threads,
     which left the internal popen code accessing the dict without a
     valid thread state.  The dict implementation changed so that's no
     longer accepted.  Fixed by creating a temporary thread state in the
     guts of popen's close routine, and grabbing the global lock with
     it for the duration]
    [20-Aug-2000 tim
     changed the popen2.py _test function to use the "more" cmd
     when os.name == "nt".  This makes test_popen2 pass under
     Win98SE.
     HOWEVER, the Win98 "more" invents a leading newline out
     of thin air, and I'm not sure that the other Windows flavors
     of "more" also do that.
     So, somebody please try under other Windows flavors!
    ]
    [still fails 15-Aug-2000 for me, on Win98 - tim
         test test_popen2 crashed -- exceptions.AssertionError :
     The problem is that the test uses "cat", but there is
     no such thing under Windows (unless you install it).
     So it's the test that's broken here, not (necessarily)
     the code.
    ]

test_winreg        Win32      26-Jul-2000
    [works 15-Aug-2000 for me, on Win98 - tim]

test_mmap          Win32      26-Jul-2000
    [believe that was fixed by Mark H.]
    [works 15-Aug-2000 for me, on Win98 - tim]

test_longexp      Win98+?     15-Aug-2000
    [fails in release build,
     passes in release build under verbose mode but doesn't
         look like it should pass,
     passes in debug build,
     passes in debug build under verbose mode and looks like
         it should pass
    ]
    [18-Aug-2000, tim:  can't reproduce, and nobody else
     saw it.  I believe there *is* a subtle bug in
     regrtest.py when using -v, and I'll pursue that,
     but can't provoke anything wrong with test_longexp
     anymore; eyeballing Fred's changes didn't turn up
     a suspect either
     19-Aug-2000, tim: the "subtle bug" in regrtest.py -v is
     actually a feature:  -v masks *some* kinds of failures,
     since it doesn't compare test output with the canned
     output; this is what makes it say "test passed" even
     in some cases where the test fails without -v
    ]

test_winreg2      Win32       26-Jul-2000
    [20-Aug-2000 tim - the test has been removed from the project]
    [19-Aug-2000 tim
     This test will never work on Win98, because it's looking for
     a part of registry that doesn't exist under W98.
     The module (winreg.py) and this test case will be removed
     before 2.0 for other reasons, though.
    ]
    [still fails 15-Aug-2000 for me, on Win98 - tim
     test test_winreg2 failed -- Writing: 'Test Failed: testHives',
     expected: 'HKEY_PERFORMANCE_DATA\012'
    ]

开放项 – 已完成/已修复

[4-Sep-2000 guido: Fredrik finished this on 1-Sep]
* PyErr_Format - Fredrik Lundh
  Make this function safe from buffer overflows.

[4-Sep-2000 guido: Fred has added popen2, popen3 on 28-Sep]
Add popen2 support for Linux -- Fred Drake

[4-Sep-2000 guido: done on 1-Sep]
Deal with buffering problem with SocketServer

[04-Sep-2000 tim:  done; installer runs; w9xpopen not an issue]
[01-Sep-2000 tim:  make a prerelease available]
Windows ME:  Don't know anything about it.  Will the installer
even run?  Does it need the w9xpopen hack?

[04-Sep-2000 tim:  done; tested on several Windows flavors now]
[01-Sep-2000 tim:  completed but untested except on Win98SE]
Windows installer:  If HKLM isn't writable, back off to HKCU (so
Python can be installed on NT & 2000 without admin privileges).

[01-Sep-200 tim - as Guido said, runtime code in posixmodule.c doesn't
 call this on NT/2000, so no need to avoid installing it everywhere.
 Added code to the installer *to* install it, though.]
Windows installer:  Install w9xpopen.exe only under Win95/98.

[23-Aug-2000 jeremy - tim reports "completed recently"]
Windows:  Look for registry info in HKCU before HKLM - Mark
Hammond.

[20-Aug-2000 tim - done]
Remove winreg.py and test_winreg2.py.  Paul Prescod (the author)
now wants to make a registry API more like the MS .NET API.  Unclear
whether that can be done in time for 2.0, but, regardless, if we
let winreg.py out the door we'll be stuck with it forever, and not
even Paul wants it anymore.

[24-Aug-2000 tim+guido - done]
Win98 Guido:  popen is hanging on Guido, and even freezing the
whole machine.  Was caused by Norton Antivirus 2000 (6.10.20) on
Windows 9x.  Resolution: disable virus protection.

已接受并完成

  • 更改 \x 转义符的含义 - PEP 223 - Fredrik Lundh
  • 在u""字符串中添加U1234678转义符 - Fredrik Lundh
  • 支持操作码参数 > 2**16 - Charles Waldman SF 补丁 100893
  • “import as” - Thomas Wouters 扩展“import”和“from … import”机制,以允许将符号作为另一个名称导入。(无需添加新关键字。)
  • 列表推导式 - Skip Montanaro Tim Peters 仍需完成 PEP。
  • 恢复旧的 os.path.commonprefix 行为 我们是否有在所有平台上都能运行的测试用例?
  • Tim O'Malley 的 cookie 模块,带有良好的许可证
  • 步进迭代(“zip”函数) - Barry Warsaw
  • SRE - Fredrik Lundh [至少我**认为**它已完成,截至2000年8月15日 - tim]
  • 修复 xrange 打印行为 - Fred Drake 移除 xrange 类型的 tp_print 处理器;它会生成列表显示而不是 'xrange(...)'。新代码生成对 xrange() 的最小调用,当 N != 1 时用 (... * N) 包裹。这使得 repr() 更具可读性,同时使其符合 reprs 所宣称的功能。它还使得在交互式解释器中工作时 xrange 对象更加明显。
  • 扩展的print语句 - Barry Warsaw PEP 214 SF 补丁 #100970 http://sourceforge.net/patch/?func=detailpatch&patch_id=100970&group_id=5470
  • poll系统调用接口 - Andrew Kuchling SF补丁100852
  • 增强赋值 - Thomas Wouters 添加 += 及其家族,以及 Python 和 C 钩子,和 API 函数。
  • gettext.py 模块 - Barry Warsaw

已推迟

  • 列表上的扩展切片 - Michael Hudson 使列表(和其他内置类型)处理扩展切片。
  • Unicode 数据库压缩 - Fredrik Lundh SF 补丁 100899 至少适用于 2.0b1。可能会作为错误修复包含在 2.0 中。
  • 范围字面量 - Thomas Wouters SF 补丁 100902 我们最终对该提案有很多疑虑。
  • 消除 SET_LINENO 操作码 - Vladimir Marangozov 通过使用代码对象的 lnotab 而非 SET_LINENO 指令实现的小优化。使用代码重写技术(Guido 不赞成)来支持使用 SET_LINENO 的调试器。

    http://starship.python.net/~vlad/lineno/ 用于(当时可用的)补丁

    在 python-dev 上的讨论

  • C 代码的测试工具 - Trent Mick

已拒绝

  • “索引-for” - Thomas Wouters 特殊语法,用于在“for”循环中为Python代码提供对循环计数器的访问。(无需添加新关键字。)

来源:https://github.com/python/peps/blob/main/peps/pep-0200.rst

上次修改:2025-02-01 08:59:27 GMT