File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
- {"translation" : " 90.78 %" , "updated_at" : " 2024-02-21T07 :09:01Z " }
1
+ {"translation" : " 90.79 %" , "updated_at" : " 2024-02-21T15 :09:23Z " }
Original file line number Diff line number Diff line change @@ -566,13 +566,16 @@ msgid ""
566
566
" reducing the number of calls to :func:`os.stat` required to walk a "
567
567
"directory tree."
568
568
msgstr ""
569
+ ":pep:`471` 向标准库添加了一个新的目录迭代函数 :func:`os.scandir`。 此外,:func:`os.walk` 现在是使用 "
570
+ "``scandir`` 来实现,这使它在 POSIX 系统上可提速 3 至 5 倍而在 Windows 系统上可提速 7 至 20 倍。 "
571
+ "这样的效果主要是通过大幅减少遍历目录树所需调用 :func:`os.stat` 的次数来达成的。"
569
572
570
573
#: ../../whatsnew/3.5.rst:457
571
574
msgid ""
572
575
"Additionally, ``scandir`` returns an iterator, as opposed to returning a "
573
576
"list of file names, which improves memory efficiency when iterating over "
574
577
"very large directories."
575
- msgstr ""
578
A088
code>
+ msgstr "此外,``scandir`` 是返回一个迭代器,而不是返回一个文件名列表,这提升了迭代非常大的目录时的内存效率。 "
576
579
577
580
#: ../../whatsnew/3.5.rst:461
578
581
msgid ""
@@ -581,12 +584,14 @@ msgid ""
581
584
"with ``'.'``. The :meth:`entry.is_file() <os.DirEntry.is_file>` call will "
582
585
"generally not make an additional system call::"
583
586
msgstr ""
587
+ "下面的例子演示了 :func:`os.scandir` 的简单用法,显示给定 *path* 中所有不以 ``'.'`` 开头的文件(不包括目录)。 "
588
+ ":meth:`entry.is_file() <os.DirEntry.is_file>` 调用通常不会执行额外的系统调用::"
584
589
585
590
#: ../../whatsnew/3.5.rst:472
586
591
msgid ""
587
592
":pep:`471` -- os.scandir() function -- a better and faster directory "
588
593
"iterator"
589
- msgstr ""
594
+ msgstr ":pep:`471` -- os.scandir() 函数 -- 一个更好且更快的目录迭代器 "
590
595
591
596
#: ../../whatsnew/3.5.rst:473
592
597
msgid ""
You can’t perform that action at this time.
0 commit comments