55msgstr ""
66"Project-Id-Version : Python 3.7\n "
77"Report-Msgid-Bugs-To : \n "
8- "POT-Creation-Date : 2018-06-26 18:54 +0800\n "
8+ "POT-Creation-Date : 2018-10-19 17:24 +0800\n "
99"PO-Revision-Date : 2018-07-15 18:56+0800\n "
1010"Last-Translator : \n "
1111"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -19,148 +19,159 @@ msgstr ""
1919msgid "Context Variables Objects"
2020msgstr ""
2121
22- #: ../../c-api/contextvars.rst:10
22+ #: ../../c-api/contextvars.rst:13
23+ msgid ""
24+ "In Python 3.7.1 the signatures of all context variables C APIs were "
25+ "**changed** to use :c:type:`PyObject` pointers instead of :c:type:"
26+ "`PyContext`, :c:type:`PyContextVar`, and :c:type:`PyContextToken`, e.g.::"
27+ msgstr ""
28+
29+ #: ../../c-api/contextvars.rst:24
30+ msgid "See :issue:`34762` for more details."
31+ msgstr ""
32+
33+ #: ../../c-api/contextvars.rst:29
2334msgid ""
2435"This section details the public C API for the :mod:`contextvars` module."
2536msgstr ""
2637
27- #: ../../c-api/contextvars.rst:14
38+ #: ../../c-api/contextvars.rst:33
2839msgid ""
2940"The C structure used to represent a :class:`contextvars.Context` object."
3041msgstr ""
3142
32- #: ../../c-api/contextvars.rst:19
43+ #: ../../c-api/contextvars.rst:38
3344msgid ""
3445"The C structure used to represent a :class:`contextvars.ContextVar` object."
3546msgstr ""
3647
37- #: ../../c-api/contextvars.rst:24
48+ #: ../../c-api/contextvars.rst:43
3849msgid "The C structure used to represent a :class:`contextvars.Token` object."
3950msgstr ""
4051
41- #: ../../c-api/contextvars.rst:28
52+ #: ../../c-api/contextvars.rst:47
4253msgid "The type object representing the *context* type."
4354msgstr ""
4455
45- #: ../../c-api/contextvars.rst:32
56+ #: ../../c-api/contextvars.rst:51
4657msgid "The type object representing the *context variable* type."
4758msgstr ""
4859
49- #: ../../c-api/contextvars.rst:36
60+ #: ../../c-api/contextvars.rst:55
5061msgid "The type object representing the *context variable token* type."
5162msgstr ""
5263
53- #: ../../c-api/contextvars.rst:39
64+ #: ../../c-api/contextvars.rst:58
5465msgid "Type-check macros:"
5566msgstr ""
5667
57- #: ../../c-api/contextvars.rst:43
68+ #: ../../c-api/contextvars.rst:62
5869msgid ""
5970"Return true if *o* is of type :c:data:`PyContext_Type`. *o* must not be "
6071"*NULL*. This function always succeeds."
6172msgstr ""
6273
63- #: ../../c-api/contextvars.rst:48
74+ #: ../../c-api/contextvars.rst:67
6475msgid ""
6576"Return true if *o* is of type :c:data:`PyContextVar_Type`. *o* must not be "
6677"*NULL*. This function always succeeds."
6778msgstr ""
6879
69- #: ../../c-api/contextvars.rst:53
80+ #: ../../c-api/contextvars.rst:72
7081msgid ""
7182"Return true if *o* is of type :c:data:`PyContextToken_Type`. *o* must not be "
7283"*NULL*. This function always succeeds."
7384msgstr ""
7485
75- #: ../../c-api/contextvars.rst:57
86+ #: ../../c-api/contextvars.rst:76
7687msgid "Context object management functions:"
7788msgstr ""
7889
79- #: ../../c-api/contextvars.rst:61
90+ #: ../../c-api/contextvars.rst:80
8091msgid ""
8192"Create a new empty context object. Returns ``NULL`` if an error has "
8293"occurred."
8394msgstr ""
8495
85- #: ../../c-api/contextvars.rst:66
96+ #: ../../c-api/contextvars.rst:85
8697msgid ""
8798"Create a shallow copy of the passed *ctx* context object. Returns ``NULL`` "
8899"if an error has occurred."
89100msgstr ""
90101
91- #: ../../c-api/contextvars.rst:71
102+ #: ../../c-api/contextvars.rst:90
92103msgid ""
93104"Create a shallow copy of the current thread context. Returns ``NULL`` if an "
94105"error has occurred."
95106msgstr ""
96107
97- #: ../../c-api/contextvars.rst:76
108+ #: ../../c-api/contextvars.rst:95
98109msgid ""
99110"Set *ctx* as the current context for the current thread. Returns ``0`` on "
100111"success, and ``-1`` on error."
101112msgstr ""
102113
103- #: ../../c-api/contextvars.rst:81
114+ #: ../../c-api/contextvars.rst:100
104115msgid ""
105116"Deactivate the *ctx* context and restore the previous context as the current "
106117"context for the current thread. Returns ``0`` on success, and ``-1`` on "
107118"error."
108119msgstr ""
109120
110- #: ../../c-api/contextvars.rst:87
121+ #: ../../c-api/contextvars.rst:106
111122msgid ""
112123"Clear the context variable free list. Return the total number of freed "
113124"items. This function always succeeds."
114125msgstr ""
115126
116- #: ../../c-api/contextvars.rst:91
127+ #: ../../c-api/contextvars.rst:110
117128msgid "Context variable functions:"
118129msgstr ""
119130
120- #: ../../c-api/contextvars.rst:95
131+ #: ../../c-api/contextvars.rst:114
121132msgid ""
122133"Create a new ``ContextVar`` object. The *name* parameter is used for "
123134"introspection and debug purposes. The *def* parameter may optionally "
124135"specify the default value for the context variable. If an error has "
125136"occurred, this function returns ``NULL``."
126137msgstr ""
127138
128- #: ../../c-api/contextvars.rst:102
139+ #: ../../c-api/contextvars.rst:121
129140msgid ""
130141"Get the value of a context variable. Returns ``-1`` if an error has "
131142"occurred during lookup, and ``0`` if no error occurred, whether or not a "
132143"value was found."
133144msgstr ""
134145
135- #: ../../c-api/contextvars.rst:106
146+ #: ../../c-api/contextvars.rst:125
136147msgid ""
137148"If the context variable was found, *value* will be a pointer to it. If the "
138149"context variable was *not* found, *value* will point to:"
139150msgstr ""
140151
141- #: ../../c-api/contextvars.rst:109
152+ #: ../../c-api/contextvars.rst:128
142153msgid "*default_value*, if not ``NULL``;"
143154msgstr ""
144155
145- #: ../../c-api/contextvars.rst:110
156+ #: ../../c-api/contextvars.rst:129
146157msgid "the default value of *var*, if not ``NULL``;"
147158msgstr ""
148159
149- #: ../../c-api/contextvars.rst:111
160+ #: ../../c-api/contextvars.rst:130
150161msgid "``NULL``"
151162msgstr ""
152163
153- #: ../../c-api/contextvars.rst:113
164+ #: ../../c-api/contextvars.rst:132
154165msgid "If the value was found, the function will create a new reference to it."
155166msgstr ""
156167
157- #: ../../c-api/contextvars.rst:117
168+ #: ../../c-api/contextvars.rst:136
158169msgid ""
159170"Set the value of *var* to *value* in the current context. Returns a pointer "
160- "to a :c:type:`PyContextToken ` object, or ``NULL`` if an error has occurred."
171+ "to a :c:type:`PyObject ` object, or ``NULL`` if an error has occurred."
161172msgstr ""
162173
163- #: ../../c-api/contextvars.rst:123
174+ #: ../../c-api/contextvars.rst:142
164175msgid ""
165176"Reset the state of the *var* context variable to that it was in before :c:"
166177"func:`PyContextVar_Set` that returned the *token* was called. This function "
0 commit comments