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-07-12
Python 版本:
2.0
发布历史:


目录

引言

本 PEP 描述了 Python 2.0 发布计划,跟踪主要新功能的状态和所有权,总结了在邮件列表论坛中进行的讨论,并提供了进一步信息、补丁和其他未解决问题的 URL。 此文件的 CVS 修订历史包含权威的历史记录。

发布计划

[2000 年 10 月 5 日修订]

  • 2000-09-26: 2.0 beta 2
  • 2000-10-09: 2.0 发布候选版本 1 (2.0c1)
  • 2000-10-16: 2.0 正式版

之前的里程碑

  • 2000-08-14: 所有 2.0 PEP 完成 / 功能冻结
  • 2000-09-05: 2.0 beta 1

什么是发布候选版本 1?

我们相信发布候选版本 1 将修复我们打算在 2.0 正式版发布之前修复的所有已知错误。 此版本应该比之前的测试版更稳定。 我们希望在正式版发布之前看到更广泛的测试,因此我们正在发布此发布候选版本。 除非测试人员在发布候选版本中发现任何阻止发布(或棕色袋)的错误,否则正式版将完全相同。

提交补丁和更改的指南

在提交更改时请保持理性。 你应该知道我们所说的理性是什么意思,否则我们不会给你提交权限 <0.5 眨眼>。 有些关于理性的具体示例包括

  • 听从独裁者的指示。
  • 首先在 python-dev 上讨论任何有争议的更改。 如果你获得了很多 +1 票而没有 -1 票,请进行更改。 如果你获得了一些 -1 票,请三思而后行; 考虑询问 Guido 的意见。
  • 如果更改是针对你贡献的代码,那么你可能应该自己修复它。
  • 如果更改影响了其他人编写的代码,那么你可能应该先征求他们的意见。
  • 你可以使用 SF Patch Manager 提交补丁并将其分配给某人进行审查。

任何重要的新功能必须在将其签入之前以 PEP 的形式进行描述并获得批准。

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

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

如果你从 SF Patch Manager 提交补丁或修复了来自 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 正式版发布之前解决

决定是否应该默认启用 cycle-gc。

解决核心 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
  • 支持 opcode 参数 > 2**16 - Charles Waldman SF Patch 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(…)”。 新代码在 N != 1 时生成对 xrange() 的最小调用,并将其包含在 (... * N) 中。 这使得 repr() 更具可读性,同时使其做到了 repr 所宣传的功能。 它还使 xrange 对象在交互式解释器中工作时更加明显。
  • 扩展的 print 语句 - Barry Warsaw PEP 214 SF Patch #100970 http://sourceforge.net/patch/?func=detailpatch&patch_id=100970&group_id=5470
  • 对 poll 系统调用的接口 - Andrew Kuchling SF Patch 100852
  • 增强赋值 - Thomas Wouters 添加 += 及其家族,以及 Python 和 C 钩子,以及 API 函数。
  • gettext.py 模块 - Barry Warsaw

推迟

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

    http://starship.python.net/~vlad/lineno/ 用于(当时正在运行的)补丁

    python-dev 上的讨论

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

拒绝

  • “索引-for” - Thomas Wouters 特殊语法,使 Python 代码能够访问“for”循环中的循环计数器。 (无需添加新的关键字。)

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

上次修改时间: 2023-09-09 17:39:29 GMT