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

Skip to content

Commit 532e802

Browse files
[po] auto sync
1 parent 21803b9 commit 532e802

File tree

3 files changed

+62
-15
lines changed

3 files changed

+62
-15
lines changed

.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "80.88%", "updated_at": "2025-02-09T01:19:55Z"}
1+
{"translation": "80.90%", "updated_at": "2025-02-09T07:55:30Z"}

howto/descriptor.po

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,8 @@ msgid ""
13281328
"place at the time of class creation. If descriptors are added to the class "
13291329
"afterwards, :meth:`~object.__set_name__` will need to be called manually."
13301330
msgstr ""
1331+
"由于更新逻辑是在 :meth:`!type.__new__` 中,因此通知仅在类创建时发出。 之后如果将描述器添加到类中,则需要手动调用 "
1332+
":meth:`~object.__set_name__`。"
13311333

13321334
#: ../../howto/descriptor.rst:851
13331335
msgid "ORM example"
@@ -1383,6 +1385,8 @@ msgid ""
13831385
"<https://en.wikipedia.org/wiki/Database_model>`_ that describe the schema "
13841386
"for each table in a database:"
13851387
msgstr ""
1388+
"我们可以使用 :class:`!Field` 类来定义描述了数据库中每张表的结构的 `模型 "
1389+
"<https://en.wikipedia.org/wiki/Database_model>`_:"
13861390

13871391
#: ../../howto/descriptor.rst:880
13881392
msgid ""
@@ -1740,6 +1744,8 @@ msgid ""
17401744
" This means that functions are non-data descriptors that return bound "
17411745
"methods during dotted lookup from an instance. Here's how it works:"
17421746
msgstr ""
1747+
"为支持方法的自动创建,函数会包括 :meth:`~object.__get__` 方法以便在属性访问期间绑定方法。 "
1748+
"这意味着函数就是在通过实例进行点号查找期间返回所绑定方法的非数据描述器。 其运作方式是这样的:"
17431749

17441750
#: ../../howto/descriptor.rst:1194
17451751
msgid ""
@@ -1802,7 +1808,7 @@ msgid ""
18021808
"Accessing the function through the class dictionary does not invoke "
18031809
":meth:`~object.__get__`. Instead, it just returns the underlying function "
18041810
"object::"
1805-
msgstr ""
1811+
msgstr "通过类字典访问函数不会唤起 :meth:`~object.__get__`。 相反,它只是返回下层的函数对象::"
18061812

18071813
#: ../../howto/descriptor.rst:1236
18081814
msgid ""
@@ -1816,7 +1822,7 @@ msgstr ""
18161822
msgid ""
18171823
"Dotted access from a class calls :meth:`~object.__get__` which just returns "
18181824
"the underlying function unchanged::"
1819-
msgstr ""
1825+
msgstr "通过类进行点号访问调用 :meth:`~object.__get__`,它将只原样返回下层的函数::"
18201826

18211827
#: ../../howto/descriptor.rst:1242
18221828
msgid ""
@@ -1831,7 +1837,7 @@ msgid ""
18311837
"The interesting behavior occurs during dotted access from an instance. The "
18321838
"dotted lookup calls :meth:`~object.__get__` which returns a bound method "
18331839
"object::"
1834-
msgstr ""
1840+
msgstr "有趣的行为发生在通过实例进行点号访问期间。 点号查找调用 :meth:`~object.__get__`,它将返回绑定的方法对象::"
18351841

18361842
#: ../../howto/descriptor.rst:1248
18371843
msgid ""
@@ -1886,6 +1892,9 @@ msgid ""
18861892
"descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. "
18871893
"Calling ``cls.f(*args)`` becomes ``f(*args)``."
18881894
msgstr ""
1895+
"总结一下,函数具有 :meth:`~object.__get__` 方法以便在其作为属性被访问时可被转换为方法。 非数据描述器会将 "
1896+
"``obj.f(*args)`` 调用转化为 ``f(obj, *args)``。 调用 ``cls.f(*args)`` 将变成 "
1897+
"``f(*args)``。"
18891898

18901899
#: ../../howto/descriptor.rst:1276
18911900
msgid "This chart summarizes the binding and its two most useful variants:"
@@ -1963,6 +1972,9 @@ msgid ""
19631972
" particular dataset. It can be called either from an object or the class: "
19641973
"``s.erf(1.5) --> 0.9332`` or ``Sample.erf(1.5) --> 0.9332``."
19651974
msgstr ""
1975+
"举例来说,一个统计软件包可能包括存放实验性数据的容器类。 该类提供了用于计算平均数、均值、中位数以及其他描述性的统计数据的方法。 "
1976+
"不过,还可能存在在概念上相关但不依赖于这些数据的有用函数。 例如,``erf(x)`` 是在统计工作中的便捷转换例程但并不直接依赖于特定的数据集。 "
1977+
"它可以通过对象或者类来调用: ``s.erf(1.5) --> 0.9332`` 或者 ``Sample.erf(1.5) --> 0.9332``。"
19661978

19671979
#: ../../howto/descriptor.rst:1311
19681980
msgid ""
@@ -2393,6 +2405,41 @@ msgid ""
23932405
" 'Emulate member_repr() in Objects/descrobject.c'\n"
23942406
" return f'<Member {self.name!r} of {self.clsname!r}>'"
23952407
msgstr ""
2408+
"null = object()\n"
2409+
"\n"
2410+
"class Member:\n"
2411+
"\n"
2412+
" def __init__(self, name, clsname, offset):\n"
2413+
" 'Emulate PyMemberDef in Include/structmember.h'\n"
2414+
" # 另请参阅 Objects/descrobject.c 中的 descr_new()\n"
2415+
" self.name = name\n"
2416+
" self.clsname = clsname\n"
2417+
" self.offset = offset\n"
2418+
"\n"
2419+
" def __get__(self, obj, objtype=None):\n"
2420+
" 'Emulate member_get() in Objects/descrobject.c'\n"
2421+
" # 另请参阅 Python/structmember.c 中的 PyMember_GetOne()\n"
2422+
" if obj is None:\n"
2423+
" return self\n"
2424+
" value = obj._slotvalues[self.offset]\n"
2425+
" if value is null:\n"
2426+
" raise AttributeError(self.name)\n"
2427+
" return value\n"
2428+
"\n"
2429+
" def __set__(self, obj, value):\n"
2430+
" 'Emulate member_set() in Objects/descrobject.c'\n"
2431+
" obj._slotvalues[self.offset] = value\n"
2432+
"\n"
2433+
" def __delete__(self, obj):\n"
2434+
" 'Emulate member_delete() in Objects/descrobject.c'\n"
2435+
" value = obj._slotvalues[self.offset]\n"
2436+
" if value is null:\n"
2437+
" raise AttributeError(self.name)\n"
2438+
" obj._slotvalues[self.offset] = null\n"
2439+
"\n"
2440+
" def __repr__(self):\n"
2441+
" 'Emulate member_repr() in Objects/descrobject.c'\n"
2442+
" return f'<Member {self.name!r} of {self.clsname!r}>'"
23962443

23972444
#: ../../howto/descriptor.rst:1670
23982445
msgid ""

library/math.po

Lines changed: 11 additions & 11 deletions
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-10 14:17+0000\n"
21+
"POT-Creation-Date: 2025-02-07 14:17+0000\n"
2222
"PO-Revision-Date: 2021-06-28 01:09+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"
@@ -398,43 +398,43 @@ msgstr ":func:`degrees(x) <degrees>`"
398398

399399
#: ../../library/math.rst:85
400400
msgid "Convert angle *x* from radians to degrees"
401-
msgstr ""
401+
msgstr "将度数值 *x* 从弧度转换为角度"
402402

403403
#: ../../library/math.rst:86
404404
msgid ":func:`radians(x) <radians>`"
405-
msgstr ""
405+
msgstr ":func:`radians(x) <radians>`"
406406

407407
#: ../../library/math.rst:86
408408
msgid "Convert angle *x* from degrees to radians"
409-
msgstr ""
409+
msgstr "将度数值 *x* 从角度转换为弧度"
410410

411411
#: ../../library/math.rst:88
412412
msgid "**Trigonometric functions**"
413-
msgstr ""
413+
msgstr "**三角函数**"
414414

415415
#: ../../library/math.rst:90
416416
msgid ":func:`acos(x) <acos>`"
417-
msgstr ""
417+
msgstr ":func:`acos(x) <acos>`"
418418

419419
#: ../../library/math.rst:90
420420
msgid "Arc cosine of *x*"
421-
msgstr ""
421+
msgstr "*x* 的反余弦"
422422

423423
#: ../../library/math.rst:91
424424
msgid ":func:`asin(x) <asin>`"
425-
msgstr ""
425+
msgstr ":func:`asin(x) <asin>`"
426426

427427
#: ../../library/math.rst:91
428428
msgid "Arc sine of *x*"
429-
msgstr ""
429+
msgstr "*x* 的反正弦"
430430

431431
#: ../../library/math.rst:92
432432
msgid ":func:`atan(x) <atan>`"
433-
msgstr ""
433+
msgstr ":func:`atan(x) <atan>`"
434434

435435
#: ../../library/math.rst:92
436436
msgid "Arc tangent of *x*"
437-
msgstr ""
437+
msgstr "*x* 的反正切"
438438

439439
#: ../../library/math.rst:93
440440
msgid ":func:`atan2(y, x) <atan2>`"

0 commit comments

Comments
 (0)
0