9
9
# Claudio Rogerio Carvalho Filho <excriptbrasil@gmail.com>, 2021
10
10
# Vinícius Muniz de Melo <viniciusdesk@icloud.com>, 2021
11
11
# i17obot <i17obot@rougeth.com>, 2021
12
- # Rafael Fontenelle <rffontenelle@gmail.com>, 2023
12
+ # Rafael Fontenelle <rffontenelle@gmail.com>, 2024
13
13
#
14
14
#, fuzzy
15
15
msgid ""
@@ -18,7 +18,7 @@ msgstr ""
18
18
"Report-Msgid-Bugs-To : \n "
19
19
"POT-Creation-Date : 2024-03-29 14:13+0000\n "
20
20
"PO-Revision-Date : 2021-06-28 01:03+0000\n "
21
- "Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2023 \n "
21
+ "Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2024 \n "
22
22
"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
23
23
"teams/5390/pt_BR/)\n "
24
24
"MIME-Version : 1.0\n "
@@ -30,7 +30,7 @@ msgstr ""
30
30
31
31
#: ../../library/dataclasses.rst:2
32
32
msgid ":mod:`!dataclasses` --- Data Classes"
33
- msgstr ""
33
+ msgstr ":mod:`!dataclasses` --- Data Classes "
34
34
35
35
#: ../../library/dataclasses.rst:10
36
36
msgid "**Source code:** :source:`Lib/dataclasses.py`"
@@ -58,7 +58,7 @@ msgstr ""
58
58
59
59
#: ../../library/dataclasses.rst:34
60
60
msgid "will add, among other things, a :meth:`!__init__` that looks like::"
61
- msgstr ""
61
+ msgstr "adicionará, entre outras coisas, um :meth:`!__init__` como esse:: "
62
62
63
63
#: ../../library/dataclasses.rst:41
64
64
msgid ""
@@ -77,6 +77,8 @@ msgid ""
77
77
"This function is a :term:`decorator` that is used to add generated :term:"
78
78
"`special methods <special method>` to classes, as described below."
79
79
msgstr ""
80
+ "Esta função é um :term:`decorador` que é usado para adicionar :term:`métodos "
81
+ "especiais <método especial>` para classes, conforme descrito abaixo."
80
82
81
83
#: ../../library/dataclasses.rst:54
82
84
msgid ""
@@ -85,6 +87,11 @@ msgid ""
85
87
"<variable annotation>`. With two exceptions described below, nothing in "
86
88
"``@dataclass`` examines the type specified in the variable annotation."
87
89
msgstr ""
90
+ "O decorador ``@dataclass`` examina a classe para encontrar campos "
91
+ "(``field``. Um ``field`` é definido como uma variável de classe que tem "
92
+ "uma :term:`anotação de tipo <variable annotation>`. Com duas exceções, "
93
+ "descritas mais adiante, ``@dataclass`` não examina o tipo especificado na "
94
+ "anotação de variável."
88
95
89
96
#: ../../library/dataclasses.rst:60
90
97
msgid ""
@@ -102,17 +109,24 @@ msgid ""
102
109
"decorator returns the same class that it is called on; no new class is "
103
110
"created."
104
111
msgstr ""
112
+ "O decorador ``@dataclass`` adicionará vários métodos \" dunder\" à classe, "
113
+ "descritos abaixo. Se algum dos métodos adicionados já existir na classe, o "
114
+ "comportamento dependerá do parâmetro, conforme documentado abaixo. O "
115
+ "decorador retorna a mesma classe decorada; nenhuma nova classe é criada."
105
116
106
117
#: ../../library/dataclasses.rst:69
107
118
msgid ""
108
119
"If ``@dataclass`` is used just as a simple decorator with no parameters, it "
109
120
"acts as if it has the default values documented in this signature. That is, "
110
121
"these three uses of ``@dataclass`` are equivalent::"
111
122
msgstr ""
123
+ "Se ``@dataclass`` for usado apenas como um simples decorador, sem "
124
+ "parâmetros, ele age como se tivesse os valores padrão documentados nessa "
125
+ "assinatura. Ou seja, esses três usos de ``@dataclass`` são equivalentes::"
112
126
113
127
#: ../../library/dataclasses.rst:87
114
128
msgid "The parameters to ``@dataclass`` are:"
115
- msgstr ""
129
+ msgstr "Os parâmetros do ``@dataclass`` são: "
116
130
117
131
#: ../../library/dataclasses.rst:89
118
132
msgid ""
@@ -126,6 +140,7 @@ msgstr ""
126
140
msgid ""
127
141
"If the class already defines :meth:`!__init__`, this parameter is ignored."
128
142
msgstr ""
143
+ "Se a classe do usuário definir :meth:`!__init__` esse parâmetro é ignorado."
129
144
130
145
#: ../../library/dataclasses.rst:95
131
146
msgid ""
@@ -147,6 +162,7 @@ msgstr ""
147
162
msgid ""
148
163
"If the class already defines :meth:`!__repr__`, this parameter is ignored."
149
164
msgstr ""
165
+ "Se a classe do usuário já define :meth:`!__repr__` esse parâmetro é ignorado."
150
166
151
167
#: ../../library/dataclasses.rst:105
152
168
msgid ""
@@ -163,6 +179,7 @@ msgstr ""
163
179
msgid ""
164
180
"If the class already defines :meth:`!__eq__`, this parameter is ignored."
165
181
msgstr ""
182
+ "Se a classe do usuário já define :meth:`!__eq__` esse parâmetro é ignorado."
166
183
167
184
#: ../../library/dataclasses.rst:113
168
185
msgid ""
@@ -185,6 +202,9 @@ msgid ""
185
202
"If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:"
186
203
"`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised."
187
204
msgstr ""
205
+ "Se a classe do usuário já define algum dentre :meth:`!__lt__`, :meth:`!"
206
+ "__le__`, :meth:`!__gt__` ou :meth:`!__ge__`, então :exc:`TypeError` é "
207
+ "levantada."
188
208
189
209
#: ../../library/dataclasses.rst:124
190
210
msgid ""
@@ -203,6 +223,12 @@ msgid ""
203
223
"and behavior of :meth:`!__eq__`, and the values of the ``eq`` and ``frozen`` "
204
224
"flags in the ``@dataclass`` decorator."
205
225
msgstr ""
226
+ ":meth:`!__hash__` é usado para prover o método :meth:`hash()`, e quando "
227
+ "objetos são adicionados a coleções do tipo dicionário ou conjunto. Ter um "
228
+ "método :meth:`!__hash__` implica que instâncias da classe serão imutáveis. "
229
+ "Mutabilidade é uma propriedade complicada, que depende da intenção do "
230
+ "programador, da existência e comportamento do método :meth:`!__eq__`, e dos "
231
+ "valores dos parâmetros ``eq`` e ``frozen`` no decorador ``@dataclass``."
206
232
207
233
#: ../../library/dataclasses.rst:134
208
234
msgid ""
@@ -212,6 +238,12 @@ msgid ""
212
238
"attribute ``__hash__ = None`` has a specific meaning to Python, as described "
213
239
"in the :meth:`!__hash__` documentation."
214
240
msgstr ""
241
+ "Por padrão, ``@dataclass`` não vai adicionar implicitamente um método :meth:"
242
+ "`~object.__hash__`, a menos que seja seguro fazê-lo. Nem irá adicionar ou "
243
+ "modificar um método :meth:`!__hash__` existente, definido explicitamente. "
244
+ "Configurar o atributo de classe ``__hash__ = None`` tem um significado "
245
+ "específico para o Python, conforme descrito na documentação de :meth:`!"
246
+ "__hash__`."
215
247
216
248
#: ../../library/dataclasses.rst:140
217
249
msgid ""
@@ -222,6 +254,12 @@ msgid ""
222
254
"logically immutable but can still be mutated. This is a specialized use case "
223
255
"and should be considered carefully."
224
256
msgstr ""
257
+ "Se :meth:`!__hash__` não é definido explicitamente, ou se é configurado como "
258
+ "``None``, então ``@dataclass`` *pode* adicionar um método :meth:`!__hash__` "
259
+ "implícito. Mesmo que não seja recomendado, pode-se forçar ``@dataclass`` a "
260
+ "criar um método :meth:`!__hash__` com ``unsafe_hash=True``. Este pode ser o "
261
+ "caso se sua classe é logicamente imutável, mas na prática pode ser mudada. "
262
+ "Esse é um caso de uso específico e deve ser considerado com muito cuidado."
225
263
226
264
#: ../../library/dataclasses.rst:147
227
265
msgid ""
@@ -230,6 +268,10 @@ msgid ""
230
268
"in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:"
231
269
"`TypeError`."
232
270
msgstr ""
271
+ "Essas são as regras governando a criação implícita de um método :meth:`!"
272
+ "__hash__`. Observe que não pode ter um método :meth:`!__hash__` explícito "
273
+ "na dataclass e configurar ``unsafe_hash=True``; isso resultará em um :exc:"
274
+ "`TypeError`."
233
275
234
276
#: ../../library/dataclasses.rst:152
235
277
msgid ""
0 commit comments