Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3ac0f14

Browse files
Translate howto/annotations (#3335)
Closes#3203
1 parent0dc7bbd commit3ac0f14

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

‎howto/annotations.po

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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 <josephLSalgado@outlook.com>\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
2324
msgid"Annotations Best Practices"
@@ -197,14 +198,21 @@ msgid ""
197198
"\n"
198199
"print(Derived.__annotations__)"
199200
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__)"
200209

201210
#:../Doc/howto/annotations.rst:98
202211
msgid"This will print the annotations dict from ``Base``, not ``Derived``."
203212
msgstr""
204213
"Esto imprimirá el diccionario de anotaciones de ``Base``, no de ``Derived``."
205214

206215
#:../Doc/howto/annotations.rst:101
207-
#,fuzzy
208216
msgid""
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+
"clasepuede 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
225233
msgid""
@@ -238,6 +246,10 @@ msgid ""
238246
"else:\n"
239247
" ann = getattr(o, '__annotations__', None)"
240248
msgstr""
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
243255
msgid""
@@ -250,15 +262,15 @@ msgstr ""
250262
"func:`isinstance` antes de un examen más detenido."
251263

252264
#:../Doc/howto/annotations.rst:123
253-
#,fuzzy
254265
msgid""
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__`."
258269
msgstr""
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
264276
msgid"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
330341
msgid""
331342
"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ <function."
332343
"__globals__>` as the globals when calling :func:`eval`."
333344
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`."
336347

337348
#:../Doc/howto/annotations.rst:159
338349
msgid""
@@ -488,6 +499,10 @@ msgid ""
488499
"\n"
489500
"print(foo.__annotations__)"
490501
msgstr""
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
493508
msgid""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp