FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update translations · python/python-docs-pt-br@d1465d2 · GitHub

Commit d1465d2

Browse files
Update translations
1 parent 3e548af commit d1465d2

4 files changed

Lines changed: 70 additions & 6 deletions

File tree

‎c-api/tuple.po‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ msgid ""
107107
msgstr ""
108108
"A referência retornada é emprestada da tupla *p* (ou seja: ela só é válida "
109109
"enquanto você mantém uma referência a *p*). Para obter uma :term:`referência "
110-
"forte`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) 1` ou :c:func:"
110+
"forte`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) <Py_NewRef>` ou :c:func:"
111111
"`PySequence_GetItem`."
112112

113113
#: ../../c-api/tuple.rst:73

‎faq/programming.po‎

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4252,21 +4252,27 @@ msgstr ""
42524252

42534253
#: ../../faq/programming.rst:1993
42544254
msgid "How do I cache method calls?"
4255-
msgstr ""
4255+
msgstr "Como faço para armazenar em cache as chamadas de um método?"
42564256

42574257
#: ../../faq/programming.rst:1995
42584258
msgid ""
42594259
"The two principal tools for caching methods are :func:`functools."
42604260
"cached_property` and :func:`functools.lru_cache`. The former stores results "
42614261
"at the instance level and the latter at the class level."
42624262
msgstr ""
4263+
"As duas principais ferramentas para armazenamento em cache de métodos são :"
4264+
"func:`functools.cached_property` e :func:`functools.lru_cache`. A primeira "
4265+
"armazena resultados no nível de instância e a segunda no nível de classe."
42634266

42644267
#: ../../faq/programming.rst:2000
42654268
msgid ""
42664269
"The *cached_property* approach only works with methods that do not take any "
42674270
"arguments. It does not create a reference to the instance. The cached "
42684271
"method result will be kept only as long as the instance is alive."
42694272
msgstr ""
4273+
"A abordagem *cached_property* funciona somente com métodos que não aceitam "
4274+
"nenhum argumento. Ela não cria uma referência para a instância. O resultado "
4275+
"do método será mantido em cache somente enquanto a instância estiver ativa."
42704276

42714277
#: ../../faq/programming.rst:2004
42724278
msgid ""
@@ -4275,20 +4281,30 @@ msgid ""
42754281
"accumulate, so too will the accumulated method results. They can grow "
42764282
"without bound."
42774283
msgstr ""
4284+
"A vantagem é que, quando um instância não for mais usada, o resultado do "
4285+
"método armazenado em cache será liberado imediatamente. A desvantagem é "
4286+
"que, se as instâncias se acumularem, os resultados do método também serão "
4287+
"acumulados. Eles podem crescer sem limites."
42784288

42794289
#: ../../faq/programming.rst:2009
42804290
msgid ""
42814291
"The *lru_cache* approach works with methods that have :term:`hashable` "
42824292
"arguments. It creates a reference to the instance unless special efforts "
42834293
"are made to pass in weak references."
42844294
msgstr ""
4295+
"A abordagem *lru_cache* funciona com métodos que têm argumento :term:"
4296+
"`hasheável`. Ele cria uma referência para a instância, a menos que sejam "
4297+
"feitos esforços especiais para passar referências fracas."
42854298

42864299
#: ../../faq/programming.rst:2013
42874300
msgid ""
42884301
"The advantage of the least recently used algorithm is that the cache is "
42894302
"bounded by the specified *maxsize*. The disadvantage is that instances are "
42904303
"kept alive until they age out of the cache or until the cache is cleared."
42914304
msgstr ""
4305+
"A vantagem do algoritmo menos recentemente usado é que o cache é limitado "
4306+
"pelo *maxsize* especificado. A desvantagem é que as instâncias são mantidas "
4307+
"vivas até que saiam do cache ou até que o cache seja limpo."
42924308

42934309
#: ../../faq/programming.rst:2018
42944310
msgid "This example shows the various techniques::"
@@ -4318,20 +4334,49 @@ msgid ""
43184334
" \"Rainfall on a given date\"\n"
43194335
" # Depends on the station_id, date, and units."
43204336
msgstr ""
4337+
"class Weather:\n"
4338+
" \"Procura informações de tempo em sites governamentais\"\n"
4339+
"\n"
4340+
" def __init__(self, station_id):\n"
4341+
" self._station_id = station_id\n"
4342+
" # O _station_id é privado e imutável\n"
4343+
"\n"
4344+
" def current_temperature(self):\n"
4345+
" \"Última observação horária\"\n"
4346+
" # Não armazena isso em cache porque os dados anteriores\n"
4347+
" # podem estar desatualizados.\n"
4348+
"\n"
4349+
" @cached_property\n"
4350+
" def location(self):\n"
4351+
" \"Retornas as coordenadas longitude/latitude coordinates da "
4352+
"estação\"\n"
4353+
" # Resultado depende apenas de station_id\n"
4354+
"\n"
4355+
" @lru_cache(maxsize=20)\n"
4356+
" def historic_rainfall(self, date, units='mm'):\n"
4357+
" \"Precipitação em uma determinada data\"\n"
4358+
" # Depende de station_id, date, e units."
43214359

43224360
#: ../../faq/programming.rst:2042
43234361
msgid ""
43244362
"The above example assumes that the *station_id* never changes. If the "
43254363
"relevant instance attributes are mutable, the *cached_property* approach "
43264364
"can't be made to work because it cannot detect changes to the attributes."
43274365
msgstr ""
4366+
"O exemplo acima assume que o *station_id* nunca muda. Se os atribuitos "
4367+
"relevantes da instância forem mutáveis, a abordagem *cached_property* não "
4368+
"poderá usada porque não é capaz de detectar alterações no atributo."
43284369

43294370
#: ../../faq/programming.rst:2047
43304371
msgid ""
43314372
"To make the *lru_cache* approach work when the *station_id* is mutable, the "
43324373
"class needs to define the :meth:`~object.__eq__` and :meth:`~object."
43334374
"__hash__` methods so that the cache can detect relevant attribute updates::"
43344375
msgstr ""
4376+
"Para que a abordagem *lru_cache* funcione quando *station_id* for mutável, a "
4377+
"classe precisa definir os métodos :meth:`~object.__eq__` e :meth:`~object."
4378+
"__hash__` para que o cache possa detectar atualizações relevantes do "
4379+
"atributo::"
43354380

43364381
#: ../../faq/programming.rst:2051
43374382
msgid ""
@@ -4355,6 +4400,25 @@ msgid ""
43554400
" 'Rainfall on a given date'\n"
43564401
" # Depends on the station_id, date, and units."
43574402
msgstr ""
4403+
"class Weather:\n"
4404+
" \"Examplo com um identificador de estação mutável\"\n"
4405+
"\n"
4406+
" def __init__(self, station_id):\n"
4407+
" self.station_id = station_id\n"
4408+
"\n"
4409+
" def change_station(self, station_id):\n"
4410+
" self.station_id = station_id\n"
4411+
"\n"
4412+
" def __eq__(self, other):\n"
4413+
" return self.station_id == other.station_id\n"
4414+
"\n"
4415+
" def __hash__(self):\n"
4416+
" return hash(self.station_id)\n"
4417+
"\n"
4418+
" @lru_cache(maxsize=20)\n"
4419+
" def historic_rainfall(self, date, units='cm'):\n"
4420+
" \"Precipitação em uma determinada data\"\n"
4421+
" # Depende de station_id, date, e units."
43584422

43594423
#: ../../faq/programming.rst:2073
43604424
msgid "Modules"

‎potodo.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
- newtypes_tutorial.po 25 / 177 ( 14.0% translated).
4646

4747

48-
# faq (94.80% done)
48+
# faq (95.72% done)
4949

5050
- library.po 157 / 162 ( 96.0% translated).
51-
- programming.po 456 / 508 ( 89.0% translated).
51+
- programming.po 466 / 508 ( 91.0% translated).
5252

5353

5454
# howto (57.69% done)
@@ -295,5 +295,5 @@
295295
- 3.7.po 252 / 568 ( 44.0% translated).
296296

297297

298-
# TOTAL (64.87% done)
298+
# TOTAL (64.89% done)
299299

‎stats.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation": "54.15%", "total": 72631, "updated_at": "2025-01-18T23:27:34+00:00Z"}
1+
{"translation": "54.15%", "total": 72631, "updated_at": "2025-01-19T23:27:06+00:00Z"}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL