@@ -9,15 +9,16 @@ msgstr ""
99"Project-Id-Version : Python en Español 3.10\n "
1010"Report-Msgid-Bugs-To : \n "
1111"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 "
1313"
Last-Translator :
José Luis Salgado Banda <[email protected] >\n "
14- "Language : es\n "
1514"Language-Team : \n "
16- "Plural-Forms : nplurals=2; plural=(n != 1); \n "
15+ "Language : es \n "
1716"MIME-Version : 1.0\n "
1817"Content-Type : text/plain; charset=utf-8\n "
1918"Content-Transfer-Encoding : 8bit\n "
19+ "Plural-Forms : nplurals=2; plural=(n != 1);\n "
2020"Generated-By : Babel 2.16.0\n "
21+ "X-Generator : Poedit 3.4.2\n "
2122
2223#: ../Doc/howto/annotations.rst:5
2324msgid "Annotations Best Practices"
@@ -197,14 +198,21 @@ msgid ""
197198"\n"
198199"print(Derived.__annotations__)"
199200msgstr ""
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__)"
200209
201210#: ../Doc/howto/annotations.rst:98
202211msgid "This will print the annotations dict from ``Base``, not ``Derived``."
203212msgstr ""
204213"Esto imprimirá el diccionario de anotaciones de ``Base``, no de ``Derived``."
205214
206215#: ../Doc/howto/annotations.rst:101
207- #, fuzzy
208216msgid ""
209217"Your code will have to have a separate code path if the object you're "
210218"examining is a class (``isinstance(o, type)``). In that case, best practice "
@@ -217,9 +225,9 @@ msgstr ""
217225"examinando es una clase (``isinstance(o, type)``). En este caso, la práctica "
218226"recomendada se basa en un detalle de implementación de las versiones de "
219227"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."
223231
224232#: ../Doc/howto/annotations.rst:109
225233msgid ""
@@ -238,6 +246,10 @@ msgid ""
238246"else:\n"
239247" ann = getattr(o, '__annotations__', None)"
240248msgstr ""
249+ "if isinstance(o, type):\n"
250+ " ann = o.__dict__.get('__annotations__', None)\n"
251+ "else:\n"
252+ " ann = getattr(o, '__annotations__', None)"
241253
242254#: ../Doc/howto/annotations.rst:118
243255msgid ""
@@ -250,15 +262,15 @@ msgstr ""
250262"func:`isinstance` antes de un examen más detenido."
251263
252264#: ../Doc/howto/annotations.rst:123
253- #, fuzzy
254265msgid ""
255266"Note that some exotic or malformed type objects may not have a :attr:`~type."
256267"__dict__` attribute, so for extra safety you may also wish to use :func:"
257268"`getattr` to access :attr:`!__dict__`."
258269msgstr ""
259270"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__`."
262274
263275#: ../Doc/howto/annotations.rst:129
264276msgid "Manually Un-Stringizing Stringized Annotations"
@@ -326,13 +338,12 @@ msgstr ""
326338"corresponda, hasta que haya encontrado la función raíz sin envolver."
327339
328340#: ../Doc/howto/annotations.rst:155
329- #, fuzzy
330341msgid ""
331342"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ <function."
332343"__globals__>` as the globals when calling :func:`eval`."
333344msgstr ""
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`."
336347
337348#: ../Doc/howto/annotations.rst:159
338349msgid ""
@@ -488,6 +499,10 @@ msgid ""
488499"\n"
489500"print(foo.__annotations__)"
490501msgstr ""
502+ "from __future__ import annotations\n"
503+ "def foo(a: \" str\" ): pass\n"
504+ "\n"
505+ "print(foo.__annotations__)"
491506
492507#: ../Doc/howto/annotations.rst:232
493508msgid ""
0 commit comments