Skip to content

Commit 3a91d74

Browse files
committed
feat: translate c-api/typehints
1 parent 11f8dc6 commit 3a91d74

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

c-api/typehints.po

+25-7
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
1-
# SOME DESCRIPTIVE TITLE.
21
# Copyright (C) 2001-2022, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
53
#
6-
#, fuzzy
4+
# Translators:
5+
# Matt Wang <mattwang44@gmail.com>, 2022
6+
#
77
msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.11\n"
1010
"Report-Msgid-Bugs-To: \n"
1111
"POT-Creation-Date: 2022-10-06 00:23+0000\n"
12-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12+
"PO-Revision-Date: 2022-10-16 16:16+0800\n"
13+
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1515
"tw)\n"
1616
"Language: zh_TW\n"
1717
"MIME-Version: 1.0\n"
1818
"Content-Type: text/plain; charset=UTF-8\n"
1919
"Content-Transfer-Encoding: 8bit\n"
20+
"X-Generator: Poedit 3.1.1\n"
2021

2122
#: ../../c-api/typehints.rst:6
2223
msgid "Objects for Type Hinting"
23-
msgstr ""
24+
msgstr "型別提示物件"
2425

2526
#: ../../c-api/typehints.rst:8
2627
msgid ""
2728
"Various built-in types for type hinting are provided. Currently, two types "
2829
"exist -- :ref:`GenericAlias <types-genericalias>` and :ref:`Union <types-"
2930
"union>`. Only ``GenericAlias`` is exposed to C."
3031
msgstr ""
32+
"提供了數個用於型別提示的內建型別。目前有兩種 -- :ref:`GenericAlias <types-"
33+
"genericalias>` 和 :ref:`Union <types-union>`。只有 ``GenericAlias`` 有公開 "
34+
"(expose) 給 C。"
3135

3236
#: ../../c-api/typehints.rst:14
3337
msgid ""
@@ -43,17 +47,31 @@ msgid ""
4347
"lazily from ``__args__``. On failure, an exception is raised and ``NULL`` "
4448
"is returned."
4549
msgstr ""
50+
"建立一個 :ref:`GenericAlias <types-genericalias>` 物件,等同於呼叫 Python "
51+
"的 :class:`types.GenericAlias` class。*origin* 和 *args* 引數分別設定了 "
52+
"`GenericAlias`` 的 ``__origin__`` 與 ``__args__`` 屬性。*origin* 應該要是個 :"
53+
"c:expr:`PyTypeObject*` 且 *args* 可以是個 :c:expr:`PyTupleObject*` 或任意 "
54+
"``PyObject*``。如果傳入的 *args* 不是個 tuple(元組),則會自動建立一個長度"
55+
"為 1 的 tuple 且 ``__args__`` 會被設為 ``(args,)``。只會進行最少的引數檢查,"
56+
"所以即便 *origin* 不是個型別,函式也會不會失敗。``GenericAlias`` 的 "
57+
"``__parameters__`` 屬性會自 ``__args__`` 惰性地建立 (constructed lazily)。當"
58+
"失敗時,會引發一個例外並回傳``NULL``。"
4659

4760
#: ../../c-api/typehints.rst:28
4861
msgid "Here's an example of how to make an extension type generic::"
4962
msgstr ""
63+
"以下是個讓一個擴充型別泛用化 (generic) 的例子:\n"
64+
"\n"
65+
"::"
5066

5167
#: ../../c-api/typehints.rst:38
5268
msgid "The data model method :meth:`__class_getitem__`."
53-
msgstr ""
69+
msgstr "資料模型方法 :meth:`__class_getitem__`。"
5470

5571
#: ../../c-api/typehints.rst:44
5672
msgid ""
5773
"The C type of the object returned by :c:func:`Py_GenericAlias`. Equivalent "
5874
"to :class:`types.GenericAlias` in Python."
5975
msgstr ""
76+
":c:func:`Py_GenericAlias` 所回傳該物件的 C 型別。等價於 Python 中的 :class:"
77+
"`types.GenericAlias`。"

0 commit comments

Comments
 (0)