5
5
msgstr ""
6
6
"Project-Id-Version : Python 3.7\n "
7
7
"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 "
9
9
"PO-Revision-Date : 2018-07-15 18:56+0800\n "
10
10
"Last-Translator : \n "
11
11
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -19,148 +19,159 @@ msgstr ""
19
19
msgid "Context Variables Objects"
20
20
msgstr ""
21
21
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
23
34
msgid ""
24
35
"This section details the public C API for the :mod:`contextvars` module."
25
36
msgstr ""
26
37
27
- #: ../../c-api/contextvars.rst:14
38
+ #: ../../c-api/contextvars.rst:33
28
39
msgid ""
29
40
"The C structure used to represent a :class:`contextvars.Context` object."
30
41
msgstr ""
31
42
32
- #: ../../c-api/contextvars.rst:19
43
+ #: ../../c-api/contextvars.rst:38
33
44
msgid ""
34
45
"The C structure used to represent a :class:`contextvars.ContextVar` object."
35
46
msgstr ""
36
47
37
- #: ../../c-api/contextvars.rst:24
48
+ #: ../../c-api/contextvars.rst:43
38
49
msgid "The C structure used to represent a :class:`contextvars.Token` object."
39
50
msgstr ""
40
51
41
- #: ../../c-api/contextvars.rst:28
52
+ #: ../../c-api/contextvars.rst:47
42
53
msgid "The type object representing the *context* type."
43
54
msgstr ""
44
55
45
- #: ../../c-api/contextvars.rst:32
56
+ #: ../../c-api/contextvars.rst:51
46
57
msgid "The type object representing the *context variable* type."
47
58
msgstr ""
48
59
49
- #: ../../c-api/contextvars.rst:36
60
+ #: ../../c-api/contextvars.rst:55
50
61
msgid "The type object representing the *context variable token* type."
51
62
msgstr ""
52
63
53
- #: ../../c-api/contextvars.rst:39
64
+ #: ../../c-api/contextvars.rst:58
54
65
msgid "Type-check macros:"
55
66
msgstr ""
56
67
57
- #: ../../c-api/contextvars.rst:43
68
+ #: ../../c-api/contextvars.rst:62
58
69
msgid ""
59
70
"Return true if *o* is of type :c:data:`PyContext_Type`. *o* must not be "
60
71
"*NULL*. This function always succeeds."
61
72
msgstr ""
62
73
63
- #: ../../c-api/contextvars.rst:48
74
+ #: ../../c-api/contextvars.rst:67
64
75
msgid ""
65
76
"Return true if *o* is of type :c:data:`PyContextVar_Type`. *o* must not be "
66
77
"*NULL*. This function always succeeds."
67
78
msgstr ""
68
79
69
- #: ../../c-api/contextvars.rst:53
80
+ #: ../../c-api/contextvars.rst:72
70
81
msgid ""
71
82
"Return true if *o* is of type :c:data:`PyContextToken_Type`. *o* must not be "
72
83
"*NULL*. This function always succeeds."
73
84
msgstr ""
74
85
75
- #: ../../c-api/contextvars.rst:57
86
+ #: ../../c-api/contextvars.rst:76
76
87
msgid "Context object management functions:"
77
88
msgstr ""
78
89
79
- #: ../../c-api/contextvars.rst:61
90
+ #: ../../c-api/contextvars.rst:80
80
91
msgid ""
81
92
"Create a new empty context object. Returns ``NULL`` if an error has "
82
93
"occurred."
83
94
msgstr ""
84
95
85
- #: ../../c-api/contextvars.rst:66
96
+ #: ../../c-api/contextvars.rst:85
86
97
msgid ""
87
98
"Create a shallow copy of the passed *ctx* context object. Returns ``NULL`` "
88
99
"if an error has occurred."
89
100
msgstr ""
90
101
91
- #: ../../c-api/contextvars.rst:71
102
+ #: ../../c-api/contextvars.rst:90
92
103
msgid ""
93
104
"Create a shallow copy of the current thread context. Returns ``NULL`` if an "
94
105
"error has occurred."
95
106
msgstr ""
96
107
97
- #: ../../c-api/contextvars.rst:76
108
+ #: ../../c-api/contextvars.rst:95
98
109
msgid ""
99
110
"Set *ctx* as the current context for the current thread. Returns ``0`` on "
100
111
"success, and ``-1`` on error."
101
112
msgstr ""
102
113
103
- #: ../../c-api/contextvars.rst:81
114
+ #: ../../c-api/contextvars.rst:100
104
115
msgid ""
105
116
"Deactivate the *ctx* context and restore the previous context as the current "
106
117
"context for the current thread. Returns ``0`` on success, and ``-1`` on "
107
118
"error."
108
119
msgstr ""
109
120
110
- #: ../../c-api/contextvars.rst:87
121
+ #: ../../c-api/contextvars.rst:106
111
122
msgid ""
112
123
"Clear the context variable free list. Return the total number of freed "
113
124
"items. This function always succeeds."
114
125
msgstr ""
115
126
116
- #: ../../c-api/contextvars.rst:91
127
+ #: ../../c-api/contextvars.rst:110
117
128
msgid "Context variable functions:"
118
129
msgstr ""
119
130
120
- #: ../../c-api/contextvars.rst:95
131
+ #: ../../c-api/contextvars.rst:114
121
132
msgid ""
122
133
"Create a new ``ContextVar`` object. The *name* parameter is used for "
123
134
"introspection and debug purposes. The *def* parameter may optionally "
124
135
"specify the default value for the context variable. If an error has "
125
136
"occurred, this function returns ``NULL``."
126
137
msgstr ""
127
138
128
- #: ../../c-api/contextvars.rst:102
139
+ #: ../../c-api/contextvars.rst:121
129
140
msgid ""
130
141
"Get the value of a context variable. Returns ``-1`` if an error has "
131
142
"occurred during lookup, and ``0`` if no error occurred, whether or not a "
132
143
"value was found."
133
144
msgstr ""
134
145
135
- #: ../../c-api/contextvars.rst:106
146
+ #: ../../c-api/contextvars.rst:125
136
147
msgid ""
137
148
"If the context variable was found, *value* will be a pointer to it. If the "
138
149
"context variable was *not* found, *value* will point to:"
139
150
msgstr ""
140
151
141
- #: ../../c-api/contextvars.rst:109
152
+ #: ../../c-api/contextvars.rst:128
142
153
msgid "*default_value*, if not ``NULL``;"
143
154
msgstr ""
144
155
145
- #: ../../c-api/contextvars.rst:110
156
+ #: ../../c-api/contextvars.rst:129
146
157
msgid "the default value of *var*, if not ``NULL``;"
147
158
msgstr ""
148
159
149
- #: ../../c-api/contextvars.rst:111
160
+ #: ../../c-api/contextvars.rst:130
150
161
msgid "``NULL``"
151
162
msgstr ""
152
163
153
- #: ../../c-api/contextvars.rst:113
164
+ #: ../../c-api/contextvars.rst:132
154
165
msgid "If the value was found, the function will create a new reference to it."
155
166
msgstr ""
156
167
157
- #: ../../c-api/contextvars.rst:117
168
+ #: ../../c-api/contextvars.rst:136
158
169
msgid ""
159
170
"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."
161
172
msgstr ""
162
173
163
- #: ../../c-api/contextvars.rst:123
174
+ #: ../../c-api/contextvars.rst:142
164
175
msgid ""
165
176
"Reset the state of the *var* context variable to that it was in before :c:"
166
177
"func:`PyContextVar_Set` that returned the *token* was called. This function "
0 commit comments