@@ -9,15 +9,16 @@ msgstr ""
9
9
"Project-Id-Version : Python en Español 3.10\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
11
"POT-Creation-Date : 2024-11-21 16:38-0300\n "
12
- "PO-Revision-Date : 2023-10-17 22:46-0500 \n "
12
+ "PO-Revision-Date : 2024-11-26 13:30-0600 \n "
13
13
"
Last-Translator :
José Luis Salgado Banda <[email protected] >\n "
14
- "Language : es\n "
15
14
"Language-Team : \n "
16
- "Plural-Forms : nplurals=2; plural=(n != 1); \n "
15
+ "Language : es \n "
17
16
"MIME-Version : 1.0\n "
18
17
"Content-Type : text/plain; charset=utf-8\n "
19
18
"Content-Transfer-Encoding : 8bit\n "
19
+ "Plural-Forms : nplurals=2; plural=(n != 1);\n "
20
20
"Generated-By : Babel 2.16.0\n "
21
+ "X-Generator : Poedit 3.4.2\n "
21
22
22
23
#: ../Doc/howto/annotations.rst:5
23
24
msgid "Annotations Best Practices"
@@ -197,14 +198,21 @@ msgid ""
197
198
"\n"
198
199
"print(Derived.__annotations__)"
199
200
msgstr ""
201
+ "class Base:\n"
202
+ " a: int = 3\n"
203
+ " b: str = 'abc'\n"
204
+ "\n"
205
+ "class Derived(Base):\n"
206
+ " pass\n"
207
+ "\n"
208
+ "print(Derived.__annotations__)"
200
209
201
210
#: ../Doc/howto/annotations.rst:98
202
211
msgid "This will print the annotations dict from ``Base``, not ``Derived``."
203
212
msgstr ""
204
213
"Esto imprimirá el diccionario de anotaciones de ``Base``, no de ``Derived``."
205
214
206
215
#: ../Doc/howto/annotations.rst:101
207
- #, fuzzy
208
216
msgid ""
209
217
"Your code will have to have a separate code path if the object you're "
210
218
"examining is a class (``isinstance(o, type)``). In that case, best practice "
@@ -217,9 +225,9 @@ msgstr ""
217
225
"examinando es una clase (``isinstance(o, type)``). En este caso, la práctica "
218
226
"recomendada se basa en un detalle de implementación de las versiones de "
219
227
"Python 3.9 y anteriores: si una clase tiene anotaciones definidas, se "
220
- "almacenan en el diccionario `` __dict__`` de la clase. Dado que la clase "
221
- "puede o no tener anotaciones definidas, la mejor práctica es llamar al "
222
- "método `` get` ` en el diccionario de la clase."
228
+ "almacenan en el diccionario :attr:`~type. __dict__` de la clase. Dado que la "
229
+ "clase puede o no tener anotaciones definidas, la mejor práctica es llamar al "
230
+ "método :meth:`~dict. get` en el diccionario de la clase."
223
231
224
232
#: ../Doc/howto/annotations.rst:109
225
233
msgid ""
@@ -238,6 +246,10 @@ msgid ""
238
246
"else:\n"
239
247
" ann = getattr(o, '__annotations__', None)"
240
248
msgstr ""
249
+ "if isinstance(o, type):\n"
250
+ " ann = o.__dict__.get('__annotations__', None)\n"
251
+ "else:\n"
252
+ " ann = getattr(o, '__annotations__', None)"
241
253
242
254
#: ../Doc/howto/annotations.rst:118
243
255
msgid ""
@@ -250,15 +262,15 @@ msgstr ""
250
262
"func:`isinstance` antes de un examen más detenido."
251
263
252
264
#: ../Doc/howto/annotations.rst:123
253
- #, fuzzy
254
265
msgid ""
255
266
"Note that some exotic or malformed type objects may not have a :attr:`~type."
256
267
"__dict__` attribute, so for extra safety you may also wish to use :func:"
257
268
"`getattr` to access :attr:`!__dict__`."
258
269
msgstr ""
259
270
"Tome en cuenta que algunos objetos de tipo exótico o con formato incorrecto "
260
- "pueden no tener un atributo ``__dict__``, así que para mayor seguridad, "
261
- "también puede usar :func:`getattr` para acceder a ``__dict__``."
271
+ "pueden no tener un atributo :attr:`~type.__dict__` , así que para mayor "
272
+ "seguridad, también puede usar :func:`getattr` para acceder a :attr:`!"
273
+ "__dict__`."
262
274
263
275
#: ../Doc/howto/annotations.rst:129
264
276
msgid "Manually Un-Stringizing Stringized Annotations"
@@ -326,13 +338,12 @@ msgstr ""
326
338
"corresponda, hasta que haya encontrado la función raíz sin envolver."
327
339
328
340
#: ../Doc/howto/annotations.rst:155
329
- #, fuzzy
330
341
msgid ""
331
342
"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ <function."
332
343
"__globals__>` as the globals when calling :func:`eval`."
333
344
msgstr ""
334
- "Si ``o`` es un invocable (pero no una clase), use `` o.__globals__`` como "
335
- "``globals`` cuando llame a :func:`eval`."
345
+ "Si ``o`` es un invocable (pero no una clase), use :attr:` o.__globals__ "
346
+ "<function.__globals__>` como globales cuando llame a :func:`eval`."
336
347
337
348
#: ../Doc/howto/annotations.rst:159
338
349
msgid ""
@@ -488,6 +499,10 @@ msgid ""
488
499
"\n"
489
500
"print(foo.__annotations__)"
490
501
msgstr ""
502
+ "from __future__ import annotations\n"
503
+ "def foo(a: \" str\" ): pass\n"
504
+ "\n"
505
+ "print(foo.__annotations__)"
491
506
492
507
#: ../Doc/howto/annotations.rst:232
493
508
msgid ""
0 commit comments