@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.12\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2025-04-11 14:54 +0000\n "
14
+ "POT-Creation-Date : 2025-06-06 15:34 +0000\n "
15
15
"PO-Revision-Date : 2024-05-11 00:33+0000\n "
16
16
"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2024\n "
17
17
"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
@@ -65,6 +65,17 @@ msgid ""
65
65
" def total_cost(self) -> float:\n"
66
66
" return self.unit_price * self.quantity_on_hand"
67
67
msgstr ""
68
+ "from dataclasses import dataclass\n"
69
+ "\n"
70
+ "@dataclass\n"
71
+ "class InventoryItem:\n"
72
+ " \"\"\" Class for keeping track of an item in inventory.\"\"\" \n"
73
+ " name: str\n"
74
+ " unit_price: float\n"
75
+ " quantity_on_hand: int = 0\n"
76
+ "\n"
77
+ " def total_cost(self) -> float:\n"
78
+ " return self.unit_price * self.quantity_on_hand"
68
79
69
80
#: ../../library/dataclasses.rst:34
70
81
msgid "will add, among other things, a :meth:`!__init__` that looks like::"
@@ -78,6 +89,11 @@ msgid ""
78
89
" self.unit_price = unit_price\n"
79
90
" self.quantity_on_hand = quantity_on_hand"
80
91
msgstr ""
92
+ "def __init__(self, name: str, unit_price: float, quantity_on_hand: int = "
93
+ "0):\n"
94
+ " self.name = name\n"
95
+ " self.unit_price = unit_price\n"
96
+ " self.quantity_on_hand = quantity_on_hand"
81
97
82
98
#: ../../library/dataclasses.rst:41
83
99
msgid ""
@@ -159,6 +175,19 @@ msgid ""
159
175
"class C:\n"
160
176
" ..."
161
177
msgstr ""
178
+ "@dataclass\n"
179
+ "class C:\n"
180
+ " ...\n"
181
+ "\n"
182
+ "@dataclass()\n"
183
+ "class C:\n"
184
+ " ...\n"
185
+ "\n"
186
+ "@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, "
187
+ "frozen=False,\n"
188
+ " match_args=True, kw_only=False, slots=False, weakref_slot=False)\n"
189
+ "class C:\n"
190
+ " ..."
162
191
163
192
#: ../../library/dataclasses.rst:87
164
193
msgid "The parameters to ``@dataclass`` are:"
@@ -257,6 +286,13 @@ msgid ""
257
286
"and behavior of :meth:`!__eq__`, and the values of the *eq* and *frozen* "
258
287
"flags in the ``@dataclass`` decorator."
259
288
msgstr ""
289
+ ":meth:`!__hash__` é usado para prover o método embutido :meth:`hash`, e "
290
+ "quando objetos são adicionados a coleções do tipo dicionário ou conjunto. "
291
+ "Ter um método :meth:`!__hash__` implica que instâncias da classe serão "
292
+ "imutáveis. Mutabilidade é uma propriedade complicada, que depende da "
293
+ "intenção do programador, da existência e comportamento do método :meth:`!"
294
+ "__eq__`, e dos valores dos parâmetros *eq* e *frozen* no decorador "
295
+ "``@dataclass``."
260
296
261
297
#: ../../library/dataclasses.rst:134
262
298
msgid ""
0 commit comments