99# Claudio Rogerio Carvalho Filho <[email protected] >, 20211010# Vinícius Muniz de Melo <[email protected] >, 20211111# i17obot <[email protected] >, 202112- # Rafael Fontenelle <[email protected] >, 2023 12+ # Rafael Fontenelle <[email protected] >, 2024 1313#
1414#, fuzzy
1515msgid ""
@@ -18,7 +18,7 @@ msgstr ""
1818"Report-Msgid-Bugs-To : \n "
1919"POT-Creation-Date : 2024-03-29 14:13+0000\n "
2020"PO-Revision-Date : 2021-06-28 01:03+0000\n "
21- "
Last-Translator :
Rafael Fontenelle <[email protected] >, 2023 \n "
21+ "
Last-Translator :
Rafael Fontenelle <[email protected] >, 2024 \n "
2222"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
2323"teams/5390/pt_BR/)\n "
2424"MIME-Version : 1.0\n "
@@ -30,7 +30,7 @@ msgstr ""
3030
3131#: ../../library/dataclasses.rst:2
3232msgid ":mod:`!dataclasses` --- Data Classes"
33- msgstr ""
33+ msgstr ":mod:`!dataclasses` --- Data Classes "
3434
3535#: ../../library/dataclasses.rst:10
3636msgid "**Source code:** :source:`Lib/dataclasses.py`"
@@ -58,7 +58,7 @@ msgstr ""
5858
5959#: ../../library/dataclasses.rst:34
6060msgid "will add, among other things, a :meth:`!__init__` that looks like::"
61- msgstr ""
61+ msgstr "adicionará, entre outras coisas, um :meth:`!__init__` como esse:: "
6262
6363#: ../../library/dataclasses.rst:41
6464msgid ""
@@ -77,6 +77,8 @@ msgid ""
7777"This function is a :term:`decorator` that is used to add generated :term:"
7878"`special methods <special method>` to classes, as described below."
7979msgstr ""
80+ "Esta função é um :term:`decorador` que é usado para adicionar :term:`métodos "
81+ "especiais <método especial>` para classes, conforme descrito abaixo."
8082
8183#: ../../library/dataclasses.rst:54
8284msgid ""
@@ -85,6 +87,11 @@ msgid ""
8587"<variable annotation>`. With two exceptions described below, nothing in "
8688"``@dataclass`` examines the type specified in the variable annotation."
8789msgstr ""
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."
8895
8996#: ../../library/dataclasses.rst:60
9097msgid ""
@@ -102,17 +109,24 @@ msgid ""
102109"decorator returns the same class that it is called on; no new class is "
103110"created."
104111msgstr ""
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."
105116
106117#: ../../library/dataclasses.rst:69
107118msgid ""
108119"If ``@dataclass`` is used just as a simple decorator with no parameters, it "
109120"acts as if it has the default values documented in this signature. That is, "
110121"these three uses of ``@dataclass`` are equivalent::"
111122msgstr ""
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::"
112126
113127#: ../../library/dataclasses.rst:87
114128msgid "The parameters to ``@dataclass`` are:"
115- msgstr ""
129+ msgstr "Os parâmetros do ``@dataclass`` são: "
116130
117131#: ../../library/dataclasses.rst:89
118132msgid ""
@@ -126,6 +140,7 @@ msgstr ""
126140msgid ""
127141"If the class already defines :meth:`!__init__`, this parameter is ignored."
128142msgstr ""
143+ "Se a classe do usuário definir :meth:`!__init__` esse parâmetro é ignorado."
129144
130145#: ../../library/dataclasses.rst:95
131146msgid ""
@@ -147,6 +162,7 @@ msgstr ""
147162msgid ""
148163"If the class already defines :meth:`!__repr__`, this parameter is ignored."
149164msgstr ""
165+ "Se a classe do usuário já define :meth:`!__repr__` esse parâmetro é ignorado."
150166
151167#: ../../library/dataclasses.rst:105
152168msgid ""
@@ -163,6 +179,7 @@ msgstr ""
163179msgid ""
164180"If the class already defines :meth:`!__eq__`, this parameter is ignored."
165181msgstr ""
182+ "Se a classe do usuário já define :meth:`!__eq__` esse parâmetro é ignorado."
166183
167184#: ../../library/dataclasses.rst:113
168185msgid ""
@@ -185,6 +202,9 @@ msgid ""
185202"If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:"
186203"`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised."
187204msgstr ""
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."
188208
189209#: ../../library/dataclasses.rst:124
190210msgid ""
@@ -203,6 +223,12 @@ msgid ""
203223"and behavior of :meth:`!__eq__`, and the values of the ``eq`` and ``frozen`` "
204224"flags in the ``@dataclass`` decorator."
205225msgstr ""
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``."
206232
207233#: ../../library/dataclasses.rst:134
208234msgid ""
@@ -212,6 +238,12 @@ msgid ""
212238"attribute ``__hash__ = None`` has a specific meaning to Python, as described "
213239"in the :meth:`!__hash__` documentation."
214240msgstr ""
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__`."
215247
216248#: ../../library/dataclasses.rst:140
217249msgid ""
@@ -222,6 +254,12 @@ msgid ""
222254"logically immutable but can still be mutated. This is a specialized use case "
223255"and should be considered carefully."
224256msgstr ""
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."
225263
226264#: ../../library/dataclasses.rst:147
227265msgid ""
@@ -230,6 +268,10 @@ msgid ""
230268"in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:"
231269"`TypeError`."
232270msgstr ""
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`."
233275
234276#: ../../library/dataclasses.rst:152
235277msgid ""
0 commit comments