Skip to content

Commit 7c44e13

Browse files
authored
Merge pull request #1546 from vim-jp/hh-update-if_pyth
Update if_pyth.{txt,jax}
2 parents 2807f84 + 5a2de7b commit 7c44e13

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

doc/if_pyth.jax

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*if_pyth.txt* For Vim バージョン 9.1. Last change: 2023 Oct 25
1+
*if_pyth.txt* For Vim バージョン 9.1. Last change: 2024 May 16
22

33

44
VIMリファレンスマニュアル by Paul Moore
@@ -334,7 +334,8 @@ Python では、'runtimepath' のパスのリストを使う代わりに、vim.V
334334
という特別なディレクトリが使われます。このディレクトリが sys.path 内で使われる
335335
とき、そして vim.path_hooks が sys.path_hooks 内で使われるとき、'runtimepath'
336336
の各パス {rtp} に対して {rtp}/python2 (or python3) と {rtp}/pythonx (両バー
337-
ジョンで読み込まれる) のモジュールがロードされます。
337+
ジョンで読み込まれる) のモジュールがロードされます (Note: find_module() は、
338+
Python 3.12.0a7 辺りで imp モジュールから削除されました)。
338339

339340
実装は以下のようになっています。ただし実際は C で書かれています: >
340341
@@ -394,10 +395,13 @@ vim.VIM_SPECIAL_PATH *python-VIM_SPECIAL_PATH*
394395

395396
vim.find_module(...) *python-find_module*
396397
vim.path_hook(path) *python-path_hook*
398+
vim.find_spec(...) *python-find_spec*
397399
上述のパスフックの実装に使われるメソッドとオブジェクト。sys.meta_path
398400
で vim.path_hook を使って何かをするようなことがなければ、これらを直接
399-
使用することはないでしょう。これらのオブジェクトが Vim の将来のバー
400-
ジョンでも存在するかどうかは保証されません。
401+
使用することはないでしょう。vim.find_spec() は Python 3.7 以降で使用可
402+
能です。
403+
これらのオブジェクトが Vim の将来のバージョンでも存在するかどうかは保
404+
証されません。
401405

402406
vim._get_paths *python-_get_paths*
403407
パスフックで検索されるパスのリストを返すメソッド。将来のバージョンのこ

en/if_pyth.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*if_pyth.txt* For Vim version 9.1. Last change: 2023 Oct 25
1+
*if_pyth.txt* For Vim version 9.1. Last change: 2024 May 16
22

33

44
VIM REFERENCE MANUAL by Paul Moore
@@ -343,7 +343,8 @@ In python vim.VIM_SPECIAL_PATH special directory is used as a replacement for
343343
the list of paths found in 'runtimepath': with this directory in sys.path and
344344
vim.path_hooks in sys.path_hooks python will try to load module from
345345
{rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for
346-
each {rtp} found in 'runtimepath'.
346+
each {rtp} found in 'runtimepath' (Note: find_module() has been removed from
347+
imp module around Python 3.12.0a7).
347348

348349
Implementation is similar to the following, but written in C: >
349350
@@ -404,10 +405,12 @@ vim.VIM_SPECIAL_PATH *python-VIM_SPECIAL_PATH*
404405

405406
vim.find_module(...) *python-find_module*
406407
vim.path_hook(path) *python-path_hook*
408+
vim.find_spec(...) *python-find_spec*
407409
Methods or objects used to implement path loading as described above.
408410
You should not be using any of these directly except for vim.path_hook
409-
in case you need to do something with sys.meta_path. It is not
410-
guaranteed that any of the objects will exist in the future vim
411+
in case you need to do something with sys.meta_path, vim.find_spec()
412+
is available starting with Python 3.7.
413+
It is not guaranteed that any of the objects will exist in future vim
411414
versions.
412415

413416
vim._get_paths *python-_get_paths*

0 commit comments

Comments
 (0)