废弃Python版本的回滚版本
项目描述
pylegacy
这个库旨在将Python新版本中的回滚内容移植到废弃的Python版本中。
pylegacy
包的树状结构类似于Python标准库,即pylegacy
包含pylegacy.abc
、pylegacy.builtins
、pylegacy.os
等。如果某个功能有回滚版本可用,则可以通过从pylegacy
命名空间导入该功能来使用它。
例如,Python 2.7中的os.makedirs
缺少在Python 3.2中首次引入的exist_ok
参数。为了启用此功能,需要将以下失败的代码片段替换为以下有效的代码片段
import os
os.makedirs("example_folder", exist_ok=True)
# Traceback (most recent call last):
# File "<stdin>", line 1, in <module>
# TypeError: makedirs() got an unexpected keyword argument 'exist_ok'
...
from pylegacy import os
os.makedirs("example_folder", exist_ok=True)
许可证
pylegacy
包在MIT许可证下发布(参见LICENSE
文件)
Copyright (c) 2021-2024 Víctor Molina García
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
《pylegacy》包的很大一部分是 Python 标准库的派生作品。Python 源代码根据 PSF-2.0 许可协议发布,版权所有 (c) 2001-2022 Python 软件基金会,保留所有权利。可以在 LICENSE.PSF-2.0
文件中找到 PSF-2.0 许可协议的副本。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。
源代码分发
pylegacy-0.2.1.zip (36.4 kB 查看哈希值)
构建分发
pylegacy-0.2.1-py2.py3-none-any.whl (14.5 kB 查看哈希值)
关闭
pylegacy-0.2.1.zip 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 1c496840de6d5e79ab27d5945a9ac33838761fdcd81b34560dbe442c3c8009c9 |
|
MD5 | 4bf3a5ed3f9e113513a2f42e164adb68 |
|
BLAKE2b-256 | d1ebe387f9100dc5f0dd841f929db05b20be4a83e575c6a2725fa6932b6a20a4 |
关闭
pylegacy-0.2.1-py2.py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | a145cd7988506f90d7dc82164c4fc0da06a29d474137d40833d166d59c071984 |
|
MD5 | 0e79eaf54bebbbedbfb9baea71266996 |
|
BLAKE2b-256 | 54b29d7e1e081897b9650f0821bf68c42261543f4fbf0c4a90c38579fe992997 |