PEP 4: 標準モジュールの廃止 ========================================== 原文: http://www.python.org/dev/peps/pep-0004/ +---------------+----------------------------------------+ | PEP | 4 | +---------------+----------------------------------------+ | Title | Deprecation of Standard Modules | +---------------+----------------------------------------+ | Version | $Revision$ | +---------------+----------------------------------------+ | Last-Modified | $Date$ | +---------------+----------------------------------------+ | Author | Martin von artin@v.loewis.de> | +---------------+----------------------------------------+ | Status | Active | +---------------+----------------------------------------+ | Type | Process | +---------------+----------------------------------------+ | Created | 1-Oct-2000 | +---------------+----------------------------------------+ | Post-History | | +---------------+----------------------------------------+ .. Introduction --------------------- イントロダクション --------------------- .. When new modules were added to the standard Python library in the past, it was not possible to foresee whether they would still be useful in the future. Even though Python "Comes With Batteries Included", batteries may discharge over time. Carrying old modules around is a burden on the maintainer, especially when there is no interest in the module anymore. 過去に標準Pythonライブラリに加えられたモジュールが、将来に渡って有益であ ると予見することは不可能です。Pythonが"バッテリー内蔵"だとしても、バッテ リーは時間と共に放電していきます。古いモジュールを抱えていることはメンテ ナにとって重荷となります。特に誰もそのモジュールにもはや興味を持っていな いときは。 .. At the same time, removing a module from the distribution is difficult, as it is not known in general whether anybody is still using it. This PEP defines a procedure for removing modules from the standard Python library. Usage of a module may be `deprecated', which means that it may be removed from a future Python release. The rationale for deprecating a module is also collected in this PEP. If the rationale turns out faulty, the module may become `undeprecated'. また、配布物からモジュールを取り除くこと、誰かがそれを使っているかもしれ ないため、難しいです。このPEPでは、標準Pythonライブラリからモジュールを取 り除くための手続きについて述べます。モジュールの使用は'廃止(deprecated)' となる可能性があり、これは将来のPythonリリースで取り除かれる可能性がある ことを意味します。このPEPでは、廃止のための論理的根拠についても述べていき ます。もしもこの根拠が間違っていた場合、そのモジュールは'廃止から復帰 (undeprecated)'となる可能性があります。 .. Procedure for declaring a module deprecated --------------------------------------------- モジュールの廃止宣言に関する手続き --------------------------------------------- .. Since the status of module deprecation is recorded in this PEP, proposals for deprecating modules MUST be made by providing a change to the text of this PEP, which SHOULD be a patch posted to SourceForge, or sent by mail to the author of this PEP. モジュールの廃止状況はこのPEPで記録されているため、廃止が提案されたモジュー ルはこのPEPの変更として提供されなければなりません。変更は、SourceForgeへの パッチか、このPEPの著者へのメールで行われるべきです。 .. A proposal for deprecation of the module MUST include the date of the proposed deprecation and a rationale for deprecating it. In addition, the proposal MUST include a change to the documentation of the module; deprecation is indicated by saying that the module is "obsolete" or "deprecated". The proposal MAY include a patch for the module's source code to indicate deprecation there as well. .. It is expected that deprecated modules are included in the Python releases that immediately follows the deprecation; later releases may ship without the deprecated modules. .. Procedure for declaring a module undeprecated ----------------------------------------------- モジュール廃止をやめて戻す時の手続き ----------------------------------------------- .. When a module becomes deprecated, a rationale is given for its deprecation. In some cases, an alternative interface for the same functionality is provided, so the old interface is deprecated. In other cases, the need for having the functionality of the module may not exist anymore. .. If the rationale is faulty, again a change to this PEP's text MUST be submitted. This change MUST include the date of undeprecation and a rationale for undeprecation. Modules that are undeprecated under this procedure MUST be listed in this PEP for at least one major release of Python. .. Obsolete modules ------------------------- 廃止済みのモジュール ------------------------- .. A number of modules are already listed as obsolete in the library documentation. These are listed here for completeness. いくつかのモジュールはライブラリ文書ですでに廃止と記されています。以下に その完全なリストを記します。 cl, sv, timing .. All these modules have been declared as obsolete in Python 2.0, some even earlier. これらのモジュールすべてはPython 2.0かそれより前に古い形式と宣言されてい ます。 .. The following obsolete modules were removed in Python 2.5: 以下の廃止済みモジュールは Python 2.5で取り除かれました。 addpack, cmp, cmpcache, codehack, dircmp, dump, find, fmt, grep, lockfile, newdir, ni, packmail, Para, poly, rand, reconvert, regex, regsub, statcache, tb, tzparse, util, whatsound, whrandom, zmod .. The following modules were removed in Python 2.6: 以下のモジュールはPython 2.6で取り除かれました。 gopherlib, rgbimg, macfs .. The following modules currently lack a DeprecationWarning: 以下のモジュールは廃止警告がない状態です。 rfc822, mimetools, multifile .. Deprecated modules -------------------- 廃止済みモジュール --------------------- +--------------+--------------------------------------------------------+ | モジュール名 | posixfile | +--------------+--------------------------------------------------------+ | 根拠 | fcntl.lockf()によるより良いロック | +--------------+--------------------------------------------------------+ | 日付 | Before 1-Oct-2000. | +--------------+--------------------------------------------------------+ | 説明 | 廃止とすでに文書化済み | | | Python 2.6にてDeprecation の警告を追加 | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | gopherlib | +--------------+--------------------------------------------------------+ | 根拠 | Gopherプロトコルはもう使用しているユーザがいないため | +--------------+--------------------------------------------------------+ | 日付 | 1-Oct-2000. | +--------------+--------------------------------------------------------+ | 説明 | Python 2.5から廃止と文書化 | | | Python 2.6から廃止 | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | rgbimgmodule | +--------------+--------------------------------------------------------+ | 根拠 | 2001-04-24の c.l.py への投稿で、Jason Petroneがこの | | | モジュールをたまに使うと述べた。2003-11-19以降他の | | | どんな参照も行われなかったため | +--------------+--------------------------------------------------------+ | 日付 | 1-Oct-2000 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.5から廃止と文書化 | | | Python 2.6から廃止 | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | pre | +--------------+--------------------------------------------------------+ | 根拠 | 基本的なPCREエンジンがUnicodeをサポートせず、 | | | Python 1.5.2.からメンテナンスされていないため | +--------------+--------------------------------------------------------+ | 日付 | 10-Apr-2002 | +--------------+--------------------------------------------------------+ | 説明 | 実装の詳細に触れているだけで、全体について触れられて | | | いませんでした。この記述は今は取り除かれました | | | | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | whrandom | +--------------+--------------------------------------------------------+ | 根拠 | このモジュールの初期seedは安全でない場所から継承され | | | 計算されていました。randomモジュールを代わりに | | | 使ってください | +--------------+--------------------------------------------------------+ | 日付 | 11-Apr-2002 | +--------------+--------------------------------------------------------+ | 説明 | このモジュールはPython 2.1以降廃止とされていましたが、 | | | このPEPには記述されていませんでした。 | | | 廃止の警告は Python 2.3がリリースされたあと1年後に | | | 加えられ、さらに一年後に削除されます | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | rfc822 | +--------------+--------------------------------------------------------+ | 根拠 | Python 2.2のE-mailパッケージで置き換わられました。 | +--------------+--------------------------------------------------------+ | 日付 | 18-Mar-2002 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.2.2から、「リリース2.3で廃止予定」と文書化 | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | mimetools | +--------------+--------------------------------------------------------+ | 根拠 | Python 2.2のE-mailパッケージで置き換わられました。 | +--------------+--------------------------------------------------------+ | 日付 | 18-Mar-2002 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.2.2から、「リリース2.3で廃止予定」と文書化 | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | MimeWriter | +--------------+--------------------------------------------------------+ | 根拠 | Python 2.2のE-mailパッケージで置き換わられました。 | +--------------+--------------------------------------------------------+ | 日付 | 18-Mar-2002 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.2.2から、「リリース2.3で廃止予定」と文書化。 | | | Python 2.6ではDeprecationWarningが起こります | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | mimify | +--------------+--------------------------------------------------------+ | 根拠 | Python 2.2のE-mailパッケージで置き換わられました。 | +--------------+--------------------------------------------------------+ | 日付 | 18-Mar-2002 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.2.2から、「リリース2.3で廃止予定」と文書化。 | | | Python 2.6ではDeprecationWarningが起こります | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | rotor | +--------------+--------------------------------------------------------+ | 根拠 | 安全でないアルゴリズムを使っていたため | +--------------+--------------------------------------------------------+ | 日付 | 24-Apr-2003 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.4のライブラリリファレンスから取り除かれました | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | TERMIOS.py | +--------------+--------------------------------------------------------+ | 根拠 | このモジュール内の定数が'termios'モジュールに移動 | +--------------+--------------------------------------------------------+ | 日付 | 10-Aug-2004 | +--------------+--------------------------------------------------------+ | 説明 | このモジュールはPython 2.1から廃止と文書化されていまし | | | たがこのPEPに記述されていませんでした。 | | | Python 2.4以降標準ライブラリから取り除かれています | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | statcache | +--------------+--------------------------------------------------------+ | 根拠 | このキャッシュを使うことは壊れやすく不安定になる傾向が | | | あるos.stat()を直接使うべきである | +--------------+--------------------------------------------------------+ | 日付 | 10-Aug-2004 | +--------------+--------------------------------------------------------+ | 説明 | このモジュールはPython 2.2から廃止と文書化されていまし | | | たがこのPEPに記述されていませんでした。 | | | Python 2.5以降標準ライブラリから取り除かれています | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | mpz | +--------------+--------------------------------------------------------+ | 根拠 | サードパーティのパッケージが似た機能を提供しており | | | GMPのAPIをよりよく包含しているため | +--------------+--------------------------------------------------------+ | 日付 | 10-Aug-2004 | +--------------+--------------------------------------------------------+ | 説明 | このモジュールはPython 2.2から廃止と文書化されていまし | | | たがこのPEPに記述されていませんでした。 | | | Python 2.4以降標準ライブラリから取り除かれています | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | xreadlines | +--------------+--------------------------------------------------------+ | 根拠 | 2.3で導入された'for line in の形式が望ましいため | +--------------+--------------------------------------------------------+ | 日付 | 10-Aug-2004 | +--------------+--------------------------------------------------------+ | 説明 | このモジュールはPython 2.3から廃止と文書化されていまし | | | たがこのPEPに記述されていませんでした。 | | | Python 2.4以降標準ライブラリから取り除かれています | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | multifile | +--------------+--------------------------------------------------------+ | 根拠 | Eメールパッケージによって置き換えられた | +--------------+--------------------------------------------------------+ | 日付 | 21-Feb-2006 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.5にて廃止と文書化 | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | sets | +--------------+--------------------------------------------------------+ | 根拠 | Python 2.4で導入された組み込みのset/fronzensetによって | | | 置き換えられた | +--------------+--------------------------------------------------------+ | 日付 | 12-Jan-2007 | +--------------+--------------------------------------------------------+ | 説明 | Python 2.6にて廃止と文書化 | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | buildtools | +--------------+--------------------------------------------------------+ | 根拠 | 不明 | +--------------+--------------------------------------------------------+ | 日付 | 15-May-2007 | +--------------+--------------------------------------------------------+ | 説明 | Python2.3で廃止と文書化されていましたが、 | | | このPEPへの記述は無視されていました。 | | | Python 2.6ではDeprecationWarningが起こります | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | cfmfile | +--------------+--------------------------------------------------------+ | 根拠 | 不明 | +--------------+--------------------------------------------------------+ | 日付 | 15-May-2007 | +--------------+--------------------------------------------------------+ | 説明 | Python2.4で廃止と文書化されていましたが、 | | | このPEPへの記述は無視されていました。 | | | Python 2.6ではDeprecationWarningが起こります | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | macfs | +--------------+--------------------------------------------------------+ | 根拠 | 不明 | +--------------+--------------------------------------------------------+ | 日付 | 15-May-2007 | +--------------+--------------------------------------------------------+ | 説明 | Python2.3で廃止と文書化されていましたが、 | | | このPEPへの記述は無視されていました。 | | | Python 2.6ではDeprecationWarningが起こります | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | md5 | +--------------+--------------------------------------------------------+ | 根拠 | 'hashlib'モジュールで置き換わられました。 | +--------------+--------------------------------------------------------+ | 日付 | 15-May-2007 | +--------------+--------------------------------------------------------+ | 説明 | Python2.5で廃止と文書化されていましたが、 | | | このPEPへの記述は無視されていました。 | | | Python 2.6ではDeprecationWarningが起こります | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | sha | +--------------+--------------------------------------------------------+ | 根拠 | 'hashlib'モジュールで置き換わられました。 | +--------------+--------------------------------------------------------+ | 日付 | 15-May-2007 | +--------------+--------------------------------------------------------+ | 説明 | Python2.5で廃止と文書化されていましたが、 | | | このPEPへの記述は無視されていました。 | | | Python 2.6ではDeprecationWarningが起こります | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | plat-freebsd2/IN and plat-freebsd3/IN | +--------------+--------------------------------------------------------+ | 根拠 | Platforms are obsolete (last released in 2000) | | | Removed from 2.6 | +--------------+--------------------------------------------------------+ | 日付 | 15-May-2007 | +--------------+--------------------------------------------------------+ | 説明 | None | +--------------+--------------------------------------------------------+ +--------------+--------------------------------------------------------+ | モジュール名 | plat-freebsd4/IN and possibly plat-freebsd5/IN | +--------------+--------------------------------------------------------+ | 根拠 | プラットフォームが古く、サポートされていないため | +--------------+--------------------------------------------------------+ | 日付 | 15-May-2007 | | | Python 2.7で取り除かれました | +--------------+--------------------------------------------------------+ | 説明 | なし | +--------------+--------------------------------------------------------+ .. Deprecation of modules removed in Python 3.0 ------------------------------------------------ Python 3.0で取り除かれるモジュール ------------------------------------------------ .. PEP 3108 lists all modules that have been removed from Python 3.0. They all are documented as deprecated in Python 2.6, and raise a DeprecationWarning if the -3 flag is activated. PEP 3108はPython3.0で取り除かれる全てのモジュールをリストアップしています。 それらのモジュールはすべてPython 2.6で廃止と文書化されており、-3フラグが 有効になっている場合に、DeprecationWarningを発行します。 .. Undeprecated modules ---------------------- 復帰したモジュール ---------------------------- .. None. なし Local Variables: coding: utf-8 End: