Tag: bpo
-
bpo-29901: Improve support of path-like objects in zipapp 分析
bpo-29901 簡介 Title: Support path-like objects in zipapp Create By: Serhiy Storchaka Solved By: Serhiy Storchaka BPO: http://bugs.python.org/issue29901 PR815: https://github.com/python/cpython/pull/815 Components: Library (Lib) Versions: Python 3.7 Stage: resolved Type: enhancement 新知 os.PathLike: https://docs.python.org/3/library/os.html#os.PathLike path-like object: https://docs.python.org/3.7/glossary.html#term-path-like-object Lib/zipapp (from version 3.5): https://docs.python.org/3/library/zipapp.html Lib/pathlib (from version 3.4): https://docs.python.org/3/library/pathlib.html 技巧 isinstance 的 classinfo 可以傳入 tuple diff –git a/Lib/zipapp.py b/Lib/zipapp.py index eceb91de1a..c23b788d1c 100644 — a/Lib/zipapp.py +++ b/Lib/zipapp.py @@ -36,9 +36,7…