8000 [po] auto sync · python/python-docs-zh-cn@7c57e30 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c57e30

Browse files
[po] auto sync
1 parent 329b2ab commit 7c57e30

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "80.85%", "updated_at": "2025-02-04T08:55:53Z"}
1+
{"translation": "80.86%", "updated_at": "2025-02-05T14:56:18Z"}

howto/descriptor.po

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ msgid ""
1818
msgstr ""
1919
"Project-Id-Version: Python 3.13\n"
2020
"Report-Msgid-Bugs-To: \n"
21-
"POT-Creation-Date: 2025-01-17 14:16+0000\n"
21+
"POT-Creation-Date: 2025-02-03 17:40+0000\n"
2222
"PO-Revision-Date: 2021-06-28 00:53+0000\n"
2323
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2025\n"
2424
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
@@ -499,6 +499,8 @@ msgid ""
499499
":meth:`~object.__set_name__` so that the field names would be recorded. "
500500
"Here we call :func:`vars` to look up the descriptor without triggering it:"
501501
msgstr ""
502+
"交互式会话显示 :class:`!Person` 类调用了 :meth:`~object.__set_name__` 以使字段名称可被记录。 "
503+
"在这里我们调用 :func:`vars` 来查找描述器而不触发它:"
502504

503505
#: ../../howto/descriptor.rst:260
504506
msgid ""
@@ -558,6 +560,8 @@ msgid ""
558560
":meth:`~object.__get__`, :meth:`~object.__set__`, or "
559561
":meth:`~object.__delete__`."
560562
msgstr ""
563+
":term:`descriptor` 是指任何定义了 :meth:`~object.__get__`, :meth:`~object.__set__` "
564+
"或 :meth:`~object.__delete__` 的对象。"
561565

562566
#: ../../howto/descriptor.rst:300
563567
msgid ""
@@ -566,6 +570,8 @@ msgid ""
566570
" where it was created or the name of class variable it was assigned to. "
567571
"(This method, if present, is called even if the class is not a descriptor.)"
568572
msgstr ""
573+
"作为可选项,描述器可以有 :meth:`~object.__set_name__` 方法。 "
574+
"这仅会被用于当描述器需要知道创建它的类或它被分配的类变量名称等场合。 (此方法如果存在,那么即使所在类并不是一个描述器仍会被调用。)"
569575

570576
#: ../../howto/descriptor.rst:305
571577
msgid ""
@@ -635,6 +641,7 @@ msgid ""
635641
"This :class:`!Validator` class is both an :term:`abstract base class` and a "
636642
"managed attribute descriptor:"
637643
msgstr ""
644+
"这个 :class:`!Validator` 类既是一个 :term:`abstract base class` 也是一个被管理的属性描述器:"
638645

639646
#: ../../howto/descriptor.rst:343
640647
msgid ""
@@ -679,6 +686,7 @@ msgid ""
679686
"Custom validators need to inherit from :class:`!Validator` and must supply a"
680687
" :meth:`!validate` method to test various restrictions as needed."
681688
msgstr ""
689+
"自定义验证器必须继承自 :class:`!Validator` 并且必须提供 :meth:`!validate` 方法以根据需要测试各种约束。"
682690

683691
#: ../../howto/descriptor.rst:368
684692
msgid "Custom validators"
@@ -1810,6 +1818,11 @@ msgid ""
18101818
">>> d.f.__self__\n"
18111819
"<__main__.D object at 0x00B18C90>"
18121820
msgstr ""
1821+
">>> d.f.__func__\n"
1822+
"<function D.f at 0x00C45070>\n"
1823+
"\n"
1824+
">>> d.f.__self__\n"
1825+
"<__main__.D object at 0x00B18C90>"
18131826

18141827#: ../../howto/descriptor.rst:1261
18151828
msgid ""
@@ -1965,6 +1978,20 @@ msgid ""
19651978
" def __call__(self, *args, **kwds):\n"
19661979
" return self.f(*args, **kwds)"
19671980
msgstr ""
1981+
"import functools\n"
1982+
"\n"
1983+
"class StaticMethod:\n"
1984+
" \"Emulate PyStaticMethod_Type() in Objects/funcobject.c\"\n"
1985+
"\n"
1986+
" def __init__(self, f):\n"
1987+
" self.f = f\n"
1988+
" functools.update_wrapper(self, f)\n"
1989+
"\n"
1990+
" def __get__(self, obj, objtype=None):\n"
1991+
" return self.f\n"
1992+
"\n"
1993+
" def __call__(self, *args, **kwds):\n"
1994+
" return self.f(*args, **kwds)"
19681995

19691996
#: ../../howto/descriptor.rst:1348
19701997
msgid ""
@@ -1997,6 +2024,10 @@ msgid ""
19972024
" def f(cls, x):\n"
19982025
" return cls.__name__, x"
19992026
msgstr ""
2027+
"class F:\n"
2028+
" @classmethod\n"
2029+
" def f(cls, x):\n"
2030+
" return cls.__name__, x"
20002031

20012032
#: ../../howto/descriptor.rst:1430
20022033
msgid ""
@@ -2005,6 +2036,10 @@ msgid ""
20052036
">>> F().f(3)\n"
20062037
"('F', 3)"
20072038
msgstr ""
2039+
">>> F.f(3)\n"
2040+
"('F', 3)\n"
2041+
">>> F().f(3)\n"
2042+
"('F', 3)"
20082043

20092044
#: ../../howto/descriptor.rst:1437
20102045
msgid ""
@@ -2028,6 +2063,14 @@ msgid ""
20282063
" d[key] = value\n"
20292064
" return d"
20302065
msgstr ""
2066+
"class Dict(dict):\n"
2067+
" @classmethod\n"
2068+
" def fromkeys(cls, iterable, value=None):\n"
2069+
" \"Emulate dict_fromkeys() in Objects/dictobject.c\"\n"
2070+
" d = cls()\n"
2071+
" for key in iterable:\n"
2072+
" d[key] = value\n"
2073+
" return d"
20312074

20322075
#: ../../howto/descriptor.rst:1454
20332076
msgid "Now a new dictionary of unique keys can be constructed like this:"

0 commit comments

Comments
 (0)
0