From 9b0e19c1f3875927e6d6b283f9ff765ea9b0f880 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 30 Aug 2024 11:35:05 +0000 Subject: [PATCH 001/186] Merge 3.13 into 3.12 --- c-api/abstract.po | 2 +- c-api/allocation.po | 2 +- c-api/apiabiversion.po | 2 +- c-api/arg.po | 26 +- c-api/bool.po | 2 +- c-api/buffer.po | 4 +- c-api/bytearray.po | 6 +- c-api/bytes.po | 2 +- c-api/call.po | 2 +- c-api/capsule.po | 2 +- c-api/cell.po | 2 +- c-api/code.po | 28 +- c-api/codec.po | 2 +- c-api/complex.po | 6 +- c-api/concrete.po | 4 +- c-api/contextvars.po | 2 +- c-api/conversion.po | 49 +- c-api/coro.po | 2 +- c-api/datetime.po | 2 +- c-api/descriptor.po | 2 +- c-api/dict.po | 12 +- c-api/exceptions.po | 8 +- c-api/file.po | 14 +- c-api/float.po | 12 +- c-api/frame.po | 2 +- c-api/function.po | 4 +- c-api/gcsupport.po | 2 +- c-api/gen.po | 2 +- c-api/hash.po | 2 +- c-api/import.po | 10 +- c-api/index.po | 2 +- c-api/init.po | 20 +- c-api/init_config.po | 102 +- c-api/intro.po | 8 +- c-api/iter.po | 2 +- c-api/iterator.po | 2 +- c-api/list.po | 2 +- c-api/long.po | 2 +- c-api/mapping.po | 2 +- c-api/marshal.po | 2 +- c-api/memory.po | 2 +- c-api/memoryview.po | 2 +- c-api/method.po | 6 +- c-api/module.po | 43 +- c-api/none.po | 2 +- c-api/number.po | 2 +- c-api/objbuffer.po | 2 +- c-api/object.po | 8 +- c-api/objimpl.po | 2 +- c-api/perfmaps.po | 13 +- c-api/refcounting.po | 2 +- c-api/reflection.po | 12 +- c-api/sequence.po | 2 +- c-api/set.po | 2 +- c-api/slice.po | 2 +- c-api/stable.po | 4 +- c-api/structures.po | 86 +- c-api/sys.po | 49 +- c-api/tuple.po | 6 +- c-api/type.po | 2 +- c-api/typehints.po | 2 +- c-api/typeobj.po | 12 +- c-api/unicode.po | 2 +- c-api/utilities.po | 2 +- c-api/veryhigh.po | 2 +- c-api/weakref.po | 4 +- distributing/index.po | 2 +- extending/building.po | 2 +- extending/embedding.po | 2 +- extending/extending.po | 2 +- extending/index.po | 2 +- extending/newtypes.po | 4 +- extending/newtypes_tutorial.po | 2 +- extending/windows.po | 2 +- faq/design.po | 12 +- faq/extending.po | 2 +- faq/general.po | 2 +- faq/gui.po | 2 +- faq/index.po | 2 +- faq/installed.po | 2 +- faq/library.po | 126 ++- faq/programming.po | 21 +- faq/windows.po | 6 +- howto/annotations.po | 135 ++- howto/argparse.po | 4 +- howto/clinic.po | 2 +- howto/cporting.po | 2 +- howto/curses.po | 10 +- howto/descriptor.po | 2 +- howto/enum.po | 6 +- howto/functional.po | 10 +- howto/gdb_helpers.po | 6 +- howto/index.po | 2 +- howto/instrumentation.po | 6 +- howto/ipaddress.po | 2 +- howto/isolating-extensions.po | 351 +++++- howto/logging-cookbook.po | 8 +- howto/logging.po | 6 +- howto/mro.po | 2 +- howto/perf_profiling.po | 2 +- howto/pyporting.po | 2 +- howto/regex.po | 220 +++- howto/sockets.po | 18 +- howto/sorting.po | 21 +- howto/unicode.po | 6 +- howto/urllib2.po | 12 +- installing/index.po | 26 +- library/2to3.po | 2 +- library/__future__.po | 26 +- library/__main__.po | 4 +- library/_thread.po | 72 +- library/abc.po | 2 +- library/aifc.po | 2 +- library/allos.po | 2 +- library/archiving.po | 2 +- library/argparse.po | 243 +++- library/array.po | 8 +- library/ast.po | 212 +++- library/asyncio-api-index.po | 4 +- library/asyncio-dev.po | 2 +- library/asyncio-eventloop.po | 35 +- library/asyncio-exceptions.po | 2 +- library/asyncio-extending.po | 2 +- library/asyncio-future.po | 2 +- library/asyncio-llapi-index.po | 2 +- library/asyncio-platforms.po | 2 +- library/asyncio-policy.po | 2 +- library/asyncio-protocol.po | 2 +- library/asyncio-queue.po | 2 +- library/asyncio-runner.po | 2 +- library/asyncio-stream.po | 2 +- library/asyncio-subprocess.po | 6 +- library/asyncio-sync.po | 2 +- library/asyncio-task.po | 4 +- library/asyncio.po | 4 +- library/atexit.po | 4 +- library/audioop.po | 2 +- library/audit_events.po | 2 +- library/base64.po | 2 +- library/bdb.po | 2 +- library/binary.po | 2 +- library/binascii.po | 2 +- library/bisect.po | 2 +- library/builtins.po | 4 +- library/bz2.po | 4 +- library/calendar.po | 63 +- library/cgi.po | 2 +- library/cgitb.po | 2 +- library/chunk.po | 2 +- library/cmath.po | 117 +- library/cmd.po | 2 +- library/cmdline.po | 2 +- library/code.po | 97 +- library/codecs.po | 2 +- library/codeop.po | 4 +- library/collections.abc.po | 2 +- library/collections.po | 291 ++++- library/colorsys.po | 4 +- library/compileall.po | 5 +- library/concurrency.po | 2 +- library/concurrent.futures.po | 2 +- library/concurrent.po | 2 +- library/configparser.po | 586 +++++++++- library/constants.po | 2 +- library/contextlib.po | 2 +- library/contextvars.po | 4 +- library/copy.po | 10 +- library/copyreg.po | 4 +- library/crypt.po | 2 +- library/crypto.po | 2 +- library/csv.po | 8 +- library/ctypes.po | 37 +- library/curses.ascii.po | 2 +- library/curses.panel.po | 2 +- library/curses.po | 10 +- library/custominterp.po | 2 +- library/dataclasses.po | 32 +- library/datatypes.po | 2 +- library/datetime.po | 171 ++- library/dbm.po | 2 +- library/debug.po | 2 +- library/decimal.po | 257 ++++- library/development.po | 2 +- library/devmode.po | 2 +- library/dialog.po | 2 +- library/difflib.po | 2 +- library/dis.po | 391 +++++-- library/distribution.po | 2 +- library/doctest.po | 4 +- library/email.charset.po | 2 +- library/email.compat32-message.po | 2 +- library/email.contentmanager.po | 2 +- library/email.encoders.po | 2 +- library/email.errors.po | 2 +- library/email.examples.po | 24 +- library/email.generator.po | 2 +- library/email.header.po | 2 +- library/email.headerregistry.po | 6 +- library/email.iterators.po | 4 +- library/email.message.po | 2 +- library/email.mime.po | 2 +- library/email.parser.po | 2 +- library/email.po | 6 +- library/email.policy.po | 2 +- library/email.utils.po | 8 +- library/ensurepip.po | 6 +- library/enum.po | 4 +- library/errno.po | 2 +- library/exceptions.po | 2 +- library/faulthandler.po | 2 +- library/fcntl.po | 10 +- library/filecmp.po | 2 +- library/fileformats.po | 2 +- library/fileinput.po | 119 +- library/filesys.po | 2 +- library/fnmatch.po | 4 +- library/fractions.po | 66 +- library/frameworks.po | 2 +- library/ftplib.po | 6 +- library/functional.po | 2 +- library/functions.po | 43 +- library/functools.po | 2 +- library/gc.po | 7 +- library/getopt.po | 6 +- library/getpass.po | 4 +- library/gettext.po | 6 +- library/glob.po | 12 +- library/graphlib.po | 3 +- library/grp.po | 2 +- library/gzip.po | 2 +- library/hashlib.po | 2 +- library/heapq.po | 6 +- library/hmac.po | 2 +- library/html.entities.po | 4 +- library/html.parser.po | 4 +- library/html.po | 4 +- library/http.client.po | 6 +- library/http.cookiejar.po | 2 +- library/http.cookies.po | 2 +- library/http.po | 8 +- library/http.server.po | 4 +- library/i18n.po | 2 +- library/idle.po | 2 +- library/imaplib.po | 6 +- library/imghdr.po | 2 +- library/importlib.metadata.po | 12 +- library/importlib.po | 279 ++++- library/importlib.resources.abc.po | 7 +- library/importlib.resources.po | 6 +- library/index.po | 2 +- library/inspect.po | 4 +- library/internet.po | 2 +- library/intro.po | 22 +- library/io.po | 7 +- library/ipaddress.po | 4 +- library/ipc.po | 2 +- library/itertools.po | 8 +- library/json.po | 14 +- library/keyword.po | 4 +- library/language.po | 2 +- library/linecache.po | 4 +- library/locale.po | 4 +- library/logging.config.po | 8 +- library/logging.handlers.po | 10 +- library/logging.po | 20 +- library/lzma.po | 4 +- library/mailbox.po | 2 +- library/mailcap.po | 2 +- library/markup.po | 2 +- library/marshal.po | 12 +- library/math.po | 35 +- library/mimetypes.po | 2 +- library/mm.po | 2 +- library/mmap.po | 4 +- library/modulefinder.po | 4 +- library/modules.po | 2 +- library/msilib.po | 2 +- library/msvcrt.po | 15 +- library/multiprocessing.po | 16 +- library/multiprocessing.shared_memory.po | 2 +- library/netdata.po | 2 +- library/netrc.po | 4 +- library/nis.po | 2 +- library/nntplib.po | 2 +- library/numbers.po | 27 +- library/numeric.po | 2 +- library/operator.po | 4 +- library/optparse.po | 4 +- library/os.path.po | 4 +- library/os.po | 503 +++++---- library/ossaudiodev.po | 2 +- library/pathlib.po | 114 +- library/pdb.po | 7 +- library/persistence.po | 2 +- library/pickle.po | 26 +- library/pickletools.po | 4 +- library/pipes.po | 2 +- library/pkgutil.po | 8 +- library/platform.po | 2 +- library/plistlib.po | 83 +- library/poplib.po | 4 +- library/posix.po | 4 +- library/pprint.po | 4 +- library/profile.po | 2 +- library/pty.po | 6 +- library/pwd.po | 4 +- library/py_compile.po | 30 +- library/pyclbr.po | 24 +- library/pydoc.po | 8 +- library/pyexpat.po | 2 +- library/python.po | 2 +- library/queue.po | 2 +- library/quopri.po | 7 +- library/random.po | 12 +- library/re.po | 4 +- library/readline.po | 4 +- library/reprlib.po | 2 +- library/resource.po | 10 +- library/rlcompleter.po | 19 +- library/runpy.po | 2 +- library/sched.po | 2 +- library/secrets.po | 3 +- library/security_warnings.po | 4 +- library/select.po | 28 +- library/selectors.po | 2 +- library/shelve.po | 2 +- library/shlex.po | 2 +- library/shutil.po | 38 +- library/signal.po | 10 +- library/site.po | 4 +- library/smtplib.po | 4 +- library/sndhdr.po | 2 +- library/socket.po | 34 +- library/socketserver.po | 2 +- library/spwd.po | 2 +- library/sqlite3.po | 26 +- library/ssl.po | 2 +- library/stat.po | 184 ++- library/statistics.po | 79 +- library/stdtypes.po | 25 +- library/string.po | 6 +- library/stringprep.po | 2 +- library/struct.po | 40 +- library/subprocess.po | 2 +- library/sunau.po | 2 +- library/superseded.po | 4 +- library/symtable.po | 2 +- library/sys.monitoring.po | 6 +- library/sys.po | 696 ++++++++++-- library/sys_path_init.po | 2 +- library/sysconfig.po | 5 +- library/syslog.po | 14 +- library/tabnanny.po | 4 +- library/tarfile.po | 143 +-- library/telnetlib.po | 2 +- library/tempfile.po | 6 +- library/termios.po | 4 +- library/test.po | 6 +- library/text.po | 2 +- library/textwrap.po | 137 ++- library/threading.po | 6 +- library/time.po | 115 +- library/timeit.po | 3 +- library/tk.po | 2 +- library/tkinter.colorchooser.po | 4 +- library/tkinter.dnd.po | 8 +- library/tkinter.font.po | 68 +- library/tkinter.messagebox.po | 4 +- library/tkinter.po | 12 +- library/tkinter.scrolledtext.po | 4 +- library/tkinter.tix.po | 2 +- library/tkinter.ttk.po | 138 ++- library/token.po | 4 +- library/tokenize.po | 4 +- library/tomllib.po | 4 +- library/trace.po | 5 +- library/traceback.po | 2 +- library/tracemalloc.po | 2 +- library/tty.po | 5 +- library/turtle.po | 2 +- library/types.po | 5 +- library/typing.po | 49 +- library/unicodedata.po | 2 +- library/unittest.mock-examples.po | 39 +- library/unittest.mock.po | 2 +- library/unittest.po | 6 +- library/unix.po | 2 +- library/urllib.error.po | 3 +- library/urllib.parse.po | 13 +- library/urllib.po | 6 +- library/urllib.request.po | 6 +- library/urllib.robotparser.po | 2 +- library/uu.po | 2 +- library/uuid.po | 4 +- library/venv.po | 4 +- library/warnings.po | 4 +- library/wave.po | 2 +- library/weakref.po | 167 ++- library/webbrowser.po | 4 +- library/windows.po | 2 +- library/winreg.po | 38 +- library/winsound.po | 2 +- library/wsgiref.po | 2 +- library/xdrlib.po | 2 +- library/xml.dom.minidom.po | 2 +- library/xml.dom.po | 2 +- library/xml.dom.pulldom.po | 2 +- library/xml.etree.elementtree.po | 84 +- library/xml.po | 2 +- library/xml.sax.handler.po | 2 +- library/xml.sax.po | 2 +- library/xml.sax.reader.po | 2 +- library/xml.sax.utils.po | 2 +- library/xmlrpc.client.po | 2 +- library/xmlrpc.po | 2 +- library/xmlrpc.server.po | 4 +- library/zipapp.po | 2 +- library/zipfile.po | 16 +- library/zipimport.po | 6 +- library/zlib.po | 4 +- library/zoneinfo.po | 2 +- reference/compound_stmts.po | 222 +++- reference/datamodel.po | 264 ++++- reference/executionmodel.po | 14 +- reference/expressions.po | 34 +- reference/grammar.po | 2 +- reference/import.po | 233 +++- reference/index.po | 2 +- reference/introduction.po | 2 +- reference/lexical_analysis.po | 2 +- reference/simple_stmts.po | 16 +- reference/toplevel_components.po | 2 +- tutorial/appendix.po | 4 +- tutorial/appetite.po | 2 +- tutorial/classes.po | 4 +- tutorial/controlflow.po | 6 +- tutorial/datastructures.po | 10 +- tutorial/errors.po | 2 +- tutorial/floatingpoint.po | 6 +- tutorial/index.po | 2 +- tutorial/inputoutput.po | 6 +- tutorial/interactive.po | 2 +- tutorial/interpreter.po | 2 +- tutorial/introduction.po | 2 +- tutorial/modules.po | 4 +- tutorial/stdlib.po | 2 +- tutorial/stdlib2.po | 5 +- tutorial/venv.po | 2 +- tutorial/whatnow.po | 2 +- using/cmdline.po | 19 +- using/configure.po | 142 ++- using/editors.po | 2 +- using/index.po | 2 +- using/mac.po | 2 +- using/unix.po | 2 +- using/windows.po | 88 +- whatsnew/2.0.po | 982 +++++++++++++--- whatsnew/2.1.po | 259 +++-- whatsnew/2.2.po | 791 ++++++++++++- whatsnew/2.3.po | 1200 ++++++++++++++++++-- whatsnew/2.4.po | 861 ++++++++++++-- whatsnew/2.5.po | 1294 ++++++++++++++++++++-- whatsnew/2.6.po | 405 ++++++- whatsnew/2.7.po | 77 +- whatsnew/3.0.po | 666 +++++++++-- whatsnew/3.1.po | 55 +- whatsnew/3.10.po | 8 +- whatsnew/3.11.po | 12 +- whatsnew/3.12.po | 58 +- whatsnew/3.2.po | 4 +- whatsnew/3.3.po | 8 +- whatsnew/3.4.po | 194 +++- whatsnew/3.5.po | 35 +- whatsnew/3.6.po | 28 +- whatsnew/3.7.po | 29 +- whatsnew/3.8.po | 14 +- whatsnew/3.9.po | 6 +- whatsnew/changelog.po | 2 +- whatsnew/index.po | 2 +- 479 files changed, 13925 insertions(+), 3056 deletions(-) diff --git a/c-api/abstract.po b/c-api/abstract.po index d21d0d087..96935d24e 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/allocation.po b/c-api/allocation.po index 03ec6394e..c18a72328 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index e61fc9f0f..f894f4d0a 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/arg.po b/c-api/arg.po index fc3294c92..b7f1f928e 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -86,7 +86,7 @@ msgstr "" #: ../../c-api/arg.rst:31 msgid "Strings and buffers" -msgstr "Strings and buffers" +msgstr "Strings e buffers" #: ../../c-api/arg.rst:33 msgid "" @@ -484,9 +484,9 @@ msgid "" "recoding them. Instead, the implementation assumes that the byte string " "object uses the encoding passed in as parameter." msgstr "" -"O mesmo que ``es``, exceto que os objetos de cadeia de bytes são passados ​​" -"sem os recodificar. Em vez disso, a implementação assume que o objeto de " -"cadeia de bytes usa a codificação passada como parâmetro." +"O mesmo que ``es``, exceto que os objetos strings de bytes são passados ​​sem " +"os recodificar. Em vez disso, a implementação presume que o objeto string de " +"bytes usa a codificação passada como parâmetro." #: ../../c-api/arg.rst:188 msgid "" @@ -584,9 +584,9 @@ msgid "" "recoding them. Instead, the implementation assumes that the byte string " "object uses the encoding passed in as parameter." msgstr "" -"O mesmo que ``es#``, exceto que os objetos de cadeia de bytes são passados ​​" -"sem que sejam recodificados. Em vez disso, a implementação assume que o " -"objeto de cadeia de bytes usa a codificação passada como parâmetro." +"O mesmo que ``es#``, exceto que os objetos strings de bytes são passados ​​sem " +"que sejam recodificados. Em vez disso, a implementação presume que o objeto " +"string de bytes usa a codificação passada como parâmetro." #: ../../c-api/arg.rst:224 msgid "" @@ -1431,11 +1431,11 @@ msgid "" msgstr "" "Passa um objeto Python intocado, mas cria uma nova :term:`referência forte` " "a ele (isto é, sua contagem de referências é incrementada por um). Se o " -"objeto passado é um ponteiro ``NULL``, assume-se que isso foi causado porque " -"a chamada que produziu o argumento encontrou um erro e definiu uma exceção. " -"Portanto, :c:func:`Py_BuildValue` irá retornar ``NULL`` mas não irá levantar " -"uma exceção. Se nenhuma exceção foi levantada ainda, :exc:`SystemError` é " -"definida." +"objeto passado é um ponteiro ``NULL``, presume-se que isso foi causado " +"porque a chamada que produziu o argumento encontrou um erro e definiu uma " +"exceção. Portanto, :c:func:`Py_BuildValue` irá retornar ``NULL`` mas não irá " +"levantar uma exceção. Se nenhuma exceção foi levantada ainda, :exc:" +"`SystemError` é definida." #: ../../c-api/arg.rst:628 msgid "``S`` (object) [PyObject \\*]" diff --git a/c-api/bool.po b/c-api/bool.po index ae9c791e8..93d016fa7 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/buffer.po b/c-api/buffer.po index 4a9c0da73..43eadfbc9 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -29,10 +29,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -318,7 +318,7 @@ msgid "" msgstr "" "Se :c:member:`~Py_buffer.shape` é ``NULL`` como resultado de uma :c:macro:" "`PyBUF_SIMPLE` ou uma requisição :c:macro:`PyBUF_WRITABLE`, o consumidor " -"deve ignorar :c:member:`~Py_buffer.itemsize` e assumir ``itemsize == 1``." +"deve ignorar :c:member:`~Py_buffer.itemsize` e presumir ``itemsize == 1``." #: ../../c-api/buffer.rst:152 msgid "" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index e9b266d13..891954e7c 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/bytearray.rst:6 msgid "Byte Array Objects" -msgstr "Objetos Byte Array" +msgstr "Objetos byte array" #: ../../c-api/bytearray.rst:13 msgid "" @@ -101,7 +101,7 @@ msgid "" "``NULL`` pointer. The returned array always has an extra null byte appended." msgstr "" "Retorna o conteúdo de *bytearray* como uma matriz de caracteres após " -"verificar um ponteiro ``NULL``. A matriz retornada sempre tem um byte nulo " +"verificar um ponteiro ``NULL``. O array retornado sempre tem um byte nulo " "extra acrescentado." #: ../../c-api/bytearray.rst:71 diff --git a/c-api/bytes.po b/c-api/bytes.po index 368c6105c..e7397fba1 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/call.po b/c-api/call.po index 0139b6473..3fdd1cf0d 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/capsule.po b/c-api/capsule.po index bf4bd6bbe..804b26669 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/cell.po b/c-api/cell.po index 75e187e70..bb9748aee 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/code.po b/c-api/code.po index 1e1f47b66..cc506382a 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -52,20 +52,24 @@ msgid "" "This is an instance of :c:type:`PyTypeObject` representing the Python :ref:" "`code object `." msgstr "" +"Esta é uma instância de :c:type:`PyTypeObject` representando o :ref:`objeto " +"código ` Python." #: ../../c-api/code.rst:30 msgid "" "Return true if *co* is a :ref:`code object `. This function " "always succeeds." msgstr "" +"Retorna verdadeiro se *co* for um :ref:`objeto código `. Esta " +"função sempre tem sucesso." #: ../../c-api/code.rst:35 msgid "Return the number of free variables in a code object." -msgstr "" +msgstr "Retorna o número de variáveis livres em um objeto código." #: ../../c-api/code.rst:39 msgid "Return the position of the first free variable in a code object." -msgstr "" +msgstr "Retorna a posição da primeira variável livre em um objeto código." #: ../../c-api/code.rst:43 msgid "" @@ -414,7 +418,7 @@ msgstr "" #: ../../c-api/code.rst:248 msgid "as ``_PyCode_GetExtra``" -msgstr "" +msgstr "como ``_PyCode_GetExtra``" #: ../../c-api/code.rst:252 msgid "" @@ -429,16 +433,20 @@ msgid "" "Set the extra data stored under the given index to *extra*. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" +"Define os dados extras armazenados sob o índice dado a *extra*. Retorna 0 em " +"caso de sucesso. Define uma exceção e retorna -1 em caso de erro." #: ../../c-api/code.rst:263 msgid "as ``_PyCode_SetExtra``" -msgstr "" +msgstr "como ``_PyCode_SetExtra``" #: ../../c-api/code.rst:267 msgid "" "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " "but will be available until the API changes." msgstr "" +"Renomeado para ``PyUnstable_Code_SetExtra``. O nome antigo privado foi " +"descontinuado, mas continuará disponível até a mudança da API." #: ../../c-api/code.rst:3 msgid "object" @@ -454,20 +462,20 @@ msgstr "objeto código" #: ../../c-api/code.rst:56 msgid "PyCode_New (C function)" -msgstr "" +msgstr "PyCode_New (função C)" #: ../../c-api/code.rst:69 msgid "PyCode_NewWithPosOnlyArgs (C function)" -msgstr "" +msgstr "PyCode_NewWithPosOnlyArgs (função C)" #: ../../c-api/code.rst:228 msgid "_PyEval_RequestCodeExtraIndex (C function)" -msgstr "" +msgstr "_PyEval_RequestCodeExtraIndex (função C)" #: ../../c-api/code.rst:246 msgid "_PyCode_GetExtra (C function)" -msgstr "" +msgstr "_PyCode_GetExtra (função C)" #: ../../c-api/code.rst:261 msgid "_PyCode_SetExtra (C function)" -msgstr "" +msgstr "_PyCode_SetExtra (função C)" diff --git a/c-api/codec.po b/c-api/codec.po index 7585df315..9a4472503 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/complex.po b/c-api/complex.po index cae4c8180..12bdb7ae9 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/complex.rst:6 msgid "Complex Number Objects" -msgstr "Objetos de números complexos" +msgstr "Objetos números complexos" #: ../../c-api/complex.rst:10 msgid "" @@ -36,7 +36,7 @@ msgid "" "and the other is a C structure which represents the actual complex number " "value. The API provides functions for working with both." msgstr "" -"Os objetos de números complexos do Python são implementados como dois tipos " +"Os objetos números complexos do Python são implementados como dois tipos " "distintos quando visualizados na API C: um é o objeto Python exposto aos " "programas Python e o outro é uma estrutura C que representa o valor real do " "número complexo. A API fornece funções para trabalhar com ambos." diff --git a/c-api/concrete.po b/c-api/concrete.po index bfd41f3e0..87e4eab84 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -93,7 +93,7 @@ msgstr "Coleções" #: ../../c-api/concrete.rst:91 msgid "Function Objects" -msgstr "Objetos Função" +msgstr "Objetos Function" #: ../../c-api/concrete.rst:102 msgid "Other Objects" diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 4e2f8db09..f887eea5c 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Leandro Braga , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/conversion.po b/c-api/conversion.po index 11ff72dee..c7525e923 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -29,7 +29,7 @@ msgstr "Conversão e formação de strings" #: ../../c-api/conversion.rst:8 msgid "Functions for number conversion and formatted string output." -msgstr "Funções para conversão de números e saída formatada de Strings." +msgstr "Funções para conversão de números e saída formatada de strings." #: ../../c-api/conversion.rst:13 msgid "" @@ -47,9 +47,9 @@ msgid "" "*format* and the variable argument list *va*. Unix man page :manpage:" "`vsnprintf(3)`." msgstr "" -"Saída não superior a *size* bytes para *str* de acordo com o formato string " -"*format* e a variável argumento de lista *va*. Página man do Unix :manpage:" -"`vsnprintf(3)`." +"Saída não superior a *size* bytes para *str* de acordo com o string de " +"formato *format* e a variável argumento de lista *va*. Página man do Unix :" +"manpage:`vsnprintf(3)`." #: ../../c-api/conversion.rst:23 msgid "" @@ -130,6 +130,9 @@ msgid "" "long` value according to the given ``base``, which must be between ``2`` and " "``36`` inclusive, or be the special value ``0``." msgstr "" +"Converte a parte inicial da string em ``str`` para um valor :c:expr:" +"`unsigned long` de acordo com a ``base`` fornecida, que deve estar entre " +"``2`` e ``36`` inclusive, ou ser o valor especial ``0``." #: ../../c-api/conversion.rst:57 msgid "" @@ -139,6 +142,11 @@ msgid "" "(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the " "end of the scan." msgstr "" +"Espaços em branco iniciais e diferenciação entre caracteres maiúsculos e " +"minúsculos são ignorados. Se ``base`` for zero, procura um ``0b``, ``0o`` ou " +"``0x`` inicial para informar qual base. Se estes estiverem ausentes, o " +"padrão é ``10``. Base deve ser 0 ou entre 2 e 36 (inclusive). Se ``ptr`` não " +"for ``NULL``, conterá um ponteiro para o fim da varredura." #: ../../c-api/conversion.rst:63 msgid "" @@ -147,10 +155,14 @@ msgid "" "macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is " "returned." msgstr "" +"Se o valor convertido ficar fora do intervalo do tipo de retorno " +"correspondente, ocorrerá um erro de intervalo (:c:data:`errno` é definido " +"como :c:macro:`!ERANGE`) e :c:macro:`!ULONG_MAX` será retornado. Se nenhuma " +"conversão puder ser realizada, ``0`` será retornado." #: ../../c-api/conversion.rst:68 msgid "See also the Unix man page :manpage:`strtoul(3)`." -msgstr "" +msgstr "Veja também a página man do Unix :manpage:`strtoul(3)`." #: ../../c-api/conversion.rst:75 msgid "" @@ -158,16 +170,21 @@ msgid "" "according to the given ``base``, which must be between ``2`` and ``36`` " "inclusive, or be the special value ``0``." msgstr "" +"Converte a parte inicial da string em ``str`` para um valor :c:expr:`long` " +"de acordo com a ``base`` fornecida, que deve estar entre ``2`` e ``36`` " +"inclusive, ou ser o valor especial ``0``." #: ../../c-api/conversion.rst:79 msgid "" "Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " "and :c:macro:`LONG_MAX` on overflows." msgstr "" +"O mesmo que :c:func:`PyOS_strtoul`, mas retorna um valor :c:expr:`long` e :c:" +"macro:`LONG_MAX` em caso de estouro." #: ../../c-api/conversion.rst:82 msgid "See also the Unix man page :manpage:`strtol(3)`." -msgstr "" +msgstr "Veja também a página man do Unix :manpage:`strtol(3)`." #: ../../c-api/conversion.rst:89 msgid "" @@ -201,11 +218,11 @@ msgid "" "number, set ``*endptr`` to point to the beginning of the string, raise " "ValueError, and return ``-1.0``." msgstr "" -"Se endptr não for ``NULL``, converte o máximo possível da string e defina " +"Se endptr não for ``NULL``, converte o máximo possível da string e define " "``*endptr`` para apontar para o primeiro caractere não convertido. Se nenhum " "segmento inicial da string for a representação válida de um número de ponto " "flutuante, define ``*endptr`` para apontar para o início da string, levanta " -"ValueError e retorne ``-1.0``." +"ValueError e retorna ``-1.0``." #: ../../c-api/conversion.rst:106 msgid "" @@ -222,7 +239,7 @@ msgstr "" "plataformas), então se ``overflow_exception`` for ``NULL`` retorna " "``Py_HUGE_VAL`` (com um sinal apropriado) e não define nenhuma exceção. Caso " "contrário, ``overflow_exception`` deve apontar para um objeto de exceção " -"Python; levantar essa exceção e retornar ``-1.0``. Em ambos os casos, define " +"Python; levanta essa exceção e retorna ``-1.0``. Em ambos os casos, define " "``*endptr`` para apontar para o primeiro caractere após o valor convertido." #: ../../c-api/conversion.rst:114 @@ -238,7 +255,7 @@ msgid "" "Convert a :c:expr:`double` *val* to a string using supplied *format_code*, " "*precision*, and *flags*." msgstr "" -"Converte um :c:expr:`double` *val* para uma string usando *format_code*, " +"Converte um *val* :c:expr:`double` para uma string usando *format_code*, " "*precision* e *flags* fornecidos." #: ../../c-api/conversion.rst:126 @@ -248,7 +265,7 @@ msgid "" "ignored. The ``'r'`` format code specifies the standard :func:`repr` format." msgstr "" "*format_code* deve ser um entre ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " -"``'G'`` ou ``'r'``. Para ``'r'``, a precisão *precision* fornecida deve ser " +"``'G'`` ou ``'r'``. Para ``'r'``, a precisão *precision* fornecida deve ser " "0 e é ignorada. O código de formato ``'r'`` especifica o formato padrão de :" "func:`repr`." @@ -313,8 +330,8 @@ msgid "" "identically to :c:func:`!strcmp` except that it ignores the case." msgstr "" "Comparação de strings sem diferença entre maiúsculas e minúsculas. A função " -"funciona quase de forma idêntica a :c:func:`!strcmp` exceto que ignora o " -"caso." +"funciona quase de forma idêntica a :c:func:`!strcmp` exceto que ignora a " +"diferença entre maiúsculas e minúsculas." #: ../../c-api/conversion.rst:163 msgid "" @@ -322,5 +339,5 @@ msgid "" "identically to :c:func:`!strncmp` except that it ignores the case." msgstr "" "Comparação de strings sem diferença entre maiúsculas e minúsculas. A função " -"funciona quase de forma idêntica a :c:func:`!strncmp` exceto que ignora o " -"caso." +"funciona quase de forma idêntica a :c:func:`!strncmp` exceto que ignora a " +"diferença entre maiúsculas e minúsculas." diff --git a/c-api/coro.po b/c-api/coro.po index f244db350..cd122b2ed 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/datetime.po b/c-api/datetime.po index b3bbffc96..a33f0331d 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 9c4d40e17..db4e6b152 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/dict.po b/c-api/dict.po index 187b8e7e0..24ed33047 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -161,7 +161,7 @@ msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -"Chamar esta API sem :term:`GIL` retido foi permitido por motivos históricos. " +"Chamar esta API sem :term:`GIL` retida era permitido por motivos históricos. " "Não é mais permitido." #: ../../c-api/dict.rst:111 @@ -464,11 +464,11 @@ msgid "" "exception unless it saves and clears the exception state first, and restores " "it before returning." msgstr "" -"É possível que já exista uma exceção pendente definida na entrada da função " +"É possível que já exista uma exceção pendente definida na entrada da chamada " "de retorno. Nesse caso, a função de retorno deve retornar ``0`` com a mesma " -"exceção ainda definida. Isso significa que a função de retorno não pode " -"chamar nenhuma outra API que possa definir uma exceção, a menos que salve e " -"limpe o estado da exceção primeiro e o restaure antes de retornar." +"exceção ainda definida. Isso significa que a callback não pode chamar " +"nenhuma outra API que possa definir uma exceção, a menos que salve e limpe o " +"estado da exceção primeiro e o restaure antes de retornar." #: ../../c-api/dict.rst:8 msgid "object" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index e16171823..7de72d47c 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -27,10 +27,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -1549,12 +1549,12 @@ msgstr "" "data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:" "`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:" "`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:" -"`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` and :c:data:" -"`PyExc_TimeoutError` were introduced following :pep:`3151`." +"`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` e :c:data:" +"`PyExc_TimeoutError` foram introduzidos seguindo a :pep:`3151`." #: ../../c-api/exceptions.rst:1133 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." -msgstr ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." +msgstr ":c:data:`PyExc_StopAsyncIteration` e :c:data:`PyExc_RecursionError`." #: ../../c-api/exceptions.rst:1136 msgid ":c:data:`PyExc_ModuleNotFoundError`." diff --git a/c-api/file.po b/c-api/file.po index c03f15e0e..072078260 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -42,10 +42,10 @@ msgstr "" "embutidos, que costumavam depender do suporte de E/S em buffer (:c:expr:" "`FILE*`) da biblioteca C padrão. No Python 3, arquivos e streams usam o novo " "módulo :mod:`io`, que define várias camadas sobre a E/S sem buffer de baixo " -"nível do sistema operacional. As funções descritas a seguir são wrappers C " -"de conveniência sobre essas novas APIs e são destinadas principalmente para " -"relatórios de erros internos no interpretador; código de terceiros é " -"recomendado para acessar as APIs de :mod:`io`." +"nível do sistema operacional. As funções descritas a seguir são invólucros " +"de conveniência para o C sobre essas novas APIs e são destinadas " +"principalmente para relatórios de erros internos no interpretador; código de " +"terceiros é recomendado para acessar as APIs de :mod:`io`." #: ../../c-api/file.rst:22 msgid "" @@ -173,8 +173,8 @@ msgid "" "Raises an :ref:`auditing event ` ``setopencodehook`` with no " "arguments." msgstr "" -"Levanta um :ref:`evento de auditoria` ``setopencodehook`` com " -"nenhum argumento." +"Levanta um :ref:`evento de auditoria` ``setopencodehook`` sem " +"argumentos." #: ../../c-api/file.rst:100 msgid "" diff --git a/c-api/float.po b/c-api/float.po index 2f53f2fb4..1c60e185b 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -91,6 +91,8 @@ msgid "" "Return a C :c:expr:`double` representation of the contents of *pyfloat*, but " "without error checking." msgstr "" +"Retorna uma representação C :c:expr:`double` do conteúdo de *pyfloat*, mas " +"sem verificação de erro." #: ../../c-api/float.rst:66 msgid "" @@ -99,19 +101,23 @@ msgid "" "file :file:`float.h`." msgstr "" "Retorna uma instância de structseq que contém informações sobre a precisão, " -"os valores mínimo e máximo de um ponto flutuante. É um wrapper fino em torno " -"do arquivo de cabeçalho :file:`float.h`." +"os valores mínimo e máximo de um ponto flutuante. É um invólucro fino em " +"torno do arquivo de cabeçalho :file:`float.h`." #: ../../c-api/float.rst:73 msgid "" "Return the maximum representable finite float *DBL_MAX* as C :c:expr:" "`double`." msgstr "" +"Retorna o ponto flutuante finito máximo representável *DBL_MAX* como :c:expr:" +"`double` do C." #: ../../c-api/float.rst:78 msgid "" "Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`." msgstr "" +"Retorna o ponto flutuante positivo mínimo normalizado *DBL_MIN* como :c:expr:" +"`double` do C." #: ../../c-api/float.rst:82 msgid "Pack and Unpack functions" diff --git a/c-api/frame.po b/c-api/frame.po index d18e2aee0..183e3abed 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/function.po b/c-api/function.po index b224fab75..4be82e67b 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/function.rst:6 msgid "Function Objects" -msgstr "Objetos Função" +msgstr "Objetos Function" #: ../../c-api/function.rst:10 msgid "There are a few functions specific to Python functions." diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 0dfa75639..7da47bd8c 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/gen.po b/c-api/gen.po index 9cefa6e61..66f1ce023 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/hash.po b/c-api/hash.po index 96bb10f98..4931efc7d 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/import.po b/c-api/import.po index 4538476f3..72d7f8a7d 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -46,10 +46,10 @@ msgid "" "module locks for most purposes, so this function's special behaviour isn't " "needed anymore." msgstr "" -"Essa função falhava em alguns casos, quando o bloqueio de importação era " -"mantido por outra thread. No Python 3.3, no entanto, o esquema de bloqueio " -"mudou passando a ser por módulo na maior parte, dessa forma, o comportamento " -"especial dessa função não é mais necessário." +"Essa função falhava em alguns casos, quando a trava de importação era " +"mantida por outra thread. No Python 3.3, no entanto, o esquema de trava " +"mudou passando a ser de travas por módulo na maior parte, dessa forma, o " +"comportamento especial dessa função não é mais necessário." #: ../../c-api/import.rst:34 msgid "" diff --git a/c-api/index.po b/c-api/index.po index be8f66854..15a309be6 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Marco Rougeth , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/init.po b/c-api/init.po index 2bd7c2f55..7a49c6095 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -536,7 +536,7 @@ msgstr "" msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -"Não exibe as mensagens de direito autoral e de versão nem mesmo no modo " +"Não exibe as mensagens de direitos autorais e de versão nem mesmo no modo " "interativo." #: ../../c-api/init.rst:292 @@ -685,7 +685,7 @@ msgid "" "_PySys_ClearAuditHooks`` with no arguments." msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython." -"_PySys_ClearAuditHooks`` com nenhum argumento." +"_PySys_ClearAuditHooks`` sem argumentos." #: ../../c-api/init.rst:420 msgid "" @@ -1154,7 +1154,7 @@ msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -"A maioria dos códigos de extensão que manipulam o :term:`GIL` tem a seguinte " +"A maioria dos códigos de extensão que manipulam a :term:`GIL` tem a seguinte " "estrutura::" #: ../../c-api/init.rst:881 @@ -1414,7 +1414,7 @@ msgid "" "is acceptable." msgstr "" "Certifique-se de que a thread atual esteja pronta para chamar a API Python " -"C, independentemente do estado atual do Python ou do bloqueio global do " +"C, independentemente do estado atual do Python ou da trava global do " "interpretador (GIL). Isso pode ser chamado quantas vezes desejar por uma " "thread, desde que cada chamada corresponda a uma chamada para :c:func:" "`PyGILState_Release`. Em geral, outras APIs relacionadas a threads podem ser " @@ -1546,7 +1546,7 @@ msgid "" "PyInterpreterState_New`` with no arguments." msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython." -"PyInterpreterState_New`` com nenhum argumento." +"PyInterpreterState_New`` sem argumentos." #: ../../c-api/init.rst:1225 msgid "" @@ -1560,7 +1560,7 @@ msgid "" "PyInterpreterState_Clear`` with no arguments." msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython." -"PyInterpreterState_Clear`` com nenhum argumento." +"PyInterpreterState_Clear`` sem argumentos." #: ../../c-api/init.rst:1233 msgid "" @@ -2093,6 +2093,10 @@ msgid "" "to preserve isolation will expose you to the full consequences of free-" "threading, including races and hard-to-debug crashes." msgstr "" +"Se você preservar o isolamento, terá acesso à computação multi-core " +"adequada, sem as complicações que acompanham o uso de threads livres. A " +"falha em preservar o isolamento traz a exposição a todas as consequências de " +"threads livres, incluindo corridas e travamentos difíceis de depurar." #: ../../c-api/init.rst:1743 msgid "" @@ -2757,7 +2761,7 @@ msgstr "" #: ../../c-api/init.rst:839 msgid "global interpreter lock" -msgstr "bloqueio global do interpretador" +msgstr "trava global do interpretador" #: ../../c-api/init.rst:839 msgid "interpreter lock" diff --git a/c-api/init_config.po b/c-api/init_config.po index a3bd5cc7d..22334a5da 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -302,28 +302,38 @@ msgid "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" +"``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`alocadores de memória padrão " +"` com :ref:`ganchos de depuração `." #: ../../c-api/init_config.rst:248 msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." -msgstr "" +msgstr "``PYMEM_ALLOCATOR_MALLOC`` (``3``): usa ``malloc()`` da biblioteca C." #: ../../c-api/init_config.rst:249 msgid "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" "ref:`debug hooks `." msgstr "" +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): força uso de ``malloc()`` com :ref:" +"`ganchos de depuração `." #: ../../c-api/init_config.rst:251 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " "`." msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`alocador de memória do Python " +"pymalloc `." #: ../../c-api/init_config.rst:253 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " "allocator ` with :ref:`debug hooks `." msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`alocador de memória deo " +"Python pymalloc ` com :ref:`ganchos de depuração `." #: ../../c-api/init_config.rst:257 msgid "" @@ -331,6 +341,9 @@ msgid "" "supported if Python is :option:`configured using --without-pymalloc <--" "without-pymalloc>`." msgstr "" +"``PYMEM_ALLOCATOR_PYMALLOC`` e ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` não são " +"suportados se o Python estiver :option:`configurado usando --without-" +"pymalloc <--without-pymalloc>`." #: ../../c-api/init_config.rst:261 msgid "See :ref:`Memory Management `." @@ -342,36 +355,42 @@ msgstr "Padrão: ``PYMEM_ALLOCATOR_NOT_SET``." #: ../../c-api/init_config.rst:267 msgid "Set the LC_CTYPE locale to the user preferred locale." -msgstr "" +msgstr "Define a localidade LC_CTYPE para a localidade preferida do usuário." #: ../../c-api/init_config.rst:269 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" "member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" +"Se igual a ``0``, define os membros :c:member:`~PyPreConfig.coerce_c_locale` " +"e :c:member:`~PyPreConfig.coerce_c_locale_warn` para ``0``." #: ../../c-api/init_config.rst:272 ../../c-api/init_config.rst:283 msgid "See the :term:`locale encoding`." -msgstr "" +msgstr "Veja a :term:`codificação da localidade`." #: ../../c-api/init_config.rst:274 ../../c-api/init_config.rst:329 #: ../../c-api/init_config.rst:684 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" +"Padrão: ``1`` na configuração do Python, ``0`` na configuração isolada." #: ../../c-api/init_config.rst:278 msgid "If equals to ``2``, coerce the C locale." -msgstr "" +msgstr "Se igual a ``2``, força a localidade para C." #: ../../c-api/init_config.rst:280 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" +"Se for igual a ``1``, lê a localidade LC_CTYPE para decidir se deve ser " +"forçado." #: ../../c-api/init_config.rst:285 ../../c-api/init_config.rst:291 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" +"Padrão: ``-1`` na configuração do Python, ``0`` na configuração isolada." #: ../../c-api/init_config.rst:289 msgid "If non-zero, emit a warning if the C locale is coerced." @@ -381,41 +400,45 @@ msgstr "Se diferente de zero, emite um aviso se a localidade C for forçada." msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" +":ref:`Modo de desenvolvimento do Python `: veja :c:member:`PyConfig." +"dev_mode`." #: ../../c-api/init_config.rst:298 ../../c-api/init_config.rst:693 #: ../../c-api/init_config.rst:735 ../../c-api/init_config.rst:1188 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." -msgstr "" +msgstr "Padrão: ``-1`` no modo do Python, ``0`` no modo isolado." #: ../../c-api/init_config.rst:302 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." -msgstr "" +msgstr "Modo isolado: veja :c:member:`PyConfig.isolated`." #: ../../c-api/init_config.rst:304 ../../c-api/init_config.rst:880 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." -msgstr "" +msgstr "Padrão: ``0`` no modo do Python, ``1`` no modo isolado." #: ../../c-api/init_config.rst:308 msgid "If non-zero:" -msgstr "" +msgstr "Se não zero:" #: ../../c-api/init_config.rst:310 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," -msgstr "" +msgstr "Define :c:member:`PyPreConfig.utf8_mode` para ``0``," #: ../../c-api/init_config.rst:311 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," -msgstr "" +msgstr "Define :c:member:`PyConfig.filesystem_encoding` para ``\"mbcs\"``," #: ../../c-api/init_config.rst:312 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." -msgstr "" +msgstr "Define :c:member:`PyConfig.filesystem_errors` para ``\"replace\"``." #: ../../c-api/init_config.rst:314 msgid "" "Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" +"Inicializado a partir do valor da variável de ambiente :envvar:" +"`PYTHONLEGACYWINDOWSFSENCODING`." #: ../../c-api/init_config.rst:317 ../../c-api/init_config.rst:894 msgid "" @@ -445,7 +468,7 @@ msgid "" msgstr "" "Se diferente de zero, :c:func:`Py_PreInitializeFromArgs` e :c:func:" "`Py_PreInitializeFromBytesArgs` analisam seu argumento ``argv`` da mesma " -"forma que o Python regular analisa argumentos de linha de comando: vej :ref:" +"forma que o Python regular analisa argumentos de linha de comando: veja :ref:" "`Argumentos de linha de comando `." #: ../../c-api/init_config.rst:333 @@ -453,88 +476,106 @@ msgid "" "Use :ref:`environment variables `? See :c:member:`PyConfig." "use_environment`." msgstr "" +"Usar :ref:`variáveis de ambiente `? Veja :c:member:" +"`PyConfig.use_environment`." #: ../../c-api/init_config.rst:336 ../../c-api/init_config.rst:1213 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" +"Padrão: ``1`` na configuração do Python e ``0`` na configuração isolada." #: ../../c-api/init_config.rst:340 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." -msgstr "" +msgstr "Se não zero, habilita o :ref:`modo UTF-8 do Python `." #: ../../c-api/init_config.rst:342 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" +"Define para ``0`` ou ``1`` pela opção de linha de comando :option:`-X utf8 <-" +"X>` e a variável de ambiente :envvar:`PYTHONUTF8`." #: ../../c-api/init_config.rst:345 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" +"Também define como ``1`` se a localidade ``LC_CTYPE`` for ``C`` ou ``POSIX``." #: ../../c-api/init_config.rst:347 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" +"Padrão: ``-1`` na configuração do Python e ``0`` na configuração isolada." #: ../../c-api/init_config.rst:353 msgid "Preinitialize Python with PyPreConfig" -msgstr "" +msgstr "Pré-inicializar Python com PyPreConfig" #: ../../c-api/init_config.rst:355 msgid "The preinitialization of Python:" -msgstr "" +msgstr "A pré-inicialização do Python:" #: ../../c-api/init_config.rst:357 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" +"Define os alocadores de memória Python (:c:member:`PyPreConfig.allocator`)" #: ../../c-api/init_config.rst:358 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" -msgstr "" +msgstr "Configura a localidade LC_CTYPE (:term:`codificação da localidade`)" #: ../../c-api/init_config.rst:359 msgid "" "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." "utf8_mode`)" msgstr "" +"Define o :ref:`Modo UTF-8 do Python ` (:c:member:`PyPreConfig." +"utf8_mode`)" #: ../../c-api/init_config.rst:362 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" +"A pré-configuração atual (tipo ``PyPreConfig``) é armazenada em ``_PyRuntime." +"preconfig``." #: ../../c-api/init_config.rst:365 msgid "Functions to preinitialize Python:" -msgstr "" +msgstr "Funções para pré-inicializar Python:" #: ../../c-api/init_config.rst:369 ../../c-api/init_config.rst:375 #: ../../c-api/init_config.rst:384 msgid "Preinitialize Python from *preconfig* preconfiguration." -msgstr "" +msgstr "Pré-inicializa o Python a partir da pré-configuração *preconfig*." #: ../../c-api/init_config.rst:371 ../../c-api/init_config.rst:380 #: ../../c-api/init_config.rst:389 msgid "*preconfig* must not be ``NULL``." -msgstr "" +msgstr "*preconfig* não pode ser ``NULL``.." #: ../../c-api/init_config.rst:377 msgid "" "Parse *argv* command line arguments (bytes strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" +"Analisa argumentos de linha de comando *argv* (strings de bytes) se :c:" +"member:`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." #: ../../c-api/init_config.rst:386 msgid "" "Parse *argv* command line arguments (wide strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" +"Analisa argumentos de linha de comando *argv* (strings largas) se :c:member:" +"`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." #: ../../c-api/init_config.rst:391 ../../c-api/init_config.rst:1301 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" +"O chamador é responsável por manipular exceções (erro ou saída) usando :c:" +"func:`PyStatus_Exception` e :c:func:`Py_ExitStatusException`." #: ../../c-api/init_config.rst:394 msgid "" @@ -545,6 +586,12 @@ msgid "" "For example, the :option:`-X utf8 <-X>` command line option enables the :ref:" "`Python UTF-8 Mode `." msgstr "" +"Para :ref:`configuração do Python ` (:c:func:" +"`PyPreConfig_InitPythonConfig`), se o Python for inicializado com argumentos " +"de linha de comando, os argumentos de linha de comando também devem ser " +"passados ​​para pré-inicializar o Python, pois eles têm um efeito na pré-" +"configuração como codificações. Por exemplo, a opção de linha de comando :" +"option:`-X utf8 <-X>` habilita o :ref:`Modo UTF-8 do Python `." #: ../../c-api/init_config.rst:401 msgid "" @@ -553,6 +600,11 @@ msgid "" "allocator. It can be called before :c:func:`Py_PreInitialize` if :c:member:" "`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" +"``PyMem_SetAllocator()`` pode ser chamado depois de :c:func:" +"`Py_PreInitialize` e antes de :c:func:`Py_InitializeFromConfig` para " +"instalar um alocador de memória personalizado. Ele pode ser chamado antes " +"de :c:func:`Py_PreInitialize` se :c:member:`PyPreConfig.allocator` estiver " +"definido como ``PYMEM_ALLOCATOR_NOT_SET``." #: ../../c-api/init_config.rst:406 msgid "" @@ -561,12 +613,18 @@ msgid "" "``malloc()`` and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must " "not be called before the Python preinitialization." msgstr "" +"Funções de alocação de memória do Python como :c:func:`PyMem_RawMalloc` não " +"devem ser usadas antes da pré-inicialização do Python, enquanto chamar " +"diretamente ``malloc()`` e ``free()`` é sempre seguro. :c:func:" +"`Py_DecodeLocale` não deve ser chamado antes da pré-inicialização do Python." #: ../../c-api/init_config.rst:411 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" +"Exemplo usando a pré-inicialização para habilitar o :ref:`modo UTF-8 do " +"Python `." #: ../../c-api/init_config.rst:433 msgid "PyConfig" @@ -574,13 +632,15 @@ msgstr "PyConfig" #: ../../c-api/init_config.rst:437 msgid "Structure containing most parameters to configure Python." -msgstr "" +msgstr "Estrutura contendo a maioria dos parâmetros para configurar o Python." #: ../../c-api/init_config.rst:439 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the " "configuration memory." msgstr "" +"Ao terminar, a função :c:func:`PyConfig_Clear` deve ser usada para liberar a " +"memória de configuração." #: ../../c-api/init_config.rst:444 msgid "Structure methods:" diff --git a/c-api/intro.po b/c-api/intro.po index 118abf336..10f41398a 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -615,7 +615,7 @@ msgstr "" "Por outro lado, quando uma função de chamada passa uma referência a um " "objeto, há duas possibilidades: a função *rouba* uma referência ao objeto, " "ou não. *Roubar uma referência* significa que quando você passa uma " -"referência para uma função, essa função assume que agora ela possui essa " +"referência para uma função, essa função presume que agora ela possui essa " "referência e você não é mais responsável por ela." #: ../../c-api/intro.rst:407 @@ -1004,8 +1004,8 @@ msgid "" msgstr "" "Na maioria dos sistemas (em particular, no Unix e no Windows, embora os " "detalhes sejam ligeiramente diferentes), :c:func:`Py_Initialize` calcula o " -"caminho de pesquisa do módulo com base em sua melhor estimativa para a " -"localização do executável do interpretador Python padrão, assumindo que a " +"caminho de pesquisa de módulos com base em sua melhor estimativa para a " +"localização do executável do interpretador Python padrão, presumindo que a " "biblioteca Python é encontrada em um local fixo em relação ao executável do " "interpretador Python. Em particular, ele procura por um diretório chamado :" "file:`lib/python{X.Y}` relativo ao diretório pai onde o executável chamado :" diff --git a/c-api/iter.po b/c-api/iter.po index abaf815e1..eae95c73c 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/iterator.po b/c-api/iterator.po index af9fe0a3d..58a77716f 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/list.po b/c-api/list.po index 15cace0d3..162975d0e 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/long.po b/c-api/long.po index 94e9e47db..6ea51da93 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/mapping.po b/c-api/mapping.po index 61da90118..e52eb4b6d 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/marshal.po b/c-api/marshal.po index e02042f8b..8a5a1cadf 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/memory.po b/c-api/memory.po index 9c9b1591c..ea96dad8c 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/memoryview.po b/c-api/memoryview.po index 20254053a..e27bc8348 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/method.po b/c-api/method.po index 645310961..fb4244f6b 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -36,8 +36,8 @@ msgid "" "to bind a :c:type:`PyCFunction` to a class object. It replaces the former " "call ``PyMethod_New(func, NULL, class)``." msgstr "" -"Um método de instância é um wrapper para um :c:type:`PyCFunction` e a nova " -"maneira de vincular um :c:type:`PyCFunction` a um objeto de classe. Ele " +"Um método de instância é um invólucro para um :c:type:`PyCFunction` e a nova " +"maneira de vincular um :c:type:`PyCFunction` a um objeto classe. Ele " "substitui a chamada anterior ``PyMethod_New(func, NULL, class)``." #: ../../c-api/method.rst:17 diff --git a/c-api/module.po b/c-api/module.po index f2012e525..ac1a98c90 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -88,6 +88,10 @@ msgid "" "object. If *module* is not a module object (or a subtype of a module " "object), :exc:`SystemError` is raised and ``NULL`` is returned." msgstr "" +"Retorna o objeto dicionário que implementa o espaço de nomes de *module*; " +"este objeto é o mesmo que o atributo :attr:`~object.__dict__` do objeto de " +"módulo. Se *module* não for um objeto de módulo (ou um subtipo de um objeto " +"de módulo), :exc:`SystemError` é levantada e ``NULL`` é retornado." #: ../../c-api/module.rst:67 msgid "" @@ -95,6 +99,9 @@ msgid "" "functions rather than directly manipulate a module's :attr:`~object." "__dict__`." msgstr "" +"É recomendado que as extensões usem outras funções ``PyModule_*`` e " +"``PyObject_*`` em vez de manipular diretamente o :attr:`~object.__dict__` de " +"um módulo." #: ../../c-api/module.rst:78 msgid "" @@ -102,6 +109,9 @@ msgid "" "one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is " "returned." msgstr "" +"Retorna o valor :attr:`__name__` do *módulo*. Se o módulo não fornecer um, " +"ou se não for uma string, :exc:`SystemError` é levantada e ``NULL`` é " +"retornado." #: ../../c-api/module.rst:86 msgid "" @@ -154,6 +164,8 @@ msgid "" ":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." msgstr "" +":c:func:`PyModule_GetFilename`: levanta :exc:`UnicodeEncodeError` quando há " +"nomes de arquivos não codificáveis, use :c:func:`PyModule_GetFilenameObject`." #: ../../c-api/module.rst:129 msgid "Initializing C modules" @@ -195,7 +207,7 @@ msgstr "" #: ../../c-api/module.rst:148 msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." -msgstr "" +msgstr "Sempre inicializa este membro para :c:macro:`PyModuleDef_HEAD_INIT`." #: ../../c-api/module.rst:152 msgid "Name for the new module." @@ -215,6 +227,10 @@ msgid "" "with :c:func:`PyModule_GetState`, rather than in static globals. This makes " "modules safe for use in multiple sub-interpreters." msgstr "" +"O estado do módulo pode ser mantido em uma área de memória por módulo que " +"pode ser recuperada com :c:func:`PyModule_GetState`, em vez de em globais " +"estáticos. Isso torna os módulos seguros para uso em vários " +"subinterpretadores." #: ../../c-api/module.rst:165 msgid "" @@ -222,12 +238,17 @@ msgid "" "freed when the module object is deallocated, after the :c:member:" "`~PyModuleDef.m_free` function has been called, if present." msgstr "" +"Esta área de memória é alocada com base em *m_size* na criação do módulo e " +"liberada quando o objeto do módulo é desalocado, após a função :c:member:" +"`~PyModuleDef.m_free` ter sido chamada, se presente." #: ../../c-api/module.rst:169 msgid "" "Setting ``m_size`` to ``-1`` means that the module does not support sub-" "interpreters, because it has global state." msgstr "" +"Definir ``m_size`` como ``-1`` significa que o módulo não oferece suporte a " +"subinterpretadores, porque ele tem estado global." #: ../../c-api/module.rst:172 msgid "" @@ -250,6 +271,9 @@ msgid "" "A pointer to a table of module-level functions, described by :c:type:" "`PyMethodDef` values. Can be ``NULL`` if no functions are present." msgstr "" +"Um ponteiro para uma tabela de funções de nível de módulo, descritas por " +"valores :c:type:`PyMethodDef`. Pode ser ``NULL`` se nenhuma função estiver " +"presente." #: ../../c-api/module.rst:186 msgid "" @@ -257,18 +281,25 @@ msgid "" "``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " "be ``NULL``." msgstr "" +"Uma matriz de definições de slot para inicialização multifásica, terminada " +"por uma entrada ``{0, NULL}``. Ao usar inicialização monofásica, *m_slots* " +"deve ser ``NULL``." #: ../../c-api/module.rst:192 msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" msgstr "" +"Antes da versão 3.5, esse membro era sempre definido como ``NULL`` e era " +"definido como:" #: ../../c-api/module.rst:199 msgid "" "A traversal function to call during GC traversal of the module object, or " "``NULL`` if not needed." msgstr "" +"Uma função de travessia para chamar durante a travessia do GC do objeto do " +"módulo, ou ``NULL`` se não for necessário." #: ../../c-api/module.rst:202 ../../c-api/module.rst:217 #: ../../c-api/module.rst:238 @@ -280,6 +311,12 @@ msgid "" "greater than 0 and the module state (as returned by :c:func:" "`PyModule_GetState`) is ``NULL``." msgstr "" +"Esta função não é mais chamada se o estado do módulo foi solicitado, mas " +"ainda não está alocado. Este é o caso imediatamente após o módulo ser criado " +"e antes de o módulo ser executado (função :c:data:`Py_mod_exec`). Mais " +"precisamente, esta função não é chamada se :c:member:`~PyModuleDef.m_size` " +"for maior que 0 e o estado do módulo (como retornado por :c:func:" +"`PyModule_GetState`) for ``NULL``." #: ../../c-api/module.rst:209 ../../c-api/module.rst:230 #: ../../c-api/module.rst:245 @@ -291,6 +328,8 @@ msgid "" "A clear function to call during GC clearing of the module object, or " "``NULL`` if not needed." msgstr "" +"Uma função de limpeza para chamar durante a limpeza do GC do objeto do " +"módulo, ou ``NULL`` se não for necessário." #: ../../c-api/module.rst:224 msgid "" diff --git a/c-api/none.po b/c-api/none.po index 15246ddab..c443fde75 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/number.po b/c-api/number.po index d96a5d003..60978d041 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/objbuffer.po b/c-api/objbuffer.po index d5e22b753..3bd300f46 100644 --- a/c-api/objbuffer.po +++ b/c-api/objbuffer.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/object.po b/c-api/object.po index 51b328af1..84b960eee 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -43,6 +43,9 @@ msgid "" "function (that is, create a new :term:`strong reference` to :const:" "`NotImplemented` and return it)." msgstr "" +"Manipula adequadamente o retorno de :c:data:`Py_NotImplemented` de dentro de " +"uma função C (ou seja, cria uma nova :term:`referência forte` para :const:" +"`NotImplemented` e retorna-a)." #: ../../c-api/object.rst:24 msgid "" @@ -50,6 +53,9 @@ msgid "" "`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these " "function would use the :func:`str` of the object instead of the :func:`repr`." msgstr "" +"Sinaliza a ser usado com múltiplas funções que imprimem o objeto (como :c:" +"func:`PyObject_Print` e :c:func:`PyFile_WriteObject`). Se passada, esta " +"função usaria o :func:`str` do objeto em vez do :func:`repr`." #: ../../c-api/object.rst:32 msgid "" diff --git a/c-api/objimpl.po b/c-api/objimpl.po index 99178c738..c056be02b 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po index 771096507..d81071aa6 100644 --- a/c-api/perfmaps.po +++ b/c-api/perfmaps.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -61,8 +61,8 @@ msgid "" "Note that holding the Global Interpreter Lock (GIL) is not required for " "these APIs." msgstr "" -"Observe que manter o bloqueio global do interpretador, ou Global Interpreter " -"Lock (GIL), não é necessário para essas APIs." +"Observe que manter a trava global do interpretador (GIL) não é necessário " +"para essas APIs." #: ../../c-api/perfmaps.rst:23 msgid "" @@ -74,7 +74,7 @@ msgid "" "call." msgstr "" "Abre o arquivo ``/tmp/perf-$pid.map``, a menos que já esteja aberto, e cria " -"um bloqueio para garantir escritas seguras para thread no arquivo (desde que " +"uma trava para garantir escritas seguras para thread no arquivo (desde que " "as escritas sejam feitas através de :c:func:" "`PyUnstable_WritePerfMapEntry` ). Normalmente, não há necessidade de chamar " "isso explicitamente; basta usar :c:func:`PyUnstable_WritePerfMapEntry` e ele " @@ -87,9 +87,8 @@ msgid "" "information about the cause of a failure." msgstr "" "Retorna ``0`` em caso de sucesso, ``-1`` em caso de falha ao criar/abrir o " -"arquivo de mapa de desempenho ou ``-2`` em caso de falha na criação de um " -"bloqueio. Verifique ``errno`` para mais informações sobre a causa de uma " -"falha." +"arquivo de mapa de desempenho ou ``-2`` em caso de falha na criação de uma " +"trava. Verifique ``errno`` para mais informações sobre a causa de uma falha." #: ../../c-api/perfmaps.rst:35 msgid "" diff --git a/c-api/refcounting.po b/c-api/refcounting.po index bda0844f5..1e42e06a4 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/reflection.po b/c-api/reflection.po index 0eeb7fb48..7ceb03e3c 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -33,9 +33,9 @@ msgid "" "Return a dictionary of the builtins in the current execution frame, or the " "interpreter of the thread state if no frame is currently executing." msgstr "" -"Retorna um dicionário dos componentes internos no quadro de execução atual " -"ou o interpretador do estado do encadeamento, se nenhum quadro estiver em " -"execução no momento." +"Retorna um dicionário dos componentes embutidos no quadro de execução atual " +"ou o interpretador do estado da thread, se nenhum quadro estiver em execução " +"no momento." #: ../../c-api/reflection.rst:16 msgid "" @@ -81,6 +81,6 @@ msgid "" "`PyEval_GetFuncName`, the result will be a description of *func*." msgstr "" "Retorna uma sequência de caracteres de descrição, dependendo do tipo de " -"*func*. Os valores de retorno incluem \"()\" para funções e métodos, " -"\"construtor\", \"instância\" e \"objeto\". Concatenado com o resultado de :" +"*func*. Os valores de retorno incluem \"()\" para funções e métodos, \" " +"constructor\", \" instance\" e \" object\".. Concatenado com o resultado de :" "c:func:`PyEval_GetFuncName`, o resultado será uma descrição de *func*." diff --git a/c-api/sequence.po b/c-api/sequence.po index dbe1fa7ba..0960cbe52 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/set.po b/c-api/set.po index 9db139a33..e3319888b 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/slice.po b/c-api/slice.po index dc0a315b5..0a630a2e7 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/stable.po b/c-api/stable.po index 30664ee76..c5b7a6953 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -49,7 +49,7 @@ msgid "" "work on 3.10.8 and vice versa, but will need to be compiled separately for " "3.9.x and 3.11.x." msgstr "" -"A Interface Binário de Aplicação (ABI) do CPython é compatível para frente e " +"A Interface Binária de Aplicação (ABI) do CPython é compatível para frente e " "para trás através de uma versão menor (se elas forem compiladas da mesma " "maneira; veja :ref:`stable-abi-platform` abaixo). Portanto, o código " "compilado para Python 3.10.0 funcionará em 3.10.8 e vice-versa, mas " diff --git a/c-api/structures.po b/c-api/structures.po index 8e5309bbb..c658da938 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/structures.rst:6 msgid "Common Object Structures" -msgstr "Estruturas Comuns de Objetos" +msgstr "Estruturas comuns de objetos" #: ../../c-api/structures.rst:8 msgid "" @@ -654,7 +654,7 @@ msgstr "" #: ../../c-api/structures.rst:604 msgid "C type" -msgstr "C type" +msgstr "Tipo C" #: ../../c-api/structures.rst:604 msgid "Python type" @@ -671,7 +671,7 @@ msgstr ":c:expr:`char`" #: ../../c-api/structures.rst:614 ../../c-api/structures.rst:615 #: ../../c-api/structures.rst:616 msgid ":py:class:`int`" -msgstr "" +msgstr ":py:class:`int`" #: ../../c-api/structures.rst:607 msgid ":c:expr:`short`" @@ -687,7 +687,7 @@ msgstr ":c:expr:`long`" #: ../../c-api/structures.rst:610 msgid ":c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`long long`" #: ../../c-api/structures.rst:611 msgid ":c:expr:`unsigned char`" @@ -707,11 +707,11 @@ msgstr ":c:expr:`unsigned long`" #: ../../c-api/structures.rst:615 msgid ":c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned long long`" #: ../../c-api/structures.rst:616 msgid ":c:expr:`Py_ssize_t`" -msgstr "" +msgstr ":c:expr:`Py_ssize_t`" #: ../../c-api/structures.rst:617 msgid ":c:expr:`float`" @@ -719,7 +719,7 @@ msgstr ":c:expr:`float`" #: ../../c-api/structures.rst:617 ../../c-api/structures.rst:618 msgid ":py:class:`float`" -msgstr "" +msgstr ":py:class:`float`" #: ../../c-api/structures.rst:618 msgid ":c:expr:`double`" @@ -727,39 +727,39 @@ msgstr ":c:expr:`double`" #: ../../c-api/structures.rst:619 msgid ":c:expr:`char` (written as 0 or 1)" -msgstr "" +msgstr ":c:expr:`char` (escrito como 0 ou 1)" #: ../../c-api/structures.rst:619 msgid ":py:class:`bool`" -msgstr "" +msgstr ":py:class:`bool`" #: ../../c-api/structures.rst:621 msgid ":c:expr:`const char *` (*)" -msgstr "" +msgstr ":c:expr:`const char *` (*)" #: ../../c-api/structures.rst:621 ../../c-api/structures.rst:622 msgid ":py:class:`str` (RO)" -msgstr "" +msgstr ":py:class:`str` (RO)" #: ../../c-api/structures.rst:622 msgid ":c:expr:`const char[]` (*)" -msgstr "" +msgstr ":c:expr:`const char[]` (*)" #: ../../c-api/structures.rst:623 msgid ":c:expr:`char` (0-127)" -msgstr "" +msgstr ":c:expr:`char` (0-127)" #: ../../c-api/structures.rst:623 msgid ":py:class:`str` (**)" -msgstr "" +msgstr ":py:class:`str` (**)" #: ../../c-api/structures.rst:624 msgid ":c:expr:`PyObject *`" -msgstr "" +msgstr ":c:expr:`PyObject *`" #: ../../c-api/structures.rst:624 msgid ":py:class:`object` (D)" -msgstr "" +msgstr ":py:class:`object` (D)" #: ../../c-api/structures.rst:627 msgid "" @@ -774,13 +774,15 @@ msgstr "" #: ../../c-api/structures.rst:634 msgid "(RO): Implies :c:macro:`Py_READONLY`." -msgstr "" +msgstr "(RO): implica :c:macro:`Py_READONLY`." #: ../../c-api/structures.rst:636 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" +"(D): pode ser deletado, neste caso o ponteiro é definido para ``NULL``. Ler " +"um ponteiro ``NULL`` levanta uma exceção :py:exc:`AttributeError`." #: ../../c-api/structures.rst:662 msgid "" @@ -799,7 +801,7 @@ msgstr "" #: ../../c-api/structures.rst:676 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." -msgstr "" +msgstr "Sempre ``None``. Deve ser usado com :c:macro:`Py_READONLY`." #: ../../c-api/structures.rst:679 msgid "Defining Getters and Setters" @@ -872,92 +874,92 @@ msgstr "staticmethod" #: ../../c-api/structures.rst:563 msgid "READ_RESTRICTED (C macro)" -msgstr "" +msgstr "READ_RESTRICTED (macro C)" #: ../../c-api/structures.rst:563 msgid "WRITE_RESTRICTED (C macro)" -msgstr "" +msgstr "WRITE_RESTRICTED (macro C)" #: ../../c-api/structures.rst:563 msgid "RESTRICTED (C macro)" -msgstr "" +msgstr "RESTRICTED (macro C)" #: ../../c-api/structures.rst:576 msgid "READONLY (C macro)" -msgstr "" +msgstr "READONLY (macro C)" #: ../../c-api/structures.rst:639 msgid "T_BYTE (C macro)" -msgstr "" +msgstr "T_BYTE (macro C)" #: ../../c-api/structures.rst:639 msgid "T_SHORT (C macro)" -msgstr "" +msgstr "T_SHORT (macro C)" #: ../../c-api/structures.rst:639 msgid "T_INT (C macro)" -msgstr "" +msgstr "T_INT (macro C)" #: ../../c-api/structures.rst:639 msgid "T_LONG (C macro)" -msgstr "" +msgstr "T_LONG (macro C)" #: ../../c-api/structures.rst:639 msgid "T_LONGLONG (C macro)" -msgstr "" +msgstr "T_LONGLONG (macro C)" #: ../../c-api/structures.rst:639 msgid "T_UBYTE (C macro)" -msgstr "" +msgstr "T_UBYTE (macro C)" #: ../../c-api/structures.rst:639 msgid "T_USHORT (C macro)" -msgstr "" +msgstr "T_USHORT (macro C)" #: ../../c-api/structures.rst:639 msgid "T_UINT (C macro)" -msgstr "" +msgstr "T_UINT (macro C)" #: ../../c-api/structures.rst:639 msgid "T_ULONG (C macro)" -msgstr "" +msgstr "T_ULONG (macro C)" #: ../../c-api/structures.rst:639 msgid "T_ULONGULONG (C macro)" -msgstr "" +msgstr "T_ULONGULONG (macro C)" #: ../../c-api/structures.rst:639 msgid "T_PYSSIZET (C macro)" -msgstr "" +msgstr "T_PYSSIZET (macro C)" #: ../../c-api/structures.rst:639 msgid "T_FLOAT (C macro)" -msgstr "" +msgstr "T_FLOAT (macro C)" #: ../../c-api/structures.rst:639 msgid "T_DOUBLE (C macro)" -msgstr "" +msgstr "T_DOUBLE (macro C)" #: ../../c-api/structures.rst:639 msgid "T_BOOL (C macro)" -msgstr "" +msgstr "T_BOOL (macro C)" #: ../../c-api/structures.rst:639 msgid "T_CHAR (C macro)" -msgstr "" +msgstr "T_CHAR (macro C)" #: ../../c-api/structures.rst:639 msgid "T_STRING (C macro)" -msgstr "" +msgstr "T_STRING (macro C)" #: ../../c-api/structures.rst:639 msgid "T_STRING_INPLACE (C macro)" -msgstr "" +msgstr "T_STRING_INPLACE (macro C)" #: ../../c-api/structures.rst:639 msgid "T_OBJECT_EX (C macro)" -msgstr "" +msgstr "T_OBJECT_EX (macro C)" #: ../../c-api/structures.rst:639 msgid "structmember.h" -msgstr "" +msgstr "structmember.h" diff --git a/c-api/sys.po b/c-api/sys.po index 66ca71f7d..2c9f6c637 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/sys.rst:6 msgid "Operating System Utilities" -msgstr "Utilitários do Sistema Operacional" +msgstr "Utilitários do sistema operacional" #: ../../c-api/sys.rst:11 msgid "" @@ -168,6 +168,11 @@ msgid "" "C++ compiler). :c:macro:`!USE_STACKCHECK` will be defined automatically; you " "should never change the definition in your own code." msgstr "" +"Retorna verdadeiro quando o interpretador fica sem espaço na pilha. Esta é " +"uma verificação confiável, mas só está disponível quando :c:macro:`!" +"USE_STACKCHECK` é definido (atualmente em certas versões do Windows usando o " +"compilador Microsoft Visual C++). :c:macro:`!USE_STACKCHECK` será definido " +"automaticamente; você nunca deve alterar a definição em seu próprio código." #: ../../c-api/sys.rst:115 msgid "" @@ -175,6 +180,9 @@ msgid "" "around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " "functions directly!" msgstr "" +"Retorna o manipulador de sinal atual para o sinal *i*. Este é um invólucro " +"fino em torno de :c:func:`!sigaction` ou :c:func:`!signal`. Não chame essas " +"funções diretamente!" #: ../../c-api/sys.rst:122 msgid "" @@ -182,6 +190,9 @@ msgid "" "handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" "func:`!signal`. Do not call those functions directly!" msgstr "" +"Define o manipulador de sinal para o sinal *i* como *h*; retornar o " +"manipulador de sinal antigo. Este é um invólucro fino em torno de :c:func:`!" +"sigaction` ou :c:func:`!signal`. Não chame essas funções diretamente!" #: ../../c-api/sys.rst:129 msgid "" @@ -189,6 +200,9 @@ msgid "" "with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:" "`Python is preinitialized `." msgstr "" +"Esta função não deve ser chamada diretamente: use a API :c:type:`PyConfig` " +"com a função :c:func:`PyConfig_SetBytesString` que garante que :ref:`Python " +"esteja pré-inicializado `." #: ../../c-api/sys.rst:133 ../../c-api/sys.rst:200 msgid "" @@ -196,6 +210,9 @@ msgid "" "preinit>` and so that the LC_CTYPE locale is properly configured: see the :c:" "func:`Py_PreInitialize` function." msgstr "" +"Esta função não deve ser chamada antes de :ref:`Python estar pré-" +"inicializado ` e para que a localidade LC_CTYPE seja configurada " +"corretamente: consulte a função :c:func:`Py_PreInitialize`." #: ../../c-api/sys.rst:137 msgid "" @@ -206,6 +223,13 @@ msgid "" "character, the bytes are escaped using the surrogateescape error handler " "instead of decoding them." msgstr "" +"Decodifica uma string de bytes do :term:`tratador de erros e codificação do " +"sistema de arquivos`. Se o tratador de erros for o :ref:`tratador de errors " +"surrogateescape `, bytes não decodificáveis ​​são " +"decodificados como caracteres no intervalo U+DC80..U+DCFF; e se uma string " +"de bytes puder ser decodificada como um caractere substituto, os bytes são " +"escapados usando o tratador de erros surrogateescape em vez de decodificá-" +"los." #: ../../c-api/sys.rst:144 msgid "" @@ -213,6 +237,10 @@ msgid "" "`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the " "number of wide characters excluding the null character into ``*size``" msgstr "" +"Retorna um ponteiro para uma string de caracteres largos recém-alocada, usa :" +"c:func:`PyMem_RawFree` para liberar a memória. Se o tamanho não for " +"``NULL``, escreve o número de caracteres largos excluindo o caractere nulo " +"em ``*size``" #: ../../c-api/sys.rst:148 msgid "" @@ -220,6 +248,9 @@ msgid "" "not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " "``(size_t)-2`` on decoding error." msgstr "" +"Retorna ``NULL`` em erro de decodificação ou erro de alocação de memória. Se " +"*size* não for ``NULL``, ``*size`` é definido como ``(size_t)-1`` em erro de " +"memória ou definido como ``(size_t)-2`` em erro de decodificação." #: ../../c-api/sys.rst:152 ../../c-api/sys.rst:192 msgid "" @@ -227,35 +258,49 @@ msgid "" "`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:" "`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." msgstr "" +":term:`tratador de erros e codificação do sistema de arquivos` são " +"selecionados por :c:func:`PyConfig_Read`: veja os membros :c:member:" +"`~PyConfig.filesystem_encoding` e :c:member:`~PyConfig.filesystem_errors` " +"de :c:type:`PyConfig`." #: ../../c-api/sys.rst:156 msgid "" "Decoding errors should never happen, unless there is a bug in the C library." msgstr "" +"Erros de decodificação nunca devem acontecer, a menos que haja um bug na " +"biblioteca C." #: ../../c-api/sys.rst:159 msgid "" "Use the :c:func:`Py_EncodeLocale` function to encode the character string " "back to a byte string." msgstr "" +"Use a função :c:func:`Py_EncodeLocale` para codificar a string de caracteres " +"de volta para uma string de bytes." #: ../../c-api/sys.rst:164 msgid "" "The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:" "`PyUnicode_DecodeLocaleAndSize` functions." msgstr "" +"As funções :c:func:`PyUnicode_DecodeFSDefaultAndSize` e :c:func:" +"`PyUnicode_DecodeLocaleAndSize`." #: ../../c-api/sys.rst:169 ../../c-api/sys.rst:211 msgid "" "The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " "`." msgstr "" +"A função agora usa a codificação UTF-8 no :ref:`Modo UTF-8 do Python `." #: ../../c-api/sys.rst:173 msgid "" "The function now uses the UTF-8 encoding on Windows if :c:member:" "`PyPreConfig.legacy_windows_fs_encoding` is zero;" msgstr "" +"A função agora usa a codificação UTF-8 no Windows se :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` for zero;" #: ../../c-api/sys.rst:180 msgid "" diff --git a/c-api/tuple.po b/c-api/tuple.po index f34fd3cb7..15e5a48c7 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -175,8 +175,8 @@ msgstr "" "a tupla já for conhecida por alguma outra parte do código. A tupla sempre " "aumentará ou diminuirá no final. Pense nisso como destruir a tupla antiga e " "criar uma nova, mas com mais eficiência. Retorna ``0`` em caso de sucesso. O " -"código do cliente nunca deve assumir que o valor resultante de ``*p`` será o " -"mesmo de antes de chamar esta função. Se o objeto referenciado por ``*p`` " +"código do cliente nunca deve presumir que o valor resultante de ``*p`` será " +"o mesmo de antes de chamar esta função. Se o objeto referenciado por ``*p`` " "for substituído, o ``*p`` original será destruído. Em caso de falha, retorna " "``-1`` e define ``*p`` para ``NULL``, e levanta :exc:`MemoryError` ou :exc:" "`SystemError`." diff --git a/c-api/type.po b/c-api/type.po index 15567d31c..17b01e2b3 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/typehints.po b/c-api/typehints.po index 71a15bae1..80813df66 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 406981d74..b062b7db7 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -82,7 +82,7 @@ msgstr "Slot de PyTypeObject [#slots]_" #: ../../c-api/typeobj.rst:40 ../../c-api/typeobj.rst:201 msgid ":ref:`Type `" -msgstr ":ref:`Type `" +msgstr ":ref:`Tipo `" #: ../../c-api/typeobj.rst:40 msgid "special methods/attrs" @@ -1624,7 +1624,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1922 ../../c-api/typeobj.rst:1943 #: ../../c-api/typeobj.rst:1974 msgid "**Default:**" -msgstr "**Default:**" +msgstr "**Padrão:**" #: ../../c-api/typeobj.rst:831 msgid "" @@ -2142,7 +2142,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1313 ../../c-api/typeobj.rst:1335 msgid ":pep:`634` -- Structural Pattern Matching: Specification" -msgstr "" +msgstr ":pep:`634` -- Structural Pattern Matching: Specification" #: ../../c-api/typeobj.rst:1320 msgid "" @@ -3032,7 +3032,7 @@ msgstr "" #: ../../c-api/typeobj.rst:2127 msgid "\"Safe object finalization\" (:pep:`442`)" -msgstr "\"Safe object finalization\" (:pep:`442`)" +msgstr "\"Finalização segura de objetos\" (:pep:`442`)" #: ../../c-api/typeobj.rst:2132 msgid "" @@ -3098,7 +3098,7 @@ msgstr "" #: ../../c-api/typeobj.rst:2179 msgid "Heap Types" -msgstr "" +msgstr "Tipos no heap" #: ../../c-api/typeobj.rst:2181 msgid "" diff --git a/c-api/unicode.po b/c-api/unicode.po index fe8692fca..6c0d312c4 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/utilities.po b/c-api/utilities.po index a6e6bb224..592756e01 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -17,10 +17,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 0147804e8..7ce7b42b2 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/weakref.po b/c-api/weakref.po index 534c87e22..97db9d105 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/weakref.rst:6 msgid "Weak Reference Objects" -msgstr "Objetos de referência fraca" +msgstr "Objetos referência fraca" #: ../../c-api/weakref.rst:8 msgid "" diff --git a/distributing/index.po b/distributing/index.po index d5288a7f4..e26351a06 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/building.po b/extending/building.po index 9ce1e0138..6c4d5627c 100644 --- a/extending/building.po +++ b/extending/building.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/embedding.po b/extending/embedding.po index 4bd7e4be9..641b06eb9 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/extending.po b/extending/extending.po index f8d748d86..3bfd16d73 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/index.po b/extending/index.po index c99eb0d08..562e67691 100644 --- a/extending/index.po +++ b/extending/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/newtypes.po b/extending/newtypes.po index f97375b2f..e751568bd 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -526,7 +526,7 @@ msgstr "" #: ../../extending/newtypes.rst:546 msgid "Documentation for the :mod:`weakref` module." -msgstr "" +msgstr "Documentação do módulo :mod:`weakref`." #: ../../extending/newtypes.rst:548 msgid "" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 0b72e5d13..4f3371347 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/windows.po b/extending/windows.po index 72f9060c9..802415cfb 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Guilherme Alves da Silva, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/design.po b/faq/design.po index 5c9f8dbb6..571563cdf 100644 --- a/faq/design.po +++ b/faq/design.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -254,7 +254,7 @@ msgstr "" "instância em vez de uma variável local. Ler ``self.x`` ou ``self.meth()`` " "deixa absolutamente claro que uma variável de instância ou método é usado " "mesmo se você não souber a definição da classe de cor. Em C++, você pode " -"perceber pela falta de uma declaração de variável local (assumindo que " +"perceber pela falta de uma declaração de variável local (presumindo que " "globais são raras ou facilmente reconhecíveis) -- mas no Python não há " "declarações de variáveis locais, então você teria que procurar a definição " "de classe para tenha certeza. Alguns padrões de codificação C++ e Java " @@ -1015,7 +1015,7 @@ msgstr "" "própria conta e risco: você pode agrupar uma estrutura mutável dentro de uma " "instância de classe que tenha um método :meth:`~object.__eq__` e um método :" "meth:`~object.__hash__`. Você deve então certificar-se de que o valor de " -"hash para todos os objetos wrapper que residem em um dicionário (ou outra " +"hash para todos os objetos invólucros que residem em um dicionário (ou outra " "estrutura baseada em hash) permaneça fixo enquanto o objeto estiver no " "dicionário (ou outra estrutura). ::" @@ -1050,8 +1050,8 @@ msgid "" "this unless you are prepared to think hard about the requirements and the " "consequences of not meeting them correctly. Consider yourself warned." msgstr "" -"No caso de :class:`!ListWrapper`, sempre que o objeto wrapper estiver em um " -"dicionário, a lista agrupada não deve ser alterada para evitar anomalias. " +"No caso de :class:`!ListWrapper`, sempre que o objeto invólucro estiver em " +"um dicionário, a lista agrupada não deve ser alterada para evitar anomalias. " "Não faça isso a menos que esteja preparado para pensar muito sobre os " "requisitos e as consequências de não atendê-los corretamente. Considere-se " "avisado." @@ -1287,7 +1287,7 @@ msgid "" msgstr "" "Python tem uma instrução :keyword:`with` que envolve a execução de um bloco, " "chamando o código na entrada e na saída do bloco. Algumas linguagens têm uma " -"construção parecida com esta::" +"construção desta forma::" #: ../../faq/design.rst:671 msgid "In Python, such a construct would be ambiguous." diff --git a/faq/extending.po b/faq/extending.po index 02a9de83f..a680e7bb5 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -21,10 +21,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/general.po b/faq/general.po index f28612736..ede2481b5 100644 --- a/faq/general.po +++ b/faq/general.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/gui.po b/faq/gui.po index 91f294515..19b38643b 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/index.po b/faq/index.po index 52a4dbfde..37a732b99 100644 --- a/faq/index.po +++ b/faq/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Ruan Aragão , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/installed.po b/faq/installed.po index dbdaa0dbc..399e89bc6 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/library.po b/faq/library.po index 3e9aacab6..ba9bdf803 100644 --- a/faq/library.po +++ b/faq/library.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -155,7 +155,7 @@ msgid "" msgstr "" "Se você deseja que o script seja independente de onde o interpretador Python " "mora, você pode usar o programa :program:`env`. Quase todas as variantes do " -"Unix suportam o seguinte, assumindo que o interpretador Python esteja em um " +"Unix suportam o seguinte, presumindo que o interpretador Python esteja em um " "diretório no :envvar:`PATH` do usuário::" #: ../../faq/library.rst:71 @@ -461,8 +461,8 @@ msgstr "" "escrever sua própria lógica manualmente. Use o módulo :mod:`queue` para " "criar uma fila contendo uma lista de tarefas. A classe :class:`~queue.Queue` " "mantém uma lista de objetos e possui um método ``.put(obj)`` que adiciona " -"itens à fila e um método ``.get()`` para retorná-los. A classe cuidará do " -"bloqueio necessário para garantir que cada trabalho seja entregue exatamente " +"itens à fila e um método ``.get()`` para retorná-los. A classe cuidará da " +"trava necessário para garantir que cada trabalho seja entregue exatamente " "uma vez." #: ../../faq/library.rst:302 @@ -494,7 +494,7 @@ msgid "" "instruction and therefore all the C implementation code reached from each " "instruction is therefore atomic from the point of view of a Python program." msgstr "" -"Um :term:`bloqueio global do interpretador` (GIL) é usado internamente para " +"Uma :term:`trava global do interpretador` (GIL) é usada internamente para " "garantir que apenas um thread seja executado na VM Python por vez. Em geral, " "Python oferece alternar entre threads apenas entre instruções de bytecode; a " "frequência com que ele muda pode ser definida via :func:`sys." @@ -541,7 +541,7 @@ msgstr "" #: ../../faq/library.rst:406 msgid "Can't we get rid of the Global Interpreter Lock?" -msgstr "Não podemos remover o Bloqueio Global do interpretador?" +msgstr "Não podemos remover a Trava Global do interpretador?" #: ../../faq/library.rst:410 msgid "" @@ -550,11 +550,11 @@ msgid "" "multi-threaded Python program effectively only uses one CPU, due to the " "insistence that (almost) all Python code can only run while the GIL is held." msgstr "" -"O :term:`bloqueio global do interpretador` (GIL) é frequentemente visto como " -"um obstáculo para a implantação do Python em máquinas servidoras " +"A :term:`trava global do interpretador` (GIL) é frequentemente vista como um " +"obstáculo para a implantação do Python em máquinas servidoras " "multiprocessadas de ponta, porque um programa Python multi-threaded " "efetivamente usa apenas uma CPU, devido à insistência de que (quase) todo " -"código Python só pode ser executado enquanto o GIL é mantido." +"código Python só pode ser executado enquanto a GIL é mantida." #: ../../faq/library.rst:415 msgid "" @@ -603,7 +603,7 @@ msgid "" "`hashlib` already do this." msgstr "" "O uso criterioso de extensões C também ajudará; se você usar uma extensão C " -"para executar uma tarefa demorada, a extensão poderá liberar o GIL enquanto " +"para executar uma tarefa demorada, a extensão poderá liberar a GIL enquanto " "o thread de execução estiver no código C e permitir que outros threads " "realizem algum trabalho. Alguns módulos de biblioteca padrão como :mod:" "`zlib` e :mod:`hashlib` já fazem isso." @@ -664,7 +664,7 @@ msgid "" "see the :mod:`os` module. The two functions are identical; :func:`~os." "unlink` is simply the name of the Unix system call for this function." msgstr "" -"Use ``os.remove(filename)`` ou ``os.unlink(filename)``;para documentação, " +"Use ``os.remove(arquivo)`` ou ``os.unlink(arquivo)``; para documentação, " "veja o módulo :mod:`os`. As duas funções são idênticas; :func:`~os.unlink` é " "simplesmente o nome da chamada do sistema para esta função no Unix." @@ -676,10 +676,17 @@ msgid "" "directories as long as they're empty; if you want to delete an entire " "directory tree and its contents, use :func:`shutil.rmtree`." msgstr "" +"Para remover um diretório, use :func:`os.rmdir`; use :func:`os.mkdir` para " +"criar um. ``os.makedirs(caminho)`` criará quaisquer diretórios " +"intermediários em ``path`` que não existam. ``os.removedirs(caminho)`` " +"removerá diretórios intermediários, desde que estejam vazios; se quiser " +"excluir toda uma árvore de diretórios e seu conteúdo, use :func:`shutil." +"rmtree`." #: ../../faq/library.rst:471 msgid "To rename a file, use ``os.rename(old_path, new_path)``." -msgstr "Para renomear um arquivos, use ``os.rename(old_path, new_path)``." +msgstr "" +"Para renomear um arquivos, use ``os.rename(caminho_antigo, caminho_novo)``." #: ../../faq/library.rst:473 msgid "" @@ -688,6 +695,10 @@ msgid "" "There's also ``os.ftruncate(fd, offset)`` for files opened with :func:`os." "open`, where *fd* is the file descriptor (a small integer)." msgstr "" +"Para truncar um arquivo, abra-o usando ``f = open(arquivo, \"rb+\")``, e use " +"``f.truncate(posição)``; a posição tem como padrão a posição atual de busca. " +"Há também ``os.ftruncate(fd, posição)`` para arquivos abertos com :func:`os." +"open`, onde *fd* é o descritor de arquivo (um pequeno inteiro)." #: ../../faq/library.rst:478 msgid "" @@ -695,6 +706,9 @@ msgid "" "files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, and :" "func:`~shutil.rmtree`." msgstr "" +"O módulo :mod:`shutil` também contém uma série de funções para trabalhar em " +"arquivos, incluindo :func:`~shutil.copyfile`, :func:`~shutil.copytree` e :" +"func:`~shutil.rmtree`." #: ../../faq/library.rst:484 msgid "How do I copy a file?" @@ -710,6 +724,13 @@ msgid "" "permissions and metadata, though using :func:`shutil.copy2` instead will " "preserve most (though not all) of it." msgstr "" +"O módulo :mod:`shutil` contém uma função :func:`~shutil.copyfile`. Observe " +"que em volumes NTFS do Windows, ele não copia `fluxos de dados alternativos " +"`_ nem " +"`forks de recursos `__ em " +"volumes HFS+ do macOS, embora ambos sejam raramente usados ​​agora. Ele também " +"não copia permissões de arquivo e metadados, embora usar :func:`shutil." +"copy2` em vez disso preserve a maioria (embora não todos) deles." #: ../../faq/library.rst:497 msgid "How do I read (or write) binary data?" @@ -721,12 +742,17 @@ msgid "" "`struct` module. It allows you to take a string containing binary data " "(usually numbers) and convert it to Python objects; and vice versa." msgstr "" +"Para ler ou escrever formatos de dados binários complexos, é melhor usar o " +"módulo :mod:`struct`. Ele permite que você pegue uma string contendo dados " +"binários (geralmente números) e a converta em objetos Python; e vice-versa." #: ../../faq/library.rst:503 msgid "" "For example, the following code reads two 2-byte integers and one 4-byte " "integer in big-endian format from a file::" msgstr "" +"Por exemplo, o código a seguir lê dois inteiros de 2 bytes e um inteiro de 4 " +"bytes no formato big-endian de um arquivo:" #: ../../faq/library.rst:512 msgid "" @@ -734,12 +760,17 @@ msgid "" "one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " "bytes) from the string." msgstr "" +"O '>' na string de formato força dados big-endian; a letra 'h' lê um " +"\"inteiro curto\" (2 bytes) e 'l' lê um \"inteiro longo\" (4 bytes) da " +"string." #: ../../faq/library.rst:516 msgid "" "For data that is more regular (e.g. a homogeneous list of ints or floats), " "you can also use the :mod:`array` module." msgstr "" +"Para dados mais regulares (por exemplo, uma lista homogênea de ints ou " +"floats), você também pode usar o módulo :mod:`array`." #: ../../faq/library.rst:521 msgid "" @@ -748,6 +779,10 @@ msgid "" "instead (the default), the file will be open in text mode and ``f.read()`` " "will return :class:`str` objects rather than :class:`bytes` objects." msgstr "" +"Para ler e escrever dados binários, é obrigatório abrir o arquivo no modo " +"binário (aqui, passando ``\"rb\"`` para :func:`open`). Se você usar " +"``\"r\"`` em vez disso (o padrão), o arquivo será aberto no modo texto e ``f." +"read()`` retornará objetos :class:`str` em vez de objetos :class:`bytes`." #: ../../faq/library.rst:529 msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" @@ -761,6 +796,11 @@ msgid "" "function. Thus, to read *n* bytes from a pipe *p* created with :func:`os." "popen`, you need to use ``p.read(n)``." msgstr "" +":func:`os.read` é uma função de baixo nível que pega um descritor de " +"arquivo, um pequeno inteiro representando o arquivo aberto. :func:`os.popen` " +"cria um objeto arquivo de alto nível, o mesmo tipo retornado pela função " +"embutida :func:`open`. Assim, para ler *n* bytes de um pipe *p* criado com :" +"func:`os.popen`, você precisa usar ``p.read(n)``." #: ../../faq/library.rst:617 msgid "How do I access the serial (RS232) port?" @@ -768,11 +808,11 @@ msgstr "Como acesso a porta serial (RS232)?" #: ../../faq/library.rst:619 msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:" -msgstr "" +msgstr "Para Win32, OSX, Linux, BSD, Jython, IronPython:" #: ../../faq/library.rst:621 msgid ":pypi:`pyserial`" -msgstr "" +msgstr ":pypi:`pyserial`" #: ../../faq/library.rst:623 msgid "For Unix, see a Usenet post by Mitch Chapman:" @@ -791,6 +831,8 @@ msgid "" "Python :term:`file objects ` are a high-level layer of " "abstraction on low-level C file descriptors." msgstr "" +"Os :term:`objetos arquivos ` do Python são uma camada de alto " +"nível de abstração em descritores de arquivo C de baixo nível." #: ../../faq/library.rst:634 msgid "" @@ -800,6 +842,11 @@ msgid "" "descriptor. This also happens automatically in ``f``'s destructor, when " "``f`` becomes garbage." msgstr "" +"Para a maioria dos objetos arquivo que você cria em Python por meio da " +"função embutida :func:`open`, ``f.close()`` marca o objeto arquivo Python " +"como fechado do ponto de vista do Python e também organiza o fechamento do " +"descritor de arquivo C subjacente. Isso também acontece automaticamente no " +"destrutor de ``f``, quando ``f`` se torna lixo." #: ../../faq/library.rst:640 msgid "" @@ -808,6 +855,10 @@ msgid "" "marks the Python-level file object as being closed, but does *not* close the " "associated C file descriptor." msgstr "" +"Mas stdin, stdout e stderr são tratados de forma especial pelo Python, " +"devido ao status especial que também lhes é dado pelo C. Executar ``sys." +"stdout.close()`` marca o objeto arquivo de nível Python como fechado, mas " +"*não* fecha o descritor de arquivo C associado." #: ../../faq/library.rst:645 msgid "" @@ -815,10 +866,14 @@ msgid "" "first be sure that's what you really want to do (e.g., you may confuse " "extension modules trying to do I/O). If it is, use :func:`os.close`::" msgstr "" +"Para fechar o descritor de arquivo C subjacente para um desses três, você " +"deve primeiro ter certeza de que é isso que você realmente quer fazer (por " +"exemplo, você pode confundir módulos de extensão tentando fazer E/S). Se " +"for, use :func:`os.close`::" #: ../../faq/library.rst:653 msgid "Or you can use the numeric constants 0, 1 and 2, respectively." -msgstr "Ou você pode usar as constantes numérias 0, 1 e 2, respectivamente." +msgstr "Ou você pode usar as constantes numéricas 0, 1 e 2, respectivamente." #: ../../faq/library.rst:657 msgid "Network/Internet Programming" @@ -826,7 +881,7 @@ msgstr "Programação Rede / Internet" #: ../../faq/library.rst:660 msgid "What WWW tools are there for Python?" -msgstr "Quais ferramentas WWW existem no Python?" +msgstr "Quais ferramentas para WWW existem no Python?" #: ../../faq/library.rst:662 msgid "" @@ -834,6 +889,9 @@ msgid "" "Reference Manual. Python has many modules that will help you build server-" "side and client-side web systems." msgstr "" +"Veja os capítulos intitulados :ref:`internet` e :ref:`netdata` no Manual de " +"Referência da Biblioteca. Python tem muitos módulos que ajudarão você a " +"construir sistemas web do lado do servidor e do lado do cliente." #: ../../faq/library.rst:668 msgid "" @@ -912,10 +970,14 @@ msgid "" "usr/sbin/sendmail``. The sendmail manual page will help you out. Here's " "some sample code::" msgstr "" +"Uma alternativa somente para Unix usa o sendmail. A localização do programa " +"sendmail varia entre os sistemas; às vezes é ``/usr/lib/sendmail``, às vezes " +"``/usr/sbin/sendmail``. A página de manual do sendmail vai ajudar você. Aqui " +"está um código de exemplo::" #: ../../faq/library.rst:761 msgid "How do I avoid blocking in the connect() method of a socket?" -msgstr "Como evito o bloqueio no método connect() de um soquete?" +msgstr "Como evito um bloqueio no método connect() de um soquete?" #: ../../faq/library.rst:763 msgid "" @@ -935,6 +997,13 @@ msgid "" "return different values, so you're going to have to check what's returned on " "your system." msgstr "" +"Para evitar que a conexão TCP bloqueie, você pode definir o soquete para o " +"modo sem bloqueio. Então, quando você fizer o :meth:`~socket.socket." +"connect`, você se conectará imediatamente (improvável) ou obterá uma exceção " +"que contém o número de erro como ``.errno``. ``errno.EINPROGRESS`` indica " +"que a conexão está em andamento, mas ainda não terminou. Diferentes sistemas " +"operacionais retornarão valores diferentes, então você terá que verificar o " +"que é retornado no seu sistema." #: ../../faq/library.rst:774 msgid "" @@ -944,6 +1013,11 @@ msgid "" "indicate that you're connected -- or you can pass this socket to :meth:" "`select.select` to check if it's writable." msgstr "" +"Você pode usar o método :meth:`~socket.socket.connect_ex` para evitar criar " +"uma exceção. Ele retornará apenas o valor de errno. Para pesquisar, você " +"pode chamar :meth:`~socket.socket.connect_ex` novamente mais tarde -- ``0`` " +"ou ``errno.EISCONN`` indicam que você está conectado -- ou você pode passar " +"este soquete para :meth:`select.select` para verificar se ele é gravável." #: ../../faq/library.rst:782 msgid "" @@ -952,6 +1026,10 @@ msgid "" "network code. The third-party `Twisted `_ library is a " "popular and feature-rich alternative." msgstr "" +"O módulo :mod:`asyncio` fornece uma biblioteca assíncrona de thread única e " +"concorrente de propósito geral, que pode ser usada para escrever código de " +"rede não bloqueante. A biblioteca de terceiros `Twisted `_ é uma alternativa popular e rica em recursos." #: ../../faq/library.rst:790 msgid "Databases" @@ -972,6 +1050,10 @@ msgid "" "`sqlite3` module, which provides a lightweight disk-based relational " "database." msgstr "" +"Interfaces para hashes baseados em disco, como :mod:`DBM ` e :mod:" +"`GDBM ` também estão incluídas no Python padrão. Há também o " +"módulo :mod:`sqlite3`, que fornece um banco de dados relacional baseado em " +"disco leve." #: ../../faq/library.rst:802 msgid "" @@ -994,6 +1076,11 @@ msgid "" "mod:`shelve` library module uses pickle and (g)dbm to create persistent " "mappings containing arbitrary Python objects." msgstr "" +"O módulo de biblioteca :mod:`pickle` resolve isso de uma maneira muito geral " +"(embora você ainda não possa armazenar coisas como arquivos abertos, " +"soquetes ou janelas), e o módulo de biblioteca :mod:`shelve` usa pickle e " +"(g)dbm para criar mapeamentos persistentes contendo objetos Python " +"arbitrários." #: ../../faq/library.rst:817 msgid "Mathematics and Numerics" @@ -1033,6 +1120,8 @@ msgstr "``uniform(a, b)`` escolhe um número float no intervalo [a, b)." msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." msgstr "" +"``normalvariate(mean, sdev)`` gera números pseudoaleatórios que seguem uma " +"distribuição normal (Gaussiana)." #: ../../faq/library.rst:836 msgid "Some higher-level functions operate on sequences directly, such as:" @@ -1042,10 +1131,13 @@ msgstr "" #: ../../faq/library.rst:838 msgid "``choice(S)`` chooses a random element from a given sequence." msgstr "" +"``choice(S)`` escolhe um elemento aleatório de uma determinada sequência." #: ../../faq/library.rst:839 msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "" +"``shuffle(L)`` embaralha uma lista internamente, ou seja permuta seus " +"elementos aleatoriamente." #: ../../faq/library.rst:841 msgid "" diff --git a/faq/programming.po b/faq/programming.po index b2069aaf3..237ff0977 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -355,7 +355,7 @@ msgid "" msgstr "" "Em Python, as variáveis que são apenas utilizadas (referenciadas) dentro de " "uma função são implicitamente globais. Se uma variável for associada a um " -"valor em qualquer lugar dentro do corpo da função, assume-se que a mesma " +"valor em qualquer lugar dentro do corpo da função, presume-se que a mesma " "será local, a menos que seja explicitamente declarado como global." #: ../../faq/programming.rst:198 @@ -1178,8 +1178,8 @@ msgstr "" "são aqueles que não têm nome utilizável externamente. Ao chamar uma função " "que aceita parâmetros somente-posicionais, os argumentos são mapeados para " "parâmetros com base apenas em sua posição. Por exemplo, :func:`divmod` é uma " -"função que aceita parâmetros somente-posicionais. Sua documentação se parece " -"com o seguinte:" +"função que aceita parâmetros somente-posicionais. Sua documentação tem esta " +"forma:" #: ../../faq/programming.rst:792 msgid "" @@ -1449,6 +1449,13 @@ msgid "" "parameter which is useful if the line uses something other than whitespace " "as a separator." msgstr "" +"Para a análise de entrada simples, a abordagem mais fácil geralmente é " +"dividir a linha em palavras delimitadas por espaços em branco usando o " +"método :meth:`str.split` de objetos Strings e, em seguida, converter as " +"Strings decimais para valores numéricos usando a função :func:`int` ou a " +"função :func:`float`. A função :meth:`!split()` aceita um parâmetro \"sep\" " +"opcional que é útil se a linha utilizar algo diferente de espaço em branco " +"como separador." #: ../../faq/programming.rst:1019 msgid "" @@ -1506,11 +1513,11 @@ msgstr "" #: ../../faq/programming.rst:1070 msgid "Performance" -msgstr "Performance" +msgstr "Desempenho" #: ../../faq/programming.rst:1073 msgid "My program is too slow. How do I speed it up?" -msgstr "Meu programa está muito lento. Como faço para melhorar a performance?" +msgstr "Meu programa está muito lento. Como faço para melhorar o desempenho?" #: ../../faq/programming.rst:1075 msgid "" @@ -1518,7 +1525,7 @@ msgid "" "remember before diving further:" msgstr "" "Isso geralmente é algo difícil de conseguir. Primeiro, aqui está uma lista " -"de situações que devemos lembrar para melhorar a performance da nossa " +"de situações que devemos lembrar para melhorar o desempenho da nossa " "aplicação antes de buscarmos outras soluções:" #: ../../faq/programming.rst:1078 diff --git a/faq/windows.po b/faq/windows.po index 86deab282..999e9fb34 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -66,7 +66,7 @@ msgstr "" "do DOS\" ou \"janela do prompt de comando\". Geralmente você pode abrir " "essas janelas procurando na barra de pesquisa por ``cmd``. Você deverá " "reconhecer quando iniciar porque você verá um \"Prompt de Comando do " -"Windows\", que geralmente parece com isso:" +"Windows\", que geralmente tem esta forma:" #: ../../faq/windows.rst:39 msgid "" @@ -420,7 +420,7 @@ msgid "" "Problem 2: SWIG generates the following code when generating wrappers to " "void functions:" msgstr "" -"Problema 2: SWIG gera o seguinte código ao gerar envólucros para funções sem " +"Problema 2: SWIG gera o seguinte código ao gerar invólucros para funções sem " "retorno:" #: ../../faq/windows.rst:235 diff --git a/howto/annotations.po b/howto/annotations.po index d27ce3df9..ec90e8391 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/annotations.rst:5 msgid "Annotations Best Practices" -msgstr "Boas Práticas de Anotação" +msgstr "Boas práticas para anotações" #: ../../howto/annotations.rst:0 msgid "author" @@ -80,15 +80,15 @@ msgid "" "`typing` module." msgstr "" "Note que este documento é específico sobre trabalhar com " -"``__annotations__``, não usa para anotações. Se você está procurando por " -"informações sobre como usar \"type hints\" no seu código, por favor veja o " -"módulo :mod:`typing`" +"``__annotations__``, não para o uso *de* anotações. Se você está procurando " +"por informações sobre como usar \"type hints\" no seu código, por favor veja " +"o módulo :mod:`typing`" #: ../../howto/annotations.rst:33 msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer" msgstr "" -"Acessando O Dicionário De Anotações De Um Objeto No Python 3.10 E Nas " -"Versões Mais Recente." +"Acessando o dicionário de anotações de um objeto no Python 3.10 e nas " +"versões mais recentes" #: ../../howto/annotations.rst:35 msgid "" @@ -100,8 +100,8 @@ msgid "" msgstr "" "O Python 3.10 adicionou uma nova função para a biblioteca padrão: :func:" "`inspect.get_annotations`. No Python 3.10 e nas versões mais recentes, " -"chamando esta função é a melhor pratica para acessar o dicionário de " -"anotações de qualquer objeto que suporta anotações. Esta função pode até " +"chamar esta função é a melhor prática para acessar o dicionário de anotações " +"de qualquer objeto com suporte a anotações. Esta função pode até " "\"destextualizar\" anotações textualizadas para você." #: ../../howto/annotations.rst:42 @@ -116,12 +116,11 @@ msgid "" msgstr "" "Se por alguma razão :func:`inspect.get_annotations` não for viável para o " "seu caso de uso, você pode acessar o membro de dados ``__annotations__`` " -"manualmente. As melhores práticas para isto também mudaram no Python 3.10: A " -"partir do Python 3.10, ``o.__annotations__`` é garantido de *sempre* " -"funcionar em funções, classes e módulos Python. Se você tem certeza que o " -"objeto que você está examinando é um desses três *exatos* objetos, pode " -"simplesmente usar ``o.__annotations__`` para chegar no dicionário de " -"anotações do objeto." +"manualmente. As melhores práticas para isto também mudaram no Python 3.10: a " +"partir do Python 3.10, ``o.__annotations__`` é garantido *sempre* funcionar " +"em funções, classes e módulos Python. Se você tem certeza que o objeto que " +"você está examinando é um desses três *exatos* objetos, pode simplesmente " +"usar ``o.__annotations__`` para chegar no dicionário de anotações do objeto." #: ../../howto/annotations.rst:52 msgid "" @@ -153,8 +152,8 @@ msgstr "" #: ../../howto/annotations.rst:68 msgid "Accessing The Annotations Dict Of An Object In Python 3.9 And Older" msgstr "" -"Acessando O Dicionário De Anotações De Um Objeto No Python 3.9 E Nas Versões " -"Mais Antigas." +"Acessando o dicionário de anotações de um objeto no Python 3.9 e nas versões " +"mais antigas" #: ../../howto/annotations.rst:70 msgid "" @@ -175,6 +174,11 @@ msgid "" "should use three-argument :func:`getattr` to access the object's " "``__annotations__`` attribute." msgstr "" +"As melhores práticas para acessar os dicionários de anotações de outros " +"objetos, funções, outros chamáveis e módulos - são as mesmas melhores " +"práticas para 3.10, supondo que você não esteja chamando :func:`inspect." +"get_annotations`: você deve usar a função :func:`getattr` com três " +"argumentos para acessar os atributos do objeto ``__annotations__``." #: ../../howto/annotations.rst:82 msgid "" @@ -184,10 +188,16 @@ msgid "" "``__annotations__`` attribute of a class may inadvertently return the " "annotations dict of a *base class.* As an example::" msgstr "" +"Infelizmente, essas não são as melhores práticas para classes. O problema é " +"que, como ``__annotations__`` é opcional nas classes, e posto que classes " +"podem herdar atributos das suas classes base, acessar o atributo " +"``__annotations__`` de uma classe pode inesperadamente retornar o dicionário " +"de anotações de uma *classe base.* Por exemplo::" #: ../../howto/annotations.rst:98 msgid "This will print the annotations dict from ``Base``, not ``Derived``." msgstr "" +"Isso mostrará o dicionário de anotações de ``Base``, não de ``Derived``." #: ../../howto/annotations.rst:101 msgid "" @@ -198,6 +208,13 @@ msgid "" "dictionary. Since the class may or may not have annotations defined, best " "practice is to call the ``get`` method on the class dict." msgstr "" +"Seu código deve seguir uma abordagem diferente caso o objeto que você esteja " +"examinando seja uma classe (``isinstance(o, type)``). Nesse caso, a melhor " +"prática está ligada a um detalhe de implementação do Python 3.9 e " +"anteriores: se a classe possui anotações definidas, elas são armazenadas no " +"dicionário ``__dict__`` da classe. Como a classe pode ou não ter anotações " +"definidas, a melhor prática é chamar o método ``get`` no dicionário da " +"classe." #: ../../howto/annotations.rst:109 msgid "" @@ -205,6 +222,9 @@ msgid "" "``__annotations__`` attribute on an arbitrary object in Python 3.9 and " "before::" msgstr "" +"Considerando tudo isso, aqui está um exemplo de código que acessa de forma " +"segura o atributo ``__annotations__`` em um objeto arbitrário em Python 3.9 " +"e anteriores::" #: ../../howto/annotations.rst:118 msgid "" @@ -212,6 +232,9 @@ msgid "" "You're encouraged to double-check the type of ``ann`` using :func:" "`isinstance` before further examination." msgstr "" +"Após executar este código, ``ann`` deve ser um dicionário ou ``None``. Você " +"é encorajado a fazer uma checagem dupla do tipo de ``ann`` utilizando :func:" +"`isinstance` antes de uma análise mais aprofundada." #: ../../howto/annotations.rst:123 msgid "" @@ -219,10 +242,13 @@ msgid "" "attribute, so for extra safety you may also wish to use :func:`getattr` to " "access ``__dict__``." msgstr "" +"Note que alguns tipos de objetos exóticos ou mal formatados podem não " +"possuir um atributo ``__dict__``, então por precaução você também pode " +"querer usar :func:`getattr` para acessar ``__dict__``." #: ../../howto/annotations.rst:129 msgid "Manually Un-Stringizing Stringized Annotations" -msgstr "" +msgstr "Recuperando manualmente anotações transformadas em strings" #: ../../howto/annotations.rst:131 msgid "" @@ -231,6 +257,10 @@ msgid "" "really is best to call :func:`inspect.get_annotations` to do this work for " "you." msgstr "" +"Em situações em que as anotações podem ter sido transformadas em strings, e " +"caso queira avaliar essas strings para produzir os valores de Python que " +"elas representam, é melhor chamar :func:`inspect.get_annotations` para fazer " +"isto por você." #: ../../howto/annotations.rst:137 msgid "" @@ -239,18 +269,26 @@ msgid "" "encouraged to examine the implementation of :func:`inspect.get_annotations` " "in the current Python version and follow a similar approach." msgstr "" +"Se estiver usando Python 3.9 ou anterior, ou por algum motivo não puder " +"usar :func:`inspect.get_annotations`, será necessário replicar sua lógica. " +"Considere examinar a implementação de :func:`inspect.get_annotations` na " +"versão de Python atual e seguir uma abordagem similar." #: ../../howto/annotations.rst:143 msgid "" "In a nutshell, if you wish to evaluate a stringized annotation on an " "arbitrary object ``o``:" msgstr "" +"Resumindo, caso deseje avaliar uma anotação transformada em string em um " +"objeto arbitrário ``o``:" #: ../../howto/annotations.rst:146 msgid "" "If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when calling :" "func:`eval`." msgstr "" +"Se ``o`` for um módulo, use ``o.__dict__`` como ``globals`` ao chamar :func:" +"`eval`." #: ../../howto/annotations.rst:148 msgid "" @@ -258,6 +296,8 @@ msgid "" "``globals``, and ``dict(vars(o))`` as the ``locals``, when calling :func:" "`eval`." msgstr "" +"Se ``o`` for uma classe, use ``sys.modules[o.__module__].__dict__`` como " +"``globals``, e ``dict(vars(o))`` como ``locals``, quando chamar :func:`eval`." #: ../../howto/annotations.rst:151 msgid "" @@ -266,12 +306,18 @@ msgid "" "accessing either ``o.__wrapped__`` or ``o.func`` as appropriate, until you " "have found the root unwrapped function." msgstr "" +"Se ``o`` for um chamável envolto em um invólucro usando :func:`functools." +"update_wrapper`, :func:`functools.wraps` ou :func:`functools.partial`, " +"desenvolva-o iterativamente acessando ``o.__wrapped__`` ou ``o.func`` " +"conforme apropriado, até encontrar a função raiz." #: ../../howto/annotations.rst:155 msgid "" "If ``o`` is a callable (but not a class), use :attr:`o.__globals__ ` as the globals when calling :func:`eval`." msgstr "" +"Caso ``o`` seja chamável (mas não uma classe), use :attr:`o.__globals__ " +"` como globals quando chamar :func:`eval`." #: ../../howto/annotations.rst:159 msgid "" @@ -281,18 +327,27 @@ msgid "" "hints that require annotating with string values that specifically *can't* " "be evaluated. For example:" msgstr "" +"Contudo, nem todas strings usadas como anotações podem ser convertidas em " +"valores de Python utilizando :func:`eval`. Valores de string poderiam " +"teoricamente conter qualquer string válida, e na prática existem casos " +"válidos para dicas de tipo que requerem anotar com valores de strings que " +"*não* podem ser executados. Por exemplo:" #: ../../howto/annotations.rst:166 msgid "" ":pep:`604` union types using ``|``, before support for this was added to " "Python 3.10." msgstr "" +"Tipos de união :pep:`604` usando ``|``, antes do suporte a isso ser " +"adicionado em Python 3.10." #: ../../howto/annotations.rst:168 msgid "" "Definitions that aren't needed at runtime, only imported when :const:`typing." "TYPE_CHECKING` is true." msgstr "" +"Definições que não são necessárias no ambiente de execução, apenas " +"importadas quando :const:`typing.TYPE_CHECKING` é verdadeiro." #: ../../howto/annotations.rst:171 msgid "" @@ -301,22 +356,30 @@ msgid "" "it's recommended to only attempt to evaluate string values when explicitly " "requested to by the caller." msgstr "" +"Caso :func:`eval` tente executar tais valores, levantará uma exceção. Então, " +"quando projetar uma biblioteca API que trabalha com anotações, é recomendado " +"que tente executar os valores das strings apenas quando for solicitado " +"explicitamente." #: ../../howto/annotations.rst:179 msgid "Best Practices For ``__annotations__`` In Any Python Version" -msgstr "Melhores Prática Para ``__annotations__`` Em Qualquer Versão Python" +msgstr "Melhores práticas para ``__annotations__`` em qualquer versão Python" #: ../../howto/annotations.rst:181 msgid "" "You should avoid assigning to the ``__annotations__`` member of objects " "directly. Let Python manage setting ``__annotations__``." msgstr "" +"Evite atribuir diretamente ao membro ``__annotations__`` dos objetos. Deixe " +"que Python gerenciar a configuração de ``__annotations__``." #: ../../howto/annotations.rst:184 msgid "" "If you do assign directly to the ``__annotations__`` member of an object, " "you should always set it to a ``dict`` object." msgstr "" +"Se você atribuir diretamente ao membro ``__annotations__`` do objeto, sempre " +"o defina como um objeto ``dict``." #: ../../howto/annotations.rst:187 msgid "" @@ -324,19 +387,22 @@ msgid "" "should ensure that it's a dictionary before attempting to examine its " "contents." msgstr "" +"Caso acesse diretamente o membro ``__annotations__`` de um objeto, " +"certifique-se de que ele é um dicionário antes de tentar examinar seu " +"conteúdo." #: ../../howto/annotations.rst:191 msgid "You should avoid modifying ``__annotations__`` dicts." -msgstr "Você deve evitar modificar ``__annotations__`` dicts." +msgstr "Evite modificar o dicionário ``__annotations__``." #: ../../howto/annotations.rst:193 msgid "" "You should avoid deleting the ``__annotations__`` attribute of an object." -msgstr "" +msgstr "Evite deletar o atributo ``__annotations__`` de um objeto." #: ../../howto/annotations.rst:198 msgid "``__annotations__`` Quirks" -msgstr "" +msgstr "Peculiaridades de ``__annotations__``" #: ../../howto/annotations.rst:200 msgid "" @@ -349,12 +415,23 @@ msgid "" "an ``AttributeError``; using ``del fn.__annotations__`` twice in a row is " "guaranteed to always throw an ``AttributeError``." msgstr "" +"Em todas as versões de Python 3, objetos de função criam preguiçosamente um " +"dicionário de anotações caso nenhuma anotação seja definida nesse objeto. " +"Você pode deletar o atributo ``__annotations__`` utilizando ``del fn." +"__annotations__``, mas ao acessar ``fn.__annotations__`` o objeto criará um " +"novo dicionário vazio que será armazenado e retornado como suas anotações.\n" +"Apagar as anotações de uma função antes que ela tenha criado preguiçosamente " +"seu dicionário de anotações irá produzir um ``AttributeError``; ao utilizar " +"``del fn.__annotations__`` duas vezes em sequência, é garantido que será " +"produzido um ``AttributeError``." #: ../../howto/annotations.rst:210 msgid "" "Everything in the above paragraph also applies to class and module objects " "in Python 3.10 and newer." msgstr "" +"O citado no parágrafo acima também se aplica para classes e objetos de " +"módulo em Python 3.10 e posteriores." #: ../../howto/annotations.rst:213 msgid "" @@ -366,6 +443,13 @@ msgid "" "``__annotations__`` to any Python value, and will retain whatever value is " "set." msgstr "" +"Em todas as versões de Python 3, você pode definir ``__annotations__`` como " +"``None`` em um objeto de função. Contudo, acessar em sequência as anotações " +"nesse objeto utilizando ``fn.__annotations__`` irá criar preguiçosamente um " +"dicionário vazio como descrito no primeiro parágrafo dessa seção. Isso *não* " +"é válido para módulos e classes, em qualquer versão de Python; esses objetos " +"permitem atribuir ``__annotations__`` a qualquer valor de Python, e " +"armazenam qualquer valor atribuído." #: ../../howto/annotations.rst:221 msgid "" @@ -374,9 +458,16 @@ msgid "" "will itself be quoted. In effect the annotation is quoted *twice.* For " "example::" msgstr "" +"Se Python transformar sua anotação em string (utilizando ``from __future__ " +"import annotations``), e você especificar uma string como anotação, essa " +"string será posta entre aspas. Na prática a anotação receberá aspas " +"*duplas*. Por exemplo::" #: ../../howto/annotations.rst:232 msgid "" "This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " "\"quirk\"; it's mentioned here simply because it might be surprising." msgstr "" +"Isso exibe ``{'a': \"'str'\"}``. Não considere isso como uma " +"\"peculiaridade\"; foi mencionado aqui simplesmente porque pode ser " +"surpreendente." diff --git a/howto/argparse.po b/howto/argparse.po index 1df58960c..49da02bea 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -680,7 +680,7 @@ msgid "" "assumes that your Python installation is in ``/usr/lib``." msgstr "" "Este comando extrairá todas as strings traduzíveis do módulo :mod:`argparse` " -"e as enviará para um arquivo chamado ``messages.po``. Este comando assume " +"e as enviará para um arquivo chamado ``messages.po``. Este comando presume " "que sua instalação do Python está em ``/usr/lib``." #: ../../howto/argparse.rst:832 diff --git a/howto/clinic.po b/howto/clinic.po index 0b8fc85b9..20e92a45a 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/cporting.po b/howto/cporting.po index 4cd539232..6386e82b0 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/curses.po b/howto/curses.po index 5e45bb26c..e93f7c3bc 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -165,10 +165,10 @@ msgid "" "that, see the Python library guide's section on ncurses, and the C manual " "pages for ncurses. It will, however, give you the basic ideas." msgstr "" -"Este HOWTO é uma introdução à escrita de programas em modo texto com curses " -"e Python. Isto não pretende ser um guia completo da PAI curses; para isso, " -"veja a seção ncurses no guia da biblioteca Python, e o manual de ncurses. " -"Isto, no entanto, lhe dará uma ideia básica." +"Este documento é uma introdução à escrita de programas em modo texto com " +"curses e Python. Isto não pretende ser um guia completo da API curses; para " +"isso, veja a seção ncurses no guia da biblioteca Python, e o manual de " +"ncurses. Isto, no entanto, lhe dará uma ideia básica." #: ../../howto/curses.rst:80 msgid "Starting and ending a curses application" diff --git a/howto/descriptor.po b/howto/descriptor.po index e4bab379b..dfb918002 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/enum.po b/howto/enum.po index c5a8034e1..c9f987b5f 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/enum.rst:3 msgid "Enum HOWTO" -msgstr "HOWTO Enum" +msgstr "Enum" #: ../../howto/enum.rst:9 msgid "" @@ -133,7 +133,7 @@ msgstr "" #: ../../howto/enum.rst:88 msgid "The complete :class:`Weekday` enum now looks like this::" -msgstr "O enum de :class:`Weekday` completa agora se parece com isso::" +msgstr "O enum de :class:`Weekday` completa agora tem esta forma::" #: ../../howto/enum.rst:103 msgid "Now we can find out what today is! Observe::" diff --git a/howto/functional.po b/howto/functional.po index cf04c4bbe..5ae3012f4 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -25,16 +25,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/functional.rst:3 msgid "Functional Programming HOWTO" -msgstr "Programação Funcional COMO FAZER" +msgstr "Programação Funcional" #: ../../howto/functional.rst:0 msgid "Author" @@ -506,8 +506,8 @@ msgid "" "Sequence unpacking also supports iterators: if you know an iterator will " "return N elements, you can unpack them into an N-tuple:" msgstr "" -"A descompilação de sequência também suporta iteradores: se você sabe que um " -"iterador retornará N elementos, você pode descompactá-los em uma N-tupla:" +"O desempacotamento de sequência também suporta iteradores: se você sabe que " +"um iterador retornará N elementos, você pode desempacotá-los em uma N-tupla:" #: ../../howto/functional.rst:246 msgid "" @@ -1029,6 +1029,8 @@ msgid "" "The cumulative effect of these changes is to turn generators from one-way " "producers of information into both producers and consumers." msgstr "" +"The cumulative effect of these changes is to turn generators from one-way " +"producers of information into both producers and consumers." #: ../../howto/functional.rst:617 msgid "" diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po index b46c7063c..1e231048b 100644 --- a/howto/gdb_helpers.po +++ b/howto/gdb_helpers.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/gdb_helpers.rst:5 msgid "Debugging C API extensions and CPython Internals with GDB" -msgstr "Depurando extensões de API C e Internos do CPython com GDB" +msgstr "Depurando extensões de API C e internos do CPython com GDB" #: ../../howto/gdb_helpers.rst:9 msgid "" @@ -45,7 +45,7 @@ msgid "" "default, GDB (or any of its front-ends) doesn't support high-level " "information specific to the CPython interpreter." msgstr "" -"Ao depurar problemas de baixo nível, como falhas ou bloqueios, um depurador " +"Ao depurar problemas de baixo nível, como falhas ou impasses, um depurador " "de baixo nível, como o GDB, é útil para diagnosticar e corrigir o problema. " "Por padrão, o GDB (ou qualquer uma de suas interfaces) não oferece suporte a " "informações de alto nível específicas do interpretador CPython." diff --git a/howto/index.po b/howto/index.po index 533e7cdb3..7ba020314 100644 --- a/howto/index.po +++ b/howto/index.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 9c6afde1b..ecbc20227 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -22,10 +22,10 @@ msgstr "" "2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -96,7 +96,7 @@ msgstr "" #: ../../howto/instrumentation.rst:44 msgid "or::" -msgstr "or::" +msgstr "ou::" #: ../../howto/instrumentation.rst:49 msgid "" @@ -153,7 +153,7 @@ msgstr "" #: ../../howto/instrumentation.rst:176 ../../howto/instrumentation.rst:236 msgid "The output looks like this:" -msgstr "O resultado deve ser algo semelhante a isto:" +msgstr "O resultado deve ser algo assim:" #: ../../howto/instrumentation.rst:201 msgid "Static SystemTap markers" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 7ebc5d593..ac9c2cf5f 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index d5d4c500c..5f91bd309 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -18,16 +18,16 @@ msgstr "" "2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/isolating-extensions.rst:7 msgid "Isolating Extension Modules" -msgstr "" +msgstr "Isolando módulos de extensão" #: ../../howto/isolating-extensions.rst-1 msgid "Abstract" @@ -39,6 +39,10 @@ msgid "" "``static`` variables, which have process-wide scope. This document describes " "problems of such per-process state and shows a safer way: per-module state." msgstr "" +"Tradicionalmente, o estado que pertence a módulos de extensão do Python era " +"mantido em variáveis ``static`` em C, que têm escopo em todo o processo. " +"Este documento descreve problemas de tal estado por processo e apresenta um " +"modo mais seguro: o estado por módulo." #: ../../howto/isolating-extensions.rst:16 msgid "" @@ -47,10 +51,14 @@ msgid "" "potentially switching from static types to heap types, and—perhaps most " "importantly—accessing per-module state from code." msgstr "" +"O documento também descreve como migrar para o uso do estado por módulo onde " +"for possível. Essa transição envolve alocar espaço para este estado, " +"potencialmente trocar tipos estáticos por tipos no heap, e—talvez o mais " +"importante—acessar o estado por módulo a partir do código." #: ../../howto/isolating-extensions.rst:23 msgid "Who should read this" -msgstr "" +msgstr "Quem deveria ler isto" #: ../../howto/isolating-extensions.rst:25 msgid "" @@ -58,10 +66,13 @@ msgid "" "extensions who would like to make that extension safer to use in " "applications where Python itself is used as a library." msgstr "" +"Este guia é escrito para mantenedores de extensões que usam a :ref:`API C ` que desejam torná-las mais seguras para o uso em aplicações onde " +"o Python em si é usado como uma biblioteca." #: ../../howto/isolating-extensions.rst:31 msgid "Background" -msgstr "" +msgstr "Contexto" #: ../../howto/isolating-extensions.rst:33 msgid "" @@ -69,24 +80,34 @@ msgid "" "configuration (e.g. the import path) and runtime state (e.g. the set of " "imported modules)." msgstr "" +"Um *interpretador* é o contexto no qual o código Python é executado. Ele " +"contém estado de configuração (por exemplo o caminho de importação) e de " +"tempo de execução (por exemplo o conjunto de módulos importados)." #: ../../howto/isolating-extensions.rst:37 msgid "" "Python supports running multiple interpreters in one process. There are two " "cases to think about—users may run interpreters:" msgstr "" +"O Python provê suporte para executar múltiplos interpretadores em um " +"processo. Dois casos devem ser considerados—usuários podem executar " +"interpretadores:" #: ../../howto/isolating-extensions.rst:40 msgid "" "in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` " "cycles, and" msgstr "" +"em sequência, com vários ciclos de :c:func:`Py_InitializeEx`/:c:func:" +"`Py_FinalizeEx`, e" #: ../../howto/isolating-extensions.rst:42 msgid "" "in parallel, managing \"sub-interpreters\" using :c:func:" "`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." msgstr "" +"em paralelo, gerenciando \"sub-interpretadores\" usando :c:func:" +"`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." #: ../../howto/isolating-extensions.rst:45 msgid "" @@ -95,6 +116,10 @@ msgid "" "about the application that uses them, which include assuming a process-wide " "\"main Python interpreter\"." msgstr "" +"Ambos os casos (e combinações deles) são muito úteis ao embutir o Python em " +"uma biblioteca. Bibliotecas geralmente não devem fazer suposições sobre a " +"aplicação que as usa, o que inclui supor um \"interpretador Python " +"principal\" para o processo inteiro." #: ../../howto/isolating-extensions.rst:50 msgid "" @@ -106,6 +131,14 @@ msgid "" "introduce edge cases that lead to crashes when a module is loaded in more " "than one interpreter in the same process." msgstr "" +"Historicamente, módulos de extensão do Python não lidam bem com este caso de " +"uso. Muitos módulos de extensão (e até alguns módulos da biblioteca padrão) " +"usam estado global *por processo*, uma vez que variáveis ``static`` do C são " +"extremamente fáceis de se usar. Assim, dados que deveriam ser específicos " +"para um interpretador acabam sendo compartilhados entre interpretadores. A " +"menos que o desenvolvedor da extensão tenha cuidado, é muito fácil criar " +"casos particulares que acabam quebrando o processo quando um módulo é " +"carregado em mais de um interpretador no mesmo processo." #: ../../howto/isolating-extensions.rst:58 msgid "" @@ -113,10 +146,13 @@ msgid "" "authors tend to not keep multiple interpreters in mind when developing, and " "it is currently cumbersome to test the behavior." msgstr "" +"Infelizmente, não é fácil fazer o estado por interpretador. Autores de " +"extensões tendem a não ter múltiplos interpretadores em mente ao " +"desenvolver, e no momento é complicado testar este comportamento." #: ../../howto/isolating-extensions.rst:63 msgid "Enter Per-Module State" -msgstr "" +msgstr "Entra o estado por módulo" #: ../../howto/isolating-extensions.rst:65 msgid "" @@ -127,6 +163,13 @@ msgid "" "multiple module objects corresponding to a single extension can even be " "loaded in a single interpreter." msgstr "" +"Ao invés de focar no estado por interpretador, a API C do Python está " +"evoluindo para melhor suportar o estado *por módulo*, que é mais granular. " +"Isso significa que dados a nível do C devem estar atrelados a um *objeto de " +"módulo*. Cada interpretador cria o seu próprio objeto de módulo, garantindo " +"assim a separação dos dados. Para testar o isolamento, múltiplos objetos de " +"módulo correspondentes a uma única extensão podem até ser carregados em um " +"único interpretador." #: ../../howto/isolating-extensions.rst:72 msgid "" @@ -136,6 +179,11 @@ msgid "" "any other :c:expr:`PyObject *`; there are no \"on interpreter shutdown\" " "hooks to think—or forget—about." msgstr "" +"O estado por módulo fornece um modo fácil de pensar sobre tempos de vida e " +"posse de recursos: o módulo de extensão será inicializado quando um objeto " +"de módulo for criado, e limpado quando ele for liberado. Nesse sentido, um " +"módulo funciona como qualquer outro :c:expr:`PyObject *`; não há ganchos " +"\"de desligamento do interpretador\" a serem considerados—ou esquecidos." #: ../../howto/isolating-extensions.rst:78 msgid "" @@ -145,10 +193,16 @@ msgid "" "exceptional cases: if you need them, you should give them additional care " "and testing. (Note that this guide does not cover them.)" msgstr "" +"Note que há casos de uso para diferentes tipos de \"objetos globais\": " +"estado por processo, por interpretador, por thread, ou por tarefa. Com o " +"estado por módulo como padrão, as outras formas ainda são possíveis, mas " +"devem ser tratadas como casos excepcionais: se você precisar delas, você " +"deve tomar cuidados adicionais e escrever mais testes. (Note que este guia " +"não cobre tais medidas.)" #: ../../howto/isolating-extensions.rst:87 msgid "Isolated Module Objects" -msgstr "" +msgstr "Objetos de módulo isolados" #: ../../howto/isolating-extensions.rst:89 msgid "" @@ -156,6 +210,9 @@ msgid "" "several module objects can be created from a single shared library. For " "example:" msgstr "" +"O ponto chave de se manter em mente ao desenvolver um módulo de extensão é " +"que vários objetos de módulo podem ser criados a partir de uma única " +"biblioteca compartilhada. Por exemplo:" #: ../../howto/isolating-extensions.rst:103 msgid "" @@ -166,6 +223,13 @@ msgid "" "are possible (see `Managing Global State`_), but they will need more thought " "and attention to edge cases." msgstr "" +"Como regra geral, os dois módulos devem ser completamente independentes. " +"Todos os objetos e o estado específicos do módulo devem ser encapsulados no " +"objeto de módulo, não devem ser compartilhados com outros objetos de módulo, " +"e devem ser limpados quando o objeto de módulo for desalocado. Uma vez que " +"esta é somente uma regra geral, exceções são possíveis (veja `Gerenciando " +"estado global`_), mas elas necessitam mais cuidado e atenção a casos " +"especiais." #: ../../howto/isolating-extensions.rst:111 msgid "" @@ -173,10 +237,13 @@ msgid "" "modules make it easier to set clear expectations and guidelines that work " "across a variety of use cases." msgstr "" +"Enquanto alguns módulos funcionariam bem com restrições menos rigorosas, " +"isolar os módulos torna mais fácil definir expectativas claras e diretrizes " +"que dão certo em uma variedade de casos de uso." #: ../../howto/isolating-extensions.rst:117 msgid "Surprising Edge Cases" -msgstr "" +msgstr "Casos particulares surpreendentes" #: ../../howto/isolating-extensions.rst:119 msgid "" @@ -187,26 +254,37 @@ msgid "" "``binascii.Error`` are separate objects. In the following code, the " "exception is *not* caught:" msgstr "" +"Note que módulos isolados criam alguns casos particulares que podem acabar " +"surpreendendo. O mais notável é que, tipicamente, cada objeto de módulo não " +"vai compartilhar as suas classes e exceções com outros módulos similares. " +"Continuando o `exemplo acima `__, note " +"``old_binascii.Error`` e ``binascii.Error`` são objetos separados. No código " +"a seguir, a exceção *não* é capturada:" #: ../../howto/isolating-extensions.rst:139 msgid "" "This is expected. Notice that pure-Python modules behave the same way: it is " "a part of how Python works." msgstr "" +"Isso é esperado. Repare que módulos Python-puro se comportam do mesmo jeito: " +"isso é parte de como o Python funciona." #: ../../howto/isolating-extensions.rst:142 msgid "" "The goal is to make extension modules safe at the C level, not to make hacks " "behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." msgstr "" +"O objetivo é fazer módulos de extensão seguros no nível do C, e não fazer " +"gambiarras se comportarem de forma intuitiva. Modificar o ``sys.modules`` " +"\"manualmente\" conta como uma gambiarra." #: ../../howto/isolating-extensions.rst:148 msgid "Making Modules Safe with Multiple Interpreters" -msgstr "" +msgstr "Fazendo módulos seguros com múltiplos interpretadores" #: ../../howto/isolating-extensions.rst:152 msgid "Managing Global State" -msgstr "" +msgstr "Gerenciando estado global" #: ../../howto/isolating-extensions.rst:154 msgid "" @@ -214,15 +292,20 @@ msgid "" "module, but to the entire process (or something else \"more global\" than a " "module). For example:" msgstr "" +"Às vezes, o estado associado a um módulo Python não é específico àquele " +"módulo, mas ao processo inteiro (ou a alguma outra coisa \"mais global\" que " +"um módulo). Por exemplo:" #: ../../howto/isolating-extensions.rst:158 msgid "The ``readline`` module manages *the* terminal." -msgstr "" +msgstr "O módulo ``readline`` gerencia *o* terminal." #: ../../howto/isolating-extensions.rst:159 msgid "" "A module running on a circuit board wants to control *the* on-board LED." msgstr "" +"Um módulo executando em uma placa de circuito quer controlar *o* componente " +"LED." #: ../../howto/isolating-extensions.rst:162 msgid "" @@ -232,6 +315,11 @@ msgid "" "whether for Python or other languages). If that is not possible, consider " "explicit locking." msgstr "" +"Nestes casos, o módulo Python deve prover *acesso* ao estado global, ao " +"invés de *possuí-lo*. Se possível, escreva o módulo de forma que múltiplas " +"cópias dele possam acessar o estado independentemente (junto com outras " +"bibliotecas, sejam elas do Python ou de outras linguagens). Se isso não for " +"possível, considere usar travas explícitas." #: ../../howto/isolating-extensions.rst:168 msgid "" @@ -240,10 +328,14 @@ msgid "" "being loaded more than once per process—see `Opt-Out: Limiting to One Module " "Object per Process`_." msgstr "" +"Se for necessário usar estado global para o processo, o jeito mais simples " +"de evitar problemas com múltiplos interpretadores é prevenir explicitamente " +"que o módulo seja carregado mais de uma vez por processo—veja `Exclusão " +"voluntária: limitando a um objeto de módulo por processo`_." #: ../../howto/isolating-extensions.rst:175 msgid "Managing Per-Module State" -msgstr "" +msgstr "Gerenciando estado por módulo" #: ../../howto/isolating-extensions.rst:177 msgid "" @@ -251,6 +343,9 @@ msgid "" "initialization `. This signals that your module " "supports multiple interpreters correctly." msgstr "" +"Para usar estado por módulo, use :ref:`inicialização multifásica de módulos " +"de extensão `. Assim, você sinaliza que o seu " +"módulo suporta múltiplos interpretadores corretamente." #: ../../howto/isolating-extensions.rst:181 msgid "" @@ -262,6 +357,13 @@ msgid "" "``csv``'s :py:data:`~csv.field_size_limit`) which the C code needs to " "function." msgstr "" +"Defina ``PyModuleDef.m_size`` como um número positivo *N* para requerer *N* " +"bytes de armazenamento local para o módulo. Geralmente, *N* será o tamanho " +"de alguma ``struct`` específica para o módulo, a qual pode guardar todo o " +"estado a nível de C do módulo. Em particular, é nela que você deve colocar " +"ponteiros para classes (incluindo exceções, mas excluindo tipos estáticos) e " +"configurações (por exemplo, :py:data:`~csv.field_size_limit` no módulo " +"``csv``) que o código C precisa para funcionar." #: ../../howto/isolating-extensions.rst:190 msgid "" @@ -270,12 +372,19 @@ msgid "" "means error- and type-checking at the C level, which is easy to get wrong " "and hard to test sufficiently." msgstr "" +"Outra opção é guardar estado no ``__dict__`` do módulo, mas você deve evitar " +"quebrar quando usuários modificarem o ``__dict__`` a partir do código " +"Python. Isso geralmente significa verificar tipos e erros no nível do C, o " +"que é fácil de ser feito incorretamente e difícil de se testar " +"suficientemente." #: ../../howto/isolating-extensions.rst:195 msgid "" "However, if module state is not needed in C code, storing it in ``__dict__`` " "only is a good idea." msgstr "" +"Entretanto, se o estado do módulo não for necessário para o código C, guardá-" +"lo somente no ``__dict__`` é uma boa ideia." #: ../../howto/isolating-extensions.rst:198 msgid "" @@ -286,6 +395,12 @@ msgid "" "and make the code longer; this is the price for modules which can be " "unloaded cleanly." msgstr "" +"Se o estado do módulo inclui ponteiros para ``PyObject``, o objeto de módulo " +"deve conter referências a tais objetos e implementar os ganchos a nível de " +"módulo ``m_traverse``, ``m_clear`` e ``m_free``. Eles funcionam como os " +"``tp_traverse``, ``tp_clear`` e ``tp_free`` de uma classe. Adicioná-los " +"requer algum trabalho e torna o código mais longo; é o preço de módulos que " +"podem ser descarregados de forma limpa." #: ../../howto/isolating-extensions.rst:205 msgid "" @@ -293,10 +408,13 @@ msgid "" "`xxlimited `__; example module initialization shown at the bottom of the file." msgstr "" +"Um exemplo de módulo com estado por módulo está disponível atualmente como " +"`xxlimited `__; há um exemplo de inicialização do módulo no final do arquivo." #: ../../howto/isolating-extensions.rst:211 msgid "Opt-Out: Limiting to One Module Object per Process" -msgstr "" +msgstr "Exclusão voluntária: limitando a um objeto de módulo por processo" #: ../../howto/isolating-extensions.rst:213 msgid "" @@ -305,10 +423,14 @@ msgid "" "module, you can explicitly make your module loadable only once per process. " "For example::" msgstr "" +"Um ``PyModuleDef.m_size`` não-negativo sinaliza que um módulo admite " +"múltiplos interpretadores corretamente. Se este ainda não é o caso para o " +"seu módulo, you pode explicitamente torná-lo carregável somente uma vez por " +"processo. Por exemplo::" #: ../../howto/isolating-extensions.rst:234 msgid "Module State Access from Functions" -msgstr "" +msgstr "Acesso ao estado de módulo a partir de funções" #: ../../howto/isolating-extensions.rst:236 msgid "" @@ -316,6 +438,9 @@ msgid "" "Functions get the module object as their first argument; for extracting the " "state, you can use ``PyModule_GetState``::" msgstr "" +"É trivial acessar o estado a partir de funções a nível do módulo. Funções " +"recebem o objeto de módulo como o primeiro argumento; para extrair o estado, " +"você pode usar ``PyModule_GetState``::" #: ../../howto/isolating-extensions.rst:251 msgid "" @@ -323,10 +448,14 @@ msgid "" "there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own " "module, you're in control of ``m_size``, so this is easy to prevent." msgstr "" +"``PyModule_GetState`` pode retornar ``NULL`` sem definir uma exceção se não " +"houver estado de módulo, ou seja se ``PyModuleDef.m_size`` for zero. No seu " +"próprio módulo, você controla o ``m_size``, de forma que isso é fácil de " +"prevenir." #: ../../howto/isolating-extensions.rst:258 msgid "Heap Types" -msgstr "" +msgstr "Tipos no heap" #: ../../howto/isolating-extensions.rst:260 msgid "" @@ -334,6 +463,9 @@ msgid "" "PyTypeObject`` structures defined directly in code and initialized using " "``PyType_Ready()``." msgstr "" +"Tradicionalmente, tipos definidos em C são *estáticos*; isto é, estruturas " +"``static PyTypeObject`` definidas diretamente em código e inicializadas " +"usando ``PyType_Ready()``." #: ../../howto/isolating-extensions.rst:264 msgid "" @@ -342,6 +474,11 @@ msgid "" "limit the possible issues, static types are immutable at the Python level: " "for example, you can't set ``str.myattribute = 123``." msgstr "" +"Tais tipos são necessariamente compartilhados pelo processo inteiro. " +"Compartilhá-los entre objetos de módulo requer atenção a qualquer estado que " +"eles possuam ou acessem. Para limitar potenciais problemas, tipos estáticos " +"são imutáveis a nível do Python: por exemplo, você não pode atribuir ``str." +"meuatributo = 123``." #: ../../howto/isolating-extensions.rst:270 msgid "" @@ -352,6 +489,13 @@ msgid "" "Python objects across interpreters implicitly depends on CPython's current, " "process-wide GIL." msgstr "" +"Não há problema em compartilhar objetos verdadeiramente imutáveis entre " +"interpretadores, desde que através deles não seja possível acessar outros " +"objetos mutáveis. De toda forma, no CPython, todo objeto Python tem um " +"detalhe de implementação mutável: o contador de referências. Mudanças no " +"refcount são protegidas pelo GIL. Logo, todo código que compartilha um " +"objeto Python entre interpretadores depende implicitamente do atual GIL do " +"CPython (que é global a nível de processo)." #: ../../howto/isolating-extensions.rst:277 msgid "" @@ -361,14 +505,20 @@ msgid "" "*heap type* for short. These correspond more closely to classes created by " "Python's ``class`` statement." msgstr "" +"Por ser imutável e global no processo, um tipo estático não pode acessar o " +"estado do \"seu\" módulo. Se um método de tal tipo precisar de acesso ao " +"estado do módulo, o tipo precisa ser convertido para um *tipo alocado no " +"heap*, ou, abreviando, *tipo no heap*. Tipos no heap correspondem mais " +"fielmente a classes criadas pela instrução ``class`` do Python." #: ../../howto/isolating-extensions.rst:284 msgid "For new modules, using heap types by default is a good rule of thumb." msgstr "" +"Para módulos novos, usar tipos no heap por padrão é uma boa regra geral." #: ../../howto/isolating-extensions.rst:288 msgid "Changing Static Types to Heap Types" -msgstr "" +msgstr "Mudando tipos estáticos para tipos no heap" #: ../../howto/isolating-extensions.rst:290 msgid "" @@ -379,18 +529,30 @@ msgid "" "unintentionally change a few details (e.g. pickleability or inherited " "slots). Always test the details that are important to you." msgstr "" +"Tipos estáticos podem ser convertidos para tipos no heap, mas note que a API " +"de tipos no heap não foi projetada para conversão \"sem perda\" de tipos " +"estáticos—isto é, para criar um tipo que funciona exatamente como um dado " +"tipo estático. Então, ao reescrever a definição de classe em uma nova API, é " +"provável que você altere alguns detalhes sem querer (por exemplo, se o tipo " +"é serializável em pickle ou não, ou slots herdados). Sempre teste os " +"detalhes que são importantes para você." #: ../../howto/isolating-extensions.rst:299 msgid "" "Watch out for the following two points in particular (but note that this is " "not a comprehensive list):" msgstr "" +"Fique atento em particular aos dois pontos a seguir (mas note the esta não é " +"uma lista completa):" #: ../../howto/isolating-extensions.rst:302 msgid "" "Unlike static types, heap type objects are mutable by default. Use the :c:" "macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." msgstr "" +"Ao contrário de tipos estáticos, tipos no heap são mutáveis por padrão. Use " +"o sinalizador :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` para impedir a " +"mutabilidade." #: ../../howto/isolating-extensions.rst:304 msgid "" @@ -398,10 +560,13 @@ msgid "" "become possible to instantiate them from Python code. You can prevent this " "with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." msgstr "" +"Tipos no heap herdam :c:member:`~PyTypeObject.tp_new` por padrão, e portanto " +"eles podem passar a ser instanciáveis a partir de código Python. Você pode " +"impedir isso com o sinalizador :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION`." #: ../../howto/isolating-extensions.rst:310 msgid "Defining Heap Types" -msgstr "" +msgstr "Definindo tipos no heap" #: ../../howto/isolating-extensions.rst:312 msgid "" @@ -409,6 +574,9 @@ msgid "" "description or \"blueprint\" of a class, and calling :c:func:" "`PyType_FromModuleAndSpec` to construct a new class object." msgstr "" +"Tipos no heap podem ser criados preenchendo uma estrutura :c:struct:" +"`PyType_Spec`, uma descrição ou \"diagrama\" de uma classe, e chamando :c:" +"func:`PyType_FromModuleAndSpec` para construir um novo objeto classe." #: ../../howto/isolating-extensions.rst:317 msgid "" @@ -416,16 +584,22 @@ msgid "" "but :c:func:`PyType_FromModuleAndSpec` associates the module with the class, " "allowing access to the module state from methods." msgstr "" +"Outras funções, como :c:func:`PyType_FromSpec`, também podem criar tipos no " +"heap, mas :c:func:`PyType_FromModuleAndSpec` associa a classe ao módulo, " +"permitindo acesso ao estado do módulo a partir dos métodos." #: ../../howto/isolating-extensions.rst:321 msgid "" "The class should generally be stored in *both* the module state (for safe " "access from C) and the module's ``__dict__`` (for access from Python code)." msgstr "" +"A classe deve em geral ser guardada *tanto* no estado do módulo (para acesso " +"seguro a partir do C) *quanto* no ``__dict__`` do módulo (para acesso a " +"partir de código Python)." #: ../../howto/isolating-extensions.rst:327 msgid "Garbage-Collection Protocol" -msgstr "" +msgstr "Protocolo de recolhimento de lixo" #: ../../howto/isolating-extensions.rst:329 msgid "" @@ -433,28 +607,38 @@ msgid "" "the type isn't destroyed before all its instances are, but may result in " "reference cycles that need to be broken by the garbage collector." msgstr "" +"Instâncias de tipos no heap contêm referências aos seus tipos. Isso garante " +"que o tipo não é destruído antes que todas as suas instâncias sejam, mas " +"pode resultar em ciclos de referência que precisam ser quebrados pelo " +"coletor de lixo." #: ../../howto/isolating-extensions.rst:334 msgid "" "To avoid memory leaks, instances of heap types must implement the garbage " "collection protocol. That is, heap types should:" msgstr "" +"Para evitar vazamentos de memória, instâncias de tipos no heap precisam " +"implementar o protocolo de recolhimento de lixo. Isto é, tipos no heap devem:" #: ../../howto/isolating-extensions.rst:338 msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." -msgstr "" +msgstr "Ter o sinalizador :c:macro:`Py_TPFLAGS_HAVE_GC`." #: ../../howto/isolating-extensions.rst:339 msgid "" "Define a traverse function using ``Py_tp_traverse``, which visits the type " "(e.g. using ``Py_VISIT(Py_TYPE(self))``)." msgstr "" +"Definir uma função de travessia usando ``Py_tp_traverse``, que visita o tipo " +"(por exemplo, usando ``Py_VISIT(Py_TYPE(self))``)." #: ../../howto/isolating-extensions.rst:342 msgid "" "Please refer to the the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :" "c:member:`~PyTypeObject.tp_traverse` for additional considerations." msgstr "" +"Por favor veja as documentações de :c:macro:`Py_TPFLAGS_HAVE_GC` e de :c:" +"member:`~PyTypeObject.tp_traverse` para considerações adicionais." #: ../../howto/isolating-extensions.rst:346 msgid "" @@ -462,10 +646,13 @@ msgid "" "awkward to use in its current state. The following sections will guide you " "through common issues." msgstr "" +"A API para definir tipos no heap cresceu organicamente, o que resultou em um " +"status quo no qual usá-la pode ser um pouco confuso. As seções a seguir vão " +"lhe guiar pelos problemas mais comuns." #: ../../howto/isolating-extensions.rst:352 msgid "``tp_traverse`` in Python 3.8 and lower" -msgstr "" +msgstr "``tp_traverse`` no Python 3.8 e anteriores" #: ../../howto/isolating-extensions.rst:354 msgid "" @@ -473,26 +660,33 @@ msgid "" "3.9. If you support Python 3.8 and lower, the traverse function must *not* " "visit the type, so it must be more complicated::" msgstr "" +"O requerimento de o ``tp_traverse`` visitar o tipo foi adicionado no Python " +"3.9. Se você suporta Python 3.8 e anteriores, a função de travessia *não* " +"deve visitar o tipo, de forma que ela precisa ser mais complicada::" #: ../../howto/isolating-extensions.rst:366 msgid "" "Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a " "replacement, use:" msgstr "" +"Infelizmente, o símbolo :c:data:`Py_Version` foi adicionado somente no " +"Python 3.11. Para substituí-lo, use::" #: ../../howto/isolating-extensions.rst:369 msgid ":c:macro:`PY_VERSION_HEX`, if not using the stable ABI, or" -msgstr "" +msgstr ":c:macro:`PY_VERSION_HEX`, caso não esteja usando a ABI estável, ou" #: ../../howto/isolating-extensions.rst:370 msgid "" ":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` and :c:func:" "`PyArg_ParseTuple`)." msgstr "" +":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` e :c:func:" +"`PyArg_ParseTuple`)." #: ../../howto/isolating-extensions.rst:375 msgid "Delegating ``tp_traverse``" -msgstr "" +msgstr "Delegando a função ``tp_traverse``" #: ../../howto/isolating-extensions.rst:377 msgid "" @@ -501,95 +695,121 @@ msgid "" "``Py_TYPE(self)`` is visited only once. Note that only heap type are " "expected to visit the type in ``tp_traverse``." msgstr "" +"Se a sua função de travessia delega para a :c:member:`~PyTypeObject." +"tp_traverse` da sua classe base (ou de outro tipo), certifique-se de que " +"``Py_TYPE(self)`` seja visitado apenas uma vez. Observe que somente tipos no " +"heap devem visitar o tipo em ``tp_traverse``." #: ../../howto/isolating-extensions.rst:382 msgid "For example, if your traverse function includes::" -msgstr "" +msgstr "Por exemplo, se a sua função de travessia incluir::" #: ../../howto/isolating-extensions.rst:386 msgid "...and ``base`` may be a static type, then it should also include::" msgstr "" +"...e ``base`` puder ser um tipo estático, então ela também precisa incluir::" #: ../../howto/isolating-extensions.rst:396 msgid "" "It is not necessary to handle the type's reference count in :c:member:" "`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_clear`." msgstr "" +"Não é necessário mexer na contagem de referências do tipo em :c:member:" +"`~PyTypeObject.tp_new` e :c:member:`~PyTypeObject.tp_clear`." #: ../../howto/isolating-extensions.rst:401 msgid "Defining ``tp_dealloc``" -msgstr "" +msgstr "Definindo ``tp_dealloc``" #: ../../howto/isolating-extensions.rst:403 msgid "" "If your type has a custom :c:member:`~PyTypeObject.tp_dealloc` function, it " "needs to:" msgstr "" +"Se o seu tipo tem uma função :c:member:`~PyTypeObject.tp_dealloc` " +"customizada, ele precisa:" #: ../../howto/isolating-extensions.rst:406 msgid "" "call :c:func:`PyObject_GC_UnTrack` before any fields are invalidated, and" msgstr "" +"chamar :c:func:`PyObject_GC_UnTrack` antes que quaisquer campos sejam " +"invalidados, e" #: ../../howto/isolating-extensions.rst:407 msgid "decrement the reference count of the type." -msgstr "" +msgstr "decrementar o contador de referências do tipo." #: ../../howto/isolating-extensions.rst:409 msgid "" "To keep the type valid while ``tp_free`` is called, the type's refcount " "needs to be decremented *after* the instance is deallocated. For example::" msgstr "" +"Para que o tipo permaneça válido durante o ``tp_free``, o refcount do tipo " +"precisa ser decrementado *depois* de a instância ser liberada. Por exemplo::" #: ../../howto/isolating-extensions.rst:421 msgid "" "The default ``tp_dealloc`` function does this, so if your type does *not* " "override ``tp_dealloc`` you don't need to add it." msgstr "" +"A função ``tp_dealloc`` padrão faz isso, de forma que se o seu tipo *não* a " +"substitui você não precisa se preocupar." #: ../../howto/isolating-extensions.rst:427 msgid "Not overriding ``tp_free``" -msgstr "" +msgstr "Evitar substituir ``tp_free``" #: ../../howto/isolating-extensions.rst:429 msgid "" "The :c:member:`~PyTypeObject.tp_free` slot of a heap type must be set to :c:" "func:`PyObject_GC_Del`. This is the default; do not override it." msgstr "" +"O slot :c:member:`~PyTypeObject.tp_free` de um tipo no heap deve ser :c:func:" +"`PyObject_GC_Del`. Este é o padráo; não o substitua." #: ../../howto/isolating-extensions.rst:435 msgid "Avoiding ``PyObject_New``" -msgstr "" +msgstr "Evitar ``PyObject_New``" #: ../../howto/isolating-extensions.rst:437 msgid "GC-tracked objects need to be allocated using GC-aware functions." msgstr "" +"Objetos rastreados pelo GC precisam ser alocados usando funções que " +"reconheçam o GC." #: ../../howto/isolating-extensions.rst:439 msgid "If you use use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:" -msgstr "" +msgstr "Se você usaria :c:func:`PyObject_New` ou :c:func:`PyObject_NewVar`:" #: ../../howto/isolating-extensions.rst:441 msgid "" "Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible. " "That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::" msgstr "" +"Se possível, chame o slot :c:member:`~PyTypeObject.tp_alloc` do tipo. Isto " +"é, troque ``TYPE *o = PyObject_New(TYPE, typeobj)`` por::" #: ../../howto/isolating-extensions.rst:446 msgid "" "Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use " "size instead of the 0." msgstr "" +"No lugar de ``o = PyObject_NewVar(TYPE, typeobj, size)``, use também a forma " +"acima, mas com ``size`` ao invés do ``0``." #: ../../howto/isolating-extensions.rst:449 msgid "" "If the above is not possible (e.g. inside a custom ``tp_alloc``), call :c:" "func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`::" msgstr "" +"Se isso não for possível (por exemplo, dentro de um ``tp_alloc`` " +"customizado), chame :c:func:`PyObject_GC_New` or :c:func:" +"`PyObject_GC_NewVar`::" #: ../../howto/isolating-extensions.rst:458 msgid "Module State Access from Classes" -msgstr "" +msgstr "Acessando o estado do módulo a partir de classes" #: ../../howto/isolating-extensions.rst:460 msgid "" @@ -597,16 +817,21 @@ msgid "" "you can call :c:func:`PyType_GetModule` to get the associated module, and " "then :c:func:`PyModule_GetState` to get the module's state." msgstr "" +"Dado um objeto de tipo definido com :c:func:`PyType_FromModuleAndSpec`, você " +"pode chamar :c:func:`PyType_GetModule` para acessar o módulo associado, e " +"então :c:func:`PyModule_GetState` para acessar o estado do módulo." #: ../../howto/isolating-extensions.rst:464 msgid "" "To save a some tedious error-handling boilerplate code, you can combine " "these two steps with :c:func:`PyType_GetModuleState`, resulting in::" msgstr "" +"Para evitar o tedioso código de tratamento de erros de sempre, você pode " +"combinar essas duas etapas com o :c:func:`PyType_GetModuleState` assim::" #: ../../howto/isolating-extensions.rst:474 msgid "Module State Access from Regular Methods" -msgstr "" +msgstr "Acesso ao estado do módulo a partir de métodos regulares" #: ../../howto/isolating-extensions.rst:476 msgid "" @@ -615,6 +840,10 @@ msgid "" "the state, you need to first get the *defining class*, and then get the " "module state from it." msgstr "" +"Acessar o estado do módulo a partir de métodos de uma classe já é um pouco " +"mais complicado, mas passou a ser possível graças à API introduzida no " +"Python 3.9. Para conseguir o estado, é necessário primeiro acessar a *classe " +"definidora*, e então obter o estado do módulo a partir dela." #: ../../howto/isolating-extensions.rst:481 msgid "" @@ -622,6 +851,9 @@ msgid "" "that method's \"defining class\" for short. The defining class can have a " "reference to the module it is part of." msgstr "" +"O maior obstáculo é encontrar *a classe na qual um método foi definido*, ou, " +"abreviando, a *classe definidora* desse método. A classe definidora pode " +"guardar uma referência para o módulo do qual ela é parte." #: ../../howto/isolating-extensions.rst:485 msgid "" @@ -629,12 +861,18 @@ msgid "" "called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that " "subclass, which may be defined in different module than yours." msgstr "" +"Não confunda a classe definidora com ``Py_TYPE(self)``. Se o método for " +"chamado em uma *subclasse* do seu tipo, ``Py_TYPE(self)`` será uma " +"referência àquela subclasse, a qual pode ter sido definida em um módulo " +"diferente do seu." #: ../../howto/isolating-extensions.rst:490 msgid "" "The following Python code can illustrate the concept. ``Base." "get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" msgstr "" +"O código Python a seguir ilustra esse conceito. ``Base.get_defining_class`` " +"retorna ``Base`` mesmo quando ``type(self) == Sub``:" #: ../../howto/isolating-extensions.rst:506 msgid "" @@ -643,12 +881,18 @@ msgid "" "METH_KEYWORDS>` :c:type:`calling convention ` and the " "corresponding :c:type:`PyCMethod` signature::" msgstr "" +"Para um método acessar a sua \"classe definidora\", ele precisa usar a :c:" +"type:`convenção de chamada ` :ref:`METH_METHOD | METH_FASTCALL " +"| METH_KEYWORDS ` e a assinatura :c:" +"type:`PyCMethod` correspondente:" #: ../../howto/isolating-extensions.rst:518 msgid "" "Once you have the defining class, call :c:func:`PyType_GetModuleState` to " "get the state of its associated module." msgstr "" +"Uma vez que vc tem a classe definidora, chame :c:func:" +"`PyType_GetModuleState` para obter o estado do módulo associado a ela." #: ../../howto/isolating-extensions.rst:521 msgid "For example::" @@ -656,11 +900,11 @@ msgstr "Por exemplo::" #: ../../howto/isolating-extensions.rst:549 msgid "Module State Access from Slot Methods, Getters and Setters" -msgstr "" +msgstr "Acesso ao estado do módulo a partir de métodos slot, getters e setters" #: ../../howto/isolating-extensions.rst:553 msgid "This is new in Python 3.11." -msgstr "" +msgstr "Adicionado na versão 3.11" #: ../../howto/isolating-extensions.rst:561 msgid "" @@ -671,6 +915,12 @@ msgid "" "`PyCMethod`. The same goes for getters and setters defined with :c:type:" "`PyGetSetDef`." msgstr "" +"Métodos slot—os métodos rápidos em C equivalentes aos métodos especiais, " +"como :c:member:`~PyNumberMethods.nb_add` para :py:attr:`~object.__add__` ou :" +"c:member:`~PyTypeObject.tp_new` para inicialização—têm uma API muito simples " +"que não permite passar a classe definidora, ao contrário do :c:type:" +"`PyCMethod`. O mesmo vale para getters e setters definidos com :c:type:" +"`PyGetSetDef`." #: ../../howto/isolating-extensions.rst:568 msgid "" @@ -678,6 +928,9 @@ msgid "" "`PyType_GetModuleByDef` function, and pass in the module definition. Once " "you have the module, call :c:func:`PyModule_GetState` to get the state::" msgstr "" +"Para acessar o estado do módulo nesses casos, use a função :c:func:" +"`PyType_GetModuleByDef`, e passe a definição do módulo. Uma vez encontrado o " +"módulo, chame :c:func:`PyModule_GetState` para obter o estado::" #: ../../howto/isolating-extensions.rst:579 msgid "" @@ -685,6 +938,9 @@ msgid "" "resolution order` (i.e. all superclasses) for the first superclass that has " "a corresponding module." msgstr "" +"Essa função :c:func:`!PyType_GetModuleByDef` funciona procurando na :term:" +"`ordem de resolução de métodos` (isto é, todas as superclasses) a primeira " +"superclasse que tem um módulo correspondente." #: ../../howto/isolating-extensions.rst:585 msgid "" @@ -693,10 +949,15 @@ msgid "" "the module of the true defining class. However, it will always return a " "module with the same definition, ensuring a compatible C memory layout." msgstr "" +"Em casos muito exóticos (cadeias hereditárias espalhadas através de " +"múltiplos módulos criados a partir da mesma definição), a :c:func:`!" +"PyType_GetModuleByDef` pode não retornar o módulo da classe definidora " +"correta. De todo modo, essa função sempre vai retornar um módulo com a mesma " +"definição, garantindo um layout de memória C compatível." #: ../../howto/isolating-extensions.rst:593 msgid "Lifetime of the Module State" -msgstr "" +msgstr "Tempo de vida do estado do módulo" #: ../../howto/isolating-extensions.rst:595 msgid "" @@ -704,6 +965,9 @@ msgid "" "each pointer to (a part of) the module state, you must hold a reference to " "the module object." msgstr "" +"Quando um objeto de módulo é coletado como lixo, o seu estado de módulo é " +"liberado. Para cada ponteiro para o estado do módulo (ou uma parte dele), é " +"necessário possuir uma referência ao objeto de módulo." #: ../../howto/isolating-extensions.rst:599 msgid "" @@ -713,14 +977,21 @@ msgid "" "reference module state from other places, such as callbacks for external " "libraries." msgstr "" +"Isso não costuma ser um problema, dado que tipos criados com :c:func:" +"`PyType_FromModuleAndSpec`, bem como suas instâncias, guardam referências ao " +"módulo. Mesmo assim, é necessário tomar cuidado com a contagem de " +"referências ao referenciar o estado do módulo a partir de outros lugares, " +"como funções de retorno para bibliotecas externas." #: ../../howto/isolating-extensions.rst:608 msgid "Open Issues" -msgstr "" +msgstr "Problemas em aberto" #: ../../howto/isolating-extensions.rst:610 msgid "Several issues around per-module state and heap types are still open." msgstr "" +"Vários problemas relacionados aos estados por módulo e aos tipos no heap " +"ainda estão em aberto." #: ../../howto/isolating-extensions.rst:612 msgid "" @@ -728,10 +999,13 @@ msgid "" "mailing list `__." msgstr "" +"O melhor lugar para discussões sobre como melhorar a situação é a `lista de " +"discussão do capi-sig `__." #: ../../howto/isolating-extensions.rst:617 msgid "Per-Class Scope" -msgstr "" +msgstr "Escopo por classe" #: ../../howto/isolating-extensions.rst:619 msgid "" @@ -740,13 +1014,20 @@ msgid "" "may change in the future—perhaps, ironically, to allow a proper solution for " "per-class scope)." msgstr "" +"Atualmente (desde o Python 3.11) não é possível anexar estado a *tipos* " +"individuais sem depender de detalhes de implementação do CPython (os quais " +"podem mudar no futuro—talvez, ironicamente, para possibilitar uma solução " +"adequada para o escopo por classe)." #: ../../howto/isolating-extensions.rst:626 msgid "Lossless Conversion to Heap Types" -msgstr "" +msgstr "Conversão sem perdas para tipos no heap" #: ../../howto/isolating-extensions.rst:628 msgid "" "The heap type API was not designed for \"lossless\" conversion from static " "types; that is, creating a type that works exactly like a given static type." msgstr "" +"A API de tipos no heap não foi projetada para conversão \"sem perdas\" de " +"tipos estáticos. isto é, para criar um tipo que funciona exatamente como um " +"dado tipo estático." diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 215a033aa..f1d403bf1 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -22,10 +22,10 @@ msgstr "" "2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -70,7 +70,7 @@ msgstr "" #: ../../howto/logging-cookbook.rst:76 msgid "The output looks like this:" -msgstr "O resultado deve ser algo semelhante a isto:" +msgstr "O resultado deve ser algo assim:" #: ../../howto/logging-cookbook.rst:102 msgid "Logging from multiple threads" @@ -2118,8 +2118,8 @@ msgstr "Manipuladores úteis incluídos no módulo logging." #: ../../howto/logging-cookbook.rst:4152 msgid ":ref:`Basic Tutorial `" -msgstr ":ref:`Basic Tutorial `" +msgstr ":ref:`Tutorial básico `" #: ../../howto/logging-cookbook.rst:4154 msgid ":ref:`Advanced Tutorial `" -msgstr ":ref:`Advanced Tutorial `" +msgstr ":ref:`Tutorial avançado `" diff --git a/howto/logging.po b/howto/logging.po index 1086b9569..d15ca978e 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -26,16 +26,16 @@ msgstr "" "Last-Translator: Vinicius vinicinbgs, 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/logging.rst:3 msgid "Logging HOWTO" -msgstr "HowTo - Logging" +msgstr "Logging" #: ../../howto/logging.rst:0 msgid "Author" @@ -1567,4 +1567,4 @@ msgstr "Manipuladores úteis incluídos no módulo logging." #: ../../howto/logging.rst:1097 msgid ":ref:`A logging cookbook `" -msgstr ":ref:`A logging cookbook `" +msgstr ":ref:`Um livro de receitas do logging `" diff --git a/howto/mro.po b/howto/mro.po index 6a53ff7dd..e53964c78 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index b7636247c..bae2ee4dc 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/pyporting.po b/howto/pyporting.po index dbb52e7e7..a777aec33 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/regex.po b/howto/regex.po index 239c662cc..71a2cbfa1 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -24,16 +24,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/regex.rst:5 msgid "Regular Expression HOWTO" -msgstr "Expressões Regulares HOWTO" +msgstr "Expressões Regulares" #: ../../howto/regex.rst:0 msgid "Author" @@ -506,7 +506,7 @@ msgstr "3" #: ../../howto/regex.rst:197 ../../howto/regex.rst:205 msgid "*Failure*" -msgstr "*Failure*" +msgstr "*Falha*" #: ../../howto/regex.rst:197 msgid "" @@ -587,6 +587,13 @@ msgid "" "similar example, ``ca+t`` will match ``'cat'`` (1 ``'a'``), ``'caaat'`` (3 " "``'a'``\\ s), but won't match ``'ct'``." msgstr "" +"Outro metacaractere de repetição é o ``+``, que corresponde a uma ou mais " +"vezes. Preste muita atenção para a diferença entre ``*`` e ``+``; ``*`` " +"corresponde com zero ou mais vezes, assim, o que quer que esteja sendo " +"repetido pode não estar presente, enquanto que ``+`` requer pelo menos uma " +"ocorrência. Para usar um exemplo similar, ``ca+t`` vai corresponder a " +"``'cat'``, (1 ``'a'``), ``'caaat'`` (3 ``'a'``\\ s), mas não corresponde com " +"``'ct'``." #: ../../howto/regex.rst:233 msgid "" @@ -626,6 +633,11 @@ msgid "" "better to use ``*``, ``+``, or ``?`` when you can, simply because they're " "shorter and easier to read." msgstr "" +"Os leitores de uma inclinação reducionista podem notar que os três outros " +"quantificadores podem todos serem expressos utilizando esta notação. ``{0,}" +"`` é o mesmo que ``*``, ``{1,}`` é equivalente a ``+``, e ``{0,1}`` é o " +"mesmo que ``?``. É melhor usar ``*``, ``+`` ou ``?`` quando puder, " +"simplesmente porque eles são mais curtos e fáceis de ler." #: ../../howto/regex.rst:259 msgid "Using Regular Expressions" @@ -807,11 +819,11 @@ msgstr "" #: ../../howto/regex.rst:344 msgid "Regular String" -msgstr "String Regular" +msgstr "String regular" #: ../../howto/regex.rst:344 msgid "Raw string" -msgstr "**String Crua**" +msgstr "**String crua**" #: ../../howto/regex.rst:346 msgid "``\"ab*\"``" @@ -835,7 +847,7 @@ msgstr "``r\"\\w+\\s+\\1\"``" #: ../../howto/regex.rst:355 msgid "Performing Matches" -msgstr "Executando Comparações" +msgstr "Executando comparações" #: ../../howto/regex.rst:357 msgid "" @@ -906,6 +918,11 @@ msgid "" "objects>` instance is returned, containing information about the match: " "where it starts and ends, the substring it matched, and more." msgstr "" +":meth:`~re.Pattern.match` e :meth:`~re.Pattern.search` retornam ``None`` se " +"não existir nenhuma correspondência encontrada. Se tiveram sucesso, uma " +"instância de :ref:`match object ` é retornada, contendo " +"informações sobre a correspondência: onde ela começa e termina, a substring " +"com a qual ela teve correspondência, e mais." #: ../../howto/regex.rst:383 msgid "" @@ -918,9 +935,9 @@ msgid "" "This HOWTO uses the standard Python interpreter for its examples. First, run " "the Python interpreter, import the :mod:`re` module, and compile a RE::" msgstr "" -"Este HOWTO usa o interpretador Python padrão para seus exemplos. Primeiro, " -"execute o interpretador Python, importe o modulo :mod:`re`, e compile uma " -"RE::" +"Este documento usa o interpretador Python padrão para seus exemplos. " +"Primeiro, execute o interpretador Python, importe o modulo :mod:`re`, e " +"compile uma RE::" #: ../../howto/regex.rst:394 msgid "" @@ -930,6 +947,12 @@ msgid "" "which will cause the interpreter to print no output. You can explicitly " "print the result of :meth:`!match` to make this clear. ::" msgstr "" +"Agora, você pode tentar corresponder várias strings com a RE ``[a-z]+``. Mas " +"uma string vazia não deveria corresponder com nada, uma vez que ``+`` " +"significa 'uma ou mais repetições'. :meth:`~re.Pattern.match` deve retornar " +"``None`` neste caso, o que fará com que o interpretador não imprima nenhuma " +"saída. Você pode imprimir explicitamente o resultado de :meth:`!match` para " +"deixar isso claro." #: ../../howto/regex.rst:404 msgid "" @@ -937,6 +960,10 @@ msgid "" "this case, :meth:`~re.Pattern.match` will return a :ref:`match object `, so you should store the result in a variable for later use. ::" msgstr "" +"Agora, vamos experimentá-la em uma string que ela deve corresponder, como " +"``tempo``. Neste caso, :meth:`~re.Pattern.match` irá retornar um :ref:" +"`objeto match `, assim que você deve armazenar o resultado em " +"uma variável para uso posterior." #: ../../howto/regex.rst:412 msgid "" @@ -944,6 +971,9 @@ msgid "" "about the matching string. Match object instances also have several methods " "and attributes; the most important ones are:" msgstr "" +"Agora você pode consultar o :ref:`objeto match ` para obter " +"informações sobre a string correspondente. Instâncias do objeto match também " +"tem vários métodos e atributos; os mais importantes são os seguintes:" #: ../../howto/regex.rst:419 msgid "``group()``" @@ -993,6 +1023,14 @@ msgid "" "scans through the string, so the match may not start at zero in that " "case. ::" msgstr "" +":meth:`~re.Match.group` retorna a substring correspondeu com a RE. :meth:" +"`~re.Match.start` e :meth:`~re.Match.end` retornam os índices inicial e o " +"final da substring correspondente. :meth:`~re.Match.span` retorna tanto os " +"índices inicial e final em uma única tupla. Como o método :meth:`~re." +"Pattern.match` somente verifica se a RE corresponde com o início de uma " +"string, :meth:`!start` será sempre zero. No entanto, o método :meth:`~re." +"Pattern.search` dos objetos padrão, varre toda a string, de modo que a " +"substring correspondente pode não iniciar em zero nesse caso." #: ../../howto/regex.rst:455 msgid "" @@ -1009,6 +1047,8 @@ msgid "" "Two pattern methods return all of the matches for a pattern. :meth:`~re." "Pattern.findall` returns a list of matching strings::" msgstr "" +"Dois métodos padrão retornam todas as correspondências de um padrão. :meth:" +"`~re.Pattern.findall` retorna uma lista de strings correspondentes:" #: ../../howto/regex.rst:473 msgid "" @@ -1026,6 +1066,10 @@ msgid "" "sequence of :ref:`match object ` instances as an :term:" "`iterator`::" msgstr "" +":meth:`~re.Pattern.findall` tem que criar a lista inteira antes de poder " +"devolvê-la como resultado. O método :meth:`~re.Pattern.finditer` retorna uma " +"sequência de instâncias :ref:`objeto match ` como um :term:" +"`iterator`::" #: ../../howto/regex.rst:495 msgid "Module-Level Functions" @@ -1040,6 +1084,13 @@ msgid "" "with the RE string added as the first argument, and still return either " "``None`` or a :ref:`match object ` instance. ::" msgstr "" +"Você não tem que criar um objeto padrão e chamar seus métodos; o módulo :mod:" +"`re` também fornece funções de nível superior chamada :func:`~re.match`, :" +"func:`~re.search`, :func:`~re.findall`, :func:`~re.sub`, e assim por diante. " +"Estas funções recebem os mesmos argumentos que o método padrão " +"correspondente, com a string RE adicionada como o primeiro argumento, e " +"ainda retornam ``None`` ou uma instância :ref:`objeto match `. ::" #: ../../howto/regex.rst:509 msgid "" @@ -1059,7 +1110,7 @@ msgstr "" #: ../../howto/regex.rst:522 msgid "Compilation Flags" -msgstr "Sinalizadores de Compilação" +msgstr "Sinalizadores de compilação" #: ../../howto/regex.rst:526 msgid "" @@ -1114,7 +1165,7 @@ msgstr ":const:`DOTALL`, :const:`S`" #: ../../howto/regex.rst:544 msgid "Make ``.`` match any character, including newlines." -msgstr "" +msgstr "Faz o ``.`` corresponder a qualquer caractere, incluindo novas linhas." #: ../../howto/regex.rst:547 msgid ":const:`IGNORECASE`, :const:`I`" @@ -1233,6 +1284,10 @@ msgid "" "only matching instead of full Unicode matching. This is only meaningful for " "Unicode patterns, and is ignored for byte patterns." msgstr "" +"Faz com que ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` e ``\\S`` executem " +"a correspondência somente ASCII em vez da correspondência Unicode completa. " +"Isso é significativo apenas para padrões Unicode e é ignorado para padrões " +"de bytes." #: ../../howto/regex.rst:639 msgid "" @@ -1281,7 +1336,7 @@ msgstr "" #: ../../howto/regex.rst:673 msgid "More Pattern Power" -msgstr "Mais Poder dos Padrões" +msgstr "Mais poder dos Padrões" #: ../../howto/regex.rst:675 msgid "" @@ -1295,7 +1350,7 @@ msgstr "" #: ../../howto/regex.rst:683 msgid "More Metacharacters" -msgstr "Mais Metacaracteres" +msgstr "Mais metacaracteres" #: ../../howto/regex.rst:685 msgid "" @@ -1499,6 +1554,12 @@ msgid "" "of interest. For example, an RFC-822 header line is divided into a header " "name and a value, separated by a ``':'``, like this:" msgstr "" +"Frequentemente é necessário obter mais informações do que apenas se a RE " +"teve correspondência ou não. As expressões regulares são muitas vezes " +"utilizadas para dissecar strings escrevendo uma RE dividida em vários " +"subgrupos que correspondem a diferentes componentes de interesse. Por " +"exemplo, uma linha de cabeçalho RFC-822 é dividida em um nome de cabeçalho e " +"um valor, separados por um ``':'``, como essa:" #: ../../howto/regex.rst:800 msgid "" @@ -1555,12 +1616,18 @@ msgid "" "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" +":meth:`~re.Match.group` pode receber vários números de grupos de uma vez, e " +"nesse caso ele irá retornar uma tupla contendo os valores correspondentes " +"desses grupos." #: ../../howto/regex.rst:850 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" +"O método :meth:`~re.Match.groups` retorna uma tupla contendo as strings de " +"todos os subgrupos, de 1 até o último. Independente da quantidade de " +"subgrupos informada. ::" #: ../../howto/regex.rst:856 msgid "" @@ -1600,7 +1667,7 @@ msgstr "" #: ../../howto/regex.rst:876 msgid "Non-capturing and Named Groups" -msgstr "Não captura e Grupos Nomeados" +msgstr "Não captura e grupos nomeados" #: ../../howto/regex.rst:878 msgid "" @@ -1643,7 +1710,7 @@ msgstr "" "erro de sintaxe porque o ``?`` não teria nada a repetir, de modo que isso " "não introduz quaisquer problemas de compatibilidade. Os caracteres " "imediatamente após um ``?`` indicam que a extensão está sendo usada, então " -"``(?=foo)`` é uma coisa (uma afirmação ``lookahead`` positiva) e ``(?:foo)`` " +"``(?=foo)`` é uma coisa (uma asserção ``lookahead`` positiva) e ``(?:foo)`` " "é outra coisa (um grupo de não captura contendo a subexpressão ``foo``)." #: ../../howto/regex.rst:899 @@ -1666,6 +1733,11 @@ msgid "" "can make this fact explicit by using a non-capturing group: ``(?:...)``, " "where you can replace the ``...`` with any other regular expression. ::" msgstr "" +"Às vezes você vai querer usar um grupo para representar uma parte de uma " +"expressão regular, mas não está interessado em recuperar o conteúdo do " +"grupo. Você pode fazer este fato explícito usando um grupo de não-captura: " +"``(?:...)``, onde você pode substituir o ``...`` por qualquer outra " +"expressão regular. ::" #: ../../howto/regex.rst:919 msgid "" @@ -1708,6 +1780,14 @@ msgid "" "still given numbers, so you can retrieve information about a group in two " "ways::" msgstr "" +"A sintaxe de um grupo nomeado é uma das extensões específicas do Python: ``(?" +"P...)``. *name* é, obviamente, o nome do grupo. Os grupos nomeados se " +"comportam exatamente como os grupos de captura, e, adicionalmente, associam " +"um nome a um grupo. Todos os métodos de :ref:`objeto correspondência ` que lidam com grupos de captura aceitam tanto inteiros que se " +"referem ao grupo por número ou strings que contêm o nome do grupo desejado. " +"Os grupos nomeados ainda recebem números, então você pode recuperar " +"informações sobre um grupo de duas maneiras::" #: ../../howto/regex.rst:946 msgid "" @@ -1721,6 +1801,9 @@ msgid "" "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" +"Os grupos nomeados são úteis porque eles permitem que você use nomes de " +"fácil lembrança, em vez de ter que lembrar de números. Aqui está um exemplo " +"de RE usando o módulo :mod:`imaplib`::" #: ../../howto/regex.rst:964 msgid "" @@ -1740,10 +1823,17 @@ msgid "" "words, ``\\b(\\w+)\\s+\\1\\b`` can also be written as ``\\b(?" "P\\w+)\\s+(?P=word)\\b``::" msgstr "" +"A sintaxe para referências anteriores em uma expressão, tal como " +"``(...)\\1``, faz referência ao número do grupo. Existe, naturalmente, uma " +"variante que usa o nome do grupo em vez do número. Isto é outra extensão " +"Python: ``(?P=name)`` indica que o conteúdo do grupo chamado *name* deve, " +"novamente, ser correspondido no ponto atual. A expressão regular para " +"encontrar palavras duplicadas, ``(\\b\\w+)\\s+\\1``, também pode ser escrita " +"como ``(?P\\b\\w+)\\s+(?P=word)``::" #: ../../howto/regex.rst:980 msgid "Lookahead Assertions" -msgstr "Afirmações Lookahead" +msgstr "Asserções lookahead" #: ../../howto/regex.rst:982 msgid "" @@ -1751,8 +1841,8 @@ msgid "" "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -"Outra afirmação de \"largura zero\" é a afirmação lookahead. Afirmações " -"LookAhead estão disponíveis tanto na forma positiva quanto na negativa, e se " +"Outra afirmação de \"largura zero\" é a asserção lookahead. Asserções " +"lookahead estão disponíveis tanto na forma positiva quanto na negativa, e se " "parece com isto:" #: ../../howto/regex.rst:985 @@ -1767,7 +1857,7 @@ msgid "" "tried, the matching engine doesn't advance at all; the rest of the pattern " "is tried right where the assertion started." msgstr "" -"Afirmação lookahead positiva. Retorna sucesso se a expressão regular " +"Asserção lookahead positiva. Retorna sucesso se a expressão regular " "informada, aqui representada por ``...``, corresponde com o conteúdo da " "localização atual, e retorna falha caso contrário. Mas, uma vez que a " "expressão informada tenha sido testada, o mecanismo de correspondência não " @@ -1784,7 +1874,7 @@ msgid "" "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -"Afirmação lookahead negativa. É o oposto da afirmação positiva; será bem-" +"Asserção lookahead negativa. É o oposto da asserção positiva; será bem-" "sucedida se a expressão informada não corresponder com o conteúdo da posição " "atual na string." @@ -1921,7 +2011,7 @@ msgstr "``.*[.](?!bat$|exe$)[^.]*$``" #: ../../howto/regex.rst:1058 msgid "Modifying Strings" -msgstr "Modificando Strings" +msgstr "Modificando strings" #: ../../howto/regex.rst:1060 msgid "" @@ -1964,10 +2054,12 @@ msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" +"Faz a mesma coisa que :meth:`!sub`, mas retorna a nova string e o número de " +"substituições" #: ../../howto/regex.rst:1080 msgid "Splitting Strings" -msgstr "Dividindo as Strings" +msgstr "Dividindo as strings" #: ../../howto/regex.rst:1082 msgid "" @@ -1978,6 +2070,13 @@ msgid "" "splitting by whitespace or by a fixed string. As you'd expect, there's a " "module-level :func:`re.split` function, too." msgstr "" +"O método :meth:`~re.Pattern.split` de um padrão divide uma string em pedaços " +"onde quer que a RE corresponda, retornando uma lista formada por esses " +"pedaços. É semelhante ao método :meth:`~str.split` de strings, mas oferece " +"muito mais generalidade nos delimitadores, e assim, você pode fazer disso " +"para fazer a divisão; :meth:`!split` só implementa a divisão de espaço em " +"branco ou por uma string fixa. Como você deve deduzir, existe também uma " +"função a nível de módulo :func:`re.split`." #: ../../howto/regex.rst:1093 msgid "" @@ -2037,6 +2136,10 @@ msgid "" "replacement value, which can be either a string or a function, and the " "string to be processed." msgstr "" +"Outra tarefa comum é encontrar todas as combinações para um padrão e " +"substituí-las por uma string diferente. O método :meth:`~re.Pattern.sub` " +"recebe um valor de substituição, que pode ser uma string ou uma função, e a " +"string a ser processada." #: ../../howto/regex.rst:1143 msgid "" @@ -2063,6 +2166,8 @@ msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" +"Aqui está um exemplo simples do uso do método :meth:`~re.Pattern.sub`. Ele " +"substitui nomes de cores pela palavra ``colour``::" #: ../../howto/regex.rst:1160 msgid "" @@ -2070,12 +2175,17 @@ msgid "" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" +"O método :meth:`~re.Pattern.subn` faz o mesmo trabalho, mas retorna uma " +"tupla com duas informações; contém uma string com novo valor e o número de " +"substituições que foram realizadas:" #: ../../howto/regex.rst:1169 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" msgstr "" +"Correspondências vazias somente são substituídas quando não estão adjacente " +"(próxima) a uma correspondência vazia anterior." #: ../../howto/regex.rst:1176 msgid "" @@ -2087,6 +2197,13 @@ msgid "" "incorporate portions of the original text in the resulting replacement " "string." msgstr "" +"Se a substituição (replacement) é uma string, qualquer barra invertida é " +"interpretada e processada. Isto é, ``\\n`` é convertido a um único caractere " +"de nova linha, ``\\r`` é convertido em um retorno do carro, e assim por " +"diante. Casos desconhecidos, como ``\\&`` são ignorados. Referências " +"anteriores (retrovisor - Aurelio), como ``\\6``, são substituídas com a " +"substring correspondida pelo grupo correspondente na RE. Isso permite que " +"você incorpore partes do texto original na string de substituição resultante." #: ../../howto/regex.rst:1183 msgid "" @@ -2158,7 +2275,7 @@ msgstr "" #: ../../howto/regex.rst:1233 msgid "Common Problems" -msgstr "Problemas Comuns" +msgstr "Problemas comuns" #: ../../howto/regex.rst:1235 msgid "" @@ -2174,7 +2291,7 @@ msgstr "" #: ../../howto/regex.rst:1241 msgid "Use String Methods" -msgstr "Usando String Methods" +msgstr "Usando métodos de string" #: ../../howto/regex.rst:1243 msgid "" @@ -2187,6 +2304,14 @@ msgid "" "for the purpose, instead of the large, more generalized regular expression " "engine." msgstr "" +"Às vezes, usar o módulo :mod:`re` é um equívoco. Se você está fazendo " +"correspondência com uma string fixa, ou uma classe de caractere única, e " +"você não está usando nenhum recurso de :mod:`re` como o sinalizador :const:" +"`~re.IGNORECASE`, então pode não ser necessário todo o poder das expressões " +"regulares. Strings possui vários métodos para executar operações com strings " +"fixas e eles são, geralmente, muito mais rápidos, porque a implementação é " +"um único e pequeno laço (loop) de C que foi otimizado para esse propósito, " +"em vez do grande e mais generalizado mecanismo das expressões regulares." #: ../../howto/regex.rst:1251 msgid "" @@ -2200,6 +2325,15 @@ msgid "" "``word`` have a word boundary on either side. This takes the job beyond :" "meth:`!replace`'s abilities.)" msgstr "" +"Um exemplo pode ser a substituição de uma string fixa única por outra; por " +"exemplo, você pode substituir ``word`` por ``deed``. :func:`re.sub` parece " +"ser a função a ser usada para isso, mas considere o método :meth:`~str." +"replace`. Note que :meth:`!replace` também irá substituir ``word`` dentro de " +"palavras, transformando ``swordfish`` em ``sdeedfish``, mas uma RE ingênua " +"teria feito isso também. (Para evitar a realização da substituição de partes " +"de palavras, o padrão teria que ser ``\\bword\\b``, a fim de exigir que " +"``word`` tenha um limite de palavra em ambos os lados (o recurso borda). " +"Isso leva o tarefa para além da capacidade de :meth:`!replace`.)" #: ../../howto/regex.rst:1260 msgid "" @@ -2209,6 +2343,11 @@ msgid "" "capable of doing both tasks and will be faster than any regular expression " "operation can be." msgstr "" +"Outra tarefa comum é apagar todas as ocorrências de um único caractere de " +"uma string ou substitui-lo por um outro caractere único. Você pode fazer " +"isso com algo como ``re.sub('\\n', ' ', S)``, mas :meth:`~str.translate` é " +"capaz de fazer ambas as tarefas e será mais rápida do que qualquer operação " +"de expressão regular pode ser." #: ../../howto/regex.rst:1266 msgid "" @@ -2231,12 +2370,20 @@ msgid "" "start at 0; if the match wouldn't start at zero, :func:`!match` will *not* " "report it. ::" msgstr "" +"A função :func:`~re.match` somente verifica se a RE corresponde ao início " +"da string, enquanto :func:`~re.search` fará a varredura através na string " +"procurando por uma correspondência. É importante manter esta distinção em " +"mente. Lembre-se, :func:`!match` só irá relatar uma correspondência bem-" +"sucedida que começa em 0; se a correspondência não começar em zero, :func:`!" +"match` não vai reportá-la." #: ../../howto/regex.rst:1284 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" +"Por outro lado, :func:`~re.search` fará a varredura percorrendo a string e " +"relatando a primeira correspondência que encontrar." #: ../../howto/regex.rst:1292 msgid "" @@ -2272,7 +2419,7 @@ msgstr "" #: ../../howto/regex.rst:1307 msgid "Greedy versus Non-Greedy" -msgstr "Gulosos versus não Gulosos" +msgstr "Gulosos versus não-gulosos" #: ../../howto/regex.rst:1309 msgid "" @@ -2298,6 +2445,12 @@ msgid "" "The final match extends from the ``'<'`` in ``''`` to the ``'>'`` in " "``''``, which isn't what you want." msgstr "" +"A RE corresponde a ``'<'`` em ``''``, e o ``.*`` consome o resto da " +"string. Existe ainda mais coisa existente na RE, no entanto, e o ``>`` pode " +"não corresponder com o final da string, de modo que o mecanismo de expressão " +"regular tem que recuar caractere por caractere até encontrar uma " +"correspondência para a ``>``. A correspondência final se estende do ``'<'`` " +"em ``''`` ao ``'>'`` em ``''``, que não é o que você quer." #: ../../howto/regex.rst:1330 msgid "" @@ -2307,6 +2460,12 @@ msgid "" "matches, and when it fails, the engine advances a character at a time, " "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" +"Neste caso, a solução é usar os quantificadores não-gulosos ``*?``, ``+?``, " +"``??`` ou ``{m,n}?``, que corresponde com o mínimo de texto possível. No " +"exemplo acima, o ``'>'`` é tentado imediatamente após a primeira " +"correspondência de ``'<'``, e quando ele falhar, o mecanismo avança um " +"caractere de cada vez, experimentado ``'>'`` a cada passo. Isso produz " +"justamente o resultado correto::" #: ../../howto/regex.rst:1339 msgid "" @@ -2347,6 +2506,9 @@ msgid "" "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" +"Para tais REs, especificar a flag :const:`re.VERBOSE` ao compilar a " +"expressão regular pode ser útil, porque permite que você formate a expressão " +"regular de forma mais clara." #: ../../howto/regex.rst:1358 msgid "" @@ -2397,3 +2559,11 @@ msgid "" "edition covered Python's now-removed :mod:`!regex` module, which won't help " "you much.) Consider checking it out from your library." msgstr "" +"O livro mais completo sobre expressões regulares é quase certamente o " +"Mastering Regular Expressions de Jeffrey Friedl’s, publicado pela O'Reilly. " +"Infelizmente, ele se concentra exclusivamente em sabores de expressões " +"regulares do Perl e do Java, e não contém qualquer material relativo a " +"Python, por isso não vai ser útil como uma referência para a programação em " +"Python. (A primeira edição cobre o módulo :mod:`!regex` agora removido do " +"Python, o que não vai te ajudar muito.) Considere removê-lo de sua " +"biblioteca." diff --git a/howto/sockets.po b/howto/sockets.po index 64b3b1782..430da46e9 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/sockets.rst:5 msgid "Socket Programming HOWTO" -msgstr "HOWTO sobre a Programação de Soquetes" +msgstr "Programação de Soquetes" #: ../../howto/sockets.rst:0 msgid "Author" @@ -76,13 +76,13 @@ msgstr "" "Só trataremos dos soquetes INET (ou seja, IPv4), no entanto, os mesmos " "representam ao menos 99% dos soquetes que estão atualmente em uso. Só " "estudaremos os soquetes STREAM (ou seja, TCP) - a menos que você realmente " -"saiba o que está fazendo (nesse caso, este HOWTO não é para você!), terás um " -"melhor conhecimento sobre o comportamento e o desempenho dos soquetes STREAM " -"do que qualquer outra coisa. Tentarei aclarar o mistério sobre o que " -"realmente é um soquete, bem como, apresentarei dicas de como trabalhar com " -"soquetes bloqueantes e os não bloqueantes. Começaremos o estudo falando da " -"razão pela qual bloquear um soquete. Precisas saber como os mesmos (os " -"soquetes bloqueantes) antes de estudar os não bloqueantes" +"saiba o que está fazendo (nesse caso, este documento não é para você!), " +"terás um melhor conhecimento sobre o comportamento e o desempenho dos " +"soquetes STREAM do que qualquer outra coisa. Tentarei aclarar o mistério " +"sobre o que realmente é um soquete, bem como, apresentarei dicas de como " +"trabalhar com soquetes bloqueantes e os não bloqueantes. Começaremos o " +"estudo falando da razão pela qual bloquear um soquete. Precisas saber como " +"os mesmos (os soquetes bloqueantes) antes de estudar os não bloqueantes" #: ../../howto/sockets.rst:31 msgid "" diff --git a/howto/sorting.po b/howto/sorting.po index 1e7aff8fa..38504bb3a 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/sorting.rst:4 msgid "Sorting Techniques" -msgstr "" +msgstr "Técnicas de ordenação" #: ../../howto/sorting.rst:0 msgid "Author" @@ -151,6 +151,10 @@ msgid "" "The :mod:`operator` module has :func:`~operator.itemgetter`, :func:" "`~operator.attrgetter`, and a :func:`~operator.methodcaller` function." msgstr "" +"O padrão de :term:`função chave` mostrado acima é muito comum, por isso, " +"Python provê funções convenientes para tornar as funções de acesso mais " +"fáceis e rápidas. O módulo :mod:`operator` tem as funções :func:`~operator." +"itemgetter`, :func:`~operator.attrgetter` e :func:`~operator.methodcaller`" #: ../../howto/sorting.rst:111 msgid "Using those functions, the above examples become simpler and faster:" @@ -176,7 +180,7 @@ msgstr "" #: ../../howto/sorting.rst:153 msgid "Ascending and Descending" -msgstr "Ascendente e Descendente" +msgstr "Ascendente e descendente" #: ../../howto/sorting.rst:155 msgid "" @@ -227,8 +231,8 @@ msgid "" "This can be abstracted out into a wrapper function that can take a list and " "tuples of field and order to sort them on multiple passes." msgstr "" -"Isso pode ser abstrato no caso das funções encapsuladoras que podem receber " -"uma lista e uma tupla com o campos e então ordená-los em múltiplos passos." +"Isso pode ser abstrato no caso das funções invólucros que podem receber uma " +"lista e uma tupla com o campos e então ordená-los em múltiplos passos." #: ../../howto/sorting.rst:206 msgid "" @@ -335,7 +339,7 @@ msgstr "" #: ../../howto/sorting.rst:253 msgid "Comparison Functions" -msgstr "" +msgstr "Funções de comparação" #: ../../howto/sorting.rst:255 msgid "" @@ -397,6 +401,9 @@ msgid "" "it is easy to add a standard sort order to a class by defining an :meth:" "`~object.__lt__` method:" msgstr "" +"As rotinas de classificação usam ``<`` ao fazer comparações entre dois " +"objetos. Portanto, é fácil adicionar uma ordem de classificação padrão a uma " +"classe definindo um método :meth:`~object.__lt__`:" #: ../../howto/sorting.rst:307 msgid "" @@ -422,7 +429,7 @@ msgstr "" #: ../../howto/sorting.rst:327 msgid "Partial Sorts" -msgstr "" +msgstr "Ordenações parciais" #: ../../howto/sorting.rst:329 msgid "" diff --git a/howto/unicode.po b/howto/unicode.po index 70f1b86b1..a75d4fc1a 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/unicode.rst:5 msgid "Unicode HOWTO" -msgstr "Unicode HOWTO" +msgstr "Unicode" #: ../../howto/unicode.rst:0 msgid "Release" @@ -147,7 +147,7 @@ msgstr "" #: ../../howto/unicode.rst:87 msgid "Encodings" -msgstr "Encodings" +msgstr "Codificações" #: ../../howto/unicode.rst:89 msgid "" diff --git a/howto/urllib2.po b/howto/urllib2.po index 47ebf0012..602d5f531 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../howto/urllib2.rst:5 msgid "HOWTO Fetch Internet Resources Using The urllib Package" -msgstr "Como Buscar Recursos Da Internet Usando O Pacote urllib" +msgstr "Como buscar recursos da Internet usando o pacote urllib" #: ../../howto/urllib2.rst:0 msgid "Author" @@ -111,10 +111,10 @@ msgstr "" "se depara com erros ou casos não triviais ao abrir URLs HTTP, você vai " "precisar entender um pouco mais do HyperText Transfer Protocol. A literatura " "de referência mais reconhecida e compreensível para o HTTP é :rfc:`2616`. " -"Ela é um documento técnico e não foi feita para ser fácil de ler. Este HOWTO " -"busca ilustrar o uso de *urllib* com detalhes suficientes sobre HTTP para te " -"permitir seguir adiante. Ele não tem a intenção de substituir a documentação " -"do :mod:`urllib.request`, mas é suplementar a ela." +"Ela é um documento técnico e não foi feita para ser fácil de ler. Este " +"documento busca ilustrar o uso de *urllib* com detalhes suficientes sobre " +"HTTP para te permitir seguir adiante. Ele não tem a intenção de substituir a " +"documentação do :mod:`urllib.request`, mas é suplementar a ela." #: ../../howto/urllib2.rst:44 msgid "Fetching URLs" diff --git a/installing/index.po b/installing/index.po index 037047f8d..f9b848c89 100644 --- a/installing/index.po +++ b/installing/index.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -178,8 +178,9 @@ msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "`__" msgstr "" -"`Python Packaging User Guide: Creating and using virtual environments " -"`__" +"`Guia de Usuário para Empacotamento de Python: Criando e usando ambientes " +"virtuais `__" #: ../../installing/index.rst:76 msgid "Basic usage" @@ -265,8 +266,9 @@ msgid "" "`Python Packaging User Guide: Installing Python Distribution Packages " "`__" msgstr "" -"`Python Packaging User Guide: Installing Python Distribution Packages " -"`__" +"`Guia de Usuário para Empacotamento de Python: Instalando pacotes Python de " +"distribuição `__" #: ../../installing/index.rst:123 msgid "How do I ...?" @@ -295,8 +297,9 @@ msgid "" "`Python Packaging User Guide: Requirements for Installing Packages `__" msgstr "" -"`Python Packaging User Guide: Requirements for Installing Packages `__" +"`Python Packaging User Guide: Requisitos para instalar pacotes `__" #: ../../installing/index.rst:143 msgid "... install packages just for the current user?" @@ -334,8 +337,9 @@ msgid "" "`Python Packaging User Guide: Installing Scientific Packages `__" msgstr "" -"`Python Packaging User Guide: Installing Scientific Packages `__" +"`Guia de Usuário para Empacotamento de Python: Instalando pacotes " +"científicos `__" #: ../../installing/index.rst:165 msgid "... work with multiple versions of Python installed in parallel?" @@ -459,5 +463,5 @@ msgid "" "`Python Packaging User Guide: Binary Extensions `__" msgstr "" -"`Python Packaging User Guide: Binary Extensions `__" +"`Guia de Usuário para Empacotamento de Python: Extensões binárias `__" diff --git a/library/2to3.po b/library/2to3.po index e85596025..3a24cfaa2 100644 --- a/library/2to3.po +++ b/library/2to3.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/__future__.po b/library/__future__.po index bc1d4feb1..3c65b4cd7 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -19,20 +19,20 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/__future__.rst:2 msgid ":mod:`!__future__` --- Future statement definitions" -msgstr "" +msgstr ":mod:`!__future__` --- Definições de instruções future" #: ../../library/__future__.rst:7 msgid "**Source code:** :source:`Lib/__future__.py`" -msgstr "**Código-fonte:** :source:`Lib/__ future __.py`" +msgstr "**Código-fonte:** :source:`Lib/__future__.py`" #: ../../library/__future__.rst:11 msgid "" @@ -41,8 +41,8 @@ msgid "" "to allow the use of new Python features in modules containing the future " "statement before the release in which the feature becomes standard." msgstr "" -"Instruções na forma ``from __future__ import feature`` são chamadas de :ref:" -"`future statements `. Esses são casos especiais do compilador Python " +"Instruções na forma ``from __future__ import feature`` são chamadas de :ref:" +"`instruções future `. Esses são casos especiais do compilador Python " "para permitir o uso de novos recursos do Python em módulos que contêm a " "instrução future antes da versão em que o recurso se torna padrão." @@ -86,7 +86,7 @@ msgid "" "`__future__` will fail, because there was no module of that name prior to " "2.1)." msgstr "" -"Para garantir que :ref:`instruções futuras ` sejam executadas em " +"Para garantir que :ref:`instruções future ` sejam executadas em " "versões anteriores a Python 2.1, pelo menos, processe exceções de tempo de " "execução (a importação de :mod:`__future__` falhará, porque não havia nenhum " "módulo desse nome antes de 2.1)." @@ -139,7 +139,7 @@ msgstr ":pep:`227`: *Statically Nested Scopes*" #: ../../library/__future__.rst:46 msgid "generators" -msgstr "geradores" +msgstr "generators" #: ../../library/__future__.rst:46 msgid "2.2.0a1" @@ -284,8 +284,8 @@ msgid "" msgstr "" "Senão *MandatoryRelease* registra quando o recurso se tornou parte do " "idioma; Em versões em ou depois disso, os módulos não precisam mais de uma " -"instrução de future para usar o recurso em questão, mas podem continuar a " -"usar essas importações." +"instrução future para usar o recurso em questão, mas podem continuar a usar " +"essas importações." #: ../../library/__future__.rst:106 msgid "" @@ -319,10 +319,10 @@ msgid "" msgstr "" "``from __future__ import annotations`` foi programado anteriormente para se " "tornar obrigatório no Python 3.10, mas o Python Steering Council decidiu " -"duas vezes adiar a mudança (`announcement for Python 3.10 `__; `announcement for Python 3.11 " -"`__; `anúncio para o Python 3.11 `__). Nenhuma decisão final foi tomada " "ainda. Veja também :pep:`563` e :pep:`649`." diff --git a/library/__main__.po b/library/__main__.po index cb341d476..675257b39 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/__main__.rst:2 msgid ":mod:`!__main__` --- Top-level code environment" -msgstr "" +msgstr ":mod:`!__main__` --- Ambiente de código principal" #: ../../library/__main__.rst:10 msgid "" diff --git a/library/_thread.po b/library/_thread.po index 67d6bc32b..3817f4ead 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -24,16 +24,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/_thread.rst:2 msgid ":mod:`!_thread` --- Low-level threading API" -msgstr "" +msgstr ":mod:`!_thread`--- API de segmentação de baixo nível" #: ../../library/_thread.rst:15 msgid "" @@ -45,11 +45,11 @@ msgid "" "level threading API built on top of this module." msgstr "" "Este módulo fornece primitivos de baixo nível para trabalhar com vários " -"encadeamentos (também chamados :dfn:`processos leves` ou :dfn:`tarefas`) --- " -"vários encadeamentos de controle compartilhando seu espaço de dados global. " -"Para sincronização, bloqueios simples (também chamados de :dfn:`mutexes`, :" -"dfn:`exclusão mútua` ou :dfn:`semáforos binários`) são fornecidos. O módulo :" -"mod:`threading` fornece uma API de segmentação mais fácil de usar e de nível " +"threads (também chamados :dfn:`processos leves` ou :dfn:`tarefas`) --- " +"vários threads de controle compartilhando seu espaço de dados global. Para " +"sincronização, travas simples (também chamadas de :dfn:`mutexes`, :dfn:" +"`exclusão mútua` ou :dfn:`semáforos binários`) são fornecidas. O módulo :mod:" +"`threading` fornece uma API de segmentação mais fácil de usar e de nível " "mais alto, construída sobre este módulo." #: ../../library/_thread.rst:26 @@ -70,7 +70,7 @@ msgstr "Este é agora um sinônimo do componente embutido :exc:`RuntimeError`." #: ../../library/_thread.rst:41 msgid "This is the type of lock objects." -msgstr "Este é o tipo de objetos de bloqueio." +msgstr "Este é o tipo de objetos de trava." #: ../../library/_thread.rst:46 msgid "" @@ -112,7 +112,7 @@ msgid "" "arguments ``function``, ``args``, ``kwargs``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``_thread." -"start_new_thread`` com argumentos ``function``, ``args``, ``kwargs``." +"start_new_thread`` com os argumentos ``function``, ``args``, ``kwargs``." #: ../../library/_thread.rst:62 msgid ":func:`sys.unraisablehook` is now used to handle unhandled exceptions." @@ -134,12 +134,16 @@ msgid "" "If given, *signum* is the number of the signal to simulate. If *signum* is " "not given, :const:`signal.SIGINT` is simulated." msgstr "" +"Se fornecido, *signum* é o número do sinal a ser simulado. Se *signum* não " +"for fornecido, :const:`signal.SIGINT` será simulado." #: ../../library/_thread.rst:75 msgid "" "If the given signal isn't handled by Python (it was set to :const:`signal." "SIG_DFL` or :const:`signal.SIG_IGN`), this function does nothing." msgstr "" +"Se o sinal fornecido não for tratado por Python (foi definido como :const:" +"`signal.SIG_DFL` ou :const:`signal.SIG_IGN`), esta função não faz nada." #: ../../library/_thread.rst:79 msgid "The *signum* argument is added to customize the signal number." @@ -168,8 +172,8 @@ msgid "" "Return a new lock object. Methods of locks are described below. The lock " "is initially unlocked." msgstr "" -"Retorna um novo objeto de bloqueio. Métodos de bloqueio são descritos " -"abaixo. O bloqueio é desativado inicialmente." +"Retorna um novo objeto de trava. Métodos de trava são descritos abaixo. A " +"trava é desativada inicialmente." #: ../../library/_thread.rst:110 msgid "" @@ -247,7 +251,7 @@ msgstr ":ref:`Disponibilidade `: Windows, pthreads." #: ../../library/_thread.rst:147 msgid "Unix platforms with POSIX threads support." -msgstr "" +msgstr "Plataformas Unix com suporte a threads POSIX." #: ../../library/_thread.rst:152 msgid "" @@ -255,10 +259,13 @@ msgid "" "`. Specifying a timeout greater than this value will " "raise an :exc:`OverflowError`." msgstr "" +"O valor máximo permitido para o parâmetro *timeout* de :meth:`Lock.acquire " +"`. A especificação de um tempo limite maior que esse " +"valor vai levantar um :exc:`OverflowError`." #: ../../library/_thread.rst:159 msgid "Lock objects have the following methods:" -msgstr "Os objetos de bloqueio têm os seguintes métodos:" +msgstr "Os objetos de trava têm os seguintes métodos:" #: ../../library/_thread.rst:164 msgid "" @@ -267,9 +274,9 @@ msgid "" "(only one thread at a time can acquire a lock --- that's their reason for " "existence)." msgstr "" -"Sem nenhum argumento opcional, esse método adquire o bloqueio " -"incondicionalmente, se necessário, aguardando até que seja liberado por " -"outro encadeamento (apenas um encadeamento por vez pode adquirir um bloqueio " +"Sem nenhum argumento opcional, esse método adquire a trava " +"incondicionalmente, se necessário, aguardando até que seja liberada por " +"outro encadeamento (apenas um encadeamento por vez pode adquirir uma trava " "--- esse é o motivo da sua existência)." #: ../../library/_thread.rst:168 @@ -279,6 +286,10 @@ msgid "" "without waiting, while if it is true, the lock is acquired unconditionally " "as above." msgstr "" +"Se o argumento inteiro *blocking* estiver presente, a ação dependerá do seu " +"valor: se for falso, a trava será adquirida apenas se puder ser adquirida " +"imediatamente sem aguardar, enquanto se for verdadeiro, a trava será " +"adquirida incondicionalmente, conforme acima." #: ../../library/_thread.rst:173 msgid "" @@ -287,14 +298,18 @@ msgid "" "*timeout* argument specifies an unbounded wait. You cannot specify a " "*timeout* if *blocking* is false." msgstr "" +"Se o argumento de ponto flutuante *timeout* estiver presente e positivo, ele " +"especificará o tempo máximo de espera em segundos antes de retornar. Um " +"argumento negativo *timeout* especifica uma espera ilimitada. Você não pode " +"especificar um *timeout* se *blocking* for falso." #: ../../library/_thread.rst:178 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not." msgstr "" -"O valor de retorno é ``True`` se o bloqueio for adquirido com sucesso, se " -"não ``False``." +"O valor de retorno é ``True`` se a trava for adquirida com sucesso, se não " +"``False``." #: ../../library/_thread.rst:181 msgid "The *timeout* parameter is new." @@ -303,14 +318,14 @@ msgstr "O parâmetro *timeout* é novo." #: ../../library/_thread.rst:184 msgid "Lock acquires can now be interrupted by signals on POSIX." msgstr "" -"As aquisições de bloqueio agora podem ser interrompidas por sinais no POSIX." +"As aquisições de trava agora podem ser interrompidas por sinais no POSIX." #: ../../library/_thread.rst:190 msgid "" "Releases the lock. The lock must have been acquired earlier, but not " "necessarily by the same thread." msgstr "" -"Libera o bloqueio. O bloqueio deve ter sido adquirido anteriormente, mas não " +"Libera a trava. A trava deve ter sido adquirido anteriormente, mas não " "necessariamente pela mesma thread." #: ../../library/_thread.rst:196 @@ -318,7 +333,7 @@ msgid "" "Return the status of the lock: ``True`` if it has been acquired by some " "thread, ``False`` if not." msgstr "" -"Retorna o status do bloqueio: ``True`` se tiver sido adquirido por alguma " +"Retorna o status da trava: ``True`` se tiver sido adquirida por alguma " "thread, ``False`` se não for o caso." #: ../../library/_thread.rst:199 @@ -326,8 +341,8 @@ msgid "" "In addition to these methods, lock objects can also be used via the :keyword:" "`with` statement, e.g.::" msgstr "" -"Além desses métodos, os objetos de bloqueio também podem ser usados através " -"da instrução :keyword:`with`, por exemplo::" +"Além desses métodos, os objetos de trava também podem ser usados através da " +"instrução :keyword:`with`, por exemplo::" #: ../../library/_thread.rst:209 msgid "**Caveats:**" @@ -358,6 +373,9 @@ msgid "" "on a lock --- the :exc:`KeyboardInterrupt` exception will happen after the " "lock has been acquired." msgstr "" +"Não é possível interromper o método :meth:`~threading.Lock.acquire` em uma " +"trava --- a exceção :exc:`KeyboardInterrupt` ocorrerá após a trava ter sido " +"adquirida." #: ../../library/_thread.rst:224 msgid "" @@ -382,19 +400,19 @@ msgstr "" #: ../../library/_thread.rst:7 msgid "light-weight processes" -msgstr "" +msgstr "processos leves" #: ../../library/_thread.rst:7 msgid "processes, light-weight" -msgstr "" +msgstr "leves, processos" #: ../../library/_thread.rst:7 msgid "binary semaphores" -msgstr "" +msgstr "semáforos binários" #: ../../library/_thread.rst:7 msgid "semaphores, binary" -msgstr "" +msgstr "binários, semáforos" #: ../../library/_thread.rst:22 msgid "pthreads" diff --git a/library/abc.po b/library/abc.po index 072eb4698..895ddddb4 100644 --- a/library/abc.po +++ b/library/abc.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/aifc.po b/library/aifc.po index 8e0c429ef..05180eb48 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/allos.po b/library/allos.po index 6a9929025..8bdda5bd1 100644 --- a/library/allos.po +++ b/library/allos.po @@ -17,10 +17,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/archiving.po b/library/archiving.po index fe92199e2..e12e229e1 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/argparse.po b/library/argparse.po index e8a77e307..33a88aff3 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -37,6 +37,8 @@ msgid "" ":mod:`!argparse` --- Parser for command-line options, arguments and sub-" "commands" msgstr "" +":mod:`!argparse` --- Analisador sintático para opções de linha de comando, " +"argumentos e subcomandos" #: ../../library/argparse.rst:12 msgid "**Source code:** :source:`Lib/argparse.py`" @@ -65,10 +67,16 @@ msgid "" "The module will also issue errors when users give the program invalid " "arguments." msgstr "" +"O módulo :mod:`argparse` torna fácil a escrita de interfaces de linha de " +"comando amigáveis. O programa define quais argumentos são necessários e :mod:" +"`argparse` descobrirá como analisá-lo e interpretá-los a partir do :data:" +"`sys.argv`. O módulo :mod:`argparse` também gera automaticamente o texto " +"ajuda e mensagens de uso. O módulo também vai emitir erros quando o usuário " +"prover argumentos inválidos para o programa." #: ../../library/argparse.rst:30 msgid "Core Functionality" -msgstr "" +msgstr "Funcionalidade central" #: ../../library/argparse.rst:32 msgid "" @@ -77,6 +85,10 @@ msgid "" "for argument specifications and has options that apply to the parser as " "whole::" msgstr "" +"O suporte do módulo :mod:`argparse` para interfaces de linha de comando é " +"construído em torno de uma instância de :class:`argparse.ArgumentParser`. É " +"um contêiner para especificações de argumentos e possui opções que se " +"aplicam ao analisador sintático como um todo::" #: ../../library/argparse.rst:41 msgid "" @@ -84,16 +96,21 @@ msgid "" "specifications to the parser. It supports positional arguments, options " "that accept values, and on/off flags::" msgstr "" +"O método :meth:`ArgumentParser.add_argument` anexa especificações de " +"argumentos individuais ao analisador. Ele oferece suporte a argumentos " +"posicionais, opções que aceitam valores e sinalizadores liga/desliga::" #: ../../library/argparse.rst:50 msgid "" "The :meth:`ArgumentParser.parse_args` method runs the parser and places the " "extracted data in a :class:`argparse.Namespace` object::" msgstr "" +"O método :meth:`ArgumentParser.parse_args` executa o analisador e coloca os " +"dados extraídos em um objeto :class:`argparse.Namespace`::" #: ../../library/argparse.rst:58 msgid "Quick Links for add_argument()" -msgstr "" +msgstr "Links rápidos para add_argument()" #: ../../library/argparse.rst:61 msgid "Name" @@ -113,13 +130,15 @@ msgstr "action_" #: ../../library/argparse.rst:63 msgid "Specify how an argument should be handled" -msgstr "" +msgstr "Especifica como um argumento deve ser tratado" #: ../../library/argparse.rst:63 msgid "" "``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " "``'append_const'``, ``'count'``, ``'help'``, ``'version'``" msgstr "" +"``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " +"``'append_const'``, ``'count'``, ``'help'``, ``'version'``" #: ../../library/argparse.rst:64 msgid "choices_" @@ -127,13 +146,15 @@ msgstr "choices_" #: ../../library/argparse.rst:64 msgid "Limit values to a specific set of choices" -msgstr "" +msgstr "Limita valores a um conjunto específico de opções" #: ../../library/argparse.rst:64 msgid "" "``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` " "instance" msgstr "" +"``['foo', 'bar']``, ``range(1, 10)`` ou instância :class:`~collections.abc." +"Container`" #: ../../library/argparse.rst:65 msgid "const_" @@ -141,7 +162,7 @@ msgstr "const_" #: ../../library/argparse.rst:65 msgid "Store a constant value" -msgstr "" +msgstr "Armazena um valor constante" #: ../../library/argparse.rst:66 msgid "default_" @@ -149,11 +170,11 @@ msgstr "default_" #: ../../library/argparse.rst:66 msgid "Default value used when an argument is not provided" -msgstr "" +msgstr "Valor padrão usado quando um argumento não é fornecido" #: ../../library/argparse.rst:66 msgid "Defaults to ``None``" -msgstr "" +msgstr "O padrão é ``None``" #: ../../library/argparse.rst:67 msgid "dest_" @@ -161,7 +182,7 @@ msgstr "dest_" #: ../../library/argparse.rst:67 msgid "Specify the attribute name used in the result namespace" -msgstr "" +msgstr "Especifica o nome do atributo usado no espaço de nomes de resultado" #: ../../library/argparse.rst:68 msgid "help_" @@ -178,6 +199,7 @@ msgstr "metavar_" #: ../../library/argparse.rst:69 msgid "Alternate display name for the argument as shown in help" msgstr "" +"Nome de exibição alternativo para o argumento conforme mostrado na ajuda" #: ../../library/argparse.rst:70 msgid "nargs_" @@ -185,7 +207,7 @@ msgstr "nargs_" #: ../../library/argparse.rst:70 msgid "Number of times the argument can be used" -msgstr "" +msgstr "Número de vezes que o argumento pode ser usado" #: ../../library/argparse.rst:70 msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" @@ -197,7 +219,7 @@ msgstr "required_" #: ../../library/argparse.rst:71 msgid "Indicate whether an argument is required or optional" -msgstr "" +msgstr "Indica se um argumento é obrigatório ou opcional" #: ../../library/argparse.rst:71 msgid "``True`` or ``False``" @@ -209,13 +231,15 @@ msgstr ":ref:`type `" #: ../../library/argparse.rst:72 msgid "Automatically convert an argument to the given type" -msgstr "" +msgstr "Converte automaticamente um argumento para o tipo fornecido" #: ../../library/argparse.rst:72 msgid "" ":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable " "function" msgstr "" +":class:`int`, :class:`float`, ``argparse.FileType('w')`` ou uma função " +"chamável" #: ../../library/argparse.rst:77 msgid "Example" @@ -234,6 +258,9 @@ msgid "" "Assuming the above Python code is saved into a file called ``prog.py``, it " "can be run at the command line and it provides useful help messages:" msgstr "" +"Presumindo que o código Python acima seja salvo em um arquivo chamado ``prog." +"py``, ele pode ser executado pela linha de comando e fornece mensagens de " +"ajuda úteis:" #: ../../library/argparse.rst:111 msgid "" @@ -245,7 +272,7 @@ msgstr "" #: ../../library/argparse.rst:122 msgid "If invalid arguments are passed in, an error will be displayed:" -msgstr "" +msgstr "Se argumentos inválidos forem passados, um erro será exibido:" #: ../../library/argparse.rst:130 msgid "The following sections walk you through this example." @@ -299,6 +326,11 @@ msgid "" "will be either the :func:`sum` function, if ``--sum`` was specified at the " "command line, or the :func:`max` function if it was not." msgstr "" +"Em seguida, a chamada ao método :meth:`~ArgumentParser.parse_args` irá " +"retornar um objeto com dois atributos, ``integers`` e ``accumulate``. O " +"atributo ``integers`` será uma lista com um ou mais números inteiros, e o " +"atributo ``accumulate`` será ou a função :func:`sum`, se ``--sum`` for " +"especificado na linha de comando, ou a função :func:`max`, caso contrário." #: ../../library/argparse.rst:168 msgid "Parsing arguments" @@ -360,10 +392,14 @@ msgstr "" msgid "" "description_ - Text to display before the argument help (by default, no text)" msgstr "" +"description_ - Texto para exibir antes da ajuda dos argumentos (por padrão, " +"nenhum texto)" #: ../../library/argparse.rst:207 msgid "epilog_ - Text to display after the argument help (by default, no text)" msgstr "" +"epilog_ - Texto para exibir após da ajuda dos argumentos (por padrão, nenhum " +"texto)" #: ../../library/argparse.rst:209 msgid "" @@ -721,6 +757,12 @@ msgid "" "of the specified characters will be treated as files, and will be replaced " "by the arguments they contain. For example::" msgstr "" +"Às vezes ao lidar com uma lista de argumentos particularmente longa, pode " +"fazer sentido manter a lista de argumentos em um arquivo em vez de digitá-la " +"na linha de comando. Se o argumento ``fromfile_prefix_chars=`` for dado ao " +"construtor :class:`ArgumentParser`, então os argumentos que começam com " +"qualquer um dos caracteres especificados serão tratados como arquivos e " +"serão substituídos pelos argumentos que eles contêm. Por exemplo::" #: ../../library/argparse.rst:574 msgid "" @@ -743,6 +785,8 @@ msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." msgstr "" +":class:`ArgumentParser` usa :term:`tratador de erros e codificação do " +"sistema de arquivos` para ler o arquivo que contém argumentos." #: ../../library/argparse.rst:583 msgid "" @@ -761,6 +805,12 @@ msgid "" "error handler`. Arguments file should be encoded in UTF-8 instead of ANSI " "Codepage on Windows." msgstr "" +":class:`ArgumentParser` alterou a codificação e os erros para ler arquivos " +"de argumentos do padrão (por exemplo, :func:`locale." +"getpreferredencoding(False) ` e ``\"strict\"``) " +"para :term:`tratador de erros e codificação do sistema de arquivos`. O " +"arquivo de argumentos deve ser codificado em UTF-8 em vez de página de " +"código ANSI no Windows." #: ../../library/argparse.rst:594 msgid "argument_default" @@ -930,7 +980,7 @@ msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` " "or ``-f, --foo``." msgstr "" -"`name or flags`_ - Um nome ou uma lista de strings de opções, por exemplo. " +"`name ou flags`_ - Um nome ou uma lista de strings de opções, por exemplo. " "``foo`` ou ``-f, --foo``." #: ../../library/argparse.rst:756 @@ -969,7 +1019,7 @@ msgstr "" #: ../../library/argparse.rst:768 msgid "choices_ - A sequence of the allowable values for the argument." -msgstr "" +msgstr "choices_ - Uma sequência dos valores permitidos para o argumento." #: ../../library/argparse.rst:770 msgid "" @@ -1007,10 +1057,15 @@ msgid "" "`~ArgumentParser.add_argument` must therefore be either a series of flags, " "or a simple argument name." msgstr "" +"O método :meth:`~ArgumentParser.add_argument` deve saber se um argumento " +"opcional, como ``-f`` ou ``--foo``, ou um argumento posicional, como uma " +"lista de nomes de arquivos, é esperado. Os primeiros argumentos passados ​​" +"para :meth:`~ArgumentParser.add_argument` devem, portanto, ser uma série de " +"sinalizadores ou um simples nome de argumento." #: ../../library/argparse.rst:794 msgid "For example, an optional argument could be created like::" -msgstr "" +msgstr "Por exemplo, um argumento opcional poderia ser criado como::" #: ../../library/argparse.rst:798 msgid "while a positional argument could be created like::" @@ -1028,7 +1083,7 @@ msgstr "" #: ../../library/argparse.rst:821 msgid "action" -msgstr "action" +msgstr "ação" #: ../../library/argparse.rst:823 msgid "" @@ -1062,6 +1117,10 @@ msgid "" "``'store_const'`` action is most commonly used with optional arguments that " "specify some sort of flag. For example::" msgstr "" +"``'store_const'`` - Isso armazena o valor especificado pelo argumento " +"nomeado const_; observe que o argumento nomeado const_ tem como padrão " +"``None``. A ação ``'store_const'`` é mais comumente usada com argumentos " +"opcionais que especificam algum tipo de sinalizador. Por exemplo::" #: ../../library/argparse.rst:847 msgid "" @@ -1083,6 +1142,11 @@ msgid "" "parsed value for the option, with any values from the command line appended " "after those default values. Example usage::" msgstr "" +"``'append'`` - Isso armazena uma lista e anexa cada valor de argumento à " +"lista. É útil permitir que uma opção seja especificada várias vezes. Se o " +"valor padrão não estiver vazio, os elementos padrão estarão presentes no " +"valor analisado da opção, com quaisquer valores da linha de comando anexados " +"após esses valores padrão. Exemplo de uso::" #: ../../library/argparse.rst:870 msgid "" @@ -1092,6 +1156,11 @@ msgid "" "useful when multiple arguments need to store constants to the same list. For " "example::" msgstr "" +"``'append_const'`` - Isso armazena uma lista e anexa o valor especificado " +"pelo argumento nomeado const_ à lista; observe que o argumento nomeado " +"const_ tem como padrão ``None``. A ação ``'append_const'`` é normalmente " +"útil quando vários argumentos precisam armazenar constantes na mesma lista. " +"Por exemplo::" #: ../../library/argparse.rst:882 msgid "" @@ -1178,6 +1247,11 @@ msgid "" "different number of command-line arguments with a single action. See also :" "ref:`specifying-ambiguous-arguments`. The supported values are:" msgstr "" +"Os objetos ArgumentParser geralmente associam um único argumento de linha de " +"comando a uma única ação a ser executada. O argumento nomeado ``nargs`` " +"associa um número diferente de argumentos de linha de comando com uma única " +"ação. Veja também :ref:`specifying-ambiguous-arguments`. Os valores " +"suportados são:" #: ../../library/argparse.rst:968 msgid "" @@ -1279,6 +1353,12 @@ msgid "" "``const`` is not provided to :meth:`~ArgumentParser.add_argument`, it will " "receive a default value of ``None``." msgstr "" +"Quando :meth:`~ArgumentParser.add_argument` é chamado com " +"``action='store_const'`` ou ``action='append_const'``. Essas ações adicionam " +"o valor ``const`` a um dos atributos do objeto retornado por :meth:" +"`~ArgumentParser.parse_args`. Consulte a descrição da action_ para obter " +"exemplos. Se ``const`` não for fornecido :meth:`~ArgumentParser." +"add_argument`, será recebido um valor padrão de ``None``." #: ../../library/argparse.rst:1064 msgid "" @@ -1289,12 +1369,20 @@ msgid "" "command-line argument following it, the value of ``const`` will be assumed " "to be ``None`` instead. See the nargs_ description for examples." msgstr "" +"Quando :meth:`~ArgumentParser.add_argument` é chamado com strings de opções " +"(como ``-f`` ou ``--foo``) e ``nargs='?'``. Isso cria um argumento opcional " +"que pode ser seguido por zero ou um argumento de linha de comando. Ao " +"analisar a linha de comando, se a string de opções for encontrada sem nenhum " +"argumento de linha de comando seguindo, o valor de ``const`` será presumido " +"como sendo ``None``. Veja a descrição de nargs_ para exemplos." #: ../../library/argparse.rst:1071 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" +"``const=None`` por padrão, incluindo quando ``action='append_const'`` ou " +"``action='store_const'``." #: ../../library/argparse.rst:1078 msgid "default" @@ -1342,12 +1430,17 @@ msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" +"Para argumentos posicionais com nargs_ igual a ``?`` ou ``*``, o valor " +"``default`` é usado quando nenhum argumento de linha de comando estava " +"presente::" #: ../../library/argparse.rst:1124 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" +"Fornecer ``default=argparse.SUPPRESS`` faz com que nenhum atributo seja " +"adicionado se o argumento da linha de comando não estiver presente::" #: ../../library/argparse.rst:1138 msgid "type" @@ -1361,12 +1454,20 @@ msgid "" "keyword for :meth:`~ArgumentParser.add_argument` allows any necessary type-" "checking and type conversions to be performed." msgstr "" +"Por padrão, o analisador sintático lê argumentos de linha de comando como " +"strings simples. No entanto, muitas vezes a string da linha de comando deve " +"ser interpretada como outro tipo, como :class:`float` ou :class:`int`. O " +"argumento nomeado ``type`` para :meth:`~ArgumentParser.add_argument` permite " +"que qualquer verificação de tipo e conversões de tipo necessárias sejam " +"realizadas." #: ../../library/argparse.rst:1146 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" +"Se o argumento nomeado type_ for usado com default_, o conversor de tipo só " +"será aplicado se o padrão for uma string." #: ../../library/argparse.rst:1149 msgid "" @@ -1375,14 +1476,19 @@ msgid "" "`ValueError`, the exception is caught and a nicely formatted error message " "is displayed. No other exception types are handled." msgstr "" +"O argumento para ``type`` pode ser qualquer chamável que aceite uma única " +"string. Se a função levantar :exc:`ArgumentTypeError`, :exc:`TypeError` ou :" +"exc:`ValueError`, a exceção será capturada e uma mensagem de erro bem " +"formatada será exibida. Nenhum outro tipo de exceção é tratado." #: ../../library/argparse.rst:1154 msgid "Common built-in types and functions can be used as type converters:" msgstr "" +"Tipos e funções embutidas comuns podem ser usados ​​como conversores de tipo:" #: ../../library/argparse.rst:1170 msgid "User defined functions can be used as well:" -msgstr "" +msgstr "Funções definidas pelo usuário também podem ser usadas:" #: ../../library/argparse.rst:1182 msgid "" @@ -1390,6 +1496,9 @@ msgid "" "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" +"A função :func:`bool` não é recomendada como conversor de tipo. Tudo o que " +"ele faz é converter strings vazias em ``False`` e strings não vazias em " +"``True``. Geralmente não é isso que se deseja." #: ../../library/argparse.rst:1186 msgid "" @@ -1398,6 +1507,11 @@ msgid "" "exceptions. Anything with more interesting error-handling or resource " "management should be done downstream after the arguments are parsed." msgstr "" +"Em geral, o argumento nomeado ``type`` é uma conveniência que só deve ser " +"usada para conversões simples que só podem gerar uma das três exceções " +"suportadas. Qualquer coisa com tratamento de erros ou gerenciamento de " +"recursos mais interessante deve ser feita posteriormente, após a análise dos " +"argumentos." #: ../../library/argparse.rst:1191 msgid "" @@ -1406,6 +1520,10 @@ msgid "" "JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` " "exception would not be handled at all." msgstr "" +"Por exemplo, conversões JSON ou YAML têm casos de erros complexos que exigem " +"relatórios melhores do que os fornecidos pelo argumento nomeado ``type``. " +"Um :exc:`~json.JSONDecodeError` não seria bem formatado e uma exceção :exc:" +"`FileNotFoundError` não seria tratada." #: ../../library/argparse.rst:1196 msgid "" @@ -1415,12 +1533,20 @@ msgid "" "closed. In this case, it would be better to wait until after the parser has " "run and then use the :keyword:`with`-statement to manage the files." msgstr "" +"Mesmo :class:`~argparse.FileType` tem suas limitações para uso com o " +"argumento nomeado ``type``. Se um argumento usar *FileType* e um argumento " +"subsequente falhar, um erro será relatado, mas o arquivo não será fechado " +"automaticamente. Neste caso, seria melhor esperar até que o analisador tenha " +"sido executado e então usar a instrução :keyword:`with` para gerenciar os " +"arquivos." #: ../../library/argparse.rst:1202 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" +"Para verificadores de tipo que simplesmente verificam um conjunto fixo de " +"valores, considere usar o argumento nomeado choices_." #: ../../library/argparse.rst:1209 msgid "choices" @@ -1434,6 +1560,12 @@ msgid "" "line is parsed, argument values will be checked, and an error message will " "be displayed if the argument was not one of the acceptable values::" msgstr "" +"Alguns argumentos de linha de comando devem ser selecionados em um conjunto " +"restrito de valores. Eles podem ser tratados passando um objeto sequência " +"como o argumento nomeado *choices* para :meth:`~ArgumentParser." +"add_argument`. Quando a linha de comando for analisada, os valores dos " +"argumentos serão verificados e uma mensagem de erro será exibida se o " +"argumento não for um dos valores aceitáveis::" #: ../../library/argparse.rst:1226 msgid "" @@ -1441,18 +1573,26 @@ msgid "" "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified::" msgstr "" +"Observe que a inclusão na sequência *choices* é verificada após qualquer " +"conversão de type_ ter sido realizada, portanto o tipo dos objetos na " +"sequência *choices* deve corresponder ao type_ especificado::" #: ../../library/argparse.rst:1238 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" +"Qualquer sequência pode ser passada como o valor *choices*, portanto " +"objetos :class:`list`, objetos :class:`tuple` e sequências personalizadas " +"são todos suportados." #: ../../library/argparse.rst:1241 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" +"O uso de :class:`enum.Enum` não é recomendado porque é difícil controlar sua " +"aparência no uso, na ajuda e nas mensagens de erro." #: ../../library/argparse.rst:1244 msgid "" @@ -1461,6 +1601,10 @@ msgid "" "*dest* parameter. If this display isn't desirable (perhaps because there " "are many choices), just specify an explicit metavar_." msgstr "" +"As opções formatadas substituem o *metavar* padrão que normalmente é " +"derivado de *dest*. Geralmente é isso que você deseja porque o usuário nunca " +"vê o parâmetro *dest*. Se esta exibição não for desejável (talvez porque " +"haja muitas opções), basta especificar um metavar_ explícito." #: ../../library/argparse.rst:1253 msgid "required" @@ -1473,6 +1617,11 @@ msgid "" "command line. To make an option *required*, ``True`` can be specified for " "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" +"Em geral, o módulo :mod:`argparse` presume que sinalizadores como ``-f`` e " +"``--bar`` indicam argumentos *opcionais*, que sempre podem ser omitidos na " +"linha de comando. Para tornar uma opção obrigatória, ``True`` pode ser " +"especificado para o argumento nomeado ``required=`` para :meth:" +"`~ArgumentParser.add_argument`::" #: ../../library/argparse.rst:1268 msgid "" @@ -1480,12 +1629,18 @@ msgid "" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" +"Como mostra o exemplo, se uma opção estiver marcada como ``required``, :meth:" +"`~ArgumentParser.parse_args` reportará um erro se essa opção não estiver " +"presente na linha de comando." #: ../../library/argparse.rst:1274 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" +"As opções obrigatórias são geralmente consideradas inadequadas porque os " +"usuários esperam que as *opções* sejam *opcionais* e, portanto, devem ser " +"evitadas quando possível." #: ../../library/argparse.rst:1281 msgid "help" @@ -1498,6 +1653,10 @@ msgid "" "at the command line), these ``help`` descriptions will be displayed with " "each argument::" msgstr "" +"O valor ``help`` é uma string contendo uma breve descrição do argumento. " +"Quando um usuário solicita ajuda (geralmente usando ``-h`` ou ``--help`` na " +"linha de comando), estas descrições de ``help`` serão exibidas com cada " +"argumento::" #: ../../library/argparse.rst:1303 msgid "" @@ -1507,18 +1666,28 @@ msgid "" "arguments to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, " "``%(type)s``, etc.::" msgstr "" +"As strings ``help`` podem incluir vários especificadores de formato para " +"evitar a repetição de coisas como o nome do programa ou o argumento " +"default_. Os especificadores disponíveis incluem o nome do programa, " +"``%(prog)s`` e a maioria dos argumentos nomeados para :meth:`~ArgumentParser." +"add_argument`, por exemplo. ``%(default)s``, ``%(type)s``, etc.::" #: ../../library/argparse.rst:1320 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" +"Como a string de ajuda oferece suporte à formatação com %, se você quiser " +"que um literal ``%`` apareça na string de ajuda, você deve escapá-lo como ``%" +"%``." #: ../../library/argparse.rst:1323 msgid "" ":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" +":mod:`argparse` oferece suporte a silenciar a entrada de ajuda para certas " +"opções, definindo o valor ``help`` como ``argparse.SUPPRESS``::" #: ../../library/argparse.rst:1338 msgid "metavar" @@ -1535,10 +1704,19 @@ msgid "" "optional argument ``--foo`` that should be followed by a single command-line " "argument will be referred to as ``FOO``. An example::" msgstr "" +"Quando :class:`ArgumentParser` gera mensagens de ajuda, ele precisa de " +"alguma forma de se referir a cada argumento esperado. Por padrão, os objetos " +"ArgumentParser usam o valor dest_ como o \"nome\" de cada objeto. Por " +"padrão, para ações de argumentos posicionais, o valor dest_ é usado " +"diretamente, e para ações de argumentos opcionais, o valor dest_ é " +"maiúsculo. Portanto, um único argumento posicional com ``dest='bar'`` será " +"referido como ``bar``. Um único argumento opcional ``--foo`` que deve ser " +"seguido por um único argumento de linha de comando será referido como " +"``FOO``. Um exemplo::" #: ../../library/argparse.rst:1364 msgid "An alternative name can be specified with ``metavar``::" -msgstr "" +msgstr "Um nome alternativo pode ser especificado com ``metavar``::" #: ../../library/argparse.rst:1381 msgid "" @@ -1546,6 +1724,9 @@ msgid "" "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" +"Observe que ``metavar`` apenas altera o nome *exibido* - o nome do atributo " +"no objeto :meth:`~ArgumentParser.parse_args` ainda é determinado pelo valor " +"dest_." #: ../../library/argparse.rst:1385 msgid "" @@ -1553,6 +1734,9 @@ msgid "" "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" +"Valores diferentes de ``nargs`` podem fazer com que o metavar seja usado " +"múltiplas vezes. Fornecer uma tupla para ``metavar`` especifica uma exibição " +"diferente para cada um dos argumentos::" #: ../../library/argparse.rst:1404 msgid "dest" @@ -1567,6 +1751,12 @@ msgid "" "is normally supplied as the first argument to :meth:`~ArgumentParser." "add_argument`::" msgstr "" +"A maioria das ações :class:`ArgumentParser` adiciona algum valor como um " +"atributo do objeto retornado por :meth:`~ArgumentParser.parse_args`. O nome " +"deste atributo é determinado pelo argumento nomeado ``dest`` de :meth:" +"`~ArgumentParser.add_argument`. Para ações de argumento posicional, ``dest`` " +"é normalmente fornecido como o primeiro argumento para :meth:" +"`~ArgumentParser.add_argument`::" #: ../../library/argparse.rst:1418 msgid "" @@ -1579,14 +1769,23 @@ msgid "" "characters to make sure the string is a valid attribute name. The examples " "below illustrate this behavior::" msgstr "" +"Para ações de argumentos opcionais, o valor de ``dest`` é normalmente " +"inferido das strings de opções. :class:`ArgumentParser` gera o valor de " +"``dest`` pegando a primeira string de opção longa e removendo a string " +"inicial ``--``. Se nenhuma string de opção longa for fornecida, ``dest`` " +"será derivado da primeira string de opção curta removendo o caractere ``-`` " +"inicial. Quaisquer caracteres ``-`` internos serão convertidos em " +"caracteres ``_`` para garantir que a string seja um nome de atributo válido. " +"Os exemplos abaixo ilustram esse comportamento:" #: ../../library/argparse.rst:1435 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" +"``dest`` permite que um nome de atributo personalizado seja fornecido::" #: ../../library/argparse.rst:1443 msgid "Action classes" -msgstr "" +msgstr "Classes de ação" #: ../../library/argparse.rst:1445 msgid "" @@ -1595,6 +1794,10 @@ msgid "" "this API may be passed as the ``action`` parameter to :meth:`~ArgumentParser." "add_argument`." msgstr "" +"As classes de ação implementam a API de Action, um chamável que retorna um " +"chamável que processa argumentos da linha de comando. Qualquer objeto que " +"siga esta API pode ser passado como parâmetro ``action`` para :meth:" +"`~ArgumentParser.add_argument`." #: ../../library/argparse.rst:1454 msgid "" diff --git a/library/array.po b/library/array.po index 316d22e2c..1566eb0e4 100644 --- a/library/array.po +++ b/library/array.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Bonifacio de Oliveira , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/array.rst:2 msgid ":mod:`!array` --- Efficient arrays of numeric values" -msgstr "" +msgstr ":mod:`!array`--- Vetores eficientes de valores numéricos" #: ../../library/array.rst:11 msgid "" @@ -199,7 +199,7 @@ msgstr "``'f'``" #: ../../library/array.rst:43 ../../library/array.rst:45 msgid "float" -msgstr "float" +msgstr "ponto flutuante" #: ../../library/array.rst:45 msgid "``'d'``" @@ -281,7 +281,7 @@ msgid "" "Raises an :ref:`auditing event ` ``array.__new__`` with arguments " "``typecode``, ``initializer``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``array.__new__`` com " +"Levanta um :ref:`evento de auditoria ` ``array.__new__`` com os " "argumentos ``typecode``, ``initializer``." #: ../../library/array.rst:101 diff --git a/library/ast.po b/library/ast.po index f20636210..e3d4caa5e 100644 --- a/library/ast.po +++ b/library/ast.po @@ -21,16 +21,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/ast.rst:2 msgid ":mod:`!ast` --- Abstract Syntax Trees" -msgstr "" +msgstr ":mod:`!ast` --- Árvores de Sintaxe Abstrata" #: ../../library/ast.rst:14 msgid "**Source code:** :source:`Lib/ast.py`" @@ -434,7 +434,7 @@ msgid "" "be expanded goes in the ``values`` list, with a ``None`` at the " "corresponding position in ``keys``." msgstr "" -"Ao descompactar o dicionário usando literais de dicionário, a expressão a " +"Ao desempacotar o dicionário usando literais de dicionário, a expressão a " "ser expandida vai para a lista ``values``, com um ``None`` na posição " "correspondente em ``keys``." @@ -700,7 +700,7 @@ msgid "" "``targets``." msgstr "" "Vários nós em ``targets`` representam a atribuição do mesmo valor a cada um. " -"A descompactação é representada colocando uma :class:`Tuple` ou :class:" +"O desempacotamento é representada colocando uma :class:`Tuple` ou :class:" "`List` dentro de ``targets``." #: ../../library/ast.rst:853 ../../library/ast.rst:1161 @@ -1023,6 +1023,10 @@ msgid "" "sequence elements is bound to that name if the overall sequence pattern is " "successful." msgstr "" +"Corresponde ao restante da sequência em um padrão de sequência de " +"correspondência de comprimento variável. Se ``name`` não for ``None``, uma " +"lista contendo os elementos restantes da sequência será vinculada a esse " +"nome se o padrão de sequência geral for bem-sucedido." #: ../../library/ast.rst:1601 msgid "" @@ -1032,6 +1036,11 @@ msgid "" "elements. Permitted key expressions are restricted as described in the match " "statement documentation." msgstr "" +"Um padrão de mapeamento de correspondência. ``keys`` é uma sequência de nós " +"de expressão. ``patterns`` é uma sequência correspondente de nós padrão. " +"``rest`` é um nome opcional que pode ser especificado para capturar os " +"elementos restantes do mapeamento. As expressões-chave permitidas são " +"restritas conforme descrito na documentação da instrução match." #: ../../library/ast.rst:1607 msgid "" @@ -1041,6 +1050,12 @@ msgid "" "dict containing the remaining mapping elements is bound to that name if the " "overall mapping pattern is successful." msgstr "" +"Este padrão será bem-sucedido se o assunto for um mapeamento, todas as " +"expressões-chave avaliadas estiverem presentes no mapeamento e o valor " +"correspondente a cada chave corresponder ao subpadrão correspondente. Se " +"``rest`` não for ``None``, um dict contendo os elementos de mapeamento " +"restantes será vinculado a esse nome se o padrão de mapeamento geral for bem-" +"sucedido." #: ../../library/ast.rst:1649 msgid "" @@ -1052,6 +1067,13 @@ msgid "" "the corresponding patterns (specified as keyword values in the class " "pattern)." msgstr "" +"Um padrão de classe de correspondência. ``cls`` é uma expressão que fornece " +"a classe nominal a ser correspondida. ``patterns`` é uma sequência de nós " +"padrão a serem comparados com a sequência definida pela classe de atributos " +"de correspondência de padrões. ``kwd_attrs`` é uma sequência de atributos " +"adicionais a serem correspondidos (especificados como argumentos nomeados no " +"padrão de classe), ``kwd_patterns`` são os padrões correspondentes " +"(especificados como valores de argumentos nomeados no padrão de classe)." #: ../../library/ast.rst:1656 msgid "" @@ -1059,6 +1081,11 @@ msgid "" "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" +"Esse padrão será bem-sucedido se o assunto for uma instância da classe " +"indicada, todos os padrões posicionais corresponderem aos atributos " +"correspondentes definidos pela classe e quaisquer atributos, passados como " +"argumentos nomeados, especificados corresponderem ao seu padrão " +"correspondente." #: ../../library/ast.rst:1660 msgid "" @@ -1066,6 +1093,10 @@ msgid "" "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" +"Nota: as classes podem definir uma propriedade que retorna self para " +"corresponder um nó padrão à instância que está sendo correspondida. Vários " +"tipos internos também são combinados dessa forma, conforme descrito na " +"documentação da instrução match." #: ../../library/ast.rst:1715 msgid "" @@ -1074,6 +1105,10 @@ msgid "" "pattern is ``None``, the node represents a capture pattern (i.e a bare name) " "and will always succeed." msgstr "" +"Uma correspondência \"como padrão\", padrão de captura ou padrão curinga. " +"``pattern`` contém o padrão de correspondência com o qual o assunto será " +"comparado. Se o padrão for ``None``, o nó representa um padrão de captura " +"(ou seja, um nome simples) e sempre terá sucesso." #: ../../library/ast.rst:1720 msgid "" @@ -1081,6 +1116,9 @@ msgid "" "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" +"O atributo ``name`` contém o nome que será vinculado se o padrão for bem-" +"sucedido. Se ``name`` for ``None``, ``pattern`` também deverá ser ``None`` e " +"o nó representa o padrão curinga." #: ../../library/ast.rst:1758 msgid "" @@ -1090,6 +1128,11 @@ msgid "" "``patterns`` attribute contains a list of match pattern nodes that will be " "matched against the subject." msgstr "" +"Uma correspondência de \"padrão ou\". Um \"padrão ou\" corresponde cada um " +"de seus subpadrões com o assunto, até que um seja bem-sucedido. O \"padrão " +"ou\" é então considerado bem-sucedido. Se nenhum dos subpadrões for bem-" +"sucedido, o padrão or falhará. O atributo ``patterns`` contém uma lista de " +"nós de padrões de correspondência que serão comparados com o assunto." #: ../../library/ast.rst:1793 msgid "Type parameters" @@ -1100,6 +1143,8 @@ msgid "" ":ref:`Type parameters ` can exist on classes, functions, and " "type aliases." msgstr "" +":ref:`Parâmetros de tipo ` podem existir em classes, funções e " +"apelidos de tipo." #: ../../library/ast.rst:1800 msgid "" @@ -1130,7 +1175,7 @@ msgstr "Uma definição de função" #: ../../library/ast.rst:1881 msgid "``name`` is a raw string of the function name." -msgstr "" +msgstr "``name`` é uma string bruta do nome da função." #: ../../library/ast.rst:1882 msgid "``args`` is an :class:`arguments` node." @@ -1138,53 +1183,64 @@ msgstr "``args`` é um nó :class:`arguments`." #: ../../library/ast.rst:1883 msgid "``body`` is the list of nodes inside the function." -msgstr "" +msgstr "``body`` é a lista de nós dentro da função." #: ../../library/ast.rst:1884 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" +"``decorator_list`` é a lista de decoradores a serem aplicados, armazenados " +"primeiro na parte externa (ou seja, o primeiro da lista será aplicado por " +"último)." #: ../../library/ast.rst:1886 msgid "``returns`` is the return annotation." -msgstr "" +msgstr "``returns`` é a anotação de retorno." #: ../../library/ast.rst:1887 ../../library/ast.rst:2064 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "" +"``type_params`` é uma lista de :ref:`parâmetros de tipo `." #: ../../library/ast.rst:1893 ../../library/ast.rst:2093 #: ../../library/ast.rst:2104 msgid "Added ``type_params``." -msgstr "" +msgstr "Adicionado ``type_params``." #: ../../library/ast.rst:1899 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" +"``lambda`` é uma definição mínima de função que pode ser usada dentro de uma " +"expressão. Ao contrário de :class:`FunctionDef`, ``body`` contém um único nó." #: ../../library/ast.rst:1923 msgid "The arguments for a function." -msgstr "" +msgstr "Os argumentos para uma função." #: ../../library/ast.rst:1925 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" +"``posonlyargs``, ``args`` e ``kwonlyargs`` são listas de nós :class:`arg`." #: ../../library/ast.rst:1926 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" +"``vararg`` e ``kwarg`` são nós :class:`arg` únicos, referindo-se aos " +"parâmetros ``*args, **kwargs``." #: ../../library/ast.rst:1928 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" +"``kw_defaults`` é uma lista de valores padrão para argumentos somente-" +"nomeados. Se um for ``None``, o argumento correspondente é necessário." #: ../../library/ast.rst:1930 msgid "" @@ -1192,21 +1248,27 @@ msgid "" "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" +"``defaults`` é uma lista de valores padrão para argumentos que podem ser " +"passados ​​posicionalmente. Se houver menos padrões, eles corresponderão aos " +"últimos n argumentos." #: ../../library/ast.rst:1937 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name; " "``annotation`` is its annotation, such as a :class:`Name` node." msgstr "" +"Um único argumento em uma lista. ``arg`` é uma string bruta do nome do " +"argumento; ``annotation`` é sua anotação, como um nó :class:`Name`." #: ../../library/ast.rst:1942 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" +"``type_comment`` é uma string opcional com a anotação de tipo como comentário" #: ../../library/ast.rst:1987 msgid "A ``return`` statement." -msgstr "" +msgstr "Uma instrução ``return``." #: ../../library/ast.rst:2002 msgid "" @@ -1219,6 +1281,8 @@ msgstr "" msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" +"Instruções ``global`` e ``nonlocal``. ``names`` é uma lista de strings " +"brutas." #: ../../library/ast.rst:2054 msgid "A class definition." @@ -1226,11 +1290,12 @@ msgstr "Uma definição de classe" #: ../../library/ast.rst:2056 msgid "``name`` is a raw string for the class name" -msgstr "" +msgstr "``name`` é uma string bruta para o nome da classe" #: ../../library/ast.rst:2057 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" +"``bases`` é uma lista de nós para classes base especificadas explicitamente." #: ../../library/ast.rst:2058 msgid "" @@ -1238,16 +1303,21 @@ msgid "" "'metaclass'. Other keywords will be passed to the metaclass, as per " "`PEP-3115 `_." msgstr "" +"``keywords`` é uma lista de nós :class:`.keyword`, principalmente para " +"'metaclass'. Outras argumentos nomeados serão passadas para a metaclasse, " +"conforme `PEP-3115 `_." #: ../../library/ast.rst:2061 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" +"``body`` é uma lista de nós que representam o código dentro da definição de " +"classe." #: ../../library/ast.rst:2063 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." -msgstr "" +msgstr "``decorator_list`` é uma lista de nós, como em :class:`FunctionDef`." #: ../../library/ast.rst:2097 msgid "Async and await" @@ -1258,12 +1328,16 @@ msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" +"Uma definição de função ``async def``. Possui os mesmos campos que :class:" +"`FunctionDef`." #: ../../library/ast.rst:2110 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" +"Uma expressão ``await``. ``value`` é o que ela espera. Válido apenas no " +"corpo de um :class:`AsyncFunctionDef`." #: ../../library/ast.rst:2144 msgid "" @@ -1271,6 +1345,9 @@ msgid "" "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" +"Laços ``async for`` e gerenciadores de contexto ``async with``. Eles têm os " +"mesmos campos que :class:`For` e :class:`With`, respectivamente. Válido " +"apenas no corpo de :class:`AsyncFunctionDef`." #: ../../library/ast.rst:2149 msgid "" @@ -1280,6 +1357,11 @@ msgid "" "singletons. Changes to one will be reflected in all other occurrences of the " "same value (e.g. :class:`ast.Add`)." msgstr "" +"Quando uma string é analisada por :func:`ast.parse`, os nós operadores " +"(subclasses de :class:`ast.operator`, :class:`ast.unaryop`, :class:`ast." +"cmpop`, :class:`ast.boolop` e :class:`ast.expr_context`) na árvore retornada " +"serão singletons. As alterações em um serão refletidas em todas as outras " +"ocorrências do mesmo valor (por exemplo, :class:`ast.Add`)." #: ../../library/ast.rst:2157 msgid ":mod:`ast` Helpers" @@ -1351,6 +1433,7 @@ msgstr "" msgid "" "If source contains a null character (``\\0``), :exc:`ValueError` is raised." msgstr "" +"Se a fonte contém um caractere nulo (``\\0``), :exc:`ValueError` é levantada." #: ../../library/ast.rst:2194 msgid "" @@ -1361,12 +1444,20 @@ msgid "" "node for a return statement, but it cannot be compiled alone (it needs to be " "inside a function node)." msgstr "" +"Observe que a análise bem-sucedida do código-fonte em um objeto AST não " +"garante que o código-fonte fornecido seja um código Python válido que pode " +"ser executado, pois a etapa de compilação pode levantar mais exceções :exc:" +"`SyntaxError`. Por exemplo, a fonte ``return 42`` gera um nó AST válido para " +"uma instrução return, mas não pode ser compilado sozinho (precisa estar " +"dentro de um nó de função)." #: ../../library/ast.rst:2201 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" +"Em particular, :func:`ast.parse` não fará nenhuma verificação de escopo, o " +"que a etapa de compilação faz." #: ../../library/ast.rst:2205 msgid "" @@ -1388,6 +1479,9 @@ msgid "" "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" +"Desfaz análise de um objeto :class:`ast.AST` e gera uma string com código " +"que produziria um objeto :class:`ast.AST` equivalente se analisado novamente " +"com :func:`ast.parse`." #: ../../library/ast.rst:2220 msgid "" @@ -1395,12 +1489,17 @@ msgid "" "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" +"A string de código produzida não será necessariamente igual ao código " +"original que gerou o objeto :class:`ast.AST` (sem quaisquer otimizações do " +"compilador, como tuplas/frozensets constantes)." #: ../../library/ast.rst:2225 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" +"Tentar desfazer análise de uma expressão altamente complexa resultaria em :" +"exc:`RecursionError`." #: ../../library/ast.rst:2233 msgid "" @@ -1409,6 +1508,10 @@ msgid "" "following Python literal structures: strings, bytes, numbers, tuples, lists, " "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" +"Avalia um nó de expressão ou uma string contendo apenas um literal Python ou " +"uma exibição de contêiner. A string ou nó fornecido pode consistir apenas " +"nas seguintes estruturas literais Python: strings, bytes, números, tuplas, " +"listas, dicionários, conjuntos, booleanos, ``None`` e ``Ellipsis``." #: ../../library/ast.rst:2238 msgid "" @@ -1416,6 +1519,10 @@ msgid "" "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" +"Isso pode ser usado para avaliar strings contendo valores Python sem a " +"necessidade de analisar os valores por conta própria. Não é capaz de avaliar " +"expressões arbitrariamente complexas, por exemplo, envolvendo operadores ou " +"indexação." #: ../../library/ast.rst:2243 msgid "" @@ -1428,18 +1535,31 @@ msgid "" "excessive CPU consumption denial of service on some inputs. Calling it on " "untrusted data is thus not recommended." msgstr "" +"Esta função foi documentada como “segura” no passado sem definir o que isso " +"significava. Isso foi enganoso. Isso foi projetado especificamente para não " +"executar código Python, ao contrário do :func:`eval` mais geral. Não há " +"espaço de nomes, pesquisas de nome ou capacidade de chamada. Mas não está " +"livre de ataques: uma entrada relativamente pequena pode levar ao " +"esgotamento da memória ou ao esgotamento da pilha C, travando o processo. " +"Também existe a possibilidade de negação de serviço por consumo excessivo de " +"CPU em algumas entradas. Portanto, não é recomendado chamá-la em dados não " +"confiáveis." #: ../../library/ast.rst:2253 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" +"É possível travar o interpretador Python devido às limitações de " +"profundidade da pilha no compilador AST do Python." #: ../../library/ast.rst:2256 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" +"Pode levantar :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" +"`MemoryError` e :exc:`RecursionError` dependendo da entrada malformada." #: ../../library/ast.rst:2260 msgid "Now allows bytes and set literals." @@ -1447,11 +1567,13 @@ msgstr "Agora permite bytes e literais de conjuntos." #: ../../library/ast.rst:2263 msgid "Now supports creating empty sets with ``'set()'``." -msgstr "" +msgstr "Agora oferece suporte à criação de conjuntos vazios com ``'set()'``." #: ../../library/ast.rst:2266 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" +"Para entradas de string, os espaços iniciais e tabulações agora são " +"removidos." #: ../../library/ast.rst:2272 msgid "" @@ -1476,6 +1598,10 @@ msgid "" "attr:`~ast.AST.col_offset`, or :attr:`~ast.AST.end_col_offset`) is missing, " "return ``None``." msgstr "" +"Obtém o segmento de código-fonte do *source* que gerou o *node*. Se alguma " +"informação de localização (:attr:`~ast.AST.lineno`, :attr:`~ast.AST." +"end_lineno`, :attr:`~ast.AST.col_offset` ou :attr:`~ast.AST.end_col_offset`) " +"está faltando, retorna ``None``." #: ../../library/ast.rst:2288 msgid "" @@ -1494,6 +1620,12 @@ msgid "" "set, by setting them to the values of the parent node. It works recursively " "starting at *node*." msgstr "" +"Quando você compila uma árvore de nós com :func:`compile`, o compilador " +"espera atributos :attr:`~ast.AST.lineno` e :attr:`~ast.AST.col_offset` para " +"cada nó que os suporta. Isso é tedioso para preencher nós gerados, portanto, " +"esse auxiliar adiciona esses atributos recursivamente, onde ainda não estão " +"definidos, definindo-os para os valores do nó pai. Ele funciona " +"recursivamente a partir do *node*." #: ../../library/ast.rst:2305 msgid "" @@ -1511,6 +1643,9 @@ msgid "" "attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " "*old_node* to *new_node* if possible, and return *new_node*." msgstr "" +"Copia o local de origem (:attr:`~ast.AST.lineno`, :attr:`~ast.AST." +"col_offset`, :attr:`~ast.AST.end_lineno` e :attr:`~ast.AST.end_col_offset`) " +"de *old_node* para *new_node* se possível e, então, retorna *new_node*." #: ../../library/ast.rst:2319 msgid "" @@ -1582,7 +1717,7 @@ msgstr "" #: ../../library/ast.rst:2361 msgid "Handles all constant nodes." -msgstr "" +msgstr "Manipula todos os nós constantes." #: ../../library/ast.rst:2363 msgid "" @@ -1699,38 +1834,52 @@ msgid "" "many spaces per level. If *indent* is a string (such as ``\"\\t\"``), that " "string is used to indent each level." msgstr "" +"Se *indent* for um inteiro não negativo ou uma string, então a árvore terá " +"uma saída formatada com este nível de indentação. Um nível de indentação 0, " +"negativo ou ``\"\"`` apenas colocará novas linhas. ``None`` (o padrão) " +"seleciona a representação de uma única linha. Usando um inteiro positivo a " +"indentação terá alguns espaços por nível. Se *indent* for uma string (como " +"``\"\\t\"``), essa string será usada para indentar cada nível." #: ../../library/ast.rst:2436 msgid "Added the *indent* option." -msgstr "" +msgstr "Adicionada a opção *indent*." #: ../../library/ast.rst:2443 msgid "Compiler Flags" -msgstr "" +msgstr "Sinalizadores do compilador" #: ../../library/ast.rst:2445 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" +"Os seguintes sinalizadores podem ser passados para :func:`compile` para " +"alterar os efeitos na compilação de um programa:" #: ../../library/ast.rst:2450 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" +"Habilita suporte para ``await``, ``async for``, ``async with`` e " +"compreensões assíncronas de nível superior." #: ../../library/ast.rst:2457 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" +"Gera e retorna uma árvore de sintaxe abstrata em vez de retornar um objeto " +"de código compilado." #: ../../library/ast.rst:2462 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" +"Habilita suporte para comentários do tipo :pep:`484` e :pep:`526` (``# type: " +"``, ``# type: ignore ``)." #: ../../library/ast.rst:2471 msgid "Command-Line Usage" @@ -1741,6 +1890,8 @@ msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" +"O módulo :mod:`ast` pode ser executado como um script na linha de comando. É " +"tão simples quanto:" #: ../../library/ast.rst:2482 msgid "The following options are accepted:" @@ -1748,31 +1899,35 @@ msgstr "As seguintes opções são aceitas:" #: ../../library/ast.rst:2488 msgid "Show the help message and exit." -msgstr "" +msgstr "Mostra a mensagem de ajuda e saia." #: ../../library/ast.rst:2493 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" +"Especifica que tipo de código deve ser compilado, como o argumento *mode* " +"em :func:`parse`." #: ../../library/ast.rst:2498 msgid "Don't parse type comments." -msgstr "" +msgstr "Não analisa comentários de tipo." #: ../../library/ast.rst:2502 msgid "Include attributes such as line numbers and column offsets." -msgstr "" +msgstr "Inclui atributos como números de linha e deslocamentos de colunas." #: ../../library/ast.rst:2507 msgid "Indentation of nodes in AST (number of spaces)." -msgstr "" +msgstr "indentação de nós em AST (número de espaços)." #: ../../library/ast.rst:2509 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" +"Se :file:`infile` for especificado, seu conteúdo será analisado no AST e " +"despejado no stdout. Caso contrário, o conteúdo será lido em stdin." #: ../../library/ast.rst:2515 msgid "" @@ -1790,6 +1945,10 @@ msgid "" "code that generated them. This is helpful for tools that make source code " "transformations." msgstr "" +"`ASTTokens `_ " +"anota ASTs do Python com as posições de tokens e texto no código-fonte que " +"as gerou. Isso é útil para ferramentas que fazem transformações de código-" +"fonte." #: ../../library/ast.rst:2523 msgid "" @@ -1797,6 +1956,9 @@ msgid "" "py>`_ unifies the token-based and parse-tree-based views of python programs " "by inserting two-way links between tokens and ast nodes." msgstr "" +"`leoAst.py `_ unifica as visualizações baseadas em token e em árvore de análise de " +"programas python, inserindo links duas vias entre tokens e nós de ast." #: ../../library/ast.rst:2528 msgid "" @@ -1804,6 +1966,10 @@ msgid "" "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" +"`LibCST `_ analisa o código como uma árvore " +"de sintaxe concreta que se parece com uma árvore ast e mantém todos os " +"detalhes de formatação. É útil para construir linters e aplicações de " +"refatoração automatizada (codemod)." #: ../../library/ast.rst:2533 msgid "" @@ -1812,6 +1978,10 @@ msgid "" "multiple Python versions). Parso is also able to list multiple syntax errors " "in your Python file." msgstr "" +"`Parso `_ é um analisador Python que oferece " +"suporte a recuperação de erros e análise de ida e volta para diferentes " +"versões do Python (em várias versões do Python). Parso também é capaz de " +"listar vários erros de sintaxe em seu arquivo Python." #: ../../library/ast.rst:59 msgid "? (question mark)" @@ -1819,7 +1989,7 @@ msgstr "? (interrogação)" #: ../../library/ast.rst:59 ../../library/ast.rst:60 msgid "in AST grammar" -msgstr "" +msgstr "em gramática de AST" #: ../../library/ast.rst:60 msgid "* (asterisk)" diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index 0c45728a1..50bdd77be 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -25,10 +25,10 @@ msgstr "" "2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -397,7 +397,7 @@ msgstr ":class:`Lock`" #: ../../library/asyncio-api-index.rst:186 msgid "A mutex lock." -msgstr "Um bloqueio mutex." +msgstr "Uma trava mutex." #: ../../library/asyncio-api-index.rst:188 msgid ":class:`Event`" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index a0833b022..72f8fb685 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 2c0d89865..2c10f2f8a 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -93,10 +93,14 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:36 msgid "Raise a :exc:`RuntimeError` if there is no running event loop." msgstr "" +"Levanta uma :exc:`RuntimeError` se não houver nenhum laço de eventos em " +"execução." #: ../../library/asyncio-eventloop.rst:38 msgid "This function can only be called from a coroutine or a callback." msgstr "" +"Esta função só pode ser chamada a partir de uma corrotina ou de um retorno " +"de chamada." #: ../../library/asyncio-eventloop.rst:44 msgid "Get the current event loop." @@ -107,12 +111,18 @@ msgid "" "When called from a coroutine or a callback (e.g. scheduled with call_soon or " "similar API), this function will always return the running event loop." msgstr "" +"Quando chamada de uma corrotina ou função de retorno (por exemplo, agendada " +"com call_soon ou API semelhante), esta função sempre retornará o laço de " +"eventos em execução." #: ../../library/asyncio-eventloop.rst:50 msgid "" "If there is no running event loop set, the function will return the result " "of the ``get_event_loop_policy().get_event_loop()`` call." msgstr "" +"Se não houver nenhum laço de eventos em execução definido, a função " +"retornará o resultado da chamada ``get_event_loop_policy()." +"get_event_loop()``." #: ../../library/asyncio-eventloop.rst:53 msgid "" @@ -131,16 +141,23 @@ msgid "" "function, instead of using these lower level functions to manually create " "and close an event loop." msgstr "" +"Como observado acima, considere usar também a função de alto nível :func:" +"`asyncio.run` ao invés de usar funções de baixo nível para manualmente criar " +"e fechar um laço de eventos." #: ../../library/asyncio-eventloop.rst:62 msgid "" "Deprecation warning is emitted if there is no current event loop. In some " "future Python release this will become an error." msgstr "" +"Um aviso de descontinuação é emitido se não houver nenhum laço de eventos " +"atual. Em alguma versão futura do Python, isso se tornará um erro." #: ../../library/asyncio-eventloop.rst:68 msgid "Set *loop* as the current event loop for the current OS thread." msgstr "" +"Define *loop* como o laço de eventos atual para a thread atual do sistema " +"operacional." #: ../../library/asyncio-eventloop.rst:72 msgid "Create and return a new event loop object." @@ -341,6 +358,10 @@ msgid "" "this method has been called, using the default executor with :meth:`loop." "run_in_executor` will raise a :exc:`RuntimeError`." msgstr "" +"Agenda o encerramento do executor padrão e aguarda ele se juntar a todas as " +"threads no :class:`~concurrent.futures.ThreadPoolExecutor`. Uma vez que este " +"método tenha sido chamado, usar o executor padrão com :meth:`loop." +"run_in_executor` levantará um :exc:`RuntimeError`." #: ../../library/asyncio-eventloop.rst:194 msgid "" @@ -348,6 +369,9 @@ msgid "" "seconds) the executor will be given to finish joining. With the default, " "``None``, the executor is allowed an unlimited amount of time." msgstr "" +"O parâmetro *timeout* especifica a quantidade de tempo (em :class:`float` " +"segundos) que o executor terá para terminar a junção. Com o padrão ``None``, " +"o executor tem permissão para um período de tempo ilimitado." #: ../../library/asyncio-eventloop.rst:199 msgid "" @@ -355,6 +379,9 @@ msgid "" "default executor is terminated without waiting for its threads to finish " "joining." msgstr "" +"Se o *timeout* for atingido, uma exceção :exc:`RuntimeWarning` será emitida " +"e o executor padrão será finalizado sem esperar que suas threads terminem a " +"junção." #: ../../library/asyncio-eventloop.rst:205 msgid "" @@ -1160,7 +1187,7 @@ msgid "" "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -"Se *host* é uma string vazia ou ``None``, todas as interfaces são assumidas " +"Se *host* é uma string vazia ou ``None``, todas as interfaces são presumidas " "e uma lista de múltiplos soquetes será retornada (muito provavelmente um " "para IPv4 e outro para IPv6)." @@ -2386,7 +2413,7 @@ msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -"Um objeto empacotador de função de retorno retornado por :meth:`loop." +"Um objeto invólucro de função de retorno retornado por :meth:`loop." "call_soon`, :meth:`loop.call_soon_threadsafe`." #: ../../library/asyncio-eventloop.rst:1553 @@ -2411,7 +2438,7 @@ msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -"Um objeto empacotador de função de retorno retornado por :meth:`loop." +"Um objeto invólucro de função de retorno retornado por :meth:`loop." "call_later`, e :meth:`loop.call_at`." #: ../../library/asyncio-eventloop.rst:1574 diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index e9413b5b1..d03298bdb 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index 05177186e..84fb9553b 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Juliana Barros Lima, 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index dcf809d5b..1267ce881 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 7ff8e191c..3d93b2db3 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 8aa27a159..1842cb6e9 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 310be1260..256f29995 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 2b1ec1058..e26010977 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vinicius Gubiani Ferreira , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 427a88e8e..77dc39ba4 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 3c8aee0c5..57dc8791a 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Italo Penaforte , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index ac7287171..6937a2c5e 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index 45d94f2a5..8c4b268cd 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -92,7 +92,7 @@ msgid "" "wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` (if :const:" "`subprocess.PIPE` is passed to *stdout* and *stderr* arguments)." msgstr "" -"O argumento *limit* define o limite do buffer para os wrappers :class:" +"O argumento *limit* define o limite do buffer para os invólucros :class:" "`StreamReader` para :attr:`Process.stdout` e :attr:`Process.stderr` (se :" "const:`subprocess.PIPE` for passado para os argumentos *stdout* e *stderr*)." @@ -224,7 +224,7 @@ msgid "" msgstr "" "Ambas as funções :func:`create_subprocess_exec` e :func:" "`create_subprocess_shell` retornam instâncias da classe *Process*. *Process* " -"é um wrapper de alto nível que permite a comunicação com subprocessos e " +"é um invólucro de alto nível que permite a comunicação com subprocessos e " "observar eles serem completados." #: ../../library/asyncio-subprocess.rst:165 diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index bddc765ff..c52877c4a 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 6f7824f1a..53539b03c 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Vinicius Gubiani Ferreira , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -1028,7 +1028,7 @@ msgid "" "release the GIL or alternative Python implementations that don't have one, " "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -"Devido ao :term:`GIL`, ``asyncio.to_thread()`` pode tipicamente ser usado " +"Devido à :term:`GIL`, ``asyncio.to_thread()`` pode tipicamente ser usado " "apenas para fazer funções vinculadas a IO não-bloqueantes. Entretanto, para " "módulos de extensão que liberam o GIL ou implementações alternativas do " "Python que não tem um, ``asyncio.to_thread()`` também pode ser usado para " diff --git a/library/asyncio.po b/library/asyncio.po index 3ce8021a0..37f46057a 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -40,7 +40,7 @@ msgstr "Guias e tutoriais" #: ../../library/asyncio.rst:2 msgid ":mod:`!asyncio` --- Asynchronous I/O" -msgstr "" +msgstr ":mod:`!asyncio` --- E/S assíncrona" #: ../../library/asyncio.rst-1 msgid "Hello World!" diff --git a/library/atexit.po b/library/atexit.po index c3fef51a8..82a359186 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/atexit.rst:2 msgid ":mod:`!atexit` --- Exit handlers" -msgstr "" +msgstr ":mod:`!atexit` --- Manipuladores de saída" #: ../../library/atexit.rst:12 msgid "" diff --git a/library/audioop.po b/library/audioop.po index 012766de1..6570cc416 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/audit_events.po b/library/audit_events.po index 3aa809a5c..9098bddef 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/base64.po b/library/base64.po index b5c803de3..0a5a23c0b 100644 --- a/library/base64.po +++ b/library/base64.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/bdb.po b/library/bdb.po index 4bdc8fc8b..41e9907a8 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/binary.po b/library/binary.po index 7c0f33ab8..88f6fdb10 100644 --- a/library/binary.po +++ b/library/binary.po @@ -19,10 +19,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/binascii.po b/library/binascii.po index 6424b6200..506083a5c 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/bisect.po b/library/bisect.po index 43d4b6e78..859a97392 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/builtins.po b/library/builtins.po index 59b6b1b7e..3fec9d2a7 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/builtins.rst:2 msgid ":mod:`!builtins` --- Built-in objects" -msgstr "" +msgstr ":mod:`!builtins` --- Objetos embutidos" #: ../../library/builtins.rst:9 msgid "" diff --git a/library/bz2.po b/library/bz2.po index 14d6e4226..e93703297 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/bz2.rst:2 msgid ":mod:`!bz2` --- Support for :program:`bzip2` compression" -msgstr "" +msgstr ":mod:`!bz2` --- Suporte para compressão :program:`bzip2`" #: ../../library/bz2.rst:12 msgid "**Source code:** :source:`Lib/bz2.py`" diff --git a/library/calendar.po b/library/calendar.po index eddb90f95..bc653efe7 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: i17obot , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/calendar.rst:2 msgid ":mod:`!calendar` --- General calendar-related functions" -msgstr "" +msgstr ":mod:`!calendar` --- Funções gerais relacionadas ao calendário" #: ../../library/calendar.rst:10 msgid "**Source code:** :source:`Lib/calendar.py`" @@ -43,6 +43,14 @@ msgid "" "Parameters that specify dates are given as integers. For related " "functionality, see also the :mod:`datetime` and :mod:`time` modules." msgstr "" +"Este módulo permite que você exiba calendários como o programa Unix :program:" +"`cal`, e fornece funções adicionais úteis relacionadas ao calendário. Por " +"padrão, esses calendários têm a segunda-feira como o primeiro dia da semana, " +"e Domingo como o último (a convenção Europeia). Use :func:`setfirstweekday` " +"para colocar o primeiro dia da semana como Domingo (6) ou para qualquer " +"outro dia da semana. Parâmetros que especificam datas são dados como " +"inteiros. Para funcionalidade relacionada, veja também os módulos :mod:" +"`datetime` e :mod:`time`." #: ../../library/calendar.rst:22 msgid "" @@ -54,6 +62,13 @@ msgid "" "as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is 2 BC, " "and so on." msgstr "" +"As funções e classes definidas neste módulo usam um calendário idealizado, o " +"calendário Gregoriano atual estendido indefinidamente nas duas direções. " +"Isso corresponde à definição do calendário \"proleptic " +"Gregorian\" (gregoriano proléptico) no livro \"Calendrical Calculations\" de " +"Dershowitz e Reingold, onde está o calendário base para todas os cálculos. " +"Anos com zero ou negativos são interpretados e prescritos pelo padrão ISO " +"8601. Ano 0 é 1 A.C., ano -1 é 2 A.C, e de assim em diante." #: ../../library/calendar.rst:33 msgid "" @@ -61,6 +76,9 @@ msgid "" "the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" "`SUNDAY` is ``6``." msgstr "" +"Cria um objeto :class:`Calendar`. *firstweekday* é um inteiro que especifica " +"o primeiro dia da semana. :const:`MONDAY` é ``0`` (o padrão), :const:" +"`SUNDAY` é ``6``." #: ../../library/calendar.rst:36 msgid "" @@ -68,10 +86,13 @@ msgid "" "preparing the calendar data for formatting. This class doesn't do any " "formatting itself. This is the job of subclasses." msgstr "" +"Um objeto :class:`Calendar` fornece vários métodos que podem ser usados para " +"preparar os dados do calendário para formatação. Esta classe não realiza " +"nenhuma formatação por si mesma. Esse é o trabalho das subclasses." #: ../../library/calendar.rst:41 msgid ":class:`Calendar` instances have the following methods:" -msgstr "" +msgstr "Instâncias de :class:`Calendar` possuem os seguintes métodos:" #: ../../library/calendar.rst:45 msgid "" @@ -79,6 +100,9 @@ msgid "" "The first value from the iterator will be the same as the value of the :attr:" "`firstweekday` property." msgstr "" +"Retorna um iterador para os números dos dias da semana que serão usados em " +"uma semana. O primeiro valor do iterador será o mesmo que o valor da " +"propriedade :attr:`firstweekday`." #: ../../library/calendar.rst:52 msgid "" @@ -87,6 +111,10 @@ msgid "" "month and all days before the start of the month or after the end of the " "month that are required to get a complete week." msgstr "" +"Retorna um iterador para o mês *month* (1--12) no ano *year*. Este iterador " +"retornará todos os dias (como objetos :class:`datetime.date`) para o mês e " +"todos os dias antes do início do mês ou após o final do mês que são " +"necessários para obter uma semana completa." #: ../../library/calendar.rst:60 msgid "" @@ -95,6 +123,10 @@ msgid "" "Days returned will simply be day of the month numbers. For the days outside " "of the specified month, the day number is ``0``." msgstr "" +"Retorna um iterador para o mês *month* no ano *year* semelhante a :meth:" +"`itermonthdates`, mas não restrito pelo intervalo de :class:`datetime.date`. " +"Os dias retornados serão simplesmente os números dos dias do mês. Para os " +"dias fora do mês especificado, o número do dia será ``0``." #: ../../library/calendar.rst:68 msgid "" @@ -103,6 +135,10 @@ msgid "" "Days returned will be tuples consisting of a day of the month number and a " "week day number." msgstr "" +"Retorna um iterador para o mês *month* no ano year semelhante a :meth:" +"`itermonthdates`, mas não restrito pelo intervalo de :class:`datetime.date`. " +"Os dias retornados serão tuplas consistindo de um número de dia do mês e um " +"número de dia da semana." #: ../../library/calendar.rst:76 msgid "" @@ -111,6 +147,10 @@ msgid "" "Days returned will be tuples consisting of a year, a month and a day of the " "month numbers." msgstr "" +"Retorna um iterador para o mês *month* no ano *year* semelhante a :meth:" +"`itermonthdates`, mas não restrito pelo intervalo de :class:`datetime.date`. " +"Os dias retornados serão tuplas consistindo de números de um ano, um mês e " +"um dia do mês." #: ../../library/calendar.rst:86 msgid "" @@ -119,24 +159,35 @@ msgid "" "Days returned will be tuples consisting of a year, a month, a day of the " "month, and a day of the week numbers." msgstr "" +"Retorna um iterador para o mês *month* no ano *year* semelhante a :meth:" +"`itermonthdates`, mas não restrito pelo intervalo de :class:`datetime.date`. " +"Os dias retornados serão tuplas consistindo de números de um ano, um mês, um " +"dia do mês e um dia da semana." #: ../../library/calendar.rst:96 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." msgstr "" +"Retorna uma lista das semanas do mês *month* do *year* como semanas " +"completas. As semanas são listas de sete objetos :class:`datetime.date`." #: ../../library/calendar.rst:102 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." msgstr "" +"Retorna uma lista das semanas do mês *month* do *year* como semanas " +"completas. As semanas são listas de sete tuplas de números dias e de dias de " +"semanas." #: ../../library/calendar.rst:109 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." msgstr "" +"Retorna uma lista das semanas do mês *month* do *year* como semanas " +"completas. As semanas são listas de números de 7 dias." #: ../../library/calendar.rst:115 msgid "" @@ -145,6 +196,10 @@ msgid "" "(defaulting to 3). Each month contains between 4 and 6 weeks and each week " "contains 1--7 days. Days are :class:`datetime.date` objects." msgstr "" +"Retorna os dados para o ano especificado prontos para formatação. O valor de " +"retorno é uma lista de linhas de meses. Cada linha de mês contém até *width* " +"meses (padrão é 3). Cada mês contém entre 4 e 6 semanas, e cada semana " +"contém 1--7 dias. Os dias são objetos :class:`datetime.date`." #: ../../library/calendar.rst:123 msgid "" @@ -518,7 +573,7 @@ msgstr "As seguintes opções são aceitas:" #: ../../library/calendar.rst:568 msgid "Show the help message and exit." -msgstr "" +msgstr "Mostra a mensagem de ajuda e saia." #: ../../library/calendar.rst:573 msgid "The locale to use for month and weekday names. Defaults to English." diff --git a/library/cgi.po b/library/cgi.po index f8325366b..4d203fe8c 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/cgitb.po b/library/cgitb.po index 8aa825b89..c5da3bf34 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/chunk.po b/library/chunk.po index 3fe8b6538..a7f1e58bc 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/cmath.po b/library/cmath.po index 636add29c..098d9efda 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/cmath.rst:2 msgid ":mod:`!cmath` --- Mathematical functions for complex numbers" -msgstr "" +msgstr ":mod:`!cmath` --- Funções matemáticas para números complexos" #: ../../library/cmath.rst:9 msgid "" @@ -40,6 +40,13 @@ msgid "" "floating-point number, respectively, and the function is then applied to the " "result of the conversion." msgstr "" +"Este módulo fornece acesso a funções matemáticas para números complexos. As " +"funções neste módulo aceitam inteiros, números de ponto flutuante ou números " +"complexos como argumentos. Eles também aceitarão qualquer objeto Python que " +"tenha um método :meth:`~object.__complex__` ou :meth:`~object.__float__`: " +"esses métodos são usados ​​para converter o objeto em um número complexo ou de " +"ponto flutuante, respectivamente, e a função é então aplicada ao resultado " +"da conversão." #: ../../library/cmath.rst:18 msgid "" @@ -51,6 +58,15 @@ msgid "" "axis we look at the sign of the imaginary part, while for a branch cut along " "the imaginary axis we look at the sign of the real part." msgstr "" +"Para funções que envolvem cortes de ramificação, temos o problema de decidir " +"como definir essas funções no próprio corte. Seguindo o artigo de Kahan " +"intitulado \"Branch cuts for complex elementary functions\" (em tradução " +"livre, \"Cortes de ramificação para funções complexas elementares\"), bem " +"como o Anexo G do C99 e padrões C posteriores, usamos o sinal de zero para " +"distinguir um lado do outro no corte de ramificação: para um corte de " +"ramificação ao longo (de uma porção) do eixo real olhamos para o sinal da " +"parte imaginária, enquanto para um corte de ramificação ao longo do eixo " +"imaginário olhamos para o sinal da parte real." #: ../../library/cmath.rst:26 msgid "" @@ -59,16 +75,22 @@ msgid "" "though it lies *below* the branch cut, and so gives a result on the negative " "imaginary axis::" msgstr "" +"Por exemplo, a função :func:`cmath.sqrt` tem um corte de ramificação ao " +"longo do eixo real negativo. Um argumento de ``complex(-2.0, -0.0)`` é " +"tratado como se estivesse *abaixo* do corte de ramificação, e assim dá um " +"resultado no eixo imaginário negativo::" #: ../../library/cmath.rst:34 msgid "" "But an argument of ``complex(-2.0, 0.0)`` is treated as though it lies above " "the branch cut::" msgstr "" +"Mas um argumento de ``complex(-2.0, 0.0)`` é tratado como se estivesse acima " +"do corte de ramificação::" #: ../../library/cmath.rst:42 msgid "Conversions to and from polar coordinates" -msgstr "" +msgstr "Conversões de e para coordenadas polares" #: ../../library/cmath.rst:44 msgid "" @@ -86,12 +108,19 @@ msgid "" "radians, from the positive x-axis to the line segment that joins the origin " "to *z*." msgstr "" +"*Coordenadas polares* fornecem uma forma alternativa de representar um " +"número complexo. Em coordenadas polares, um número complexo *z* é definido " +"pelo módulo *r* e pelo ângulo de fase *phi*. O módulo *r* é a distância de " +"*z* à origem, enquanto a fase *phi* é o ângulo anti-horário, medido em " +"radianos, do eixo x positivo ao segmento de reta que une a origem a *z*." #: ../../library/cmath.rst:58 msgid "" "The following functions can be used to convert from the native rectangular " "coordinates to polar coordinates and back." msgstr "" +"As funções a seguir podem ser usadas para converter coordenadas retangulares " +"nativas em coordenadas polares e vice-versa." #: ../../library/cmath.rst:63 msgid "" @@ -101,6 +130,11 @@ msgid "" "along the negative real axis. The sign of the result is the same as the " "sign of ``x.imag``, even when ``x.imag`` is zero::" msgstr "" +"Retorna a fase de *x* (também conhecido como *argumento* de *x*), como um " +"ponto flutuante. ``phase(x)`` é equivalente a ``math.atan2(x.imag, x." +"real)``. O resultado está no intervalo [-\\ *π*, *π*], e o corte de " +"ramificação para esta operação está ao longo do eixo real negativo. O sinal " +"do resultado é igual ao sinal de ``x.imag``, mesmo quando ``x.imag`` é zero::" #: ../../library/cmath.rst:77 msgid "" @@ -108,6 +142,9 @@ msgid "" "the built-in :func:`abs` function. There is no separate :mod:`cmath` module " "function for this operation." msgstr "" +"O módulo (valor absoluto) de um número complexo *x* pode ser calculado " +"usando a função embutida :func:`abs`. Não há função do módulo :mod:`cmath` " +"separada para esta operação." #: ../../library/cmath.rst:84 msgid "" @@ -115,6 +152,9 @@ msgid "" "phi)`` where *r* is the modulus of *x* and phi is the phase of *x*. " "``polar(x)`` is equivalent to ``(abs(x), phase(x))``." msgstr "" +"Retorna a representação de *x* em coordenadas polares. Retorna um par ``(r, " +"phi)`` onde *r* é o módulo de *x* e phi é a fase de *x*. ``polar(x)`` é " +"equivalente a ``(abs(x), phase(x))``." #: ../../library/cmath.rst:92 msgid "" @@ -131,6 +171,7 @@ msgid "" "Return *e* raised to the power *x*, where *e* is the base of natural " "logarithms." msgstr "" +"Retorna *e* elevado à potência *x*, onde *e* é a base de logaritmos naturais." #: ../../library/cmath.rst:107 msgid "" @@ -138,17 +179,24 @@ msgid "" "specified, returns the natural logarithm of *x*. There is one branch cut, " "from 0 along the negative real axis to -∞." msgstr "" +"Retorna o logaritmo de *x* para a *base* fornecida. Se a *base* não for " +"especificada, retorna o logaritmo natural de *x*. Há um corte de " +"ramificação, de 0 ao longo do eixo real negativo até -∞." #: ../../library/cmath.rst:114 msgid "" "Return the base-10 logarithm of *x*. This has the same branch cut as :func:" "`log`." msgstr "" +"Retorna o logaritmo de *x* na base 10. Este tem o mesmo corte de ramificação " +"que :func:`log`." #: ../../library/cmath.rst:120 msgid "" "Return the square root of *x*. This has the same branch cut as :func:`log`." msgstr "" +"Retorna a raiz quadrada de *x*. Este tem o mesmo corte de ramificação que :" +"func:`log`." #: ../../library/cmath.rst:124 msgid "Trigonometric functions" @@ -160,11 +208,16 @@ msgid "" "from 1 along the real axis to ∞. The other extends left from -1 along the " "real axis to -∞." msgstr "" +"Retorna o arco cosseno de *x*. Existem dois cortes de ramificação: um se " +"estende desde 1 ao longo do eixo real até ∞. O outro se estende para a " +"esquerda de -1 ao longo do eixo real até -∞." #: ../../library/cmath.rst:135 msgid "" "Return the arc sine of *x*. This has the same branch cuts as :func:`acos`." msgstr "" +"Retorna o arco seno de *x*. Tem os mesmos cortes de ramificação que :func:" +"`acos`." #: ../../library/cmath.rst:140 msgid "" @@ -172,18 +225,21 @@ msgid "" "``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " "along the imaginary axis to ``-∞j``." msgstr "" +"Retorna o arco tangente de *x*. Existem dois cortes de ramificação: Um se " +"estende de ``1j`` ao longo do eixo imaginário até ``∞j``. O outro se estende " +"de ``-1j`` ao longo do eixo imaginário até ``-∞j``." #: ../../library/cmath.rst:147 msgid "Return the cosine of *x*." -msgstr "" +msgstr "Retorna o cosseno de *x*." #: ../../library/cmath.rst:152 msgid "Return the sine of *x*." -msgstr "Devolve o seno de *x*." +msgstr "Retorna o seno de *x*." #: ../../library/cmath.rst:157 msgid "Return the tangent of *x*." -msgstr "" +msgstr "Retorna a tangente de *x*." #: ../../library/cmath.rst:161 msgid "Hyperbolic functions" @@ -194,6 +250,8 @@ msgid "" "Return the inverse hyperbolic cosine of *x*. There is one branch cut, " "extending left from 1 along the real axis to -∞." msgstr "" +"Retorna o cosseno hiperbólico inverso de *x*. Há um corte de ramificação, " +"estendendo-se para a esquerda de 1 ao longo do eixo real até -∞." #: ../../library/cmath.rst:171 msgid "" @@ -201,6 +259,9 @@ msgid "" "extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " "from ``-1j`` along the imaginary axis to ``-∞j``." msgstr "" +"Retorna o seno hiperbólico inverso de *x*. Existem dois cortes de " +"ramificação: Um se estende de ``1j`` ao longo do eixo imaginário até ``∞j``. " +"O outro se estende de ``-1j`` ao longo do eixo imaginário até ``-∞j``." #: ../../library/cmath.rst:178 msgid "" @@ -208,6 +269,9 @@ msgid "" "extends from ``1`` along the real axis to ``∞``. The other extends from " "``-1`` along the real axis to ``-∞``." msgstr "" +"Retorna a tangente hiperbólica inversa de *x*. Existem dois cortes de " +"ramificação: Um se estende de ``1`` ao longo do eixo real até ``∞``. O outro " +"se estende de ``-1`` ao longo do eixo real até ``-∞``." #: ../../library/cmath.rst:185 msgid "Return the hyperbolic cosine of *x*." @@ -223,25 +287,31 @@ msgstr "Retorna a tangente hiperbólica de *x*." #: ../../library/cmath.rst:199 msgid "Classification functions" -msgstr "" +msgstr "Funções de classificação" #: ../../library/cmath.rst:203 msgid "" "Return ``True`` if both the real and imaginary parts of *x* are finite, and " "``False`` otherwise." msgstr "" +"Retorna ``True`` se ambas as partes real e imaginária de *x* forem finitas, " +"e ``False`` caso contrário." #: ../../library/cmath.rst:211 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is an " "infinity, and ``False`` otherwise." msgstr "" +"Retorna ``True`` se ou a parte real ou a imaginária de *x* for infinita, e " +"``False`` caso contrário." #: ../../library/cmath.rst:217 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is a NaN, " "and ``False`` otherwise." msgstr "" +"Retorna ``True`` se ou a parte real ou a imaginária de *x* for NaN, e " +"``False`` caso contrário." #: ../../library/cmath.rst:223 msgid "" @@ -268,7 +338,7 @@ msgid "" "within about 9 decimal digits. *rel_tol* must be greater than zero." msgstr "" "*rel_tol* é a tolerância relativa -- é a diferença máxima permitida entre " -"*a* e *b*, em relação ao maior valor absoluto de *a* e *b*. Por exemplo, " +"*a* e *b*, em relação ao maior valor absoluto de *a* ou *b*. Por exemplo, " "para definir uma tolerância de 5%, passe ``rel_tol=0.05``. A tolerância " "padrão é ``1e-09``, o que garante que os dois valores sejam iguais em cerca " "de 9 dígitos decimais. *rel_tol* deve ser maior que zero." @@ -311,37 +381,43 @@ msgstr "Constantes" #: ../../library/cmath.rst:258 msgid "The mathematical constant *π*, as a float." -msgstr "" +msgstr "A constante matemática *π*, como um ponto flutuante." #: ../../library/cmath.rst:263 msgid "The mathematical constant *e*, as a float." -msgstr "" +msgstr "A constante matemática *e*, como um ponto flutuante." #: ../../library/cmath.rst:268 msgid "The mathematical constant *τ*, as a float." -msgstr "" +msgstr "A constante matemática *τ*, como um ponto flutuante." #: ../../library/cmath.rst:275 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." -msgstr "" +msgstr "Infinito positivo de ponto flutuante. Equivalente a ``float('inf')``." #: ../../library/cmath.rst:282 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." msgstr "" +"Número complexo com parte real zero e parte imaginária infinita positiva. " +"Equivalente a ``complex(0.0, float('inf'))``." #: ../../library/cmath.rst:290 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." msgstr "" +"Um valor de ponto flutuante \"não um número\" (NaN). Equivalente a " +"``float('nan')``." #: ../../library/cmath.rst:298 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." msgstr "" +"Número complexo com parte real zero e parte imaginária NaN. Equivalente a " +"``complex(0.0, float('nan'))``." #: ../../library/cmath.rst:306 msgid "" @@ -354,6 +430,13 @@ msgid "" "as a real number (in which case the complex number has an imaginary part of " "zero)." msgstr "" +"Observe que a seleção de funções é semelhante, mas não idêntica, àquela no " +"módulo :mod:`math`. A razão para ter dois módulos é que alguns usuários não " +"estão interessados ​​em números complexos e talvez nem saibam o que são. Eles " +"preferem que ``math.sqrt(-1)`` gere uma exceção do que retorne um número " +"complexo. Observe também que as funções definidas em :mod:`cmath` sempre " +"retornam um número complexo, mesmo que a resposta possa ser expressa como um " +"número real (nesse caso o número complexo tem uma parte imaginária de zero)." #: ../../library/cmath.rst:314 msgid "" @@ -365,6 +448,13 @@ msgid "" "choice of branch cuts for numerical purposes, a good reference should be the " "following:" msgstr "" +"Uma nota sobre cortes de ramificação: são curvas ao longo das quais a função " +"dada não é contínua. Eles são um recurso necessário de muitas funções " +"complexas. Presume-se que se você precisar calcular com funções complexas, " +"você entenderá sobre cortes de ramificação. Consulte quase qualquer livro " +"(não muito elementar) sobre variáveis ​​complexas para obter esclarecimento. " +"Para informações sobre a escolha adequada dos cortes de ramificação para " +"fins numéricos, uma boa referência deve ser a seguinte:" #: ../../library/cmath.rst:324 msgid "" @@ -372,6 +462,9 @@ msgid "" "nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the " "art in numerical analysis. Clarendon Press (1987) pp165--211." msgstr "" +"Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " +"nothing's sign bit. Em Iserles, A. e Powell, M. (eds.), The state of the " +"art in numerical analysis. Clarendon Press (1987) pp165--211." #: ../../library/cmath.rst:304 msgid "module" diff --git a/library/cmd.po b/library/cmd.po index 12a631d38..1f4cdd051 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/cmdline.po b/library/cmdline.po index 6c742d85f..b72c37971 100644 --- a/library/cmdline.po +++ b/library/cmdline.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/code.po b/library/code.po index 00e06b45d..7094aae9c 100644 --- a/library/code.po +++ b/library/code.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/code.rst:2 msgid ":mod:`!code` --- Interpreter base classes" -msgstr "" +msgstr ":mod:`!code` --- Classes bases do interpretador" #: ../../library/code.rst:7 msgid "**Source code:** :source:`Lib/code.py`" @@ -39,10 +39,10 @@ msgid "" "in Python. Two classes and convenience functions are included which can be " "used to build applications which provide an interactive interpreter prompt." msgstr "" -"O módulo ``code`` fornece facilidades para implementarmos loops de leitura-" -"eval-escrita no código Python. São incluídas duas classes e funções de " -"conveniência que podem ser usadas para criar aplicativos que fornecem um " -"prompt de interpretação interativa." +"O módulo ``code`` fornece facilidades para implementar laços de leitura-" +"execução-escrita no código Python. São incluídas duas classes e funções de " +"conveniência que podem ser usadas para criar aplicações que fornecem um " +"prompt de interpretador interativo." #: ../../library/code.rst:18 msgid "" @@ -93,6 +93,12 @@ msgid "" "syntax error). This function *almost* always makes the same decision as the " "real interpreter main loop." msgstr "" +"Esta função é útil para programas que desejam emular o laço principal do " +"interpretador Python (também conhecido como laço de leitura-execução-" +"impressão). A parte complicada é determinar quando o usuário digitou um " +"comando incompleto que pode ser concluído inserindo mais texto (em vez de um " +"comando completo ou um erro de sintaxe). Esta função *quase* sempre toma a " +"mesma decisão que o laço principal do interpretador real." #: ../../library/code.rst:57 msgid "" @@ -101,6 +107,10 @@ msgid "" "optional grammar start symbol, which should be ``'single'`` (the default), " "``'eval'`` or ``'exec'``." msgstr "" +"*source* é a string fonte; *filename* é o nome do arquivo opcional do qual a " +"fonte foi lida, sendo o padrão ``''``; e *symbol* é o símbolo " +"opcional de início da gramática, que deve ser ``'single'`` (o padrão), " +"``'eval'`` ou ``'exec'``." #: ../../library/code.rst:62 msgid "" @@ -110,10 +120,15 @@ msgid "" "error, or raises :exc:`OverflowError` or :exc:`ValueError` if the command " "contains an invalid literal." msgstr "" +"Retorna um objeto código (o mesmo que ``compile(source, filename, symbol)``) " +"se o comando for completo e válido; ``None`` se o comando estiver " +"incompleto; levanta :exc:`SyntaxError` se o comando estiver completo e " +"contém um erro de sintaxe, ou levanta :exc:`OverflowError` ou :exc:" +"`ValueError` se o comando contiver um literal inválido." #: ../../library/code.rst:72 msgid "Interactive Interpreter Objects" -msgstr "Objetos de Interpretador Interativo" +msgstr "Objetos de interpretador interativo" #: ../../library/code.rst:77 msgid "" @@ -121,6 +136,9 @@ msgid "" "for :func:`compile_command`; the default for *filename* is ``''``, " "and for *symbol* is ``'single'``. One of several things can happen:" msgstr "" +"Compila e executa alguma fonte no interpretador. Os argumentos são os mesmos " +"de :func:`compile_command`; o padrão para *filename* é ``''``, e para " +"*symbol* é ``'single'``. Uma de várias coisas pode acontecer:" #: ../../library/code.rst:81 msgid "" @@ -129,12 +147,18 @@ msgid "" "by calling the :meth:`showsyntaxerror` method. :meth:`runsource` returns " "``False``." msgstr "" +"A entrada está incorreta; :func:`compile_command` levantou uma exceção (:exc:" +"`SyntaxError` ou :exc:`OverflowError`). Um traceback da sintaxe será " +"impresso chamando o método :meth:`showsyntaxerror`. :meth:`runsource` " +"retorna ``False``." #: ../../library/code.rst:86 msgid "" "The input is incomplete, and more input is required; :func:`compile_command` " "returned ``None``. :meth:`runsource` returns ``True``." msgstr "" +"A entrada está incompleta e são necessárias mais entradas; :func:" +"`compile_command` retornou ``None``. :meth:`runsource` retorna ``True``." #: ../../library/code.rst:89 msgid "" @@ -143,12 +167,18 @@ msgid "" "exceptions, except for :exc:`SystemExit`). :meth:`runsource` returns " "``False``." msgstr "" +"A entrada está completa; :func:`compile_command` retornou um objeto código. " +"O código é executado chamando :meth:`runcode` (que também lida com exceções " +"de tempo de execução, exceto :exc:`SystemExit`). :meth:`runsource` retorna " +"``False``." #: ../../library/code.rst:93 msgid "" "The return value can be used to decide whether to use ``sys.ps1`` or ``sys." "ps2`` to prompt the next line." msgstr "" +"O valor de retorno pode ser usado para decidir se usar ``sys.ps1`` ou ``sys." +"ps2`` para solicitar a próxima linha." #: ../../library/code.rst:99 msgid "" @@ -156,6 +186,9 @@ msgid "" "called to display a traceback. All exceptions are caught except :exc:" "`SystemExit`, which is allowed to propagate." msgstr "" +"Executa um objeto código. Quando ocorre uma exceção, :meth:`showtraceback` é " +"chamado para exibir um traceback. Todas as exceções são capturadas, exceto :" +"exc:`SystemExit`, que pode ser propagada." #: ../../library/code.rst:103 msgid "" @@ -163,6 +196,9 @@ msgid "" "this code, and may not always be caught. The caller should be prepared to " "deal with it." msgstr "" +"Uma observação sobre :exc:`KeyboardInterrupt`: esta exceção pode ocorrer em " +"outro lugar neste código e nem sempre pode ser detectada. O chamador deve " +"estar preparado para lidar com isso." #: ../../library/code.rst:110 msgid "" @@ -172,6 +208,12 @@ msgid "" "Python's parser, because it always uses ``''`` when reading from a " "string. The output is written by the :meth:`write` method." msgstr "" +"Exibe o erro de sintaxe que acabou de ocorrer. Isso não exibe um stack trace " +"(situação da pilha de execução) porque não há um para erros de sintaxe. Se " +"*filename* for fornecido, ele será inserido na exceção em vez do nome de " +"arquivo padrão fornecido pelo analisador sintático do Python, porque ele " +"sempre usa ``''`` ao ler uma string. A saída é escrita pelo método :" +"meth:`write`." #: ../../library/code.rst:119 msgid "" @@ -179,12 +221,17 @@ msgid "" "because it is within the interpreter object implementation. The output is " "written by the :meth:`write` method." msgstr "" +"Exibe a exceção que acabou de ocorrer. Removemos o primeiro item da pilha " +"porque ele está dentro da implementação do objeto interpretador. A saída é " +"escrita pelo método :meth:`write`." #: ../../library/code.rst:123 msgid "" "The full chained traceback is displayed instead of just the primary " "traceback." msgstr "" +"O traceback encadeado completo é exibido em vez de apenas o traceback " +"primário." #: ../../library/code.rst:129 msgid "" @@ -192,10 +239,13 @@ msgid "" "classes should override this to provide the appropriate output handling as " "needed." msgstr "" +"Escreve uma string no fluxo de erro padrão (``sys.stderr``). As classes " +"derivadas devem substituir isso para fornecer o tratamento de saída " +"apropriado conforme necessário." #: ../../library/code.rst:136 msgid "Interactive Console Objects" -msgstr "Objetos de Console Interativos" +msgstr "Objetos de console Interativo" #: ../../library/code.rst:138 msgid "" @@ -203,6 +253,9 @@ msgid "" "`InteractiveInterpreter`, and so offers all the methods of the interpreter " "objects as well as the following additions." msgstr "" +"A classe :class:`InteractiveConsole` é uma subclasse de :class:" +"`InteractiveInterpreter` e, portanto, oferece todos os métodos dos objetos " +"interpretadores, bem como as seguintes adições." #: ../../library/code.rst:145 msgid "" @@ -213,6 +266,12 @@ msgid "" "(so as not to confuse this with the real interpreter -- since it's so " "close!)." msgstr "" +"Emula de forma muito semelhante o console interativo do Python. O argumento " +"opcional *banner* especifica o banner a ser impresso antes da primeira " +"interação; por padrão ele imprime um banner semelhante ao impresso pelo " +"interpretador Python padrão, seguido pelo nome da classe do objeto console " +"entre parênteses (para não confundir isso com o interpretador real -- já que " +"está tão próximo!)." #: ../../library/code.rst:151 msgid "" @@ -220,14 +279,17 @@ msgid "" "exiting. Pass the empty string to suppress the exit message. If *exitmsg* is " "not given or ``None``, a default message is printed." msgstr "" +"O argumento opcional *exitmsg* especifica uma mensagem de saída impressa ao " +"sair. Passe a string vazia para suprimir a mensagem de saída. Se *exitmsg* " +"não for fornecido ou ``None``, uma mensagem padrão será impressa." #: ../../library/code.rst:155 msgid "To suppress printing any banner, pass an empty string." -msgstr "" +msgstr "Para suprimir a impressão de qualquer banner, passe uma string vazia." #: ../../library/code.rst:158 msgid "Print an exit message when exiting." -msgstr "Imprima uma mensagem de saída ao sair." +msgstr "Imprime uma mensagem de saída ao sair." #: ../../library/code.rst:164 msgid "" @@ -241,10 +303,19 @@ msgid "" "is required, ``False`` if the line was dealt with in some way (this is the " "same as :meth:`!runsource`)." msgstr "" +"Envia uma linha do texto fonte para o interpretador. A linha não deve ter " +"uma nova linha à direita; pode ter novas linhas internas. A linha é anexada " +"a um buffer e o método :meth:`~InteractiveInterpreter.runsource` do " +"interpretador é chamado com o conteúdo concatenado do buffer como fonte. Se " +"isso indicar que o comando foi executado ou é inválido, o buffer será " +"redefinido; caso contrário, o comando estará incompleto e o buffer " +"permanecerá como estava após a linha ser anexada. O valor de retorno é " +"``True`` se mais entrada for necessária, ``False`` se a linha foi tratada de " +"alguma forma (isto é o mesmo que :meth:`!runsource`)." #: ../../library/code.rst:176 msgid "Remove any unhandled source text from the input buffer." -msgstr "" +msgstr "Remove qualquer texto fonte não tratado do buffer de entrada." #: ../../library/code.rst:181 msgid "" @@ -253,3 +324,7 @@ msgid "" "`EOFError` is raised. The base implementation reads from ``sys.stdin``; a " "subclass may replace this with a different implementation." msgstr "" +"Escreve um prompt e leia uma linha. A linha retornada não inclui a nova " +"linha final. Quando o usuário insere a sequência de teclas de fim de linha, " +"uma exceção :exc:`EOFError` é levantada. A implementação base lê ``sys." +"stdin``; uma subclasse pode substituir isso por uma implementação diferente." diff --git a/library/codecs.po b/library/codecs.po index c9a3ab62a..0f2b0880d 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/codeop.po b/library/codeop.po index 254cf844d..402eec210 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/codeop.rst:2 msgid ":mod:`!codeop` --- Compile Python code" -msgstr "" +msgstr ":mod:`!codeop` --- Compila código Python" #: ../../library/codeop.rst:10 msgid "**Source code:** :source:`Lib/codeop.py`" diff --git a/library/collections.abc.po b/library/collections.abc.po index 06f04b5c1..5034af362 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/collections.po b/library/collections.po index dd64ad322..a15adc936 100644 --- a/library/collections.po +++ b/library/collections.po @@ -25,16 +25,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/collections.rst:2 msgid ":mod:`!collections` --- Container datatypes" -msgstr "" +msgstr ":mod:`!collections` --- Tipos de dados de contêineres" #: ../../library/collections.rst:10 msgid "**Source code:** :source:`Lib/collections/__init__.py`" @@ -85,7 +85,7 @@ msgstr ":class:`Counter`" #: ../../library/collections.rst:28 msgid "dict subclass for counting :term:`hashable` objects" -msgstr "" +msgstr "subclasse de dict para contar objetos :term:`hasheáveis `" #: ../../library/collections.rst:29 msgid ":class:`OrderedDict`" @@ -112,7 +112,7 @@ msgstr ":class:`UserDict`" #: ../../library/collections.rst:31 msgid "wrapper around dictionary objects for easier dict subclassing" msgstr "" -"envoltório em torno de objetos dicionário para facilitar fazer subclasse de " +"invólucro em torno de objetos dicionário para facilitar fazer subclasse de " "dict" #: ../../library/collections.rst:32 @@ -122,7 +122,7 @@ msgstr ":class:`UserList`" #: ../../library/collections.rst:32 msgid "wrapper around list objects for easier list subclassing" msgstr "" -"envoltório em torno de objetos lista para facilitar criação de subclasse de " +"invólucro em torno de objetos lista para facilitar criação de subclasse de " "lista" #: ../../library/collections.rst:33 @@ -132,8 +132,8 @@ msgstr ":class:`UserString`" #: ../../library/collections.rst:33 msgid "wrapper around string objects for easier string subclassing" msgstr "" -"envoltório em torno de objetos string para uma facilitar criação de " -"subclasse de string" +"invólucro em torno de objetos string para uma facilitar criação de subclasse " +"de string" #: ../../library/collections.rst:38 msgid ":class:`ChainMap` objects" @@ -318,6 +318,10 @@ msgid "" "whether writes and other mutations apply only to the first mapping or to any " "mapping in the chain." msgstr "" +"A `receita de Contextos Aninhados `_ possui opções " +"para controlar se escritas e outras mutações se aplicam a apenas o primeiro " +"mapeamento ou para qualquer mapeamento na cadeia." #: ../../library/collections.rst:141 msgid "" @@ -390,6 +394,12 @@ msgid "" "integer value including zero or negative counts. The :class:`Counter` class " "is similar to bags or multisets in other languages." msgstr "" +"Um :class:`Counter` é uma subclasse de :class:`dict` subclass para contagem " +"de objetos :term:`hasheáveis `. É uma coleção na qual elementos " +"são armazenados como chaves de dicionário e suas contagens são armazenadas " +"como valores de dicionário. Contagens podem ser qualquer valor inteiro " +"incluindo zero e contagens negativas. A classe :class:`Counter` é similar a " +"sacos ou multiconjuntos em outras linguagens." #: ../../library/collections.rst:251 msgid "" @@ -424,6 +434,11 @@ msgid "" "encountered in the left operand and then by the order encountered in the " "right operand." msgstr "" +"Como uma subclasse de :class:`dict`, :class:`Counter` herda a capacidade de " +"lembrar a ordem de inserção. Operações matemáticas em objetos *Counter* " +"também preservam ordem. Os resultados são ordenados de acordo com o momento " +"que um elemento é encontrado pela primeira vez no operando da esquerda e, em " +"seguida, pela ordem encontrada no operando da direita." #: ../../library/collections.rst:280 msgid "" @@ -693,6 +708,12 @@ msgid "" "safe, memory efficient appends and pops from either side of the deque with " "approximately the same *O*\\ (1) performance in either direction." msgstr "" +"Deques são uma generalização de pilhas e filas (o nome é pronunciado " +"\"deck\" e é abreviação de \"double-ended queue\", e conhecida como \"fila " +"duplamente terminada\" em português). O Deques oferece suporte para " +"acréscimos e retiradas seguros para thread e eficientes em uso memória de " +"ambos os lados do deque com aproximadamente o mesmo desempenho *O*\\ (1) em " +"qualquer direção." #: ../../library/collections.rst:463 msgid "" @@ -701,6 +722,11 @@ msgid "" "for ``pop(0)`` and ``insert(0, v)`` operations which change both the size " "and position of the underlying data representation." msgstr "" +"Embora os objetos :class:`list` ofereçam suporte a operações semelhantes, " +"eles são otimizados para operações rápidas de comprimento fixo e sujeitam em " +"custos de movimentação de memória *O*\\ (*n*) para as operações ``pop(0)`` e " +"``insert(0, v)`` que alteram o tamanho e a posição da representação de dados " +"subjacente." #: ../../library/collections.rst:469 msgid "" @@ -848,6 +874,12 @@ msgid "" "slows to *O*\\ (*n*) in the middle. For fast random access, use lists " "instead." msgstr "" +"Além do acima, deques oferece suporte a iteração, serialização com pickle, " +"``len(d)``, ``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)`` e teste " +"de associação com o operador :keyword:`in` e referências subscritas, como " +"``d[0]`` para acessar o primeiro elemento. O acesso indexado é *O*\\ (1) em " +"ambas as extremidades, mas diminui para *O*\\ (*n*) no meio. Para acesso " +"aleatório rápido, use listas." #: ../../library/collections.rst:591 msgid "" @@ -997,6 +1029,10 @@ msgid "" "class:`dict` class when the requested key is not found; whatever it returns " "or raises is then returned or raised by :meth:`~object.__getitem__`." msgstr "" +"Este método é chamado pelo método :meth:`~object.__getitem__` da classe :" +"class:`dict` quando a chave solicitada não é encontrada; tudo o que ele " +"retorna ou levanta é então retornado ou levantado por :meth:`~object." +"__getitem__`." #: ../../library/collections.rst:750 msgid "" @@ -1005,10 +1041,15 @@ msgid "" "dictionaries, return ``None`` as a default rather than using :attr:" "`default_factory`." msgstr "" +"Observe que :meth:`__missing__` *não* é chamado para nenhuma operação além " +"de :meth:`~object.__getitem__`. Isso significa que :meth:`get` irá, como " +"dicionários normais, retornar ``None`` como padrão ao invés de usar :attr:" +"`default_factory`." #: ../../library/collections.rst:756 msgid ":class:`defaultdict` objects support the following instance variable:" -msgstr "Objetos :class:`defaultdict` permitem a seguinte variável instanciada:" +msgstr "" +"Objetos :class:`defaultdict` permitem a seguinte variável de instância:" #: ../../library/collections.rst:761 msgid "" @@ -1016,11 +1057,16 @@ msgid "" "from the first argument to the constructor, if present, or to ``None``, if " "absent." msgstr "" +"Este atributo é usado pelo método :meth:`__missing__`; ele é inicializado a " +"partir do primeiro argumento para o construtor, se presente, ou para " +"``None``, se ausente." #: ../../library/collections.rst:765 ../../library/collections.rst:1182 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "" +"Adicionado operadores de mesclagem (``|``) e de atualização (``|=``), " +"especificados na :pep:`584`." #: ../../library/collections.rst:771 msgid ":class:`defaultdict` Examples" @@ -1045,6 +1091,14 @@ msgid "" "list. This technique is simpler and faster than an equivalent technique " "using :meth:`dict.setdefault`:" msgstr "" +"Quando cada chave é encontrada pela primeira vez, ela ainda não está no " +"mapeamento; então uma entrada é criada automaticamente usando a função :attr:" +"`~defaultdict.default_factory` que retorna uma :class:`list` vazia. A " +"operação :meth:`list.append` então anexa o valor à nova lista. Quando as " +"chaves são encontradas novamente, a pesquisa prossegue normalmente " +"(retornando a lista daquela chave) e a operação :meth:`list.append` adiciona " +"outro valor à lista. Esta técnica é mais simples e rápida que uma técnica " +"equivalente usando :meth:`dict.setdefault`:" #: ../../library/collections.rst:799 msgid "" @@ -1052,6 +1106,9 @@ msgid "" "class:`defaultdict` useful for counting (like a bag or multiset in other " "languages):" msgstr "" +"Definir :attr:`~defaultdict.default_factory` como :class:`int` torna :class:" +"`defaultdict` útil para contagem (como um multiconjunto em outras " +"linguagens):" #: ../../library/collections.rst:811 msgid "" @@ -1060,6 +1117,10 @@ msgid "" "default count of zero. The increment operation then builds up the count for " "each letter." msgstr "" +"Quando uma letra é encontrada pela primeira vez, ela está ausente no " +"mapeamento, então a função :attr:`~defaultdict.default_factory` chama :func:" +"`int` para fornecer uma contagem padrão de zero. A operação de incremento " +"então cria a contagem para cada letra." #: ../../library/collections.rst:815 msgid "" @@ -1068,16 +1129,22 @@ msgid "" "functions is to use a lambda function which can supply any constant value " "(not just zero):" msgstr "" +"A função :func:`int` que sempre retorna zero é apenas um caso especial de " +"funções constantes. Uma maneira mais rápida e flexível de criar funções " +"constantes é usar uma função lambda que pode fornecer qualquer valor " +"constante (não apenas zero):" #: ../../library/collections.rst:828 msgid "" "Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :" "class:`defaultdict` useful for building a dictionary of sets:" msgstr "" +"Definir :attr:`~defaultdict.default_factory` como :class:`set` torna :class:" +"`defaultdict` útil para construir um dicionário de conjuntos:" #: ../../library/collections.rst:841 msgid ":func:`namedtuple` Factory Function for Tuples with Named Fields" -msgstr "" +msgstr "Função de fábrica para tuplas com campos nomeados :func:`namedtuple`" #: ../../library/collections.rst:843 msgid "" @@ -1099,6 +1166,12 @@ msgid "" "helpful docstring (with typename and field_names) and a helpful :meth:" "`__repr__` method which lists the tuple contents in a ``name=value`` format." msgstr "" +"Retorna uma nova subclasse de tupla chamada *typename*. A nova subclasse é " +"usada para criar objetos semelhantes a tuplas que possuem campos acessíveis " +"por pesquisa de atributos, além de serem indexáveis ​​e iteráveis. As " +"instâncias da subclasse também possuem uma docstring útil (com typename e " +"field_names) e um método útil :meth:`__repr__` que lista o conteúdo da tupla " +"em um formato ``nome=valor``." #: ../../library/collections.rst:855 msgid "" @@ -1106,6 +1179,10 @@ msgid "" "Alternatively, *field_names* can be a single string with each fieldname " "separated by whitespace and/or commas, for example ``'x y'`` or ``'x, y'``." msgstr "" +"*field_names* são uma sequência de strings como ``['x', 'y']``. " +"Alternativamente, *field_names* pode ser uma única string com cada nome de " +"campo separado por espaços em branco e/ou vírgulas como, por exemplo, ``'x " +"y'`` ou ``'x, y'``." #: ../../library/collections.rst:859 msgid "" @@ -1114,6 +1191,11 @@ msgid "" "and underscores but do not start with a digit or underscore and cannot be a :" "mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or *raise*." msgstr "" +"Qualquer identificador Python válido pode ser usado para um nome de campo, " +"exceto para nomes que começam com um sublinhado. Identificadores válidos " +"consistem em letras, dígitos e sublinhados, mas não começam com um dígito ou " +"sublinhado e não podem ser uma :mod:`keyword` como *class*, *for*, *return*, " +"*global*, *pass* ou *raise*." #: ../../library/collections.rst:865 msgid "" @@ -1122,6 +1204,10 @@ msgid "" "converted to ``['abc', '_1', 'ghi', '_3']``, eliminating the keyword ``def`` " "and the duplicate fieldname ``abc``." msgstr "" +"Se *rename* for verdadeiro, nomes de campos inválidos serão automaticamente " +"substituídos por nomes posicionais. Por exemplo, ``['abc', 'def', 'ghi', " +"'abc']`` é convertido para ``['abc', '_1', 'ghi', '_3']``, eliminando a " +"palavra reservada ``def`` e o nome de campo duplicado ``abc``." #: ../../library/collections.rst:870 msgid "" @@ -1132,24 +1218,36 @@ msgid "" "``x`` will be a required argument, ``y`` will default to ``1``, and ``z`` " "will default to ``2``." msgstr "" +"*defaults* pode ser ``None`` ou um :term:`iterável` de valores padrão. Como " +"os campos com valor padrão devem vir depois de qualquer campo sem padrão, os " +"*padrões* são aplicados aos parâmetros mais à direita. Por exemplo, se os " +"nomes dos campos forem ``['x', 'y', 'z']`` e os padrões forem ``(1, 2)``, " +"então ``x`` será um argumento obrigatório, ``y`` será o padrão ``1``, e " +"``z`` será o padrão ``2``." #: ../../library/collections.rst:877 msgid "" "If *module* is defined, the ``__module__`` attribute of the named tuple is " "set to that value." msgstr "" +"Se *module* for definido, o atributo ``__module__`` da tupla nomeada será " +"definido com esse valor." #: ../../library/collections.rst:880 msgid "" "Named tuple instances do not have per-instance dictionaries, so they are " "lightweight and require no more memory than regular tuples." msgstr "" +"As instâncias de tuplas nomeadas não possuem dicionários por instância, " +"portanto são leves e não requerem mais memória do que as tuplas normais." #: ../../library/collections.rst:883 msgid "" "To support pickling, the named tuple class should be assigned to a variable " "that matches *typename*." msgstr "" +"Para prover suporte para a serialização com pickle, a classe de tupla " +"nomeada deve ser atribuída a uma variável que corresponda a *typename*." #: ../../library/collections.rst:886 msgid "Added support for *rename*." @@ -1160,6 +1258,8 @@ msgid "" "The *verbose* and *rename* parameters became :ref:`keyword-only arguments " "`." msgstr "" +"Os parâmetros *verbose* e *rename* tornaram-se :ref:`argumentos somente-" +"nomeados `." #: ../../library/collections.rst:893 msgid "Added the *module* parameter." @@ -1180,6 +1280,8 @@ msgid "" "Named tuples are especially useful for assigning field names to result " "tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" msgstr "" +"Tuplas nomeadas são especialmente úteis para atribuir nomes de campos a " +"tuplas de resultados retornadas pelos módulos :mod:`csv` ou :mod:`sqlite3`::" #: ../../library/collections.rst:935 msgid "" @@ -1187,11 +1289,16 @@ msgid "" "additional methods and two attributes. To prevent conflicts with field " "names, the method and attribute names start with an underscore." msgstr "" +"Além dos métodos herdados das tuplas, as tuplas nomeadas oferecem suporte a " +"três métodos adicionais e dois atributos. Para evitar conflitos com nomes de " +"campos, os nomes de métodos e atributos começam com um sublinhado." #: ../../library/collections.rst:941 msgid "" "Class method that makes a new instance from an existing sequence or iterable." msgstr "" +"Método de classe que cria uma nova instância a partir de uma sequência " +"existente ou iterável." #: ../../library/collections.rst:951 msgid "" @@ -1203,7 +1310,7 @@ msgstr "" #: ../../library/collections.rst:960 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." -msgstr "" +msgstr "Retorna um :class:`OrderedDict` em vez de um :class:`dict` normal." #: ../../library/collections.rst:963 msgid "" @@ -1212,34 +1319,47 @@ msgid "" "features of :class:`OrderedDict` are required, the suggested remediation is " "to cast the result to the desired type: ``OrderedDict(nt._asdict())``." msgstr "" +"Retorna um :class:`dict` regular em vez de um :class:`OrderedDict`. A partir " +"do Python 3.7, é garantido que os dicionários regulares sejam ordenados. Se " +"os recursos extras de :class:`OrderedDict` forem necessários, a correção " +"sugerida é converter o resultado para o tipo desejado: ``OrderedDict(nt." +"_asdict())``." #: ../../library/collections.rst:972 msgid "" "Return a new instance of the named tuple replacing specified fields with new " "values::" msgstr "" +"Retorna uma nova instância da tupla nomeada substituindo os campos " +"especificados por novos valores::" #: ../../library/collections.rst:984 msgid "" "Tuple of strings listing the field names. Useful for introspection and for " "creating new named tuple types from existing named tuples." msgstr "" +"Tupla de strings listando os nomes dos campos. Útil para introspecção e para " +"criar novos tipos de tuplas nomeadas a partir de tuplas nomeadas existentes." #: ../../library/collections.rst:999 msgid "Dictionary mapping field names to default values." -msgstr "" +msgstr "Dicionário mapeando nomes de campos para valores padrão." #: ../../library/collections.rst:1009 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" "`getattr` function:" msgstr "" +"Para recuperar um campo cujo nome está armazenado em uma string, use a " +"função :func:`getattr`:" #: ../../library/collections.rst:1015 msgid "" "To convert a dictionary to a named tuple, use the double-star-operator (as " "described in :ref:`tut-unpacking-arguments`):" msgstr "" +"Para converter um dicionário em uma tupla nomeada, use o operador estrela " +"dupla (conforme descrito em :ref:`tut-unpacking-arguments`):" #: ../../library/collections.rst:1022 msgid "" @@ -1247,6 +1367,9 @@ msgid "" "functionality with a subclass. Here is how to add a calculated field and a " "fixed-width print format:" msgstr "" +"Como uma tupla nomeada é uma classe regular do Python, é fácil adicionar ou " +"alterar funcionalidades com uma subclasse. Veja como adicionar um campo " +"calculado e um formato de impressão de largura fixa:" #: ../../library/collections.rst:1041 msgid "" @@ -1254,6 +1377,9 @@ msgid "" "keep memory requirements low by preventing the creation of instance " "dictionaries." msgstr "" +"A subclasse mostrada acima define ``__slots__`` como uma tupla vazia. Isso " +"ajuda a manter baixos os requisitos de memória, evitando a criação de " +"dicionários de instância." #: ../../library/collections.rst:1044 msgid "" @@ -1261,16 +1387,21 @@ msgid "" "create a new named tuple type from the :attr:`~somenamedtuple._fields` " "attribute:" msgstr "" +"A criação de subclasse não é útil para adicionar novos campos armazenados. " +"Em vez disso, simplesmente crie um novo tipo de tupla nomeado a partir do " +"atributo :attr:`~somenamedtuple._fields`:" #: ../../library/collections.rst:1049 msgid "" "Docstrings can be customized by making direct assignments to the ``__doc__`` " "fields:" msgstr "" +"Docstrings podem ser personalizados fazendo atribuições diretas aos campos " +"``__doc__``:" #: ../../library/collections.rst:1058 msgid "Property docstrings became writeable." -msgstr "" +msgstr "Os docstrings de propriedade tornaram-se graváveis." #: ../../library/collections.rst:1063 msgid "" @@ -1278,18 +1409,25 @@ msgid "" "tuples. It also provides an elegant notation using the :keyword:`class` " "keyword::" msgstr "" +"Veja :class:`typing.NamedTuple` para uma maneira de adicionar dicas de tipo " +"para tuplas nomeadas. Ele também fornece uma notação elegante usando a " +"palavra reservada :keyword:`class`::" #: ../../library/collections.rst:1072 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " "underlying dictionary instead of a tuple." msgstr "" +"Veja :meth:`types.SimpleNamespace` para um espaço de nomes mutável baseado " +"em um dicionário subjacente em vez de uma tupla." #: ../../library/collections.rst:1075 msgid "" "The :mod:`dataclasses` module provides a decorator and functions for " "automatically adding generated special methods to user-defined classes." msgstr "" +"O módulo :mod:`dataclasses` fornece um decorador e funções para adicionar " +"automaticamente métodos especiais gerados a classes definidas pelo usuário." #: ../../library/collections.rst:1080 msgid ":class:`OrderedDict` objects" @@ -1302,16 +1440,23 @@ msgid "" "important now that the built-in :class:`dict` class gained the ability to " "remember insertion order (this new behavior became guaranteed in Python 3.7)." msgstr "" +"Os dicionários ordenados são como os dicionários normais, mas possuem alguns " +"recursos extras relacionados às operações de pedido. Eles se tornaram menos " +"importantes agora que a classe embutida :class:`dict` ganhou a capacidade de " +"lembrar a ordem de inserção (esse novo comportamento foi garantido no Python " +"3.7)." #: ../../library/collections.rst:1088 msgid "Some differences from :class:`dict` still remain:" -msgstr "" +msgstr "Algumas diferenças de :class:`dict` ainda permanecem:" #: ../../library/collections.rst:1090 msgid "" "The regular :class:`dict` was designed to be very good at mapping " "operations. Tracking insertion order was secondary." msgstr "" +"O :class:`dict` regular foi projetado para ser muito bom em operações de " +"mapeamento. O rastreamento do pedido de inserção era secundário." #: ../../library/collections.rst:1093 msgid "" @@ -1319,6 +1464,9 @@ msgid "" "Space efficiency, iteration speed, and the performance of update operations " "were secondary." msgstr "" +"O :class:`OrderedDict` foi projetado para ser bom em operações de " +"reordenação. A eficiência de espaço, a velocidade de iteração e o desempenho " +"das operações de atualização eram secundários." #: ../../library/collections.rst:1097 msgid "" @@ -1326,29 +1474,42 @@ msgid "" "better than :class:`dict`. As shown in the recipes below, this makes it " "suitable for implementing various kinds of LRU caches." msgstr "" +"O algoritmo :class:`OrderedDict` pode lidar com operações de reordenação " +"frequentes melhor do que :class:`dict`. Conforme mostrado nas receitas " +"abaixo, isso o torna adequado para implementar vários tipos de caches LRU." #: ../../library/collections.rst:1101 msgid "" "The equality operation for :class:`OrderedDict` checks for matching order." msgstr "" +"A operação de igualdade para :class:`OrderedDict` verifica a ordem " +"correspondente." #: ../../library/collections.rst:1103 msgid "" "A regular :class:`dict` can emulate the order sensitive equality test with " "``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." msgstr "" +"Um :class:`dict` regular pode emular o teste de igualdade sensível à ordem " +"com ``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." #: ../../library/collections.rst:1106 msgid "" "The :meth:`popitem` method of :class:`OrderedDict` has a different " "signature. It accepts an optional argument to specify which item is popped." msgstr "" +"O método :meth:`popitem` de :class:`OrderedDict` tem uma assinatura " +"diferente. Ele aceita um argumento opcional para especificar qual item será " +"exibido." #: ../../library/collections.rst:1109 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " "with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." msgstr "" +"Um :class:`dict` normal pode emular o ``od.popitem(last=True)`` do " +"OrderedDict com ``d.popitem()`` que é garantido para exibir o (último) item " +"mais à direita." #: ../../library/collections.rst:1112 msgid "" @@ -1356,12 +1517,17 @@ msgid "" "with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " "leftmost (first) item if it exists." msgstr "" +"Um :class:`dict` normal pode emular o ``od.popitem(last=False)`` do " +"OrderedDict com ``(k := next(iter(d)), d.pop(k))`` que retornará e remova o " +"item mais à esquerda (primeiro), se existir." #: ../../library/collections.rst:1116 msgid "" ":class:`OrderedDict` has a :meth:`move_to_end` method to efficiently " "reposition an element to an endpoint." msgstr "" +":class:`OrderedDict` possui um método :meth:`move_to_end` para reposicionar " +"eficientemente um elemento em um endpoint." #: ../../library/collections.rst:1119 msgid "" @@ -1369,6 +1535,9 @@ msgid "" "last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " "associated value to the rightmost (last) position." msgstr "" +"Um :class:`dict` normal pode emular o ``od.move_to_end(k, last=True)`` do " +"OrderedDict com ``d[k] = d.pop(k)`` que moverá a chave e seu valor associado " +"para a posição mais à direita (última)." #: ../../library/collections.rst:1123 msgid "" @@ -1376,16 +1545,22 @@ msgid "" "OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " "associated value to the leftmost (first) position." msgstr "" +"Um :class:`dict` regular não tem um equivalente eficiente para o ``od." +"move_to_end(k, last=False)`` do OrderedDict, que move a chave e seu valor " +"associado para a posição mais à esquerda (primeira)." #: ../../library/collections.rst:1127 msgid "Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method." msgstr "" +"Até o Python 3.8, :class:`dict` não tinha um método :meth:`__reversed__`." #: ../../library/collections.rst:1132 msgid "" "Return an instance of a :class:`dict` subclass that has methods specialized " "for rearranging dictionary order." msgstr "" +"Retorna uma instância de uma subclasse :class:`dict` que possui métodos " +"especializados para reorganizar a ordem do dicionário." #: ../../library/collections.rst:1139 msgid "" @@ -1394,6 +1569,10 @@ msgid "" "out)` order if *last* is true or :abbr:`FIFO (first-in, first-out)` order if " "false." msgstr "" +"O método :meth:`popitem` para dicionários ordenados retorna e remove um par " +"(chave, valor). Os pares são retornados na ordem :abbr:`LIFO (último a " +"entrar, primeiro a sair)` se *last* for verdadeiro ou na ordem :abbr:`FIFO " +"(primeiro a entrar, primeiro a sair)` se for falso." #: ../../library/collections.rst:1146 msgid "" @@ -1401,6 +1580,10 @@ msgid "" "moved to the right end if *last* is true (the default) or to the beginning " "if *last* is false. Raises :exc:`KeyError` if the *key* does not exist:" msgstr "" +"Move uma chave *key* existente para qualquer extremidade de um dicionário " +"ordenado. O item é movido para a extremidade direita se *last* for " +"verdadeiro (o padrão) ou para o início se *último* for falso. Levanta :exc:" +"`KeyError` se a *key* não existir:" #: ../../library/collections.rst:1163 msgid "" @@ -1419,22 +1602,33 @@ msgid "" "allows :class:`OrderedDict` objects to be substituted anywhere a regular " "dictionary is used." msgstr "" +"Testes de igualdade entre objetos :class:`OrderedDict` são sensíveis à ordem " +"e são implementados como ``list(od1.items())==list(od2.items())``. Testes de " +"igualdade entre objetos :class:`OrderedDict` e outros objetos :class:" +"`~collections.abc.Mapping` são insensíveis à ordem como dicionários " +"regulares. Isso permite que objetos :class:`OrderedDict` sejam substituídos " +"em qualquer lugar que um dicionário regular seja usado." #: ../../library/collections.rst:1173 msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." msgstr "" +"Os itens, chaves e valores de :term:`visões ` de :class:" +"`OrderedDict` agora oferecem suporte a iteração reversa usando :func:" +"`reversed`." #: ../../library/collections.rst:1177 msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " "passed to the :class:`OrderedDict` constructor and its :meth:`update` method." msgstr "" +"Com a aceitação da :pep:`468`, a ordem é mantida para argumentos nomeados " +"passados ​​para o construtor :class:`OrderedDict` e seu método :meth:`update`." #: ../../library/collections.rst:1187 msgid ":class:`OrderedDict` Examples and Recipes" -msgstr "" +msgstr "Exemplos e receitas de :class:`OrderedDict`" #: ../../library/collections.rst:1189 msgid "" @@ -1443,16 +1637,22 @@ msgid "" "existing entry, the original insertion position is changed and moved to the " "end::" msgstr "" +"É simples criar uma variante de dicionário ordenado que lembre a ordem em " +"que as chaves foram inseridas pela *última* vez. Se uma nova entrada " +"substituir uma entrada existente, a posição de inserção original será " +"alterada e movida para o final::" #: ../../library/collections.rst:1201 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "func:`functools.lru_cache`:" msgstr "" +"Um :class:`OrderedDict` também seria útil para implementar variantes de :" +"func:`functools.lru_cache`:" #: ../../library/collections.rst:1300 msgid ":class:`UserDict` objects" -msgstr "" +msgstr "Objetos :class:`UserDict`" #: ../../library/collections.rst:1302 msgid "" @@ -1461,6 +1661,11 @@ msgid "" "subclass directly from :class:`dict`; however, this class can be easier to " "work with because the underlying dictionary is accessible as an attribute." msgstr "" +"A classe :class:`UserDict` atua como um invólucro em torno de objetos " +"dicionário. A necessidade desta classe foi parcialmente suplantada pela " +"capacidade de criar subclasses diretamente de :class:`dict`; entretanto, " +"essa classe pode ser mais fácil de trabalhar porque o dicionário subjacente " +"é acessível como um atributo." #: ../../library/collections.rst:1310 msgid "" @@ -1470,21 +1675,30 @@ msgid "" "initialized with its contents; note that a reference to *initialdata* will " "not be kept, allowing it to be used for other purposes." msgstr "" +"Classe que simula um dicionário. O conteúdo da instância é mantido em um " +"dicionário regular, que é acessível através do atributo :attr:`data` das " +"instâncias :class:`UserDict`. Se *initialdata* for fornecido, :attr:`data` é " +"inicializado com seu conteúdo; observe que a referência a *initialdata* não " +"será mantida, permitindo sua utilização para outros fins." #: ../../library/collections.rst:1316 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" msgstr "" +"Além de prover suporte aos métodos e operações de mapeamentos, as " +"instâncias :class:`UserDict` fornecem o seguinte atributo:" #: ../../library/collections.rst:1321 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "" +"Um dicionário real usado para armazenar o conteúdo da classe :class:" +"`UserDict`." #: ../../library/collections.rst:1327 msgid ":class:`UserList` objects" -msgstr "" +msgstr "Objetos :class:`UserList`" #: ../../library/collections.rst:1329 msgid "" @@ -1493,6 +1707,10 @@ msgid "" "existing methods or add new ones. In this way, one can add new behaviors to " "lists." msgstr "" +"Esta classe atua como um invólucro em torno de objetos de lista. É uma " +"classe base útil para suas próprias classes semelhantes a listas, que podem " +"herdar delas e substituir métodos existentes ou adicionar novos. Desta " +"forma, é possível adicionar novos comportamentos às listas." #: ../../library/collections.rst:1334 msgid "" @@ -1500,6 +1718,10 @@ msgid "" "subclass directly from :class:`list`; however, this class can be easier to " "work with because the underlying list is accessible as an attribute." msgstr "" +"A necessidade desta classe foi parcialmente suplantada pela capacidade de " +"criar subclasses diretamente de :class:`list`; no entanto, pode ser mais " +"fácil trabalhar com essa classe porque a lista subjacente pode ser acessada " +"como um atributo." #: ../../library/collections.rst:1340 msgid "" @@ -1509,18 +1731,27 @@ msgid "" "of *list*, defaulting to the empty list ``[]``. *list* can be any iterable, " "for example a real Python list or a :class:`UserList` object." msgstr "" +"Classe que simula uma lista. O conteúdo da instância é mantido em uma lista " +"regular, que é acessível através do atributo :attr:`data` das instâncias :" +"class:`UserList`. O conteúdo da instância é inicialmente definido como uma " +"cópia de *list*, padronizando a lista vazia ``[]``. *list* pode ser qualquer " +"iterável, por exemplo, uma lista Python real ou um objeto :class:`UserList`." #: ../../library/collections.rst:1346 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" msgstr "" +"Além de prover suporte aos métodos e operações de sequências mutáveis, as " +"instâncias :class:`UserList` fornecem o seguinte atributo:" #: ../../library/collections.rst:1351 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." msgstr "" +"Um objeto :class:`list` real usado para armazenar o conteúdo da classe :" +"class:`UserList`." #: ../../library/collections.rst:1354 msgid "" @@ -1531,6 +1762,12 @@ msgid "" "constructor can be called with a single parameter, which is a sequence " "object used as a data source." msgstr "" +"**Requisitos para criar subclasse:** Espera-se que as subclasses de :class:" +"`UserList` ofereçam um construtor que pode ser chamado sem argumentos ou com " +"um argumento. Listar operações que retornam uma nova sequência tenta criar " +"uma instância da classe de implementação real. Para isso, presume que o " +"construtor pode ser chamado com um único parâmetro, que é um objeto de " +"sequência usado como fonte de dados." #: ../../library/collections.rst:1361 msgid "" @@ -1539,10 +1776,14 @@ msgid "" "consult the sources for information about the methods which need to be " "provided in that case." msgstr "" +"Se uma classe derivada não desejar atender a este requisito, todos os " +"métodos especiais suportados por esta classe precisarão ser substituídos; " +"consulte as fontes para obter informações sobre os métodos que precisam ser " +"fornecidos nesse caso." #: ../../library/collections.rst:1367 msgid ":class:`UserString` objects" -msgstr "" +msgstr "Objetos :class:`UserString`" #: ../../library/collections.rst:1369 msgid "" @@ -1551,6 +1792,11 @@ msgid "" "directly from :class:`str`; however, this class can be easier to work with " "because the underlying string is accessible as an attribute." msgstr "" +"A classe :class:`UserString` atua como um invólucro em torno de objetos " +"string. A necessidade desta classe foi parcialmente suplantada pela " +"capacidade de criar subclasses diretamente de :class:`str`; entretanto, essa " +"classe pode ser mais fácil de trabalhar porque a string subjacente é " +"acessível como um atributo." #: ../../library/collections.rst:1377 msgid "" @@ -1560,21 +1806,32 @@ msgid "" "to a copy of *seq*. The *seq* argument can be any object which can be " "converted into a string using the built-in :func:`str` function." msgstr "" +"Classe que simula um objeto string. O conteúdo da instância é mantido em um " +"objeto string regular, que é acessível através do atributo :attr:`data` das " +"instâncias :class:`UserString`. O conteúdo da instância é inicialmente " +"definido como uma cópia de *seq*. O argumento *seq* pode ser qualquer objeto " +"que possa ser convertido em uma string usando a função embutida :func:`str`." #: ../../library/collections.rst:1384 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" msgstr "" +"Além de prover suporte aos métodos e operações de strings, as instâncias :" +"class:`UserString` fornecem o seguinte atributo:" #: ../../library/collections.rst:1389 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." msgstr "" +"Um objeto :class:`str` real usado para armazenar o conteúdo da classe :class:" +"`UserString`." #: ../../library/collections.rst:1392 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." msgstr "" +"Novos métodos ``__getnewargs__``, ``__rmod__``, ``casefold``, " +"``format_map``, ``isprintable`` e ``maketrans``." diff --git a/library/colorsys.po b/library/colorsys.po index 7d5e527e9..6f63b5341 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Italo Penaforte , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/colorsys.rst:2 msgid ":mod:`!colorsys` --- Conversions between color systems" -msgstr "" +msgstr ":mod:`!colorsys` --- Conversões entre sistemas de cores" #: ../../library/colorsys.rst:9 msgid "**Source code:** :source:`Lib/colorsys.py`" diff --git a/library/compileall.po b/library/compileall.po index 60f2842ba..e08ca42fa 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/compileall.rst:2 msgid ":mod:`!compileall` --- Byte-compile Python libraries" -msgstr "" +msgstr ":mod:`!compileall` --- Compilar bibliotecas do Python para bytecode" #: ../../library/compileall.rst:7 msgid "**Source code:** :source:`Lib/compileall.py`" @@ -454,6 +454,7 @@ msgstr "O parâmetro *invalidation_mode* foi adicionado." msgid "" "The *invalidation_mode* parameter's default value is updated to ``None``." msgstr "" +"O valor padrão do parâmetro *invalidation_mode* é atualizado para ``None``." #: ../../library/compileall.rst:231 msgid "Setting *workers* to 0 now chooses the optimal number of cores." diff --git a/library/concurrency.po b/library/concurrency.po index 791fe085f..37b1bdcc7 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Hildeberto Abreu Magalhães , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 81e9f0c65..e897acf7b 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/concurrent.po b/library/concurrent.po index aadf59d92..359a906b7 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/configparser.po b/library/configparser.po index 5941eb7bd..7aa9929bd 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -20,16 +20,17 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/configparser.rst:2 msgid ":mod:`!configparser` --- Configuration file parser" msgstr "" +":mod:`!configparser` --- Analisador sintático de arquivo de configuração" #: ../../library/configparser.rst:14 msgid "**Source code:** :source:`Lib/configparser.py`" @@ -42,50 +43,64 @@ msgid "" "found in Microsoft Windows INI files. You can use this to write Python " "programs which can be customized by end users easily." msgstr "" +"Este módulo fornece a classe :class:`ConfigParser` que implementa uma " +"linguagem de configuração básica que fornece uma estrutura semelhante à " +"encontrada nos arquivos INI do Microsoft Windows. Você pode usar isso para " +"escrever programas Python que podem ser facilmente personalizados pelos " +"usuários finais." #: ../../library/configparser.rst:31 msgid "" "This library does *not* interpret or write the value-type prefixes used in " "the Windows Registry extended version of INI syntax." msgstr "" +"Esta biblioteca *não* interpreta ou escreve os prefixos de tipo de valor " +"usados ​​na versão estendida do Registro do Windows da sintaxe INI." #: ../../library/configparser.rst:36 msgid "Module :mod:`tomllib`" -msgstr "" +msgstr "Módulo :mod:`tomllib`" #: ../../library/configparser.rst:37 msgid "" "TOML is a well-specified format for application configuration files. It is " "specifically designed to be an improved version of INI." msgstr "" +"TOML é um formato bem especificado para arquivos de configuração de " +"aplicações. Ele foi projetado especificamente para ser uma versão melhorada " +"do INI." #: ../../library/configparser.rst:40 msgid "Module :mod:`shlex`" -msgstr "" +msgstr "Módulo :mod:`shlex`" #: ../../library/configparser.rst:41 msgid "" "Support for creating Unix shell-like mini-languages which can also be used " "for application configuration files." msgstr "" +"Suporte para criação de minilinguagens semelhantes a shell Unix que também " +"podem ser usadas para arquivos de configuração de aplicações." #: ../../library/configparser.rst:44 msgid "Module :mod:`json`" -msgstr "" +msgstr "Módulo :mod:`json`" #: ../../library/configparser.rst:45 msgid "" "The ``json`` module implements a subset of JavaScript syntax which is " "sometimes used for configuration, but does not support comments." msgstr "" +"O módulo ``json`` implementa um subconjunto de sintaxe JavaScript que às " +"vezes é usado para configuração, mas não suporta comentários." #: ../../library/configparser.rst:60 msgid "Quick Start" -msgstr "" +msgstr "Início rápido" #: ../../library/configparser.rst:62 msgid "Let's take a very basic configuration file that looks like this:" -msgstr "" +msgstr "Vamos pegar um arquivo de configuração bem básico parecido com este:" #: ../../library/configparser.rst:79 msgid "" @@ -95,6 +110,11 @@ msgid "" "classes can read and write such files. Let's start by creating the above " "configuration file programmatically." msgstr "" +"A estrutura dos arquivos INI é descrita `na seção seguinte <#supported-ini-" +"file-structure>`_. Essencialmente, o arquivo consiste em seções, cada uma " +"contendo chaves com valores. As classes :mod:`configparser` podem ler e " +"escrever tais arquivos. Vamos começar criando o arquivo de configuração " +"acima programaticamente." #: ../../library/configparser.rst:103 msgid "" @@ -102,12 +122,18 @@ msgid "" "are differences, `outlined later <#mapping-protocol-access>`_, but the " "behavior is very close to what you would expect from a dictionary." msgstr "" +"Como você pode ver, podemos tratar um analisador sintático de configuração " +"como um dicionário. Existem diferenças, `descritas posteriormente <#mapping-" +"protocol-access>`_, mas o comportamento é muito próximo do que você " +"esperaria de um dicionário." #: ../../library/configparser.rst:107 msgid "" "Now that we have created and saved a configuration file, let's read it back " "and explore the data it holds." msgstr "" +"Agora que criamos e salvamos um arquivo de configuração, vamos lê-lo e " +"explorar os dados que ele contém." #: ../../library/configparser.rst:142 msgid "" @@ -116,6 +142,10 @@ msgid "" "other sections [1]_. Note also that keys in sections are case-insensitive " "and stored in lowercase [1]_." msgstr "" +"Como podemos ver acima, a API é bastante simples. A única mágica envolve a " +"seção ``DEFAULT`` que fornece valores padrão para todas as outras seções " +"[1]_. Observe também que as chaves nas seções não diferenciam maiúsculas de " +"minúsculas e são armazenadas em letras minúsculas [1]_." #: ../../library/configparser.rst:147 msgid "" @@ -130,10 +160,12 @@ msgid "" "This behaviour is equivalent to a :meth:`ConfigParser.read` call with " "several files passed to the *filenames* parameter." msgstr "" +"Este comportamento é equivalente a uma chamada :meth:`ConfigParser.read` com " +"vários arquivos passados ​​para o parâmetro *filenames*." #: ../../library/configparser.rst:173 msgid "Supported Datatypes" -msgstr "" +msgstr "Tipos de dados suportados" #: ../../library/configparser.rst:175 msgid "" @@ -141,6 +173,10 @@ msgid "" "always storing them internally as strings. This means that if you need " "other datatypes, you should convert on your own:" msgstr "" +"Os analisadores sintáticos de configuração não adivinham os tipos de dados " +"dos valores nos arquivos de configuração, sempre os armazenando internamente " +"como strings. Isso significa que se você precisar de outros tipos de dados, " +"deverá converter por conta própria:" #: ../../library/configparser.rst:186 msgid "" @@ -152,6 +188,15 @@ msgid "" "and recognizes Boolean values from ``'yes'``/``'no'``, ``'on'``/``'off'``, " "``'true'``/``'false'`` and ``'1'``/``'0'`` [1]_. For example:" msgstr "" +"Como essa tarefa é tão comum, os analisadores sintáticos de configuração " +"fornecem uma variedade de métodos getter úteis para manipular com números " +"inteiros, pontos flutuantes e booleanos. O último é o mais interessante " +"porque simplesmente passar o valor para ``bool()`` não adiantaria nada já " +"que ``bool('False')`` ainda é ``True``. É por isso que os analisadores " +"sintáticos de configuração também fornecem :meth:`~ConfigParser.getboolean`. " +"Este método não diferencia maiúsculas de minúsculas e reconhece valores " +"booleanos de ``'yes'``/``'no'``, ``'on'``/``'off'``, ``'true'`` /``'false'`` " +"e ``'1'``/``'0'`` [1]_. Por exemplo:" #: ../../library/configparser.rst:203 msgid "" @@ -160,16 +205,22 @@ msgid "" "methods. You can register your own converters and customize the provided " "ones. [1]_" msgstr "" +"Além de :meth:`~ConfigParser.getboolean`, os analisadores sintáticos de " +"configuração também fornecem métodos :meth:`~ConfigParser.getint` e :meth:" +"`~ConfigParser.getfloat` equivalentes. Você pode registrar seus próprios " +"conversores e personalizar os fornecidos. [1]_" #: ../../library/configparser.rst:209 msgid "Fallback Values" -msgstr "" +msgstr "Valores reservas" #: ../../library/configparser.rst:211 msgid "" "As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " "method to provide fallback values:" msgstr "" +"Assim como acontece com um dicionário, você pode usar o método :meth:" +"`~ConfigParser.get` de uma seção para fornecer valores reservas (fallback):" #: ../../library/configparser.rst:224 msgid "" @@ -179,6 +230,11 @@ msgid "" "``'topsecret.server.example'``, we will always get the default, even if we " "specify a fallback:" msgstr "" +"Observe que os valores padrão têm precedência sobre os valores substitutos. " +"Por exemplo, em nosso exemplo a chave ``'CompressionLevel'`` foi " +"especificada apenas na seção ``'DEFAULT'``. Se tentarmos obtê-lo na seção " +"``'topsecret.server.example'``, sempre obteremos o padrão, mesmo se " +"especificarmos um substituto:" #: ../../library/configparser.rst:235 msgid "" @@ -187,6 +243,11 @@ msgid "" "backwards compatibility. When using this method, a fallback value can be " "provided via the ``fallback`` keyword-only argument:" msgstr "" +"Mais uma coisa a ter em conta é que o método :meth:`~ConfigParser.get` no " +"nível do analisador fornece uma interface personalizada e mais complexa, " +"mantida para compatibilidade com versões anteriores. Ao usar este método, um " +"valor substituto pode ser fornecido através do argumento somente-nomeado " +"``fallback``:" #: ../../library/configparser.rst:246 msgid "" @@ -194,6 +255,9 @@ msgid "" "getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " "methods, for example:" msgstr "" +"O mesmo argumento ``fallback`` pode ser usado com os métodos :meth:" +"`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat` e :meth:" +"`~ConfigParser.getboolean`, por exemplo:" #: ../../library/configparser.rst:262 msgid "Supported INI File Structure" @@ -211,12 +275,25 @@ msgid "" "of the value. Depending on the parser's mode, blank lines may be treated as " "parts of multiline values or ignored." msgstr "" +"Um arquivo de configuração consiste em seções, cada uma liderada por um " +"cabeçalho ``[section]``, seguido por entradas de chave/valor separadas por " +"uma string específica (``=`` ou ``:`` por padrão [1]_) . Por padrão, os " +"nomes das seções diferenciam maiúsculas de minúsculas, mas as chaves não " +"[1]_. Os espaços em branco à esquerda e à direita são removidos das chaves e " +"dos valores. Os valores podem ser omitidos se o analisador sintático estiver " +"configurado para permitir [1]_, caso em que o delimitador chave/valor também " +"pode ser omitido. Os valores também podem abranger várias linhas, desde que " +"sejam indentados de forma mais profunda que a primeira linha do valor. " +"Dependendo do modo do analisador sintático, as linhas em branco podem ser " +"tratadas como partes de valores multilinhas ou ignoradas." #: ../../library/configparser.rst:274 msgid "" "By default, a valid section name can be any string that does not contain '\\" "\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." msgstr "" +"Por padrão, um nome de seção válido pode ser qualquer string que não " +"contenha '\\\\n'. Para alterar isso, consulte :attr:`ConfigParser.SECTCRE`." #: ../../library/configparser.rst:277 msgid "" @@ -224,6 +301,9 @@ msgid "" "(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " "otherwise empty line, possibly indented. [1]_" msgstr "" +"Os arquivos de configuração podem incluir comentários, prefixados por " +"caracteres específicos (``#`` e ``;`` por padrão [1]_). Os comentários podem " +"aparecer sozinhos em uma linha vazia, possivelmente identados. [1]_" #: ../../library/configparser.rst:281 ../../library/configparser.rst:344 msgid "For example:" @@ -231,7 +311,7 @@ msgstr "Por exemplo:" #: ../../library/configparser.rst:329 msgid "Interpolation of values" -msgstr "" +msgstr "Interpolação de valores" #: ../../library/configparser.rst:331 msgid "" @@ -239,6 +319,9 @@ msgid "" "interpolation. This means values can be preprocessed before returning them " "from ``get()`` calls." msgstr "" +"Além da funcionalidade principal, :class:`ConfigParser` oferece suporte a " +"interpolação. Isso significa que os valores podem ser pré-processados ​​antes " +"de retorná-los das chamadas ``get()``." #: ../../library/configparser.rst:339 msgid "" @@ -247,6 +330,10 @@ msgid "" "or values in the special default section [1]_. Additional default values " "can be provided on initialization." msgstr "" +"A implementação padrão usada por :class:`ConfigParser`. Ele permite que os " +"valores contenham strings de formato que se referem a outros valores na " +"mesma seção ou valores na seção padrão especial [1]_. Valores padrão " +"adicionais podem ser fornecidos na inicialização." #: ../../library/configparser.rst:357 msgid "" @@ -257,6 +344,12 @@ msgid "" "keys used in the chain of references do not have to be specified in any " "specific order in the configuration file." msgstr "" +"No exemplo acima, :class:`ConfigParser` com *interpolation* definido como " +"``BasicInterpolation()`` resolveria ``%(home_dir)s`` para o valor de " +"``home_dir`` (``/Users`` neste caso). ``%(my_dir)s`` na verdade resolveria " +"para ``/Users/lumberjack``. Todas as interpolações são feitas sob demanda, " +"portanto as chaves usadas na cadeia de referências não precisam ser " +"especificadas em nenhuma ordem específica no arquivo de configuração." #: ../../library/configparser.rst:364 msgid "" @@ -264,6 +357,9 @@ msgid "" "``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" "lumberjack`` as the value of ``my_dir``." msgstr "" +"Com ``interpolation`` definido como ``None``, o analisador sintático " +"simplesmente retornaria ``%(my_dir)s/Pictures`` como o valor de " +"``my_pictures`` e ``%(home_dir)s/lumberjack`` como o valor de ``my_dir``." #: ../../library/configparser.rst:372 msgid "" @@ -274,20 +370,28 @@ msgid "" "`` part is omitted, interpolation defaults to the current section (and " "possibly the default values from the special section)." msgstr "" +"Um manipulador alternativo para interpolação que implementa uma sintaxe mais " +"avançada, usada, por exemplo, em ``zc.buildout``. A interpolação estendida " +"usa ``${section:option}`` para denotar um valor de uma seção estrangeira. A " +"interpolação pode abranger vários níveis. Por conveniência, se a parte " +"``section:`` for omitida, a interpolação será padronizada para a seção atual " +"(e possivelmente para os valores padrão da seção especial)." #: ../../library/configparser.rst:379 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" msgstr "" +"Por exemplo, a configuração especificada acima com interpolação básica " +"ficaria assim com interpolação estendida:" #: ../../library/configparser.rst:393 msgid "Values from other sections can be fetched as well:" -msgstr "" +msgstr "Valores de outras seções também podem ser obtidos:" #: ../../library/configparser.rst:415 msgid "Mapping Protocol Access" -msgstr "" +msgstr "Acesso através do protocolo de mapeamento" #: ../../library/configparser.rst:419 msgid "" @@ -296,6 +400,10 @@ msgid "" "`configparser`, the mapping interface implementation is using the " "``parser['section']['option']`` notation." msgstr "" +"Acesso através do protocolo de mapeamento é um nome genérico para " +"funcionalidade que permite usar objetos personalizados como se fossem " +"dicionários. No caso de :mod:`configparser`, a implementação da interface de " +"mapeamento está usando a notação ``parser['section']['option']``." #: ../../library/configparser.rst:424 msgid "" @@ -305,6 +413,12 @@ msgid "" "values are changed on a section proxy, they are actually mutated in the " "original parser." msgstr "" +"``parser['section']`` em particular retorna um intermediário para os dados " +"da seção no analisador sintático. Isso significa que os valores não são " +"copiados, mas obtidos do analisador sintático original sob demanda. O que é " +"ainda mais importante é que quando os valores são alterados em um " +"intermediário de seção, eles são, na verdade, modificados no analisador " +"sintático original." #: ../../library/configparser.rst:430 msgid "" @@ -313,6 +427,10 @@ msgid "" "`~collections.abc.MutableMapping` ABC. However, there are a few differences " "that should be taken into account:" msgstr "" +"Os objetos :mod:`configparser` se comportam o mais próximo possível dos " +"dicionários reais. A interface de mapeamento é completa e segue a ABC :class:" +"`~collections.abc.MutableMapping`. No entanto, existem algumas diferenças " +"que devem ser levadas em consideração:" #: ../../library/configparser.rst:435 msgid "" @@ -322,6 +440,12 @@ msgid "" "default. At the same time, for a section that holds the key ``'a'``, both " "expressions return ``True``::" msgstr "" +"Por padrão, todas as chaves nas seções são acessíveis sem distinção entre " +"maiúsculas e minúsculas [1]_. Por exemplo. ``for option in " +"parser[\"section\"]`` produz apenas nomes de chaves de opção " +"``optionxform``\\ ada. Isso significa chaves em letras minúsculas por " +"padrão. Ao mesmo tempo, para uma seção que contém a chave ``'a'``, ambas as " +"expressões retornam ``True``::" #: ../../library/configparser.rst:443 msgid "" @@ -332,22 +456,28 @@ msgid "" "deleting causes the default value to be visible again. Trying to delete a " "default value causes a :exc:`KeyError`." msgstr "" +"Todas as seções também incluem valores ``DEFAULTSECT``, o que significa que " +"``.clear()`` em uma seção não pode deixá-la visivelmente vazia. Isso ocorre " +"porque os valores padrão não podem ser excluídos da seção (porque " +"tecnicamente eles não estão lá). Se eles forem substituídos na seção, a " +"exclusão fará com que o valor padrão fique visível novamente. Tentar excluir " +"um valor padrão causa um :exc:`KeyError`." #: ../../library/configparser.rst:450 msgid "``DEFAULTSECT`` cannot be removed from the parser:" -msgstr "" +msgstr "``DEFAULTSECT`` não pode ser removido do analisador sintático:" #: ../../library/configparser.rst:452 msgid "trying to delete it raises :exc:`ValueError`," -msgstr "" +msgstr "tentar excluí-lo levanta :exc:`ValueError`," #: ../../library/configparser.rst:454 msgid "``parser.clear()`` leaves it intact," -msgstr "" +msgstr "``parser.clear()`` deixa-o intacto," #: ../../library/configparser.rst:456 msgid "``parser.popitem()`` never returns it." -msgstr "" +msgstr "``parser.popitem()`` nunca o retorna." #: ../../library/configparser.rst:458 msgid "" @@ -355,6 +485,10 @@ msgid "" "fallback value. Note however that the section-level ``get()`` methods are " "compatible both with the mapping protocol and the classic configparser API." msgstr "" +"``parser.get(section, option, **kwargs)`` - o segundo argumento **não** é um " +"valor substituto. Observe, entretanto, que os métodos ``get()`` em nível de " +"seção são compatíveis tanto com o protocolo de mapeamento quanto com a API " +"clássica do configparser." #: ../../library/configparser.rst:462 msgid "" @@ -365,6 +499,12 @@ msgid "" "*value* pairs for a specified ``section``, with all interpolations expanded " "(unless ``raw=True`` is provided)." msgstr "" +"``parser.items()`` é compatível com o protocolo de mapeamento (retorna uma " +"lista de pares *section_name*, *section_proxy* incluindo o DEFAULTSECT). " +"Entretanto, este método também pode ser invocado com argumentos: ``parser." +"items(section, raw, vars)``. A última chamada retorna uma lista de pares " +"*option*, *value* para uma ``section`` especificada, com todas as " +"interpolações expandidas (a menos que ``raw=True`` seja fornecido)." #: ../../library/configparser.rst:469 msgid "" @@ -372,10 +512,13 @@ msgid "" "that subclasses overriding the original interface still should have mappings " "working as expected." msgstr "" +"O protocolo de mapeamento é implementado sobre a API legada existente para " +"que as subclasses que substituem a interface original ainda tenham " +"mapeamentos funcionando conforme o esperado." #: ../../library/configparser.rst:475 msgid "Customizing Parser Behaviour" -msgstr "" +msgstr "Personalizando o comportamento do analisador sintático" #: ../../library/configparser.rst:477 msgid "" @@ -385,16 +528,23 @@ msgid "" "dictated by historical background and it's very likely that you will want to " "customize some of the features." msgstr "" +"Existem quase tantas variantes de formato INI quanto aplicações que o " +"utilizam. :mod:`configparser` percorre um longo caminho para fornecer " +"suporte para o maior conjunto sensato de estilos INI disponíveis. A " +"funcionalidade padrão é determinada principalmente pelo histórico e é muito " +"provável que você queira personalizar alguns dos recursos." #: ../../library/configparser.rst:483 msgid "" "The most common way to change the way a specific config parser works is to " "use the :meth:`!__init__` options:" msgstr "" +"A maneira mais comum de alterar a forma como um analisador sintático de " +"configuração específico funciona é usar as opções :meth:`!__init__`:" #: ../../library/configparser.rst:486 msgid "*defaults*, default value: ``None``" -msgstr "" +msgstr "*defaults*, valor padrão: ``None``" #: ../../library/configparser.rst:488 msgid "" @@ -403,16 +553,22 @@ msgid "" "concise configuration files that don't specify values which are the same as " "the documented default." msgstr "" +"Esta opção aceita um dicionário de pares chave-valor que será inicialmente " +"colocado na seção ``DEFAULT``. Isso é uma maneira elegante de oferecer " +"suporte a arquivos de configuração concisos que não especificam valores " +"iguais ao padrão documentado." #: ../../library/configparser.rst:493 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" +"Dica: se você deseja especificar valores padrão para uma seção específica, " +"use :meth:`~ConfigParser.read_dict` antes de ler o arquivo real." #: ../../library/configparser.rst:496 msgid "*dict_type*, default value: :class:`dict`" -msgstr "" +msgstr "*dict_type*, valor padrão: :class:`dict`" #: ../../library/configparser.rst:498 msgid "" @@ -421,12 +577,18 @@ msgid "" "every section is stored in the order they were added to the parser. Same " "goes for options within sections." msgstr "" +"Esta opção tem um grande impacto no comportamento do protocolo de mapeamento " +"e na aparência dos arquivos de configuração gravados. Com o dicionário " +"padrão, cada seção é armazenada na ordem em que foram adicionadas ao " +"analisador sintático. O mesmo vale para opções dentro das seções." #: ../../library/configparser.rst:503 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." msgstr "" +"Um tipo de dicionário alternativo pode ser usado, por exemplo, para ordenar " +"as seções e opções ao fazer *write-back*." #: ../../library/configparser.rst:506 msgid "" @@ -434,10 +596,13 @@ msgid "" "operation. When you use a regular dictionary in those operations, the order " "of the keys will be ordered. For example:" msgstr "" +"Observação: existem maneiras de adicionar um conjunto de pares de valores-" +"chave em uma única operação. Quando você usa um dicionário regular nessas " +"operações, a classificação das chaves será ordenada. Por exemplo:" #: ../../library/configparser.rst:528 msgid "*allow_no_value*, default value: ``False``" -msgstr "" +msgstr "*allow_no_value*, valor padrão: ``False``" #: ../../library/configparser.rst:530 msgid "" @@ -446,10 +611,14 @@ msgid "" "*allow_no_value* parameter to the constructor can be used to indicate that " "such values should be accepted:" msgstr "" +"Alguns arquivos de configuração são conhecidos por incluir configurações sem " +"valores, mas que de outra forma estão em conformidade com a sintaxe " +"suportada por :mod:`configparser`. O parâmetro *allow_no_value* para o " +"construtor pode ser usado para indicar que tais valores devem ser aceitos:" #: ../../library/configparser.rst:565 msgid "*delimiters*, default value: ``('=', ':')``" -msgstr "" +msgstr "*delimiters*, valor padrão: ``('=', ':')``" #: ../../library/configparser.rst:567 msgid "" @@ -457,20 +626,26 @@ msgid "" "The first occurrence of a delimiting substring on a line is considered a " "delimiter. This means values (but not keys) can contain the delimiters." msgstr "" +"Delimitadores são substrings que delimitam chaves de valores dentro de uma " +"seção. A primeira ocorrência de uma substring delimitadora em uma linha é " +"considerada um delimitador. Isso significa que os valores (mas não as " +"chaves) podem conter os delimitadores." #: ../../library/configparser.rst:571 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." msgstr "" +"Veja também o argumento *space_around_delimiters* para :meth:`ConfigParser." +"write`." #: ../../library/configparser.rst:574 msgid "*comment_prefixes*, default value: ``('#', ';')``" -msgstr "" +msgstr "*comment_prefixes*, valor padrão: ``('#', ';')``" #: ../../library/configparser.rst:576 msgid "*inline_comment_prefixes*, default value: ``None``" -msgstr "" +msgstr "*inline_comment_prefixes*, valor padrão: ``None``" #: ../../library/configparser.rst:578 msgid "" @@ -481,12 +656,21 @@ msgid "" "well). By default inline comments are disabled and ``'#'`` and ``';'`` are " "used as prefixes for whole line comments." msgstr "" +"Prefixos de comentários são strings que indicam o início de um comentário " +"válido em um arquivo de configuração. *comment_prefixes* são usados ​​apenas " +"em linhas vazias (opcionalmente indentadas), enquanto " +"*inline_comment_prefixes* pode ser usado após cada valor válido (por " +"exemplo, nomes de seções, opções e linhas vazias também). Por padrão, os " +"comentários embutidos estão desabilitados e ``'#'`` e ``';'`` são usados ​​" +"como prefixos para comentários de linha inteira." #: ../../library/configparser.rst:585 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" +"Nas versões anteriores do :mod:`configparser`, o comportamento correspondia " +"a ``comment_prefixes=('#',';')`` e ``inline_comment_prefixes=(';',)``." #: ../../library/configparser.rst:589 msgid "" @@ -497,10 +681,17 @@ msgid "" "storing comment prefix characters at the beginning of a line in multiline " "values is to interpolate the prefix, for example::" msgstr "" +"Observe que os analisadores sintáticos de configuração não oferecem suporte " +"a escape de prefixos de comentários, portanto, usar " +"*inline_comment_prefixes* pode impedir que os usuários especifiquem valores " +"de opção com caracteres usados ​​como prefixos de comentários. Em caso de " +"dúvida, evite definir *inline_comment_prefixes*. Em qualquer circunstância, " +"a única maneira de armazenar caracteres de prefixo de comentário no início " +"de uma linha em valores multilinha é interpolar o prefixo, por exemplo::" #: ../../library/configparser.rst:635 msgid "*strict*, default value: ``True``" -msgstr "*strict*, o valor padrão é: ``True``" +msgstr "*strict*, valor padrão: ``True``" #: ../../library/configparser.rst:637 msgid "" @@ -509,12 +700,19 @@ msgid "" "read_file`, :meth:`~ConfigParser.read_string` or :meth:`~ConfigParser." "read_dict`). It is recommended to use strict parsers in new applications." msgstr "" +"Ao definir como ``True``, o analisador sintático não permitirá nenhuma seção " +"ou opção duplicada durante a leitura de uma única fonte (usando :meth:" +"`~ConfigParser.read_file`, :meth:`~ConfigParser.read_string` ou :meth:" +"`~ConfigParser.read_dict`). Recomenda-se usar analisadores sintáticos " +"estritos em novas aplicações." #: ../../library/configparser.rst:642 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." msgstr "" +"Nas versões anteriores do :mod:`configparser`, o comportamento correspondia " +"a ``strict=False``." #: ../../library/configparser.rst:646 msgid "*empty_lines_in_values*, default value: ``True``" @@ -529,6 +727,13 @@ msgid "" "when configuration files get big and complex, it is easy for the user to " "lose track of the file structure. Take for instance:" msgstr "" +"Em analisadores sintáticos de configuração, os valores podem abranger várias " +"linhas, desde que sejam mais indentados do que a chave que os contém. Por " +"padrão, os analisadores sintáticos também permitem que linhas vazias façam " +"parte de valores. Ao mesmo tempo, as chaves podem ser indentados " +"arbitrariamente para melhorar a legibilidade. Consequentemente, quando os " +"arquivos de configuração ficam grandes e complexos, é fácil para o usuário " +"perder o controle da estrutura do arquivo. Tomemos por exemplo:" #: ../../library/configparser.rst:663 msgid "" @@ -538,13 +743,18 @@ msgid "" "This will make empty lines split keys every time. In the example above, it " "would produce two keys, ``key`` and ``this``." msgstr "" +"Isso pode ser especialmente problemático para o usuário ver se está usando " +"uma fonte proporcional para editar o arquivo. É por isso que quando sua " +"aplicação não precisa de valores com linhas vazias, você deve considerar " +"proibi-los. Isso fará com que as linhas vazias dividam as chaves sempre. No " +"exemplo acima, seriam produzidas duas chaves, ``key`` e ``this``." #: ../../library/configparser.rst:669 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " "``\"DEFAULT\"``)" msgstr "" -"*default_section*, valor default: ``configparser.DEFAULTSECT`` (isto é: " +"*default_section*, valor padrão: ``configparser.DEFAULTSECT`` (isto é: " "``\"DEFAULT\"``)" #: ../../library/configparser.rst:672 @@ -560,10 +770,20 @@ msgid "" "default_section`` attribute and may be modified at runtime (i.e. to convert " "files from one format to another)." msgstr "" +"A convenção de permitir uma seção especial de valores padrão para outras " +"seções ou fins de interpolação é um conceito poderoso desta biblioteca, " +"permitindo aos usuários criar configurações declarativas complexas. Esta " +"seção normalmente é chamada de ``\"DEFAULT\"``, mas pode ser personalizada " +"para apontar para qualquer outro nome de seção válido. Alguns valores " +"típicos incluem: ``\"general\"`` ou ``\"common\"``. O nome fornecido é usado " +"para reconhecer seções padrão ao ler de qualquer fonte e é usado ao gravar a " +"configuração em um arquivo. Seu valor atual pode ser recuperado usando o " +"atributo ``parser_instance.default_section`` e pode ser modificado em tempo " +"de execução (ou seja, para converter arquivos de um formato para outro)." #: ../../library/configparser.rst:683 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" -msgstr "" +msgstr "*interpolation*, valor padrão: ``configparser.BasicInterpolation``" #: ../../library/configparser.rst:685 msgid "" @@ -574,10 +794,17 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_. :class:" "`RawConfigParser` has a default value of ``None``." msgstr "" +"O comportamento de interpolação pode ser personalizado fornecendo um " +"manipulador personalizado por meio do argumento *interpolation*. ``None`` " +"pode ser usado para desligar completamente a interpolação, " +"``ExtendedInterpolation()`` fornece uma variante mais avançada inspirada em " +"``zc.buildout``. Mais sobre o assunto na `seção de documentação dedicada " +"<#interpolation-of-values>`_. :class:`RawConfigParser` tem um valor padrão " +"de ``None``." #: ../../library/configparser.rst:692 msgid "*converters*, default value: not set" -msgstr "*converters*, valor default : not set" +msgstr "*converters*, valor padrão: não definido" #: ../../library/configparser.rst:694 msgid "" @@ -592,6 +819,17 @@ msgid "" "``parser_instance.getdecimal('section', 'key', fallback=0)`` and " "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" +"Os analisadores sintáticos de configuração fornecem getters de valor de " +"opção que realizam conversão de tipo. Por padrão, :meth:`~ConfigParser." +"getint`, :meth:`~ConfigParser.getfloat` e :meth:`~ConfigParser.getboolean` " +"são implementados. Caso outros getters sejam desejáveis, os usuários podem " +"defini-los em uma subclasse ou passar um dicionário onde cada chave é um " +"nome do conversor e cada valor é um chamável que implementa a referida " +"conversão. Por exemplo, passar ``{'decimal': decimal.Decimal}`` adicionaria :" +"meth:`!getdecimal` no objeto analisador sintático e em todos os proxies de " +"seção. Em outras palavras, será possível escrever ``parser_instance." +"getdecimal('section', 'key', fallback=0)`` e ``parser_instance['section']." +"getdecimal('key', 0)``." #: ../../library/configparser.rst:705 msgid "" @@ -600,6 +838,11 @@ msgid "" "method starts with ``get``, it will be available on all section proxies, in " "the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" +"Se o conversor precisar acessar o estado do analisador sintático, ele poderá " +"ser implementado como um método em uma subclasse do analisador sintático de " +"configuração. Se o nome deste método começar com ``get``, ele estará " +"disponível em todos os intermediários de seção, na forma compatível com dict " +"(veja o exemplo ``getdecimal()`` acima)." #: ../../library/configparser.rst:710 msgid "" @@ -607,6 +850,10 @@ msgid "" "these parser attributes. The defaults are defined on the classes, so they " "may be overridden by subclasses or by attribute assignment." msgstr "" +"Uma personalização mais avançada pode ser obtida substituindo os valores " +"padrão desses atributos do analisador sintático. Os padrões são definidos " +"nas classes, portanto podem ser substituídos por subclasses ou por " +"atribuição de atributos." #: ../../library/configparser.rst:716 msgid "" @@ -616,12 +863,20 @@ msgid "" "``'off'``. You can override this by specifying a custom dictionary of " "strings and their Boolean outcomes. For example:" msgstr "" +"Por padrão, ao usar :meth:`~ConfigParser.getboolean`, os analisadores " +"sintáticos de configuração consideram os seguintes valores ``True``: " +"``'1'``, ``'yes'``, ``'true'``, ``'on'`` e os seguintes valores ``False``: " +"``'0'``, ``'no'``, ``'false'``, ``'off'``. Você pode substituir isso " +"especificando um dicionário personalizado de strings e seus resultados " +"booleanos. Por exemplo:" #: ../../library/configparser.rst:734 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." msgstr "" +"Outros pares booleanos típicos incluem ``accept``/``reject`` ou ``enabled``/" +"``disabled``." #: ../../library/configparser.rst:740 msgid "" @@ -630,6 +885,11 @@ msgid "" "configuration file gets written, all keys will be lowercase. Override this " "method if that's unsuitable. For example:" msgstr "" +"Este método transforma nomes de opções em cada operação de leitura, obtenção " +"ou definição. O padrão converte o nome em letras minúsculas. Isso também " +"significa que quando um arquivo de configuração for gravado, todas as chaves " +"estarão em letras minúsculas. Substitua esse método se for inadequado. Por " +"exemplo:" #: ../../library/configparser.rst:770 msgid "" @@ -637,6 +897,9 @@ msgid "" "should be an idempotent function: if the name is already in canonical form, " "it should be returned unchanged." msgstr "" +"A função optionxform transforma nomes de opções em um formato canônico. Esta " +"deve ser uma função idempotente: se o nome já estiver na forma canônica, " +"deverá ser retornado inalterado." #: ../../library/configparser.rst:777 msgid "" @@ -646,6 +909,11 @@ msgid "" "name ``\" larch \"``. Override this attribute if that's unsuitable. For " "example:" msgstr "" +"Uma expressão regular compilada usada para analisar cabeçalhos de seção. O " +"padrão corresponde a ``[section]`` para o nome ``\"section\"``. O espaço em " +"branco é considerado parte do nome da seção, portanto ``[ larch ]`` será " +"lido como uma seção de nome ``\" larch \"``. Substitua esse atributo se " +"for inadequado. Por exemplo:" #: ../../library/configparser.rst:805 msgid "" @@ -653,6 +921,9 @@ msgid "" "option lines, it's not recommended to override it because that would " "interfere with constructor options *allow_no_value* and *delimiters*." msgstr "" +"Embora os objetos ConfigParser também usem um atributo ``OPTCRE`` para " +"reconhecer linhas de opção, não é recomendado substituí-lo porque isso " +"interferiria nas opções do construtor *allow_no_value* e *delimiters*." #: ../../library/configparser.rst:811 msgid "Legacy API Examples" @@ -666,28 +937,37 @@ msgid "" "access is preferred for new projects. The legacy API is at times more " "advanced, low-level and downright counterintuitive." msgstr "" +"Principalmente por questões de compatibilidade com versões anteriores, :mod:" +"`configparser` fornece também uma API legada com métodos ``get``/``set`` " +"explícitos. Embora existam casos de uso válidos para os métodos descritos " +"abaixo, o acesso ao protocolo de mapeamento é preferido para novos projetos. " +"A API legada é às vezes mais avançada, de baixo nível e totalmente " +"contraintuitiva." #: ../../library/configparser.rst:819 msgid "An example of writing to a configuration file::" -msgstr "" +msgstr "Um exemplo de escrita em um arquivo de configuração::" #: ../../library/configparser.rst:842 msgid "An example of reading the configuration file again::" -msgstr "" +msgstr "Um exemplo de leitura do arquivo de configuração novamente::" #: ../../library/configparser.rst:860 msgid "To get interpolation, use :class:`ConfigParser`::" -msgstr "" +msgstr "Para obter interpolação, use :class:`ConfigParser`::" #: ../../library/configparser.rst:893 msgid "" "Default values are available in both types of ConfigParsers. They are used " "in interpolation if an option used is not defined elsewhere. ::" msgstr "" +"Os valores padrão estão disponíveis em ambos os tipos de ConfigParsers. Eles " +"são usados ​​em interpolação se uma opção usada não estiver definida em outro " +"lugar. ::" #: ../../library/configparser.rst:911 msgid "ConfigParser Objects" -msgstr "" +msgstr "Objetos ConfigParser" #: ../../library/configparser.rst:915 msgid "" @@ -696,6 +976,11 @@ msgid "" "will be used to create the dictionary objects for the list of sections, for " "the options within a section, and for the default values." msgstr "" +"O principal analisador sintático de configuração. Quando *defaults* é " +"fornecido, ele é inicializado no dicionário de padrões intrínsecos. Quando " +"*dict_type* for fornecido, ele será usado para criar os objetos dicionário " +"para a lista de seções, para as opções dentro de uma seção e para os valores " +"padrão." #: ../../library/configparser.rst:920 msgid "" @@ -705,6 +990,12 @@ msgid "" "can be indented. When *inline_comment_prefixes* is given, it will be used " "as the set of substrings that prefix comments in non-empty lines." msgstr "" +"Quando *delimitadores* são fornecidos, eles são usados ​​como o conjunto de " +"substrings que dividem chaves de valores. Quando *comment_prefixes* for " +"fornecido, ele será usado como o conjunto de substrings que prefixam " +"comentários em linhas vazias. Os comentários podem ser indentados. Quando " +"*inline_comment_prefixes* for fornecido, ele será usado como o conjunto de " +"substrings que prefixam comentários em linhas não vazias." #: ../../library/configparser.rst:926 msgid "" @@ -718,6 +1009,16 @@ msgid "" "are accepted; the value held for these is ``None`` and they are serialized " "without the trailing delimiter." msgstr "" +"Quando *strict* for ``True`` (o padrão), o analisador sintático não " +"permitirá nenhuma seção ou opção duplicada durante a leitura de uma única " +"fonte (arquivo, string ou dicionário), levantando :exc:" +"`DuplicateSectionError` ou :exc:`DuplicateOptionError`. Quando " +"*empty_lines_in_values* é ``False`` (padrão: ``True``), cada linha vazia " +"marca o fim de uma opção. Caso contrário, as linhas vazias internas de uma " +"opção multilinha serão mantidas como parte do valor. Quando *allow_no_value* " +"for ``True`` (padrão: ``False``), opções sem valores serão aceitas; o valor " +"mantido para estes é ``None`` e eles são serializados sem o delimitador " +"final." #: ../../library/configparser.rst:936 msgid "" @@ -728,6 +1029,13 @@ msgid "" "evaluate an already parsed config file, but will be used when writing parsed " "settings to a new config file." msgstr "" +"Quando *default_section* é fornecido, ele especifica o nome da seção " +"especial que contém valores padrão para outras seções e propósitos de " +"interpolação (normalmente chamada de ``\"DEFAULT\"``). Este valor pode ser " +"recuperado e alterado em tempo de execução usando o atributo de instância " +"``default_section``. Isso não reavaliará um arquivo de configuração já " +"analisado, mas será usado ao escrever configurações analisadas em um novo " +"arquivo de configuração." #: ../../library/configparser.rst:943 msgid "" @@ -737,6 +1045,12 @@ msgid "" "advanced variant inspired by ``zc.buildout``. More on the subject in the " "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" +"O comportamento de interpolação pode ser personalizado fornecendo um " +"manipulador personalizado por meio do argumento *interpolation*. ``None`` " +"pode ser usado para desligar completamente a interpolação, " +"``ExtendedInterpolation()`` fornece uma variante mais avançada inspirada em " +"``zc.buildout``. Mais sobre o assunto na `seção de documentação dedicada " +"<#interpolation-of-values>`_." #: ../../library/configparser.rst:949 msgid "" @@ -746,6 +1060,11 @@ msgid "" "converts option names to lower case), the values ``foo %(bar)s`` and ``foo " "%(BAR)s`` are equivalent." msgstr "" +"Todos os nomes de opções usados ​​na interpolação serão passados ​​através do " +"método :meth:`optionxform` assim como qualquer outra referência de nome de " +"opção. Por exemplo, usando a implementação padrão de :meth:`optionxform` " +"(que converte nomes de opções para letras minúsculas), os valores ``foo " +"%(bar)s`` e ``foo %(BAR)s`` são equivalentes." #: ../../library/configparser.rst:955 msgid "" @@ -755,20 +1074,28 @@ msgid "" "converter gets its own corresponding :meth:`!get*()` method on the parser " "object and section proxies." msgstr "" +"Quando *conversers* é fornecido, deve ser um dicionário onde cada chave " +"representa o nome de um conversor de tipo e cada valor é um chamável " +"implementando a conversão de string para o tipo de dados desejado. Cada " +"conversor obtém seu próprio método :meth:`!get*()` correspondente no objeto " +"analisador sintático e nos intermediários de seção." #: ../../library/configparser.rst:961 msgid "The default *dict_type* is :class:`collections.OrderedDict`." -msgstr "" +msgstr "O padrão *dict_type* é :class:`collections.OrderedDict`." #: ../../library/configparser.rst:964 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" +"*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " +"*empty_lines_in_values*, *default_section* e *interpolation* foram " +"adicionados." #: ../../library/configparser.rst:969 msgid "The *converters* argument was added." -msgstr "" +msgstr "O argumento *converters* foi adicionado." #: ../../library/configparser.rst:972 msgid "" @@ -776,22 +1103,29 @@ msgid "" "consistent behavior across the parser: non-string keys and values are " "implicitly converted to strings." msgstr "" +"O argumento *defaults* é lido com :meth:`read_dict()`, fornecendo um " +"comportamento consistente em todo o analisador: chaves e valores que não são " +"de string são convertidos implicitamente em strings." #: ../../library/configparser.rst:977 ../../library/configparser.rst:1240 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" +"O *dict_type* padrão é :class:`dict`, pois agora preserva a ordem de " +"inserção." #: ../../library/configparser.rst:983 msgid "Return a dictionary containing the instance-wide defaults." -msgstr "" +msgstr "Retorna um dicionário contendo os padrões de toda a instância." #: ../../library/configparser.rst:988 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" +"Retorna uma lista das seções disponíveis; a *seção padrão* não está incluída " +"na lista." #: ../../library/configparser.rst:994 msgid "" @@ -800,20 +1134,26 @@ msgid "" "*default section* name is passed, :exc:`ValueError` is raised. The name of " "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" +"Adiciona uma seção de nome *section* à instância. Se já existir uma seção " +"com o nome fornecido, :exc:`DuplicateSectionError` será levantada. Se o nome " +"da *seção padrão* for passado, :exc:`ValueError` será levantada. O nome da " +"seção deve ser uma string; caso contrário, :exc:`TypeError` será levantada." #: ../../library/configparser.rst:999 msgid "Non-string section names raise :exc:`TypeError`." -msgstr "" +msgstr "Nomes de seções sem string levantam :exc:`TypeError`." #: ../../library/configparser.rst:1005 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" +"Indica se a *section* nomeada está presente na configuração. A *seção " +"padrão* não é reconhecida." #: ../../library/configparser.rst:1011 msgid "Return a list of options available in the specified *section*." -msgstr "" +msgstr "Retorna uma lista de opções disponíveis na *section* especificada." #: ../../library/configparser.rst:1016 msgid "" @@ -821,12 +1161,17 @@ msgid "" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" +"Se a *section* fornecida existir e contiver a *option* fornecida, retorna :" +"const:`True`; caso contrário, retorna :const:`False`. Se a *section* " +"especificada for :const:`None` ou uma string vazia, DEFAULT será presumido." #: ../../library/configparser.rst:1023 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" +"Tenta ler e analisar um iterável de nomes de arquivos, retornando uma lista " +"de nomes de arquivos que foram analisados ​​com sucesso." #: ../../library/configparser.rst:1026 msgid "" @@ -838,6 +1183,14 @@ msgid "" "wide directory), and all existing configuration files in the iterable will " "be read." msgstr "" +"Se *filenames* for uma string, um objeto :class:`bytes` ou um :term:`objeto " +"caminho ou similar`, este parâmetro será tratado como um único nome de " +"arquivo. Se um arquivo nomeado em *filenames* não puder ser aberto, esse " +"arquivo será ignorado. Isso foi projetado para que você possa especificar um " +"iterável de possíveis locais de arquivo de configuração (por exemplo, o " +"diretório atual, o diretório inicial do usuário e algum diretório de todo o " +"sistema) e todos os arquivos de configuração existentes no iterável serão " +"lidos." #: ../../library/configparser.rst:1035 msgid "" @@ -846,26 +1199,35 @@ msgid "" "be loaded from a file should load the required file or files using :meth:" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" +"Se nenhum dos arquivos nomeados existir, a instância :class:`ConfigParser` " +"conterá um conjunto de dados vazio. Uma aplicação que requer que valores " +"iniciais sejam carregados de um arquivo deve carregar o arquivo ou arquivos " +"necessários usando :meth:`read_file` antes de chamar :meth:`read` para " +"quaisquer arquivos opcionais::" #: ../../library/configparser.rst:1048 msgid "" "Added the *encoding* parameter. Previously, all files were read using the " "default encoding for :func:`open`." msgstr "" +"Adicionado o parâmetro *encoding*. Anteriormente, todos os arquivos eram " +"lidos usando a codificação padrão para :func:`open`." #: ../../library/configparser.rst:1052 msgid "The *filenames* parameter accepts a :term:`path-like object`." -msgstr "" +msgstr "O parâmetro *filenames* aceita um :term:`objeto caminho ou similar`." #: ../../library/configparser.rst:1055 msgid "The *filenames* parameter accepts a :class:`bytes` object." -msgstr "" +msgstr "O parâmetro *filenames* aceita um objeto :class:`bytes`." #: ../../library/configparser.rst:1061 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" +"Lê e analisa dados de configuração de *f* que devem ser iteráveis, " +"produzindo strings Unicode (por exemplo, arquivos abertos em modo texto)." #: ../../library/configparser.rst:1064 msgid "" @@ -873,14 +1235,17 @@ msgid "" "not given and *f* has a :attr:`!name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" +"O argumento opcional *source* especifica o nome do arquivo que está sendo " +"lido. Se não for fornecido e *f* tiver um atributo :attr:`!name`, que é " +"usado para *source*; o padrão é ``''``." #: ../../library/configparser.rst:1068 msgid "Replaces :meth:`!readfp`." -msgstr "" +msgstr "Substitui :meth:`!readfp`." #: ../../library/configparser.rst:1073 msgid "Parse configuration data from a string." -msgstr "" +msgstr "Analisa dados de configuração de uma string." #: ../../library/configparser.rst:1075 msgid "" @@ -888,6 +1253,9 @@ msgid "" "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" +"O argumento opcional *source* especifica um nome específico do contexto da " +"string passada. Se não for fornecido, ``''`` será usado. Geralmente " +"deve ser um caminho do sistema de arquivos ou uma URL." #: ../../library/configparser.rst:1084 msgid "" @@ -897,16 +1265,25 @@ msgid "" "preserves order, sections and their keys will be added in order. Values are " "automatically converted to strings." msgstr "" +"Carrega a configuração de qualquer objeto que forneça um método ``items()`` " +"dict ou similar. Chaves são nomes de seções, valores são dicionários com " +"chaves e valores que devem estar presentes na seção. Se o tipo de dicionário " +"usado preservar a ordem, as seções e suas chaves serão adicionadas em ordem. " +"Os valores são convertidos automaticamente em strings." #: ../../library/configparser.rst:1090 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" +"O argumento opcional *source* especifica um nome específico do contexto do " +"dicionário passado. Se não for fornecido, ```` será usado." #: ../../library/configparser.rst:1093 msgid "This method can be used to copy state between parsers." msgstr "" +"Este método pode ser usado para copiar o estado entre analisadores " +"sintáticos." #: ../../library/configparser.rst:1100 msgid "" @@ -916,6 +1293,11 @@ msgid "" "*fallback* is provided, it is used as a fallback value. ``None`` can be " "provided as a *fallback* value." msgstr "" +"Obtém um valor de *option* para a *section* nomeada. Se *vars* for " +"fornecido, deverá ser um dicionário. A *option* é pesquisada em *vars* (se " +"fornecido), *section* e em *DEFAULTSECT* nesta ordem. Se a chave não for " +"encontrada e *fallback* for fornecido, ele será usado como um valor " +"alternativo. ``None`` pode ser fornecido como um valor *fallback*." #: ../../library/configparser.rst:1106 msgid "" @@ -923,6 +1305,9 @@ msgid "" "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" +"Todas as interpolações ``'%'`` são expandidas nos valores de retorno, a " +"menos que o argumento *raw* seja verdadeiro. Os valores das chaves de " +"interpolação são consultados da mesma maneira que a opção." #: ../../library/configparser.rst:1110 msgid "" @@ -930,6 +1315,9 @@ msgid "" "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" +"Os argumentos *raw*, *vars* e *fallback* são palavras somente-nomeadas para " +"proteger os usuários de tentarem usar o terceiro argumento como substituto " +"*fallback* (especialmente ao usar o protocolo de mapeamento)." #: ../../library/configparser.rst:1118 msgid "" @@ -937,6 +1325,9 @@ msgid "" "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" +"Um método de conveniência que força a *option* na *section* especificada ser " +"um número inteiro. Veja :meth:`get` para explicação de *raw*, *vars* e " +"*fallback*." #: ../../library/configparser.rst:1125 msgid "" @@ -956,12 +1347,22 @@ msgid "" "`ValueError`. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" +"Um método de conveniência que força a *option* na *section* especificada a " +"um valor booleano. Observe que os valores aceitos para a opção são ``'1'``, " +"``'yes'``, ``'true'``, e ``'on'``, o que fazem com que este método retorne " +"``True``, e ``'0'``, ``'no'``, ``'false'``, e ``'off'``, o que fazem com que " +"ele retorne ``False``. Esses valores de string são verificados sem distinção " +"entre maiúsculas e minúsculas. Qualquer outro valor fará com que ele " +"levante :exc:`ValueError`. Veja :meth:`get` para explicação de *raw*, *vars* " +"e *fallback*." #: ../../library/configparser.rst:1145 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" +"Quando *section* não é fornecido, retorna uma lista de pares *section_name*, " +"*section_proxy*, incluindo DEFAULTSECT." #: ../../library/configparser.rst:1148 msgid "" @@ -969,6 +1370,9 @@ msgid "" "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" +"Caso contrário, retorna uma lista de pares *name*, *value* para as opções na " +"*section* fornecida. Argumentos opcionais têm o mesmo significado do método :" +"meth:`get`." #: ../../library/configparser.rst:1152 msgid "" @@ -976,6 +1380,9 @@ msgid "" "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" +"Os itens presentes em *vars* não aparecem mais no resultado. O comportamento " +"anterior misturava opções reais do analisador sintático com variáveis ​​" +"fornecidas para interpolação." #: ../../library/configparser.rst:1160 msgid "" @@ -983,6 +1390,9 @@ msgid "" "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" +"Se a seção fornecida existir, defina a opção fornecida com o valor " +"especificado; caso contrário, levanta :exc:`NoSectionError`. *option* e " +"*value* devem ser strings; caso contrário, :exc:`TypeError` será levantada." #: ../../library/configparser.rst:1167 msgid "" @@ -992,6 +1402,11 @@ msgid "" "*space_around_delimiters* is true, delimiters between keys and values are " "surrounded by spaces." msgstr "" +"Escreve uma representação da configuração no :term:`objeto arquivo` " +"especificado, que deve ser aberto em modo texto (aceitando strings). Esta " +"representação pode ser analisada por uma futura chamada :meth:`read`. Se " +"*space_around_delimiters* for verdadeiro, os delimitadores entre chaves e " +"valores serão envoltos por espaços." #: ../../library/configparser.rst:1175 msgid "" @@ -999,6 +1414,9 @@ msgid "" "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" +"Os comentários no arquivo de configuração original não são preservados ao " +"escrever a configuração. O que é considerado um comentário depende dos " +"valores fornecidos para *comment_prefix* e *inline_comment_prefix*." #: ../../library/configparser.rst:1183 msgid "" @@ -1006,12 +1424,17 @@ msgid "" "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" +"Remove a *option* especificada da *section* especificada. Se a seção não " +"existir, levanta :exc:`NoSectionError`. Se existisse a opção de ser " +"removida, retorna :const:`True`; caso contrário, retorna :const:`False`." #: ../../library/configparser.rst:1191 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" +"Remove a *section* especificada da configuração. Se a seção de fato existiu, " +"retorna ``True``. Caso contrário, retorna ``False``." #: ../../library/configparser.rst:1197 msgid "" @@ -1021,6 +1444,12 @@ msgid "" "*option*; subclasses may override this or client code can set an attribute " "of this name on instances to affect this behavior." msgstr "" +"Transforma o nome da opção *option* conforme encontrado em um arquivo de " +"entrada ou conforme passado pelo código do cliente no formato que deve ser " +"usado nas estruturas internas. A implementação padrão retorna uma versão em " +"minúsculas de *option*; subclasses podem substituir isso ou o código do " +"cliente pode definir um atributo com esse nome nas instâncias para afetar " +"esse comportamento." #: ../../library/configparser.rst:1203 msgid "" @@ -1029,12 +1458,19 @@ msgid "" "string. Setting it to ``str``, for example, would make option names case " "sensitive::" msgstr "" +"Você não precisa criar uma subclasse do analisador sintático para usar esse " +"método; você também pode configurá-lo em uma instância, para uma função que " +"recebe um argumento de string e retorna uma string. Definir como ``str``, " +"por exemplo, faria com que sejam diferenciadas as letras maiúsculas das " +"minúsculas nos nomes das opções::" #: ../../library/configparser.rst:1211 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" +"Observe que ao ler arquivos de configuração, os espaços em branco ao redor " +"dos nomes das opções são removidos antes de :meth:`optionxform` ser chamado." #: ../../library/configparser.rst:1217 msgid "" @@ -1042,10 +1478,13 @@ msgid "" "ConfigParser.get` when the *raw* parameter is false. This is relevant only " "when the default *interpolation* is used." msgstr "" +"A profundidade máxima para interpolação recursiva para :meth:`~configparser." +"ConfigParser.get` quando o parâmetro *raw* é falso. Isso é relevante apenas " +"quando a *interpolation* padrão é usada." #: ../../library/configparser.rst:1225 msgid "RawConfigParser Objects" -msgstr "" +msgstr "Objetos RawConfigParser" #: ../../library/configparser.rst:1235 msgid "" @@ -1054,6 +1493,10 @@ msgid "" "via its unsafe ``add_section`` and ``set`` methods, as well as the legacy " "``defaults=`` keyword argument handling." msgstr "" +"Variante legada do :class:`ConfigParser`. Ela tem a interpolação " +"desabilitada por padrão e permite nomes de seções não-string, nomes de " +"opções e valores através de seus métodos inseguros ``add_section`` e " +"``set``, bem como o tratamento de argumentos nomeados legados ``defaults=`` ." #: ../../library/configparser.rst:1245 msgid "" @@ -1061,6 +1504,9 @@ msgid "" "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" +"Considere usar :class:`ConfigParser`, que verifica os tipos de valores a " +"serem armazenados internamente. Se você não quiser interpolação, você pode " +"usar ``ConfigParser(interpolation=None)``." #: ../../library/configparser.rst:1252 msgid "" @@ -1068,12 +1514,18 @@ msgid "" "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" +"Adiciona uma seção chamada *section* à instância. Se já existir uma seção " +"com o nome fornecido, :exc:`DuplicateSectionError` será levantada. Se o nome " +"da *seção padrão* for passado, :exc:`ValueError` será levantada." #: ../../library/configparser.rst:1256 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" +"O tipo da *section* não está marcado, o que permite aos usuários criar " +"seções nomeadas sem string. Este comportamento não é compatível e pode " +"causar erros internos." #: ../../library/configparser.rst:1262 msgid "" @@ -1084,6 +1536,12 @@ msgid "" "(including interpolation and output to files) can only be achieved using " "string values." msgstr "" +"Se a seção fornecida existir, defina a opção fornecida com o valor " +"especificado; caso contrário, levanta :exc:`NoSectionError`. Embora seja " +"possível usar :class:`RawConfigParser` (ou :class:`ConfigParser` com " +"parâmetros *raw* definidos como verdadeiro) para armazenamento *interno* de " +"valores não-string, funcionalidade completa (incluindo interpolação e saída " +"para arquivos) só pode ser alcançado usando valores de string." #: ../../library/configparser.rst:1269 msgid "" @@ -1092,6 +1550,10 @@ msgid "" "file or get it in non-raw mode. **Use the mapping protocol API** which does " "not allow such assignments to take place." msgstr "" +"Este método permite que os usuários atribuam valores não-string às chaves " +"internamente. Este comportamento não é suportado e causará erros ao tentar " +"escrever em um arquivo ou obtê-lo no modo não bruto. **Use a API do " +"protocolo de mapeamento** que não permite que tais atribuições ocorram." #: ../../library/configparser.rst:1276 msgid "Exceptions" @@ -1099,11 +1561,11 @@ msgstr "Exceções" #: ../../library/configparser.rst:1280 msgid "Base class for all other :mod:`configparser` exceptions." -msgstr "" +msgstr "Classe base para todas as outras exceções do :mod:`configparser`." #: ../../library/configparser.rst:1285 msgid "Exception raised when a specified section is not found." -msgstr "" +msgstr "Exceção levantada quando uma seção especificada não é encontrada." #: ../../library/configparser.rst:1290 msgid "" @@ -1111,12 +1573,18 @@ msgid "" "name of a section that is already present or in strict parsers when a " "section if found more than once in a single input file, string or dictionary." msgstr "" +"Exceção levantada se :meth:`~ConfigParser.add_section` for chamado com o " +"nome de uma seção que já está presente ou em analisadores sintáticos " +"estritos quando uma seção for encontrada mais de uma vez em um único arquivo " +"de entrada, string ou dicionário." #: ../../library/configparser.rst:1294 msgid "" "Added the optional *source* and *lineno* attributes and parameters to :meth:" "`!__init__`." msgstr "" +"Adicionados os atributos e parâmetros opcionais *source* e *lineno* a :meth:" +"`!__init__`." #: ../../library/configparser.rst:1301 msgid "" @@ -1125,18 +1593,28 @@ msgid "" "and case sensitivity-related errors, e.g. a dictionary may have two keys " "representing the same case-insensitive configuration key." msgstr "" +"Exceção levantada por analisadores sintáticos estritos se uma única opção " +"aparecer duas vezes durante a leitura de um único arquivo, string ou " +"dicionário. Isso detecta erros ortográficos e erros relacionados a " +"diferenciação de letras maiúsculas e minúsculas como, p. ex., um dicionário " +"pode ter duas chaves representando a mesma chave de configuração que não " +"diferencia maiúsculas de minúsculas." #: ../../library/configparser.rst:1309 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" +"Exceção levantada quando uma opção especificada não é encontrada na seção " +"especificada." #: ../../library/configparser.rst:1315 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" +"Classe base para exceções levantadas quando ocorrem problemas ao executar a " +"interpolação de strings." #: ../../library/configparser.rst:1321 msgid "" @@ -1144,34 +1622,46 @@ msgid "" "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" +"Exceção levantada quando a interpolação de string não pode ser concluída " +"porque o número de iterações excede :const:`MAX_INTERPOLATION_DEPTH`. " +"Subclasse de :exc:`InterpolationError`." #: ../../library/configparser.rst:1328 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" +"Exceção levantada quando uma opção referenciada a partir de um valor não " +"existe. Subclasse de :exc:`InterpolationError`." #: ../../library/configparser.rst:1334 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" +"Exceção levantada quando o texto fonte no qual são feitas as substituições " +"não está em conformidade com a sintaxe exigida. Subclasse de :exc:" +"`InterpolationError`." #: ../../library/configparser.rst:1340 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" +"Exceção levantada ao tentar analisar um arquivo que não possui cabeçalhos de " +"seção." #: ../../library/configparser.rst:1346 msgid "Exception raised when errors occur attempting to parse a file." -msgstr "" +msgstr "Exceção levantada quando ocorrem erros ao tentar analisar um arquivo." #: ../../library/configparser.rst:1348 msgid "" "The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" +"O atributo ``filename`` e o argumento do construtor :meth:`!__init__` foram " +"removidos. Eles estiveram disponíveis usando o nome ``source`` desde 3.2." #: ../../library/configparser.rst:1353 msgid "Footnotes" @@ -1183,6 +1673,10 @@ msgid "" "changing the behaviour outlined by the footnote reference, consult the " "`Customizing Parser Behaviour`_ section." msgstr "" +"Os analisadores sintáticos de configuração permitem muita personalização. " +"Caso você tenha interesse em alterar o comportamento descrito na referência " +"da nota de rodapé, consulte a seção `Personalizando o comportamento do " +"analisador sintático`_." #: ../../library/configparser.rst:16 msgid ".ini" @@ -1198,11 +1692,11 @@ msgstr "configuração" #: ../../library/configparser.rst:16 msgid "ini file" -msgstr "" +msgstr "arquivo ini" #: ../../library/configparser.rst:16 msgid "Windows ini file" -msgstr "" +msgstr "arquivo ini do Windows" #: ../../library/configparser.rst:335 msgid "% (percent)" @@ -1210,7 +1704,7 @@ msgstr "% (porcentagem)" #: ../../library/configparser.rst:335 ../../library/configparser.rst:368 msgid "interpolation in configuration files" -msgstr "" +msgstr "interpolação em arquivos de configuração" #: ../../library/configparser.rst:368 msgid "$ (dollar)" diff --git a/library/constants.po b/library/constants.po index adf07e5e1..d1b289e18 100644 --- a/library/constants.po +++ b/library/constants.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/contextlib.po b/library/contextlib.po index 90ba3c25b..6db61ccf6 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/contextvars.po b/library/contextvars.po index 39b7f32eb..951e29bd5 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/contextvars.rst:2 msgid ":mod:`!contextvars` --- Context Variables" -msgstr "" +msgstr ":mod:`!contextvars` --- Variáveis de contexto" #: ../../library/contextvars.rst:11 msgid "" diff --git a/library/copy.po b/library/copy.po index fe117d38b..5a39aaad0 100644 --- a/library/copy.po +++ b/library/copy.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/copy.rst:2 msgid ":mod:`!copy` --- Shallow and deep copy operations" -msgstr "" +msgstr ":mod:`!copy` --- Operações de cópia profunda e cópia rasa" #: ../../library/copy.rst:7 msgid "**Source code:** :source:`Lib/copy.py`" @@ -166,9 +166,9 @@ msgid "" "registered pickle functions from the :mod:`copyreg` module." msgstr "" "As classes podem usar as mesmas interfaces para controlar a cópia que usam " -"para controlar o *pickling*. Veja a descrição do módulo :mod:`pickle` para " -"informações sobre esses métodos. Na verdade, o módulo :mod:`copy` usa as " -"funções pickle registradas do módulo :mod:`copyreg`." +"para controlar a serialização com pickle. Veja a descrição do módulo :mod:" +"`pickle` para informações sobre esses métodos. Na verdade, o módulo :mod:" +"`copy` usa as funções pickle registradas do módulo :mod:`copyreg`." #: ../../library/copy.rst:82 msgid "" diff --git a/library/copyreg.po b/library/copyreg.po index f14ff5e99..d06e583e4 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/copyreg.rst:2 msgid ":mod:`!copyreg` --- Register :mod:`!pickle` support functions" -msgstr "" +msgstr ":mod:`!copyreg` --- Registra funções de suporte :mod:`!pickle`" #: ../../library/copyreg.rst:7 msgid "**Source code:** :source:`Lib/copyreg.py`" diff --git a/library/crypt.po b/library/crypt.po index 962075a85..6d29fee27 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/crypto.po b/library/crypto.po index 4a9899add..da5b27b7a 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/csv.po b/library/csv.po index 78ec98d42..214673263 100644 --- a/library/csv.po +++ b/library/csv.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/csv.rst:2 msgid ":mod:`!csv` --- CSV File Reading and Writing" -msgstr "" +msgstr ":mod:`!csv` --- Leitura e escrita de arquivos CSV" #: ../../library/csv.rst:9 msgid "**Source code:** :source:`Lib/csv.py`" @@ -88,7 +88,7 @@ msgstr "" #: ../../library/csv.rst:41 msgid ":pep:`305` - CSV File API" -msgstr ":pep:`305` - API de arquivo CSV" +msgstr ":pep:`305` - CSV File API" #: ../../library/csv.rst:42 msgid "The Python Enhancement Proposal which proposed this addition to Python." @@ -518,6 +518,8 @@ msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) field as " "``None`` and to otherwise behave as :data:`QUOTE_ALL`." msgstr "" +"Instrui objetos :class:`reader` a interpretar um campo vazio (sem aspas) " +"como ``None`` e a se comportar de outra forma como :data:`QUOTE_ALL`." #: ../../library/csv.rst:359 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index 83dd1de7b..468616d0b 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -231,11 +231,11 @@ msgstr "" #: ../../library/ctypes.rst:217 msgid "ctypes type" -msgstr "ctypes type" +msgstr "Tipo ctypes" #: ../../library/ctypes.rst:217 msgid "C type" -msgstr "C type" +msgstr "Tipo C" #: ../../library/ctypes.rst:217 msgid "Python type" @@ -263,7 +263,7 @@ msgstr ":c:expr:`char`" #: ../../library/ctypes.rst:221 msgid "1-character bytes object" -msgstr "1-character bytes object" +msgstr "objeto bytes de 1 caractere" #: ../../library/ctypes.rst:223 msgid ":class:`c_wchar`" @@ -275,7 +275,7 @@ msgstr ":c:type:`wchar_t`" #: ../../library/ctypes.rst:223 msgid "1-character string" -msgstr "1-character string" +msgstr "string de 1 caractere" #: ../../library/ctypes.rst:225 msgid ":class:`c_byte`" @@ -398,7 +398,7 @@ msgstr ":c:expr:`float`" #: ../../library/ctypes.rst:253 ../../library/ctypes.rst:255 #: ../../library/ctypes.rst:257 msgid "float" -msgstr "float" +msgstr "ponto flutuante" #: ../../library/ctypes.rst:255 msgid ":class:`c_double`" @@ -1274,7 +1274,7 @@ msgstr "" #: ../../library/ctypes.rst:1322 msgid "Here are some examples::" -msgstr "Here are some examples::" +msgstr "Veja alguns exemplos::" #: ../../library/ctypes.rst:1333 msgid "" @@ -1921,6 +1921,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.addressof`` com o " +"argumento ``obj``." #: ../../library/ctypes.rst:1891 msgid "" @@ -1979,6 +1981,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes." +"create_string_buffer`` com os argumentos ``init``, ``size``." #: ../../library/ctypes.rst:1935 msgid "" @@ -2006,6 +2010,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes." +"create_unicode_buffer`` com os argumentos ``init``, ``size``." #: ../../library/ctypes.rst:1952 msgid "" @@ -2068,6 +2074,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.get_errno`` sem " +"argumentos." #: ../../library/ctypes.rst:2009 msgid "" @@ -2080,6 +2088,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.get_last_error`` " +"sem argumentos." #: ../../library/ctypes.rst:2016 msgid "" @@ -2133,6 +2143,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.set_errno`` com o " +"argumento ``errno``." #: ../../library/ctypes.rst:2062 msgid "" @@ -2146,6 +2158,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.set_last_error`` " +"com o argumento ``error``." #: ../../library/ctypes.rst:2071 msgid "" @@ -2164,6 +2178,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.string_at`` com os " +"argumentos ``ptr``, ``size``." #: ../../library/ctypes.rst:2086 msgid "" @@ -2192,6 +2208,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.wstring_at`` com " +"os argumentos ``ptr``, ``size``." #: ../../library/ctypes.rst:2110 msgid "Data types" @@ -2227,6 +2245,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ctypes.cdata/buffer`` com " +"os argumentos ``pointer``, ``size``, ``offset``." #: ../../library/ctypes.rst:2137 msgid "" @@ -2253,6 +2273,9 @@ msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" +"Este método, e outros que indiretamente chamam este método, levantam um :ref:" +"`evento de auditoria ` ``ctypes.cdata`` com o argumento " +"``address``." #: ../../library/ctypes.rst:2158 msgid "" diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 28fcd3c3e..4fbe1c0ed 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/curses.panel.po b/library/curses.panel.po index 635d867f8..ed786bbee 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/curses.po b/library/curses.po index 48b2899c1..69eef7d25 100644 --- a/library/curses.po +++ b/library/curses.po @@ -24,20 +24,22 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/curses.rst:2 msgid ":mod:`!curses` --- Terminal handling for character-cell displays" msgstr "" +":mod:`!curses` --- Gerenciador de terminal para visualizadores de células de " +"caracteres." #: ../../library/curses.rst:12 msgid "**Source code:** :source:`Lib/curses`" -msgstr "" +msgstr "**Código-fonte:** :source:`Lib/curses`" #: ../../library/curses.rst:16 msgid "" @@ -2119,7 +2121,7 @@ msgstr "" #: ../../library/curses.rst:1663 msgid "ACS code" -msgstr "ACS code" +msgstr "Código ACS" #: ../../library/curses.rst:1665 msgid "alternate name for upper right corner" @@ -2444,7 +2446,7 @@ msgstr "" #: ../../library/curses.rst:1867 msgid "Action" -msgstr "" +msgstr "Ação" #: ../../library/curses.rst:1869 msgid ":kbd:`Control-A`" diff --git a/library/custominterp.po b/library/custominterp.po index b8fa0a560..144458b8c 100644 --- a/library/custominterp.po +++ b/library/custominterp.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/dataclasses.po b/library/dataclasses.po index 1adb22380..09c99ec00 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -221,6 +221,13 @@ msgid "" "and behavior of :meth:`!__eq__`, and the values of the *eq* and *frozen* " "flags in the ``@dataclass`` decorator." msgstr "" +":meth:`!__hash__` é usado para prover o método embutido :meth:`hash()`, e " +"quando objetos são adicionados a coleções do tipo dicionário ou conjunto. " +"Ter um método :meth:`!__hash__` implica que instâncias da classe serão " +"imutáveis. Mutabilidade é uma propriedade complicada, que depende da " +"intenção do programador, da existência e comportamento do método :meth:`!" +"__eq__`, e dos valores dos parâmetros *eq* e *frozen* no decorador " +"``@dataclass``." #: ../../library/dataclasses.rst:134 msgid "" @@ -275,6 +282,13 @@ msgid "" "used (if the superclass is :class:`object`, this means it will fall back to " "id-based hashing)." msgstr "" +"Se *eq* e *frozen* são ambos verdadeiros, por padrão ``@dataclass`` vai " +"gerar um método :meth:`!__hash__`. Se *eq* é verdadeiro e *frozen* é falso, :" +"meth:`!__hash__` será configurado para ``None``, marcando a classe como não-" +"hasheável (já que é mutável). Se *eq* é falso, :meth:`!__hash__` será " +"deixado intocado, o que significa que o método :meth:`!__hash__` da " +"superclasse será usado (se a superclasse é :class:`object`, significa que " +"voltará para o hash baseado em id)." #: ../../library/dataclasses.rst:160 msgid "" @@ -283,6 +297,10 @@ msgid "" "`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the " "class, then :exc:`TypeError` is raised. See the discussion below." msgstr "" +"*frozen*: Se verdadeiro (o padrão é ``False``), atribuições para os campos " +"vão gerar uma exceção. Imita instâncias congeladas, somente leitura. Se :" +"meth:`~object.__setattr__` ou :meth:`~object.__delattr__` é definido na " +"classe, a exceção :exc:`TypeError` é levantada. Veja a discussão abaixo." #: ../../library/dataclasses.rst:165 msgid "" @@ -292,6 +310,11 @@ msgid "" "generated, see above). If false, or if :attr:`!__match_args__` is already " "defined in the class, then :attr:`!__match_args__` will not be generated." msgstr "" +"*match_args*: Se verdadeiro (o padrão é ``True``), a tupla :attr:`~object." +"__match_args__` será criada a partir da lista de parâmetros para o método :" +"meth:`~object.__init__` gerado (mesmo se :meth:`!__init__` não for gerado, " +"veja acima). Se falso, ou se :attr:`!__match_args__` já estiver definido na " +"classe, então :attr:`!__match_args__` não será gerado." #: ../../library/dataclasses.rst:174 msgid "" @@ -303,6 +326,13 @@ msgid "" "term:`parameter` glossary entry for details. Also see the :const:`KW_ONLY` " "section." msgstr "" +"*kw_only*: Se verdadeiro (o valor padrão é ``False``), então todos os campos " +"serão marcados como somente-nomeado. Se um campo for marcado como somente-" +"nomeado, então o único efeito é que o parâmetro :meth:`~object.__init__` " +"gerado a partir de um campo somente-nomeado deve ser especificado com um " +"campo quando :meth:`!__init__` é chamado. Não há efeito em nenhum outro " +"aspecto das classes de dados. Veja a entrada :term:`parâmetro` do glossário " +"para detalhes. Veja também a seção :const:`KW_ONLY`." #: ../../library/dataclasses.rst:185 msgid "" diff --git a/library/datatypes.po b/library/datatypes.po index 043835d29..a2241f59a 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/datetime.po b/library/datetime.po index d9da4ea7a..f4c303882 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -33,16 +33,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/datetime.rst:2 msgid ":mod:`!datetime` --- Basic date and time types" -msgstr "" +msgstr ":mod:`!datetime` --- Tipos básicos de data e hora" #: ../../library/datetime.rst:11 msgid "**Source code:** :source:`Lib/datetime.py`" @@ -115,7 +115,7 @@ msgid "" "naive and aware datetimes." msgstr "" "Biblioteca de terceiros que apresenta tipos estáticos distintos para, por " -"exemplo, permitir que :term:`verificadores de tipo estático` diferenciem datas ingênuas e conscientes." #: ../../library/datetime.rst:48 @@ -210,12 +210,16 @@ msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is 1." msgstr "" +"O menor número de ano permitido em um objeto :class:`date` ou :class:`." +"datetime`. :const:`MINYEAR` é 1." #: ../../library/datetime.rst:93 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is 9999." msgstr "" +"O maior número de ano permitido no objeto :class:`date` ou :class:`." +"datetime`. :const:`MAXYEAR` é 9999." #: ../../library/datetime.rst:98 msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." @@ -233,8 +237,8 @@ msgid "" "attr:`day`." msgstr "" "Uma data ingênua idealizada, presumindo que o atual calendário Gregoriano " -"sempre foi, e sempre estará em vigor. Atributos: :attr:`year`, :attr:" -"`month`, e :attr:`day`." +"sempre foi, e sempre estará em vigor. Atributos: :attr:`year`, :attr:`month` " +"e :attr:`day`." #: ../../library/datetime.rst:116 msgid "" @@ -256,7 +260,7 @@ msgid "" msgstr "" "Uma combinação de uma data e uma hora. Atributos: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" -"`microsecond`, e :attr:`.tzinfo`." +"`microsecond` e :attr:`.tzinfo`." #: ../../library/datetime.rst:133 msgid "" @@ -398,14 +402,16 @@ msgid "" "All arguments are optional and default to 0. Arguments may be integers or " "floats, and may be positive or negative." msgstr "" +"Todos os argumentos são opcionais e o padrão é 0. Os argumentos podem ser " +"números inteiros ou ponto flutuantes, e podem ser positivos ou negativos." #: ../../library/datetime.rst:213 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -"Apenas *dias*, *segundos* e *microssegundos* são armazenados internamente. " -"Os argumentos são convertidos para essas unidades:" +"Apenas *days*, *seconds* e *microseconds* são armazenados internamente. Os " +"argumentos são convertidos para essas unidades:" #: ../../library/datetime.rst:216 msgid "A millisecond is converted to 1000 microseconds." @@ -449,8 +455,8 @@ msgid "" "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -"O exemplo a seguir ilustra como quaisquer argumentos além de *dias*, " -"*segundos* e *microssegundos* são \"mesclados\" e normalizados nos três " +"O exemplo a seguir ilustra como quaisquer argumentos além de *days*, " +"*seconds* e *microseconds* são \"mesclados\" e normalizados nos três " "atributos resultantes::" #: ../../library/datetime.rst:246 @@ -473,8 +479,8 @@ msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -"Se o valor normalizado de dias estiver fora do intervalo indicado, :exc:" -"`OverflowError` é gerado." +"Se o valor normalizado de dias estiver fora do intervalo indicado, a " +"exceção :exc:`OverflowError` é levantada." #: ../../library/datetime.rst:256 msgid "" @@ -516,6 +522,9 @@ msgid "" "timedelta.min``. ``-timedelta.max`` is not representable as a :class:" "`timedelta` object." msgstr "" +"Observe que, devido à normalização, ``timedelta.max`` é maior que ``-" +"timedelta.min``. ``-timedelta.max`` não é representável como um objeto :" +"class:`timedelta`." #: ../../library/datetime.rst:286 ../../library/datetime.rst:564 #: ../../library/datetime.rst:1085 ../../library/datetime.rst:1716 @@ -578,6 +587,8 @@ msgid "" "Sum of ``t2`` and ``t3``. Afterwards ``t1 - t2 == t3`` and ``t1 - t3 == t2`` " "are true. (1)" msgstr "" +"Soma de ``t2`` e ``t3``. Depois ``t1 - t2 == t3`` e ``t1 - t3 == t2`` são " +"verdadeiros. (1)" #: ../../library/datetime.rst:309 msgid "``t1 = t2 - t3``" @@ -588,6 +599,8 @@ msgid "" "Difference of ``t2`` and ``t3``. Afterwards ``t1 == t2 - t3`` and ``t2 == " "t1 + t3`` are true. (1)(6)" msgstr "" +"Diferença de ``t2`` e ``t3``. Depois ``t1 == t2 - t3`` e ``t2 == t1 + t3`` " +"são verdadeiros (1)(6)" #: ../../library/datetime.rst:313 msgid "``t1 = t2 * i or t1 = i * t2``" @@ -598,10 +611,12 @@ msgid "" "Delta multiplied by an integer. Afterwards ``t1 // i == t2`` is true, " "provided ``i != 0``." msgstr "" +"Delta multiplicado por um número inteiro. Depois ``t1 // i == t2`` é " +"verdadeiro, desde que ``i != 0``." #: ../../library/datetime.rst:317 msgid "In general, ``t1 * i == t1 * (i-1) + t1`` is true. (1)" -msgstr "" +msgstr "Em geral, ``t1 * i == t1 * (i-1) + t1`` é verdadeiro. (1)" #: ../../library/datetime.rst:320 msgid "``t1 = t2 * f or t1 = f * t2``" @@ -625,6 +640,8 @@ msgid "" "Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns a :" "class:`float` object." msgstr "" +"Divisão (3) da duração total ``t2`` por unidade de intervalo ``t3``. Retorna " +"um objeto :class:`float`." #: ../../library/datetime.rst:328 msgid "``t1 = t2 / f or t1 = t2 / i``" @@ -641,7 +658,7 @@ msgstr "" #: ../../library/datetime.rst:332 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" -msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" +msgstr "``t1 = t2 // i`` ou ``t1 = t2 // t3``" #: ../../library/datetime.rst:332 msgid "" @@ -668,8 +685,8 @@ msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -"Calcula o quociente e o restante: ``q = t1 // t2`` (3) e ``r = t1% t2``. q é " -"um número inteiro e r é um objeto :class:`timedelta`." +"Calcula o quociente e o restante: ``q = t1 // t2`` (3) e ``r = t1 % t2``. q " +"é um número inteiro e r é um objeto :class:`timedelta`." #: ../../library/datetime.rst:344 msgid "``+t1``" @@ -688,6 +705,8 @@ msgid "" "Equivalent to ``timedelta(-t1.days, -t1.seconds*, -t1.microseconds)``, and " "to ``t1 * -1``. (1)(4)" msgstr "" +"Equivalente a ``timedelta(-t1.days, -t1.seconds*, -t1.microseconds)`` e a " +"``t1 * -1``. (1)(4)" #: ../../library/datetime.rst:351 msgid "``abs(t)``" @@ -698,6 +717,8 @@ msgid "" "Equivalent to ``+t`` when ``t.days >= 0``, and to ``-t`` when ``t.days < " "0``. (2)" msgstr "" +"Equivalente a ``+t`` quando ``t.days >= 0`` e a ``-t`` quando ``t.days < " +"0``. (2)" #: ../../library/datetime.rst:354 msgid "``str(t)``" @@ -738,11 +759,12 @@ msgstr "Isso é exato e não pode transbordar." #: ../../library/datetime.rst:373 msgid "Division by zero raises :exc:`ZeroDivisionError`." -msgstr "" +msgstr "A divisão por zero levanta :exc:`ZeroDivisionError`." #: ../../library/datetime.rst:376 msgid "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" +"``-timedelta.max`` não é representável como um objeto :class:`timedelta`." #: ../../library/datetime.rst:379 msgid "" @@ -783,7 +805,7 @@ msgid "" msgstr "" "A divisão pelo piso e a divisão verdadeira de um objeto :class:`timedelta` " "por outro objeto :class:`timedelta` agora são suportadas, assim como as " -"operações restantes e a função :func:`divmod`. A verdadeira divisão e " +"operações restantes e a função :func:`divmod`. A divisão verdadeira e " "multiplicação de um objeto :class:`timedelta` por um objeto :class:`float` " "agora são suportadas." @@ -882,8 +904,8 @@ msgstr "``1 <= day <= número de dias no mês e ano fornecidos``" msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -"Se um argumento fora desses intervalos for fornecido, :exc:`ValueError` é " -"levantado." +"Se um argumento fora desses intervalos for fornecido, a exceção :exc:" +"`ValueError` é levantada." #: ../../library/datetime.rst:476 ../../library/datetime.rst:849 msgid "Other constructors, all class methods:" @@ -1032,7 +1054,7 @@ msgstr "``date2 = date1 + timedelta``" #: ../../library/datetime.rst:586 msgid "``date2`` will be ``timedelta.days`` days after ``date1``. (1)" -msgstr "" +msgstr "``date2`` terá ``timedelta.days`` dias após ``date1``. (1)" #: ../../library/datetime.rst:589 msgid "``date2 = date1 - timedelta``" @@ -1040,7 +1062,7 @@ msgstr "``date2 = date1 - timedelta``" #: ../../library/datetime.rst:589 msgid "Computes ``date2`` such that ``date2 + timedelta == date1``. (2)" -msgstr "" +msgstr "Calcula ``date2`` de modo que ``date2 + timedelta == date1``. (2)" #: ../../library/datetime.rst:592 msgid "``timedelta = date1 - date2``" @@ -1092,9 +1114,9 @@ msgid "" msgstr "" "*date2* é movida para frente no tempo se ``timedelta.days > 0``, ou para " "trás se ``timedelta.days < 0``. Posteriormente ``date2 - date1 == timedelta." -"days``. ``timedelta.seconds`` e ``timedelta.microseconds`` são ignorados. :" -"exc:`OverflowError` é levantado se ``date2.year`` for menor que :const:" -"`MINYEAR` ou maior que :const:`MAXYEAR`." +"days``. ``timedelta.seconds`` e ``timedelta.microseconds`` são ignorados. A " +"exceção :exc:`OverflowError` é levantada se ``date2.year`` for menor que :" +"const:`MINYEAR` ou maior que :const:`MAXYEAR`." #: ../../library/datetime.rst:613 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." @@ -1105,6 +1127,8 @@ msgid "" "This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta." "microseconds`` are 0, and ``date2 + timedelta == date1`` after." msgstr "" +"Isso é exato e não pode estourar. ``timedelta.seconds`` e ``timedelta." +"microseconds`` são 0, e ``date2 + timedelta == date1`` depois." #: ../../library/datetime.rst:620 msgid ":class:`date` objects are equal if they represent the same date." @@ -1149,8 +1173,7 @@ msgstr "" #: ../../library/datetime.rst:648 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -"As horas, minutos e segundos são ``0``, e o sinalizador de horário de verão " -"é ``-1``." +"As horas, minutos e segundos são 0, e o sinalizador de horário de verão é -1." #: ../../library/datetime.rst:650 ../../library/datetime.rst:1339 msgid "``d.timetuple()`` is equivalent to::" @@ -1161,6 +1184,8 @@ msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with 1 for January 1st." msgstr "" +"sendo ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` o número " +"do dia no ano atual, começando com 1 para 1º de janeiro." #: ../../library/datetime.rst:660 msgid "" @@ -1169,8 +1194,8 @@ msgid "" "toordinal()) == d``." msgstr "" "Retorna o ordinal proléptico gregoriano da data, considerando que 1º de " -"janeiro do ano 1 tem o ordinal ``1``. Para qualquer objeto :class:`date` " -"*d*, ``date.fromordinal(d.toordinal()) == d``." +"janeiro do ano 1 tem o ordinal 1. Para qualquer objeto :class:`date` *d*, " +"``date.fromordinal(d.toordinal()) == d``." #: ../../library/datetime.rst:667 msgid "" @@ -1318,9 +1343,9 @@ msgid "" "object, :class:`.datetime` assumes there are exactly 3600\\*24 seconds in " "every day." msgstr "" -"Assim como um objeto :class:`date`, :class:`.datetime` assume o atual " +"Assim como um objeto :class:`date`, :class:`.datetime` presume o atual " "calendário Gregoriano estendido em ambas as direções; assim como um objeto :" -"class:`.time`, :class:`.datetime` assume que existem exatamente 3600\\*24 " +"class:`.time`, :class:`.datetime` presume que existem exatamente 3600\\*24 " "segundos em cada dia." #: ../../library/datetime.rst:827 @@ -1760,6 +1785,12 @@ msgid "" "respectively, the earlier and later of the two moments with the same wall " "time representation." msgstr "" +"Entre ``[0, 1]``. Usado para desambiguar tempos reais durante um intervalo " +"repetido. (Um intervalo repetido ocorre quando relógios são atrasados ao " +"final do horário de verão ou quando a diferença UTC para o fuso horário " +"atual é reduzida por razões políticas.) Os valores 0 e 1 representam, " +"respectivamente, o primeiro e o segundo dos dois momentos com a mesma " +"representação de tempo real." #: ../../library/datetime.rst:1143 msgid "``datetime2 = datetime1 + timedelta``" @@ -1818,6 +1849,14 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone " "adjustments are done even if the input is an aware object." msgstr "" +"``datetime2`` representa a duração de ``timedelta`` removido de " +"``datetime1``, movendo o tempo para frente se ``timedelta.days > 0``, ou " +"para trás se ``timedelta.days < 0``. O resultado tem o mesmo atributo :attr:" +"`~.datetime.tzinfo` que o datetime de entrada, e ``datetime2 - datetime1 == " +"timedelta`` após. :exc:`OverflowError` é levantada se ``datetime2.year`` " +"fosse menor que :const:`MINYEAR` ou maior que :const:`MAXYEAR`. Perceba que " +"nenhum ajuste no fuso horário é feito mesmo se a entrada é um objeto " +"consciente disso." #: ../../library/datetime.rst:1168 msgid "" @@ -1826,6 +1865,10 @@ msgid "" "as the input datetime, and no time zone adjustments are done even if the " "input is aware." msgstr "" +"Computa o ``datetime2`` tal que ``datetime2 + timedelta == datetime1``. " +"Assim como para adição, o resultado tem o mesmo atributo :attr:`~.datetime." +"tzinfo` que datetime de entrada, e nenhum ajuste de fuso horário é feito " +"mesmo que a entrada seja consciente disso." #: ../../library/datetime.rst:1173 msgid "" @@ -1891,12 +1934,22 @@ msgid "" "implementation never overflows. :class:`!datetime` instances in a repeated " "interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" +"Se ambos os comparandos forem conscientes e tiverem o mesmo atributo :attr:`!" +"tzinfo`, os atributos :attr:`!tzinfo` e :attr:`~.datetime.fold` serão " +"ignorados e os datetimes base serão comparados. Se ambos os comparandos " +"forem conscientes e tiverem atributos :attr:`~.datetime.tzinfo` diferentes, " +"a comparação atua como se os comparandos fossem primeiro convertidos para " +"datetimes UTC, exceto que a implementação nunca estoura. Instâncias :class:`!" +"datetime` em um intervalo repetido nunca são iguais a instâncias :class:`!" +"datetime` em outro fuso horário." #: ../../library/datetime.rst:1206 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time, taking into account the time zone." msgstr "" +"*datetime1* é considerado menor que *datetime2* quando *datetime1* precede " +"*datetime2* no tempo. levando em consideração o fuso horário." #: ../../library/datetime.rst:1209 msgid "" @@ -1914,6 +1967,12 @@ msgid "" "comparands were first converted to UTC datetimes except that the " "implementation never overflows." msgstr "" +"Se ambos os comparandos forem conscientes e tiverem o mesmo atributo :attr:`!" +"tzinfo`, os atributos :attr:`!tzinfo` e :attr:`~.datetime.fold` serão " +"ignorados e os datetimes base serão comparados. Se ambos os comparandos " +"forem conscientes e tiverem atributos :attr:`~.datetime.tzinfo` diferentes, " +"a comparação atua como se os comparandos fossem primeiro convertidos para " +"datetimes UTC, exceto que a implementação nunca estoura." #: ../../library/datetime.rst:1220 msgid "" @@ -2100,6 +2159,13 @@ msgid "" "non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!tm_isdst` is set " "to 0." msgstr "" +"onde ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` é o " +"número de dias dentro do ano atual, começando com 1 para 1º de janeiro. O " +"sinalizador :attr:`~time.struct_time.tm_isdst` do resultado é definido " +"conforme o método :meth:`dst`: :attr:`.tzinfo` é ``None`` ou :meth:`dst` " +"retorna ``None``, :attr:`!tm_isdst` é definido para ``-1``; caso contrário " +"se :meth:`dst` retornar um valor diferente de zero, :attr:`!tm_isdst` é " +"definido para 1; caso contrário :attr:`!tm_isdst` é definido para 0." #: ../../library/datetime.rst:1356 msgid "" @@ -2108,6 +2174,10 @@ msgid "" "regardless of what ``d.dst()`` returns. DST is never in effect for a UTC " "time." msgstr "" +"Se a instância :class:`.datetime` *d* é ingênua, isto é o mesmo que ``d." +"timetuple()`` exceto que :attr:`~.time.struct_time.tm_isdst` é forçado para " +"0 independente do que ``d.dst()`` retorna. DST nunca é afetado por um " +"horário UTC." #: ../../library/datetime.rst:1360 msgid "" @@ -2117,6 +2187,11 @@ msgid "" "`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` " "and UTC adjustment spills over a year boundary." msgstr "" +"Se *d* é consciente, *d* é normalizado para horário UTC, subtraindo ``d." +"utcoffset()``, e uma :class:`time.struct_time` para a hora normalizada é " +"retornado. :attr:`!tm_isdst` é forçado para 0. Perceba que um :exc:" +"`OverflowError` pode ser levantada se ``d.year`` for ``MINYEAR`` ou " +"``MAXYEAR`` e os ajustes UTC ultrapassarem o limite de um ano." #: ../../library/datetime.rst:1369 msgid "" @@ -2162,7 +2237,7 @@ msgid "" "`OverflowError` or :exc:`OSError` for times far in the past or far in the " "future." msgstr "" -"Assume-se que instâncias :class:`.datetime` ingênuas representam a hora " +"Presume-se que instâncias :class:`.datetime` ingênuas representam a hora " "local e este método depende da função C :c:func:`mktime` da plataforma para " "realizar a conversão. Como :class:`.datetime` suporta um intervalo maior de " "valores que :c:func:`mktime` em muitas plataformas, este método pode " @@ -2333,7 +2408,7 @@ msgstr "" #: ../../library/datetime.rst:1502 ../../library/datetime.rst:1877 msgid "Added the *timespec* parameter." -msgstr "" +msgstr "Adicionado o parâmetro *timespec*." #: ../../library/datetime.rst:1508 msgid "" @@ -2393,7 +2468,7 @@ msgstr "Exemplos de uso: :class:`.datetime`" #: ../../library/datetime.rst:1550 msgid "Examples of working with :class:`.datetime` objects:" -msgstr "" +msgstr "Exemplos para trabalhar com objetos :class:`.datetime`:" #: ../../library/datetime.rst:1603 msgid "" @@ -2418,6 +2493,9 @@ msgid "" "A :class:`.time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" +"Um objeto :class:`.time` representa a hora (local) do dia, independente de " +"qualquer dia em particular, e sujeito a ajustes através de um objeto :class:" +"`tzinfo`." #: ../../library/datetime.rst:1683 msgid "" @@ -2434,6 +2512,9 @@ msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to 0 except *tzinfo*, which defaults to ``None``." msgstr "" +"Se um argumento fora desses intervalos é fornecido, :exc:`ValueError` é " +"levantada. Todos tem como padrão o valor 0 exceto *tzinfo*, o qual tem o " +"valor padrão ``None``." #: ../../library/datetime.rst:1701 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." @@ -2469,12 +2550,17 @@ msgid "" ":class:`.time` objects support equality and order comparisons, where *a* is " "considered less than *b* when *a* precedes *b* in time." msgstr "" +"Objetos :class:`.time` suportam comparações de igualdade e ordem, onde *a* é " +"considerado menor que *b* quando *a* precede *b* no tempo." #: ../../library/datetime.rst:1757 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" +"Objetos :class:`!time` ingênuos e conscientes nunca são iguais. A comparação " +"de ordem entre objetos :class:`!time` ingênuos e conscientes levanta :exc:" +"`TypeError`." #: ../../library/datetime.rst:1761 msgid "" @@ -2484,12 +2570,19 @@ msgid "" "different :attr:`!tzinfo` attributes, the comparands are first adjusted by " "subtracting their UTC offsets (obtained from ``self.utcoffset()``)." msgstr "" +"Se ambos os comparandos são conscientes, e tem o mesmo atributo :attr:`~." +"time.tzinfo`, os atributos :attr:`!tzinfo` e :attr:`!fold` são ignorados e " +"os tempos base são comparados. Se ambos os comparandos são conscientes e tem " +"atributos :attr:`!tzinfo` diferentes, os comparandos são primeiro ajustados " +"subtraindo sua diferença em UTC (obtida através de ``self.utcoffset()``)." #: ../../library/datetime.rst:1767 msgid "" "Equality comparisons between aware and naive :class:`.time` instances don't " "raise :exc:`TypeError`." msgstr "" +"Comparações de igualdade entre instâncias de :class:`.time` conscientes e " +"nativas não levantam :exc:`TypeError`." #: ../../library/datetime.rst:1771 msgid "" @@ -2708,6 +2801,10 @@ msgid "" "otherwise it can be pickled but possibly not unpickled again. This is a " "technical requirement that may be relaxed in the future." msgstr "" +"Requisito especial para preservação: uma subclasse :class:`tzinfo` deve ter " +"um método :meth:`~object.__init__` que pode ser chamado sem nenhum " +"argumento, caso contrário ele pode ser conservado, mas não alterado " +"novamente. Isso é um requisito técnico que pode ser relaxado no futuro." #: ../../library/datetime.rst:1986 msgid "" @@ -2715,6 +2812,10 @@ msgid "" "methods. Exactly which methods are needed depends on the uses made of aware :" "mod:`!datetime` objects. If in doubt, simply implement all of them." msgstr "" +"Uma subclasse concreta de :class:`tzinfo` pode precisar implementar os " +"seguintes métodos. Exatamente quais métodos são necessários depende do uso " +"feito de objetos :mod:`!datetime` conscientes. Se estiver em dúvida, " +"simplesmente implemente todos eles." #: ../../library/datetime.rst:1993 msgid "" @@ -2817,7 +2918,7 @@ msgstr "" #: ../../library/datetime.rst:2053 msgid "or::" -msgstr "or::" +msgstr "ou::" #: ../../library/datetime.rst:2065 msgid "" diff --git a/library/dbm.po b/library/dbm.po index 449293bbf..11ecfa9ae 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/debug.po b/library/debug.po index bfa161630..83f41d841 100644 --- a/library/debug.po +++ b/library/debug.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Hildeberto Abreu Magalhães , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/decimal.po b/library/decimal.po index a64131951..242903990 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -63,6 +63,11 @@ msgid "" "point. End users typically would not expect ``1.1 + 2.2`` to display as " "``3.3000000000000003`` as it does with binary floating point." msgstr "" +"Os números decimais podem ser representados exatamente. Por outro lado, " +"números como ``1.1`` e ``2.2`` não possuem representações exatas em ponto " +"flutuante binário. Os usuários finais normalmente não esperam que ``1.1 + " +"2.2`` sejam exibidos como ``3.3000000000000003``, como acontece com o ponto " +"flutuante binário." #: ../../library/decimal.rst:47 msgid "" @@ -73,6 +78,12 @@ msgid "" "accumulate. For this reason, decimal is preferred in accounting applications " "which have strict equality invariants." msgstr "" +"A exatidão transita para a aritmética. No ponto flutuante decimal, ``0.1 + " +"0.1 + 0.1 - 0.3`` é exatamente igual a zero. No ponto flutuante binário, o " +"resultado é ``5.5511151231257827e-017``. Embora próximas de zero, as " +"diferenças impedem o teste de igualdade confiável e as diferenças podem se " +"acumular. Por esse motivo, o decimal é preferido em aplicações de " +"contabilidade que possuem invariáveis estritos de igualdade." #: ../../library/decimal.rst:54 msgid "" @@ -83,6 +94,12 @@ msgid "" "multiplicands. For instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * " "1.20`` gives ``1.5600``." msgstr "" +"O módulo decimal incorpora uma noção de casas significativas para que ``1.30 " +"+ 1.20`` seja ``2.50``. O zero à direita é mantido para indicar " +"significância. Esta é a apresentação habitual para aplicações monetárias. " +"Para multiplicação, a abordagem \"livro escolar\" usa todas as figuras nos " +"multiplicandos. Por exemplo, ``1.3 * 1.2`` é igual a ``1.56`` enquanto " +"``1.30 * 1.20`` é igual a ``1.5600``." #: ../../library/decimal.rst:61 msgid "" @@ -138,6 +155,11 @@ msgid "" "``-Infinity``, and ``NaN``. The standard also differentiates ``-0`` from " "``+0``." msgstr "" +"Um número decimal é imutável. Possui um sinal, dígitos de coeficiente e um " +"expoente. Para preservar a significância, os dígitos do coeficiente não " +"truncam zeros à direita. Os decimais também incluem valores especiais, tais " +"como ``Infinity``, ``-Infinity`` e ``NaN``. O padrão também diferencia " +"``-0`` de ``+0``." #: ../../library/decimal.rst:94 msgid "" @@ -167,7 +189,7 @@ msgid "" "`FloatOperation`." msgstr "" "Sinais são grupos de condições excepcionais que surgem durante o curso da " -"computação. Dependendo das necessidades do aplicativo, os sinais podem ser " +"computação. Dependendo das necessidades da aplicação, os sinais podem ser " "ignorados, considerados informativos ou tratados como exceções. Os sinais no " "módulo decimal são: :const:`Clamped`, :const:`InvalidOperation`, :const:" "`DivisionByZero`, :const:`Inexact`, :const:`Rounded`, :const:`Subnormal`, :" @@ -191,6 +213,8 @@ msgid "" "IBM's General Decimal Arithmetic Specification, `The General Decimal " "Arithmetic Specification `_." msgstr "" +"A especificação geral aritmética decimal da IBM, `The General Decimal " +"Arithmetic Specification `_." #: ../../library/decimal.rst:125 msgid "Quick-start Tutorial" @@ -214,6 +238,12 @@ msgid "" "values such as ``NaN`` which stands for \"Not a number\", positive and " "negative ``Infinity``, and ``-0``::" msgstr "" +"Instâncias decimais podem ser construídas a partir de números inteiros, " +"strings, pontos flutuantes ou tuplas. A construção de um número inteiro ou " +"de um ponto flutuante realiza uma conversão exata do valor desse número " +"inteiro ou ponto flutuante. Os números decimais incluem valores especiais " +"como ``NaN``, que significa \"Não é um número\", ``Infinity`` positivo e " +"negativo e ``-0``::" #: ../../library/decimal.rst:163 msgid "" @@ -261,6 +291,9 @@ msgid "" "This method is useful for monetary applications that often round results to " "a fixed number of places:" msgstr "" +"O método :meth:`~Decimal.quantize` arredonda um número para um expoente " +"fixo. Esse método é útil para aplicações monetárias que geralmente " +"arredondam os resultados para um número fixo de locais:" #: ../../library/decimal.rst:262 msgid "" @@ -301,6 +334,11 @@ msgid "" "cleared, so it is best to clear the flags before each set of monitored " "computations by using the :meth:`~Context.clear_flags` method. ::" msgstr "" +"Os contextos também possuem sinalizadores para monitorar condições " +"excepcionais encontradas durante os cálculos. Os sinalizadores permanecem " +"definidos até que sejam explicitamente limpos, portanto, é melhor limpar os " +"sinalizadores antes de cada conjunto de cálculos monitorados usando o " +"método :meth:`~Context.clear_flags`. ::" #: ../../library/decimal.rst:312 msgid "" @@ -308,12 +346,17 @@ msgid "" "(digits beyond the context precision were thrown away) and that the result " "is inexact (some of the discarded digits were non-zero)." msgstr "" +"A entrada *flags* mostra que a aproximação racional de pi foi arredondada " +"(dígitos além da precisão do contexto foram descartados) e que o resultado é " +"inexato (alguns dos dígitos descartados eram diferentes de zero)." #: ../../library/decimal.rst:316 msgid "" "Individual traps are set using the dictionary in the :attr:`~Context.traps` " "attribute of a context:" msgstr "" +"As armadilhas individuais são definidas usando o dicionário no atributo :" +"attr:`~Context.traps` de um contexto:" #: ../../library/decimal.rst:331 msgid "" @@ -371,6 +414,10 @@ msgid "" "an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))`` returns " "``Decimal('1.414')``." msgstr "" +"Se *value* for um :class:`tuple`, ele deverá ter três componentes, um sinal " +"(``0`` para positivo ou ``1`` para negativo), um :class:`tuple` de dígitos e " +"um expoente inteiro. Por exemplo, ``Decimal((0, (1, 4, 1, 4), -3))`` returna " +"``Decimal('1.414')``." #: ../../library/decimal.rst:376 msgid "" @@ -405,6 +452,10 @@ msgid "" "exception is raised; otherwise, the constructor returns a new Decimal with " "the value of ``NaN``." msgstr "" +"O objetivo do argumento *context* é determinar o que fazer se *value* for " +"uma string malformada. Se o contexto capturar :const:`InvalidOperation`, uma " +"exceção será levantada; caso contrário, o construtor retornará um novo " +"decimal com o valor de ``NaN``." #: ../../library/decimal.rst:392 msgid "Once constructed, :class:`Decimal` objects are immutable." @@ -477,8 +528,8 @@ msgid "" "The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-" "integer`` operations (respectively) as described in the specification." msgstr "" -"Os operadores ``%`` e ``//`` implementam as operações de ``módulo`` e " -"``divisão inteira`` (respectivamente) como descrito na especificação." +"Os operadores ``%`` e ``//`` implementam as operações de ``remainder`` e " +"``divide-integer`` (respectivamente) como descrito na especificação." #: ../../library/decimal.rst:436 msgid "" @@ -683,7 +734,7 @@ msgid "" "Alternative constructor that only accepts instances of :class:`float` or :" "class:`int`." msgstr "" -"Construtor alternativo que aceita apenas instâncias de :class:`float` ou :" +"Construtor alternativo que aceita apenas instâncias de :class:`float` ou :" "class:`int`." #: ../../library/decimal.rst:579 @@ -694,6 +745,11 @@ msgid "" "``0x1.999999999999ap-4``. That equivalent value in decimal is " "``0.1000000000000000055511151231257827021181583404541015625``." msgstr "" +"Observe que ``Decimal.from_float(0.1)`` não é o mesmo que " +"``Decimal('0.1')``. Como 0.1 não é exatamente representável no ponto " +"flutuante binário, o valor é armazenado como o valor representável mais " +"próximo que é ``0x1.999999999999ap-4``.; Esse valor equivalente em decimal é " +"``0.1000000000000000055511151231257827021181583404541015625``." #: ../../library/decimal.rst:585 msgid "" @@ -866,6 +922,9 @@ msgid "" "before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" +"Como ``max(self, other)``, exceto que a regra de arredondamento de contexto " +"é aplicada antes de retornar e que os valores ``NaN`` são sinalizados ou " +"ignorados (dependendo do contexto e se estão sinalizando ou silenciosos)." #: ../../library/decimal.rst:710 msgid "" @@ -881,6 +940,9 @@ msgid "" "before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" +"Como ``min(self, other)``, exceto que a regra de arredondamento de contexto " +"é aplicada antes de retornar e que os valores ``NaN`` são sinalizados ou " +"ignorados (dependendo do contexto e se estão sinalizando ou silenciosos)." #: ../../library/decimal.rst:722 msgid "" @@ -927,6 +989,8 @@ msgid "" "Used for producing canonical values of an equivalence class within either " "the current context or the specified context." msgstr "" +"Usado para produzir valores canônicos de uma classe de equivalência no " +"contexto atual ou no contexto especificado." #: ../../library/decimal.rst:749 msgid "" @@ -937,22 +1001,35 @@ msgid "" "exponent is incremented by 1. Otherwise (the coefficient is zero) the " "exponent is set to 0. In all cases the sign is unchanged." msgstr "" +"Esta tem a mesma semântica que a operação unária mais, exceto que se o " +"resultado final for finito, ele será reduzido à sua forma mais simples, com " +"todos os zeros à direita removidos e seu sinal preservado. Ou seja, enquanto " +"o coeficiente for diferente de zero e múltiplo de dez, o coeficiente é " +"dividido por dez e o expoente é incrementado em 1. Caso contrário (o " +"coeficiente é zero), o expoente é definido como 0. Em todos os casos, o " +"sinal permanece inalterado. ." #: ../../library/decimal.rst:756 msgid "" "For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both " "normalize to the equivalent value ``Decimal('32.1')``." msgstr "" +"Por exemplo, ``Decimal('32.100')`` e ``Decimal('0.321000e+2')`` ambos " +"normalizam para o valor equivalente ``Decimal('32.1')``." #: ../../library/decimal.rst:759 msgid "Note that rounding is applied *before* reducing to simplest form." msgstr "" +"Observe que o arredondamento é aplicado *antes* de reduzir para a forma mais " +"simples." #: ../../library/decimal.rst:761 msgid "" "In the latest versions of the specification, this operation is also known as " "``reduce``." msgstr "" +"Nas versões mais recentes da especificação, esta operação também é conhecida " +"como ``reduce``." #: ../../library/decimal.rst:766 msgid "" @@ -1055,6 +1132,8 @@ msgid "" "An error is returned whenever the resulting exponent is greater than :attr:" "`~Context.Emax` or less than :meth:`~Context.Etiny`." msgstr "" +"Um erro é retornado sempre que o expoente resultante for maior que :attr:" +"`~Context.Emax` ou menor que :meth:`~Context.Etiny`." #: ../../library/decimal.rst:808 msgid "" @@ -1109,6 +1188,7 @@ msgid "" "Test whether self and other have the same exponent or whether both are " "``NaN``." msgstr "" +"Testa se \"self\" e \"other\" têm o mesmo expoente ou se ambos são ``NaN``." #: ../../library/decimal.rst:852 msgid "" @@ -1183,7 +1263,7 @@ msgid "" msgstr "" "Arredonda para o número inteiro mais próximo, sinalizando :const:`Inexact` " "ou :const:`Rounded`, conforme apropriado, se o arredondamento ocorrer. O " -"modo de arredondamento é determinado pelo parâmetro ``rouding``, se " +"modo de arredondamento é determinado pelo parâmetro ``rounding``, se " "fornecido, ou pelo ``context`` especificado. Se nenhum parâmetro for " "fornecido, o modo de arredondamento do contexto atual será usado." @@ -1209,6 +1289,11 @@ msgid "" "`Decimal` instance whose exponent and sign are both zero, and whose digits " "are all either ``0`` or ``1``." msgstr "" +"Os métodos :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :" +"meth:`~Decimal.logical_or` e :meth:`~Decimal.logical_xor` esperam que seus " +"argumentos sejam *operandos lógicos*. Um *operando lógico* é uma instância " +"de :class:`Decimal` cujo expoente e sinal são zero e cujos dígitos são todos " +"``0`` ou ``1``." #: ../../library/decimal.rst:918 msgid "Context objects" @@ -1256,6 +1341,11 @@ msgid "" "specified, a copy of the current context is used. The *kwargs* argument is " "used to set the attributes of the new context." msgstr "" +"Retorna um gerenciador de contexto que vai definir o contexto atual da " +"thread ativa para uma cópia de *ctx* na entrada da instrução \"with\" e " +"restaurar o contexto anterior ao sair da instrução \"with\". Se nenhum " +"contexto for especificado, uma cópia do contexto atual será usada. O " +"argumento *kwargs* é usado para definir os atributos do novo contexto." #: ../../library/decimal.rst:948 msgid "" @@ -1268,7 +1358,7 @@ msgstr "" #: ../../library/decimal.rst:958 msgid "Using keyword arguments, the code would be the following::" -msgstr "" +msgstr "Usando argumentos nomeados, o código seria o seguinte::" #: ../../library/decimal.rst:966 msgid "" @@ -1276,12 +1366,17 @@ msgid "" "`Context` doesn't support. Raises either :exc:`TypeError` or :exc:" "`ValueError` if *kwargs* supplies an invalid value for an attribute." msgstr "" +"Levanta :exc:`TypeError` se *kwargs* fornecer um atributo que :class:" +"`Context` não oferecer suporte. Levanta :exc:`TypeError` ou :exc:" +"`ValueError` se *kwargs* fornecer um valor inválido para um atributo." #: ../../library/decimal.rst:970 msgid "" ":meth:`localcontext` now supports setting context attributes through the use " "of keyword arguments." msgstr "" +":meth:`localcontext` agora tem suporte à configuração de atributos de " +"contexto através do uso de argumentos nomeados." #: ../../library/decimal.rst:973 msgid "" @@ -1333,6 +1428,10 @@ msgid "" "exceptions. This allows an application to complete a run in the presence of " "conditions that would otherwise halt the program." msgstr "" +"Como as armadilhas estão desativadas, esse contexto é útil para aplicativos " +"que preferem ter o valor de resultado de ``NaN`` ou ``Infinity`` em vez de " +"levantar exceções. Isso permite que uma aplicação conclua uma execução na " +"presença de condições que interromperiam o programa." #: ../../library/decimal.rst:1003 msgid "" @@ -1373,6 +1472,9 @@ msgid "" "rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" "`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." msgstr "" +"Os valores padrão são :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." +"rounding`\\ =\\ :const:`ROUND_HALF_EVEN` e armadilhas ativadas para :class:" +"`Overflow`, :class:`InvalidOperation` e :class:`DivisionByZero`." #: ../../library/decimal.rst:1020 msgid "" @@ -1398,6 +1500,8 @@ msgid "" "*prec* is an integer in the range [``1``, :const:`MAX_PREC`] that sets the " "precision for arithmetic operations in the context." msgstr "" +"*prec* é um número inteiro no intervalo [``1``, :const:`MAX_PREC`] que " +"define a precisão das operações aritméticas no contexto." #: ../../library/decimal.rst:1033 msgid "" @@ -1422,6 +1526,9 @@ msgid "" "allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, " "``0``], *Emax* in the range [``0``, :const:`MAX_EMAX`]." msgstr "" +"Os campos *Emin* e *Emax* são números inteiros que especificam os limites " +"externos permitidos para expoentes. *Emin* deve estar no intervalo [:const:" +"`MIN_EMIN`, ``0``], *Emax* no intervalo [``0``, :const:`MAX_EMAX`]." #: ../../library/decimal.rst:1043 msgid "" @@ -1429,6 +1536,9 @@ msgid "" "``1``, exponents are printed with a capital ``E``; otherwise, a lowercase " "``e`` is used: ``Decimal('6.02e+23')``." msgstr "" +"O campo *capitals* é ``0`` ou ``1`` (o padrão). Se definido como ``1``, os " +"expoentes serão impressos com um ``E`` maiúsculo; caso contrário, um ``e`` " +"minúscula é usado: ``Decimal('6.02e+23')``." #: ../../library/decimal.rst:1047 msgid "" @@ -1443,12 +1553,24 @@ msgid "" "value of the number but loses information about significant trailing zeros. " "For example::" msgstr "" +"O campo *clamp* é ``0`` (o padrão) ou ``1``. Se definido como ``1``, o " +"expoente ``e`` de uma instância de :class:`Decimal` representável nesse " +"contexto é estritamente limitado ao intervalo ``Emin - prec + 1 <= e <= Emax " +"- prec + 1``. Se *clamp* for ``0``, uma condição mais fraca será mantida: o " +"expoente ajustado da instância de :class:`Decimal` é no máximo :attr:" +"`~Context.Emax`. Quando *clamp* é ``1``, um grande número normal terá, " +"sempre que possível, seu expoente reduzido e um número correspondente de " +"zeros adicionado ao seu coeficiente, para ajustar as restrições do expoente; " +"isso preserva o valor do número, mas perde informações sobre zeros à direita " +"significativos. Por exemplo::" #: ../../library/decimal.rst:1062 msgid "" "A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " "interchange formats specified in IEEE 754." msgstr "" +"Um valor de *clamp* de ``1`` permite compatibilidade com os formatos de " +"intercâmbio decimal de largura fixa especificados na IEEE 754." #: ../../library/decimal.rst:1065 msgid "" @@ -1462,14 +1584,23 @@ msgid "" "exp(context=C)``. Each :class:`Context` method accepts a Python integer (an " "instance of :class:`int`) anywhere that a Decimal instance is accepted." msgstr "" +"A classe :class:`Context` define vários métodos de uso geral, bem como um " +"grande número de métodos para fazer aritmética diretamente em um determinado " +"contexto. Além disso, para cada um dos métodos de :class:`Decimal` descritos " +"acima (com exceção dos métodos :meth:`~Decimal.adjusted` e :meth:`~Decimal." +"as_tuple`) existe um método correspondente em :class:`Context`. Por exemplo, " +"para uma instância ``C`` de :class:`Context` e uma instância ``x`` de :class:" +"`Decimal`, ``C.exp(x)`` é equivalente a ``x.exp(context=C)``. Cada método " +"de :class:`Context` aceita um número inteiro do Python (uma instância de :" +"class:`int`) em qualquer lugar em que uma instância de Decimal seja aceita." #: ../../library/decimal.rst:1078 msgid "Resets all of the flags to ``0``." -msgstr "" +msgstr "Redefine todos os sinalizadores para ``0``." #: ../../library/decimal.rst:1082 msgid "Resets all of the traps to ``0``." -msgstr "" +msgstr "Redefine todas as armadilhas para ``0``." #: ../../library/decimal.rst:1088 msgid "Return a duplicate of the context." @@ -1611,7 +1742,7 @@ msgstr "Divide dois números e retorna a parte inteira do resultado." #: ../../library/decimal.rst:1223 msgid "Returns ``e ** x``." -msgstr "" +msgstr "Retorna ``e ** x``." #: ../../library/decimal.rst:1228 msgid "Returns *x* multiplied by *y*, plus *z*." @@ -1763,6 +1894,11 @@ msgid "" "rounding mode of the context is used. Results are always correctly rounded " "in the Python version." msgstr "" +"Com dois argumentos, calcula ``x**y``. Se ``x`` for negativo, ``y`` deve ser " +"inteiro. O resultado será inexato, a menos que ``y`` seja inteiro e o " +"resultado seja finito e possa ser expresso exatamente em \"precisão\" " +"dígitos. O modo de arredondamento do contexto é usado. Os resultados são " +"sempre arredondados corretamente na versão Python." #: ../../library/decimal.rst:1388 msgid "" @@ -1778,6 +1914,9 @@ msgid "" "`exp` and :meth:`ln` functions. The result is well-defined but only \"almost " "always correctly rounded\"." msgstr "" +"O módulo C calcula :meth:`power` em termos das funções corretamente " +"arredondadas :meth:`exp` e :meth:`ln`. O resultado é bem definido, mas " +"apenas \"quase sempre corretamente arredondado\"." #: ../../library/decimal.rst:1396 msgid "" @@ -1948,7 +2087,7 @@ msgstr "Modos de arredondamento" #: ../../library/decimal.rst:1528 msgid "Round towards ``Infinity``." -msgstr "" +msgstr "Arredonda para ``Infinity``." #: ../../library/decimal.rst:1532 msgid "Round towards zero." @@ -1956,7 +2095,7 @@ msgstr "Arredonda para zero." #: ../../library/decimal.rst:1536 msgid "Round towards ``-Infinity``." -msgstr "" +msgstr "Arredonda para ``-Infinity``." #: ../../library/decimal.rst:1540 msgid "Round to nearest with ties going towards zero." @@ -2032,6 +2171,9 @@ msgid "" "attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " "exponent is reduced to fit by adding zeros to the coefficient." msgstr "" +"Normalmente, *clamping* ocorre quando um expoente fica fora dos limites do " +"contexto :attr:`~Context.Emin` e :attr:`~Context.Emax`. Se possível, o " +"expoente é reduzido para caber adicionando zeros ao coeficiente." #: ../../library/decimal.rst:1590 msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." @@ -2048,6 +2190,9 @@ msgid "" "negative power. If this signal is not trapped, returns ``Infinity`` or ``-" "Infinity`` with the sign determined by the inputs to the calculation." msgstr "" +"Pode ocorrer com divisão, divisão de módulo ou ao elevar um número a uma " +"potência negativa. Se este sinal não for capturado, retornará ``Infinity`` " +"ou ``-Infinity`` com o sinal determinado pelas entradas do cálculo." #: ../../library/decimal.rst:1604 msgid "Indicates that rounding occurred and the result is not exact." @@ -2072,6 +2217,8 @@ msgid "" "Indicates that an operation was requested that does not make sense. If not " "trapped, returns ``NaN``. Possible causes include::" msgstr "" +"Indica que uma operação foi solicitada que não faz sentido. Se não for " +"capturado, retorna ``NaN``. As possíveis causas incluem::" #: ../../library/decimal.rst:1631 msgid "Numerical overflow." @@ -2085,6 +2232,11 @@ msgid "" "outward to ``Infinity``. In either case, :class:`Inexact` and :class:" "`Rounded` are also signaled." msgstr "" +"Indica que o expoente é maior que :attr:`Context.Emax` após o arredondamento " +"ocorrer. Se não for capturado, o resultado depende do modo de " +"arredondamento, puxando para dentro para o maior número finito representável " +"ou arredondando para fora para ``Infinity``. Nos dois casos, :class:" +"`Inexact` e :class:`Rounded` também são sinalizados." #: ../../library/decimal.rst:1642 msgid "Rounding occurred though possibly no information was lost." @@ -2098,10 +2250,15 @@ msgid "" "(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " "unchanged. This signal is used to detect loss of significant digits." msgstr "" +"Sinalizado sempre que o arredondamento descarta dígitos; mesmo que esses " +"dígitos sejam zero (como arredondamento ``5.00`` a ``5.0``). Se não for " +"capturado, retorna o resultado inalterado. Este sinal é usado para detectar " +"a perda de dígitos significativos." #: ../../library/decimal.rst:1652 msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." msgstr "" +"O expoente foi menor que :attr:`~Context.Emin` antes do arredondamento." #: ../../library/decimal.rst:1654 msgid "" @@ -2177,6 +2334,10 @@ msgid "" "can still incur round-off error when non-zero digits exceed the fixed " "precision." msgstr "" +"O uso do ponto flutuante decimal elimina o erro de representação decimal " +"(possibilitando representar ``0.1`` de forma exata); no entanto, algumas " +"operações ainda podem sofrer erros de arredondamento quando dígitos " +"diferentes de zero excederem a precisão fixa." #: ../../library/decimal.rst:1713 msgid "" @@ -2210,6 +2371,9 @@ msgid "" "including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " "``+0`` and ``-0``." msgstr "" +"O sistema numérico para o módulo :mod:`decimal` fornece valores especiais, " +"incluindo ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, e dois zeros, " +"``+0`` e ``-0``." #: ../../library/decimal.rst:1763 msgid "" @@ -2246,6 +2410,14 @@ msgid "" "series of computations that occasionally have missing inputs --- it allows " "the calculation to proceed while flagging specific results as invalid." msgstr "" +"Algumas operações são indeterminadas e retornam ``NaN`` ou, se o sinal :exc:" +"`InvalidOperation` for capturado, levanta uma exceção. Por exemplo, ``0/0`` " +"retorna ``NaN``, que significa \"não é um número\" em inglês. Esta variação " +"de ``NaN`` é silenciosa e, uma vez criada, fluirá através de outros cálculos " +"sempre resultando em outra ``NaN``. Esse comportamento pode ser útil para " +"uma série de cálculos que ocasionalmente têm entradas ausentes --- ele " +"permite que o cálculo continue enquanto sinaliza resultados específicos como " +"inválidos." #: ../../library/decimal.rst:1780 msgid "" @@ -2253,6 +2425,9 @@ msgid "" "operation. This is a useful return value when an invalid result needs to " "interrupt a calculation for special handling." msgstr "" +"Uma variante é ``sNaN``, que sinaliza em vez de permanecer em silêncio após " +"cada operação. Esse é um valor de retorno útil quando um resultado inválido " +"precisa interromper um cálculo para tratamento especial." #: ../../library/decimal.rst:1784 msgid "" @@ -2270,6 +2445,20 @@ msgid "" "standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal." "compare_signal` methods instead." msgstr "" +"O comportamento dos operadores de comparação do Python pode ser um pouco " +"surpreendente onde um ``NaN`` está envolvido. Um teste de igualdade em que " +"um dos operandos é um ``NaN`` silencioso ou sinalizador sempre retorna :" +"const:`False` (mesmo ao fazer ``Decimal('NaN')==Decimal('NaN')``), enquanto " +"um teste de desigualdade sempre retorna :const:`True`. Uma tentativa de " +"comparar dois decimais usando qualquer um dos operadores ``<``, ``<=``, " +"``>`` ou ``>=`` levantará o sinal :exc:`InvalidOperation` se um dos " +"operandos for um ``NaN`` e retorna :const:`False` se esse sinal não for " +"capturado. Observe que a especificação aritmética decimal geral não " +"especifica o comportamento das comparações diretas; estas regras para " +"comparações envolvendo a ``NaN`` foram retiradas do padrão IEEE 854 " +"(consulte a Tabela 3 na seção 5.7). Para garantir uma rígida conformidade " +"com os padrões, use os métodos :meth:`~Decimal.compare` e :meth:`~Decimal." +"compare_signal`." #: ../../library/decimal.rst:1797 msgid "" @@ -2341,9 +2530,9 @@ msgid "" msgstr "" "O novo contexto é copiado de um contexto protótipo chamado *DefaultContext*. " "Para controlar os padrões para que cada thread, use os mesmos valores em " -"todo o aplicativo, modifique diretamente o objeto *DefaultContext*. Isso " -"deve ser feito *antes* de qualquer thread ser iniciada, para que não haja " -"uma condição de corrida entre as threads chamando :func:`getcontext`. Por " +"todo a aplicação, modifique diretamente o objeto *DefaultContext*. Isso deve " +"ser feito *antes* de qualquer thread ser iniciada, para que não haja uma " +"condição de corrida entre as threads chamando :func:`getcontext`. Por " "exemplo::" #: ../../library/decimal.rst:1855 @@ -2360,7 +2549,7 @@ msgstr "" #: ../../library/decimal.rst:2012 msgid "Decimal FAQ" -msgstr "Perguntas Frequentes sobre Decimal" +msgstr "Perguntas frequentes sobre Decimal" #: ../../library/decimal.rst:2014 msgid "" @@ -2390,6 +2579,9 @@ msgid "" "places. If the :const:`Inexact` trap is set, it is also useful for " "validation:" msgstr "" +"R. O método :meth:`~Decimal.quantize` arredonda para um número fixo de casas " +"decimais. Se a armadilha :const:`Inexact` estiver configurada, também será " +"útil para validação:" #: ../../library/decimal.rst:2045 msgid "" @@ -2406,12 +2598,18 @@ msgid "" "division and non-integer multiplication, will change the number of decimal " "places and need to be followed-up with a :meth:`~Decimal.quantize` step:" msgstr "" +"R. Algumas operações como adição, subtração e multiplicação por um número " +"inteiro preservam automaticamente o ponto fixo. Outras operações, como " +"divisão e multiplicação não inteira, alteram o número de casas decimais e " +"precisam ser seguidas com uma etapa :meth:`~Decimal.quantize`:" #: ../../library/decimal.rst:2066 msgid "" "In developing fixed-point applications, it is convenient to define functions " "to handle the :meth:`~Decimal.quantize` step:" msgstr "" +"No desenvolvimento de aplicações de ponto fixo, é conveniente definir " +"funções para manipular a etapa :meth:`~Decimal.quantize`:" #: ../../library/decimal.rst:2080 msgid "" @@ -2420,16 +2618,22 @@ msgid "" "precisions. Is there a way to transform them to a single recognizable " "canonical value?" msgstr "" +"P. Existem várias maneiras de expressar o mesmo valor. Os números ``200``, " +"``200.000``, ``2E2`` e ``.02E+4`` têm todos o mesmo valor em várias " +"precisões. Existe uma maneira de transformá-los em um único valor canônico " +"reconhecível?" #: ../../library/decimal.rst:2085 msgid "" "A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " "single representative:" msgstr "" +"R. O método :meth:`~Decimal.normalize` mapeia todos os valores equivalentes " +"para um único representativo:" #: ../../library/decimal.rst:2092 msgid "Q. When does rounding occur in a computation?" -msgstr "" +msgstr "P. Quando ocorre o arredondamento em um cálculo?" #: ../../library/decimal.rst:2094 msgid "" @@ -2440,6 +2644,11 @@ msgid "" "rounding (or other context operations) is applied to the *result* of the " "computation::" msgstr "" +"R. Ocorre *após* o cálculo. A filosofia da especificação decimal é que os " +"números são considerados exatos e criados independentemente do contexto " +"atual. Eles podem até ter maior precisão do que o contexto atual. O processo " +"de cálculo com essas entradas exatas e, em seguida, o arredondamento (ou " +"outras operações de contexto) é aplicado ao *resultado* do cálculo::" #: ../../library/decimal.rst:2112 msgid "" @@ -2456,6 +2665,10 @@ msgid "" "``5.0E+3`` as ``5000`` keeps the value constant but cannot show the " "original's two-place significance." msgstr "" +"R. Para alguns valores, a notação exponencial é a única maneira de expressar " +"o número de casas significativas no coeficiente. Por exemplo, expressar " +"``5.0E+3`` como ``5000`` mantém o valor constante, mas não pode mostrar a " +"significância de duas casa do original." #: ../../library/decimal.rst:2120 msgid "" @@ -2568,12 +2781,18 @@ msgid "" "maximum values, :attr:`~Context.clamp` should always be 0 (the default). " "Setting :attr:`~Context.prec` requires some care." msgstr "" +"O contexto deve ser adaptado para uma aritmética exata de precisão " +"arbitrária. :attr:`~Context.Emin` e :attr:`~Context.Emax` devem sempre ser " +"configurados com os valores máximos, :attr:`~Context.clamp` deve sempre ser " +"0 (o padrão). A configuração de :attr:`~Context.prec` requer alguns cuidados." #: ../../library/decimal.rst:2197 msgid "" "The easiest approach for trying out bignum arithmetic is to use the maximum " "value for :attr:`~Context.prec` as well [#]_::" msgstr "" +"A abordagem mais fácil para testar a aritmética do bignum é usar o valor " +"máximo para :attr:`~Context.prec` também [#]_::" #: ../../library/decimal.rst:2206 msgid "" @@ -2590,6 +2809,10 @@ msgid "" "that you have 8GB of RAM and expect 10 simultaneous operands using a maximum " "of 500MB each::" msgstr "" +"Em sistemas com alocação excessiva (por exemplo, Linux), uma abordagem mais " +"sofisticada é ajustar :attr:`~Context.prec` à quantidade de RAM disponível. " +"Suponha que você tenha 8 GB de RAM e espere 10 operandos simultâneos usando " +"no máximo 500 MB cada::" #: ../../library/decimal.rst:2238 msgid "" diff --git a/library/development.po b/library/development.po index f4b488906..891c2c472 100644 --- a/library/development.po +++ b/library/development.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/devmode.po b/library/devmode.po index 35746371c..276f41b26 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/dialog.po b/library/dialog.po index 7d4e9630e..79688ca04 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/difflib.po b/library/difflib.po index bc70b497e..b470b2a81 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/dis.po b/library/dis.po index a78e9125a..3a3bdc626 100644 --- a/library/dis.po +++ b/library/dis.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/dis.rst:2 msgid ":mod:`!dis` --- Disassembler for Python bytecode" -msgstr "" +msgstr ":mod:`!dis` --- Disassembler de bytecode do Python" #: ../../library/dis.rst:7 msgid "**Source code:** :source:`Lib/dis.py`" @@ -44,9 +44,9 @@ msgid "" "is defined in the file :file:`Include/opcode.h` and used by the compiler and " "the interpreter." msgstr "" -"O módulo :mod:`dis` oferece suporte à análise dos termos :term:`bytecode` do " +"O módulo :mod:`dis` oferece suporte à análise de :term:`bytecode` do " "CPython, desmontando-o. O bytecode do CPython que o módulo leva como entrada " -"é definido no arquivo :file:`Incluir/opcode.h` e usado pelo compilador e " +"é definido no arquivo :file:`Include/opcode.h` e usado pelo compilador e " "pelo interpretador." #: ../../library/dis.rst:24 @@ -56,24 +56,26 @@ msgid "" "between versions of Python. Use of this module should not be considered to " "work across Python VMs or Python releases." msgstr "" -"O bytecode é um detalhe de implementação do interpretador do CPython. Não há " -"garantias de que o bytecode não será adicionado, removido ou alterado entre " -"as versões do Python. O uso deste módulo não deve ser considerado que " -"funcionará em todas as VMs do Python ou mesmo em versões do Python." +"O bytecode é um detalhe de implementação do interpretador CPython. Não há " +"garantias de que bytecodes não serão adicionados, removidos ou alterados " +"entre as versões do Python. O uso deste módulo não deve ser considerado que " +"funcionará em todas as VMs do Python ou mesmo versões do Python." #: ../../library/dis.rst:29 msgid "" "Use 2 bytes for each instruction. Previously the number of bytes varied by " "instruction." msgstr "" -"Use 2 bytes para cada instrução. Anteriormente, o número de bytes variava de " -"acordo com as instruções." +"Cada instrução ocupa 2 bytes. Anteriormente, o número de bytes variava de " +"acordo com a instrução." #: ../../library/dis.rst:33 msgid "" "The argument of jump, exception handling and loop instructions is now the " "instruction offset rather than the byte offset." msgstr "" +"O argumento para instruções de pulo, tratamento de exceção e laço é agora o " +"deslocamento em instruções, ao invés de em bytes." #: ../../library/dis.rst:37 msgid "" @@ -84,6 +86,13 @@ msgid "" "specialize it for different runtime conditions. The adaptive bytecode can be " "shown by passing ``adaptive=True``." msgstr "" +"Algumas instruções vêm acompanhadas de uma ou mais entradas de cache em " +"linha, as quais assumem a forma de instruções :opcode:`CACHE`. Tais " +"instruções são escondidas por padrão, mas podem ser visualizadas passando " +"``show_caches=True`` para qualquer utilidade do :mod:`dis`. Além disso, o " +"interpretador agora adapta o bytecode para especializá-lo a diferentes " +"condições de tempo de execução. O bytecode adaptativo pode ser visualizado " +"passando ``adaptive=True``." #: ../../library/dis.rst:45 msgid "" @@ -91,6 +100,9 @@ msgid "" "the instruction that appears immediately after the jump instruction's :" "opcode:`CACHE` entries." msgstr "" +"O argumento de um pulo é o deslocamento da instrução alvo relativo à " +"instrução que aparece imediatamente após as entradas :opcode:`CACHE` da " +"instrução de pulo." #: ../../library/dis.rst:50 msgid "" @@ -98,28 +110,33 @@ msgid "" "transparent for forward jumps but needs to be taken into account when " "reasoning about backward jumps." msgstr "" +"Como consequência, a presença de instruções :opcode:`CACHE` é transparente " +"para pulos adiante, mas precisa ser considerada ao lidar com pulos para trás." #: ../../library/dis.rst:54 msgid "Example: Given the function :func:`!myfunc`::" -msgstr "" +msgstr "Exemplo: Dada a função :func:`!myfunc`::" #: ../../library/dis.rst:59 msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" msgstr "" +"o comando a seguir pode ser usado para mostrar a desconstrução de :func:`!" +"myfunc`:" #: ../../library/dis.rst:72 msgid "(The \"2\" is a line number)." -msgstr "(O \"2\" é um número da linha)." +msgstr "(O \"2\" é o número da linha)." #: ../../library/dis.rst:77 msgid "Command-line interface" -msgstr "" +msgstr "Interface de linha de comando" #: ../../library/dis.rst:79 msgid "The :mod:`dis` module can be invoked as a script from the command line:" msgstr "" +"O módulo :mod:`dis` pode ser invocado como um script na linha de comando:" #: ../../library/dis.rst:85 msgid "The following options are accepted:" @@ -127,7 +144,7 @@ msgstr "As seguintes opções são aceitas:" #: ../../library/dis.rst:91 msgid "Display usage and exit." -msgstr "Exibe o uso e sai." +msgstr "Exibe o modo de uso e sai." #: ../../library/dis.rst:93 msgid "" @@ -138,7 +155,7 @@ msgstr "" #: ../../library/dis.rst:97 msgid "Bytecode analysis" -msgstr "Analise do Bytecode" +msgstr "Análise de bytecode" #: ../../library/dis.rst:101 msgid "" @@ -147,8 +164,8 @@ msgid "" "code." msgstr "" "A API de análise de bytecode permite que partes do código Python sejam " -"Wrapped em um objeto da :class:`Bytecode` que facilite o acesso aos detalhes " -"do código compilado." +"encapsuladas em um objeto :class:`Bytecode` que facilite o acesso aos " +"detalhes do código compilado." #: ../../library/dis.rst:108 msgid "" @@ -156,6 +173,9 @@ msgid "" "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" +"Analisa o bytecode correspondente a uma função, um gerador, um gerador " +"assíncrono, uma corrotina, um método, uma string de código-fonte, ou um " +"objeto de código (conforme retornado por :func:`compile`)." #: ../../library/dis.rst:112 msgid "" @@ -163,10 +183,10 @@ msgid "" "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -"Este é um Wrapper de conveniência em torno de muitas das funções listadas " -"abaixo, mais notavelmente a funçõa :func:`get_instructions`, como iterando " -"sobre uma instância :class:`Bytecode` produz as operações bytecode como nas " -"instância :class:`Instruction`." +"Esta é um invólucro de conveniência que encapsula muitas das funções " +"listadas abaixo, principalmente a :func:`get_instructions`, já que iterar " +"sobre sobre uma instância de :class:`Bytecode` produz operações bytecode " +"como instâncias de :class:`Instruction`." #: ../../library/dis.rst:116 ../../library/dis.rst:304 msgid "" @@ -175,6 +195,10 @@ msgid "" "source line information (if any) is taken directly from the disassembled " "code object." msgstr "" +"Se *first_line* não for ``None``, ele indica o número de linha que deve ser " +"reportado para a primeira linha de código-fonte no código desmontado. Caso " +"contrário, a informação de linha de código-fonte (se houver) é extraída " +"diretamente da desconstrução do objeto de código." #: ../../library/dis.rst:121 msgid "" @@ -182,55 +206,72 @@ msgid "" "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" +"Se *current_offset* não for ``None``, ele é um deslocamento em instruções no " +"código desconstruído. Definir este argumento significa que o :meth:`.dis` " +"vai mostrar um marcador de \"instrução atual\" sobre o opcode especificado." #: ../../library/dis.rst:125 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" +"Se *show_caches* for ``True``, o :meth:`.dis` vai exibir entradas de cache " +"em linha usadas pelo interpretador para especializar o bytecode." #: ../../library/dis.rst:128 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" +"Se *adaptive* for ``True``, o :meth:`.dis` vai exibir bytecode especializado " +"que pode ser diferente do bytecode original." #: ../../library/dis.rst:133 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" +"Constrói uma instância de :class:`Bytecode` a partir do traceback fornecido, " +"definindo *current_offset* apontando para a instrução responsável pela " +"exceção." #: ../../library/dis.rst:138 msgid "The compiled code object." -msgstr "" +msgstr "O objeto de código compilado." #: ../../library/dis.rst:142 msgid "The first source line of the code object (if available)" msgstr "" +"A primeira linha de código-fonte do objeto de código (caso disponível)." #: ../../library/dis.rst:146 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" +"Retorna uma visualização formatada das operações em bytecode (as mesmas que " +"seriam impressas pela :func:`dis.dis`, mas retornadas como uma string " +"multilinha)." #: ../../library/dis.rst:151 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" +"Retorna uma string multilinha formatada com informação detalhada sobre o " +"objeto de código, como :func:`code_info`." #: ../../library/dis.rst:154 ../../library/dis.rst:194 #: ../../library/dis.rst:246 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" +"Este método agora lida com objetos de corrotina e de gerador assíncrono." #: ../../library/dis.rst:157 ../../library/dis.rst:249 #: ../../library/dis.rst:265 ../../library/dis.rst:292 #: ../../library/dis.rst:313 msgid "Added the *show_caches* and *adaptive* parameters." -msgstr "" +msgstr "Adicionados os parâmetros *show_caches* e *adaptive*." #: ../../library/dis.rst:160 msgid "Example:" @@ -238,7 +279,7 @@ msgstr "Exemplo:" #: ../../library/dis.rst:176 msgid "Analysis functions" -msgstr "" +msgstr "Funções de análise" #: ../../library/dis.rst:178 msgid "" @@ -247,6 +288,10 @@ msgid "" "a single operation is being performed, so the intermediate analysis object " "isn't useful:" msgstr "" +"O módulo :mod:`dis` também define as seguintes funções que convertem a " +"entrada diretamente para a saída desejada. Elas podem ser úteis se somente " +"uma única operação está sendo feita, de forma que o objeto de análise " +"intermediário não é útil:" #: ../../library/dis.rst:184 msgid "" @@ -254,6 +299,9 @@ msgid "" "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" +"Retorna uma string multilinha formatada com informação detalhada sobre o " +"objeto de código correspondente à função, gerador, gerador assíncrono, " +"corrotina, método, string de código-fonte ou objeto de código fornecido." #: ../../library/dis.rst:188 msgid "" @@ -261,6 +309,9 @@ msgid "" "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" +"Observe que o conteúdo exato de strings de informação de código são " +"altamente dependentes da implementação e podem mudar de forma arbitrária " +"através de VMs Python ou lançamentos do Python." #: ../../library/dis.rst:200 msgid "" @@ -268,17 +319,22 @@ msgid "" "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" +"Imprime no arquivo *file* (ou ``sys.stdout`` caso *file* não seja " +"especificado) informações detalhadas sobre o objeto de código correspondente " +"à função, método, string de código-fonte fornecido." #: ../../library/dis.rst:204 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" +"Este é um atalho conveniente para ``print(code_info(x), file=file)``, " +"destinado à exploração interativa no prompt do interpretador." #: ../../library/dis.rst:209 ../../library/dis.rst:240 #: ../../library/dis.rst:262 ../../library/dis.rst:289 msgid "Added *file* parameter." -msgstr "" +msgstr "Adicionado o parâmetro *file*." #: ../../library/dis.rst:215 msgid "" @@ -295,6 +351,19 @@ msgid "" "before being disassembled. If no object is provided, this function " "disassembles the last traceback." msgstr "" +"Desmonta o objeto *x*. *x* pode denotar um módulo, uma classe, um método, " +"uma função, um gerador, um gerador assíncrono, uma corrotina, um objeto de " +"código, uma string de código-fonte ou uma sequência de bytes contendo " +"bytecode bruto. Para um módulo, são desmontadas todas as funções. Para uma " +"classe, são desmontados todos os métodos (incluindo métodos de classe e " +"estáticos). Para um objeto de código ou sequência de bytecodes brutos, é " +"impressa uma linha para cada instrução de bytecode. Além disso, objetos de " +"código aninhados são desmontados recursivamente. Estes podem incluir " +"expressões geradoras, funções aninhadas, corpos de classes aninhadas, e " +"objetos de código usados para :ref:`escopos de anotação `. Strings são compiladas para objetos de código com a função " +"embutida :func:`compile` antes de serem desmontadas. Se nenhum objeto for " +"fornecido, o último traceback é desmontado." #: ../../library/dis.rst:228 ../../library/dis.rst:259 #: ../../library/dis.rst:286 @@ -302,28 +371,37 @@ msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" +"O resultado é escrito como texto no arquivo *file* caso tenha sido fornecido " +"como argumento, ou para ``sys.stdout`` caso contrário." #: ../../library/dis.rst:231 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" +"A profundidade máxima de recursão é limitada por *depth* a menos que seja " +"``None``. ``depth=0`` significa não fazer recursão." #: ../../library/dis.rst:234 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" +"Se *show_caches* for ``True``, essa função vai exibir entradas de cache em " +"linha usadas pelo interpretador para especializar o bytecode." #: ../../library/dis.rst:237 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" +"Se *adaptive* for ``True``, essa função vai exibir bytecode especializado " +"que pode ser diferente do bytecode original." #: ../../library/dis.rst:243 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" +"Foi implementada a desmontagem recursiva, e adicionado o parâmetro *depth*." #: ../../library/dis.rst:255 msgid "" @@ -331,58 +409,70 @@ msgid "" "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" +"Desmonta a função no topo da pilha de um traceback, usando o último " +"traceback caso nenhum tenha sido passado. A instrução que causou a exceção " +"é indicada." #: ../../library/dis.rst:272 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" +"Desmonta um objeto de código, indicando a última instrução se *lasti* tiver " +"sido fornecido. A saída é dividida em colunas da seguinte forma:" #: ../../library/dis.rst:275 msgid "the line number, for the first instruction of each line" -msgstr "" +msgstr "o número da linha, para a primeira instrução de cada linha" #: ../../library/dis.rst:276 msgid "the current instruction, indicated as ``-->``," -msgstr "" +msgstr "a instrução atual, indicada por ``-->``," #: ../../library/dis.rst:277 msgid "a labelled instruction, indicated with ``>>``," -msgstr "" +msgstr "um rótulo da instrução, indicado com ``>>``," #: ../../library/dis.rst:278 msgid "the address of the instruction," -msgstr "" +msgstr "o endereço da instrução" #: ../../library/dis.rst:279 msgid "the operation code name," -msgstr "" +msgstr "o nome do código da operação," #: ../../library/dis.rst:280 msgid "operation parameters, and" -msgstr "" +msgstr "os parâmetros da operação, e" #: ../../library/dis.rst:281 msgid "interpretation of the parameters in parentheses." -msgstr "" +msgstr "a interpretação dos parâmetros, em parênteses." #: ../../library/dis.rst:283 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" +"A interpretação dos parâmetros reconhece nomes de variáveis locais e " +"globais, valores de constantes, alvos de ramificações, e operadores de " +"comparação." #: ../../library/dis.rst:298 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" +"Retorna um iterador sobre as instruções na função, método, string de código-" +"fonte ou objeto de código fornecido." #: ../../library/dis.rst:301 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" +"O iterador gera uma série de tuplas nomeadas :class:`Instruction` contendo " +"detalhes de cada operação no código fornecido." #: ../../library/dis.rst:309 msgid "" @@ -396,10 +486,15 @@ msgid "" "of lines in the source code. They are generated as ``(offset, lineno)`` " "pairs." msgstr "" +"Essa função geradora usa o método :meth:`~codeobject.co_lines` do :ref:" +"`objeto de código ` *code* para encontrar as posições que " +"correspondem aos inícios de cada linha do código-fonte. Elas são geradas em " +"pares ``(offset, lineno)``." #: ../../library/dis.rst:324 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" +"Números de linhas podem ser decrescentes. Antes, eles eram sempre crescentes." #: ../../library/dis.rst:327 msgid "" @@ -407,16 +502,21 @@ msgid "" "attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " "attributes of the :ref:`code object `." msgstr "" +"O método :meth:`~codeobject.co_lines` da :pep:`626` é usado ao invés dos " +"atributos :attr:`~codeobject.co_firstlineno` e :attr:`~codeobject.co_lnotab` " +"do :ref:`objeto de código `." #: ../../library/dis.rst:335 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" +"Detecta todas as posições na string de bytecode compilado bruto *code* que " +"são alvos de pulos, e as retorna em uma lista." #: ../../library/dis.rst:341 msgid "Compute the stack effect of *opcode* with argument *oparg*." -msgstr "" +msgstr "Calcula o efeito que o *opcode* com argumento *oparg* tem na pilha." #: ../../library/dis.rst:343 msgid "" @@ -425,6 +525,11 @@ msgid "" "return the stack effect of not jumping. And if *jump* is ``None`` (default), " "it will return the maximal stack effect of both cases." msgstr "" +"Se a operação tiver um alvo de pulo e *jump* for ``True``, :func:" +"`~stack_effect` vai retornar o efeito na pilha de realizar o pulo. Se " +"*jump* for ``False``, ela vai retornar o efeito na pilha de não pular. E se " +"*jump* for ``None`` (o padrão), vai retornar o efeito máximo na pilha dentre " +"os dois casos." #: ../../library/dis.rst:350 msgid "Added *jump* parameter." @@ -432,45 +537,52 @@ msgstr "Adicionado o parâmetro *jump*." #: ../../library/dis.rst:357 msgid "Python Bytecode Instructions" -msgstr "" +msgstr "Instruções em bytecode do Python" #: ../../library/dis.rst:359 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" +"A função :func:`get_instructions` e a classe :class:`Bytecode` fornecem " +"detalhes de instruções de bytecode como instâncias de :class:`Instruction`:" #: ../../library/dis.rst:364 msgid "Details for a bytecode operation" -msgstr "" +msgstr "Detalhes de uma operação em bytecode" #: ../../library/dis.rst:368 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" +"código numérico da operação, correspondendo aos valores dos opcodes listados " +"abaixo e aos valores dos bytecodes nas :ref:`opcode_collections`." #: ../../library/dis.rst:374 msgid "human readable name for operation" -msgstr "" +msgstr "nome legível por humanos para a operação" #: ../../library/dis.rst:379 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" +"argumento numérico para a operação (se houver), caso contrário ``None``" #: ../../library/dis.rst:384 msgid "resolved arg value (if any), otherwise ``None``" -msgstr "" +msgstr "valor resolvido do argumento (se houver), caso contrário ``None``" #: ../../library/dis.rst:389 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" +"descrição legível por humanos do argumento da operação (se houver), caso " +"contrário uma string vazia." #: ../../library/dis.rst:395 msgid "start index of operation within bytecode sequence" -msgstr "" +msgstr "índice de início da operação dentro da sequência de bytecodes" #: ../../library/dis.rst:400 msgid "line started by this opcode (if any), otherwise ``None``" @@ -478,31 +590,35 @@ msgstr "" #: ../../library/dis.rst:405 msgid "``True`` if other code jumps to here, otherwise ``False``" -msgstr "" +msgstr "``True`` se algum outro código pula para cá, senão ``False``" #: ../../library/dis.rst:410 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" +"objeto :class:`dis.Positions` contendo os pontos de início e fim cobertos " +"por esta instrução." #: ../../library/dis.rst:417 msgid "Field ``positions`` is added." -msgstr "" +msgstr "Adicionado o campo ``positions``." #: ../../library/dis.rst:422 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" +"Caso a informação não esteja disponível, alguns campos podem ser ``None``." #: ../../library/dis.rst:432 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" +"O compilador de Python atualmente gera as seguintes instruções de bytecode." #: ../../library/dis.rst:435 msgid "**General instructions**" -msgstr "" +msgstr "**Instruções gerais**" #: ../../library/dis.rst:437 msgid "" @@ -510,16 +626,21 @@ msgid "" "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" +"A seguir, vamos usar ``STACK`` para nos referirmos à pilha do interpretador, " +"e vamos descrever operações nela como se ela fosse uma lista do Python. " +"Nessa linguagem, ``STACK[-1]`` é o topo da pilha." #: ../../library/dis.rst:443 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" +"Código para não fazer nada. Usado como espaço reservado pelo otimizador de " +"bytecode, e para gerar eventos de rastreamento de linha." #: ../../library/dis.rst:449 msgid "Removes the top-of-stack item::" -msgstr "" +msgstr "Remove o item no topo da pilha::" #: ../../library/dis.rst:456 msgid "" @@ -530,16 +651,19 @@ msgstr "" #: ../../library/dis.rst:465 msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" +"Implementa ``del STACK[-2]``. Usado como limpeza quando um gerador termina." #: ../../library/dis.rst:473 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" +"Coloca o i-ésimo item no topo da pilha sem removê-lo da sua posição " +"original::" #: ../../library/dis.rst:484 msgid "Swap the top of the stack with the i-th element::" -msgstr "" +msgstr "Troca o topo da pilha de lugar com o i-ésimo elemento." #: ../../library/dis.rst:493 msgid "" @@ -548,6 +672,10 @@ msgid "" "itself. It is automatically hidden by all ``dis`` utilities, but can be " "viewed with ``show_caches=True``." msgstr "" +"Ao invés de ser uma instrução de fato, este opcode é usado para demarcar " +"espaço extra para o interpretador armazernar dados úteis diretamente no " +"próprio bytecode. É escondido automaticamente por todas as utilidades do " +"``dis``, mas pode ser visualizado com ``show_caches=True``." #: ../../library/dis.rst:498 msgid "" @@ -555,6 +683,9 @@ msgid "" "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" +"Do ponto de vista lógico, este espaço faz parte da instrução anterior. " +"Muitos opcodes esperam ser seguidos por um número exato de caches, e " +"instruem o interpretador a pulá-los em tempo de execução." #: ../../library/dis.rst:502 msgid "" @@ -562,42 +693,50 @@ msgid "" "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" +"Caches populados podem se parecer com qualquer instrução, de forma que ler " +"ou modificar bytecode adaptativo bruto contendo dados \"quickened\" requer " +"muito cuidado." #: ../../library/dis.rst:509 msgid "**Unary operations**" -msgstr "" +msgstr "**Operações unárias**" #: ../../library/dis.rst:511 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" +"Operações unárias tiram o topo da pilha, aplicam a operação, e põem o " +"resultado de volta na pilha." #: ../../library/dis.rst:517 msgid "Implements ``STACK[-1] = -STACK[-1]``." -msgstr "" +msgstr "Implementa ``STACK[-1] = -STACK[-1]``." #: ../../library/dis.rst:522 msgid "Implements ``STACK[-1] = not STACK[-1]``." -msgstr "" +msgstr "Implementa ``STACK[-1] = not STACK[-1]``." #: ../../library/dis.rst:527 msgid "Implements ``STACK[-1] = ~STACK[-1]``." -msgstr "" +msgstr "Implementa ``STACK[-1] = ~STACK[-1]``." #: ../../library/dis.rst:532 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." -msgstr "" +msgstr "Implementa ``STACK[-1] = iter(STACK[-1])``." #: ../../library/dis.rst:537 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" +"Se ``STACK[-1]`` for um :term:`iterador gerador` ou um objeto :term:" +"`corrotina`, nada acontece. Caso contrário, implementa ``STACK[-1] = " +"iter(STACK[-1])``." #: ../../library/dis.rst:543 msgid "**Binary and in-place operations**" -msgstr "" +msgstr "**Operações binárias e internas**" #: ../../library/dis.rst:545 msgid "" @@ -605,6 +744,9 @@ msgid "" "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" +"Operações binárias removem os dois itens no topo da pilha (``STACK[-1]`` e " +"``STACK[-2]``). A operação é realizada, e o resultado é colocado de volta na " +"pilha." #: ../../library/dis.rst:548 msgid "" @@ -612,12 +754,16 @@ msgid "" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" +"As operações internas são como as operações binárias, só que a operação é " +"feita internamente caso suportado por ``STACK[-2]``, e o ``STACK[-1]`` " +"resultante pode ser (mas não necessariamente é) o ``STACK[-2]`` original." #: ../../library/dis.rst:555 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" +"Implementa os operadores binários e locais (depende do valor de *op*)::" #: ../../library/dis.rst:567 ../../library/dis.rst:576 #: ../../library/dis.rst:586 ../../library/dis.rst:594 @@ -627,11 +773,11 @@ msgstr "" #: ../../library/dis.rst:1045 ../../library/dis.rst:1057 #: ../../library/dis.rst:1069 msgid "Implements::" -msgstr "" +msgstr "Implementa::" #: ../../library/dis.rst:617 msgid "**Coroutine opcodes**" -msgstr "" +msgstr "**Opcodes para corrotinas**" #: ../../library/dis.rst:621 msgid "" @@ -640,38 +786,45 @@ msgid "" "generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or " "resolves ``o.__await__``." msgstr "" +"Implementa ``STACK[-1] = get_awaitable(STACK[-1])``, onde " +"``get_awaitable(o)`` retorna ``o`` se ``o`` for um objeto de corrotina ou um " +"gerador com o sinalizador :data:`~inspect.CO_ITERABLE_COROUTINE`, ou então " +"resolve ``o.__await__``." #: ../../library/dis.rst:626 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" +"Se o operando ``where`` não for zero, ele indica onde a instrução ocorre:" #: ../../library/dis.rst:629 msgid "``1``: After a call to ``__aenter__``" -msgstr "" +msgstr "``1``: Após uma chamada a ``__aenter__``" #: ../../library/dis.rst:630 msgid "``2``: After a call to ``__aexit__``" -msgstr "" +msgstr "``2``: Após uma chamada a ``__aexit__``" #: ../../library/dis.rst:634 msgid "Previously, this instruction did not have an oparg." -msgstr "" +msgstr "Anteriormente, esta instrução não tinha um oparg." #: ../../library/dis.rst:640 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." -msgstr "" +msgstr "Implementa ``STACK[-1] = STACK[-1].__aiter__()``." #: ../../library/dis.rst:643 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." -msgstr "" +msgstr "Não é mais aceitado que o ``__aiter__`` retorne objetos aguardáveis." #: ../../library/dis.rst:650 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" +"Implementa ``STACK.append(get_awaitable(STACK[-1].__anext__()))``. Veja " +"``GET_AWAITABLE`` para o significado de ``get_awaitable``." #: ../../library/dis.rst:658 msgid "" @@ -680,12 +833,18 @@ msgid "" "and the raised exception in ``STACK[-1]``. Both are popped. If the exception " "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" +"Termina um laço :keyword:`async for`. Trata exceções levantadas ao aguardar " +"um item seguinte. A pilha contém o iterável async em ``STACK[-2]`` e a " +"exceção levantada em ``STACK[-1]``. Ambos são retirados. Se a exceção não " +"for :exc:`StopAsyncIteration`, ela é re-levantada." #: ../../library/dis.rst:665 ../../library/dis.rst:770 #: ../../library/dis.rst:781 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" +"A representação da exceção na pilha consiste agora de um item, ao invés de " +"três." #: ../../library/dis.rst:671 msgid "" @@ -694,34 +853,42 @@ msgid "" "instance of :exc:`StopIteration`, pop three values from the stack and push " "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" +"Trata uma exceção levantada durante um chamada a :meth:`~generator.throw` " +"ou :meth:`~generator.close` através do quadro atual. Se ``STACK[-1]`` for " +"uma instância de :exc:`StopIteration`, remove três valores da pilha e põe de " +"volta o seu membro ``value``. Caso contrário, re-levanta ``STACK[-1]``." #: ../../library/dis.rst:681 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" +"Resolve os métodos especiais ``__aenter__`` e ``__aexit__`` de " +"``STACK[-1]``. Põe na pilha ``__aexit__`` e o resultado de ``__aenter__()``::" #: ../../library/dis.rst:690 msgid "**Miscellaneous opcodes**" -msgstr "" +msgstr "**Opcodes genéricos**" #: ../../library/dis.rst:699 msgid "Used to implement set comprehensions." -msgstr "" +msgstr "Usado para implementar compreensões de conjuntos." #: ../../library/dis.rst:709 msgid "Used to implement list comprehensions." -msgstr "" +msgstr "Usado para implementar compreensões de lista." #: ../../library/dis.rst:720 msgid "Used to implement dict comprehensions." -msgstr "" +msgstr "Usado para implementar compreensões de dicionário." #: ../../library/dis.rst:723 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" +"O valor do mapa é ``STACK[-1]``, e a sua chave, ``STACK[-2]``. Antes, eles " +"estavam ao contrário." #: ../../library/dis.rst:727 msgid "" @@ -730,28 +897,34 @@ msgid "" "off, the container object remains on the stack so that it is available for " "further iterations of the loop." msgstr "" +"Para as instruções :opcode:`SET_ADD`, :opcode:`LIST_APPEND` e :opcode:" +"`MAP_ADD`, o valor ou par chave/valor é removido da pilha, mas o objeto de " +"contêiner continua na pilha para que ele esteja disponível para as iterações " +"seguintes do laço." #: ../../library/dis.rst:735 msgid "Returns with ``STACK[-1]`` to the caller of the function." -msgstr "" +msgstr "Retorna ``STACK[-1]`` para quem chamou a função." #: ../../library/dis.rst:740 msgid "Returns with ``co_consts[consti]`` to the caller of the function." -msgstr "" +msgstr "Retorna ``co_consts[consti]`` para quem chamou a função." #: ../../library/dis.rst:747 msgid "Yields ``STACK.pop()`` from a :term:`generator`." -msgstr "" +msgstr "Gera ``STACK.pop()`` a partir de um :term:`gerador`." #: ../../library/dis.rst:749 msgid "oparg set to be the stack depth." -msgstr "" +msgstr "oparg definido como sendo a profundidade da pilha." #: ../../library/dis.rst:752 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" +"oparg definido como sendo a profundidade do bloco exception, para o " +"fechamento eficiente de geradores." #: ../../library/dis.rst:758 msgid "" @@ -760,11 +933,17 @@ msgid "" "module body contains :term:`variable annotations ` " "statically." msgstr "" +"Verifica se ``__annotations__`` está definido em ``locals()`` e, se não " +"estiver, é inicializado como um ``dict`` vazio. Este opcode é emitido " +"somente se o corpo de uma classe ou módulo contém :term:`anotações de " +"variáveis ` estaticamente." #: ../../library/dis.rst:768 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" +"Remove o valor no topo da pilha, o qual é usado para restaurar o estado de " +"exceção." #: ../../library/dis.rst:775 msgid "" @@ -772,6 +951,9 @@ msgid "" "pops an additional value from the stack which is used to set :attr:`~frame." "f_lasti` of the current frame." msgstr "" +"Re-levanta a exceção que se encontra no topo da pilha. Se o oparg não for " +"zero, remove um valor adicional do topo da pilha, o qual é atribuído ao :" +"attr:`~frame.f_lasti`` do quadro atual." #: ../../library/dis.rst:786 msgid "" @@ -779,6 +961,9 @@ msgid "" "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" +"Remove um valor do topo da pilha. Põe a exceção atual no topo da pilha. Põe " +"de volta no topo da pilha o valor que foi removido inicialmente. Usado em " +"tratadores de exceções." #: ../../library/dis.rst:794 msgid "" @@ -786,12 +971,17 @@ msgid "" "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" +"Verifica correspondências de exceções em ``except``. Testa de ``STACK[-2]`` " +"é uma exceção que corresponde a ``STACK[-1]``. Remove ``STACK[-1]`` do topo " +"da pilha, e põe no seu lugar o resultado booleano do teste." #: ../../library/dis.rst:802 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" +"Verifica correspondências de exceções em ``except*``. Aplica " +"``split(STACK[-1])`` no grupo de exceções que representa ``STACK[-2]``." #: ../../library/dis.rst:805 msgid "" @@ -800,6 +990,11 @@ msgid "" "subgroup. When there is no match, pops one item (the match type) and pushes " "``None``." msgstr "" +"No caso de uma correspondência, remove dois itens do topo da pilha e põe " +"nela o subgrupo que falhou a correspondência (``None`` caso a " +"correspondência tenha sido total), seguido pelo subgrupo que correspondeu. " +"Quando não há correspondência nenhuma, remove um item (o tipo da " +"correspondêcia) e põe ``None`` no seu lugar." #: ../../library/dis.rst:814 msgid "" @@ -808,24 +1003,34 @@ msgid "" "call ``context_manager.__exit__(*exc_info())`` when an exception has " "occurred in a :keyword:`with` statement." msgstr "" +"Chama a função na posição 4 da pilha com argumentos (tipo, val, tb) " +"representando a exceção no topo da pilha. Usado para implementar a chamada " +"``context_manager.__exit__(*exc_info())`` quando uma exceção ocorreu em uma " +"instrução :keyword:`with`." #: ../../library/dis.rst:821 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" +"A função ``__exit__`` fica agora na posição 4 pilha, ao invés da 7. A " +"representação da exceção pilha consiste agora de um item, não três." #: ../../library/dis.rst:828 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" +"Põe :exc:`AssertionError` no topo da pilha. Usado pela instrução :keyword:" +"`assert`." #: ../../library/dis.rst:836 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" +"Põe a função :func:`!builtins.__build_class__` no topo da pilha. Ela será " +"chamada posteriormente para construir uma classe." #: ../../library/dis.rst:842 msgid "" @@ -835,10 +1040,15 @@ msgid "" "`~object.__enter__` is called. Finally, the result of calling the " "``__enter__()`` method is pushed onto the stack." msgstr "" +"Este opcode realiza várias operações antes do início de um bloco \"with\". " +"Primeiro, ele carrega o :meth:`~object.__exit__` do gerenciador de contexto " +"e o coloca no topo da pilha para ser usado posteriormente pela :opcode:" +"`WITH_EXCEPT_START`. Então, o método :meth:`~object.__enter__` é chamado. " +"Por fim, o resultado do ``__enter__()`` é posto no topo da pilha." #: ../../library/dis.rst:853 msgid "Perform ``STACK.append(len(STACK[-1]))``." -msgstr "" +msgstr "Realiza ``STACK.append(len(STACK[-1]))``." #: ../../library/dis.rst:860 msgid "" @@ -847,6 +1057,10 @@ msgid "" "its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " "Otherwise, push ``False``." msgstr "" +"Se ``STACK[-1]`` for uma instância de :class:`collections.abc.Mapping` (ou, " +"de forma mais técnica: se tiver o sinalizador :c:macro:`Py_TPFLAGS_MAPPING` " +"definido no seu :c:member:`~PyTypeObject.tp_flags`), põe ``True`` no topo da " +"pilha. Caso contrário, põe ``False``." #: ../../library/dis.rst:870 msgid "" @@ -856,6 +1070,11 @@ msgid "" "its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " "Otherwise, push ``False``." msgstr "" +"Se ``STACK[-1]`` for uma instância de :class:`collections.abc.Sequence` e " +"*não* for uma instância de :class:`str`/:class:`bytes`/:class:`bytearray` " +"(ou, de forma mais técnica: se tiver o sinalizador :c:macro:" +"`Py_TPFLAGS_SEQUENCE` definido no seu :c:member:`~PyTypeObject.tp_flags`), " +"põe ``True`` no topo da pilha. Caso contrário, põe ``False``." #: ../../library/dis.rst:880 msgid "" @@ -863,12 +1082,18 @@ msgid "" "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" +"``STACK[-1]`` é uma tupla de chaves de um mapeamento, e ``STACK[-2]`` é o " +"sujeito de uma correspondência. Se ``STACK[-2]`` contiver todas as chaves em " +"``STACK[-1]``, põe no topo da pilha um :class:`tuple` contendo os valores " +"correspondentes. Caso contrário, põe ``None``." #: ../../library/dis.rst:886 ../../library/dis.rst:1513 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" +"Anteriormente, essa instrução também colocava na pilha um valor booleano " +"indicando sucesso (``True``) ou falha (``False``)." #: ../../library/dis.rst:893 msgid "" @@ -877,18 +1102,27 @@ msgid "" "objects>`. The compiler tries to use :opcode:`STORE_FAST` or :opcode:" "`STORE_GLOBAL` if possible." msgstr "" +"Implementa ``name = STACK.pop()``. *namei* é o índice de *name* no atributo :" +"attr:`~codeobject.co_names` do :ref:`objeto de código `. O " +"compilador tenta usar :opcode:`STORE_FAST` ou :opcode:`STORE_GLOBAL` se " +"possível." #: ../../library/dis.rst:900 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`~codeobject." "co_names` attribute of the :ref:`code object `." msgstr "" +"Implementa ``del name``, onde *namei* é o índice no atributo :attr:" +"`~codeobject.co_names` do :ref:`objeto de código `." #: ../../library/dis.rst:906 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" +"Desempacota ``STACK[-1]`` em *count* valores individuais, os quais são " +"postos na pilha da direita para a esquerda. Requer que haja exatamente " +"*count* valores::" #: ../../library/dis.rst:915 msgid "" @@ -897,10 +1131,16 @@ msgid "" "be smaller than the number of items in the iterable: one of the new values " "will be a list of all leftover items." msgstr "" +"Implementa atribuição com um alvo estrelado: desempacota o iterável " +"``STACK[-1]`` em valores individuais, sendo que pode haver menos valores do " +"que itens no iterável: um dos novos valores será a lista de todos os itens " +"que sobraram." #: ../../library/dis.rst:920 msgid "The number of values before and after the list value is limited to 255." msgstr "" +"A quantidade de valores antes e após o valor que será a lista é limitada a " +"255." #: ../../library/dis.rst:922 msgid "" @@ -910,42 +1150,59 @@ msgid "" "values where the low byte of *counts* is the number of values before the " "list value, the high byte of *counts* the number of values after it." msgstr "" +"A quantidade de valores antes do valor lista é passada no argumento do " +"opcode. A quantidade de valores após a lista, se houver, é passada usando um " +"``EXTENDED_ARG``. A consequência é que o argumento pode ser visto como um " +"valor de dois bytes, onde o byte \"de baixo\" de *counts* é a quantidade de " +"valores antes do valor lista, e o byte \"de cima\" de *counts*, a quantidade " +"após." #: ../../library/dis.rst:928 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" +"Os valores extraídos são postos na pilha da direita para a esquerda, ou " +"seja, após executar ``a, *b, c = d`` os valores serão armazenados como " +"``STACK.extend((a, b, c))``." #: ../../library/dis.rst:940 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" +"onde *namei* é o índice do nome no :attr:`~codeobject.co_names` do :ref:" +"`objeto de código `." #: ../../library/dis.rst:950 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" +"onde *namei* é o índice do nome no :attr:`~codeobject.co_names` do :ref:" +"`objeto de código `." #: ../../library/dis.rst:956 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" +"Funciona como o :opcode:`STORE_NAME`, mas o nome é armazenado com um nome " +"global." #: ../../library/dis.rst:961 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." -msgstr "" +msgstr "Funciona como o :opcode:`DELETE_NAME`, mas deleta um nome global." #: ../../library/dis.rst:966 msgid "Pushes ``co_consts[consti]`` onto the stack." -msgstr "" +msgstr "Põe ``co_consts[consti]`` no topo da pilha." #: ../../library/dis.rst:971 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" +"Põe no topo da pilha o valor associado a ``co_names[namei]``. O nome é " +"procurado nos locais, nos globais, e então nos embutidos." #: ../../library/dis.rst:977 msgid "" diff --git a/library/distribution.po b/library/distribution.po index 620a5af11..dbb3144e2 100644 --- a/library/distribution.po +++ b/library/distribution.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/doctest.po b/library/doctest.po index b82be8c0c..f7b8b93c7 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -2241,7 +2241,7 @@ msgstr ">>>" #: ../../library/doctest.rst:339 msgid "interpreter prompt" -msgstr "" +msgstr "prompt do interpretador" #: ../../library/doctest.rst:339 ../../library/doctest.rst:577 msgid "..." diff --git a/library/email.charset.po b/library/email.charset.po index 01991aff9..ae3145e3b 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 4db498651..1c22ad9e9 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index 580996247..0222d7f9d 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.encoders.po b/library/email.encoders.po index b847a68d4..9653861d0 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.errors.po b/library/email.errors.po index 706938ea7..90454f6ca 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.examples.po b/library/email.examples.po index aabe87731..2ee65bd4b 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -33,37 +33,48 @@ msgid "" "Here are a few examples of how to use the :mod:`email` package to read, " "write, and send simple email messages, as well as more complex MIME messages." msgstr "" +"Aqui estão alguns exemplos de como usar o pacote :mod:`email` para ler, " +"escrever e enviar mensagens de e-mail simples, bem como mensagens MIME mais " +"complexas." #: ../../library/email.examples.rst:9 msgid "" "First, let's see how to create and send a simple text message (both the text " "content and the addresses may contain unicode characters):" msgstr "" +"Primeiro, vamos ver como criar e enviar uma mensagem de texto simples (tanto " +"o conteúdo do texto quanto os endereços podem conter caracteres Unicode):" #: ../../library/email.examples.rst:15 msgid "" "Parsing :rfc:`822` headers can easily be done by the using the classes from " "the :mod:`~email.parser` module:" msgstr "" +"A análise dos cabeçalhos :rfc:`822` pode ser feita facilmente usando as " +"classes do módulo :mod:`~email.parser`:" #: ../../library/email.examples.rst:21 msgid "" "Here's an example of how to send a MIME message containing a bunch of family " "pictures that may be residing in a directory:" msgstr "" +"Aqui está um exemplo de como enviar uma mensagem MIME contendo várias fotos " +"de família que podem estar em um diretório:" #: ../../library/email.examples.rst:27 msgid "" "Here's an example of how to send the entire contents of a directory as an " "email message: [1]_" msgstr "" +"Aqui está um exemplo de como enviar todo o conteúdo de um diretório como uma " +"mensagem de e-mail: [1]_" #: ../../library/email.examples.rst:33 msgid "" "Here's an example of how to unpack a MIME message like the one above, into a " "directory of files:" msgstr "" -"Aqui está um exemplo de como descompactar uma mensagem MIME, como a acima, " +"Aqui está um exemplo de como desempacotar uma mensagem MIME, como a acima, " "para um diretório de arquivos:" #: ../../library/email.examples.rst:39 @@ -73,16 +84,22 @@ msgid "" "image in the html part, and we save a copy of what we are going to send to " "disk, as well as sending it." msgstr "" +"Aqui está um exemplo de como criar uma mensagem HTML com uma versão " +"alternativa em texto simples. Para tornar as coisas um pouco mais " +"interessantes, incluímos uma imagem relacionada na parte html e salvamos uma " +"cópia do que vamos enviar para o disco, assim como enviamos." #: ../../library/email.examples.rst:47 msgid "" "If we were sent the message from the last example, here is one way we could " "process it:" msgstr "" +"Se nos fosse enviada a mensagem do último exemplo, aqui está uma maneira de " +"processá-la:" #: ../../library/email.examples.rst:52 msgid "Up to the prompt, the output from the above is:" -msgstr "" +msgstr "Até o prompt, a saída do comando acima é:" #: ../../library/email.examples.rst:66 msgid "Footnotes" @@ -92,3 +109,4 @@ msgstr "Notas de rodapé" msgid "" "Thanks to Matthew Dixon Cowles for the original inspiration and examples." msgstr "" +"Obrigado a Matthew Dixon Cowles pela inspiração original e pelos exemplos." diff --git a/library/email.generator.po b/library/email.generator.po index e5c06c8bf..db3fc5954 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.header.po b/library/email.header.po index f211fa0e9..f2fd112ce 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 38834b08c..67e88faa5 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -428,7 +428,7 @@ msgstr "" #: ../../library/email.headerregistry.rst:0 msgid "to" -msgstr "to" +msgstr "para" #: ../../library/email.headerregistry.rst:330 #: ../../library/email.headerregistry.rst:332 @@ -557,7 +557,7 @@ msgstr "" #: ../../library/email.headerregistry.rst:382 msgid "or::" -msgstr "or::" +msgstr "ou::" #: ../../library/email.headerregistry.rst:386 msgid "" diff --git a/library/email.iterators.po b/library/email.iterators.po index c4531ed1c..f6b999f68 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/email.iterators.rst:2 msgid ":mod:`!email.iterators`: Iterators" -msgstr "" +msgstr ":mod:`!email.iterators`: Iteradores" #: ../../library/email.iterators.rst:7 msgid "**Source code:** :source:`Lib/email/iterators.py`" diff --git a/library/email.message.po b/library/email.message.po index 3c8a6427a..eba701ae1 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.mime.po b/library/email.mime.po index fed39871d..1b81f7a24 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.parser.po b/library/email.parser.po index de261bd88..69cfd2714 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.po b/library/email.po index 158beda47..bb804f62f 100644 --- a/library/email.po +++ b/library/email.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/email.rst:2 msgid ":mod:`!email` --- An email and MIME handling package" -msgstr "" +msgstr ":mod:`!email` --- Um e-mail e um pacote MIME manipulável" #: ../../library/email.rst:11 msgid "**Source code:** :source:`Lib/email/__init__.py`" @@ -248,7 +248,7 @@ msgstr "Módulo :mod:`smtplib`" #: ../../library/email.rst:136 msgid "SMTP (Simple Mail Transport Protocol) client" -msgstr "Cliente SMTP (Simple Mail Transport Protocol)" +msgstr "Cliente SMTP (Protocolo Simples de Envio de E-mail)" #: ../../library/email.rst:138 msgid "Module :mod:`poplib`" diff --git a/library/email.policy.po b/library/email.policy.po index 33f943987..577802e0b 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.utils.po b/library/email.utils.po index 21847342e..153bead27 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/email.utils.rst:2 msgid ":mod:`!email.utils`: Miscellaneous utilities" -msgstr "" +msgstr ":mod:`!email.utils`: Utilitários diversos" #: ../../library/email.utils.rst:7 msgid "**Source code:** :source:`Lib/email/utils.py`" @@ -53,8 +53,8 @@ msgstr "" "argumentos, retorna a hora atual. Caso contrário, o argumento *dt* deve ser " "uma instância :class:`~datetime.datetime` e é convertido para o fuso horário " "local de acordo com o banco de dados de fuso horário do sistema. Se *dt* for " -"ingênuo (ou seja, ``dt.tzinfo`` for ``None``), será assumido que está no " -"horário local. O parâmetro *isdst* é ignorado." +"ingênuo (ou seja, ``dt.tzinfo`` for ``None``), será presumido como estando " +"no horário local. O parâmetro *isdst* é ignorado." #: ../../library/email.utils.rst:26 msgid "The *isdst* parameter." diff --git a/library/ensurepip.po b/library/ensurepip.po index afa493d48..2cce2d270 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/ensurepip.rst:2 msgid ":mod:`!ensurepip` --- Bootstrapping the ``pip`` installer" -msgstr "" +msgstr ":mod:`!ensurepip` --- Inicialização do instalador do ``pip``" #: ../../library/ensurepip.rst:10 msgid "**Source code:** :source:`Lib/ensurepip`" @@ -294,6 +294,6 @@ msgid "" "version of ``pip``)." msgstr "" "O processo de inicialização pode instalar módulos adicionais exigidos pelo " -"``pip``, mas outro software não deve assumir que essas dependências sempre " +"``pip``, mas outro software não deve presumir que essas dependências sempre " "estarão presentes por padrão (como as dependências podem ser removidas em " "uma versão futura do ``pip``)." diff --git a/library/enum.po b/library/enum.po index 16b919a0a..8ed5b6d52 100644 --- a/library/enum.po +++ b/library/enum.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -326,7 +326,7 @@ msgstr "" #: ../../library/enum.rst:0 msgid "value" -msgstr "value" +msgstr "valor" #: ../../library/enum.rst:180 msgid "The value to lookup." diff --git a/library/errno.po b/library/errno.po index 482dff49a..ea1ac6fbc 100644 --- a/library/errno.po +++ b/library/errno.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/exceptions.po b/library/exceptions.po index e1dc70e75..6a93f41ca 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/faulthandler.po b/library/faulthandler.po index 9141f029c..f56d42032 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/fcntl.po b/library/fcntl.po index 76a4cfcd8..ed184dc79 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -124,6 +124,8 @@ msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``fcntl.fcntl`` com os " +"argumentos ``fd``, ``cmd``, ``arg``." #: ../../library/fcntl.rst:90 msgid "" @@ -191,6 +193,8 @@ msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``fcntl.ioctl`` com os " +"argumentos ``fd``, ``request``, ``arg``." #: ../../library/fcntl.rst:141 msgid "" @@ -210,6 +214,8 @@ msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``fcntl.flock`` com os " +"argumentos ``fd`` e ``operation``." #: ../../library/fcntl.rst:153 msgid "" @@ -278,6 +284,8 @@ msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``fcntl.lockf`` com os " +"argumentos ``fd``, ``cmd``, ``len``, ``start``, ``whence``." #: ../../library/fcntl.rst:196 msgid "Examples (all on a SVR4 compliant system)::" diff --git a/library/filecmp.po b/library/filecmp.po index b9abf8237..c575b775a 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/fileformats.po b/library/fileformats.po index c01a6c5a1..8a5d2e9d4 100644 --- a/library/fileformats.po +++ b/library/fileformats.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Erick Simões , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/fileinput.po b/library/fileinput.po index b312a68a3..0c61752a4 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -17,16 +17,17 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/fileinput.rst:2 msgid ":mod:`!fileinput` --- Iterate over lines from multiple input streams" msgstr "" +":mod:`!fileinput` --- Itera sobre linhas de múltiplos fluxos de entrada" #: ../../library/fileinput.rst:10 msgid "**Source code:** :source:`Lib/fileinput.py`" @@ -38,6 +39,9 @@ msgid "" "over standard input or a list of files. If you just want to read or write " "one file see :func:`open`." msgstr "" +"Este módulo implementa uma classe auxiliar e funções para escrever " +"rapidamente um laço sobre uma entrada padrão ou uma lista de arquivos. Se " +"você quiser apenas ler ou escrever um arquivo veja :func:`open`." #: ../../library/fileinput.rst:18 msgid "The typical use is::" @@ -52,6 +56,13 @@ msgid "" "it as the first argument to :func:`.input`. A single file name is also " "allowed." msgstr "" +"Isto itera sobre as linhas de todos os arquivos listados em ``sys." +"argv[1:]``, padronizando ``sys.stdin`` se a lista estiver vazia. Se o nome " +"de um arquivo for ``'-'``, ele também será substituído por ``sys.stdin`` e " +"os argumentos opcionais *mode* e *openhook* serão ignorados. Para " +"especificar uma lista alternativa de nomes de arquivos, passe-a como " +"primeiro argumento para :func:`.input`. Um único nome de arquivo também é " +"permitido." #: ../../library/fileinput.rst:30 msgid "" @@ -60,10 +71,15 @@ msgid "" "`FileInput`. If an I/O error occurs during opening or reading a file, :exc:" "`OSError` is raised." msgstr "" +"Todos os arquivos são abertos em modo texto por padrão, mas você pode " +"substituir isso especificando o parâmetro *mode* na chamada para :func:`." +"input` ou :class:`FileInput`. Se ocorrer um erro de E/S durante a abertura " +"ou leitura de um arquivo, :exc:`OSError` será levantada." #: ../../library/fileinput.rst:35 msgid ":exc:`IOError` used to be raised; it is now an alias of :exc:`OSError`." msgstr "" +":exc:`IOError` costumava ser levantada; agora é um apelido de :exc:`OSError`." #: ../../library/fileinput.rst:38 msgid "" @@ -71,6 +87,9 @@ msgid "" "return no lines, except perhaps for interactive use, or if it has been " "explicitly reset (e.g. using ``sys.stdin.seek(0)``)." msgstr "" +"Se ``sys.stdin`` for usado mais de uma vez, o segundo e posterior uso não " +"retornará nenhuma linha, exceto talvez para uso interativo, ou se tiver sido " +"explicitamente redefinido (por exemplo, usando ``sys.stdin.seek(0)``)." #: ../../library/fileinput.rst:42 msgid "" @@ -78,12 +97,17 @@ msgid "" "in the list of filenames is noticeable at all is when the last file opened " "is empty." msgstr "" +"Arquivos vazios são abertos e fechados imediatamente; a única vez que sua " +"presença na lista de nomes de arquivos é perceptível é quando o último " +"arquivo aberto está vazio." #: ../../library/fileinput.rst:46 msgid "" "Lines are returned with any newlines intact, which means that the last line " "in a file may not have one." msgstr "" +"As linhas são retornadas com novas linhas intactas, o que significa que a " +"última linha de um arquivo pode não ter nenhuma." #: ../../library/fileinput.rst:49 msgid "" @@ -98,7 +122,7 @@ msgstr "" #: ../../library/fileinput.rst:56 msgid "The following function is the primary interface of this module:" -msgstr "" +msgstr "A seguinte função é a interface principal deste módulo:" #: ../../library/fileinput.rst:61 msgid "" @@ -107,6 +131,10 @@ msgid "" "to use during iteration. The parameters to this function will be passed " "along to the constructor of the :class:`FileInput` class." msgstr "" +"Cria uma instância da classe :class:`FileInput`. A instância será usada como " +"estado global para as funções deste módulo e também será retornada para uso " +"durante a iteração. Os parâmetros desta função serão passados ​​para o " +"construtor da classe :class:`FileInput`." #: ../../library/fileinput.rst:66 msgid "" @@ -114,37 +142,48 @@ msgid "" "keyword:`with` statement. In this example, *input* is closed after the :" "keyword:`!with` statement is exited, even if an exception occurs::" msgstr "" +"A instância :class:`FileInput` pode ser usada como um gerenciador de " +"contexto na instrução :keyword:`with`. Neste exemplo, *input* é fechado após " +"a saída da instrução :keyword:`!with`, mesmo se ocorrer uma exceção::" #: ../../library/fileinput.rst:74 ../../library/fileinput.rst:170 msgid "Can be used as a context manager." -msgstr "" +msgstr "Pode ser usado como gerenciador de contexto." #: ../../library/fileinput.rst:77 msgid "The keyword parameters *mode* and *openhook* are now keyword-only." -msgstr "" +msgstr "Os parâmetros nomeados *mode* e *openhook* agora são somente-nomeados." #: ../../library/fileinput.rst:80 ../../library/fileinput.rst:176 #: ../../library/fileinput.rst:210 msgid "The keyword-only parameter *encoding* and *errors* are added." msgstr "" +"Os parâmetros somente-nomeados *encoding* e *errors* foram adicionados." #: ../../library/fileinput.rst:84 msgid "" "The following functions use the global state created by :func:`fileinput." "input`; if there is no active state, :exc:`RuntimeError` is raised." msgstr "" +"As funções a seguir usam o estado global criado por :func:`fileinput.input`; " +"se não houver estado ativo, :exc:`RuntimeError` será levantada." #: ../../library/fileinput.rst:90 msgid "" "Return the name of the file currently being read. Before the first line has " "been read, returns ``None``." msgstr "" +"Retorna o nome do arquivo que está sendo lido no momento. Antes da primeira " +"linha ser lida, retorna ``None``." #: ../../library/fileinput.rst:96 msgid "" "Return the integer \"file descriptor\" for the current file. When no file is " "opened (before the first line and between files), returns ``-1``." msgstr "" +"Retorna o número inteiro de \"descritor de arquivo\" para o arquivo atual. " +"Quando nenhum arquivo é aberto (antes da primeira linha e entre arquivos), " +"retorna ``-1``." #: ../../library/fileinput.rst:102 msgid "" @@ -152,6 +191,9 @@ msgid "" "Before the first line has been read, returns ``0``. After the last line of " "the last file has been read, returns the line number of that line." msgstr "" +"Retorna o número cumulativo da linha que acabou de ser lida. Antes da " +"primeira linha ser lida, retorna ``0``. Após a leitura da última linha do " +"último arquivo, retorna o número da linha dessa linha." #: ../../library/fileinput.rst:109 msgid "" @@ -159,18 +201,25 @@ msgid "" "read, returns ``0``. After the last line of the last file has been read, " "returns the line number of that line within the file." msgstr "" +"Retorna o número da linha no arquivo atual. Antes da primeira linha ser " +"lida, retorna ``0``. Após a leitura da última linha do último arquivo, " +"retorna o número da linha dessa linha no arquivo." #: ../../library/fileinput.rst:116 msgid "" "Return ``True`` if the line just read is the first line of its file, " "otherwise return ``False``." msgstr "" +"Retorna ``True`` se a linha que acabou de ler for a primeira linha do seu " +"arquivo, caso contrário retorna ``False``." #: ../../library/fileinput.rst:122 msgid "" "Return ``True`` if the last line was read from ``sys.stdin``, otherwise " "return ``False``." msgstr "" +"Retorna ``True`` se a última linha foi lida em ``sys.stdin``, caso contrário " +"retorna ``False``." #: ../../library/fileinput.rst:128 msgid "" @@ -182,16 +231,25 @@ msgid "" "file. After the last line of the last file has been read, this function has " "no effect." msgstr "" +"Fecha o arquivo atual para que a próxima iteração leia a primeira linha do " +"próximo arquivo (se houver); as linhas não lidas do arquivo não contarão " +"para a contagem cumulativa de linhas. O nome do arquivo não é alterado até " +"que a primeira linha do próximo arquivo seja lida. Antes da leitura da " +"primeira linha, esta função não tem efeito; ele não pode ser usado para " +"pular o primeiro arquivo. Após a leitura da última linha do último arquivo, " +"esta função não terá efeito." #: ../../library/fileinput.rst:138 msgid "Close the sequence." -msgstr "" +msgstr "Fecha a sequência." #: ../../library/fileinput.rst:140 msgid "" "The class which implements the sequence behavior provided by the module is " "available for subclassing as well:" msgstr "" +"A classe que implementa o comportamento de sequência fornecido pelo módulo " +"também está disponível para subclasses:" #: ../../library/fileinput.rst:146 msgid "" @@ -204,12 +262,22 @@ msgid "" "sequential order; random access and :meth:`~io.TextIOBase.readline` cannot " "be mixed." msgstr "" +"A classe :class:`FileInput` é a implementação; seus métodos :meth:" +"`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:" +"`isfirstline`, :meth:`isstdin`, :meth:`nextfile` e :meth:`close` " +"correspondem às funções de mesmo nome no módulo. Além disso, é :term:" +"`iterável` e possui um método :meth:`~io.TextIOBase.readline` que retorna a " +"próxima linha de entrada. A sequência deve ser acessada em ordem " +"estritamente sequencial; acesso aleatório e :meth:`~io.TextIOBase.readline` " +"não podem ser misturados." #: ../../library/fileinput.rst:154 msgid "" "With *mode* you can specify which file mode will be passed to :func:`open`. " "It must be one of ``'r'`` and ``'rb'``." msgstr "" +"Com *mode* você pode especificar qual modo de arquivo será passado para :" +"func:`open`. Deve ser um entre ``'r'`` e ``'rb'``." #: ../../library/fileinput.rst:157 msgid "" @@ -217,12 +285,17 @@ msgid "" "*filename* and *mode*, and returns an accordingly opened file-like object. " "You cannot use *inplace* and *openhook* together." msgstr "" +"O *openhook*, quando fornecido, deve ser uma função que recebe dois " +"argumentos, *filename* e *mode*, e retorna um objeto arquivo ou similar " +"aberto de acordo. Você não pode usar *inplace* e *openhook* juntos." #: ../../library/fileinput.rst:161 msgid "" "You can specify *encoding* and *errors* that is passed to :func:`open` or " "*openhook*." msgstr "" +"Você pode especificar *encoding* e *errors* que são passados ​​para :func:" +"`open` ou *openhook*." #: ../../library/fileinput.rst:163 msgid "" @@ -230,16 +303,20 @@ msgid "" "keyword:`with` statement. In this example, *input* is closed after the :" "keyword:`!with` statement is exited, even if an exception occurs::" msgstr "" +"Uma instância :class:`FileInput` pode ser usada como um gerenciador de " +"contexto na instrução :keyword:`with`. Neste exemplo, *input* é fechado após " +"a saída da instrução :keyword:`!with`, mesmo se ocorrer uma exceção::" #: ../../library/fileinput.rst:173 msgid "The keyword parameter *mode* and *openhook* are now keyword-only." -msgstr "" +msgstr "Os parâmetros nomeados *mode* e *openhook* agora são somente-nomeados." #: ../../library/fileinput.rst:179 msgid "" "The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been " "removed." msgstr "" +"Os modos ``'rU'`` e ``'U'`` e o método :meth:`!__getitem__` foram removidos." #: ../../library/fileinput.rst:184 msgid "" @@ -254,10 +331,21 @@ msgid "" "extension is ``'.bak'`` and it is deleted when the output file is closed. " "In-place filtering is disabled when standard input is read." msgstr "" +"**Filtragem local opcional:** se o argumento nomeado ``inplace=True`` for " +"passado para :func:`fileinput.input` ou para o construtor :class:" +"`FileInput`, o arquivo é movido para um arquivo de backup e a saída padrão é " +"direcionada para o arquivo de entrada (se já existir um arquivo com o mesmo " +"nome do arquivo de backup, ele será substituído silenciosamente). Isso torna " +"possível escrever um filtro que reescreva seu arquivo de entrada " +"internamente. Se o parâmetro *backup* for fornecido (normalmente como " +"``backup='.'``), ele especifica a extensão do arquivo de " +"backup, e o arquivo de backup permanece disponível; por padrão, a extensão é " +"``'.bak'`` e é excluída quando o arquivo de saída é fechado. A filtragem " +"local é desativada quando a entrada padrão é lida." #: ../../library/fileinput.rst:196 msgid "The two following opening hooks are provided by this module:" -msgstr "" +msgstr "Os dois ganchos de abertura a seguir são fornecidos por este módulo:" #: ../../library/fileinput.rst:200 msgid "" @@ -266,37 +354,52 @@ msgid "" "modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file " "is opened normally (ie, using :func:`open` without any decompression)." msgstr "" +"Abre de forma transparente arquivos compactados com gzip e bzip2 " +"(reconhecidos pelas extensões ``'.gz'`` e ``'.bz2'``) usando os módulos :mod:" +"`gzip` e :mod:`bz2`. Se a extensão do nome do arquivo não for ``'.gz'`` ou " +"``'.bz2'``, o arquivo é aberto normalmente (ou seja, usando :func:`open` sem " +"qualquer descompactação)." #: ../../library/fileinput.rst:205 msgid "" "The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` " "for compressed files and open for normal files." msgstr "" +"Os valores *encoding* e *errors* são passados ​​para :class:`io.TextIOWrapper` " +"para arquivos compactados e abertos para arquivos normais." #: ../../library/fileinput.rst:208 msgid "" "Usage example: ``fi = fileinput.FileInput(openhook=fileinput." "hook_compressed, encoding=\"utf-8\")``" msgstr "" +"Exemplo de uso: ``fi = fileinput.FileInput(openhook=fileinput." +"hook_compressed, encoding=\"utf-8\")``" #: ../../library/fileinput.rst:216 msgid "" "Returns a hook which opens each file with :func:`open`, using the given " "*encoding* and *errors* to read the file." msgstr "" +"Retorna um gancho que abre cada arquivo com :func:`open`, usando a " +"*encoding* e *errors* fornecidas para ler o arquivo." #: ../../library/fileinput.rst:219 msgid "" "Usage example: ``fi = fileinput.FileInput(openhook=fileinput." "hook_encoded(\"utf-8\", \"surrogateescape\"))``" msgstr "" +"Exemplo de uso: ``fi = fileinput.FileInput(openhook=fileinput." +"hook_encoded(\"utf-8\", \"surrogateescape\"))``" #: ../../library/fileinput.rst:223 msgid "Added the optional *errors* parameter." -msgstr "" +msgstr "Adicionado o parâmetro opcional *errors*." #: ../../library/fileinput.rst:226 msgid "" "This function is deprecated since :func:`fileinput.input` and :class:" "`FileInput` now have *encoding* and *errors* parameters." msgstr "" +"Esta função foi descontinuado já que :func:`fileinput.input` e :class:" +"`FileInput` agora possuem parâmetros *encoding* e *errors*." diff --git a/library/filesys.po b/library/filesys.po index 2ef1d4a6d..467b78f07 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/fnmatch.po b/library/fnmatch.po index 59cc3aaee..848cc1a40 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -21,16 +21,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/fnmatch.rst:2 msgid ":mod:`!fnmatch` --- Unix filename pattern matching" -msgstr "" +msgstr ":mod:`!fnmatch` --- Correspondência de padrões de nome de arquivo Unix" #: ../../library/fnmatch.rst:7 msgid "**Source code:** :source:`Lib/fnmatch.py`" diff --git a/library/fractions.po b/library/fractions.po index 404d615cd..5e49beb99 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -18,16 +18,16 @@ msgstr "" "2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/fractions.rst:2 msgid ":mod:`!fractions` --- Rational numbers" -msgstr "" +msgstr ":mod:`!fractions` --- Números racionais" #: ../../library/fractions.rst:10 msgid "**Source code:** :source:`Lib/fractions.py`" @@ -37,12 +37,16 @@ msgstr "**Código-fonte:** :source:`Lib/fractions.py`" msgid "" "The :mod:`fractions` module provides support for rational number arithmetic." msgstr "" +"O módulo :mod:`fractions` fornece suporte para aritmética de números " +"racionais." #: ../../library/fractions.rst:17 msgid "" "A Fraction instance can be constructed from a pair of integers, from another " "rational number, or from a string." msgstr "" +"Uma instância de Fraction pode ser construída a partir de um par de números " +"inteiros, de outro número racional ou de uma string." #: ../../library/fractions.rst:26 msgid "" @@ -72,6 +76,13 @@ msgid "" "In either form the input string may also have leading and/or trailing " "whitespace. Here are some examples::" msgstr "" +"onde o ``sign`` opcional pode ser '+' ou '-' e ``numerator`` e " +"``denominator`` (se presente) são strings de dígitos decimais (sublinhados " +"podem ser usados ​​para delimitar dígitos como com literais integrais no " +"código). Além disso, qualquer string que represente um valor finito e seja " +"aceita pelo construtor :class:`float` também é aceita pelo construtor :class:" +"`Fraction`. Em qualquer forma, a string de entrada também pode ter espaços " +"em branco à esquerda e/ou à direita. Aqui estão alguns exemplos::" #: ../../library/fractions.rst:78 msgid "" @@ -81,12 +92,19 @@ msgid "" "treated as immutable. In addition, :class:`Fraction` has the following " "properties and methods:" msgstr "" +"A classe :class:`Fraction` herda da classe base abstrata :class:`numbers." +"Rational` e implementa todos os métodos e operações dessa classe. As " +"instâncias de :class:`Fraction` são :term:`hasheável` e devem ser tratadas " +"como imutáveis. Além disso, :class:`Fraction` tem as seguintes propriedades " +"e métodos:" #: ../../library/fractions.rst:84 msgid "" "The :class:`Fraction` constructor now accepts :class:`float` and :class:" "`decimal.Decimal` instances." msgstr "" +"O construtor :class:`Fraction` agora aceita instâncias :class:`float` e :" +"class:`decimal.Decimal`." #: ../../library/fractions.rst:88 msgid "" @@ -100,17 +118,23 @@ msgid "" "Underscores are now permitted when creating a :class:`Fraction` instance " "from a string, following :PEP:`515` rules." msgstr "" +"Sublinhados agora são permitidos ao criar uma instância :class:`Fraction` a " +"partir de uma string, seguindo as regras :PEP:`515`." #: ../../library/fractions.rst:97 msgid "" ":class:`Fraction` implements ``__int__`` now to satisfy ``typing." "SupportsInt`` instance checks." msgstr "" +":class:`Fraction` implementa ``__int__`` agora para satisfazer verificações " +"de instância ``typing.SupportsInt``." #: ../../library/fractions.rst:101 msgid "" "Space is allowed around the slash for string inputs: ``Fraction('2 / 3')``." msgstr "" +"É permitido espaço ao redor da barra para entradas de string: " +"``Fraction('2 / 3')``." #: ../../library/fractions.rst:104 msgid "" @@ -118,24 +142,29 @@ msgid "" "presentation types ``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, " "``\"G\"`` and ``\"%\"\"``." msgstr "" +"Instâncias de :class:`Fraction` agora oferecem suporte à formatação no " +"estilo float, com tipos de apresentação ``\"e\"``, ``\"E\"``, ``\"f\"``, " +"``\"F\"``, ``\"g\"``, ``\"G\"`` e ``\"%\"\"``." #: ../../library/fractions.rst:111 msgid "Numerator of the Fraction in lowest term." -msgstr "" +msgstr "Numerador de Fraction no menor termo." #: ../../library/fractions.rst:115 msgid "Denominator of the Fraction in lowest term." -msgstr "" +msgstr "Denominador de Fraction no menor termo." #: ../../library/fractions.rst:120 msgid "" "Return a tuple of two integers, whose ratio is equal to the original " "Fraction. The ratio is in lowest terms and has a positive denominator." msgstr "" +"Retorna uma tupla de dois inteiros, cuja razão é igual a Fraction original. " +"A razão está em termos mais baixos e tem um denominador positivo." #: ../../library/fractions.rst:128 msgid "Return ``True`` if the Fraction is an integer." -msgstr "" +msgstr "Retorna ``True`` se a Fraction for um inteiro." #: ../../library/fractions.rst:134 msgid "" @@ -143,24 +172,33 @@ msgid "" "class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " "the same value as ``Fraction(3, 10)``." msgstr "" +"Construtor alternativo que aceita apenas instâncias de :class:`float` ou :" +"class:`numbers.Integral`. Esteja ciente de que ``Fraction.from_float(0.3)`` " +"não é o mesmo valor que ``Fraction(3, 10)``." #: ../../library/fractions.rst:140 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`float`." msgstr "" +"A partir do Python 3.2, você também pode construir uma instância :class:" +"`Fraction` diretamente de um :class:`float`." #: ../../library/fractions.rst:146 msgid "" "Alternative constructor which only accepts instances of :class:`decimal." "Decimal` or :class:`numbers.Integral`." msgstr "" +"Construtor alternativo que aceita somente instâncias de :class:`decimal." +"Decimal` ou :class:`numbers.Integral`." #: ../../library/fractions.rst:151 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`decimal.Decimal` instance." msgstr "" +"A partir do Python 3.2, você também pode construir uma instância :class:" +"`Fraction` diretamente de uma instância de :class:`decimal.Decimal`." #: ../../library/fractions.rst:158 msgid "" @@ -168,22 +206,31 @@ msgid "" "denominator at most max_denominator. This method is useful for finding " "rational approximations to a given floating-point number:" msgstr "" +"Encontra e retorna o :class:`Fraction` mais próximo de ``self`` que tem " +"denominador no máximo max_denominator. Este método é útil para encontrar " +"aproximações racionais para um dado número de ponto flutuante:" #: ../../library/fractions.rst:166 msgid "or for recovering a rational number that's represented as a float:" msgstr "" +"ou para recuperar um número racional que é representado como um ponto " +"flutuante:" #: ../../library/fractions.rst:179 msgid "" "Returns the greatest :class:`int` ``<= self``. This method can also be " "accessed through the :func:`math.floor` function:" msgstr "" +"Retorna o maior :class:`int` ``<= self``. Este método também pode ser " +"acessado por meio da função :func:`math.floor`:" #: ../../library/fractions.rst:189 msgid "" "Returns the least :class:`int` ``>= self``. This method can also be " "accessed through the :func:`math.ceil` function." msgstr "" +"Retorna o menor :class:`int` ``>= self``. Este método também pode ser " +"acessado por meio da função :func:`math.ceil`." #: ../../library/fractions.rst:196 msgid "" @@ -193,6 +240,11 @@ msgid "" "rounding half toward even. This method can also be accessed through the :" "func:`round` function." msgstr "" +"A primeira versão retorna o :class:`int` mais próximo de ``self``, " +"arredondando a metade para par. A segunda versão arredonda ``self`` para o " +"múltiplo mais próximo de ``Fraction(1, 10**ndigits)`` (logicamente, se " +"``ndigits`` for negativo), novamente arredondando a metade para par. Este " +"método também pode ser acessado por meio da função :func:`round`." #: ../../library/fractions.rst:204 msgid "" @@ -207,7 +259,7 @@ msgstr "" #: ../../library/fractions.rst:212 msgid "Here are some examples::" -msgstr "Here are some examples::" +msgstr "Veja alguns exemplos::" #: ../../library/fractions.rst:228 msgid "Module :mod:`numbers`" @@ -215,4 +267,4 @@ msgstr "Módulo :mod:`numbers`" #: ../../library/fractions.rst:229 msgid "The abstract base classes making up the numeric tower." -msgstr "" +msgstr "As classes base abstratas que compõem a torre numérica." diff --git a/library/frameworks.po b/library/frameworks.po index d8b738c4e..4dba43e4a 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/ftplib.po b/library/ftplib.po index 736089db0..e9a45967c 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -19,10 +19,10 @@ msgstr "" "2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -203,6 +203,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ftplib.connect`` com os " +"argumentos ``self``, ``host``, ``port``." #: ../../library/ftplib.rst:195 msgid "" @@ -240,6 +242,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ftplib.sendcmd`` com os " +"argumentos ``self``, ``cmd``." #: ../../library/ftplib.rst:234 msgid "" diff --git a/library/functional.po b/library/functional.po index 741fd08e3..eefee8ae5 100644 --- a/library/functional.po +++ b/library/functional.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/functions.po b/library/functions.po index 65b7c14db..0e7c2bcef 100644 --- a/library/functions.po +++ b/library/functions.po @@ -31,10 +31,10 @@ msgstr "" "Last-Translator: Marco Rougeth , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -588,7 +588,7 @@ msgid "" "argument ``breakpointhook``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.breakpoint`` com " -"argumento ``breakpointhook``." +"o argumento ``breakpointhook``." #: ../../library/functions.rst:189 msgid "" @@ -917,9 +917,9 @@ msgid "" "``source`` and ``filename``. This event may also be raised by implicit " "compilation." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``compile`` com argumentos " -"``source``, ``filename``. Esse evento pode também ser levantando por uma " -"compilação implícita." +"Levanta um :ref:`evento de auditoria ` ``compile`` com os " +"argumentos ``source``, ``filename``. Esse evento pode também ser levantando " +"por uma compilação implícita." #: ../../library/functions.rst:350 msgid "" @@ -939,8 +939,8 @@ msgid "" "complex string when compiling to an AST object due to stack depth " "limitations in Python's AST compiler." msgstr "" -"É possível quebrar o interpretador Python com uma string suficiente grande/" -"complexa quando compilando para uma objeto AST, devido limitações do tamanho " +"É possível quebrar o interpretador Python com uma string suficientemente " +"grande/complexa ao compilar para um objeto AST, devido limitações do tamanho " "da pilha no compilador AST do Python." #: ../../library/functions.rst:361 @@ -1198,31 +1198,31 @@ msgstr "Parâmetros" #: ../../library/functions.rst:529 msgid "A Python expression." -msgstr "" +msgstr "Uma expressão Python." #: ../../library/functions.rst:533 msgid "The global namespace (default: ``None``)." -msgstr "" +msgstr "O espaço de nomes global (por padrão, ``None``)." #: ../../library/functions.rst:537 msgid "The local namespace (default: ``None``)." -msgstr "" +msgstr "O espaço de nomes local (por padrão, ``None``)." #: ../../library/functions.rst:0 msgid "Returns" -msgstr "" +msgstr "Retorna" #: ../../library/functions.rst:541 msgid "The result of the evaluated expression." -msgstr "" +msgstr "O resultado da expressão avaliada." #: ../../library/functions.rst:0 msgid "raises" -msgstr "" +msgstr "levanta" #: ../../library/functions.rst:542 msgid "Syntax errors are reported as exceptions." -msgstr "" +msgstr "Erros de sintaxe são reportados como exceções." #: ../../library/functions.rst:544 msgid "" @@ -1609,7 +1609,7 @@ msgid "" "with two leading underscores) name in order to retrieve it with :func:" "`getattr`." msgstr "" -"Uma vez que :ref:`mutilação de nome privado ` " +"Uma vez que :ref:`desfiguração de nome privado ` " "acontece em tempo de compilação, deve-se manualmente mutilar o nome de um " "atributo privado (atributos com dois sublinhados à esquerda) para recuperá-" "lo com :func:`getattr`." @@ -2300,7 +2300,7 @@ msgstr "``'b'``" #: ../../library/functions.rst:1213 ../../library/functions.rst:1357 msgid "binary mode" -msgstr "binary mode" +msgstr "modo binário" #: ../../library/functions.rst:1214 msgid "``'t'``" @@ -2666,7 +2666,7 @@ msgstr "" "Se a chamada de sistema é interrompida e o tratador de sinal não levanta uma " "exceção, a função agora tenta novamente a chamada de sistema em vez de " "levantar uma exceção :exc:`InterruptedError` (consulte :pep:`475` para " -"entender a lógica)." +"entender a justificativa)." #: ../../library/functions.rst:1392 msgid "The ``'namereplace'`` error handler was added." @@ -3054,7 +3054,7 @@ msgid "" "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -"Uma vez que :ref:`mutilação de nome privado ` " +"Uma vez que :ref:`desfiguração de nome privado ` " "acontece em tempo de compilação, deve-se manualmente mutilar o nome de um " "atributo privado (atributos com dois sublinhados à esquerda) para defini-lo " "com :func:`setattr`." @@ -3517,9 +3517,8 @@ msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -"Subclasses de :class:`type` que não fazem sobrecarga de ``type.__new__`` não " -"podem mais usar a forma com apenas um argumento para obter o tipo de um " -"objeto." +"Subclasses de :class:`type` que não substituem ``type.__new__`` não podem " +"mais usar a forma com apenas um argumento para obter o tipo de um objeto." #: ../../library/functions.rst:1922 msgid "" @@ -3949,7 +3948,7 @@ msgstr "instrução" #: ../../library/functions.rst:2036 msgid "import" -msgstr "importação" +msgstr "import" #: ../../library/functions.rst:2036 msgid "builtins" diff --git a/library/functools.po b/library/functools.po index 9f6330e3d..de5a3b28f 100644 --- a/library/functools.po +++ b/library/functools.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/gc.po b/library/gc.po index b92d4de3e..eac847945 100644 --- a/library/gc.po +++ b/library/gc.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/gc.rst:2 msgid ":mod:`!gc` --- Garbage Collector interface" -msgstr "" +msgstr ":mod:`!gc` --- Interface para o coletor de lixo" #: ../../library/gc.rst:12 msgid "" @@ -121,6 +121,9 @@ msgid "" "returned. If *generation* is not ``None``, return only the objects tracked " "by the collector that are in that generation." msgstr "" +"Retorna uma lista de todos os objetos rastreados pelo coletor, excluindo a " +"lista retornada. Se *generation* não for ``None``, retorna apenas os objetos " +"rastreados pelo coletor que estão nessa geração." #: ../../library/gc.rst:75 msgid "New *generation* parameter." diff --git a/library/getopt.po b/library/getopt.po index 1762f1a49..2f4e5b4ea 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -17,16 +17,18 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/getopt.rst:2 msgid ":mod:`!getopt` --- C-style parser for command line options" msgstr "" +":mod:`!getopt` --- Analisador sintático no estilo C para opções de linha de " +"comando" #: ../../library/getopt.rst:8 msgid "**Source code:** :source:`Lib/getopt.py`" @@ -180,7 +182,7 @@ msgstr "" #: ../../library/getopt.rst:91 msgid "Alias for :exc:`GetoptError`; for backward compatibility." -msgstr "Alias para :exc:`GetoptError`; para compatibilidade reversa." +msgstr "Apelido para :exc:`GetoptError`; para compatibilidade reversa." #: ../../library/getopt.rst:93 msgid "An example using only Unix style options:" diff --git a/library/getpass.po b/library/getpass.po index 708114272..d96b0ecdf 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/getpass.rst:2 msgid ":mod:`!getpass` --- Portable password input" -msgstr "" +msgstr ":mod:`!getpass` --- Entrada de senha portátil" #: ../../library/getpass.rst:11 msgid "**Source code:** :source:`Lib/getpass.py`" diff --git a/library/gettext.po b/library/gettext.po index 858e65d6d..4d842c5f7 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/gettext.rst:2 msgid ":mod:`!gettext` --- Multilingual internationalization services" -msgstr "" +msgstr ":mod:`!gettext` --- Serviços de internacionalização multilíngues" #: ../../library/gettext.rst:10 msgid "**Source code:** :source:`Lib/gettext.py`" @@ -1074,7 +1074,7 @@ msgstr "Consulte a nota de rodapé para a :func:`bindtextdomain` acima." #: ../../library/gettext.rst:56 msgid "_ (underscore)" -msgstr "_ (underscore)" +msgstr "_ (sublinhado)" #: ../../library/gettext.rst:56 msgid "gettext" diff --git a/library/glob.po b/library/glob.po index 31ee3e144..6bf02c63f 100644 --- a/library/glob.po +++ b/library/glob.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/glob.rst:2 msgid ":mod:`!glob` --- Unix style pathname pattern expansion" -msgstr "" +msgstr ":mod:`!glob` --- Expansão de padrão de nome de arquivo no estilo Unix" #: ../../library/glob.rst:7 msgid "**Source code:** :source:`Lib/glob.py`" @@ -114,8 +114,8 @@ msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -"Esta função pode suportar :ref:`paths relative to directory descriptors " -"` com o parâmetro *dir_fd*." +"Esta função oferece suporte para :ref:`caminhos relativos aos descritores de " +"diretório ` com o parâmetro *dir_fd*." #: ../../library/glob.rst:66 msgid "" @@ -142,7 +142,7 @@ msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``glob.glob`` com " +"Levanta um :ref:`evento de auditoria ` ``glob.glob`` com os " "argumentos ``pathname``, ``recursive``." #: ../../library/glob.rst:74 ../../library/glob.rst:101 @@ -150,7 +150,7 @@ msgid "" "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " "``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``glob.glob/2`` com " +"Levanta um :ref:`evento de auditoria ` ``glob.glob/2`` com os " "argumentos ``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." #: ../../library/glob.rst:77 diff --git a/library/graphlib.po b/library/graphlib.po index a85f48ae0..664fb7c23 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -29,6 +29,7 @@ msgstr "" msgid "" ":mod:`!graphlib` --- Functionality to operate with graph-like structures" msgstr "" +":mod:`!graphlib` --- Funcionalidade para operar com estruturas do tipo grafo" #: ../../library/graphlib.rst:8 msgid "**Source code:** :source:`Lib/graphlib.py`" diff --git a/library/grp.po b/library/grp.po index 2a4d0d184..73a0618bc 100644 --- a/library/grp.po +++ b/library/grp.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/gzip.po b/library/gzip.po index fc0893e72..0a8e911c8 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/hashlib.po b/library/hashlib.po index d6b8bdc11..a801c8873 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vinicius Gubiani Ferreira , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/heapq.po b/library/heapq.po index ef9f49acf..3abc44f05 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/heapq.rst:2 msgid ":mod:`!heapq` --- Heap queue algorithm" -msgstr "" +msgstr ":mod:`!heapq` --- Algoritmo de fila heap" #: ../../library/heapq.rst:12 msgid "**Source code:** :source:`Lib/heapq.py`" @@ -188,7 +188,7 @@ msgid "" "input streams is already sorted (smallest to largest)." msgstr "" "Semelhante a ``sorted(itertools.chain(*iterables))`` mas retorna um " -"iterável, não puxa os dados para a memória todos de uma vez e assume que " +"iterável, não puxa os dados para a memória todos de uma vez e presume que " "cada um dos fluxos de entrada já está classificado (do menor para o maior)." #: ../../library/heapq.rst:98 diff --git a/library/hmac.po b/library/hmac.po index e74a4db67..d5d08226c 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/html.entities.po b/library/html.entities.po index c261f7b49..18213530f 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/html.entities.rst:2 msgid ":mod:`!html.entities` --- Definitions of HTML general entities" -msgstr "" +msgstr ":mod:`!html.entities` --- Definições de entidades gerais de HTML" #: ../../library/html.entities.rst:9 msgid "**Source code:** :source:`Lib/html/entities.py`" diff --git a/library/html.parser.po b/library/html.parser.po index 8c7f67c1c..4eace77f9 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -312,7 +312,7 @@ msgstr "" #: ../../library/html.parser.rst:9 msgid "HTML" -msgstr "" +msgstr "HTML" #: ../../library/html.parser.rst:9 msgid "XHTML" diff --git a/library/html.po b/library/html.po index 17b5d9328..8fc86f9f3 100644 --- a/library/html.po +++ b/library/html.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/html.rst:2 msgid ":mod:`!html` --- HyperText Markup Language support" -msgstr "" +msgstr ":mod:`!html` --- Suporte HTML (HyperText Markup Language)" #: ../../library/html.rst:7 msgid "**Source code:** :source:`Lib/html/__init__.py`" diff --git a/library/http.client.po b/library/http.client.po index 20a853e4e..fb8ae92e8 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -520,6 +520,8 @@ msgid "" "Raises an :ref:`auditing event ` ``http.client.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``http.client.connect`` com " +"os argumentos ``self``, ``host``, ``port``." #: ../../library/http.client.rst:409 msgid "Close the connection to the server." @@ -597,6 +599,8 @@ msgid "" "Raises an :ref:`auditing event ` ``http.client.send`` with " "arguments ``self``, ``data``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``http.client.send`` com os " +"argumentos ``self``, ``data``." #: ../../library/http.client.rst:480 msgid "HTTPResponse Objects" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 330e9dd04..8aa7db4a5 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/http.cookies.po b/library/http.cookies.po index 303ce7043..19079def2 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/http.po b/library/http.po index 783da39e4..17efece5b 100644 --- a/library/http.po +++ b/library/http.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -49,15 +49,15 @@ msgid "" ":mod:`http.client` is a low-level HTTP protocol client; for high-level URL " "opening use :mod:`urllib.request`" msgstr "" -":mod:`http.client` is a low-level HTTP protocol client; for high-level URL " -"opening use :mod:`urllib.request`" +":mod:`http.client` é um cliente de protocolo HTTP de baixo nível; para " +"abertura de URL de alto nível, use :mod:`urllib.request`" #: ../../library/http.rst:20 msgid "" ":mod:`http.server` contains basic HTTP server classes based on :mod:" "`socketserver`" msgstr "" -":mod:`http.server` contains basic HTTP server classes based on :mod:" +":mod:`http.server` contém classes básicas de servidor HTTP baseadas em :mod:" "`socketserver`" #: ../../library/http.rst:21 diff --git a/library/http.server.po b/library/http.server.po index 0e8aa0094..fc3845a4a 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -645,7 +645,7 @@ msgstr "" #: ../../library/http.server.rst:519 msgid "Security Considerations" -msgstr "Considerações de segurança" +msgstr "Considerações de Segurança" #: ../../library/http.server.rst:523 msgid "" diff --git a/library/i18n.po b/library/i18n.po index 36502f3f9..26c7a7a59 100644 --- a/library/i18n.po +++ b/library/i18n.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/idle.po b/library/idle.po index 7ad54fb8d..e6fed8632 100644 --- a/library/idle.po +++ b/library/idle.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/imaplib.po b/library/imaplib.po index 22c4989d8..cd939f8f3 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -432,6 +432,8 @@ msgid "" "Raises an :ref:`auditing event ` ``imaplib.open`` with arguments " "``self``, ``host``, ``port``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``imaplib.open`` com os " +"argumentos ``self``, ``host``, ``port``." #: ../../library/imaplib.rst:373 msgid "The *timeout* parameter was added." @@ -504,6 +506,8 @@ msgid "" "Raises an :ref:`auditing event ` ``imaplib.send`` with arguments " "``self``, ``data``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``imaplib.send`` com os " +"argumentos ``self``, ``data``." #: ../../library/imaplib.rst:449 msgid "" diff --git a/library/imghdr.po b/library/imghdr.po index 08e67da15..5786b4522 100644 --- a/library/imghdr.po +++ b/library/imghdr.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index c29dc2ad2..d61d2a059 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -52,10 +52,10 @@ msgid "" msgstr "" "``importlib.metadata`` é uma biblioteca que fornece acesso aos metadados de " "um `Pacote de Distribuição `_ instalado, como seus pontos de " -"entrada ou seus nomes de nível superior (`Pacotes de Importação `, módulos, " -"se houver). Construída em parte no sistema de importação do Python, esta " +"glossary/#term-Import-Package>`_ instalado, como seus pontos de entrada ou " +"seus nomes de nível superior (`Pacotes de Importação `_, módulos, se " +"houver). Construída em parte no sistema de importação do Python, esta " "biblioteca pretende substituir funcionalidades semelhantes na `API de ponto " "de entrada`_ e `API de metadados`_ de ``pkg_resources``. Junto com :mod:" "`importlib.resources`, este pacote pode eliminar a necessidade de usar o " @@ -503,7 +503,7 @@ msgstr "" "Por padrão, este pacote fornece suporte embutido para descoberta de " "metadados para sistema de arquivos e arquivo zip `Pacotes de Distribuição " "`. Esta pesquisa do localizador de metadados tem como padrão ``sys." +"Package>`_. Esta pesquisa do localizador de metadados tem como padrão ``sys." "path``, mas varia um pouco na maneira como ela interpreta esses valores em " "relação a outras mecanismo de importação. Em particular:" diff --git a/library/importlib.po b/library/importlib.po index 7048e37b5..997d196bf 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -827,7 +827,7 @@ msgstr "" #: ../../library/importlib.rst:446 msgid "No longer abstract and a concrete implementation is provided." -msgstr "" +msgstr "Não é mais abstrato e uma implementação concreta é fornecida." #: ../../library/importlib.rst:451 msgid "" @@ -837,11 +837,17 @@ msgid "" "available (e.g. a built-in module). Raises :exc:`ImportError` if the loader " "cannot find the module specified." msgstr "" +"Um método abstrato para retornar a fonte de um módulo. Ele é retornado como " +"uma string de texto usando :term:`novas linhas universais`, traduzindo todos " +"os separadores de linha reconhecidos em caracteres ``'\\n'``. Retorna " +"``None`` se nenhuma fonte estiver disponível (por exemplo, um módulo " +"embutido). Levanta :exc:`ImportError` se o carregador não puder encontrar o " +"módulo especificado." #: ../../library/importlib.rst:457 ../../library/importlib.rst:466 #: ../../library/importlib.rst:516 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." -msgstr "" +msgstr "Levanta :exc:`ImportError` em vez de :exc:`NotImplementedError`." #: ../../library/importlib.rst:462 msgid "" @@ -849,10 +855,13 @@ msgid "" "false value otherwise. :exc:`ImportError` is raised if the :term:`loader` " "cannot find the module." msgstr "" +"Um método opcional para retornar um valor verdadeiro se o módulo for um " +"pacote, um valor falso caso contrário. :exc:`ImportError` é levantada se o :" +"term:`carregador` não puder encontrar o módulo." #: ../../library/importlib.rst:471 msgid "Create a code object from Python source." -msgstr "" +msgstr "Cria um objeto código a partir de código-fonte Python" #: ../../library/importlib.rst:473 msgid "" @@ -861,28 +870,34 @@ msgid "" "source code originated from, which can be an abstract concept (e.g. location " "in a zip file)." msgstr "" +"O argumento *data* pode ser qualquer coisa a qual a função :func:`compile` " +"tenha suporte (por exemplo, string ou bytes). O argumento *path* deve ser o " +"\"caminho\" de onde o código-fonte se originou, o que pode ser um conceito " +"abstrato (por exemplo, local em um arquivo zip)." #: ../../library/importlib.rst:478 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" +"Com o objeto de código subsequente, é possível executá-lo em um módulo " +"executando ``exec(code, module.__dict__)``." #: ../../library/importlib.rst:483 msgid "Made the method static." -msgstr "" +msgstr "O método foi tornado estático." #: ../../library/importlib.rst:488 msgid "Implementation of :meth:`Loader.exec_module`." -msgstr "" +msgstr "Implementação de :meth:`Loader.exec_module`." #: ../../library/importlib.rst:494 msgid "Implementation of :meth:`Loader.load_module`." -msgstr "" +msgstr "Implementação de :meth:`Loader.load_module`." #: ../../library/importlib.rst:496 msgid "use :meth:`exec_module` instead." -msgstr "" +msgstr "use :meth:`exec_module`." #: ../../library/importlib.rst:502 msgid "" @@ -890,18 +905,27 @@ msgid "" "implemented, helps a module to be executed as a script. The ABC represents " "an optional :pep:`302` protocol." msgstr "" +"Uma classe base abstrata que herda de :class:`InspectLoader` que, quando " +"implementada, ajuda um módulo a ser executado como um script. A ABC " +"representa um protocolo opcional da :pep:`302`." #: ../../library/importlib.rst:508 msgid "" "An abstract method that is to return the value of :attr:`__file__` for the " "specified module. If no path is available, :exc:`ImportError` is raised." msgstr "" +"Um método abstrato que deve retornar o valor de :attr:`__file__` para o " +"módulo especificado. Se nenhum caminho estiver disponível, :exc:" +"`ImportError` é levantada." #: ../../library/importlib.rst:512 msgid "" "If source code is available, then the method should return the path to the " "source file, regardless of whether a bytecode was used to load the module." msgstr "" +"Se o código-fonte estiver disponível, o método deverá retornar o caminho " +"para o arquivo fonte, independentemente de um bytecode ter sido usado para " +"carregar o módulo." #: ../../library/importlib.rst:522 msgid "" @@ -909,16 +933,22 @@ msgid "" "class:`ExecutionLoader`, providing concrete implementations of :meth:" "`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`." msgstr "" +"Uma classe base abstrata que herda de :class:`ResourceLoader` e :class:" +"`ExecutionLoader`, fornecendo implementações concretas de :meth:" +"`ResourceLoader.get_data` e :meth:`ExecutionLoader.get_filename`." #: ../../library/importlib.rst:526 msgid "" "The *fullname* argument is a fully resolved name of the module the loader is " "to handle. The *path* argument is the path to the file for the module." msgstr "" +"O argumento *fullname* é um nome totalmente resolvido do módulo que o " +"carregador deve manipular. O argumento *path* é o caminho para o arquivo do " +"módulo." #: ../../library/importlib.rst:533 msgid "The name of the module the loader can handle." -msgstr "" +msgstr "O nome do módulo que o carregador pode manipular." #: ../../library/importlib.rst:537 msgid "Path to the file of the module." @@ -926,19 +956,19 @@ msgstr "Caminho para o arquivo do módulo" #: ../../library/importlib.rst:541 msgid "Calls super's ``load_module()``." -msgstr "" +msgstr "Chama ``load_module()`` do super." #: ../../library/importlib.rst:543 msgid "Use :meth:`Loader.exec_module` instead." -msgstr "" +msgstr "Use :meth:`Loader.exec_module`" #: ../../library/importlib.rst:548 ../../library/importlib.rst:1143 msgid "Returns :attr:`path`." -msgstr "" +msgstr "Retorna :attr:`path`." #: ../../library/importlib.rst:552 msgid "Reads *path* as a binary file and returns the bytes from it." -msgstr "" +msgstr "Lê *caminho* como um arquivo binário e retorna os bytes dele." #: ../../library/importlib.rst:557 msgid "" @@ -946,6 +976,9 @@ msgid "" "file loading. The class inherits from both :class:`ResourceLoader` and :" "class:`ExecutionLoader`, requiring the implementation of:" msgstr "" +"Uma classe base abstrata para implementar o carregamento de arquivo fonte (e " +"opcionalmente bytecode). A classe herda de :class:`ResourceLoader` e :class:" +"`ExecutionLoader`, exigindo a implementação de:" #: ../../library/importlib.rst:561 msgid ":meth:`ResourceLoader.get_data`" @@ -960,6 +993,8 @@ msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" +"Deve retornar apenas o caminho para o arquivo fonte; o carregamento sem " +"fonte não é suportado." #: ../../library/importlib.rst:566 msgid "" @@ -972,38 +1007,55 @@ msgid "" "loading by removing the parsing step of Python's compiler, and so no " "bytecode-specific API is exposed." msgstr "" +"Os métodos abstratos definidos por esta classe são para adicionar suporte " +"opcional ao arquivo bytecode. Não implementar esses métodos opcionais (ou " +"fazer com que eles levantem :exc:`NotImplementedError`) faz com que o " +"carregador funcione apenas com código-fonte. Implementar os métodos permite " +"que o carregador funcione com arquivos de código-fonte *e* bytecode; ele não " +"permite carregamento *sem fonte* onde apenas o bytecode é fornecido. " +"Arquivos de bytecode são uma otimização para acelerar o carregamento " +"removendo a etapa de análise do compilador do Python e, portanto, nenhuma " +"API específica de bytecode é exposta." #: ../../library/importlib.rst:577 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" +"Método abstrato opcional que retorna um :class:`dict` contendo metadados " +"sobre o caminho especificado. As chaves de dicionário suportadas são:" #: ../../library/importlib.rst:580 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" +"``'mtime'`` (obrigatório): um número inteiro ou de ponto flutuante que " +"representa o tempo de modificação do código-fonte;" #: ../../library/importlib.rst:582 msgid "``'size'`` (optional): the size in bytes of the source code." -msgstr "" +msgstr "``'size'`` (opcional): o tamanho em bytes do código-fonte." #: ../../library/importlib.rst:584 msgid "" "Any other keys in the dictionary are ignored, to allow for future " "extensions. If the path cannot be handled, :exc:`OSError` is raised." msgstr "" +"Quaisquer outras chaves no dicionário são ignoradas, para permitir extensões " +"futuras. Se o caminho não puder ser manipulado, :exc:`OSError` é levantada." #: ../../library/importlib.rst:589 ../../library/importlib.rst:602 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." -msgstr "" +msgstr "Levanta :exc:`OSError` em vez de :exc:`NotImplementedError`." #: ../../library/importlib.rst:594 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" +"Método abstrato opcional que retorna o horário de modificação do caminho " +"especificado." #: ../../library/importlib.rst:597 msgid "" @@ -1011,6 +1063,10 @@ msgid "" "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" +"Este método foi descontinuado em favor de :meth:`path_stats`. Você não " +"precisa implementá-lo, mas ele ainda está disponível para fins de " +"compatibilidade. Levanta :exc:`OSError` se o caminho não puder ser " +"manipulado." #: ../../library/importlib.rst:607 msgid "" @@ -1018,36 +1074,41 @@ msgid "" "Any intermediate directories which do not exist are to be created " "automatically." msgstr "" +"Método abstrato opcional que grava os bytes especificados em um caminho de " +"arquivo. Quaisquer diretórios intermediários que não existam devem ser " +"criados automaticamente." #: ../../library/importlib.rst:611 msgid "" "When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" +"Quando a gravação no caminho falhar porque o caminho é somente leitura (:" +"const:`errno.EACCES`/:exc:`PermissionError`), não propaga a exceção." #: ../../library/importlib.rst:615 msgid "No longer raises :exc:`NotImplementedError` when called." -msgstr "" +msgstr "Não mais levanta :exc:`NotImplementedError` quando chamado." #: ../../library/importlib.rst:620 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." -msgstr "" +msgstr "Implementação concreta de :meth:`InspectLoader.get_code`." #: ../../library/importlib.rst:624 msgid "Concrete implementation of :meth:`Loader.exec_module`." -msgstr "" +msgstr "Implementação concreta de :meth:`Loader.exec_module`." #: ../../library/importlib.rst:630 msgid "Concrete implementation of :meth:`Loader.load_module`." -msgstr "" +msgstr "Implementação concreta de :meth:`Loader.load_module`." #: ../../library/importlib.rst:632 msgid "Use :meth:`exec_module` instead." -msgstr "" +msgstr "Use :meth:`exec_module`." #: ../../library/importlib.rst:637 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." -msgstr "" +msgstr "Implementação concreta de :meth:`InspectLoader.get_source`." #: ../../library/importlib.rst:641 msgid "" @@ -1057,6 +1118,11 @@ msgid "" "extension is removed **and** the module name itself does not end in " "``__init__``." msgstr "" +"Implementação concreta de :meth:`InspectLoader.is_package`. Um módulo é " +"determinado como um pacote se seu caminho de arquivo (conforme fornecido " +"por :meth:`ExecutionLoader.get_filename`) for um arquivo chamado " +"``__init__`` quando a extensão do arquivo for removida **e** o nome do " +"módulo em si não terminar em ``__init__``." #: ../../library/importlib.rst:650 msgid "*Superseded by TraversableResources*" @@ -1215,23 +1281,23 @@ msgstr "Abstrato. O nome base deste objeto sem nenhuma referência pai." #: ../../library/importlib.rst:744 msgid "Yield ``Traversable`` objects in ``self``." -msgstr "" +msgstr "Produz objetos ``Traversable`` em ``self``." #: ../../library/importlib.rst:748 msgid "Return ``True`` if ``self`` is a directory." -msgstr "" +msgstr "Retorna ``True`` se ``self`` for um diretório." #: ../../library/importlib.rst:752 msgid "Return ``True`` if ``self`` is a file." -msgstr "" +msgstr "Retorna ``True`` se ``self`` for um arquivo." #: ../../library/importlib.rst:756 msgid "Return Traversable child in ``self``." -msgstr "" +msgstr "Retorna o filho Traversable em ``self``." #: ../../library/importlib.rst:760 msgid "Return ``Traversable`` child in ``self``." -msgstr "" +msgstr "Retorna o filho ``Traversable`` em ``self``." #: ../../library/importlib.rst:764 msgid "" @@ -1251,11 +1317,11 @@ msgstr "" #: ../../library/importlib.rst:772 msgid "Read contents of ``self`` as bytes." -msgstr "" +msgstr "Lê o conteúdo de ``self`` como bytes." #: ../../library/importlib.rst:776 msgid "Read contents of ``self`` as text." -msgstr "" +msgstr "Lê o conteúdo de ``self`` como texto." #: ../../library/importlib.rst:781 msgid "" @@ -1291,55 +1357,67 @@ msgstr "" #: ../../library/importlib.rst:804 msgid ":mod:`importlib.machinery` -- Importers and path hooks" -msgstr "" +msgstr ":mod:`importlib.machinery` -- Importadores e ganchos de caminho" #: ../../library/importlib.rst:809 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" -msgstr "" +msgstr "**Código-fonte:** :source:`Lib/importlib/machinery.py`" #: ../../library/importlib.rst:813 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" +"Este módulo contém vários objetos que ajudam o :keyword:`import` a localizar " +"e carregar módulos." #: ../../library/importlib.rst:818 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" +"Uma lista de strings representando os sufixos de arquivo reconhecidos para " +"módulos em código-fonte." #: ../../library/importlib.rst:825 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" +"Uma lista de strings representando os sufixos de arquivo para módulos em " +"bytecode não otimizado." #: ../../library/importlib.rst:830 ../../library/importlib.rst:840 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." -msgstr "" +msgstr "Use :attr:`BYTECODE_SUFFIXES`." #: ../../library/importlib.rst:835 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" +"Uma lista de strings representando os sufixos de arquivo para módulos em " +"bytecode otimizado." #: ../../library/importlib.rst:845 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" +"Uma lista de strings representando os sufixos de arquivo reconhecidos para " +"módulos em bytecode (incluindo com ponto no início)." #: ../../library/importlib.rst:850 msgid "The value is no longer dependent on ``__debug__``." -msgstr "" +msgstr "O valor não mais depende de ``__debug__``." #: ../../library/importlib.rst:855 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" +"Uma lista de strings representando os sufixos de arquivo reconhecidos para " +"módulos de extensão." #: ../../library/importlib.rst:862 msgid "" @@ -1349,6 +1427,11 @@ msgid "" "module without needing any details on the kind of module (for example, :func:" "`inspect.getmodulename`)." msgstr "" +"Retorna uma lista combinada de strings representando todos os sufixos de " +"arquivo para módulos reconhecidos pelo maquinário de importação padrão. Este " +"é um auxiliar para código que simplesmente precisa saber se um caminho de " +"sistema de arquivos potencialmente se refere a um módulo sem precisar de " +"detalhes sobre o tipo de módulo (por exemplo, :func:`inspect.getmodulename`)." #: ../../library/importlib.rst:873 msgid "" @@ -1356,6 +1439,10 @@ msgid "" "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" +"Um :term:`importador` para módulos embutidos. Todos os módulos embutidos " +"conhecidos estão listados em :data:`sys.builtin_module_names`. Esta classe " +"implementa os ABCs :class:`importlib.abc.MetaPathFinder` e :class:`importlib." +"abc.InspectLoader`." #: ../../library/importlib.rst:878 ../../library/importlib.rst:892 #: ../../library/importlib.rst:905 ../../library/importlib.rst:920 @@ -1363,35 +1450,48 @@ msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" +"Somente métodos de classe são definidos por esta classe para aliviar a " +"necessidade de instanciação." #: ../../library/importlib.rst:881 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" +"Como parte da :pep:`489`, o ​​importador embutido agora implementa :meth:" +"`Loader.create_module` e :meth:`Loader.exec_module`" #: ../../library/importlib.rst:888 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" +"Um :term:`importador` para módulos congelados. Esta classe implementa os " +"ABCs :class:`importlib.abc.MetaPathFinder` e :class:`importlib.abc." +"InspectLoader`." #: ../../library/importlib.rst:895 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" +"Ganhou os métodos :meth:`~Loader.create_module` e :meth:`~Loader." +"exec_module`." #: ../../library/importlib.rst:902 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" +":term:`Localizador ` para módulos declarados no registro do Windows. " +"Esta classe implementa a ABC :class:`importlib.abc.MetaPathFinder`." #: ../../library/importlib.rst:910 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" +"Use a configuração de :mod:`site` em vez disso. Versões futuras do Python " +"podem não habilitar esse localizador por padrão." #: ../../library/importlib.rst:917 msgid "" @@ -1399,6 +1499,9 @@ msgid "" "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" +"Um :term:`Localizador ` para atributos :data:`sys.path` e pacote " +"``__path__``. Esta classe implementa a ABC :class:`importlib.abc." +"MetaPathFinder`." #: ../../library/importlib.rst:925 msgid "" @@ -1413,6 +1516,17 @@ msgid "" "the module. If no finder is ever found then ``None`` is both stored in the " "cache and returned." msgstr "" +"Método de classe que tenta encontrar um :term:`spec ` para o " +"módulo especificado por *fullname* em :data:`sys.path` ou, se definido, em " +"*path*. Para cada entrada de caminho pesquisada, :data:`sys." +"path_importer_cache` é verificado. Se um objeto não falso for encontrado, " +"ele será usado como o :term:`localizador de entrada de caminho` para " +"procurar o módulo que está sendo pesquisado. Se nenhuma entrada for " +"encontrada em :data:`sys.path_importer_cache`, então :data:`sys.path_hooks` " +"será pesquisado para um localizador para a entrada de caminho e, se " +"encontrado, será armazenado em :data:`sys.path_importer_cache` junto com a " +"consulta sobre o módulo. Se nenhum localizador for encontrado, então " +"``None`` será armazenado no cache e retornado." #: ../../library/importlib.rst:939 msgid "" @@ -1420,6 +1534,9 @@ msgid "" "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" +"Se o diretório de trabalho atual — representado por uma string vazia — não " +"for mais válido, ``None`` será retornado, mas nenhum valor será armazenado " +"em cache em :data:`sys.path_importer_cache`." #: ../../library/importlib.rst:946 msgid "" @@ -1427,28 +1544,38 @@ msgid "" "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" +"Chama :meth:`importlib.abc.PathEntryFinder.invalidate_caches` em todos os " +"localizadores armazenados em :data:`sys.path_importer_cache` que definem o " +"método. Caso contrário, as entradas em :data:`sys.path_importer_cache` " +"definidas como ``None`` são excluídas." #: ../../library/importlib.rst:951 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." -msgstr "" +msgstr "Entradas de ``None`` em :data:`sys.path_importer_cache` são excluídas." #: ../../library/importlib.rst:954 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" +"Chama objetos em :data:`sys.path_hooks` com o diretório de trabalho atual " +"para ``''`` (ou seja, a string vazia)." #: ../../library/importlib.rst:961 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" +"Uma implementação concreta de :class:`importlib.abc.PathEntryFinder` que " +"armazena em cache os resultados do sistema de arquivos." #: ../../library/importlib.rst:964 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" +"O argumento *path* é o diretório que o localizador é responsável por " +"pesquisar." #: ../../library/importlib.rst:967 msgid "" @@ -1457,6 +1584,11 @@ msgid "" "The loaders are expected to be callables which accept two arguments of the " "module's name and the path to the file found." msgstr "" +"O argumento *loader_details* é um número variável de tuplas de 2 itens, cada " +"uma contendo um carregador e uma sequência de sufixos de arquivo que o " +"carregador reconhece. Espera-se que os carregadores sejam chamáveis ​​que " +"aceitam dois argumentos do nome do módulo e o caminho para o arquivo " +"encontrado." #: ../../library/importlib.rst:972 msgid "" @@ -1470,18 +1602,30 @@ msgid "" "prevent this from happening, when you create a module dynamically, make sure " "to call :func:`importlib.invalidate_caches`." msgstr "" +"O localizador armazenará em cache o conteúdo do diretório conforme " +"necessário, fazendo chamadas de \"stat\" para cada pesquisa de módulo para " +"verificar se o cache não está desatualizado. Como a obsolescência do cache " +"depende da granularidade das informações de estado do sistema operacional do " +"sistema de arquivos, há uma condição de corrida potencial de busca por um " +"módulo, criação de um novo arquivo e, em seguida, busca pelo módulo que o " +"novo arquivo representa. Se as operações ocorrerem rápido o suficiente para " +"caber na granularidade das chamadas de \"stat\", a pesquisa do módulo " +"falhará. Para evitar que isso aconteça, ao criar um módulo dinamicamente, " +"certifique-se de chamar :func:`importlib.invalidate_caches`." #: ../../library/importlib.rst:986 msgid "The path the finder will search in." -msgstr "" +msgstr "O caminho que o localizador irá procurar." #: ../../library/importlib.rst:990 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" +"Tenta encontrar a especificação para manipular *fullname* dentro de :attr:" +"`path`." #: ../../library/importlib.rst:996 msgid "Clear out the internal cache." -msgstr "" +msgstr "Limpa o cache interno." #: ../../library/importlib.rst:1000 msgid "" @@ -1489,12 +1633,18 @@ msgid "" "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" +"Um método de classe que retorna uma clausura para uso em :data:`sys." +"path_hooks`. Uma instância de :class:`FileFinder` é retornada pela clausura " +"usando o argumento de caminho dado à clausura diretamente e *loader_details* " +"indiretamente." #: ../../library/importlib.rst:1005 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" +"Se o argumento para a clausura não for um diretório existente, :exc:" +"`ImportError` será levantada." #: ../../library/importlib.rst:1011 msgid "" @@ -1502,43 +1652,52 @@ msgid "" "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" +"Uma implementação concreta de :class:`importlib.abc.SourceLoader` " +"subclassificando :class:`importlib.abc.FileLoader` e fornecendo algumas " +"implementações concretas de outros métodos." #: ../../library/importlib.rst:1019 msgid "The name of the module that this loader will handle." -msgstr "" +msgstr "O nome do módulo que este carregador irá manipular." #: ../../library/importlib.rst:1023 msgid "The path to the source file." -msgstr "" +msgstr "O caminho para o arquivo fonte." #: ../../library/importlib.rst:1027 msgid "Return ``True`` if :attr:`path` appears to be for a package." -msgstr "" +msgstr "Retorna ``True`` se :attr:`path` parecer ser para um pacote." #: ../../library/importlib.rst:1031 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" +"Implementação concreta de :meth:`importlib.abc.SourceLoader.path_stats`." #: ../../library/importlib.rst:1035 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." -msgstr "" +msgstr "Implementação concreta de :meth:`importlib.abc.SourceLoader.set_data`." #: ../../library/importlib.rst:1039 ../../library/importlib.rst:1082 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" +"Implementação concreta de :meth:`importlib.abc.Loader.load_module` onde a " +"especificação do nome do módulo para carregar é opcional" #: ../../library/importlib.rst:1044 ../../library/importlib.rst:1087 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." -msgstr "" +msgstr "Use :meth:`importlib.abc.Loader.exec_module`." #: ../../library/importlib.rst:1049 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" +"Uma implementação concreta de :class:`importlib.abc.FileLoader` que pode " +"importar arquivos de bytecode (ou seja, não existem arquivos de código-" +"fonte)." #: ../../library/importlib.rst:1052 msgid "" @@ -1546,39 +1705,51 @@ msgid "" "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" +"Observe que o uso direto de arquivos de bytecode (e, portanto, não de " +"arquivos de código-fonte) impede que seus módulos sejam utilizáveis ​​por " +"todas as implementações do Python ou novas versões do Python que alteram o " +"formato do bytecode." #: ../../library/importlib.rst:1061 msgid "The name of the module the loader will handle." -msgstr "" +msgstr "O nome do módulo que o carregador vai manipular." #: ../../library/importlib.rst:1065 msgid "The path to the bytecode file." -msgstr "" +msgstr "O caminho para o arquivo de bytecode." #: ../../library/importlib.rst:1069 msgid "Determines if the module is a package based on :attr:`path`." -msgstr "" +msgstr "Determina se o módulo é um pacote baseado em :attr:`path`." #: ../../library/importlib.rst:1073 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" +"Retorna o objeto código para :attr:`name` criado a partir de :attr:`path`." #: ../../library/importlib.rst:1077 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" +"Retorna ``None``, pois os arquivos de bytecode não têm código-fonte quando " +"este carregador é usado." #: ../../library/importlib.rst:1092 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" +"Uma implementação concreta de :class:`importlib.abc.ExecutionLoader` para " +"módulos de extensão." #: ../../library/importlib.rst:1095 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" +"O argumento *fullname* especifica o nome do módulo ao qual o carregador deve " +"dar suporte. O argumento *path* é o caminho para o arquivo do módulo de " +"extensão." #: ../../library/importlib.rst:1098 msgid "" @@ -1586,42 +1757,52 @@ msgid "" "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" +"Observe que, por padrão, a importação de um módulo de extensão falhará em " +"subinterpretadores se ele não implementar inicialização multifásica " +"(consulte a :pep:`489`), mesmo que ele seja importado com sucesso." #: ../../library/importlib.rst:1104 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" +"A inicialização multifásica agora é necessária para uso em " +"subinterpretadores." #: ../../library/importlib.rst:1109 msgid "Name of the module the loader supports." -msgstr "" +msgstr "Nome do módulo ao qual o carregador dá suporte." #: ../../library/importlib.rst:1113 msgid "Path to the extension module." -msgstr "" +msgstr "Caminho para o módulo de extensão." #: ../../library/importlib.rst:1117 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" +"Cria o objeto do módulo a partir da especificação fornecida de acordo com a :" +"pep:`489`." #: ../../library/importlib.rst:1124 msgid "Initializes the given module object in accordance with :pep:`489`." -msgstr "" +msgstr "Inicializa o objeto do módulo fornecido de acordo com a :pep:`489`." #: ../../library/importlib.rst:1130 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" +"Retorna ``True`` se o caminho do arquivo aponta para o módulo ``__init__`` " +"de um pacote com base em :attr:`EXTENSION_SUFFIXES`." #: ../../library/importlib.rst:1135 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" +"Retorna ``None``, pois os módulos de extensão não possuem um objeto código." #: ../../library/importlib.rst:1139 msgid "Returns ``None`` as extension modules do not have source code." -msgstr "" +msgstr "Retorna ``None`` pois os módulos de extensão não possuem código-fonte." #: ../../library/importlib.rst:1150 msgid "" @@ -1629,6 +1810,10 @@ msgid "" "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" +"Uma implementação concreta de :class:`importlib.abc.InspectLoader` para " +"pacotes de espaço de nomes. Este é um apelido para uma classe privada e só é " +"tornado público para introspecção do atributo ``__loader__`` em pacotes de " +"espaço de nomes::" #: ../../library/importlib.rst:1168 msgid "" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index 0b9408535..70f66eee2 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -16,16 +16,17 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/importlib.resources.abc.rst:2 msgid ":mod:`!importlib.resources.abc` -- Abstract base classes for resources" msgstr "" +":mod:`!importlib.resources.abc` -- Classes base abstratas para recursos" #: ../../library/importlib.resources.abc.rst:7 msgid "**Source code:** :source:`Lib/importlib/resources/abc.py`" @@ -188,11 +189,11 @@ msgstr "Produz objetos Traversable em self." #: ../../library/importlib.resources.abc.rst:106 msgid "Return ``True`` if self is a directory." -msgstr "" +msgstr "Retorna ``True`` se self for um diretório." #: ../../library/importlib.resources.abc.rst:110 msgid "Return ``True`` if self is a file." -msgstr "" +msgstr "Retorna ``True`` se self for um arquivo." #: ../../library/importlib.resources.abc.rst:114 msgid "" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 6318ba446..96dcd9cc3 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -28,6 +28,8 @@ msgstr "" msgid "" ":mod:`!importlib.resources` -- Package resource reading, opening and access" msgstr "" +":mod:`!importlib.resources` -- Leitura, abertura e acesso a recursos de " +"pacotes" #: ../../library/importlib.resources.rst:7 msgid "**Source code:** :source:`Lib/importlib/resources/__init__.py`" @@ -149,7 +151,7 @@ msgstr "" "*anchor* é um :class:`Anchor` opcional. Se a âncora for um pacote, os " "recursos são resolvidos a partir desse pacote. Se for um módulo, os recursos " "são resolvidos ao lado desse módulo (no mesmo pacote ou na raiz do pacote). " -"Se a âncora for omitido, o módulo do chamador é usado." +"Se a âncora for omitida, o módulo do chamador é usado." #: ../../library/importlib.resources.rst:74 msgid "" diff --git a/library/index.po b/library/index.po index 65a3e27ab..001467369 100644 --- a/library/index.po +++ b/library/index.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/inspect.po b/library/inspect.po index bd36d22f9..d80e7df8c 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -83,7 +83,7 @@ msgstr "Descrição" #: ../../library/inspect.rst:48 msgid "class" -msgstr "class" +msgstr "classe" #: ../../library/inspect.rst:48 ../../library/inspect.rst:63 #: ../../library/inspect.rst:81 ../../library/inspect.rst:248 diff --git a/library/internet.po b/library/internet.po index 2aa19e5bb..9a4a759ee 100644 --- a/library/internet.po +++ b/library/internet.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/intro.po b/library/intro.po index b4c9e4193..75ba32fa4 100644 --- a/library/intro.po +++ b/library/intro.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -56,11 +56,11 @@ msgid "" "statement. Some of these are defined by the core language, but many are not " "essential for the core semantics and are only described here." msgstr "" -"A biblioteca também contém exceções e funções embutidas -- objetos que podem " -"ser usados por todo o código Python sem a necessidade de uma instrução :" -"keyword:`import`. Alguns desses são definidos pelo núcleo da linguagem, mas " -"muitos não são essenciais para as semânticas principais e são apenas " -"descritos aqui." +"A biblioteca também contém exceções e funções embutidas --- objetos que " +"podem ser usados por todo o código Python sem a necessidade de uma " +"instrução :keyword:`import`. Alguns desses são definidos pelo núcleo da " +"linguagem, mas muitos não são essenciais para as semânticas principais e são " +"apenas descritos aqui." #: ../../library/intro.rst:20 msgid "" @@ -98,7 +98,7 @@ msgid "" "grouped in chapters of related modules." msgstr "" "Este manual está organizado \"de dentro para fora\": ele primeiro descreve " -"as funções inclusas, tipos de dados e exceções, e finalmente os módulos, " +"as funções embutidas, tipos de dados e exceções, e finalmente os módulos, " "agrupados em capítulos de módulos relacionados." #: ../../library/intro.rst:36 @@ -122,10 +122,10 @@ msgstr "" "romance --- você também pode navegar pela tabela de conteúdos (no início do " "manual), ou procurar por uma função, módulo ou termo específicos no índice " "(na parte final). E finalmente, se você gostar de aprender sobre assuntos " -"diversos, você pode escolher um número de página aleatório (veja module :mod:" -"`random`) e leia uma seção ou duas. Independente da ordem na qual você leia " -"as seções deste manual, ajuda iniciar pelo capítulo :ref:`built-in-funcs`, " -"já que o resto do manual requer familiaridade com este material." +"diversos, você pode escolher um número de página aleatório (veja o módulo :" +"mod:`random`) e leia uma seção ou duas. Independente da ordem na qual você " +"leia as seções deste manual, ajuda iniciar pelo capítulo :ref:`built-in-" +"funcs`, já que o resto do manual requer familiaridade com este material." #: ../../library/intro.rst:48 msgid "Let the show begin!" diff --git a/library/io.po b/library/io.po index 0f96e1c3e..83a5090b7 100644 --- a/library/io.po +++ b/library/io.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -255,6 +255,9 @@ msgid "" "arguments *path*, *mode* and *flags*. The *mode* and *flags* arguments may " "have been modified or inferred from the original call." msgstr "" +"Esta função levanta um :ref:`evento de auditoria ` ``open`` com os " +"argumentos *path*, *mode* e *flags*. Os argumentos *mode* e *flags* podem " +"ter sido modificados ou inferidos da chamada original." #: ../../library/io.rst:184 msgid "" @@ -1530,7 +1533,7 @@ msgstr "" #: ../../library/io.rst:1131 msgid "Performance" -msgstr "Performance" +msgstr "Desempenho" #: ../../library/io.rst:1133 msgid "" diff --git a/library/ipaddress.po b/library/ipaddress.po index 8c5811921..106c2e777 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/ipaddress.rst:2 msgid ":mod:`!ipaddress` --- IPv4/IPv6 manipulation library" -msgstr "" +msgstr ":mod:`!ipaddress` --- Biblioteca de manipulação de IPv4/IPv6" #: ../../library/ipaddress.rst:9 msgid "**Source code:** :source:`Lib/ipaddress.py`" diff --git a/library/ipc.po b/library/ipc.po index f1e8ed189..3733fd796 100644 --- a/library/ipc.po +++ b/library/ipc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/itertools.po b/library/itertools.po index 5f91dcd51..d6a9645a9 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -206,7 +206,7 @@ msgstr ":func:`chain.from_iterable`" #: ../../library/itertools.rst:57 ../../library/itertools.rst:63 msgid "iterable" -msgstr "iterable" +msgstr "Iterável" #: ../../library/itertools.rst:57 msgid "``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``" @@ -549,8 +549,8 @@ msgid "" "Alternate constructor for :func:`chain`. Gets chained inputs from a single " "iterable argument that is evaluated lazily. Roughly equivalent to::" msgstr "" -"Construtor alternativo para :func:`chain`. Obtém entradas encadeadas a " -"partir de um único argumento iterável que avaliado preguiçosamente. " +"Construtor alternativo para :func:`chain`. Obtém entradas encadeadas a " +"partir de um único argumento iterável que avaliado preguiçosamente. " "Aproximadamente equivalente a::" #: ../../library/itertools.rst:232 diff --git a/library/json.po b/library/json.po index 16bec05cf..c72d08ea3 100644 --- a/library/json.po +++ b/library/json.po @@ -23,16 +23,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/json.rst:2 msgid ":mod:`!json` --- JSON encoder and decoder" -msgstr "" +msgstr ":mod:`!json` --- Codificador e decodificador JSON" #: ../../library/json.rst:10 msgid "**Source code:** :source:`Lib/json/__init__.py`" @@ -474,7 +474,7 @@ msgstr "Python" #: ../../library/json.rst:317 ../../library/json.rst:406 msgid "object" -msgstr "object" +msgstr "objeto" #: ../../library/json.rst:317 ../../library/json.rst:406 msgid "dict" @@ -498,7 +498,7 @@ msgstr "str" #: ../../library/json.rst:323 msgid "number (int)" -msgstr "number (int)" +msgstr "número (inteiro)" #: ../../library/json.rst:323 msgid "int" @@ -506,11 +506,11 @@ msgstr "int" #: ../../library/json.rst:325 msgid "number (real)" -msgstr "number (real)" +msgstr "número (real)" #: ../../library/json.rst:325 msgid "float" -msgstr "float" +msgstr "ponto flutuante" #: ../../library/json.rst:327 ../../library/json.rst:414 msgid "true" @@ -641,7 +641,7 @@ msgstr "int, float e Enums derivados de int e float" #: ../../library/json.rst:412 msgid "number" -msgstr "number" +msgstr "número" #: ../../library/json.rst:421 msgid "Added support for int- and float-derived Enum classes." diff --git a/library/keyword.po b/library/keyword.po index 4e6399c73..0de5dcdd0 100644 --- a/library/keyword.po +++ b/library/keyword.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/keyword.rst:2 msgid ":mod:`!keyword` --- Testing for Python keywords" -msgstr "" +msgstr ":mod:`!keyword` --- Testando palavras reservadas do Python" #: ../../library/keyword.rst:7 msgid "**Source code:** :source:`Lib/keyword.py`" diff --git a/library/language.po b/library/language.po index 75170a65c..cdb2c2c98 100644 --- a/library/language.po +++ b/library/language.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/linecache.po b/library/linecache.po index 157da8029..8963b322c 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/linecache.rst:2 msgid ":mod:`!linecache` --- Random access to text lines" -msgstr "" +msgstr ":mod:`!linecache` --- Acesso aleatório a linhas de texto" #: ../../library/linecache.rst:9 msgid "**Source code:** :source:`Lib/linecache.py`" diff --git a/library/locale.po b/library/locale.po index 7a9ed6342..91d576005 100644 --- a/library/locale.po +++ b/library/locale.po @@ -21,16 +21,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/locale.rst:2 msgid ":mod:`!locale` --- Internationalization services" -msgstr "" +msgstr ":mod:`!locale` --- Serviços de internacionalização" #: ../../library/locale.rst:10 msgid "**Source code:** :source:`Lib/locale.py`" diff --git a/library/logging.config.po b/library/logging.config.po index 6b07865b1..b95f6f623 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -43,15 +43,15 @@ msgstr "" #: ../../library/logging.config.rst:17 msgid ":ref:`Basic Tutorial `" -msgstr ":ref:`Basic Tutorial `" +msgstr ":ref:`Tutorial básico `" #: ../../library/logging.config.rst:18 msgid ":ref:`Advanced Tutorial `" -msgstr ":ref:`Advanced Tutorial `" +msgstr ":ref:`Tutorial avançado `" #: ../../library/logging.config.rst:19 msgid ":ref:`Logging Cookbook `" -msgstr ":ref:`Logging Cookbook `" +msgstr ":ref:`Livro de receitas de logging `" #: ../../library/logging.config.rst:23 msgid "This section describes the API for configuring the logging module." diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 8a2c7d059..31678a41a 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -44,15 +44,15 @@ msgstr "" #: ../../library/logging.handlers.rst:17 msgid ":ref:`Basic Tutorial `" -msgstr ":ref:`Basic Tutorial `" +msgstr ":ref:`Tutorial básico `" #: ../../library/logging.handlers.rst:18 msgid ":ref:`Advanced Tutorial `" -msgstr ":ref:`Advanced Tutorial `" +msgstr ":ref:`Tutorial avançado `" #: ../../library/logging.handlers.rst:19 msgid ":ref:`Logging Cookbook `" -msgstr ":ref:`Logging Cookbook `" +msgstr ":ref:`Livro de receitas de logging `" #: ../../library/logging.handlers.rst:25 msgid "" @@ -112,7 +112,7 @@ msgstr "" #: ../../library/logging.handlers.rst:0 msgid "Returns" -msgstr "" +msgstr "Retorna" #: ../../library/logging.handlers.rst:69 msgid "the old stream, if the stream was changed, or ``None`` if it wasn't." diff --git a/library/logging.po b/library/logging.po index 34ade59a4..179433af2 100644 --- a/library/logging.po +++ b/library/logging.po @@ -26,16 +26,16 @@ msgstr "" "Last-Translator: Katyanna Moura , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/logging.rst:2 msgid ":mod:`!logging` --- Logging facility for Python" -msgstr "" +msgstr ":mod:`!logging` --- Recurso de utilização do Logging para Python" #: ../../library/logging.rst:10 msgid "**Source code:** :source:`Lib/logging/__init__.py`" @@ -51,15 +51,15 @@ msgstr "" #: ../../library/logging.rst:19 msgid ":ref:`Basic Tutorial `" -msgstr ":ref:`Basic Tutorial `" +msgstr ":ref:`Tutorial básico `" #: ../../library/logging.rst:20 msgid ":ref:`Advanced Tutorial `" -msgstr ":ref:`Advanced Tutorial `" +msgstr ":ref:`Tutorial avançado `" #: ../../library/logging.rst:21 msgid ":ref:`Logging Cookbook `" -msgstr ":ref:`Logging Cookbook `" +msgstr ":ref:`Livro de receitas de logging `" #: ../../library/logging.rst:25 msgid "" @@ -83,7 +83,7 @@ msgstr "" #: ../../library/logging.rst:33 msgid "Here's a simple example of idiomatic usage: ::" -msgstr "" +msgstr "Aqui está um exemplo simples de uso idiomático: ::" #: ../../library/logging.rst:58 msgid "If you run *myapp.py*, you should see this in *myapp.log*:" @@ -2065,7 +2065,7 @@ msgstr "" #: ../../library/logging.rst:1418 msgid "The *style* argument was added." -msgstr "" +msgstr "O argumento *style* foi adicionado." #: ../../library/logging.rst:1421 msgid "" @@ -2076,11 +2076,11 @@ msgstr "" #: ../../library/logging.rst:1427 msgid "The *force* argument was added." -msgstr "" +msgstr "O argumento *force* foi adicionado." #: ../../library/logging.rst:1430 msgid "The *encoding* and *errors* arguments were added." -msgstr "" +msgstr "Os argumentos *encoding* e *errors* foram adicionados." #: ../../library/logging.rst:1435 msgid "" @@ -2278,7 +2278,7 @@ msgstr "Manipuladores úteis incluídos no módulo logging." #: ../../library/logging.rst:1540 msgid ":pep:`282` - A Logging System" -msgstr "" +msgstr ":pep:`282` - A Logging System" #: ../../library/logging.rst:1541 msgid "" diff --git a/library/lzma.po b/library/lzma.po index 3e59e6243..59e157e2c 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -58,7 +58,7 @@ msgstr "" "A interface fornecida por este módulo é muito semelhante à do módulo :mod:" "`bz2`. Observe que :class:`LZMAFile` e :class:`bz2.BZ2File` *não* são seguro " "para thread, portanto, se você precisar usar uma única instância :class:" -"`LZMAFile` de vários threads, é necessário protegê-la com um bloqueio." +"`LZMAFile` de vários threads, é necessário protegê-la com uma trava." #: ../../library/lzma.rst:29 msgid "" diff --git a/library/mailbox.po b/library/mailbox.po index c5ca14d14..65e7c488f 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/mailcap.po b/library/mailcap.po index 4a73383b0..44780c150 100644 --- a/library/mailcap.po +++ b/library/mailcap.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/markup.po b/library/markup.po index 189c09daa..18aa740a5 100644 --- a/library/markup.po +++ b/library/markup.po @@ -17,10 +17,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/marshal.po b/library/marshal.po index d91c02351..42e622f7c 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/marshal.rst:2 msgid ":mod:`!marshal` --- Internal Python object serialization" -msgstr "" +msgstr ":mod:`!marshal` --- Serialização interna de objetos Python" #: ../../library/marshal.rst:10 msgid "" @@ -150,7 +150,7 @@ msgid "" "Raises an :ref:`auditing event ` ``marshal.dumps`` with arguments " "``value``, ``version``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``marshal.dumps`` com " +"Levanta um :ref:`evento de auditoria ` ``marshal.dumps`` com os " "argumentos ``value``, ``version``." #: ../../library/marshal.rst:74 @@ -171,8 +171,8 @@ msgid "" "Raises an :ref:`auditing event ` ``marshal.load`` with no " "arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``marshal.load`` com nenhum " -"argumento." +"Levanta um :ref:`evento de auditoria ` ``marshal.load`` sem " +"argumentos." #: ../../library/marshal.rst:83 msgid "" @@ -225,7 +225,7 @@ msgid "" "Raises an :ref:`auditing event ` ``marshal.loads`` with argument " "``bytes``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``marshal.loads`` com " +"Levanta um :ref:`evento de auditoria ` ``marshal.loads`` com o " "argumento ``bytes``." #: ../../library/marshal.rst:114 diff --git a/library/math.po b/library/math.po index ed41a91b6..2e334b276 100644 --- a/library/math.po +++ b/library/math.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/math.rst:2 msgid ":mod:`!math` --- Mathematical functions" -msgstr "" +msgstr ":mod:`!math` --- Funções matemáticas" #: ../../library/math.rst:13 msgid "" @@ -71,7 +71,7 @@ msgstr "" #: ../../library/math.rst:30 msgid "Number-theoretic and representation functions" -msgstr "Funções teóricas dos números e de representação" +msgstr "Funções de teoria dos números e de representação" #: ../../library/math.rst:34 msgid "" @@ -79,9 +79,9 @@ msgid "" "*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." msgstr "" -"Retorna o limite máximo de *x*, o menor inteiro maior ou igual que *x*. Se " -"*x* não é um float, delega para :meth:`x.__ceil__ `, cujo " -"qual deve retornar um valor do tipo :class:`~numbers.Integral`." +"Retorna o teto de *x*, o menor inteiro maior ou igual que *x*. Se *x* não é " +"um float, delega para :meth:`x.__ceil__ `, que deve " +"retornar um valor do tipo :class:`~numbers.Integral`." #: ../../library/math.rst:41 msgid "" @@ -122,7 +122,7 @@ msgid "" "returns *-1.0*." msgstr "" "Retorna um ponto flutuante com a magnitude (valor absoluto) de *x*, mas o " -"sinal de *y*. Em plataformas que suportam zeros sem sinal, ``copysign(1.0, " +"sinal de *y*. Em plataformas que suportam zeros com sinal, ``copysign(1.0, " "-0.0)`` retorna *-1.0*." #: ../../library/math.rst:66 @@ -149,10 +149,9 @@ msgid "" "*x* is not a float, delegates to :meth:`x.__floor__ `, " "which should return an :class:`~numbers.Integral` value." msgstr "" -"Retorna o limite mínimo de *x*, o maior inteiro menor ou igual a *x*. Se *x* " -"não é um ponto flutuante, delega para :meth:`x.__floor__ `, cujo qual deve retornar um valor do tipo :class:`~numbers." -"Integral`" +"Retorna o chão de *x*, o maior inteiro menor ou igual a *x*. Se *x* não é um " +"ponto flutuante, delega para :meth:`x.__floor__ `, que " +"deve retornar um valor do tipo :class:`~numbers.Integral`" #: ../../library/math.rst:87 msgid "" @@ -212,11 +211,11 @@ msgid "" "occasionally double-round an intermediate sum causing it to be off in its " "least significant bit." msgstr "" -"A precisão do algoritmo depende das garantias aritméticas IEEE-754 e do caso " -"típico em que o modo de arredondamento é meio par. Em algumas compilações " -"que não são do Windows, a biblioteca C subjacente usa adição de precisão " -"estendida e pode ocasionalmente arredondar uma soma intermediária fazendo " -"com que ela fique fora do bit menos significativo." +"A precisão do algoritmo depende das garantias aritméticas do IEEE-754 e do " +"caso típico em que o modo de arredondamento é meio par. Em algumas " +"compilações que não são do Windows, a biblioteca C subjacente usa adição de " +"precisão estendida e pode ocasionalmente arredondar uma soma intermediária " +"fazendo com que ela introduza um erro no bit menos significativo." #: ../../library/math.rst:119 msgid "" @@ -273,7 +272,7 @@ msgid "" "within about 9 decimal digits. *rel_tol* must be greater than zero." msgstr "" "*rel_tol* é a tolerância relativa -- é a diferença máxima permitida entre " -"*a* e *b*, em relação ao maior valor absoluto de *a* e *b*. Por exemplo, " +"*a* e *b*, em relação ao maior valor absoluto de *a* ou *b*. Por exemplo, " "para definir uma tolerância de 5%, passe ``rel_tol=0.05``. A tolerância " "padrão é ``1e-09``, o que garante que os dois valores sejam iguais em cerca " "de 9 dígitos decimais. *rel_tol* deve ser maior que zero." @@ -444,6 +443,8 @@ msgid "" "If *k* is not specified or is ``None``, then *k* defaults to *n* and the " "function returns ``n!``." msgstr "" +"Se *k* não for especificado ou for ``None``, *k* usará o padrão *n* e a " +"função retornará ``n!``." #: ../../library/math.rst:266 msgid "" diff --git a/library/mimetypes.po b/library/mimetypes.po index d19e95c82..d496f9eba 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/mm.po b/library/mm.po index 54e3d1220..2b3f6cae1 100644 --- a/library/mm.po +++ b/library/mm.po @@ -17,10 +17,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/mmap.po b/library/mmap.po index 598b3e761..fde591626 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -166,6 +166,8 @@ msgid "" "Raises an :ref:`auditing event ` ``mmap.__new__`` with arguments " "``fileno``, ``length``, ``access``, ``offset``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``mmap.__new__`` com os " +"argumentos ``fileno``, ``length``, ``access``, ``offset``." #: ../../library/mmap.rst:77 msgid "" diff --git a/library/modulefinder.po b/library/modulefinder.po index bb4c903ad..1fdd6bba9 100644 --- a/library/modulefinder.po +++ b/library/modulefinder.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/modulefinder.rst:2 msgid ":mod:`!modulefinder` --- Find modules used by a script" -msgstr "" +msgstr ":mod:`!modulefinder` --- Procura módulos usados por um script" #: ../../library/modulefinder.rst:9 msgid "**Source code:** :source:`Lib/modulefinder.py`" diff --git a/library/modules.po b/library/modules.po index 5a0987275..70b58d56c 100644 --- a/library/modules.po +++ b/library/modules.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/msilib.po b/library/msilib.po index 4cde2e840..07b91ac15 100644 --- a/library/msilib.po +++ b/library/msilib.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/msvcrt.po b/library/msvcrt.po index cdbdcf116..ec83902ce 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -94,7 +94,7 @@ msgid "" "Raises an :ref:`auditing event ` ``msvcrt.locking`` with arguments " "``fd``, ``mode``, ``nbytes``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``msvcrt.locking`` com " +"Levanta um :ref:`evento de auditoria ` ``msvcrt.locking`` com os " "argumentos ``fd``, ``mode``, ``nbytes``." #: ../../library/msvcrt.rst:51 @@ -113,14 +113,13 @@ msgid "" "Locks the specified bytes. If the bytes cannot be locked, :exc:`OSError` is " "raised." msgstr "" -"Bloqueia os bytes especificados. Se os bytes não puderem ser bloqueados, :" -"exc:`OSError` é levantado." +"Trava os bytes especificados. Se os bytes não puderem ser travados, uma " +"exceção :exc:`OSError` é levantada." #: ../../library/msvcrt.rst:65 msgid "Unlocks the specified bytes, which must have been previously locked." msgstr "" -"Desbloqueia os bytes especificados, que devem ter sido bloqueados " -"anteriormente." +"Destrava os bytes especificados, que devem ter sido travados anteriormente." #: ../../library/msvcrt.rst:70 msgid "" @@ -151,7 +150,7 @@ msgid "" "arguments ``handle``, ``flags``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``msvcrt.open_osfhandle`` " -"com argumentos ``handle``, ``flags``." +"com os argumentos ``handle``, ``flags``." #: ../../library/msvcrt.rst:87 msgid "" @@ -167,7 +166,7 @@ msgid "" "argument ``fd``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``msvcrt.get_osfhandle`` " -"com argumento ``fd``." +"com o argumento ``fd``." #: ../../library/msvcrt.rst:96 msgid "Console I/O" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index d4499b8bd..abf1a4741 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -24,16 +24,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/multiprocessing.rst:2 msgid ":mod:`!multiprocessing` --- Process-based parallelism" -msgstr "" +msgstr ":mod:`!multiprocessing` --- Paralelismo baseado em processo" #: ../../library/multiprocessing.rst:7 msgid "**Source code:** :source:`Lib/multiprocessing/`" @@ -67,6 +67,14 @@ msgid "" "module allows the programmer to fully leverage multiple processors on a " "given machine. It runs on both POSIX and Windows." msgstr "" +":mod:`multiprocessing` é um pacote que oferece suporte à invocação de " +"processos utilizando uma API semelhante ao módulo :mod:`threading`. O " +"pacote :mod:`multiprocessing` oferece simultaneamente concorrência local e " +"remota, efetivamente contornando a :term:`trava global do interpretador " +"`, ao utilizar subprocessos ao invés de threads. " +"Devido a isso, o módulo :mod:`multiprocessing` permite ao programador " +"aproveitar totalmente os múltiplos processadores de uma máquina. Ele " +"funciona tanto em POSIX como em Windows." #: ../../library/multiprocessing.rst:25 msgid "" @@ -339,8 +347,8 @@ msgid "" "Without using the lock output from the different processes is liable to get " "all mixed up." msgstr "" -"Sem utilizar a saída do bloqueio dos diferentes processos, é possível que " -"tudo fique confuso." +"Sem utilizar a saída da trava dos diferentes processos, é possível que tudo " +"fique confuso." #: ../../library/multiprocessing.rst:312 msgid "Sharing state between processes" diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 5a39ecc1a..310eb5a69 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/netdata.po b/library/netdata.po index 987ec5c28..03d7f7703 100644 --- a/library/netdata.po +++ b/library/netdata.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/netrc.po b/library/netrc.po index 76c78b9da..9824244b0 100644 --- a/library/netrc.po +++ b/library/netrc.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/netrc.rst:2 msgid ":mod:`!netrc` --- netrc file processing" -msgstr "" +msgstr ":mod:`!netrc` --- Arquivo de processamento netrc" #: ../../library/netrc.rst:10 msgid "**Source code:** :source:`Lib/netrc.py`" diff --git a/library/nis.po b/library/nis.po index 222fcacc0..bda9b2eeb 100644 --- a/library/nis.po +++ b/library/nis.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/nntplib.po b/library/nntplib.po index d3eb12629..2b8e266a3 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/numbers.po b/library/numbers.po index 4b13a84c7..c243828f7 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/numbers.rst:2 msgid ":mod:`!numbers` --- Numeric abstract base classes" -msgstr "" +msgstr ":mod:`!numbers` --- Classes base abstratas numéricas" #: ../../library/numbers.rst:7 msgid "**Source code:** :source:`Lib/numbers.py`" @@ -38,6 +38,10 @@ msgid "" "define more operations. None of the types defined in this module are " "intended to be instantiated." msgstr "" +"O módulo :mod:`!numbers` (:pep:`3141`) define uma hierarquia de :term:" +"`classes base abstratas ` que progressivamente definem " +"mais operações. Nenhum dos tipos definidos neste módulo se destina a ser " +"instanciado." #: ../../library/numbers.rst:18 msgid "" @@ -87,6 +91,8 @@ msgid "" "To :class:`Complex`, :class:`!Real` adds the operations that work on real " "numbers." msgstr "" +"Para :class:`Complex`, :class:`!Real` adiciona as operações que funcionam em " +"números reais." #: ../../library/numbers.rst:51 msgid "" @@ -184,6 +190,11 @@ msgid "" "there. For subtypes of :class:`Integral`, this means that :meth:`~object." "__add__` and :meth:`~object.__radd__` should be defined as::" msgstr "" +"Queremos implementar as operações aritméticas de forma que as operações de " +"modo misto chamem uma implementação cujo autor conhecia os tipos de ambos os " +"argumentos ou convertam ambos para o tipo embutido mais próximo e façam a " +"operação lá. Para subtipos de :class:`Integral`, isso significa que :meth:" +"`~object.__add__` e :meth:`~object.__radd__` devem ser definidos com::" #: ../../library/numbers.rst:157 msgid "" @@ -203,6 +214,7 @@ msgstr "" msgid "" "If ``A`` defines an :meth:`~object.__add__` which accepts ``b``, all is well." msgstr "" +"Se ``A`` define um :meth:`~object.__add__`, que aceita ``b``, está tudo bem." #: ../../library/numbers.rst:166 msgid "" @@ -212,12 +224,19 @@ msgid "" "data:`NotImplemented` from :meth:`!__add__`. (Or ``A`` may not implement :" "meth:`!__add__` at all.)" msgstr "" +"Se ``A`` voltar ao código padrão e tivesse que retornar um valor de :meth:" +"`~object.__add__`, perderíamos a possibilidade de que ``B`` definisse um :" +"meth:`~object.__radd__` mais inteligente, então o código padrão deve " +"retornar :data:`NotImplemented` de :meth:`!__add__`. (Ou ``A`` pode não " +"implementar :meth:`!__add__`.)" #: ../../library/numbers.rst:172 msgid "" "Then ``B``'s :meth:`~object.__radd__` gets a chance. If it accepts ``a``, " "all is well." msgstr "" +"Então, :meth:`~object.__radd__` do ``B`` consegue uma chance. Se ele aceitar " +"``a``, está tudo bem." #: ../../library/numbers.rst:174 msgid "" @@ -244,6 +263,10 @@ msgid "" "class:`complex`, and both :meth:`~object.__radd__` s land there, so ``a+b == " "b+a``." msgstr "" +"Se ``A <: Complex`` e ``B <: Real`` sem compartilhar nenhum outro " +"conhecimento, então a operação compartilhada apropriada é aquela envolvendo " +"a :class:`complex` embutida, e :meth:`~object.__radd__` de ambos chegam lá, " +"de forma que ``a+b == b+a``." #: ../../library/numbers.rst:187 msgid "" diff --git a/library/numeric.po b/library/numeric.po index a68bb07eb..ea12fb4ec 100644 --- a/library/numeric.po +++ b/library/numeric.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/operator.po b/library/operator.po index 00086682f..a8318a113 100644 --- a/library/operator.po +++ b/library/operator.po @@ -20,16 +20,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/operator.rst:2 msgid ":mod:`!operator` --- Standard operators as functions" -msgstr "" +msgstr ":mod:`!operator` --- Operadores padrões como funções" #: ../../library/operator.rst:9 msgid "**Source code:** :source:`Lib/operator.py`" diff --git a/library/optparse.po b/library/optparse.po index 6ce06f3ca..157594d56 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Leticia Portella , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -93,7 +93,7 @@ msgstr "" #: ../../library/optparse.rst:81 msgid "Background" -msgstr "" +msgstr "Contexto" #: ../../library/optparse.rst:83 msgid "" diff --git a/library/os.path.po b/library/os.path.po index 0746eb463..25b19ce16 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/os.path.rst:2 msgid ":mod:`!os.path` --- Common pathname manipulations" -msgstr "" +msgstr ":mod:`!os.path` --- Manipulações comuns de nomes de caminhos" #: ../../library/os.path.rst:7 msgid "" diff --git a/library/os.po b/library/os.po index 60b014695..2e719c297 100644 --- a/library/os.po +++ b/library/os.po @@ -32,16 +32,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/os.rst:2 msgid ":mod:`!os` --- Miscellaneous operating system interfaces" -msgstr "" +msgstr ":mod:`!os` --- Diversas interfaces de sistema operacional" #: ../../library/os.rst:7 msgid "**Source code:** :source:`Lib/os.py`" @@ -61,7 +61,7 @@ msgstr "" "dependentes de sistema operacional. Se você quiser ler ou escrever um " "arquivo, veja :func:`open`; se o que quer é manipular estruturas de " "diretórios, veja o módulo :mod:`os.path`; e se quiser ler todas as linhas, " -"de todos os arquivos, na linha de comando, veja o módulo :mod:`fileinput`. " +"de todos os arquivos na linha de comando, veja o módulo :mod:`fileinput`. " "Para criar arquivos e diretórios temporários, veja o módulo :mod:`tempfile`; " "e, para manipulação em alto nível de arquivos e diretórios, veja o módulo :" "mod:`shutil`." @@ -132,8 +132,8 @@ msgid "" "the case of invalid or inaccessible file names and paths, or other arguments " "that have the correct type, but are not accepted by the operating system." msgstr "" -"Todas as funções neste módulo trazem :exc:`OSError` (ou suas subclasses) no " -"caso de nomes e caminhos de arquivos inválidos ou inacessíveis, ou outros " +"Todas as funções neste módulo levantam :exc:`OSError` (ou suas subclasses) " +"no caso de nomes e caminhos de arquivos inválidos ou inacessíveis, ou outros " "argumentos que possuem o tipo correto, mas não são aceitos pelo sistema " "operacional." @@ -452,7 +452,7 @@ msgid "" "of your home directory (on some platforms), and is equivalent to " "``getenv(\"HOME\")`` in C." msgstr "" -"Um objeto :term:`mapeamento ` onde as chaves e strings que " +"Um objeto :term:`mapeamento` onde as chaves e valores são strings que " "representam o ambiente do processo. Por exemplo, ``environ['HOME']`` é o " "nome do caminho do seu diretório pessoal (em algumas plataformas), e é " "equivalente a ``getenv(\"HOME\")`` em C." @@ -497,7 +497,7 @@ msgid "" "getting, setting, or deleting an item. For example, ``environ['monty'] = " "'python'`` maps the key ``'MONTY'`` to the value ``'python'``." msgstr "" -"No Windows, as teclas são convertidas em maiúsculas. Isso também se aplica " +"No Windows, as chaves são convertidas em maiúsculas. Isso também se aplica " "ao obter, definir ou excluir um item. Por exemplo, ``environ['monty'] = " "'python'`` mapeia a chave ``'MONTY'`` para o valor ``'python'``." @@ -642,9 +642,9 @@ msgid "" msgstr "" "Retorna o valor da variável de ambiente *key* como uma string se existir, ou " "*default* se não existir. *key* é uma string. Note que uma vez que :func:" -"`getenv` utiliza :data:`os.environ`, o mapeamento de :func:`getenv` é " -"capturado de maneira similar na importação, e a função pode não refletir " -"futuras mudanças no ambiente." +"`getenv` utiliza :data:`os.environ`, o mapeamento de :func:`getenv` é também " +"similarmente capturado na importação, e a função pode não refletir futuras " +"mudanças no ambiente." #: ../../library/os.rst:318 msgid "" @@ -664,7 +664,7 @@ msgstr "" #: ../../library/os.rst:4571 ../../library/os.rst:4582 #: ../../library/os.rst:4699 msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`Disponibilidade `: Unix, Windows." +msgstr ":ref:`Disponibilidade`: Unix, Windows." #: ../../library/os.rst:327 msgid "" @@ -677,7 +677,7 @@ msgstr "" "Retorna o valor da variável de ambiente *key* como bytes se existir, ou " "*default* se não existir. *key* deve ser bytes. Note que uma vez que :func:" "`getenvb` utiliza :data:`os.environb`, o mapeamento de :func:`getenvb` é " -"capturado de maneira similar na importação, e a função pode não refletir " +"também similarmente capturado na importação, e a função pode não refletir " "futuras mudanças no ambiente." #: ../../library/os.rst:334 @@ -839,8 +839,8 @@ msgid "" "the same id, which may be already reused by another process." msgstr "" "Retorna o ID do processo pai. Quando o processo pai é encerrado, no Unix, o " -"ID retornado é o do processo init(1); no Windows, ainda é o mesmo ID, que já " -"pode ser reutilizado por outro processo." +"ID retornado é o do processo init (1); no Windows, ainda é o mesmo ID, que " +"pode já estar sendo reutilizado por outro processo." #: ../../library/os.rst:464 msgid "Added support for Windows." @@ -878,8 +878,8 @@ msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " "effective, and saved user ids." msgstr "" -"Retorna uma tupla (ruid, euid, suid) indicando os IDs de usuário reais, " -"efetivos e salvos do processo atual." +"Retorna uma tupla (ruid, euid, suid) indicando os IDs de usuário real, " +"efetivo e salvo do processo atual." #: ../../library/os.rst:519 msgid "" @@ -1375,6 +1375,10 @@ msgid "" "If *offset_src* is ``None``, then *src* is read from the current position; " "respectively for *offset_dst*." msgstr "" +"Copia *count* bytes do descritor de arquivo *src*, começando no deslocamento " +"*offset_src*, para o descritor de arquivo *dst*, começando no deslocamento " +"*offset_dst*. Se *offset_src* for ``None``, *src* será lido a partir da " +"posição atual; respectivamente para *offset_dst*." #: ../../library/os.rst:924 msgid "" @@ -1477,7 +1481,7 @@ msgstr ":ref:`Disponibilidade `: não WASI." #: ../../library/os.rst:976 ../../library/os.rst:1244 msgid "The new file descriptor is now non-inheritable." -msgstr "O novo descritor de arquivo agora é não-herdável." +msgstr "O novo descritor de arquivo agora é não-hereditário." #: ../../library/os.rst:982 msgid "" @@ -1486,9 +1490,10 @@ msgid "" "` by default or non-inheritable if *inheritable* is " "``False``." msgstr "" -"Duplica o descritor de arquivo *fd* como *fd2*, fechando o último primeiro, " -"se necessário. Retorna *fd2*. O novo descritor de arquivo é :ref:`herdável " -"` por padrão ou não-herdável se *inheritable* for ``False``." +"Duplica o descritor de arquivo *fd* como *fd2*, fechando o último antes " +"disso, se necessário. Retorna *fd2*. O novo descritor de arquivo é :ref:" +"`herdável ` por padrão ou não-herdável se *inheritable* for " +"``False``." #: ../../library/os.rst:989 msgid "Add the optional *inheritable* parameter." @@ -1535,9 +1540,9 @@ msgid "" "and *gid*. To leave one of the ids unchanged, set it to -1. See :func:" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -"Altera o o ID do proprietário e do grupo do arquivo dado por *fd* para o " -"*uid* e *gid* numérico. Para deixar um dos IDs inalteradas, defina-o como " -"-1. Veja :func:`chown`. A partir do Python 3.3, isto é equivalente a ``os." +"Altera o ID do proprietário e do grupo do arquivo dado por *fd* para o *uid* " +"e *gid* numérico. Para deixar um dos IDs inalteradas, defina-o como -1. " +"Veja :func:`chown`. A partir do Python 3.3, isto é equivalente a ``os." "chown(fd, uid, gid)``." #: ../../library/os.rst:1017 ../../library/os.rst:2091 @@ -1554,7 +1559,7 @@ msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -"Força a gravação de arquivo com descritor de arquivo *fd* no disco. Não " +"Força a gravação do arquivo com descritor de arquivo *fd* no disco. Não " "força a atualização de metadados." #: ../../library/os.rst:1033 @@ -1587,15 +1592,15 @@ msgid "" "included in ``pathconf_names``, an :exc:`OSError` is raised with :const:" "`errno.EINVAL` for the error number." msgstr "" -"Se *name* for uma string e não for conhecida, exceção :exc:`ValueError` é " -"levantada. Se um valor específico para *name* não for compatível com o " +"Se *name* for uma string e não for conhecida, uma exceção :exc:`ValueError` " +"é levantada. Se um valor específico para *name* não for compatível com o " "sistema hospedeiro, mesmo que seja incluído no ``pathconf_names``, uma " "exceção :exc:`OSError` é levantada com :const:`errno.EINVAL` como número do " "erro." #: ../../library/os.rst:1051 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." -msgstr "Assim como no Python 3.3, é equivalente a ``os.pathconf(fd, name)``." +msgstr "A partir do Python 3.3, é equivalente a ``os.pathconf(fd, name)``." #: ../../library/os.rst:1058 msgid "" @@ -1607,7 +1612,7 @@ msgstr "" #: ../../library/os.rst:1061 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." -msgstr "Assim como no Python 3.3, é equivalente a ``os.stat(fd)``." +msgstr "A partir do Python 3.3, é equivalente a ``os.stat(fd)``." #: ../../library/os.rst:1065 ../../library/os.rst:2326 msgid "The :func:`.stat` function." @@ -1702,10 +1707,10 @@ msgid "" "`F_LOCK`, :data:`F_TLOCK`, :data:`F_ULOCK` or :data:`F_TEST`. *len* " "specifies the section of the file to lock." msgstr "" -"Aplica, testa ou remove um bloqueio POSIX em um descritor de arquivo aberto. " +"Aplica, testa ou remove uma trava POSIX em um descritor de arquivo aberto. " "*fd* é um descritor de arquivo aberto. *cmd* especifica o comando a ser " "usado - um dentre :data:`F_LOCK`, :data:`F_TLOCK`, :data:`F_ULOCK` ou :data:" -"`F_TEST`. *len* especifica a seção do arquivo a ser bloqueada." +"`F_TEST`. *len* especifica a seção do arquivo para travar." #: ../../library/os.rst:1136 msgid "" @@ -1717,7 +1722,7 @@ msgstr "" #: ../../library/os.rst:1148 msgid "Flags that specify what action :func:`lockf` will take." -msgstr "Sinalizadores que especificam qual ação :func:`lockf` vai acontecer." +msgstr "Sinalizadores que especificam qual ação :func:`lockf` vai executar." #: ../../library/os.rst:1157 msgid "" @@ -1863,9 +1868,9 @@ msgid "" "value is first masked out. Return the file descriptor for the newly opened " "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -"Abre o arquivo *path* e define várias sinalizadores de acordo com *flags* e, " +"Abre o arquivo *path* e define vários sinalizadores de acordo com *flags* e, " "possivelmente, seu modo, de acordo com *mode*. Ao computar *mode*, o valor " -"atual de umask é iniciar com máscara. Retorna o descritor de arquivo para o " +"atual de umask é primeiro mascarado. Retorna o descritor de arquivo para o " "arquivo recém-aberto. O novo descritor de arquivo é :ref:`não-herdável " "`." @@ -1877,17 +1882,17 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" "Para ler uma descrição dos valores de sinalizadores e modos, veja a " -"documentação de tempo de execução de C; constantes de sinalizador (como :" -"const:`O_RDONLY` e :const:`O_WRONLY`) são definidas no módulo :mod:`os`. Em " -"particular, no Windows é necessário adicionar :const:`O_BINARY` para abrir " -"arquivos em modo binário." +"documentação de C; constantes de sinalizador (como :const:`O_RDONLY` e :" +"const:`O_WRONLY`) são definidas no módulo :mod:`os`. Em particular, no " +"Windows é necessário adicionar :const:`O_BINARY` para abrir arquivos em modo " +"binário." #: ../../library/os.rst:1239 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -"Esta função pode suportar :ref:`caminhos relativos aos descritores de " +"Esta função oferece suporte para :ref:`caminhos relativos aos descritores de " "diretório ` com o parâmetro *dir_fd*." #: ../../library/os.rst:1242 @@ -1959,9 +1964,9 @@ msgid "" "on Windows." msgstr "" "As seguintes constantes são opções para o parâmetro *flags* da função :func:" -"`~os.open`. Elas podem ser combinadas usando o operador bit a bit OR ``|``. " +"`~os.open`. Elas podem ser combinadas usando o operador bit a bit OU ``|``. " "Algumas delas não estão disponíveis em todas as plataformas. Para obter " -"descrições de sua disponibilidade e uso, consulte a página do manual :" +"descrições de sua disponibilidade e uso, consulte a página de manual :" "manpage:`open(2)` para Unix ou `o MSDN `_ para Windows." @@ -2006,8 +2011,8 @@ msgid "" "Add :data:`O_PATH` on systems that support it. Add :data:`O_TMPFILE`, only " "available on Linux Kernel 3.11 or newer." msgstr "" -"Adicionada :data:`O_PATH` em sistemas que suportam. Adicionada :data:" -"`O_TMPFILE`, só está disponível no kernel Linux 3.11 ou mais recente." +"Adicionada :data:`O_PATH` em sistemas que oferecem suporte. Adicionada :data:" +"`O_TMPFILE`, somente disponível no kernel Linux 3.11 ou mais recente." #: ../../library/os.rst:1340 msgid "" @@ -2018,8 +2023,8 @@ msgid "" msgstr "" "Abre um novo par de pseudo-terminal. Retorna um par de descritores de " "arquivos ``(master, slave)`` para o pty e o tty, respectivamente. Os novos " -"descritores de arquivos são :ref:`non-herdáveis `. Para uma " -"abordagem (ligeiramente) mais portátil, use o módulo :mod:`pty`." +"descritores de arquivos são :ref:`não-herdáveis `. Para uma " +"abordagem (ligeiramente) mais portável, use o módulo :mod:`pty`." #: ../../library/os.rst:1347 ../../library/os.rst:1359 msgid "The new file descriptors are now non-inheritable." @@ -2043,9 +2048,10 @@ msgid "" "and writing, respectively." msgstr "" "Cria um encadeamento (pipe) com *flags* definidos atomicamente. *flags* " -"podem ser construídos por ORing junto a um ou mais destes valores: :data:" -"`O_NONBLOCK`, :data:`O_CLOEXEC`. Retorna um par de descritores de arquivos " -"``(r, w)`` utilizáveis para leitura e gravação, respectivamente." +"podem ser construídos por aplicação de OU junto a um ou mais destes " +"valores: :data:`O_NONBLOCK`, :data:`O_CLOEXEC`. Retorna um par de " +"descritores de arquivos ``(r, w)`` utilizáveis para leitura e gravação, " +"respectivamente." #: ../../library/os.rst:1378 msgid "" @@ -2171,8 +2177,7 @@ msgid "" msgstr "" "Não aguarda por dados que não estão disponíveis imediatamente. Se esse " "sinalizador for especificado, a chamada do sistema retorna instantaneamente " -"se for necessário ler dados do armazenamento de backup ou aguardar um " -"bloqueio." +"se for necessário ler dados do armazenamento de backup ou aguardar uma trava." #: ../../library/os.rst:1463 msgid "" @@ -2261,7 +2266,7 @@ msgid "" "Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -"Fornece um equivalente, por gravação, do sinalizador :data:`O_DSYNC` da " +"Fornece um equivalente para gravação do sinalizador :data:`O_DSYNC` da " "função :func:`os.open`. Este efeito de sinalizador se aplica apenas ao " "intervalo de dados escrito pela chamada de sistema." @@ -2274,7 +2279,7 @@ msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -"Fornece um equivalente, por gravação, do sinalizador :data:`O_SYNC` da " +"Fornece um equivalente para gravação do sinalizador :data:`O_SYNC` da " "função :func:`os.open`. Este efeito de sinalizador se aplica apenas ao " "intervalo de dados escrito pela chamada de sistema." @@ -2287,7 +2292,7 @@ msgid "" "of the file. However, if the *offset* argument is ``-1``, the current file " "*offset* is updated." msgstr "" -"Fornece um equivalente, por gravação, do sinalizador :data:`O_APPEND` da " +"Fornece um equivalente para gravação do sinalizador :data:`O_APPEND` da " "função :func:`os.open`. Esse sinalizador é significante apenas para :func:" "`os.pwritev`, e seu efeito se aplica apenas ao intervalo de dados escrito " "pela chamada de sistema. O argumento *offset* não afeta a operação de " @@ -2331,7 +2336,7 @@ msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -"A primeira notação da função é suportada por todas as plataformas que " +"A primeira notação da função está disponível por todas as plataformas que " "definem :func:`sendfile`." #: ../../library/os.rst:1592 @@ -2432,6 +2437,15 @@ msgid "" "in the same filesystem, otherwise an :exc:`OSError` is raised with :attr:" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" +"Transfere *count* bytes do descritor de arquivo *src*, começando do " +"*offset_src*, para o descritor de arquivo *dst*, começando do *offset_dst*. " +"Pelo menos um dos descritores de arquivo deve se referir a um encadeamento. " +"Se *offset_src* é ``None``, então *src* é lido a partir da posição atual; o " +"mesmo para *offset_dst*. O deslocamento associado a um descritor de arquivo " +"que se refere a um encadeamento deve ser ``None``. Os arquivos apontados por " +"*src* e *dst* devem residir no mesmo sistema de arquivos, de outra forma " +"uma :exc:`OSError` é levantada com :attr:`~OSError.errno` definido para :" +"const:`errno.EXDEV`." #: ../../library/os.rst:1673 msgid "" @@ -2508,7 +2522,7 @@ msgstr "" #: ../../library/os.rst:1740 msgid "Write the bytestring in *str* to file descriptor *fd*." -msgstr "Escreve a bytestring em *str* no descritor de arquivo *fd*." +msgstr "Escreve a string de bytes em *str* no descritor de arquivo *fd*." #: ../../library/os.rst:1746 msgid "" @@ -2603,9 +2617,9 @@ msgid "" "descriptors created by Python are non-inheritable by default." msgstr "" "Um descritor de arquivo tem um sinalizador \"herdável\" que indica se o " -"descritor de arquivo pode ser herdado por processos filho. Desde o Python " -"3.4, os descritores de arquivo criados pelo Python não são herdáveis por " -"padrão." +"descritor de arquivo pode ser herdado por processos filho. A partir do " +"Python 3.4, os descritores de arquivo criados pelo Python não são herdáveis " +"por padrão." #: ../../library/os.rst:1823 msgid "" @@ -3210,8 +3224,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.link`` com argumentos " -"``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." +"Levanta um :ref:`evento de auditoria ` ``os.link`` com os " +"argumentos ``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." #: ../../library/os.rst:2197 msgid ":ref:`Availability `: Unix, Windows, not Emscripten." @@ -3327,8 +3341,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.listdrives`` com " -"nenhum argumento." +"Levanta um :ref:`evento de auditoria ` ``os.listdrives`` sem " +"argumentos." #: ../../library/os.rst:2260 ../../library/os.rst:2284 #: ../../library/os.rst:2304 @@ -3406,8 +3420,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.listvolumes`` com " -"nenhum argumento." +"Levanta um :ref:`evento de auditoria ` ``os.listvolumes`` sem " +"argumentos." #: ../../library/os.rst:2311 msgid "" @@ -3496,6 +3510,10 @@ msgid "" "control to the new directory such that only the current user and " "administrators have access. Other values of *mode* are ignored." msgstr "" +"No Windows, um modo *mode* de ``0o700`` é tratado especificamente para " +"aplicar controle de acesso ao novo diretório de forma que apenas o usuário " +"atual e os administradores tenham acesso. Outros valores de *mode* são " +"ignorados." #: ../../library/os.rst:2366 msgid "" @@ -3515,7 +3533,7 @@ msgstr "" #: ../../library/os.rst:2377 msgid "Windows now handles a *mode* of ``0o700``." -msgstr "" +msgstr "O Windows agora lida com um *mode* de ``0o700``." #: ../../library/os.rst:2387 msgid "" @@ -3781,7 +3799,7 @@ msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.remove`` com " +"Levanta um :ref:`evento de auditoria ` ``os.remove`` com os " "argumentos ``path``, ``dir_fd``." #: ../../library/os.rst:2586 @@ -3849,9 +3867,8 @@ msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -"Esta função pode implementar a especificação de *src_dir_fd* e/ou " -"*dst_dir_fd* para fornecer :ref:`caminhos relativos a descritores de " -"diretório `." +"Esta função permite especificar *src_dir_fd* e/ou *dst_dir_fd* para " +"fornecer :ref:`caminhos relativos a descritores de diretório `." #: ../../library/os.rst:2622 msgid "" @@ -3866,7 +3883,7 @@ msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.rename`` com " +"Levanta um :ref:`evento de auditoria ` ``os.rename`` com os " "argumentos ``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." #: ../../library/os.rst:2626 @@ -3931,8 +3948,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.rmdir`` com argumentos " -"``path``, ``dir_fd``." +"Levanta um :ref:`evento de auditoria ` ``os.rmdir`` com os " +"argumentos ``path``, ``dir_fd``." #: ../../library/os.rst:2691 msgid "" @@ -3969,7 +3986,7 @@ msgstr "" "realizar uma chamada de sistema, mas :func:`~os.DirEntry.is_dir` e :func:" "`~os.DirEntry.is_file` normalmente requerem apenas uma chamada de sistema " "para links simbólicos; :func:`os.DirEntry.stat` sempre requer uma chamada de " -"sistema no Unix, mas requer apenas uma para links simbólicos no Windows." +"sistema no Unix, mas requer uma apenas para links simbólicos no Windows." #: ../../library/os.rst:2708 msgid "" @@ -4388,8 +4405,8 @@ msgid "" "future ``st_ctime`` may be changed to return zero or the metadata change " "time, if available." msgstr "" -"O atributo ``st_ctime`` de um resultado estatístico foi descontinuado no " -"Windows. A hora de criação do arquivo está devidamente disponível como " +"O atributo ``st_ctime`` do resultado de stat foi descontinuado no Windows. A " +"hora de criação do arquivo está devidamente disponível como " "``st_birthtime``, e no futuro ``st_ctime`` pode ser alterada para retornar " "zero ou a hora de alteração dos metadados, se disponível." @@ -4555,15 +4572,15 @@ msgstr "Registros de data e hora:" #: ../../library/os.rst:3035 msgid "Time of most recent access expressed in seconds." -msgstr "Hora do acesso mais recente expresso em segundos." +msgstr "Hora do acesso mais recente expressa em segundos." #: ../../library/os.rst:3039 msgid "Time of most recent content modification expressed in seconds." -msgstr "Hora da modificação de conteúdo mais recente expresso em segundos." +msgstr "Hora da modificação de conteúdo mais recente expressa em segundos." #: ../../library/os.rst:3043 msgid "Time of most recent metadata change expressed in seconds." -msgstr "Hora da alteração de metadados mais recente expresso em segundos." +msgstr "Hora da alteração de metadados mais recente expressa em segundos." #: ../../library/os.rst:3045 msgid "" @@ -4610,7 +4627,7 @@ msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -"Hora de criação do arquivo expresso em segundos. Este atributo nem sempre " +"Hora de criação do arquivo expressa em segundos. Este atributo nem sempre " "está disponível e pode levantar :exc:`AttributeError`." #: ../../library/os.rst:3080 @@ -4622,7 +4639,7 @@ msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -"Hora de criação do arquivo expresso em nanossegundos em um inteiro. Este " +"Hora de criação do arquivo expressa em nanossegundos em um inteiro. Este " "atributo nem sempre está disponível e pode levantar :exc:`AttributeError`." #: ../../library/os.rst:3093 @@ -4878,11 +4895,11 @@ msgid "" "only, and if :const:`ST_NOSUID` is set, the semantics of setuid/setgid bits " "are disabled or not supported." msgstr "" -"Duas constantes de nível de módulo são definidas para os sinalizadores de " +"Duas constantes em nível de módulo são definidas para os sinalizadores de " "bit do atributo :attr:`f_flag`: se :const:`ST_RDONLY` estiver definido, o " "sistema de arquivos é montado somente leitura, e se :const:`ST_NOSUID` " "estiver definido, a semântica dos bits setuid/setgid é desabilitada ou não é " -"suportada." +"implementada." #: ../../library/os.rst:3237 msgid "" @@ -4900,13 +4917,13 @@ msgstr "" "baseados em GNU/glibc. São elas :const:`ST_NODEV` (impede o acesso aos " "arquivos especiais do dispositivo), :const:`ST_NOEXEC` (não permite a " "execução do programa), :const:`ST_SYNCHRONOUS` (as escritas são " -"sincronizadas de uma vez), :const:`ST_MANDLOCK` (permitir bloqueios " -"obrigatórios em um sistema de arquivos), :const:`ST_WRITE` (escrever no " -"arquivo/diretório/symlink), :const:`ST_APPEND` (arquivo somente anexado), :" -"const:`ST_IMMUTABLE` (arquivo imutável), :const:`ST_NOATIME` (não atualiza " -"os tempos de acesso), :const:`ST_NODIRATIME` (não atualiza os tempos de " -"acesso ao diretório), :const:`ST_RELATIME` (atualiza o atime relativo ao " -"mtime/ctime)." +"sincronizadas de uma vez), :const:`ST_MANDLOCK` (permitir travas " +"obrigatórias em um sistema de arquivos), :const:`ST_WRITE` (escrever no " +"arquivo/diretório/link simbólico), :const:`ST_APPEND` (arquivo somente " +"anexado), :const:`ST_IMMUTABLE` (arquivo imutável), :const:`ST_NOATIME` (não " +"atualiza os tempos de acesso), :const:`ST_NODIRATIME` (não atualiza os " +"tempos de acesso ao diretório), :const:`ST_RELATIME` (atualiza o atime " +"relativo ao mtime/ctime)." #: ../../library/os.rst:3250 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." @@ -5112,8 +5129,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.symlink`` com " -"argumentos ``src``, ``dst``, ``dir_fd``." +"Levanta um :ref:`evento de auditoria ` ``os.symlink`` com os " +"argumentos ``src``, ``dst`` e ``dir_fd``." #: ../../library/os.rst:3390 msgid "" @@ -5147,7 +5164,7 @@ msgid "" "``path``, ``length``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``os.truncate`` com os " -"argumentos ``path``, ``length``." +"argumentos ``path`` e ``length``." #: ../../library/os.rst:3432 msgid "" @@ -5225,7 +5242,7 @@ msgid "" "``path``, ``times``, ``ns``, ``dir_fd``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``os.utime`` com os " -"argumentos ``path``, ``times``, ``ns``, ``dir_fd``." +"argumentos ``path``, ``times``, ``ns`` e ``dir_fd``." #: ../../library/os.rst:3478 msgid "" @@ -5383,8 +5400,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.walk`` com argumentos " -"``top``, ``topdown``, ``onerror``, ``followlinks``." +"Levanta um :ref:`evento de auditoria ` ``os.walk`` com os " +"argumentos ``top``, ``topdown``, ``onerror`` e ``followlinks``." #: ../../library/os.rst:3577 msgid "" @@ -5446,8 +5463,9 @@ msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.fwalk`` com argumentos " -"``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." +"Levanta um :ref:`evento de auditoria ` ``os.fwalk`` com os " +"argumentos ``top``, ``topdown``, ``onerror``, ``follow_symlinks`` e " +"``dir_fd``." #: ../../library/os.rst:3645 msgid "Added support for :class:`bytes` paths." @@ -5462,8 +5480,8 @@ msgid "" msgstr "" "Cria um arquivo anônimo e retorna um descritor de arquivo que faça " "referência a ele. *flags* deve ser uma das constantes ``os.MFD_*`` " -"disponíveis no sistema (ou uma combinação ORed bit a bit delas). Por padrão, " -"o novo descritor de arquivo é :ref:`não herdável `." +"disponíveis no sistema (ou uma combinação de OU bit a bit delas). Por " +"padrão, o novo descritor de arquivo é :ref:`não herdável `." #: ../../library/os.rst:3656 msgid "" @@ -5488,7 +5506,7 @@ msgstr "" #: ../../library/os.rst:3686 msgid "These flags can be passed to :func:`memfd_create`." -msgstr "Essss sinalizadores podem ser passados para :func:`memfd_create`." +msgstr "Esses sinalizadores podem ser passados para :func:`memfd_create`." #: ../../library/os.rst:3688 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" @@ -5509,10 +5527,10 @@ msgid "" "ref:`non-inheritable `." msgstr "" "Cria e retorna um descritor de arquivo de evento. Os descritores de arquivo " -"suportam :func:`read` e :func:`write` brutos com um tamanho de buffer de 8, :" -"func:`~select.select`, :func:`~select.poll` e similares. Veja a página man :" -"manpage:`eventfd(2)` para mais informações. Por padrão, o novo descritor de " -"arquivo é :ref:`não herdável `." +"implementam :func:`read` e :func:`write` brutos com um tamanho de buffer de " +"8, :func:`~select.select`, :func:`~select.poll` e similares. Veja a página " +"man :manpage:`eventfd(2)` para mais informações. Por padrão, o novo " +"descritor de arquivo é :ref:`não herdável `." #: ../../library/os.rst:3703 msgid "" @@ -5539,7 +5557,7 @@ msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -"Se :const:`EFD_SEMAPHORE` for especificada e o contador de evento for " +"Se :const:`EFD_SEMAPHORE` for especificado e o contador de evento for " "diferente de zero, :func:`eventfd_read` retorna 1 e decrementa o contador em " "um." @@ -5602,7 +5620,7 @@ msgstr "" msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" "Define sinalizador close-on-exec para o novo descritor de arquivo :func:" -"`eventfd`" +"`eventfd`." #: ../../library/os.rst:3774 msgid "" @@ -5649,7 +5667,7 @@ msgid "" "``path``, ``attribute``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``os.getxattr`` com os " -"argumentos ``path``, ``attribute``." +"argumentos ``path`` e ``attribute``." #: ../../library/os.rst:3810 ../../library/os.rst:3842 #: ../../library/os.rst:3867 @@ -5693,8 +5711,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.removexattr`` com o " -"argumento ``path``, ``attribute``." +"Levanta um :ref:`evento de auditoria ` ``os.removexattr`` com os " +"argumentos ``path`` e ``attribute``." #: ../../library/os.rst:3848 msgid "" @@ -5731,7 +5749,7 @@ msgid "" "``path``, ``attribute``, ``value``, ``flags``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``os.setxattr`` com os " -"argumentos ``path``, ``attribute``, ``value``, ``flags``." +"argumentos ``path``, ``attribute``, ``value`` e ``flags``." #: ../../library/os.rst:3873 msgid "" @@ -5775,8 +5793,8 @@ msgid "" "``os.execv('/bin/echo', ['foo', 'bar'])`` will only print ``bar`` on " "standard output; ``foo`` will seem to be ignored." msgstr "" -"As várias funções :func:`exec\\* ` pegam uma lista de argumentos para " -"o novo programa carregado no processo. Em cada caso, o primeiro desses " +"As várias funções :func:`exec\\* ` recebem uma lista de argumentos " +"para o novo programa carregado no processo. Em cada caso, o primeiro desses " "argumentos é passado para o novo programa como seu próprio nome, e não como " "um argumento que um usuário pode ter digitado em uma linha de comando. Para " "o programador C, este é o ``argv[0]`` passado para um programa :c:func:" @@ -5835,7 +5853,7 @@ msgid "" "argument ``path``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``os.add_dll_directory`` " -"com argumento ``path``." +"com o argumento ``path``." #: ../../library/os.rst:3933 msgid "" @@ -5868,7 +5886,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" "Todas essas funções executam um novo programa, substituindo o processo " -"atual; eles não voltam. No Unix, o novo executável é carregado no processo " +"atual; elas não retornam. No Unix, o novo executável é carregado no processo " "atual e terá a mesma identificação de processo do chamador. Os erros serão " "relatados como exceções de :exc:`OSError`." @@ -5924,7 +5942,7 @@ msgstr "" "envvar:`PATH` para localizar o programa *file*. Quando o ambiente está sendo " "substituído (usando uma das variantes :func:`exec\\*e `, discutidas " "no próximo parágrafo), o novo ambiente é usado como fonte da variável :" -"envvar:`PATH` As outras variantes, :func:`execl`, :func:`execle`, :func:" +"envvar:`PATH`. As outras variantes, :func:`execl`, :func:`execle`, :func:" "`execv` e :func:`execve`, não usarão a variável :envvar:`PATH` para " "localizar o executável; *path* deve conter um caminho absoluto ou relativo " "apropriado. Caminhos relativos devem incluir pelo menos uma barra, mesmo no " @@ -5965,8 +5983,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.exec`` com argumentos " -"``path``, ``args``, ``env``." +"Levanta um :ref:`evento de auditoria ` ``os.exec`` com os " +"argumentos ``path``, ``args`` e ``env``." #: ../../library/os.rst:4002 msgid "" @@ -5982,14 +6000,14 @@ msgid "" "stdio buffers, etc." msgstr "" "Sai do processo com status *n*, sem chamar manipuladores de limpeza, " -"liberando buffers de stdio etc." +"liberando buffers de entrada e saída padrões etc." #: ../../library/os.rst:4016 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -"A forma padrão de sair é :func:`sys.exit(n) . :func:`!_exit` " +"A forma padrão de sair é :func:`sys.exit(n) `. :func:`!_exit` " "normalmente só deve ser usado no processo filho após uma função :func:`fork`." #: ../../library/os.rst:4019 @@ -6011,8 +6029,8 @@ msgid "" "underlying platform." msgstr "" "Alguns deles podem não estar disponíveis em todas as plataformas Unix, pois " -"há algumas variações. Essas constantes são definidas onde são definidas pela " -"plataforma subjacente." +"há algumas variações. Essas constantes estão definidas onde elas são " +"definidas pela plataforma subjacente." #: ../../library/os.rst:4032 msgid "" @@ -6066,7 +6084,7 @@ msgid "" "inability to fork or create a pipe." msgstr "" "Código de saída que significa que um erro do sistema operacional foi " -"detectado, como a incapacidade de fazer fork ou criar um encadeamento." +"detectado, como a incapacidade de criar um fork ou um encadeamento." #: ../../library/os.rst:4098 msgid "" @@ -6131,8 +6149,8 @@ msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -"Faz um fork de um processo filho. Retorna ``0`` no filho e o ID de processo " -"do filho no pai. Se ocorrer um erro, uma :exc:`OSError` é levantada." +"Cria um processo filho. Retorna ``0`` no filho e o ID de processo do filho " +"no pai. Se ocorrer um erro, uma exceção :exc:`OSError` é levantada." #: ../../library/os.rst:4162 msgid "" @@ -6146,8 +6164,7 @@ msgstr "" msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.fork`` com nenhum " -"argumento." +"Levanta um :ref:`evento de auditoria ` ``os.fork`` sem argumentos." #: ../../library/os.rst:4169 msgid "" @@ -6155,14 +6172,14 @@ msgid "" "in the :mod:`ssl` documentation." msgstr "" "Se você usa soquetes TLS em um aplicação chamando ``fork()``, consulte " -"alerta na documentação :mod:`ssl`." +"alerta na documentação do módulo :mod:`ssl`." #: ../../library/os.rst:4174 ../../library/os.rst:4218 msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -"No macOS, o uso desta função é inseguro quando misturado com o uso de APIs " +"No macOS, o uso desta função é inseguro quando combinado com o uso de APIs " "de sistema de nível superior, e isso inclui o uso de :mod:`urllib.request`." #: ../../library/os.rst:4177 @@ -6170,7 +6187,7 @@ msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -"Chamar ``fork()`` em um subinterpretador não é mais suportado (:exc:" +"Chamar ``fork()`` em um subinterpretador não é mais possível (:exc:" "`RuntimeError` é levantada)." #: ../../library/os.rst:4181 @@ -6178,8 +6195,8 @@ msgid "" "If Python is able to detect that your process has multiple threads, :func:" "`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" -"Se o Python for capaz de detectar que o seu processar tem vários threads, o :" -"func:`os.fork` agora levanta um :exc:`DeprecationWarning`." +"Se o Python for capaz de detectar que o seu processar tem várias threads, o :" +"func:`os.fork` agora levanta uma exceção :exc:`DeprecationWarning`." #: ../../library/os.rst:4185 msgid "" @@ -6192,12 +6209,12 @@ msgid "" "``free``)." msgstr "" "Optamos por apresentar isso como um alerta, quando detectável, para informar " -"melhor os desenvolvedores sobre um problema de design que a plataforma POSIX " -"observa especificamente como não suportado. Mesmo em códigos que *aparentem* " -"funcionar, nunca foi seguro misturar threading com :func:`os.fork` em " -"plataformas POSIX. O próprio tempo de execução do CPython sempre fez " -"chamadas API que não são seguras para uso no filho processar quando existiam " -"threads no pai (como ``malloc`` e ``free``)." +"melhor aos desenvolvedores sobre um problema de design que a plataforma " +"POSIX indica especificamente como sem suporte. Mesmo em códigos que " +"*aparentem* funcionar, nunca foi seguro misturar threading com :func:`os." +"fork` em plataformas POSIX. O próprio ambiente de execução do CPython sempre " +"fez chamadas à API que não são seguras para uso no processo filho quando " +"existiam threads no pai (como ``malloc`` e ``free``)." #: ../../library/os.rst:4194 msgid "" @@ -6216,10 +6233,10 @@ msgid "" "discuss.python.org/t/33555>`_ for technical details of why we're surfacing " "this longstanding platform compatibility problem to developers." msgstr "" -"Consulte `esta discussão sobre a incompatibilidade do fazer um fork com " -"threads `_ para obter detalhes técnicos " -"sobre o motivo pelo qual estamos revelando esse problema de longa data da " -"plataforma compatibilidade aos desenvolvedores." +"Consulte `esta discussão sobre fork ser incompatível com threads `_ para obter detalhes técnicos sobre o motivo " +"pelo qual estamos revelando aos desenvolvedores esse problema de longa data " +"de compatibilidade da plataforma." #: ../../library/os.rst:4203 ../../library/os.rst:4450 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." @@ -6234,26 +6251,25 @@ msgid "" "the master end of the pseudo-terminal. For a more portable approach, use " "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -"Faz um fork de um processo filho, usando um novo pseudoterminal como o " -"terminal de controle do filho. Retorna um par de ``(pid, fd)``, onde *pid* é " -"``0`` no filho, o novo ID de processo do filho no pai e *fd* é o descritor " -"de arquivo do lado mestre do pseudoterminal. Para uma abordagem mais " -"portátil, use o módulo :mod:`pty`. Se ocorrer um erro, :exc:`OSError` é " -"levantada." +"Cria um processo filho, usando um novo pseudoterminal como o terminal de " +"controle do filho. Retorna um par de ``(pid, fd)``, onde *pid* é ``0`` no " +"filho, o novo ID de processo do filho no pai e *fd* é o descritor de arquivo " +"do lado mestre do pseudoterminal. Para uma abordagem mais portátil, use o " +"módulo :mod:`pty`. Se ocorrer um erro, :exc:`OSError` é levantada." #: ../../library/os.rst:4214 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.forkpty`` com nenhum " -"argumento." +"Levanta um :ref:`evento de auditoria ` ``os.forkpty`` sem " +"argumentos." #: ../../library/os.rst:4221 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -"Chamar ``forkpty()`` em um subinterpretador não é mais suportado (:exc:" +"Chamar ``forkpty()`` em um subinterpretador não é mais permitido (:exc:" "`RuntimeError` é levantada)." #: ../../library/os.rst:4225 @@ -6262,9 +6278,9 @@ msgid "" "raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." "fork`." msgstr "" -"Se o Python for capaz de detectar que o seu processar tem vários threads, " -"isso agora levanta um :exc:`DeprecationWarning`. Veja a explicação mais " -"longa em :func:`os.fork`." +"Se o Python for capaz de detectar que o seu processo tem vários threads, " +"isso agora levanta uma exceção :exc:`DeprecationWarning`. Veja a explicação " +"mais longa em :func:`os.fork`." #: ../../library/os.rst:4239 msgid "" @@ -6284,13 +6300,13 @@ msgid "" "be set to *sig*. The Windows version of :func:`kill` additionally takes " "process handles to be killed." msgstr "" -"Windows: Os sinais :const:`signal.CTRL_C_EVENT` e :const:`signal." +"Windows: os sinais :const:`signal.CTRL_C_EVENT` e :const:`signal." "CTRL_BREAK_EVENT` são sinais especiais que só podem ser enviados para " "processos de console que compartilham uma janela de console comum, por " "exemplo, alguns subprocessos. Qualquer outro valor para *sig* fará com que o " "processo seja encerrado incondicionalmente pela API TerminateProcess e o " "código de saída será definido como *sig*. A versão Windows de :func:`kill` " -"adicionalmente leva identificadores de processo para ser morto." +"também recebe os identificadores de processo a serem eliminados." #: ../../library/os.rst:4250 msgid "See also :func:`signal.pthread_kill`." @@ -6301,8 +6317,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.kill`` com argumentos " -"``pid``, ``sig``." +"Levanta um :ref:`evento de auditoria ` ``os.kill`` com os " +"argumentos ``pid`` e ``sig``." #: ../../library/os.rst:4266 msgid "Send the signal *sig* to the process group *pgid*." @@ -6313,8 +6329,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.killpg`` com " -"argumentos ``pgid``, ``sig``." +"Levanta um :ref:`evento de auditoria ` ``os.killpg`` com os " +"argumentos ``pgid`` e ``sig``." #: ../../library/os.rst:4275 msgid "" @@ -6363,8 +6379,8 @@ msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -"Bloqueia os segmentos do programa na memória. O valor de *op* (definido em " -"````) determina quais segmentos estão bloqueados." +"Trava os segmentos do programa na memória. O valor de *op* (definido em " +"````) determina quais segmentos são travados." #: ../../library/os.rst:4312 msgid "" @@ -6537,10 +6553,10 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" "O argumento *setpgroup* definirá o grupo de processos do filho para o valor " -"especificado. Se o valor especificado for 0, o ID do grupo de processo da " -"criança será igual ao seu ID de processo. Se o valor de *setpgroup* não for " -"definido, o filho herdará o ID do grupo de processos do pai. Este argumento " -"corresponde ao sinalizador :c:macro:`!POSIX_SPAWN_SETPGROUP` da biblioteca C." +"especificado. Se o valor especificado for 0, o ID do grupo de processo filho " +"será igual ao ID do processo. Se o valor de *setpgroup* não for definido, o " +"filho herdará o ID do grupo de processos do pai. Este argumento corresponde " +"ao sinalizador :c:macro:`!POSIX_SPAWN_SETPGROUP` da biblioteca C." #: ../../library/os.rst:4401 msgid "" @@ -6605,18 +6621,18 @@ msgid "" msgstr "" "O argumento *scheduler* deve ser uma tupla contendo a política do agendador " "(opcional) e uma instância de :class:`sched_param` com os parâmetros do " -"agendador. Um valor ``None`` no lugar da política do planejador indica que " -"não está sendo fornecido. Este argumento é uma combinação dos sinalizadores :" -"c:macro:`!POSIX_SPAWN_SETSCHEDPARAM` e :c:macro:`!POSIX_SPAWN_SETSCHEDULER` " -"da biblioteca C." +"agendador. Um valor ``None`` no lugar da política do agendador indica que a " +"política não está sendo fornecido. Este argumento é uma combinação dos " +"sinalizadores :c:macro:`!POSIX_SPAWN_SETSCHEDPARAM` e :c:macro:`!" +"POSIX_SPAWN_SETSCHEDULER` da biblioteca C." #: ../../library/os.rst:4430 ../../library/os.rst:4446 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.posix_spawn`` com " -"argumentos ``path``, ``argv``, ``env``." +"Levanta um :ref:`evento de auditoria ` ``os.posix_spawn`` com os " +"argumentos ``path``, ``argv`` e ``env``." #: ../../library/os.rst:4440 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." @@ -6650,16 +6666,15 @@ msgstr "" #: ../../library/os.rst:4463 msgid "*before* is a function called before forking a child process." -msgstr "" -"*before* é uma função chamada antes de fazer um fork para um processo filho." +msgstr "*before* é uma função chamada antes de criar um processo filho." #: ../../library/os.rst:4464 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -"*after_in_parent* é uma função chamada a partir do processo pai após fazer " -"um fork para um processo filho." +"*after_in_parent* é uma função chamada a partir do processo pai após criar " +"um processo filho." #: ../../library/os.rst:4466 msgid "*after_in_child* is a function called from the child process." @@ -6681,9 +6696,10 @@ msgid "" "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -"As funções registradas para execução antes de fazer o fork são chamadas na " -"ordem de registro reversa. As funções registradas para execução após o fork " -"ser feito (no pai ou no filho) são chamadas na ordem de registro." +"As funções registradas para execução antes de criar um processo filho são " +"chamadas na ordem de registro reversa. As funções registradas para execução " +"após o processo filho ser criado (no pai ou no filho) são chamadas na ordem " +"de registro." #: ../../library/os.rst:4477 msgid "" @@ -6691,8 +6707,8 @@ msgid "" "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -"Note que chamadas a :c:func:`fork` feitas por código C de terceiros pode não " -"chamar estas funções, a menos que ele explicitamente chame :c:func:" +"Note que chamadas a :c:func:`fork` feitas por código C de terceiros podem " +"não chamar estas funções, a menos que ele explicitamente chamem :c:func:" "`PyOS_BeforeFork`, :c:func:`PyOS_AfterFork_Parent` e :c:func:" "`PyOS_AfterFork_Child`." @@ -6727,8 +6743,8 @@ msgstr "" "Se *mode* for :const:`P_NOWAIT`, esta função retorna o id do processo do " "novo processo; se *mode* for :const:`P_WAIT`, retorna o código de saída do " "processo se ele sair normalmente, ou ``-signal``, onde *signal* é o sinal " -"que matou o processo. No Windows, o id de processo será na verdade o " -"identificador do processo, portanto, pode ser usado com a função :func:" +"que matou o processo. No Windows, o id do processo será na verdade o " +"manipulador do processo, portanto, pode ser usado com a função :func:" "`waitpid`." #: ../../library/os.rst:4510 @@ -6736,8 +6752,8 @@ msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -"Nota sobre VxWorks: esta função não retorna ``-signal`` quando o novo " -"processo é encerrado. Em vez disso, ele levanta a exceção OSError." +"Nota sobre VxWorks: esta função não retorna ``-signal`` se o novo processo é " +"interrompido. Em vez disso, ele levanta a exceção OSError." #: ../../library/os.rst:4513 msgid "" @@ -6777,7 +6793,7 @@ msgstr "" "variável de ambiente :envvar:`PATH` para localizar o programa *file*. Quando " "o ambiente está sendo substituído (usando uma das variantes :func:`spawn\\*e " "`, discutidas no próximo parágrafo), o novo ambiente é usado como " -"fonte da variável :envvar:`PATH` As outras variantes, :func:`spawnl`, :func:" +"fonte da variável :envvar:`PATH`. As outras variantes, :func:`spawnl`, :func:" "`spawnle`, :func:`spawnv` e :func:`spawnve`, não usarão a variável :envvar:" "`PATH` para localizar o executável; *path* deve conter um caminho absoluto " "ou relativo apropriado." @@ -6816,8 +6832,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.spawn`` com argumentos " -"``mode``, ``path``, ``args``, ``env``." +"Levanta um :ref:`evento de auditoria ` ``os.spawn`` com os " +"argumentos ``mode``, ``path``, ``args`` e ``env``." #: ../../library/os.rst:4554 msgid "" @@ -6840,7 +6856,7 @@ msgid "" msgstr "" "Valores possíveis para o parâmetro *mode* para a família de funções :func:" "`spawn\\* `. Se qualquer um desses valores for fornecido, as " -"funções :func:`spawn\\ `. retornarão assim que o novo processo for " +"funções :func:`spawn\\* ` retornarão assim que o novo processo for " "criado, com o id do processo como o valor de retorno." #: ../../library/os.rst:4576 @@ -6866,8 +6882,8 @@ msgid "" "used, the current process will be replaced; the :func:`spawn\\* ` " "function will not return." msgstr "" -"Valores possíveis do o parâmetro *mode* para a família de funções :func:" -"`spawn\\* `. Eles são menos portáteis do que os listados acima. :" +"Valores possíveis para o parâmetro *mode* para a família de funções :func:" +"`spawn\\* `. Eles são menos portáveis do que os listados acima. :" "const:`P_DETACH` é semelhante a :const:`P_NOWAIT`, mas o novo processo é " "separado do console do processo de chamada. Se :const:`P_OVERLAY` for usado, " "o processo atual será substituído; a função :func:`spawn\\* ` não " @@ -6910,7 +6926,7 @@ msgid "" "a document." msgstr "" "Ao iniciar uma aplicação, especifique *arguments* a serem passados como uma " -"única string. Este argumento pode não ter efeito quando usar esta função " +"única string. Este argumento pode não ter efeito quando esta função é usada " "para iniciar um documento." #: ../../library/os.rst:4615 @@ -6931,7 +6947,7 @@ msgid "" msgstr "" "Use *show_cmd* para substituir o estilo de janela padrão. Se isso terá algum " "efeito irá depender da aplicação sendo iniciada. Os valores são inteiros " -"conforme suportado pela função Win32 :c:func:`!ShellExecute`." +"conforme implementado pela função Win32 :c:func:`!ShellExecute`." #: ../../library/os.rst:4623 msgid "" @@ -6959,7 +6975,7 @@ msgid "" msgstr "" "Para reduzir a sobrecarga de inicialização do interpretador, a função Win32 :" "c:func:`!ShellExecute` não é resolvida até que esta função seja chamada pela " -"primeira vez. Se a função não puder ser resolvida, :exc:" +"primeira vez. Se a função não puder ser resolvida, uma exceção :exc:" "`NotImplementedError` será levantada." #: ../../library/os.rst:4635 @@ -6967,8 +6983,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``os.startfile`` coms " -"argumentos ``path``, ``operation``." +"Levanta um :ref:`evento de auditoria ` ``os.startfile`` com os " +"argumentos ``path`` e ``operation``." #: ../../library/os.rst:4637 msgid "" @@ -6976,7 +6992,7 @@ msgid "" "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``os.startfile/2`` com os " -"argumentos ``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." +"argumentos ``path``, ``operation``, ``arguments``, ``cwd`` e ``show_cmd``." #: ../../library/os.rst:4641 msgid "" @@ -7061,7 +7077,7 @@ msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -"Retorna os tempos atuais de processo globais. O valor de retorno é um objeto " +"Retorna os tempos do processo global atual. O valor de retorno é um objeto " "com cinco atributos:" #: ../../library/os.rst:4684 @@ -7074,12 +7090,12 @@ msgstr ":attr:`!system` - tempo do sistema" #: ../../library/os.rst:4686 msgid ":attr:`!children_user` - user time of all child processes" -msgstr ":attr:`!children_user` - tempo do usuário de todos os processo filhos" +msgstr ":attr:`!children_user` - tempo do usuário de todos os processos filhos" #: ../../library/os.rst:4687 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -":attr:`!children_system` - tempo do sistema de todos os processo filhos" +":attr:`!children_system` - tempo do sistema de todos os processos filhos" #: ../../library/os.rst:4688 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" @@ -7120,17 +7136,17 @@ msgid "" msgstr "" "Aguarda a conclusão de um processo filho e retorna uma tupla contendo seu " "pid e indicação de status de saída: um número de 16 bits, cujo byte baixo é " -"o número do sinal que matou o processo e cujo byte alto é o status de saída " -"(se o sinal número é zero); o bit alto do byte baixo é definido se um " -"arquivo principal foi produzido." +"o número do sinal que interrompeu o processo e cujo byte alto é o status de " +"saída (se o número do sinal é zero); o bit alto do byte baixo é definido se " +"um arquivo principal foi produzido." #: ../../library/os.rst:4714 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -"Se não houver filhos que possam ser esperados, :exc:`ChildProcessError` é " -"levantada." +"Se não houver filhos que possam ser aguardados, uma exceção :exc:" +"`ChildProcessError` é levantada." #: ../../library/os.rst:4717 ../../library/os.rst:4792 msgid "" @@ -7152,7 +7168,7 @@ msgstr "" #: ../../library/os.rst:4731 msgid "Wait for the completion of a child process." -msgstr "Aguarde a conclusão de um processo filho." +msgstr "Aguarda a conclusão de um processo filho." #: ../../library/os.rst:4733 msgid "" @@ -7233,7 +7249,7 @@ msgid "" "the value of the integer *options*, which should be ``0`` for normal " "operation." msgstr "" -"No Unix: Aguarda a conclusão de um processo filho dado pelo id de processo " +"No Unix: aguarda a conclusão de um processo filho dado pelo id de processo " "*pid* e retorna uma tupla contendo seu id de processo e indicação de status " "de saída (codificado como para :func:`wait`). A semântica da chamada é " "afetada pelo valor do inteiro *options*, que deve ser ``0`` para operação " @@ -7280,7 +7296,7 @@ msgid "" "`spawn\\* ` functions called with :const:`P_NOWAIT` return suitable " "process handles." msgstr "" -"No Windows: Aguarda a conclusão de um processo fornecido pelo identificador " +"No Windows: aguarda a conclusão de um processo fornecido pelo identificador " "de processo *pid* e retorna uma tupla contendo *pid*, e seu status de saída " "deslocado 8 bits para a esquerda (o deslocamento torna o uso da função em " "várias plataformas mais fácil). Um *pid* menor ou igual a ``0`` não tem " @@ -7299,7 +7315,7 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" "Semelhante a :func:`waitpid`, exceto que nenhum argumento de id de processo " -"é fornecido e uma tupla de 3 elementos contendo a id do processo da criança, " +"é fornecido e uma tupla de 3 elementos contendo o id do processo filho, " "indicação de status de saída e informações de uso de recursos é retornada. " "Consulte :func:`resource.getrusage` para obter detalhes sobre as informações " "de uso de recursos. O argumento *option* é o mesmo fornecido para :func:" @@ -7321,8 +7337,8 @@ msgid "" "information. The arguments to :func:`wait4` are the same as those provided " "to :func:`waitpid`." msgstr "" -"Semelhante a :func:`waitpid`, exceto uma tupla de 3 elementos, contendo a id " -"do processo da filho, indicação de status de saída e informações de uso de " +"Semelhante a :func:`waitpid`, exceto uma tupla de 3 elementos, contendo o id " +"do processo filho, indicação de status de saída e informações de uso de " "recursos é retornada. Consulte :func:`resource.getrusage` para obter " "detalhes sobre as informações de uso de recursos. Os argumentos para :func:" "`wait4` são os mesmos que aqueles fornecidos a :func:`waitpid`." @@ -7347,7 +7363,7 @@ msgstr "" #: ../../library/os.rst:4842 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." -msgstr ":data:`!P_ALL` - espera por qualquer criança; *id* é ignorado." +msgstr ":data:`!P_ALL` - espera por qualquer filho; *id* é ignorado." #: ../../library/os.rst:4843 msgid "" @@ -7372,9 +7388,9 @@ msgid "" "continued from a job control stop since they were last reported." msgstr "" "Este sinalizador *options* para :func:`waitpid`, :func:`wait3`, :func:" -"`wait4` e :func:`waitid` faz com que os processos filho sejam relatados se " +"`wait4` e :func:`waitid` faz com que os processos filhos sejam reportados se " "eles tiverem continuado de uma parada de controle de trabalho desde que " -"foram relatados pela última vez." +"foram reportados pela última vez." #: ../../library/os.rst:4866 msgid "" @@ -7382,7 +7398,7 @@ msgid "" "terminated to be reported." msgstr "" "Este sinalizador *options* para :func:`waitid` faz com que os processos " -"filhos que terminaram sejam relatados." +"filhos que terminaram sejam reportados." #: ../../library/os.rst:4869 msgid "" @@ -7411,8 +7427,9 @@ msgid "" "their current state has not been reported since they were stopped." msgstr "" "Este sinalizador de *options* para :func:`waitpid`, :func:`wait3` e :func:" -"`wait4` faz com que os processos filho também sejam relatados se eles foram " -"interrompidos, mas seu estado atual não foi relatado desde que foram parou." +"`wait4` faz com que os processos filho também sejam reportados se eles foram " +"interrompidos, mas seu estado atual não foi reportado desde que foram " +"parados." #: ../../library/os.rst:4895 msgid "This option is not available for :func:`waitid`." @@ -7482,7 +7499,7 @@ msgstr "" #: ../../library/os.rst:4950 msgid "Otherwise, raise a :exc:`ValueError`." -msgstr "Do contrário, levanta uma :exc:`ValueError`." +msgstr "Do contrário, levanta uma exceção :exc:`ValueError`." #: ../../library/os.rst:4952 msgid "On Windows, return *status* shifted right by 8 bits." @@ -7523,7 +7540,7 @@ msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -"Retorna ``True`` se um despejo de núcleo *(core dump)* foi gerado para o " +"Retorna ``True`` se um despejo de memória *(core dump)* foi gerado para o " "processo; caso contrário, retorna ``False``." #: ../../library/os.rst:4978 ../../library/os.rst:5044 @@ -7649,7 +7666,9 @@ msgstr "Política de agendamento para programas de servidor esporádicos." #: ../../library/os.rst:5080 msgid "A First In First Out scheduling policy." -msgstr "Uma política de agendamento Primeiro a Entrar, Primeiro a Sair (FIFO)." +msgstr "" +"Uma política de agendamento Primeiro a Entrar, Primeiro a Sair (First In " +"First Out - FIFO)." #: ../../library/os.rst:5084 msgid "A round-robin scheduling policy." @@ -7792,9 +7811,9 @@ msgstr "" "é o nome de um valor de sistema definido; esses nomes são especificados em " "vários padrões (POSIX, Unix 95, Unix 98 e outros). Algumas plataformas " "também definem nomes adicionais. Os nomes conhecidos pelo sistema " -"operacional host são fornecidos como as chaves do dicionário " -"``confstr_names``. Para variáveis ​​de configuração não incluídas nesse " -"mapeamento, passar um número inteiro para *name* também é aceito." +"operacional são fornecidos como as chaves do dicionário ``confstr_names``. " +"Para variáveis ​​de configuração não incluídas nesse mapeamento, passar um " +"número inteiro para *name* também é aceito." #: ../../library/os.rst:5186 msgid "" @@ -7812,9 +7831,9 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" "Se *name* for uma string e não for conhecida, :exc:`ValueError` é levantada. " -"Se um valor específico para *name* não for compatível com o sistema de host, " -"mesmo que seja incluído em ``confstr_names``, uma :exc:`OSError` é levantada " -"com :const:`errno.EINVAL` como número do erro." +"Se um valor específico para *name* não for compatível com o sistema " +"operacional do computador, mesmo que seja incluído em ``confstr_names``, " +"uma :exc:`OSError` é levantada com :const:`errno.EINVAL` como número do erro." #: ../../library/os.rst:5199 msgid "" @@ -7824,8 +7843,8 @@ msgid "" msgstr "" "Nomes de mapeamento de dicionário aceitos por :func:`confstr` para os " "valores inteiros definidos para esses nomes pelo sistema operacional do " -"host. Isso pode ser usado para determinar o conjunto de nomes conhecidos " -"pelo sistema." +"computador. Isso pode ser usado para determinar o conjunto de nomes " +"conhecidos pelo sistema." #: ../../library/os.rst:5208 msgid "" @@ -7876,9 +7895,8 @@ msgid "" "determine the set of names known to the system." msgstr "" "Nomes de mapeamento de dicionário aceitos por :func:`sysconf` para os " -"valores inteiros definidos para esses nomes pelo sistema operacional do " -"host. Isso pode ser usado para determinar o conjunto de nomes conhecidos " -"pelo sistema." +"valores inteiros definidos para esses nomes pelo sistema operacional. Isso " +"pode ser usado para determinar o conjunto de nomes conhecidos pelo sistema." #: ../../library/os.rst:5245 msgid "Add ``'SC_MINSIGSTKSZ'`` name." @@ -7889,8 +7907,9 @@ msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -"Os dados a seguir são usados para suportar operações de manipulação de path. " -"Estão definidos e disponíveis para todas as plataformas." +"Os dados a seguir são usados para operações de manipulação de caminhos de " +"arquivos e diretórios. Estão definidos e disponíveis para todas as " +"plataformas." #: ../../library/os.rst:5251 msgid "" @@ -8044,9 +8063,9 @@ msgid "" "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -"O argumento sinalizadores é uma máscara de bits que pode conter zero ou mais " -"dos seguintes valores operados com OU juntos: :const:`os.GRND_RANDOM` e :py:" -"data:`GRND_NONBLOCK`." +"O argumento *flags* é uma máscara de bits que pode conter zero ou mais dos " +"seguintes valores operados com OU: :const:`os.GRND_RANDOM` e :py:data:" +"`GRND_NONBLOCK`." #: ../../library/os.rst:5363 msgid "" @@ -8064,8 +8083,8 @@ msgstr ":ref:`Disponibilidade `: Linux >= 3.17." msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -"Retorna uma bytestring de *size* bytes aleatórios próprios para uso " -"criptográfico." +"Retorna uma sequência de bytes de tamanho *size* aleatórios próprios para " +"uso criptográfico." #: ../../library/os.rst:5374 msgid "" @@ -8152,7 +8171,7 @@ msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -"No Windows, ``BCryptGenRandom()`` é usadp e, vez de ``CryptGenRandom()``, o " +"No Windows, ``BCryptGenRandom()`` é usado em vez de ``CryptGenRandom()``, o " "qual foi descontinuado." #: ../../library/os.rst:5416 @@ -8163,7 +8182,7 @@ msgid "" msgstr "" "Por padrão, ao ler de ``/dev/random``, :func:`getrandom` bloqueia se nenhum " "byte aleatório estiver disponível, e ao ler de ``/dev/urandom``, ele " -"bloqueia se o pool de entropia não ainda foi inicializado." +"bloqueia se o pool de entropia ainda não foi inicializado." #: ../../library/os.rst:5420 msgid "" @@ -8179,7 +8198,7 @@ msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." msgstr "" -"Se este bit é definido bytes aleatórios são pegos a partir de ``/dev/" +"Se este bit é definido os bytes aleatórios são pegos a partir de ``/dev/" "random`` ao invés de ``/dev/urandom``." #: ../../library/os.rst:363 ../../library/os.rst:529 ../../library/os.rst:731 @@ -8198,7 +8217,7 @@ msgstr "processo" #: ../../library/os.rst:372 ../../library/os.rst:438 msgid "group" -msgstr "gru" +msgstr "grupo" #: ../../library/os.rst:447 ../../library/os.rst:529 msgid "id" @@ -8276,11 +8295,11 @@ msgstr "percorrer" #: ../../library/os.rst:3488 ../../library/os.rst:3587 msgid "traversal" -msgstr "" +msgstr "traversal" #: ../../library/os.rst:4235 ../../library/os.rst:4262 msgid "killing" -msgstr "" +msgstr "interrupção" #: ../../library/os.rst:4235 ../../library/os.rst:4262 msgid "signalling" diff --git a/library/ossaudiodev.po b/library/ossaudiodev.po index e65183931..b4f8b1f4c 100644 --- a/library/ossaudiodev.po +++ b/library/ossaudiodev.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Danilo Lima , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/pathlib.po b/library/pathlib.po index b7b0cf9e5..1d66fc38b 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -20,16 +20,17 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pathlib.rst:2 msgid ":mod:`!pathlib` --- Object-oriented filesystem paths" msgstr "" +":mod:`!pathlib` --- Caminhos do sistema de arquivos orientados a objetos" #: ../../library/pathlib.rst:9 msgid "**Source code:** :source:`Lib/pathlib.py`" @@ -159,6 +160,11 @@ msgid "" "the :meth:`~os.PathLike.__fspath__` method returns a string, such as another " "path object::" msgstr "" +"Cada elemento de *pathsegments* pode ser uma string representando um " +"segmento de caminho, um objeto que implementa a interface que retorna uma " +"string ou um objeto implementando a interface :class:`os.PathLike`, onde o " +"método :meth:`~os.PathLike.__fspath__` retorna uma string, como outro objeto " +"caminho::" #: ../../library/pathlib.rst:117 msgid "When *pathsegments* is empty, the current directory is assumed::" @@ -485,12 +491,16 @@ msgid "" "This method is string-based; it neither accesses the filesystem nor treats " "\"``..``\" segments specially. The following code is equivalent:" msgstr "" +"Este método é baseado em string; ele não acessa o sistema de arquivos nem " +"trata segmentos \"``..``\" especialmente. O código a seguir é equivalente:" #: ../../library/pathlib.rst:522 msgid "" "Passing additional arguments is deprecated; if supplied, they are joined " "with *other*." msgstr "" +"A passagem de argumentos adicionais está descontinuada; se fornecidos, eles " +"são unidos com *other*." #: ../../library/pathlib.rst:527 msgid "" @@ -515,6 +525,8 @@ msgid "" "Calling this method is equivalent to combining the path with each of the " "given *pathsegments* in turn::" msgstr "" +"Chamar este método é equivalente a combinar o caminho com cada um dos " +"*pathsegments* por vez::" #: ../../library/pathlib.rst:557 msgid "" @@ -560,17 +572,21 @@ msgstr "" msgid "" "Set *case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" +"Defina *case_sensitive* como ``True`` ou ``False`` para substituir esse " +"comportamento." #: ../../library/pathlib.rst:597 ../../library/pathlib.rst:944 #: ../../library/pathlib.rst:1357 msgid "The *case_sensitive* parameter was added." -msgstr "" +msgstr "O parâmetro *case_sensitive* foi adicionado." #: ../../library/pathlib.rst:603 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, :exc:`ValueError` is raised::" msgstr "" +"Calcula uma versão deste caminho em relação ao caminho representado por " +"*other*. Se for impossível, :exc:`ValueError` é levantada::" #: ../../library/pathlib.rst:618 msgid "" @@ -579,6 +595,10 @@ msgid "" "path. In all other cases, such as the paths referencing different drives, :" "exc:`ValueError` is raised.::" msgstr "" +"Quando *walk_up* é falso (o padrão), o caminho deve começar com *other*. " +"Quando o argumento é verdadeiro, entradas ``..`` podem ser adicionadas para " +"formar o caminho relativo. Em todos os outros casos, como os caminhos que " +"fazem referência a unidades diferentes, :exc:`ValueError` é levantada.::" #: ../../library/pathlib.rst:633 msgid "" @@ -587,18 +607,27 @@ msgid "" "*walk_up* option as it assumes that no symlinks are present in the path; " "call :meth:`~Path.resolve` first if necessary to resolve symlinks." msgstr "" +"Esta função faz parte de :class:`PurePath` e funciona com strings. Ela não " +"verifica ou acessa a estrutura do arquivo subjacente. Isso pode impactar a " +"opção *walk_up*, pois ela presume que não há links simbólicos presentes no " +"caminho; chame :meth:`~Path.resolve` primeiro se necessário para resolver " +"links simbólicos." #: ../../library/pathlib.rst:639 msgid "" "The *walk_up* parameter was added (old behavior is the same as " "``walk_up=False``)." msgstr "" +"O parâmetro *walk_up* foi adicionado (o comportamento antigo é o mesmo de " +"``walk_up=False``)." #: ../../library/pathlib.rst:644 msgid "" "Passing additional positional arguments is deprecated; if supplied, they are " "joined with *other*." msgstr "" +"A passagem de argumentos posicionais adicionais está descontinuada; se " +"fornecidos, eles são unidos com *other*." #: ../../library/pathlib.rst:649 msgid "" @@ -633,6 +662,10 @@ msgid "" "such as from :attr:`parent` and :meth:`relative_to`. Subclasses may override " "this method to pass information to derivative paths, for example::" msgstr "" +"Cria um novo objeto caminho do mesmo tipo combinando os *pathsegments* " +"fornecidos. Este método é chamado sempre que um caminho derivado é criado, " +"como de :attr:`parent` e :meth:`relative_to`. Subclasses podem substituir " +"este método para passar informações para caminhos derivados, por exemplo::" #: ../../library/pathlib.rst:733 msgid "Concrete paths" @@ -720,7 +753,7 @@ msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -"Retorna um novo objeto de caminho que representa o diretório atual (conforme " +"Retorna um novo objeto caminho que representa o diretório atual (conforme " "retornado por :func:`os.getcwd`)::" #: ../../library/pathlib.rst:817 @@ -729,10 +762,10 @@ msgid "" "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -"Retorna um novo objeto de caminho representando o diretório pessoal do " -"usuário (conforme retornado por :func:`os.path.expanduser` com a construção " -"``~``). Se o diretório pessoal não puder ser resolvido, :exc:`RuntimeError` " -"é levantada." +"Retorna um novo objeto caminho representando o diretório pessoal do usuário " +"(conforme retornado por :func:`os.path.expanduser` com a construção ``~``). " +"Se o diretório pessoal não puder ser resolvido, :exc:`RuntimeError` é " +"levantada." #: ../../library/pathlib.rst:831 msgid "" @@ -776,12 +809,15 @@ msgstr "" #: ../../library/pathlib.rst:870 msgid "Return ``True`` if the path points to an existing file or directory." msgstr "" +"Retorna ``True`` se o caminho aponta para um arquivo ou diretório existente." #: ../../library/pathlib.rst:872 msgid "" "This method normally follows symlinks; to check if a symlink exists, add the " "argument ``follow_symlinks=False``." msgstr "" +"Este método normalmente segue links simbólicos; para verificar se um link " +"simbólico existe, adicione o argumento ``follow_symlinks=False``." #: ../../library/pathlib.rst:891 msgid "" @@ -790,7 +826,7 @@ msgid "" "`RuntimeError` is raised." msgstr "" "Retorna um novo caminho com as construções ``~`` e ``~user`` expandidas, " -"como retornado por :meth:`os.path.expanduser`. Se um diretóriopessoal não " +"como retornado por :meth:`os.path.expanduser`. Se um diretório pessoal não " "puder ser resolvido, :exc:`RuntimeError` é levantada." #: ../../library/pathlib.rst:906 @@ -826,6 +862,12 @@ msgid "" "typically, case-sensitive on POSIX, and case-insensitive on Windows. Set " "*case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" +"Por padrão, ou quando o argumento somente-nomeado *case_sensitive* é " +"definido como ``None``, esse método corresponde a caminhos usando regras de " +"capitalização específicas da plataforma: normalmente, diferencia maiúsculas " +"de minúsculas no POSIX e não diferencia maiúsculas de minúsculas no Windows. " +"Defina *case_sensitive* como ``True`` ou ``False`` para substituir esse " +"comportamento." #: ../../library/pathlib.rst:935 msgid "" @@ -841,7 +883,7 @@ msgid "" "arguments ``self``, ``pattern``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``pathlib.Path.glob`` com " -"argumentos ``self``, ``pattern``." +"os argumentos ``self``, ``pattern``." #: ../../library/pathlib.rst:940 ../../library/pathlib.rst:1353 msgid "" @@ -892,6 +934,9 @@ msgid "" "Return ``True`` if the path points to a junction, and ``False`` for any " "other type of file. Currently only Windows supports junctions." msgstr "" +"Retorna ``True`` se o caminho apontar para uma junção, e ``False`` para " +"qualquer outro tipo de arquivo. Atualmente, apenas o Windows dá suporte a " +"junções." #: ../../library/pathlib.rst:982 msgid "" @@ -904,6 +949,15 @@ msgid "" "letter root (e.g. ``c:\\``), a UNC share (e.g. ``\\\\server\\share``), or a " "mounted filesystem directory." msgstr "" +"Retorna ``True`` se o caminho for um :dfn:`ponto de montagem`: um ponto em " +"um sistema de arquivos onde um sistema de arquivos diferente foi montado. No " +"POSIX, a função verifica se o pai do *path*, :file:`path/..`, está em um " +"dispositivo diferente de *path*, ou se :file:`path/..` e *path* apontam para " +"o mesmo nó-i no mesmo dispositivo -- isso deve detectar pontos de montagem " +"para todas as variantes Unix e POSIX. No Windows, um ponto de montagem é " +"considerado uma raiz de letra de unidade (por exemplo, ``c:\\``), um " +"compartilhamento UNC (por exemplo, ``\\\\server\\share``) ou um diretório de " +"sistema de arquivos montado." #: ../../library/pathlib.rst:993 msgid "Windows support was added." @@ -985,6 +1039,8 @@ msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up." msgstr "" +"Gera os nomes de arquivos em uma árvore de diretórios percorrendo a árvore " +"de cima para baixo ou de baixo para cima." #: ../../library/pathlib.rst:1067 msgid "" @@ -992,6 +1048,9 @@ msgid "" "but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, " "dirnames, filenames)``." msgstr "" +"Para cada diretório na árvore de diretórios com raiz em *self* (incluindo " +"*self*, mas excluindo '.' e '..'), o método produz uma tupla de 3 elementos " +"de ``(dirpath, dirnames, filenames)``." #: ../../library/pathlib.rst:1071 msgid "" @@ -1002,6 +1061,13 @@ msgid "" "begins with *self*) to a file or directory in *dirpath*, do ``dirpath / " "name``. Whether or not the lists are sorted is file system-dependent." msgstr "" +"*dirpath* é um :class:`Path` para o diretório que está sendo percorrido no " +"momento, *dirnames* é uma lista de strings para os nomes dos subdiretórios " +"em *dirpath* (excluindo ``'.'`` e ``'..'``), e *filenames* é uma lista de " +"strings para os nomes dos arquivos não diretório em *dirpath*. Para obter um " +"caminho completo (que começa com *self*) para um arquivo ou diretório em " +"*dirpath*, faça ``dirpath / name``. Se as listas são ou não classificadas " +"depende do sistema de arquivos." #: ../../library/pathlib.rst:1079 msgid "" @@ -1013,6 +1079,14 @@ msgid "" "*top_down*, the list of subdirectories is retrieved before the triples for " "the directory and its subdirectories are walked." msgstr "" +"Se o argumento opcional *top_down* for verdadeiro (que é o padrão), o trio " +"para um diretório é gerado antes dos trios para qualquer um de seus " +"subdiretórios (os diretórios são percorridos de cima para baixo). Se " +"*top_down* for falso, o trio para um diretório é gerado após os trios para " +"todos os seus subdiretórios (os diretórios são percorridos de baixo para " +"cima). Não importa o valor de *top_down*, a lista de subdiretórios é " +"recuperada antes que os trios para o diretório e seus subdiretórios sejam " +"percorridos." #: ../../library/pathlib.rst:1087 msgid "" @@ -1026,6 +1100,16 @@ msgid "" "of :meth:`Path.walk()` since the directories in *dirnames* have already been " "generated by the time *dirnames* is yielded to the caller." msgstr "" +"Quando *top_down* é verdadeiro, o chamador pode modificar a lista *dirnames* " +"no local (por exemplo, usando :keyword:`del` ou atribuição de fatias), e :" +"meth:`Path.walk` só recursivamente nos subdiretórios cujos nomes permanecem " +"em *dirnames*. Isso pode ser usado para podar a pesquisa, ou para impor uma " +"ordem específica de visita, ou mesmo para informar :meth:`Path.walk` sobre " +"diretórios que o chamador cria ou renomeia antes de retomar :meth:`Path." +"walk` novamente. Modificar *dirnames* quando *top_down* é false não tem " +"efeito no comportamento de :meth:`Path.walk()`, pois os diretórios em " +"*dirnames* já foram gerados no momento em que *dirnames* é cedido ao " +"chamador." #: ../../library/pathlib.rst:1097 msgid "" @@ -1270,7 +1354,7 @@ msgstr "" #: ../../library/pathlib.rst:1330 msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." -msgstr "" +msgstr "O parâmetro *strict* foi adicionado (comportamento pré-3.6 é estrito)." #: ../../library/pathlib.rst:1335 msgid "" @@ -1323,11 +1407,11 @@ msgid "" "ignored." msgstr "" "No Windows, um link simbólico representa um arquivo ou um diretório e não se " -"transforma no destino dinamicamente. Se o alvo estiver presente, o tipo de " -"link simbólico será criado para corresponder. Caso contrário, o link " -"simbólico será criado como um diretório se *target_is_directory* for " -"``True`` ou um link simbólico de arquivo (o padrão) caso contrário. Em " -"plataformas não Windows, *target_is_directory* é ignorado." +"transforma no destino dinamicamente. Se o alvo estiver presente, será criado " +"um link simbólico de mesmo tipo. Caso contrário, o link simbólico será " +"criado como um diretório se *target_is_directory* for ``True`` ou um link " +"simbólico de arquivo (o padrão) caso contrário. Em plataformas não Windows, " +"*target_is_directory* é ignorado." #: ../../library/pathlib.rst:1409 msgid "" diff --git a/library/pdb.po b/library/pdb.po index 45e831abb..6cc087417 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -91,7 +91,7 @@ msgstr "O uso típico para invadir o depurador é inserir::" #: ../../library/pdb.rst:43 msgid "Or::" -msgstr "ou ::" +msgstr "ou::" #: ../../library/pdb.rst:47 msgid "" @@ -329,8 +329,7 @@ msgstr "Exemplo de chamada para habilitar rastreamento com *skip*::" msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``pdb.Pdb`` com nenhum " -"argumento." +"Levanta um :ref:`evento de auditoria ` ``pdb.Pdb`` sem argumentos." #: ../../library/pdb.rst:212 msgid "Added the *skip* parameter." diff --git a/library/persistence.po b/library/persistence.po index 9b0570b6e..c04badd39 100644 --- a/library/persistence.po +++ b/library/persistence.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/pickle.po b/library/pickle.po index d93604f8d..4de99dc0d 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -20,16 +20,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pickle.rst:2 msgid ":mod:`!pickle` --- Python object serialization" -msgstr "" +msgstr ":mod:`!pickle` --- Serialização de objetos Python" #: ../../library/pickle.rst:10 msgid "**Source code:** :source:`Lib/pickle.py`" @@ -638,6 +638,8 @@ msgid "" "If *buffer_callback* is ``None`` (the default), buffer views are serialized " "into *file* as part of the pickle stream." msgstr "" +"Se *buffer_callback* for ``None`` (o padrão), as visualizações de buffer são " +"serializadas em *file* como parte do fluxo pickle." #: ../../library/pickle.rst:320 msgid "" @@ -646,12 +648,19 @@ msgid "" "``None``), the given buffer is :ref:`out-of-band `; otherwise " "the buffer is serialized in-band, i.e. inside the pickle stream." msgstr "" +"Se *buffer_callback* não for ``None``, ele pode ser chamado qualquer número " +"de vezes com uma visualização de buffer. Se essa chamada retornar um valor " +"falso (tal como ``None``), o buffer fornecido é :ref:`fora da banda `; caso contrário, o buffer é serializado dentro da banda, ou seja, " +"dentro do fluxo pickle." #: ../../library/pickle.rst:325 msgid "" "It is an error if *buffer_callback* is not ``None`` and *protocol* is " "``None`` or smaller than 5." msgstr "" +"É um erro se *buffer_callback* não for ``None`` e *protocol* for ``None`` ou " +"menor que 5." #: ../../library/pickle.rst:333 msgid "" @@ -821,6 +830,10 @@ msgid "" "*buffer_callback* argument was ``None`` when a :class:`Pickler` was " "instantiated (or when :func:`dump` or :func:`dumps` was called)." msgstr "" +"Se *buffers* for ``None`` (o padrão), todos os dados necessários para " +"desserialização devem estar contidos no fluxo pickle. Isso significa que o " +"argumento *buffer_callback* era ``None`` quando um :class:`Pickler` foi " +"instanciado (ou quando :func:`dump` ou :func:`dumps` foi chamado)." #: ../../library/pickle.rst:424 msgid "" @@ -829,6 +842,11 @@ msgid "" "of-band ` buffer view. Such buffers have been given in order to " "the *buffer_callback* of a Pickler object." msgstr "" +"Se *buffers* for ``None``, deve ser um iterável de objetos habilitados para " +"buffer que é consumido cada vez que o fluxo de serialização com pickle faz " +"referência a uma visualização de buffer :ref:`fora da banda `. " +"Esses buffers foram fornecidos em ordem para o *buffer_callback* de um " +"objeto Pickler." #: ../../library/pickle.rst:434 msgid "" @@ -883,7 +901,7 @@ msgid "" "arguments ``module``, ``name``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``pickle.find_class`` com " -"argumento ``module``, ``name``." +"os argumentos ``module``, ``name``." #: ../../library/pickle.rst:464 msgid "" @@ -1882,7 +1900,7 @@ msgstr "" #: ../../library/pickle.rst:1147 msgid "Performance" -msgstr "Performance" +msgstr "Desempenho" #: ../../library/pickle.rst:1149 msgid "" diff --git a/library/pickletools.po b/library/pickletools.po index adcdd2fda..bc50dee2b 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pickletools.rst:2 msgid ":mod:`!pickletools` --- Tools for pickle developers" -msgstr "" +msgstr ":mod:`!pickletools` --- Ferramentas para desenvolvedores pickle" #: ../../library/pickletools.rst:8 msgid "**Source code:** :source:`Lib/pickletools.py`" diff --git a/library/pipes.po b/library/pipes.po index 3b7ff544a..a861041a0 100644 --- a/library/pipes.po +++ b/library/pipes.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/pkgutil.po b/library/pkgutil.po index e79b5a45e..feee93ebd 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pkgutil.rst:2 msgid ":mod:`!pkgutil` --- Package extension utility" -msgstr "" +msgstr ":mod:`!pkgutil` --- Utilitário de extensão de pacote" #: ../../library/pkgutil.rst:7 msgid "**Source code:** :source:`Lib/pkgutil.py`" @@ -59,6 +59,10 @@ msgid "" "This is useful if one wants to distribute different parts of a single " "logical package as multiple directories." msgstr "" +"Para cada diretório em :data:`sys.path` que tenha um subdiretório que " +"corresponda ao nome do pacote, adiciona o subdiretório ao :attr:`__path__` " +"do pacote. Isto é útil se quisermos distribuir diferentes partes de um único " +"pacote lógico como múltiplos diretórios." #: ../../library/pkgutil.rst:33 msgid "" diff --git a/library/platform.po b/library/platform.po index bf329b973..eb7670ba6 100644 --- a/library/platform.po +++ b/library/platform.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/plistlib.po b/library/plistlib.po index 00e9b3505..a910c6962 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/plistlib.rst:2 msgid ":mod:`!plistlib` --- Generate and parse Apple ``.plist`` files" -msgstr "" +msgstr ":mod:`!plistlib` --- Gera e analisa arquivos Apple ``.plist``" #: ../../library/plistlib.rst:11 msgid "**Source code:** :source:`Lib/plistlib.py`" @@ -39,6 +39,9 @@ msgid "" "list\" files used by Apple, primarily on macOS and iOS. This module supports " "both binary and XML plist files." msgstr "" +"Este módulo fornece uma interface para ler e escrever os arquivos \"property " +"listas (lista de propriedades) usados ​​pela Apple, principalmente no macOS e " +"iOS. Este módulo tem suporte a arquivos plist binários e XML." #: ../../library/plistlib.rst:23 msgid "" @@ -46,12 +49,18 @@ msgid "" "supporting basic object types, like dictionaries, lists, numbers and " "strings. Usually the top level object is a dictionary." msgstr "" +"O formato de arquivo de lista de propriedades (``.plist``) é uma " +"serialização simples que oferece suporte a tipos básicos de objetos, como " +"dicionários, listas, números e strings. Normalmente, o objeto de nível " +"superior é um dicionário." #: ../../library/plistlib.rst:27 msgid "" "To write out and to parse a plist file, use the :func:`dump` and :func:" "`load` functions." msgstr "" +"Para escrever e analisar um arquivo plist, use as funções :func:`dump` e :" +"func:`load`." #: ../../library/plistlib.rst:30 msgid "" @@ -65,30 +74,39 @@ msgid "" "dictionaries (but only with string keys), :class:`bytes`, :class:`bytearray` " "or :class:`datetime.datetime` objects." msgstr "" +"Os valores podem ser strings, inteiros, floats, booleanos, tuplas, listas, " +"dicionários (mas somente com chaves de string), objetos :class:`bytes`, :" +"class:`bytearray` ou :class:`datetime.datetime`." #: ../../library/plistlib.rst:37 msgid "New API, old API deprecated. Support for binary format plists added." msgstr "" +"Nova API, API antiga descontinuada. Suporte para plists de formato binário " +"adicionado." #: ../../library/plistlib.rst:40 msgid "" "Support added for reading and writing :class:`UID` tokens in binary plists " "as used by NSKeyedArchiver and NSKeyedUnarchiver." msgstr "" +"Adicionado suporte para leitura e escrita de tokens :class:`UID` em plists " +"binários, conforme usado por NSKeyedArchiver e NSKeyedUnarchiver." #: ../../library/plistlib.rst:44 msgid "Old API removed." -msgstr "" +msgstr "API antiga removida." #: ../../library/plistlib.rst:49 msgid "" "`PList manual page `_" msgstr "" +"`Pagina de manual de PList `_" #: ../../library/plistlib.rst:50 msgid "Apple's documentation of the file format." -msgstr "" +msgstr "Documentação da Apple sobre o formato de arquivo." #: ../../library/plistlib.rst:53 msgid "This module defines the following functions:" @@ -99,28 +117,31 @@ msgid "" "Read a plist file. *fp* should be a readable and binary file object. Return " "the unpacked root object (which usually is a dictionary)." msgstr "" +"Lê um arquivo plist. *fp* deve ser um objeto arquivo binário e legível. " +"Retorna o objeto raiz desempacotado (que geralmente é um dicionário)." #: ../../library/plistlib.rst:61 msgid "The *fmt* is the format of the file and the following values are valid:" -msgstr "" +msgstr "*fmt* é o formato do arquivo e os seguintes valores são válidos:" #: ../../library/plistlib.rst:63 msgid ":data:`None`: Autodetect the file format" -msgstr "" +msgstr ":data:`None`: Detecta automaticamente o formato do arquivo" #: ../../library/plistlib.rst:65 msgid ":data:`FMT_XML`: XML file format" -msgstr "" +msgstr ":data:`FMT_XML`: Formato de arquivo XML" #: ../../library/plistlib.rst:67 msgid ":data:`FMT_BINARY`: Binary plist format" -msgstr "" +msgstr ":data:`FMT_BINARY`: Formato binário plist" #: ../../library/plistlib.rst:69 msgid "" "The *dict_type* is the type used for dictionaries that are read from the " "plist file." msgstr "" +"O *dict_type* é o tipo usado para dicionários que são lidos do arquivo plist." #: ../../library/plistlib.rst:72 msgid "" @@ -129,12 +150,18 @@ msgid "" "exceptions on ill-formed XML. Unknown elements will simply be ignored by " "the plist parser." msgstr "" +"Dados XML para o formato :data:`FMT_XML` são analisados ​​usando o analisador " +"sintático Expat de :mod:`xml.parsers.expat` -- veja sua documentação para " +"possíveis exceções em XML malformado. Elementos desconhecidos serão " +"simplesmente ignorados pelo analisador de plist." #: ../../library/plistlib.rst:77 msgid "" "The parser for the binary format raises :exc:`InvalidFileException` when the " "file cannot be parsed." msgstr "" +"O analisador sintático para o formato binário levanta :exc:" +"`InvalidFileException` quando o arquivo não pode ser analisado." #: ../../library/plistlib.rst:85 msgid "" @@ -146,20 +173,24 @@ msgstr "" msgid "" "Write *value* to a plist file. *Fp* should be a writable, binary file object." msgstr "" +"Escreve *value* em um arquivo plist. *Fp* deve ser um objeto arquivo binário " +"gravável." #: ../../library/plistlib.rst:96 msgid "" "The *fmt* argument specifies the format of the plist file and can be one of " "the following values:" msgstr "" +"O argumento *fmt* especifica o formato do arquivo plist e pode ser um dos " +"seguintes valores:" #: ../../library/plistlib.rst:99 msgid ":data:`FMT_XML`: XML formatted plist file" -msgstr "" +msgstr ":data:`FMT_XML`: Arquivo plist formatado em XML" #: ../../library/plistlib.rst:101 msgid ":data:`FMT_BINARY`: Binary formatted plist file" -msgstr "" +msgstr ":data:`FMT_BINARY`: Arquivo plist formatado em binário" #: ../../library/plistlib.rst:103 msgid "" @@ -167,58 +198,74 @@ msgid "" "written to the plist in sorted order, otherwise they will be written in the " "iteration order of the dictionary." msgstr "" +"Quando *sort_keys* é verdadeiro (o padrão), as chaves dos dicionários serão " +"escritas ordenadas no plist, caso contrário, elas serão escritas na ordem de " +"iteração do dicionário." #: ../../library/plistlib.rst:107 msgid "" "When *skipkeys* is false (the default) the function raises :exc:`TypeError` " "when a key of a dictionary is not a string, otherwise such keys are skipped." msgstr "" +"Quando *skipkeys* é falso (o padrão), a função levanta :exc:`TypeError` " +"quando uma chave de um dicionário não é uma string, caso contrário, tais " +"chaves são ignoradas." #: ../../library/plistlib.rst:110 msgid "" "A :exc:`TypeError` will be raised if the object is of an unsupported type or " "a container that contains objects of unsupported types." msgstr "" +"Uma :exc:`TypeError` será levantada se o objeto for de um tipo não suportado " +"ou um contêiner que contém objetos de tipos não suportados." #: ../../library/plistlib.rst:113 msgid "" "An :exc:`OverflowError` will be raised for integer values that cannot be " "represented in (binary) plist files." msgstr "" +"Uma :exc:`OverflowError` será levantada para valores inteiros que não podem " +"ser representados em arquivos plist (binários)." #: ../../library/plistlib.rst:121 msgid "" "Return *value* as a plist-formatted bytes object. See the documentation for :" "func:`dump` for an explanation of the keyword arguments of this function." msgstr "" +"Retorna *value* como um objeto bytes formatado em plist. Veja a documentação " +"para :func:`dump` para uma explicação dos argumentos nomeados desta função." #: ../../library/plistlib.rst:128 msgid "The following classes are available:" -msgstr "" +msgstr "As seguintes classes estão disponíveis:" #: ../../library/plistlib.rst:132 msgid "" "Wraps an :class:`int`. This is used when reading or writing NSKeyedArchiver " "encoded data, which contains UID (see PList manual)." msgstr "" +"Envolve um :class:`int`. Isso é usado ao ler ou escrever dados codificados " +"NSKeyedArchiver, que contém UID (veja o manual de PList)." #: ../../library/plistlib.rst:135 msgid "" "It has one attribute, :attr:`data`, which can be used to retrieve the int " "value of the UID. :attr:`data` must be in the range ``0 <= data < 2**64``." msgstr "" +"Tem um atributo, :attr:`data`, que pode ser usado para recuperar o valor int " +"do UID. :attr:`data` deve estar no intervalo ``0 <= data < 2**64``." #: ../../library/plistlib.rst:141 msgid "The following constants are available:" -msgstr "" +msgstr "As seguintes constantes estão disponíveis:" #: ../../library/plistlib.rst:145 msgid "The XML format for plist files." -msgstr "" +msgstr "O formato XML para arquivos plist." #: ../../library/plistlib.rst:152 msgid "The binary format for plist files" -msgstr "" +msgstr "O formato binário para arquivos plist" #: ../../library/plistlib.rst:158 msgid "Examples" @@ -226,15 +273,15 @@ msgstr "Exemplos" #: ../../library/plistlib.rst:160 msgid "Generating a plist::" -msgstr "" +msgstr "Gerando um plist::" #: ../../library/plistlib.rst:182 msgid "Parsing a plist::" -msgstr "" +msgstr "Analisando um plist::" #: ../../library/plistlib.rst:13 msgid "plist" -msgstr "" +msgstr "plist" #: ../../library/plistlib.rst:13 msgid "file" @@ -242,4 +289,4 @@ msgstr "arquivo" #: ../../library/plistlib.rst:13 msgid "property list" -msgstr "" +msgstr "lista de propriedades" diff --git a/library/poplib.po b/library/poplib.po index 058d982d2..2b4c72380 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -90,6 +90,8 @@ msgid "" "Raises an :ref:`auditing event ` ``poplib.connect`` with arguments " "``self``, ``host``, ``port``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``ftplib.connect`` com os " +"argumentos ``self``, ``host``, ``port``." #: ../../library/poplib.rst:57 ../../library/poplib.rst:79 msgid "" diff --git a/library/posix.po b/library/posix.po index 855df2823..7565a7056 100644 --- a/library/posix.po +++ b/library/posix.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/posix.rst:2 msgid ":mod:`!posix` --- The most common POSIX system calls" -msgstr "" +msgstr ":mod:`!posix` --- As chamadas de sistema mais comuns do POSIX" #: ../../library/posix.rst:10 msgid "" diff --git a/library/pprint.po b/library/pprint.po index 59fdb6542..5a2188583 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pprint.rst:2 msgid ":mod:`!pprint` --- Data pretty printer" -msgstr "" +msgstr ":mod:`!pprint` --- Impressão bonita de dados" #: ../../library/pprint.rst:10 msgid "**Source code:** :source:`Lib/pprint.py`" diff --git a/library/profile.po b/library/profile.po index fa425db82..574514b88 100644 --- a/library/profile.po +++ b/library/profile.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/pty.po b/library/pty.po index 9c97bcefb..4eec7452d 100644 --- a/library/pty.po +++ b/library/pty.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pty.rst:2 msgid ":mod:`!pty` --- Pseudo-terminal utilities" -msgstr "" +msgstr ":mod:`!pty` --- Utilitários de pseudoterminal" #: ../../library/pty.rst:11 msgid "**Source code:** :source:`Lib/pty.py`" @@ -80,7 +80,7 @@ msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -"No macOS, o uso desta função é inseguro quando misturado com o uso de APIs " +"No macOS, o uso desta função é inseguro quando combinado com o uso de APIs " "de sistema de nível superior, e isso inclui o uso de :mod:`urllib.request`." #: ../../library/pty.rst:42 diff --git a/library/pwd.po b/library/pwd.po index 5f42f7f99..16040d4f1 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -20,16 +20,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pwd.rst:2 msgid ":mod:`!pwd` --- The password database" -msgstr "" +msgstr ":mod:`!pwd` --- A senha do banco de dados" #: ../../library/pwd.rst:10 msgid "" diff --git a/library/py_compile.po b/library/py_compile.po index 09e69744d..ec64209c2 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/py_compile.rst:2 msgid ":mod:`!py_compile` --- Compile Python source files" -msgstr "" +msgstr ":mod:`!py_compile` --- Compila arquivos fonte do Python" #: ../../library/py_compile.rst:10 msgid "**Source code:** :source:`Lib/py_compile.py`" @@ -73,6 +73,19 @@ msgid "" "raised. This function returns the path to byte-compiled file, i.e. whatever " "*cfile* value was used." msgstr "" +"Compila um arquivo fonte para bytecode e grava o arquivo de cache de " +"bytecode. O código-fonte é carregado a partir do arquivo chamado *file*. O " +"bytecode é gravado em *cfile*, cujo padrão é o caminho :pep:`3147`/:pep:" +"`488`, terminando em ``.pyc``. Por exemplo, se *file* for ``/foo/bar/baz." +"py``, o *cfile* será padronizado como ``/foo/bar/__pycache__/baz.cpython-32." +"pyc`` para o Python 3.2. Se *dfile* for especificado, ele será usado em vez " +"de *file* como o nome do arquivo fonte do qual as linhas de origem são " +"obtidas para exibição em tracebacks de exceção. Se *doraise* for verdadeiro, " +"a :exc:`PyCompileError` será levantada quando um erro for encontrado durante " +"a compilação de *file*. Se *doraise* for false (o padrão), uma string de " +"erros será gravada em ``sys.stderr``, mas nenhuma exceção será levantada. " +"Essa função retorna o caminho para o arquivo compilado em bytes, ou seja, " +"qualquer valor *cfile* foi usado." #: ../../library/py_compile.rst:46 msgid "" @@ -192,6 +205,11 @@ msgid "" "invalidation` for more information on how Python invalidates ``.pyc`` files " "at runtime." msgstr "" +"Uma enumeração de métodos possíveis que o interpretador pode usar para " +"determinar se um arquivo de bytecode está atualizado com um arquivo fonte. O " +"arquivo ``.pyc`` indica o modo de invalidação desejado em seu cabeçalho. " +"Veja :ref:`pyc-invalidation` para obter mais informações sobre como o Python " +"invalida arquivos ``.pyc`` em tempo de execução." #: ../../library/py_compile.rst:109 msgid "" @@ -244,12 +262,20 @@ msgid "" "locate source files; it only compiles files named explicitly. The exit " "status is nonzero if one of the files could not be compiled." msgstr "" +"Este módulo pode ser invocado como um script para compilar vários arquivos " +"fonte. Os arquivos nomeados em *filenames* são compilados e o bytecode " +"resultante é armazenado em cache da maneira normal. Este programa não " +"pesquisa uma estrutura de diretórios para localizar arquivos de origem; ele " +"apenas compila arquivos nomeados explicitamente. O status de saída será " +"diferente de zero se um dos arquivos não puder ser compilado." #: ../../library/py_compile.rst:145 msgid "" "Positional arguments are files to compile. If ``-`` is the only parameter, " "the list of files is taken from standard input." msgstr "" +"Argumentos posicionais são arquivos para compilar. Se ``-`` for o único " +"parâmetro, a lista de arquivos será obtida da entrada padrão." #: ../../library/py_compile.rst:150 msgid "Suppress errors output." diff --git a/library/pyclbr.po b/library/pyclbr.po index 4774a5b93..fb567b9bf 100644 --- a/library/pyclbr.po +++ b/library/pyclbr.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pyclbr.rst:2 msgid ":mod:`!pyclbr` --- Python module browser support" -msgstr "" +msgstr ":mod:`!pyclbr` --- Suporte a navegador de módulos do Python" #: ../../library/pyclbr.rst:9 msgid "**Source code:** :source:`Lib/pyclbr.py`" @@ -114,13 +114,15 @@ msgstr "" #: ../../library/pyclbr.rst:60 msgid "Function Objects" -msgstr "Objetos Função" +msgstr "Objetos Function" #: ../../library/pyclbr.rst:64 msgid "" "Class :class:`!Function` instances describe functions defined by def " "statements. They have the following attributes:" msgstr "" +"Instâncias da classe :class:`!Function` descrevem funções definidas por " +"instruções def. Elas têm os seguintes atributos:" #: ../../library/pyclbr.rst:70 msgid "Name of the file in which the function is defined." @@ -141,18 +143,23 @@ msgstr "O número da linha no arquivo em que a definição é iniciada." #: ../../library/pyclbr.rst:90 msgid "For top-level functions, ``None``. For nested functions, the parent." msgstr "" +"Para funções de nível superior, ``None``. Para funções aninhadas, o pai." #: ../../library/pyclbr.rst:97 msgid "" "A :class:`dictionary ` mapping names to descriptors for nested " "functions and classes." msgstr "" +"Um :class:`dicionário ` que mapeia nomes para descritores para funções " +"e classes aninhadas." #: ../../library/pyclbr.rst:105 msgid "" "``True`` for functions that are defined with the :keyword:`async ` prefix, ``False`` otherwise." msgstr "" +"``True`` para funções que são definidas com o prefixo :keyword:`async `. Caso contrário, ``False``." #: ../../library/pyclbr.rst:114 msgid "Class Objects" @@ -164,6 +171,9 @@ msgid "" "statements. They have the same attributes as :class:`Functions ` " "and two more." msgstr "" +"Instâncias da classe :class:`!Class` descrevem classes definidas por " +"instruções class. Elas têm os mesmos atributos que :class:`Functions " +"` e mais dois." #: ../../library/pyclbr.rst:125 msgid "Name of the file in which the class is defined." @@ -180,6 +190,7 @@ msgstr "O nome da classe." #: ../../library/pyclbr.rst:145 msgid "For top-level classes, ``None``. For nested classes, the parent." msgstr "" +"Para classes de nível superior, ``None``. Para classes aninhadas, o pai." #: ../../library/pyclbr.rst:152 msgid "" @@ -195,6 +206,10 @@ msgid "" "which are not discoverable by :func:`readmodule_ex` are listed as a string " "with the class name instead of as :class:`!Class` objects." msgstr "" +"Uma lista de objetos :class:`!Class` que descreve as classes base imediatas " +"da classe que está sendo descrita. Classes nomeadas como superclasses, mas " +"que não podem ser descobertas por :func:`readmodule_ex` são listadas como " +"uma string com o nome da classe em vez de como objetos de :class:`!Class`." #: ../../library/pyclbr.rst:169 msgid "" @@ -202,3 +217,6 @@ msgid "" "be derived from the newer :attr:`children` dictionary, but remains for back-" "compatibility." msgstr "" +"Um :class:`dicionário ` que mapeia nomes de métodos para números de " +"linha. Isso pode ser derivado do dicionário :attr:`children` mais novo, mas " +"permanece para compatibilidade retroativa." diff --git a/library/pydoc.po b/library/pydoc.po index b3cbff901..eef485368 100644 --- a/library/pydoc.po +++ b/library/pydoc.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/pydoc.rst:2 msgid ":mod:`!pydoc` --- Documentation generator and online help system" -msgstr "" +msgstr ":mod:`!pydoc` --- Gerador de documentação e sistema de ajuda online" #: ../../library/pydoc.rst:10 msgid "**Source code:** :source:`Lib/pydoc.py`" @@ -207,8 +207,8 @@ msgid "" "envvar:`!PYTHONDOCS` environment variable to a different URL or to a local " "directory containing the Library Reference Manual pages." msgstr "" -"Os documentos do módulo para os módulos principais são assumidos para " -"residir em ``https://docs.python.org/X.Y/library/`` onde ``X`` e ``Y`` são " +"Os documentos do módulo para os módulos principais são presumidos como " +"residindo em ``https://docs.python.org/X.Y/library/``, sendo ``X`` e ``Y`` " "os números de versão principal e secundária do interpretador Python. Isso " "pode ser substituído definindo a variável de ambiente :envvar:`!PYTHONDOCS` " "para uma URL diferente ou para um diretório local contendo as páginas do " diff --git a/library/pyexpat.po b/library/pyexpat.po index d783733b1..de720f722 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/python.po b/library/python.po index 79312a6e8..f86224910 100644 --- a/library/python.po +++ b/library/python.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Italo Penaforte , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/queue.po b/library/queue.po index 5e24f071a..3ed629006 100644 --- a/library/queue.po +++ b/library/queue.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/quopri.po b/library/quopri.po index 0667052d5..9a63ea414 100644 --- a/library/quopri.po +++ b/library/quopri.po @@ -17,16 +17,17 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/quopri.rst:2 msgid ":mod:`!quopri` --- Encode and decode MIME quoted-printable data" msgstr "" +":mod:`!quopri` --- Codifica e decodifica dados MIME imprimidos entre aspas" #: ../../library/quopri.rst:7 msgid "**Source code:** :source:`Lib/quopri.py`" @@ -117,7 +118,7 @@ msgstr "Codifica e decodifica dados de base64 MIME" #: ../../library/quopri.rst:9 msgid "quoted-printable" -msgstr "" +msgstr "imprimíveis entre aspas" #: ../../library/quopri.rst:9 msgid "encoding" @@ -129,4 +130,4 @@ msgstr "MIME" #: ../../library/quopri.rst:9 msgid "quoted-printable encoding" -msgstr "" +msgstr "codificação de imprimíveis entre aspas" diff --git a/library/random.po b/library/random.po index fe65b74ac..e22346e97 100644 --- a/library/random.po +++ b/library/random.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/random.rst:2 msgid ":mod:`!random` --- Generate pseudo-random numbers" -msgstr "" +msgstr ":mod:`!random` --- Gera números pseudoaleatórios" #: ../../library/random.rst:7 msgid "**Source code:** :source:`Lib/random.py`" @@ -141,6 +141,10 @@ msgid "" "alternative random number generator with a long period and comparatively " "simple update operations." msgstr "" +"`Receita de Complementary-Multiply-with-Carry `_ para um gerador de " +"números aleatórios alternativo compatível com um longo período e operações " +"de atualização comparativamente simples." #: ../../library/random.rst:64 msgid "Bookkeeping functions" @@ -374,7 +378,7 @@ msgid "" msgstr "" "*weights* ou *cum_weights* pode usar qualquer tipo numérico que interopera " "com os valores :class:`float` retornados por :func:`random` (que inclui " -"inteiros, pontos flutuantes, e frações mas exclui decimais). Assume-se que " +"inteiros, pontos flutuantes, e frações mas exclui decimais). Presume-se que " "pesos serão não-negativos e finitos. Uma :exc:`ValueError` é levantada se " "todos os pesos forem zero." @@ -648,7 +652,7 @@ msgstr "" "Nota sobre multithreading: quando duas threads chamam esta função " "simultaneamente, é possível que recebam o mesmo valor de retorno. Isso pode " "ser evitado de três maneiras. 1) Fazer com que cada thread use uma instância " -"diferente do gerador de números aleatórios. 2) Colocar bloqueios em todas as " +"diferente do gerador de números aleatórios. 2) Colocar travas em todas as " "chamadas. 3) Usar a função mais lenta, mas segura para thread :func:" "`normalvariate`." diff --git a/library/re.po b/library/re.po index 533c7175f..0cff61978 100644 --- a/library/re.po +++ b/library/re.po @@ -23,16 +23,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/re.rst:2 msgid ":mod:`!re` --- Regular expression operations" -msgstr "" +msgstr ":mod:`!re` --- Operações com expressões regulares" #: ../../library/re.rst:10 msgid "**Source code:** :source:`Lib/re/`" diff --git a/library/readline.po b/library/readline.po index 16b1f7c98..597a604f5 100644 --- a/library/readline.po +++ b/library/readline.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/readline.rst:2 msgid ":mod:`!readline` --- GNU readline interface" -msgstr "" +msgstr ":mod:`!readline` --- Interface para o GNU readline" #: ../../library/readline.rst:12 msgid "" diff --git a/library/reprlib.po b/library/reprlib.po index d64bc9ba2..45e6e61ce 100644 --- a/library/reprlib.po +++ b/library/reprlib.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/resource.po b/library/resource.po index 3ed25ddb8..fea8a7aae 100644 --- a/library/resource.po +++ b/library/resource.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -52,11 +52,13 @@ msgstr "" #: ../../library/resource.rst:26 msgid "A deprecated alias of :exc:`OSError`." -msgstr "" +msgstr "Um apelido descontinuado de :exc:`OSError`." #: ../../library/resource.rst:28 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" +"Seguindo a :pep:`3151`, esta classe foi transformada em um apelido de :exc:" +"`OSError`." #: ../../library/resource.rst:33 msgid "Resource Limits" @@ -127,6 +129,8 @@ msgid "" "Raises an :ref:`auditing event ` ``resource.setrlimit`` with " "arguments ``resource``, ``limits``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``resource.setrlimit`` com " +"os argumentos ``resource``, ``limits``." #: ../../library/resource.rst:88 msgid "" @@ -156,6 +160,8 @@ msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``resource.prlimit`` com os " +"argumentos ``pid``, ``resource``, ``limits``." #: ../../library/resource.rst:104 msgid ":ref:`Availability `: Linux >= 2.6.36 with glibc >= 2.13." diff --git a/library/rlcompleter.po b/library/rlcompleter.po index 7b320efa7..be5edd1e5 100644 --- a/library/rlcompleter.po +++ b/library/rlcompleter.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/rlcompleter.rst:2 msgid ":mod:`!rlcompleter` --- Completion function for GNU readline" -msgstr "" +msgstr ":mod:`!rlcompleter` --- Função de autocomplemento para GNU readline" #: ../../library/rlcompleter.rst:9 msgid "**Source code:** :source:`Lib/rlcompleter.py`" @@ -67,6 +67,10 @@ msgid "" "`-S` option, the module is automatically imported and configured (see :ref:" "`rlcompleter-config`)." msgstr "" +"O módulo :mod:`!rlcompleter` é projetado para uso com o :ref:`modo " +"interativo ` do Python. A menos que Python seja executado " +"com a opção :option:`-S`, o módulo é automaticamente importado e configurado " +"(veja :ref:`rlcompleter-config`)." #: ../../library/rlcompleter.rst:38 msgid "" @@ -82,7 +86,7 @@ msgstr "Os objetos Completer têm o seguinte método:" #: ../../library/rlcompleter.rst:50 msgid "Return the next possible completion for *text*." -msgstr "" +msgstr "Retorna o próximo completamento possível para *text*." #: ../../library/rlcompleter.rst:52 msgid "" @@ -90,6 +94,9 @@ msgid "" "successively with ``state == 0, 1, 2, ...`` until the method returns " "``None``." msgstr "" +"Quando chamado pelo módulo :mod:`readline`, este método é chamado " +"sucessivamente com ``state == 0, 1, 2, ...`` até que o método retorne " +"``None``." #: ../../library/rlcompleter.rst:56 msgid "" @@ -111,3 +118,9 @@ msgid "" "evaluation of the expression is caught, silenced and :const:`None` is " "returned." msgstr "" +"Se chamado por um nome pontilhado, vai tentar avaliar qualquer coisa sem " +"efeitos colaterais óbvios (as funções não serão avaliadas, mas pode levantar " +"chamadas para :meth:`~object.__getattr__`) até a última parte e encontrar " +"correspondências para o resto por meio da função :func:`dir`. Qualquer " +"exceção levantada durante a avaliação da expressão é capturada, silenciada " +"e :const:`None` é retornado." diff --git a/library/runpy.po b/library/runpy.po index 3316e9828..c145d1333 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/sched.po b/library/sched.po index ed11fc526..3adc22d34 100644 --- a/library/sched.po +++ b/library/sched.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/secrets.po b/library/secrets.po index 05359fb98..21aaa4e40 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -18,16 +18,17 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/secrets.rst:2 msgid ":mod:`!secrets` --- Generate secure random numbers for managing secrets" msgstr "" +":mod:`!secrets` --- Gera números aleatórios seguros para gerenciar segredos" #: ../../library/secrets.rst:16 msgid "**Source code:** :source:`Lib/secrets.py`" diff --git a/library/security_warnings.po b/library/security_warnings.po index 3abd3b0a8..48ea7250d 100644 --- a/library/security_warnings.po +++ b/library/security_warnings.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/security_warnings.rst:6 msgid "Security Considerations" -msgstr "Considerações de segurança" +msgstr "Considerações de Segurança" #: ../../library/security_warnings.rst:8 msgid "The following modules have specific security considerations:" diff --git a/library/select.po b/library/select.po index 8ebe727d7..925d2a5f6 100644 --- a/library/select.po +++ b/library/select.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -43,6 +43,14 @@ msgid "" "(in particular, on Unix, it works on pipes). It cannot be used on regular " "files to determine whether a file has grown since it was last read." msgstr "" +"Este módulo fornece acesso às funções :c:func:`!select` e :c:func:`!poll` " +"disponíveis na maioria dos sistemas operacionais, :c:func:`!devpoll` " +"disponível no Solaris e derivados, :c:func:`!epoll` disponível no Linux 2.5+ " +"e :c:func:`!kqueue` disponível na maioria dos BSD. Observe que no Windows, " +"ele funciona apenas para sockets; em outros sistemas operacionais, ele " +"também funciona para outros tipos de arquivo (em particular, no Unix, ele " +"funciona em pipes). Ele não pode ser usado em arquivos regulares para " +"determinar se um arquivo cresceu desde a última leitura." #: ../../library/select.rst:20 msgid "" @@ -51,6 +59,10 @@ msgid "" "encouraged to use the :mod:`selectors` module instead, unless they want " "precise control over the OS-level primitives used." msgstr "" +"O módulo :mod:`selectors` permite multiplexação de E/S de alto nível e " +"eficiente, construída sobre as primitivas do módulo :mod:`select`. Os " +"usuários são encorajados a usar o módulo :mod:`selectors` em vez disso, a " +"menos que queiram controle preciso sobre as primitivas de nível de SO usadas." #: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." @@ -72,11 +84,13 @@ msgstr "O módulo define o seguinte:" #: ../../library/select.rst:32 msgid "A deprecated alias of :exc:`OSError`." -msgstr "" +msgstr "Um apelido descontinuado de :exc:`OSError`." #: ../../library/select.rst:34 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" +"Seguindo a :pep:`3151`, esta classe foi transformada em um apelido de :exc:" +"`OSError`." #: ../../library/select.rst:40 msgid "" @@ -84,6 +98,9 @@ msgid "" "polling object; see section :ref:`devpoll-objects` below for the methods " "supported by devpoll objects." msgstr "" +"(Suportado somente no Solaris e derivados.) Retorna um objeto de pesquisa ``/" +"dev/poll``; consulte a seção :ref:`devpoll-objects` abaixo para os métodos " +"suportados pelos objetos devpoll." #: ../../library/select.rst:44 msgid "" @@ -92,11 +109,16 @@ msgid "" "func:`!devpoll` will fail. If your program increases this value, :c:func:`!" "devpoll` may return an incomplete list of active file descriptors." msgstr "" +"Objetos :c:func:`!devpoll` são vinculados ao número de descritores de " +"arquivo permitidos no momento da instanciação. Se seu programa reduzir esse " +"valor, :c:func:`!devpoll` falhará. Se seu programa aumentar esse valor, :c:" +"func:`!devpoll` pode retornar uma lista incompleta de descritores de arquivo " +"ativos." #: ../../library/select.rst:50 ../../library/select.rst:79 #: ../../library/select.rst:106 msgid "The new file descriptor is :ref:`non-inheritable `." -msgstr "" +msgstr "O novo descritor de arquivo é :ref:`não herdável `." #: ../../library/select.rst:54 ../../library/select.rst:108 msgid "The new file descriptor is now non-inheritable." diff --git a/library/selectors.po b/library/selectors.po index 56ffb4bca..7c5696a53 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/shelve.po b/library/shelve.po index b60343bf6..ec8081aef 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -21,10 +21,10 @@ msgstr "" "2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/shlex.po b/library/shlex.po index 4989c0f82..ba2ee5def 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/shutil.po b/library/shutil.po index 06568361e..99e08614e 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -128,7 +128,7 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``shutil.copyfile`` com " +"Levanta um :ref:`evento de auditoria ` ``shutil.copyfile`` com os " "argumentos ``src``, ``dst``." #: ../../library/shutil.rst:72 @@ -185,7 +185,7 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copymode`` with " "arguments ``src``, ``dst``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``shutil.copymode`` com " +"Levanta um :ref:`evento de auditoria ` ``shutil.copymode`` com os " "argumentos ``src``, ``dst``." #: ../../library/shutil.rst:108 @@ -269,7 +269,7 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``shutil.copystat`` com " +"Levanta um :ref:`evento de auditoria ` ``shutil.copystat`` com os " "argumentos ``src``, ``dst``." #: ../../library/shutil.rst:155 @@ -461,7 +461,7 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``shutil.copytree`` com " +"Levanta um :ref:`evento de auditoria ` ``shutil.copytree`` com os " "argumentos ``src``, ``dst``." #: ../../library/shutil.rst:277 @@ -541,6 +541,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.rmtree`` with arguments " "``path``, ``dir_fd``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``shutil.rmtree`` com os " +"argumentos ``path``, ``dir_fd``." #: ../../library/shutil.rst:332 msgid "" @@ -621,8 +623,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." msgstr "" -"Levanta um :ref:`evento auditoria ` ``shutil.move`` com argumentos " -"``src``, ``dst``." +"Levanta um :ref:`evento de auditoria ` ``shutil.move`` com os " +"argumentos ``src``, ``dst``." #: ../../library/shutil.rst:382 msgid "" @@ -665,7 +667,7 @@ msgstr "No Windows, *path* pode agora ser um arquivo ou diretório." #: ../../library/shutil.rst:416 msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`Disponibilidade `: Unix, Windows." +msgstr ":ref:`Disponibilidade`: Unix, Windows." #: ../../library/shutil.rst:420 msgid "Change owner *user* and/or *group* of the given *path*." @@ -688,7 +690,7 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``shutil.chown`` com " +"Levanta um :ref:`evento de auditoria ` ``shutil.chown`` com os " "argumentos ``path``, ``user``, ``group``." #: ../../library/shutil.rst:429 @@ -957,7 +959,7 @@ msgid "" "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``shutil.make_archive`` com " -"argumentos ``base_name``, ``format``, ``root_dir``, ``base_dir``." +"os argumentos ``base_name``, ``format``, ``root_dir``, ``base_dir``." #: ../../library/shutil.rst:620 msgid "" @@ -1042,7 +1044,7 @@ msgid "" "Further arguments are passed as keyword arguments: *owner*, *group*, " "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -"*function* é o chamável que será usado para descompactar arquivos. O " +"*function* é o chamável que será usado para desempacotar arquivos. O " "chamável receberá o *base_name* do arquivo a ser criado, seguido pelo " "*base_dir* (cujo padrão é :data:`os.curdir`) para iniciar o arquivamento. " "Outros argumentos são passados ​​como argumentos nomeados *owner*, *group*, " @@ -1084,7 +1086,7 @@ msgstr "Remove o formato de arquivo *name* da lista de formatos suportados." #: ../../library/shutil.rst:684 msgid "Unpack an archive. *filename* is the full path of the archive." -msgstr "Descompacta um arquivo. *filename* é o caminho completo do arquivo." +msgstr "Desempacota um arquivo. *filename* é o caminho completo do arquivo." #: ../../library/shutil.rst:686 msgid "" @@ -1092,7 +1094,7 @@ msgid "" "unpacked. If not provided, the current working directory is used." msgstr "" "*extract_dir* é o nome do diretório de destino onde o arquivo é " -"descompactado. Se não for fornecido, o diretório de trabalho atual será " +"desempacotado. Se não for fornecido, o diretório de trabalho atual será " "usado." #: ../../library/shutil.rst:689 @@ -1106,7 +1108,7 @@ msgstr "" "*format* é o formato do arquivo: um de \"zip\", \"tar\", \"gztar\", " "\"bztar\" ou \"xztar\". Ou qualquer outro formato registrado com :func:" "`register_unpack_format`. Se não for fornecido, :func:`unpack_archive` irá " -"usar a extensão do nome do arquivo e ver se um descompactador foi registrado " +"usar a extensão do nome do arquivo e ver se um desempacotador foi registrado " "para essa extensão. Caso nenhum seja encontrado, uma :exc:`ValueError` é " "levantada." @@ -1126,7 +1128,7 @@ msgid "" "arguments ``filename``, ``extract_dir``, ``format``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``shutil.unpack_archive`` " -"com argumentos ``filename``, ``extract_dir``, ``format``." +"com os argumentos ``filename``, ``extract_dir``, ``format``." #: ../../library/shutil.rst:708 msgid "" @@ -1152,7 +1154,7 @@ msgid "" "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -"Registra um formato de descompactação. *name* é o nome do formato e " +"Registra um formato de desempacotamento. *name* é o nome do formato e " "*extensions* é uma lista de extensões correspondentes ao formato, como ``." "zip`` para arquivos Zip." @@ -1194,7 +1196,7 @@ msgstr "" #: ../../library/shutil.rst:741 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -"Cancela o registro de um formato de descompactação. *name* é o nome do " +"Cancela o registro de um formato de desempacotamento. *name* é o nome do " "formato." #: ../../library/shutil.rst:746 @@ -1211,7 +1213,7 @@ msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -"*zip*: arquivo ZIP (descompactar arquivos compactados funciona apenas se o " +"*zip*: arquivo ZIP (desempacotar arquivos compactados funciona apenas se o " "módulo correspondente estiver disponível)." #: ../../library/shutil.rst:754 diff --git a/library/signal.po b/library/signal.po index 45e66c4c9..d294802dd 100644 --- a/library/signal.po +++ b/library/signal.po @@ -22,24 +22,24 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/signal.rst:2 msgid ":mod:`!signal` --- Set handlers for asynchronous events" -msgstr "" +msgstr ":mod:`!signal` --- Define manipuladores para eventos assíncronos" #: ../../library/signal.rst:7 msgid "**Source code:** :source:`Lib/signal.py`" -msgstr "" +msgstr "**Código-fonte:** :source:`Lib/signal.py`" #: ../../library/signal.rst:11 msgid "This module provides mechanisms to use signal handlers in Python." -msgstr "" +msgstr "Este módulo fornece mecanismos para usar signal handlers em Python" #: ../../library/signal.rst:15 msgid "General rules" @@ -511,6 +511,8 @@ msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``signal.pthread_kill`` com " +"os argumentos ``thread_id``, ``signalnum``." #: ../../library/signal.rst:439 msgid "See the man page :manpage:`pthread_kill(3)` for further information." diff --git a/library/site.po b/library/site.po index abc1bc987..22f0a4b3e 100644 --- a/library/site.po +++ b/library/site.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -399,7 +399,7 @@ msgstr "instrução" #: ../../library/site.rst:52 msgid "import" -msgstr "importação" +msgstr "import" #: ../../library/site.rst:77 msgid "package" diff --git a/library/smtplib.po b/library/smtplib.po index 334bc24e1..49b659828 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -326,6 +326,8 @@ msgid "" "Raises an :ref:`auditing event ` ``smtplib.connect`` with " "arguments ``self``, ``host``, ``port``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``smtplib.connect`` com os " +"argumentos ``self``, ``host``, ``port``." #: ../../library/smtplib.rst:258 msgid "" diff --git a/library/sndhdr.po b/library/sndhdr.po index 47a0d951d..f0c5bce34 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/socket.po b/library/socket.po index de3421752..d3431aa7d 100644 --- a/library/socket.po +++ b/library/socket.po @@ -28,10 +28,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -521,11 +521,13 @@ msgstr "Exceções" #: ../../library/socket.rst:288 msgid "A deprecated alias of :exc:`OSError`." -msgstr "" +msgstr "Um apelido descontinuado de :exc:`OSError`." #: ../../library/socket.rst:290 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" +"Seguindo a :pep:`3151`, esta classe foi transformada em um apelido de :exc:" +"`OSError`." #: ../../library/socket.rst:296 msgid "" @@ -923,6 +925,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.__new__`` com os " +"argumentos ``self``, ``family``, ``type``, ``protocol``." #: ../../library/socket.rst:733 msgid "The AF_CAN family was added. The AF_RDS family was added." @@ -1155,6 +1159,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.getaddrinfo`` com " +"os argumentos ``host``, ``port``, ``family``, ``type``, ``protocol``." #: ../../library/socket.rst:944 msgid "" @@ -1199,6 +1205,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.gethostbyname`` " +"com o argumento ``hostname``." #: ../../library/socket.rst:982 ../../library/socket.rst:998 #: ../../library/socket.rst:1011 ../../library/socket.rst:1026 @@ -1234,6 +1242,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.gethostname`` sem " +"argumentos." #: ../../library/socket.rst:1008 msgid "" @@ -1257,6 +1267,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.gethostbyaddr`` " +"com o argumento ``ip_address``." #: ../../library/socket.rst:1031 msgid "" @@ -1282,6 +1294,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.getnameinfo`` com " +"o argumento ``sockaddr``." #: ../../library/socket.rst:1048 msgid "" @@ -1304,6 +1318,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.getservbyname`` " +"com os argumentos ``servicename``, ``protocolname``." #: ../../library/socket.rst:1070 msgid "" @@ -1317,6 +1333,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.getservbyport`` " +"com os argumentos ``port`` e ``protocolname``." #: ../../library/socket.rst:1081 msgid "" @@ -1416,7 +1434,7 @@ msgstr "" #: ../../library/socket.rst:1165 ../../library/socket.rst:1185 msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`Disponibilidade `: Unix, Windows." +msgstr ":ref:`Disponibilidade`: Unix, Windows." #: ../../library/socket.rst:1167 ../../library/socket.rst:1187 msgid "Windows support added" @@ -1506,6 +1524,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.sethostname`` com " +"o argumento ``name``." #: ../../library/socket.rst:1263 ../../library/socket.rst:1702 #: ../../library/socket.rst:1746 @@ -1650,6 +1670,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.bind`` com os " +"argumentos ``self``, ``address``." #: ../../library/socket.rst:1405 msgid "" @@ -1702,6 +1724,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.connect`` com os " +"argumentos ``self``, ``address``." #: ../../library/socket.rst:1441 msgid "" @@ -2039,6 +2063,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.sendto`` com os " +"argumentos ``self``, ``address``." #: ../../library/socket.rst:1825 msgid "" @@ -2076,6 +2102,8 @@ msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``socket.sendmsg`` com os " +"argumentos ``self``, ``address``." #: ../../library/socket.rst:1869 msgid "" diff --git a/library/socketserver.po b/library/socketserver.po index 69798e6cc..ed4df2864 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/spwd.po b/library/spwd.po index 458489160..b4418c40b 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/sqlite3.po b/library/sqlite3.po index 820579e83..f0f7fb3f5 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -24,10 +24,10 @@ msgstr "" "Last-Translator: i17obot , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -52,7 +52,7 @@ msgstr "" "disco que não requer um processo de servidor separado e permite acessar o " "banco de dados usando uma variante não padrão da linguagem de consulta SQL. " "Algumas aplicações podem usar SQLite para armazenamento interno de dados. " -"Também é possível prototipar uma aplicação usando SQLite e, em seguida, " +"Também é possível prototipar um aplicativo usando SQLite e, em seguida, " "portar o código para um banco de dados maior, como PostgreSQL ou Oracle." #: ../../library/sqlite3.rst:32 @@ -440,12 +440,16 @@ msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect`` with argument " "``database``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sqlite3.connect`` com o " +"argumento ``database``." #: ../../library/sqlite3.rst:347 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.connect/handle`` with " "argument ``connection_handle``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sqlite3.connect/handle`` " +"com o argumento ``connection_handle``." #: ../../library/sqlite3.rst:349 msgid "Added the *uri* parameter." @@ -1154,6 +1158,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sqlite3." +"enable_load_extension`` com os argumentos ``connection``, ``enabled``." #: ../../library/sqlite3.rst:1024 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." @@ -1181,6 +1187,8 @@ msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sqlite3.load_extension`` " +"com os argumentos ``connection``, ``path``." #: ../../library/sqlite3.rst:1077 msgid "Added the ``sqlite3.load_extension`` auditing event." @@ -1199,7 +1207,7 @@ msgstr "" #: ../../library/sqlite3.rst:1104 ../../library/sqlite3.rst:1176 msgid ":ref:`sqlite3-howto-encoding`" -msgstr "" +msgstr ":ref:`sqlite3-howto-encoding`" #: ../../library/sqlite3.rst:1109 msgid "Create a backup of an SQLite database." @@ -1461,7 +1469,7 @@ msgstr "" #: ../../library/sqlite3.rst:1395 ../../library/sqlite3.rst:1681 #: ../../library/sqlite3.rst:1704 msgid "See :ref:`sqlite3-howto-row-factory` for more details." -msgstr "" +msgstr "Consulte :ref:`sqlite3-howto-row-factory` para mais detalhes." #: ../../library/sqlite3.rst:1399 msgid "" @@ -1472,7 +1480,7 @@ msgstr "" #: ../../library/sqlite3.rst:1404 msgid "See :ref:`sqlite3-howto-encoding` for more details." -msgstr "" +msgstr "Consulte :ref:`sqlite3-howto-encoding` para mais detalhes." #: ../../library/sqlite3.rst:1408 msgid "" @@ -1932,7 +1940,7 @@ msgstr "" #: ../../library/sqlite3.rst:1908 ../../library/sqlite3.rst:1925 msgid "Python type" -msgstr "Tipo Python" +msgstr "Python type" #: ../../library/sqlite3.rst:1908 ../../library/sqlite3.rst:1925 msgid "SQLite type" @@ -2045,7 +2053,7 @@ msgstr "" #: ../../library/sqlite3.rst:1984 msgid "Command-line interface" -msgstr "" +msgstr "Interface de linha de comando" #: ../../library/sqlite3.rst:1986 msgid "" @@ -2391,11 +2399,11 @@ msgstr "" #: ../../library/sqlite3.rst:2595 msgid ":ref:`unicode-howto`" -msgstr "" +msgstr ":ref:`unicode-howto`" #: ../../library/sqlite3.rst:2601 msgid "Explanation" -msgstr "Explicação" +msgstr "Explanação" #: ../../library/sqlite3.rst:2607 msgid "Transaction control" diff --git a/library/ssl.po b/library/ssl.po index 5f7912c24..fd8e19bb2 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -25,10 +25,10 @@ msgstr "" "2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/stat.po b/library/stat.po index 98d5041f1..de5f73a62 100644 --- a/library/stat.po +++ b/library/stat.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/stat.rst:2 msgid ":mod:`!stat` --- Interpreting :func:`~os.stat` results" -msgstr "" +msgstr ":mod:`!stat` --- Interpretando resultados de :func:`~os.stat`" #: ../../library/stat.rst:10 msgid "**Source code:** :source:`Lib/stat.py`" @@ -40,62 +40,75 @@ msgid "" "exist). For complete details about the :c:func:`stat`, :c:func:`!fstat` " "and :c:func:`!lstat` calls, consult the documentation for your system." msgstr "" +"O módulo :mod:`stat` define constantes e funções para interpretar os " +"resultados de :func:`os.stat`, :func:`os.fstat` e :func:`os.lstat` (se " +"existirem). Para detalhes completos sobre chamadas :c:func:`stat`, :c:func:`!" +"fstat` e :c:func:`!lstat`, consulte a documentação do seu sistema." #: ../../library/stat.rst:19 msgid "The stat module is backed by a C implementation." -msgstr "" +msgstr "O módulo stat é apoiado por uma implementação C." #: ../../library/stat.rst:22 msgid "" "The :mod:`stat` module defines the following functions to test for specific " "file types:" msgstr "" +"O módulo :mod:`stat` define as seguintes funções para testar tipos de " +"arquivos específicos:" #: ../../library/stat.rst:28 msgid "Return non-zero if the mode is from a directory." -msgstr "" +msgstr "Retorna diferente de zero se o modo for de um diretório." #: ../../library/stat.rst:33 msgid "Return non-zero if the mode is from a character special device file." msgstr "" +"Retorna diferente de zero se o modo for de um arquivo de dispositivo " +"especial de caractere." #: ../../library/stat.rst:38 msgid "Return non-zero if the mode is from a block special device file." msgstr "" +"Retorna diferente de zero se o modo for de um arquivo de dispositivo " +"especial de bloco." #: ../../library/stat.rst:43 msgid "Return non-zero if the mode is from a regular file." -msgstr "" +msgstr "Retorna diferente de zero se o modo for de um arquivo regular." #: ../../library/stat.rst:48 msgid "Return non-zero if the mode is from a FIFO (named pipe)." msgstr "" +"Retorna diferente de zero se o modo for de um FIFO (encadeamento nomeado)." #: ../../library/stat.rst:53 msgid "Return non-zero if the mode is from a symbolic link." -msgstr "" +msgstr "Retorna diferente de zero se o modo for de um link simbólico." #: ../../library/stat.rst:58 msgid "Return non-zero if the mode is from a socket." -msgstr "" +msgstr "Retorna diferente de zero se o modo for de um soquete." #: ../../library/stat.rst:62 msgid "Return non-zero if the mode is from a door." -msgstr "" +msgstr "Retorna diferente de zero se o modo for de uma porta." #: ../../library/stat.rst:68 msgid "Return non-zero if the mode is from an event port." -msgstr "" +msgstr "Retorna diferente de zero se o modo for de uma porta de eventos." #: ../../library/stat.rst:74 msgid "Return non-zero if the mode is from a whiteout." -msgstr "" +msgstr "Retorna diferente de zero se o modo for de um apagamento." #: ../../library/stat.rst:78 msgid "" "Two additional functions are defined for more general manipulation of the " "file's mode:" msgstr "" +"Duas funções adicionais são definidas para manipulação mais geral do modo do " +"arquivo:" #: ../../library/stat.rst:84 msgid "" @@ -103,12 +116,17 @@ msgid "" "---that is, the file's permission bits, plus the sticky bit, set-group-id, " "and set-user-id bits (on systems that support them)." msgstr "" +"Retorna a parte do modo do arquivo que pode ser definido por :func:`os." +"chmod` --- ou seja, os bits de permissão do arquivo, mais os bits sticky " +"bit, set-group-id e set-user-id (em sistemas que têm suporte a eles)." #: ../../library/stat.rst:91 msgid "" "Return the portion of the file's mode that describes the file type (used by " "the :func:`!S_IS\\*` functions above)." msgstr "" +"Retorna a parte do modo do arquivo que descreve o tipo de arquivo (usado " +"pelas funções :func:`!S_IS\\*` acima)." #: ../../library/stat.rst:94 msgid "" @@ -119,6 +137,12 @@ msgid "" "information about a file that isn't handled by :mod:`os.path`, like the " "tests for block and character devices." msgstr "" +"Normalmente, você usaria as funções :func:`!os.path.is\\*` para testar o " +"tipo de um arquivo; as funções aqui são úteis quando você está fazendo " +"vários testes do mesmo arquivo e deseja evitar a sobrecarga da chamada de " +"sistema :c:func:`stat` para cada teste. Eles também são úteis ao verificar " +"informações sobre um arquivo que não é manipulado por :mod:`os.path`, como " +"os testes para dispositivos de blocos e caracteres." #: ../../library/stat.rst:101 msgid "Example::" @@ -129,58 +153,65 @@ msgid "" "An additional utility function is provided to convert a file's mode in a " "human readable string:" msgstr "" +"Uma função utilitária adicional é fornecida para converter o modo de um " +"arquivo em uma string legível por humanos:" #: ../../library/stat.rst:134 msgid "Convert a file's mode to a string of the form '-rwxrwxrwx'." -msgstr "" +msgstr "Converte o modo de um arquivo em uma string no formato '-rwxrwxrwx'." #: ../../library/stat.rst:138 msgid "" "The function supports :data:`S_IFDOOR`, :data:`S_IFPORT` and :data:`S_IFWHT`." msgstr "" +"A função tem suporte a :data:`S_IFDOOR`, :data:`S_IFPORT` e :data:`S_IFWHT`." #: ../../library/stat.rst:143 msgid "" "All the variables below are simply symbolic indexes into the 10-tuple " "returned by :func:`os.stat`, :func:`os.fstat` or :func:`os.lstat`." msgstr "" +"Todas as variáveis ​​abaixo são simplesmente índices simbólicos nas 10 tuplas " +"retornadas por :func:`os.stat`, :func:`os.fstat` ou :func:`os.lstat`." #: ../../library/stat.rst:149 msgid "Inode protection mode." -msgstr "" +msgstr "Modo de proteção de nó-i." #: ../../library/stat.rst:154 msgid "Inode number." -msgstr "" +msgstr "Número de nó-i." #: ../../library/stat.rst:159 msgid "Device inode resides on." -msgstr "" +msgstr "Nó-i em que o dispositivo reside." #: ../../library/stat.rst:164 msgid "Number of links to the inode." -msgstr "" +msgstr "Número de links para o nó-i." #: ../../library/stat.rst:169 msgid "User id of the owner." -msgstr "" +msgstr "O ID de usuário para o proprietário." #: ../../library/stat.rst:174 msgid "Group id of the owner." -msgstr "" +msgstr "O ID de grupo para o proprietário." #: ../../library/stat.rst:179 msgid "" "Size in bytes of a plain file; amount of data waiting on some special files." msgstr "" +"Tamanho em bytes de um arquivo simples; quantidade de dados aguardando em " +"alguns arquivos especiais." #: ../../library/stat.rst:184 msgid "Time of last access." -msgstr "" +msgstr "Hora do último acesso." #: ../../library/stat.rst:189 msgid "Time of last modification." -msgstr "" +msgstr "Hora da última modificação." #: ../../library/stat.rst:194 msgid "" @@ -188,6 +219,10 @@ msgid "" "Unix) is the time of the last metadata change, and, on others (like " "Windows), is the creation time (see platform documentation for details)." msgstr "" +"O \"ctime\" conforme relatado pelo sistema operacional. Em alguns sistemas " +"(como Unix) é o horário da última alteração de metadados e, em outros (como " +"Windows), é o horário de criação (consulte a documentação da plataforma para " +"obter detalhes)." #: ../../library/stat.rst:198 msgid "" @@ -200,72 +235,89 @@ msgid "" "open. The meaning of the size field for other character and block devices " "varies more, depending on the implementation of the underlying system call." msgstr "" +"A interpretação do “tamanho do arquivo” muda de acordo com o tipo de " +"arquivo. Para arquivos simples, este é o tamanho do arquivo em bytes. Para " +"FIFOs e soquetes na maioria dos tipos de Unix (incluindo Linux em " +"particular), o \"tamanho\" é o número de bytes aguardando para serem lidos " +"no momento da chamada para :func:`os.stat`, :func:`os.fstat` ou :func:`os." +"lstat`; isso às vezes pode ser útil, especialmente para pesquisar um desses " +"arquivos especiais após uma abertura sem bloqueio. O significado do campo de " +"tamanho para outros dispositivos de caracteres e blocos varia mais, " +"dependendo da implementação da chamada de sistema subjacente." #: ../../library/stat.rst:207 msgid "The variables below define the flags used in the :data:`ST_MODE` field." msgstr "" +"As variáveis ​​abaixo definem os sinalizadores utilizadas no campo :data:" +"`ST_MODE`." #: ../../library/stat.rst:209 msgid "" "Use of the functions above is more portable than use of the first set of " "flags:" msgstr "" +"O uso das funções acima é mais portátil do que o uso do primeiro conjunto de " +"sinalizadores:" #: ../../library/stat.rst:213 msgid "Socket." -msgstr "" +msgstr "Soquete." #: ../../library/stat.rst:217 msgid "Symbolic link." -msgstr "" +msgstr "Link simbólico." #: ../../library/stat.rst:221 msgid "Regular file." -msgstr "" +msgstr "Arquivo regular." #: ../../library/stat.rst:225 msgid "Block device." -msgstr "" +msgstr "Dispositivo de bloco." #: ../../library/stat.rst:229 msgid "Directory." -msgstr "" +msgstr "Diretório." #: ../../library/stat.rst:233 msgid "Character device." -msgstr "" +msgstr "Dispositivo de caracteres." #: ../../library/stat.rst:237 msgid "FIFO." -msgstr "" +msgstr "FIFO." #: ../../library/stat.rst:241 msgid "Door." -msgstr "" +msgstr "Porta." #: ../../library/stat.rst:247 msgid "Event port." -msgstr "" +msgstr "Porta de eventos." #: ../../library/stat.rst:253 msgid "Whiteout." -msgstr "" +msgstr "Apagamento." #: ../../library/stat.rst:259 msgid "" ":data:`S_IFDOOR`, :data:`S_IFPORT` or :data:`S_IFWHT` are defined as 0 when " "the platform does not have support for the file types." msgstr "" +":data:`S_IFDOOR`, :data:`S_IFPORT` ou :data:`S_IFWHT` são definidos como 0 " +"quando a plataforma não possui suporte para os tipos de arquivo." #: ../../library/stat.rst:262 msgid "" "The following flags can also be used in the *mode* argument of :func:`os." "chmod`:" msgstr "" +"Os seguintes sinalizadores também podem ser usados ​​no argumento *mode* de :" +"func:`os.chmod`:" #: ../../library/stat.rst:266 msgid "Set UID bit." -msgstr "" +msgstr "Define o bit de UID." #: ../../library/stat.rst:270 msgid "" @@ -277,6 +329,13 @@ msgid "" "execution bit (:data:`S_IXGRP`) set, the set-group-ID bit indicates " "mandatory file/record locking (see also :data:`S_ENFMT`)." msgstr "" +"Bit de set-group-ID. Este bit tem vários usos especiais. Para um diretório, " +"indica que a semântica BSD deve ser usada para esse diretório: os arquivos " +"criados lá herdam seu ID de grupo do diretório, não do ID de grupo efetivo " +"do processo de criação, e os diretórios criados lá também receberão o " +"conjunto de bits :data:`S_ISGID`. Para um arquivo que não possui o bit de " +"execução de grupo (:data:`S_IXGRP`) definido, o bit de set-group-ID indica " +"trava obrigatória de arquivo/registro (veja também :data:`S_ENFMT`)." #: ../../library/stat.rst:281 msgid "" @@ -284,34 +343,38 @@ msgid "" "that directory can be renamed or deleted only by the owner of the file, by " "the owner of the directory, or by a privileged process." msgstr "" +"Sticky bit. Quando este bit é definido em um diretório, significa que um " +"arquivo nesse diretório pode ser renomeado ou excluído apenas pelo " +"proprietário do arquivo, pelo proprietário do diretório ou por um processo " +"privilegiado." #: ../../library/stat.rst:287 msgid "Mask for file owner permissions." -msgstr "" +msgstr "Máscara para permissões de proprietário de arquivo." #: ../../library/stat.rst:291 msgid "Owner has read permission." -msgstr "" +msgstr "Proprietário tem permissão de leitura." #: ../../library/stat.rst:295 msgid "Owner has write permission." -msgstr "" +msgstr "Proprietário tem permissão de escrita." #: ../../library/stat.rst:299 msgid "Owner has execute permission." -msgstr "" +msgstr "Proprietário tem permissão de execução." #: ../../library/stat.rst:303 msgid "Mask for group permissions." -msgstr "" +msgstr "Máscara para permissões de grupo." #: ../../library/stat.rst:307 msgid "Group has read permission." -msgstr "" +msgstr "Grupo tem permissão de leitura." #: ../../library/stat.rst:311 msgid "Group has write permission." -msgstr "" +msgstr "Grupo tem permissão de escrita." #: ../../library/stat.rst:315 msgid "Group has execute permission." @@ -319,19 +382,19 @@ msgstr "Grupo tem permissão de execução." #: ../../library/stat.rst:319 msgid "Mask for permissions for others (not in group)." -msgstr "" +msgstr "Máscara para permissões para outros (não no grupo)." #: ../../library/stat.rst:323 msgid "Others have read permission." -msgstr "" +msgstr "Outros têm permissão de leitura." #: ../../library/stat.rst:327 msgid "Others have write permission." -msgstr "" +msgstr "Outros têm permissão de escrita." #: ../../library/stat.rst:331 msgid "Others have execute permission." -msgstr "" +msgstr "Outros têm permissão de execução." #: ../../library/stat.rst:335 msgid "" @@ -339,66 +402,73 @@ msgid "" "`S_ISGID`: file/record locking is enforced on files that do not have the " "group execution bit (:data:`S_IXGRP`) set." msgstr "" +"Aplicação de trava de arquivo do System V. Este sinalizador é compartilhada " +"com :data:`S_ISGID`: a trava de arquivo/registro é aplicada em arquivos que " +"não possuem o bit de execução de grupo (:data:`S_IXGRP`) definido." #: ../../library/stat.rst:341 msgid "Unix V7 synonym for :data:`S_IRUSR`." -msgstr "" +msgstr "Sinônimo Unix V7 para :data:`S_IRUSR`." #: ../../library/stat.rst:345 msgid "Unix V7 synonym for :data:`S_IWUSR`." -msgstr "" +msgstr "Sinônimo Unix V7 para :data:`S_IWUSR`." #: ../../library/stat.rst:349 msgid "Unix V7 synonym for :data:`S_IXUSR`." -msgstr "" +msgstr "Sinônimo Unix V7 para :data:`S_IXUSR`." #: ../../library/stat.rst:351 msgid "" "The following flags can be used in the *flags* argument of :func:`os." "chflags`:" msgstr "" +"Os seguintes sinalizadores podem ser usados ​​no argumento *flags* de :func:" +"`os.chflags`:" #: ../../library/stat.rst:355 msgid "Do not dump the file." -msgstr "" +msgstr "Não despeja o arquivo." #: ../../library/stat.rst:359 ../../library/stat.rst:387 msgid "The file may not be changed." -msgstr "" +msgstr "O arquivo não pode ser alterado." #: ../../library/stat.rst:363 ../../library/stat.rst:391 msgid "The file may only be appended to." -msgstr "" +msgstr "O arquivo só pode sofrer acréscimos." #: ../../library/stat.rst:367 msgid "The directory is opaque when viewed through a union stack." -msgstr "" +msgstr "O diretório é opaco quando visualizado por meio de uma pilha de união." #: ../../library/stat.rst:371 ../../library/stat.rst:395 msgid "The file may not be renamed or deleted." -msgstr "" +msgstr "O arquivo não pode ser renomeado ou excluído." #: ../../library/stat.rst:375 msgid "The file is stored compressed (macOS 10.6+)." -msgstr "" +msgstr "O arquivo é armazenado compactado (macOS 10.6+)." #: ../../library/stat.rst:379 msgid "The file should not be displayed in a GUI (macOS 10.5+)." -msgstr "" +msgstr "O arquivo não deve ser exibido em uma GUI (macOS 10.5+)." #: ../../library/stat.rst:383 msgid "The file may be archived." -msgstr "" +msgstr "O arquivo não pode ser arquivado." #: ../../library/stat.rst:399 msgid "The file is a snapshot file." -msgstr "" +msgstr "O arquivo é um arquivo de captura (snapshot)." #: ../../library/stat.rst:401 msgid "" "See the \\*BSD or macOS systems man page :manpage:`chflags(2)` for more " "information." msgstr "" +"Consulte a página man dos sistemas \\*BSD ou macOS :manpage:`chflags(2)` " +"para obter mais informações." #: ../../library/stat.rst:403 msgid "" @@ -408,6 +478,11 @@ msgid "" "library/windows/desktop/gg258117.aspx>`_ for more detail on the meaning of " "these constants." msgstr "" +"No Windows, as seguintes constantes de atributos de arquivo estão " +"disponíveis para uso ao testar bits no membro ``st_file_attributes`` " +"retornado por :func:`os.stat`. Consulte a `documentação da API do Windows " +"`_ " +"para obter mais detalhes sobre o significado dessas constantes." #: ../../library/stat.rst:429 msgid "" @@ -415,3 +490,6 @@ msgid "" "``st_reparse_tag`` member returned by :func:`os.lstat`. These are well-known " "constants, but are not an exhaustive list." msgstr "" +"No Windows, as seguintes constantes estão disponíveis para comparação com o " +"membro ``st_reparse_tag`` retornado por :func:`os.lstat`. Estas são " +"constantes bem conhecidas, mas não são uma lista exaustiva." diff --git a/library/statistics.po b/library/statistics.po index d4bf665c3..ed342ed30 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -24,16 +24,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/statistics.rst:2 msgid ":mod:`!statistics` --- Mathematical statistics functions" -msgstr "" +msgstr ":mod:`!statistics` --- Funções estatísticas" #: ../../library/statistics.rst:12 msgid "**Source code:** :source:`Lib/statistics.py`" @@ -186,7 +186,7 @@ msgstr ":func:`multimode`" #: ../../library/statistics.rst:84 msgid "List of modes (most common values) of discrete or nominal data." -msgstr "" +msgstr "Lista de modas (valores mais comuns) de dados discretos ou nominais." #: ../../library/statistics.rst:85 msgid ":func:`quantiles`" @@ -242,36 +242,37 @@ msgstr "Variância amostral dos dados." #: ../../library/statistics.rst:102 msgid "Statistics for relations between two inputs" -msgstr "" +msgstr "Estatísticas para relações entre duas entradas" #: ../../library/statistics.rst:104 msgid "" "These functions calculate statistics regarding relations between two inputs." msgstr "" +"Essas funções calculam estatísticas sobre relações entre duas entradas." #: ../../library/statistics.rst:107 msgid ":func:`covariance`" -msgstr "" +msgstr ":func:`covariance`" #: ../../library/statistics.rst:107 msgid "Sample covariance for two variables." -msgstr "" +msgstr "Covariância amostral para duas variáveis." #: ../../library/statistics.rst:108 msgid ":func:`correlation`" -msgstr "" +msgstr ":func:`correlation`" #: ../../library/statistics.rst:108 msgid "Pearson and Spearman's correlation coefficients." -msgstr "" +msgstr "Coeficientes de correlação de Pearson e Spearman." #: ../../library/statistics.rst:109 msgid ":func:`linear_regression`" -msgstr "" +msgstr ":func:`linear_regression`" #: ../../library/statistics.rst:109 msgid "Slope and intercept for simple linear regression." -msgstr "" +msgstr "Inclinação e intersecção para regressão linear simples." #: ../../library/statistics.rst:114 msgid "Function details" @@ -321,6 +322,11 @@ msgid "" "a more robust, although less efficient, measure of `central tendency " "`_, see :func:`median`." msgstr "" +"A média é fortemente afetada por `outliers `_ (valor atípico) e não é necessariamente um exemplo típico dos " +"pontos de dados. Para uma medida mais robusta, embora menos eficiente, de " +"`tendência central `_, " +"veja :func:`median`." #: ../../library/statistics.rst:155 msgid "" @@ -359,16 +365,21 @@ msgid "" "for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at " "30%, and a final exam at 30%:" msgstr "" +"A ponderação opcional é suportada. Por exemplo, um professor atribui uma " +"nota para um curso ponderando questionários em 20%, trabalhos de casa em " +"20%, um exame de meio de período em 30% e um exame final em 30%:" #: ../../library/statistics.rst:186 msgid "" "If *weights* is supplied, it must be the same length as the *data* or a :exc:" "`ValueError` will be raised." msgstr "" +"Se *weights* for fornecido, deve ter o mesmo comprimento que *data* ou uma :" +"exc:`ValueError` será levantada." #: ../../library/statistics.rst:191 ../../library/statistics.rst:259 msgid "Added support for *weights*." -msgstr "" +msgstr "Adicionado suporte a *weights*." #: ../../library/statistics.rst:197 msgid "Convert *data* to floats and compute the geometric mean." @@ -409,6 +420,9 @@ msgid "" "numbers. If *weights* is omitted or ``None``, then equal weighting is " "assumed." msgstr "" +"Retorna a média harmônica de *data*, uma sequência ou iterável de números de " +"valor real. Se *weights* for omitido ou ``None``, então a ponderação igual é " +"presumida." #: ../../library/statistics.rst:224 msgid "" @@ -417,6 +431,10 @@ msgid "" "*b* and *c* will be equivalent to ``3/(1/a + 1/b + 1/c)``. If one of the " "values is zero, the result will be zero." msgstr "" +"A média harmônica é a recíproca da média arimética calculada pela função :" +"func:`mean` dos recíprocos dos dados. Por exemplo, a média harmônica de três " +"valores *a*, *b* e *c* será equivalente a ``3/(1/a + 1/b + 1/c)``. Se um dos " +"valores for zero, o resultado também será zero." #: ../../library/statistics.rst:229 msgid "" @@ -424,6 +442,9 @@ msgid "" "the data. It is often appropriate when averaging ratios or rates, for " "example speeds." msgstr "" +"A média harmônica é um tipo de média, uma medida de localização central dos " +"dados. Ela é geralmente apropriada quando se está calculando a média de " +"razões e taxas; por exemplo, velocidades." #: ../../library/statistics.rst:233 msgid "" @@ -439,12 +460,17 @@ msgid "" "to 60 km/hr for the remaining 30 km of the journey. What is the average " "speed?" msgstr "" +"Suponha que um carro viaja a 40 km/h por 5 km e, quando o trânsito melhora, " +"acelera para 60 km/h pelos 30 km restantes da viagem. Qual é a velocidade " +"média?" #: ../../library/statistics.rst:250 msgid "" ":exc:`StatisticsError` is raised if *data* is empty, any element is less " "than zero, or if the weighted sum isn't positive." msgstr "" +":exc:`StatisticsError` é levantada se *data* for vazio, qualquer elemento " +"for menor que zero, ou se a soma ponderada não for positiva." #: ../../library/statistics.rst:253 msgid "" @@ -565,6 +591,9 @@ msgid "" "`_ around the midpoints of " "consecutive, fixed-width intervals." msgstr "" +"Estima a mediana para dados numéricos que foram `agrupados ou \"binned\" " +"`_ em torno dos pontos médios de " +"intervalos consecutivos de largura fixa." #: ../../library/statistics.rst:338 msgid "" @@ -582,12 +611,17 @@ msgid "" "consecutive ten-year age groups with each group being represented by the 5-" "year midpoints of the intervals:" msgstr "" +"Por exemplo, as informações demográficas podem ter sido resumidas em grupos " +"etários consecutivos de dez anos, com cada grupo sendo representado pelos " +"pontos médios de cinco anos dos intervalos:" #: ../../library/statistics.rst:359 msgid "" "The 50th percentile (median) is the 536th person out of the 1071 member " "cohort. That person is in the 30 to 40 year old age group." msgstr "" +"O 50º percentil (mediana) é a 536ª pessoa de 1071 membros. Essa pessoa está " +"na faixa etária de 30 a 40 anos." #: ../../library/statistics.rst:362 msgid "" @@ -596,6 +630,10 @@ msgid "" "is that the 484 members of that age group are evenly distributed between 30 " "and 40. For that, we use :func:`median_grouped`:" msgstr "" +"A função regular :func:`median` iria presumir que todos na faixa etária " +"tricenariana tinham exatamente 35 anos. Uma suposição mais sustentável é que " +"os 484 membros dessa faixa etária estão distribuídos uniformemente entre 30 " +"e 40. Para isso, usamos :func:`median_grouped`:" #: ../../library/statistics.rst:376 msgid "" @@ -603,12 +641,17 @@ msgid "" "exact multiples of *interval*. This is essential for getting a correct " "result. The function does not check this precondition." msgstr "" +"O chamador é responsável por garantir que os pontos de dados sejam separados " +"por múltiplos exatos de *intervalo*. Isso é essencial para obter um " +"resultado correto. A função não verifica essa pré-condição." #: ../../library/statistics.rst:380 msgid "" "Inputs may be any numeric type that can be coerced to a float during the " "interpolation step." msgstr "" +"As entradas podem ser qualquer tipo numérico que possa ser convertido para " +"um ponto flutuante durante a etapa de interpolação." #: ../../library/statistics.rst:386 msgid "" @@ -637,7 +680,7 @@ msgid "" "``mode`` assumes discrete data and returns a single value. This is the " "standard treatment of the mode as commonly taught in schools:" msgstr "" -"``mode`` assume que os dados são discretos e retorna um único valor. Esse é " +"``mode`` presume que os dados são discretos e retorna um único valor. Esse é " "o tratamento padrão do conceito de moda normalmente ensinado nas escolas:" #: ../../library/statistics.rst:403 @@ -697,6 +740,10 @@ msgid "" "a point that is not the mean. If it is missing or ``None`` (the default), " "the arithmetic mean is automatically calculated." msgstr "" +"Se o segundo argumento opcional *mu* for fornecido, ele deve ser a média da " +"*população* dos dados em *data*. Ele também pode ser usado para calcular o " +"segundo momento em torno de um ponto que não é a média. Se estiver faltando " +"ou for ``None`` (o padrão), a média aritmética é calculada automaticamente." #: ../../library/statistics.rst:457 msgid "" @@ -1214,6 +1261,11 @@ msgid "" "statisticshowto.datasciencecentral.com/inverse-distribution-function/>`_ " "function. Mathematically, it is written ``x : P(X <= x) = p``." msgstr "" +"Calcula a função distribuição acumulada inversa, também conhecida como " +"`função quantil ` _ ou o `função " +"ponto percentual `_. Matematicamente, é representada como ``x : P(X <= " +"x) = p``." #: ../../library/statistics.rst:879 msgid "" @@ -1459,10 +1511,11 @@ msgstr "" #: ../../library/statistics.rst:1137 msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" msgstr "" +"Os pontos em ``xarr`` e ``yarr`` podem ser usados ​​para fazer um gráfico PDF:" #: ../../library/statistics.rst:1139 msgid "Scatter plot of the estimated probability density function." -msgstr "" +msgstr "Gráfico de dispersão da função de densidade de probabilidade estimada." #: ../../library/statistics.rst:1142 msgid "" diff --git a/library/stdtypes.po b/library/stdtypes.po index 7bc3c3de3..4a1bfe584 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -33,10 +33,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -2693,7 +2693,7 @@ msgstr "" #: ../../library/stdtypes.rst:1603 msgid "String Methods" -msgstr "Métodos de string" +msgstr "String Methods" #: ../../library/stdtypes.rst:1608 msgid "" @@ -4154,7 +4154,7 @@ msgid "" "assume that ``'\\0'`` is the end of the string." msgstr "" "Como as Strings do Python possuem comprimento explícito, ``%s`` as " -"conversões não assumem que ``'\\0'`` é o fim da string." +"conversões não presumem que ``'\\0'`` é o fim da string." #: ../../library/stdtypes.rst:2500 msgid "" @@ -4400,7 +4400,7 @@ msgstr "" #: ../../library/stdtypes.rst:2637 msgid "Bytearray Objects" -msgstr "Bytearray Objects" +msgstr "Objetos Bytearray" #: ../../library/stdtypes.rst:2641 msgid "" @@ -4566,7 +4566,7 @@ msgid "" "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -"Alguns operações com bytes e bytearray assumem o uso de formatos binários " +"Alguns operações com bytes e bytearray presumem o uso de formatos binários " "compatíveis com ASCII e, portanto, devem ser evitados ao trabalhar com dados " "binários arbitrários. Essas restrições são abordadas a seguir." @@ -4916,7 +4916,7 @@ msgid "" "instead produce new objects." msgstr "" "Os seguintes métodos de objetos bytes e bytearray tem comportamentos padrões " -"que assumem o uso de formatos binários compatíveis com ASCII, mas ainda " +"que presumem o uso de formatos binários compatíveis com ASCII, mas ainda " "podem ser usados com dados binários arbitrários através da passagem " "argumentos apropriados. Perceba que todos os métodos de bytearray nesta " "seção *não* alteram os argumentos, e ao invés disso produzem novos objetos." @@ -5112,7 +5112,7 @@ msgid "" "data. Note that all of the bytearray methods in this section do *not* " "operate in place, and instead produce new objects." msgstr "" -"O seguintes métodos de bytes e objetos bytearray assumem o uso de formatos " +"O seguintes métodos de bytes e objetos bytearray presumem o uso de formatos " "binários compatíveis com ASCII e não devem ser aplicados a dados binários " "arbitrários. Perceba que todos os métodos de bytearray nesta seção *não* " "alteram os argumentos, e ao invés disso produzem novos objetos." @@ -7404,12 +7404,12 @@ msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -"Um booleano que é true se o apelido foi descompactado usando o operador " +"Um booleano que é true se o apelido foi desempacotado usando o operador " "``*`` (consulte :data:`~typing.TypeVarTuple`)." #: ../../library/stdtypes.rst:5134 msgid ":pep:`484` - Type Hints" -msgstr ":pep:`484` - Dicas de tipos" +msgstr ":pep:`484` - Dicas de tipo" #: ../../library/stdtypes.rst:5135 msgid "Introducing Python's framework for type annotations." @@ -7744,7 +7744,8 @@ msgid "" "``\"__code__\"``." msgstr "" "Acessar :attr:`~function.__code__` levanta um :ref:`evento de auditoria " -"` ``object.__getattr__`` com argumentos ``obj`` e ``\"__code__\"``." +"` ``object.__getattr__`` com os argumentos ``obj`` e " +"``\"__code__\"``." #: ../../library/stdtypes.rst:5393 msgid "" @@ -8291,7 +8292,7 @@ msgstr "verdade" #: ../../library/stdtypes.rst:34 msgid "value" -msgstr "value" +msgstr "valor" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:81 #: ../../library/stdtypes.rst:208 ../../library/stdtypes.rst:817 @@ -8364,7 +8365,7 @@ msgstr "==" #: ../../library/stdtypes.rst:123 msgid "< (less)" -msgstr "< (menor)" +msgstr "< (menor que)" #: ../../library/stdtypes.rst:123 msgid "<=" diff --git a/library/string.po b/library/string.po index afc8866be..8d93c2c69 100644 --- a/library/string.po +++ b/library/string.po @@ -24,16 +24,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/string.rst:2 msgid ":mod:`!string` --- Common string operations" -msgstr "" +msgstr ":mod:`!string` --- Operações comuns de strings" #: ../../library/string.rst:7 msgid "**Source code:** :source:`Lib/string.py`" @@ -1588,7 +1588,7 @@ msgstr ", (vírgula)" #: ../../library/string.rst:418 msgid "_ (underscore)" -msgstr "_ (underscore)" +msgstr "_ (sublinhado)" #: ../../library/string.rst:746 msgid "$ (dollar)" diff --git a/library/stringprep.po b/library/stringprep.po index 2a178b074..77e585fd3 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/struct.po b/library/struct.po index 6e5581c1a..3cbc2dd55 100644 --- a/library/struct.po +++ b/library/struct.po @@ -27,16 +27,16 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/struct.rst:2 msgid ":mod:`!struct` --- Interpret bytes as packed binary data" -msgstr "" +msgstr ":mod:`!struct` --- Interpreta bytes como dados binários empacotados" #: ../../library/struct.rst:7 msgid "**Source code:** :source:`Lib/struct.py`" @@ -52,6 +52,13 @@ msgid "" "connections), or data transfer between the Python application and the C " "layer." msgstr "" +"Este módulo converte entre valores Python e structs C representados como " +"objetos :class:`bytes` do Python. :ref:`Strings de formato ` compactas descrevem as conversões pretendidas de/para valores " +"Python. As funções e objetos do módulo podem ser usados ​​para duas aplicações " +"amplamente distintas, troca de dados com fontes externas (arquivos ou " +"conexões de rede) ou transferência de dados entre a aplicação Python e a " +"camada C." #: ../../library/struct.rst:25 msgid "" @@ -64,6 +71,14 @@ msgid "" "for defining byte ordering and padding between elements. See :ref:`struct-" "alignment` for details." msgstr "" +"Quando nenhum caractere de prefixo é fornecido, o modo nativo é o padrão. " +"Ele empacota ou descompacta dados com base na plataforma e no compilador nos " +"quais o interpretador Python foi construído. O resultado do empacotamento de " +"uma dada estrutura C inclui bytes de preenchimento que mantêm o alinhamento " +"adequado para os tipos C envolvidos; similarmente, o alinhamento é levado em " +"conta ao desempacotar. Em contraste, ao comunicar dados entre fontes " +"externas, o programador é responsável por definir a ordenação de bytes e o " +"preenchimento entre os elementos. Veja :ref:`struct-alignment` para detalhes." #: ../../library/struct.rst:35 msgid "" @@ -75,20 +90,29 @@ msgid "" "implement the buffer protocol, so that they can be read/filled without " "additional copying from a :class:`bytes` object." msgstr "" +"Várias funções :mod:`struct` (e métodos de :class:`Struct`) recebem um " +"argumento *buffer*. Isso se refere a objetos que implementam :ref:" +"`bufferobjects` e fornecem um buffer legível ou de leitura-gravação. Os " +"tipos mais comuns usados ​​para esse propósito são :class:`bytes` e :class:" +"`bytearray`, mas muitos outros tipos que podem ser vistos como uma matriz de " +"bytes implementam o protocolo de buffer, para que possam ser lidos/" +"preenchidos sem cópia adicional de um objeto :class:`bytes`." #: ../../library/struct.rst:44 msgid "Functions and Exceptions" -msgstr "Funções e Exceções" +msgstr "Funções e exceções" #: ../../library/struct.rst:46 msgid "The module defines the following exception and functions:" -msgstr "" +msgstr "O módulo define as seguintes exceções e funções:" #: ../../library/struct.rst:51 msgid "" "Exception raised on various occasions; argument is a string describing what " "is wrong." msgstr "" +"Exceção levantada em várias ocasiões; argumento é uma string que descreve o " +"que está errado." #: ../../library/struct.rst:57 msgid "" @@ -506,7 +530,7 @@ msgstr "``q``" #: ../../library/struct.rst:244 msgid ":c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`long long`" #: ../../library/struct.rst:244 ../../library/struct.rst:246 #: ../../library/struct.rst:257 @@ -519,7 +543,7 @@ msgstr "``Q``" #: ../../library/struct.rst:246 msgid ":c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned long long`" #: ../../library/struct.rst:249 msgid "``n``" @@ -552,7 +576,7 @@ msgstr "\\(6)" #: ../../library/struct.rst:253 ../../library/struct.rst:255 #: ../../library/struct.rst:257 msgid "float" -msgstr "float" +msgstr "ponto flutuante" #: ../../library/struct.rst:253 ../../library/struct.rst:255 #: ../../library/struct.rst:257 @@ -799,7 +823,7 @@ msgstr "" #: ../../library/struct.rst:449 msgid "Module :mod:`json`" -msgstr "" +msgstr "Módulo :mod:`json`" #: ../../library/struct.rst:450 msgid "JSON encoder and decoder." diff --git a/library/subprocess.po b/library/subprocess.po index bac213ee1..a33ee5df9 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/sunau.po b/library/sunau.po index a68866f4f..ea6648aa2 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/superseded.po b/library/superseded.po index daec58e19..63fe7e9d3 100644 --- a/library/superseded.po +++ b/library/superseded.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/superseded.rst:5 msgid "Superseded Modules" -msgstr "Módulos Substituídos" +msgstr "Módulos substituídos" #: ../../library/superseded.rst:7 msgid "" diff --git a/library/symtable.po b/library/symtable.po index 51b0409bf..da4c26d7f 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 2b6a22008..6487d0fea 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/sys.monitoring.rst:2 msgid ":mod:`!sys.monitoring` --- Execution event monitoring" -msgstr "" +msgstr ":mod:`!sys.monitoring` --- Monitoramento de eventos de execução" #: ../../library/sys.monitoring.rst:13 msgid "" @@ -297,6 +297,8 @@ msgstr "" #: ../../library/sys.monitoring.rst:166 msgid "An alias for ``0`` so users can do explicit comparisons like::" msgstr "" +"Um apelido para ``0`` para que os usuários possam fazer comparações " +"explícitas como::" #: ../../library/sys.monitoring.rst:171 msgid "Events are divided into three groups:" diff --git a/library/sys.po b/library/sys.po index 6220bbdb6..799ee4926 100644 --- a/library/sys.po +++ b/library/sys.po @@ -27,16 +27,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/sys.rst:2 msgid ":mod:`!sys` --- System-specific parameters and functions" -msgstr "" +msgstr ":mod:`!sys` --- Parâmetros e funções específicas do sistema" #: ../../library/sys.rst:9 msgid "" @@ -130,11 +130,11 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" "Chamar :func:`sys.addaudithook` levantará um evento de auditoria denominado " -"``sys.addaudithook`` com nenhum argumentos. Se qualquer gancho existente " -"levantar uma exceção derivada de :class:`RuntimeError`, o novo gancho não " -"será adicionado e a exceção será suprimida. Como resultado, os chamadores " -"não podem presumir que seu gancho foi adicionado, a menos que controlem " -"todos os ganchos existentes." +"``sys.addaudithook`` sem argumentos. Se qualquer gancho existente levantar " +"uma exceção derivada de :class:`RuntimeError`, o novo gancho não será " +"adicionado e a exceção será suprimida. Como resultado, os chamadores não " +"podem presumir que seu gancho foi adicionado, a menos que controlem todos os " +"ganchos existentes." #: ../../library/sys.rst:58 msgid "" @@ -328,7 +328,7 @@ msgstr "" #: ../../library/sys.rst:171 msgid "See also the :data:`sys.stdlib_module_names` list." -msgstr "" +msgstr "Veja também a lista de :data:`sys.stdlib_module_names`." #: ../../library/sys.rst:176 msgid "" @@ -336,6 +336,10 @@ msgid "" "and restored afterwards. This is intended to be called from a debugger from " "a checkpoint, to recursively debug or profile some other code." msgstr "" +"Chama ``func(*args)``, enquanto o rastreamento está habilitado. O estado de " +"rastreamento é salvo e restaurado posteriormente. Isso deve ser chamado de " +"um depurador de um ponto de verificação, para depurar ou analisar o " +"desempenho recursivamente algum outro código." #: ../../library/sys.rst:180 msgid "" @@ -343,6 +347,9 @@ msgid "" "`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!" "call_tracing` enables explicit recursion of the tracing function." msgstr "" +"O rastreamento é suspenso ao chamar uma função de rastreamento definida por :" +"func:`settrace` ou :func:`setprofile` para evitar recursão infinita. :func:`!" +"call_tracing` habilita a recursão explícita da função de rastreamento." #: ../../library/sys.rst:187 msgid "A string containing the copyright pertaining to the Python interpreter." @@ -386,20 +393,20 @@ msgid "" "deadlocked thread may bear no relationship to that thread's current activity " "by the time calling code examines the frame." msgstr "" -"Isso é mais útil para depurar impasses: esta função não requer a cooperação " -"dos encadeamentos em impasse e as pilhas de chamadas de tais encadeamentos " +"Isso é mais útil para fazer a depuração de impasses: esta função não requer " +"a cooperação das threads em impasse e as pilhas de chamadas de tais threads " "são congeladas enquanto permanecerem em impasse (*deadlock*). O quadro " -"retornado para um encadeamento sem impasse pode não ter nenhuma relação com " -"a atividade atual desse encadeamento no momento em que o código de chamada " -"examina o quadro." +"retornado para uma thread sem impasse pode não ter nenhuma relação com a " +"atividade atual da thread no momento em que o código de chamada examina o " +"quadro." #: ../../library/sys.rst:214 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``sys._current_frames`` com " -"nenhum argumento." +"Levanta um :ref:`evento de auditoria ` ``sys._current_frames`` sem " +"argumentos." #: ../../library/sys.rst:218 msgid "" @@ -424,13 +431,15 @@ msgid "" "no arguments." msgstr "" "Levanta um :ref:`evento de auditoria ` ``sys._current_exceptions`` " -"com nenhum argumento." +"sem argumentos." #: ../../library/sys.rst:229 msgid "" "Each value in the dictionary is now a single exception instance, rather than " "a 3-tuple as returned from ``sys.exc_info()``." msgstr "" +"Cada valor no dicionário agora é uma única instância de exceção, em vez de " +"uma tupla de 3 elementos, como retornado de ``sys.exc_info()``." #: ../../library/sys.rst:235 msgid "" @@ -679,6 +688,13 @@ msgid "" "such top-level exceptions can be customized by assigning another three-" "argument function to ``sys.excepthook``." msgstr "" +"Quando uma exceção além da :exc:`SystemExit` é levantada e não capturada, o " +"interpretador chama ``sys.excepthook`` com três argumentos, a classe de " +"exceção, a instância de exceção e um objeto traceback. Em uma sessão " +"interativa, isso acontece logo antes de o controle retornar ao prompt; em um " +"programa Python, isso acontece pouco antes de o programa ser encerrado. A " +"manipulação de tais exceções de nível superior pode ser personalizada " +"atribuindo outra função de três argumentos a ``sys.excepthook``." #: ../../library/sys.rst:394 msgid "" @@ -978,7 +994,7 @@ msgstr "" #: ../../library/sys.rst:577 msgid ":option:`-X warn_default_encoding <-X>`" -msgstr "" +msgstr ":option:`-X warn_default_encoding <-X>`" #: ../../library/sys.rst:579 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." @@ -1013,6 +1029,8 @@ msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." msgstr "" +"Adicionado o atributo ``warn_default_encoding`` para o sinalizador :option:`-" +"X` ``warn_default_encoding``." #: ../../library/sys.rst:599 msgid "Added the ``safe_path`` attribute for :option:`-P` option." @@ -1040,7 +1058,7 @@ msgstr "" #: ../../library/sys.rst:615 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" -msgstr "" +msgstr "Atributos da :term:`tupla nomeada` :data:`!float_info`" #: ../../library/sys.rst:618 msgid "attribute" @@ -1056,13 +1074,15 @@ msgstr "explicação" #: ../../library/sys.rst:623 msgid ":c:macro:`!DBL_EPSILON`" -msgstr "" +msgstr ":c:macro:`!DBL_EPSILON`" #: ../../library/sys.rst:624 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" +"diferença entre 1,0 e o menor valor maior que 1,0 que pode ser representado " +"como ponto flutuante." #: ../../library/sys.rst:627 msgid "See also :func:`math.ulp`." @@ -1070,59 +1090,67 @@ msgstr "Veja também :func:`math.ulp.`" #: ../../library/sys.rst:630 msgid ":c:macro:`!DBL_DIG`" -msgstr "" +msgstr ":c:macro:`!DBL_DIG`" #: ../../library/sys.rst:631 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" +"O número máximo de dígitos decimais que podem ser fielmente representados em " +"um ponto flutuante; veja abaixo." #: ../../library/sys.rst:635 msgid ":c:macro:`!DBL_MANT_DIG`" -msgstr "" +msgstr ":c:macro:`!DBL_MANT_DIG`" #: ../../library/sys.rst:636 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" +"Precisão do ponto flutuante: o número de dígitos de base ``radix`` no " +"significando de um ponto flutuante." #: ../../library/sys.rst:640 msgid ":c:macro:`!DBL_MAX`" -msgstr "" +msgstr ":c:macro:`!DBL_MAX`" #: ../../library/sys.rst:641 msgid "The maximum representable positive finite float." -msgstr "" +msgstr "O ponto flutuante finito positivo máximo representável." #: ../../library/sys.rst:644 msgid ":c:macro:`!DBL_MAX_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MAX_EXP`" #: ../../library/sys.rst:645 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" +"O inteiro máximo *e* de tal modo que ``radix**(e-1)`` é um ponto flutuante " +"finito representável." #: ../../library/sys.rst:649 msgid ":c:macro:`!DBL_MAX_10_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MAX_10_EXP`" #: ../../library/sys.rst:650 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" +"O inteiro máximo *e* de tal modo que ``10**e`` é um intervalo de pontos " +"flutuantes finitos representáveis." #: ../../library/sys.rst:654 msgid ":c:macro:`!DBL_MIN`" -msgstr "" +msgstr ":c:macro:`!DBL_MIN`" #: ../../library/sys.rst:655 msgid "The minimum representable positive *normalized* float." -msgstr "" +msgstr "O ponto flutuante *normalizado* positivo mínimo representável." #: ../../library/sys.rst:657 msgid "" @@ -1134,32 +1162,36 @@ msgstr "" #: ../../library/sys.rst:661 msgid ":c:macro:`!DBL_MIN_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MIN_EXP`" #: ../../library/sys.rst:662 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" +"O inteiro mínimo *e* de tal modo que ``radix**(e-1)`` é um ponto flutuante " +"normalizado." #: ../../library/sys.rst:666 msgid ":c:macro:`!DBL_MIN_10_EXP`" -msgstr "" +msgstr ":c:macro:`!DBL_MIN_10_EXP`" #: ../../library/sys.rst:667 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" +"O inteiro mínimo *e* de tal modo que ``10**e`` é um ponto flutuante " +"normalizado." #: ../../library/sys.rst:670 msgid ":c:macro:`!FLT_RADIX`" -msgstr "" +msgstr ":c:macro:`!FLT_RADIX`" #: ../../library/sys.rst:671 msgid "The radix of exponent representation." -msgstr "" +msgstr "A raiz da representação do expoente." #: ../../library/sys.rst:674 msgid ":c:macro:`!FLT_ROUNDS`" -msgstr "" +msgstr ":c:macro:`!FLT_ROUNDS`" #: ../../library/sys.rst:675 msgid "" @@ -1167,32 +1199,37 @@ msgid "" "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" +"Um inteiro representando o modo de arredondamento para aritmética de ponto " +"flutuante. Isso reflete o valor da macro do sistema :c:macro:`!FLT_ROUNDS` " +"no momento da inicialização do interpretador:" #: ../../library/sys.rst:679 msgid "``-1``: indeterminable" -msgstr "" +msgstr "``-1``: indeterminável" #: ../../library/sys.rst:680 msgid "``0``: toward zero" -msgstr "" +msgstr "``0``: em direção a zero" #: ../../library/sys.rst:681 msgid "``1``: to nearest" -msgstr "" +msgstr "``1``: para o mais próximo" #: ../../library/sys.rst:682 msgid "``2``: toward positive infinity" -msgstr "" +msgstr "``2``: em direção ao infinito positivo" #: ../../library/sys.rst:683 msgid "``3``: toward negative infinity" -msgstr "" +msgstr "``3``: em direção ao infinito negativo" #: ../../library/sys.rst:685 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" +"Todos os outros valores para :c:macro:`!FLT_ROUNDS` caracterizam o " +"comportamento de arredondamento definido pela implementação." #: ../../library/sys.rst:688 msgid "" @@ -1201,6 +1238,11 @@ msgid "" "float_info.dig` significant digits, then converting ``s`` to a float and " "back again will recover a string representing the same decimal value::" msgstr "" +"O atributo :attr:`sys.float_info.dig` precisa de mais explicações. Se ``s`` " +"for qualquer string representando um número decimal com no máximo :attr:`!" +"sys.float_info.dig` dígitos significativos, então converter ``s`` para ponto " +"flutuante e vice-versa recuperará uma string representando o mesmo decimal " +"valor::" #: ../../library/sys.rst:701 msgid "" @@ -1254,7 +1296,7 @@ msgstr "" #: ../../library/sys.rst:738 msgid "Return the number of unicode objects that have been interned." -msgstr "" +msgstr "Retorna o número de objetos unicode que foram internalizados." #: ../../library/sys.rst:745 msgid "Return the build time API version of Android as an integer." @@ -1280,6 +1322,10 @@ msgid "" "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" +"Retorna o valor atual dos sinalizadores que são usados para chamadas :c:func:" +"`dlopen`. Nomes simbólicos para os valores dos sinalizadores podem ser " +"encontrados no módulo :mod:`os` (constantes :samp:`RTLD_{xxx}`, por exemplo :" +"const:`os.RTLD_LAZY`)." #: ../../library/sys.rst:770 msgid "" @@ -1397,6 +1443,8 @@ msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" +"Objetos imortais têm contagens de referência muito grandes que não " +"correspondem ao número real de referências ao objeto." #: ../../library/sys.rst:844 msgid "" @@ -1455,6 +1503,10 @@ msgid "" "using :func:`getsizeof` recursively to find the size of containers and all " "their contents." msgstr "" +"Consulte `receita de tamanho recursivo `_ para " +"obter um exemplo de uso de :func:`getsizeof` recursivamente para encontrar o " +"tamanho dos contêineres e todo o seu conteúdo." #: ../../library/sys.rst:873 msgid "" @@ -1502,12 +1554,19 @@ msgid "" "unidentifiable, ``None`` is returned. The default for *depth* is zero, " "returning the module at the top of the call stack." msgstr "" +"Retorna o nome de um módulo da pilha de chamadas. Se o inteiro opcional " +"*depth* for fornecido, retorna o módulo que muitas chamadas abaixo do topo " +"da pilha. Se for mais profundo do que a pilha de chamadas, ou se o módulo " +"não for identificável, ``None`` é retornado. O padrão para *depth* é zero, " +"retornando o módulo no topo da pilha de chamadas." #: ../../library/sys.rst:902 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sys._getframemodulename`` " +"com o argumento ``depth``." #: ../../library/sys.rst:916 msgid "Get the profiler function as set by :func:`setprofile`." @@ -1526,8 +1585,8 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" "A função :func:`gettrace` destina-se apenas à implementação de depuradores, " -"criadores de perfil, ferramentas de cobertura e similares. Seu comportamento " -"faz parte da plataforma de implementação, e não da definição da linguagem e, " +"perfiladores, ferramentas de cobertura e similares. Seu comportamento faz " +"parte da plataforma de implementação, e não da definição da linguagem e, " "portanto, pode não estar disponível em todas as implementações do Python." #: ../../library/sys.rst:937 @@ -1553,7 +1612,7 @@ msgstr "" #: ../../library/sys.rst:948 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." -msgstr "" +msgstr "*platform* será ``2`` (VER_PLATFORM_WIN32_NT)." #: ../../library/sys.rst:950 msgid "*product_type* may be one of the following values:" @@ -1569,7 +1628,7 @@ msgstr "Significado" #: ../../library/sys.rst:955 msgid "``1`` (VER_NT_WORKSTATION)" -msgstr "" +msgstr "``1`` (VER_NT_WORKSTATION)" #: ../../library/sys.rst:955 msgid "The system is a workstation." @@ -1577,7 +1636,7 @@ msgstr "O sistema é uma estação de trabalho" #: ../../library/sys.rst:957 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" -msgstr "" +msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" #: ../../library/sys.rst:957 msgid "The system is a domain controller." @@ -1585,7 +1644,7 @@ msgstr "O sistema é um controlador de domínio." #: ../../library/sys.rst:960 msgid "``3`` (VER_NT_SERVER)" -msgstr "" +msgstr "``3`` (VER_NT_SERVER)" #: ../../library/sys.rst:960 msgid "The system is a server, but not a domain controller." @@ -1597,6 +1656,9 @@ msgid "" "Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" +"Esta função atua como um envólucro em volta da função Win32 :c:func:`!" +"GetVersionEx`; consulte a documentação da Microsoft em :c:func:`!" +"OSVERSIONINFOEX` para obter mais informações sobre esses campos." #: ../../library/sys.rst:968 msgid "" @@ -1685,35 +1747,35 @@ msgstr "" #: ../../library/sys.rst:1025 msgid "The width in bits used for hash values" -msgstr "" +msgstr "A largura em bits usada para fazer hash de valores" #: ../../library/sys.rst:1029 msgid "The prime modulus P used for numeric hash scheme" -msgstr "" +msgstr "O módulo primo P usado para esquema de hash numérico" #: ../../library/sys.rst:1033 msgid "The hash value returned for a positive infinity" -msgstr "" +msgstr "O valor de hash retornado para um infinito positivo" #: ../../library/sys.rst:1037 msgid "(This attribute is no longer used)" -msgstr "" +msgstr "(Este atributo não é mais usado)" #: ../../library/sys.rst:1041 msgid "The multiplier used for the imaginary part of a complex number" -msgstr "" +msgstr "O multiplicador usado para a parte imaginária de um número complexo" #: ../../library/sys.rst:1045 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" -msgstr "" +msgstr "O nome do algoritmo para hash de str, bytes e memoryview" #: ../../library/sys.rst:1049 msgid "The internal output size of the hash algorithm" -msgstr "" +msgstr "O tamanho da saída interna do algoritmo de hash" #: ../../library/sys.rst:1053 msgid "The size of the seed key of the hash algorithm" -msgstr "" +msgstr "O tamanho da chave semente do algoritmo hash" #: ../../library/sys.rst:1057 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" @@ -1780,12 +1842,23 @@ msgid "" "would be ``sys.version_info(2, 7, 2, 'final', 0)``. For CPython they are " "the same value, since it is the reference implementation." msgstr "" +"*version* é uma tupla nomeada, no mesmo formato que :data:`sys." +"version_info`. Ela representa a versão da implementação Python em " +"*implementation*. Isso tem um significado distinto da versão específica da " +"*linguagem* Python à qual o interpretador em execução no momento está em " +"conformidade, que ``sys.version_info`` representa. Por exemplo, para PyPy " +"1.8 ``sys.implementation.version`` pode ser ``sys.version_info(1, 8, 0, " +"'final', 0)``, enquanto ``sys.version_info`` seria ``sys.version_info(2, 7, " +"2, 'final', 0)``. Para CPython, eles são o mesmo valor, pois é a " +"implementação de referência." #: ../../library/sys.rst:1102 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" +"*hexversion* é a versão de implementação em formato hexadecimal, como :data:" +"`sys.hexversion`." #: ../../library/sys.rst:1105 msgid "" @@ -1795,6 +1868,12 @@ msgid "" "implementation may use some other value if appropriate. If ``cache_tag`` is " "set to ``None``, it indicates that module caching should be disabled." msgstr "" +"*cache_tag* é a tag usada pelo mecanismo de importação nos nomes de arquivo " +"dos módulos em cache. Por convenção, seria um composto do nome e da versão " +"da implementação, como ``'cpython-33'``. No entanto, uma implementação " +"Python pode usar algum outro valor, se apropriado. Se ``cache_tag`` for " +"definido como ``None``, isso indica que o cache do módulo deve ser " +"desabilitado." #: ../../library/sys.rst:1112 msgid "" @@ -1805,46 +1884,64 @@ msgid "" "between implementation versions. (It may change between Python language " "versions, however.) See :pep:`421` for more information." msgstr "" +":data:`sys.implementation` pode conter atributos adicionais específicos para " +"a implementação do Python. Esses atributos não padrão devem começar com um " +"sublinhado e não são descritos aqui. Independentemente do seu conteúdo, :" +"data:`sys.implementation` não mudará durante uma execução do interpretador, " +"nem entre versões de implementação. (No entanto, ele pode mudar entre " +"versões da linguagem Python.) Veja a :pep:`421` para mais informações." #: ../../library/sys.rst:1123 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" +"A adição de novos atributos obrigatórios deve passar pelo processo normal de " +"PEPs. Veja a :pep:`421` para mais informações." #: ../../library/sys.rst:1128 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" +"Uma :term:`tupla nomeada` que contém informações sobre a representação " +"interna de inteiros do Python. Os atributos são somente leitura." #: ../../library/sys.rst:1133 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" +"O número de bits mantidos em cada dígito. Os inteiros do Python são " +"armazenados internamente na base ``2**int_info.bits_per_digit``." #: ../../library/sys.rst:1138 msgid "The size in bytes of the C type used to represent a digit." -msgstr "" +msgstr "O tamanho em bytes do tipo C usado para representar um dígito." #: ../../library/sys.rst:1142 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" +"O valor padrão para :func:`sys.get_int_max_str_digits` quando não estiver " +"explicitamente configurado." #: ../../library/sys.rst:1147 msgid "" "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" +"O valor mínimo diferente de zero para :func:`sys.set_int_max_str_digits`, :" +"envvar:`PYTHONINTMAXSTRDIGITS` ou :option:`-X int_max_str_digits <-X>`." #: ../../library/sys.rst:1154 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." msgstr "" +"Adicionados :attr:`~int_info.default_max_str_digits` e :attr:`~int_info." +"str_digits_check_threshold`." #: ../../library/sys.rst:1160 msgid "" @@ -1854,6 +1951,11 @@ msgid "" "so that you can set this hook there. The :mod:`site` module :ref:`sets this " "`." msgstr "" +"Quando esse atributo existe, seu valor é chamado automaticamente (sem " +"argumentos) quando o interpretador é iniciado em :ref:`modo interativo `. Isso é feito após o arquivo :envvar:`PYTHONSTARTUP` ser lido, " +"para que você possa definir esse gancho lá. O módulo :mod:`site` :ref:" +"`define isso `." #: ../../library/sys.rst:1166 msgid "" @@ -1866,6 +1968,9 @@ msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``cpython." +"run_interactivehook`` com o objeto gancho como o argumento quando o gancho é " +"chamado na inicialização." #: ../../library/sys.rst:1177 msgid "" @@ -1878,6 +1983,15 @@ msgid "" "interned, and the dictionaries used to hold module, class or instance " "attributes have interned keys." msgstr "" +"Insere *string* na tabela de strings \"internalizadas\" e retorna a string " +"internalizada -- que é a própria *string* ou uma cópia. Strings " +"internalizadas são úteis para obter um pouco de desempenho na pesquisa de " +"dicionário -- se as chaves em um dicionário foram internalizadas, e a chave " +"de pesquisa para internalizada, já que comparações de chaves (após o hash) " +"podem ser feitas por uma comparação de ponteiros em vez de uma comparação de " +"strings. Normalmente, os nomes usados ​​em programas Python são internalizados " +"automaticamente, e os dicionários usados ​​para armazenar atributos de módulo, " +"classe ou instância têm chaves internalizadas." #: ../../library/sys.rst:1185 msgid "" @@ -1901,6 +2015,13 @@ msgid "" "pdb; pdb.pm()`` to enter the post-mortem debugger; see :mod:`pdb` module for " "more information.)" msgstr "" +"Esta variável nem sempre está definida; ela é definida para a instância de " +"exceção quando uma exceção não é tratada e o interpretador imprime uma " +"mensagem de erro e um stack traceback. Seu uso pretendido é permitir que um " +"usuário interativo importe um módulo depurador e se envolva na depuração " +"post-mortem sem ter que reexecutar o comando que causou o erro. (O uso " +"típico é ``import pdb; pdb.pm()`` para entrar no depurador post-mortem; veja " +"o módulo :mod:`pdb` para mais informações.)" #: ../../library/sys.rst:1212 msgid "" @@ -1908,6 +2029,9 @@ msgid "" "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" +"Essas três variáveis ​​estão descontinuadas; use :data:`sys.last_exc` em vez " +"disso. Elas mantêm a representação legada de ``sys.last_exc``, conforme " +"retornada de :func:`exc_info` acima." #: ../../library/sys.rst:1218 msgid "" @@ -1915,12 +2039,17 @@ msgid "" "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" +"Um inteiro que fornece o valor máximo que uma variável do tipo :c:type:" +"`Py_ssize_t` pode assumir. Geralmente é ``2**31 - 1`` em uma plataforma de " +"32 bits e ``2**63 - 1`` em uma plataforma de 64 bits." #: ../../library/sys.rst:1225 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" +"Um inteiro que fornece o valor do maior ponto de código Unicode, ou seja, " +"``1114111`` (``0x10FFFF`` em hexadecimal)." #: ../../library/sys.rst:1228 msgid "" @@ -1928,6 +2057,9 @@ msgid "" "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" +"Antes da :pep:`393`, ``sys.maxunicode`` costumava ser ``0xFFFF`` ou " +"``0x10FFFF``, dependendo da opção de configuração que especificava se os " +"caracteres Unicode eram armazenados como UCS-2 ou UCS-4." #: ../../library/sys.rst:1236 msgid "" @@ -1941,6 +2073,15 @@ msgid "" "as a second argument. The method returns a :term:`module spec`, or ``None`` " "if the module cannot be found." msgstr "" +"Uma lista de objetos :term:`localizador de metacaminho` que têm seus " +"métodos :meth:`~importlib.abc.MetaPathFinder.find_spec` chamados para ver se " +"um dos objetos consegue encontrar o módulo a ser importado. Por padrão, ele " +"contém entradas que implementam a semântica de importação padrão do Python. " +"O método :meth:`~importlib.abc.MetaPathFinder.find_spec` é chamado com pelo " +"menos o nome absoluto do módulo que está sendo importado. Se o módulo a ser " +"importado estiver contido em um pacote, o atributo :attr:`__path__` do " +"pacote pai é passado como um segundo argumento. O método retorna uma :term:" +"`especificação do módulo`, ou ``None`` se o módulo não puder ser encontrado." #: ../../library/sys.rst:1248 msgid ":class:`importlib.abc.MetaPathFinder`" @@ -1951,6 +2092,8 @@ msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" +"A classe base abstrata que define a interface dos objetos localizadores em :" +"data:`meta_path`." #: ../../library/sys.rst:1251 msgid ":class:`importlib.machinery.ModuleSpec`" @@ -1961,12 +2104,16 @@ msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" +"A classe concreta da qual :meth:`~importlib.abc.MetaPathFinder.find_spec` " +"deve retornar instâncias." #: ../../library/sys.rst:1258 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`." msgstr "" +":term:`Especificações de módulo ` foram introduzidas no Python " +"3.4, pela :pep:`451`." #: ../../library/sys.rst:1263 msgid "" @@ -1974,6 +2121,9 @@ msgid "" "data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." "find_spec` method." msgstr "" +"Foi removido o alternativa que procurava um método :meth:`!find_module` se " +"uma entrada :data:`meta_path` não tivesse um método :meth:`~importlib.abc." +"MetaPathFinder.find_spec`." #: ../../library/sys.rst:1269 msgid "" @@ -1986,12 +2136,22 @@ msgid "" "size may change during iteration as a side effect of code or activity in " "other threads." msgstr "" +"Este é um dicionário que mapeia nomes de módulos para módulos que já foram " +"carregados. Isso pode ser manipulado para forçar o recarregamento de módulos " +"e outros truques. No entanto, substituir o dicionário não vai funcionar " +"necessariamente como esperado e excluir itens essenciais do dicionário pode " +"fazer com que o Python falhe. Se você quiser iterar sobre este dicionário " +"global, sempre use ``sys.modules.copy()`` ou ``tuple(sys.modules)`` para " +"evitar exceções, pois seu tamanho pode mudar durante a iteração como um " +"efeito colateral do código ou atividade em outros threads." #: ../../library/sys.rst:1281 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" +"A lista dos argumentos originais da linha de comando passados ​​para o " +"executável Python." #: ../../library/sys.rst:1284 msgid "" @@ -2000,6 +2160,10 @@ msgid "" "user's program. Arguments consumed by the interpreter itself will be present " "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" +"Os elementos de :data:`sys.orig_argv` são os argumentos para o interpretador " +"Python, enquanto os elementos de :data:`sys.argv` são os argumentos para o " +"programa do usuário. Os argumentos consumidos pelo próprio interpretador " +"estarão presentes em :data:`sys.orig_argv` e ausentes em :data:`sys.argv`." #: ../../library/sys.rst:1296 msgid "" @@ -2007,6 +2171,9 @@ msgid "" "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" +"Uma lista de strings que especifica o caminho de pesquisa para módulos. " +"Inicializado a partir da variável de ambiente :envvar:`PYTHONPATH`, mais um " +"padrão dependente da instalação." #: ../../library/sys.rst:1300 msgid "" @@ -2014,29 +2181,41 @@ msgid "" "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" +"Por padrão, conforme inicializado na inicialização do programa, um caminho " +"potencialmente inseguro é adicionado ao :data:`sys.path` (*antes* das " +"entradas inseridas como resultado de :envvar:`PYTHONPATH`):" #: ../../library/sys.rst:1304 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" +"A linha de comando ``python -m módulo``: adiciona o diretório de trabalho " +"atual" #: ../../library/sys.rst:1306 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" +"A linha de comando ``python script.py``: prefixa o diretório do script. Se " +"for um link simbólico, resolve links simbólicos." #: ../../library/sys.rst:1308 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" +"As linhas de comando ``python -c código`` e ``python`` (REPL): adiciona uma " +"string vazia, que indica o diretório de trabalho atual." #: ../../library/sys.rst:1311 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" +"Para não acrescentar esse caminho potencialmente inseguro, use a opção de " +"linha de comando :option:`-P` ou a variável de ambiente :envvar:" +"`PYTHONSAFEPATH`." #: ../../library/sys.rst:1314 msgid "" @@ -2044,12 +2223,17 @@ msgid "" "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" +"Um programa é livre para modificar esta lista para seus próprios propósitos. " +"Somente strings devem ser adicionadas a :data:`sys.path`; todos os outros " +"tipos de dados são ignorados durante a importação." #: ../../library/sys.rst:1320 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" +"Módulo :mod:`site` Descreve como usar arquivos .pth para estender :data:`sys." +"path`." #: ../../library/sys.rst:1325 msgid "" @@ -2057,10 +2241,13 @@ msgid "" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" +"Uma lista de chamáveis que recebem um argumento de caminho para tentar criar " +"um :term:`localizador` para o caminho. Se um localizador puder ser criado, " +"ele deve ser retornado pelo chamável, senão, ele levanta :exc:`ImportError`." #: ../../library/sys.rst:1329 ../../library/sys.rst:1340 msgid "Originally specified in :pep:`302`." -msgstr "" +msgstr "Originalmente especificado na :pep:`302`." #: ../../library/sys.rst:1334 msgid "" @@ -2069,6 +2256,11 @@ msgid "" "finders that are found. If a path is a valid file system path but no finder " "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" +"Um dicionário atuando como um cache para objetos do :term:`localizador`. As " +"chaves são caminhos que foram passados ​​para :data:`sys.path_hooks` e os " +"valores são os localizadores que são encontrados. Se um caminho for um " +"caminho de sistema de arquivo válido, mas nenhum localizador for encontrado " +"em :data:`sys.path_hooks`, então ``None`` é armazenado." #: ../../library/sys.rst:1345 msgid "" @@ -2091,15 +2283,15 @@ msgstr "" #: ../../library/sys.rst:1364 msgid "System" -msgstr "" +msgstr "Sistema" #: ../../library/sys.rst:1364 msgid "``platform`` value" -msgstr "" +msgstr "Valor de ``platform``" #: ../../library/sys.rst:1366 msgid "AIX" -msgstr "" +msgstr "AIX" #: ../../library/sys.rst:1366 msgid "``'aix'``" @@ -2107,15 +2299,15 @@ msgstr "``'aix'``" #: ../../library/sys.rst:1367 msgid "Emscripten" -msgstr "" +msgstr "Emscripten" #: ../../library/sys.rst:1367 msgid "``'emscripten'``" -msgstr "" +msgstr "``'emscripten'``" #: ../../library/sys.rst:1368 msgid "Linux" -msgstr "" +msgstr "Linux" #: ../../library/sys.rst:1368 msgid "``'linux'``" @@ -2123,11 +2315,11 @@ msgstr "``'linux'``" #: ../../library/sys.rst:1369 msgid "WASI" -msgstr "" +msgstr "WASI" #: ../../library/sys.rst:1369 msgid "``'wasi'``" -msgstr "" +msgstr "``'wasi'``" #: ../../library/sys.rst:1370 msgid "Windows" @@ -2174,6 +2366,8 @@ msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" +":data:`os.name` tem uma granularidade mais substancial. :func:`os.uname` " +"fornece informações de versão dependentes do sistema." #: ../../library/sys.rst:1392 msgid "" @@ -2188,6 +2382,9 @@ msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" +"Nome do diretório da biblioteca específica da plataforma. É usado para " +"construir o caminho da biblioteca padrão e os caminhos dos módulos de " +"extensão instalados." #: ../../library/sys.rst:1401 msgid "" @@ -2195,12 +2392,17 @@ msgid "" "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" +"É igual a ``\"lib\"`` na maioria das plataformas. No Fedora e SuSE, é igual " +"a ``\"lib64\"`` em plataformas de 64 bits, o que fornece os seguintes " +"caminhos ``sys.path`` (onde ``X.Y`` é a versão ``major.minor`` do Python):" #: ../../library/sys.rst:1405 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" +"``/usr/lib64/pythonX.Y/``: Biblioteca padrão (como ``os.py`` do módulo :mod:" +"`os`)" #: ../../library/sys.rst:1407 msgid "" @@ -2208,18 +2410,25 @@ msgid "" "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" +"``/usr/lib64/pythonX.Y/lib-dynload/``: Módulos de extensão C da biblioteca " +"padrão (como o módulo :mod:`errno`, o nome exato do arquivo é específico da " +"plataforma)" #: ../../library/sys.rst:1410 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" +"``/usr/lib/pythonX.Y/site-packages/`` (sempre usa ``lib``, não :data:`sys." +"platlibdir`): Módulos de terceiros" #: ../../library/sys.rst:1412 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" +"``/usr/lib64/pythonX.Y/site-packages/``: Módulos de extensão C de pacotes de " +"terceiros" #: ../../library/sys.rst:1420 msgid "" @@ -2229,6 +2438,11 @@ msgid "" "to the :program:`configure` script. See :ref:`installation_paths` for " "derived paths." msgstr "" +"Uma string que fornece o prefixo do diretório específico do site onde os " +"arquivos Python independentes de plataforma são instalados; no Unix, o " +"padrão é :file:`/usr/local`. Isso pode ser definido no momento da construção " +"com o argumento :option:`--prefix` para o script :program:`configure`. Veja :" +"ref:`installation_paths` para caminhos derivados." #: ../../library/sys.rst:1426 msgid "" @@ -2236,6 +2450,9 @@ msgid "" "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" +"Se um :ref:`ambiente virtual ` estiver em vigor, este valor será " +"alterado em ``site.py`` para apontar para o ambiente virtual. O valor para a " +"instalação do Python ainda estará disponível, via :data:`base_prefix`." #: ../../library/sys.rst:1441 msgid "" @@ -2246,6 +2463,12 @@ msgid "" "time the interpreter prepares to read a new interactive command; this can be " "used to implement a dynamic prompt." msgstr "" +"Strings especificando o prompt primário e secundário do interpretador. Elas " +"são definidas somente se o interpretador estiver no modo interativo. Seus " +"valores iniciais neste caso são ``'>>> '`` e ``'... '``. Se um objeto não " +"string for atribuído a qualquer variável, seu :func:`str` é reavaliado cada " +"vez que o interpretador se prepara para ler um novo comando interativo; isso " +"pode ser usado para implementar um prompt dinâmico." #: ../../library/sys.rst:1451 msgid "" @@ -2257,6 +2480,14 @@ msgid "" "values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` constants, e." "g. :const:`os.RTLD_LAZY`)." msgstr "" +"Define os sinalizadores usados ​​pelo interpretador para chamadas :c:func:" +"`dlopen`, como quando o interpretador carrega módulos de extensão. Entre " +"outras coisas, isso habilitará uma resolução preguiçosa de símbolos ao " +"importar um módulo, se chamado como ``sys.setdlopenflags(0)``. Para " +"compartilhar símbolos entre módulos de extensão, chame como ``sys." +"setdlopenflags(os.RTLD_GLOBAL)``. Nomes simbólicos para os valores de " +"sinalizadores podem ser encontrados no módulo :mod:`os` (constantes :samp:" +"`RTLD_{xxx}`, por exemplo, :const:`os.RTLD_LAZY`)." #: ../../library/sys.rst:1463 msgid "" @@ -2282,6 +2513,18 @@ msgid "" "Also, its return value is not used, so it can simply return ``None``. Error " "in the profile function will cause itself unset." msgstr "" +"Define a função de perfil do sistema, que permite implementar um perfilador " +"de código-fonte Python em Python. Veja o capítulo :ref:`profile` para mais " +"informações sobre o perfilador Python. A função de perfil do sistema é " +"chamada de forma semelhante à função de rastreamento do sistema (veja :func:" +"`settrace`), mas é chamada com eventos diferentes, por exemplo, não é " +"chamada para cada linha de código executada (apenas na chamada e retorno, " +"mas o evento de retorno é relatado mesmo quando uma exceção foi definida). A " +"função é específica do thread, mas não há como o perfilador saber sobre " +"trocas de contexto entre threads, então não faz sentido usá-la na presença " +"de vários threads. Além disso, seu valor de retorno não é usado, então ele " +"pode simplesmente retornar ``None``. Um erro na função de perfil fará com " +"que sua própria definição seja removida." #: ../../library/sys.rst:1487 msgid "" @@ -2289,6 +2532,10 @@ msgid "" "`settrace`. To trace calls with :func:`!setprofile` inside a tracing " "function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" +"O mesmo mecanismo de rastreamento é usado para :func:`!setprofile` como :" +"func:`settrace`. Para rastrear chamadas com :func:`!setprofile` dentro de " +"uma função de rastreamento (por exemplo, em um ponto de interrupção do " +"depurador), consulte :func:`call_tracing`." #: ../../library/sys.rst:1491 msgid "" @@ -2297,10 +2544,14 @@ msgid "" "``'return'``, ``'c_call'``, ``'c_return'``, or ``'c_exception'``. *arg* " "depends on the event type." msgstr "" +"As funções de perfil devem ter três argumentos: *frame*, *event* e *arg*. " +"*frame* é o quadro de pilha atual. *event* é uma string: ``'call'``, " +"``'return'``, ``'c_call'``, ``'c_return'`` ou ``'c_exception'``. *arg* " +"depende do tipo de evento." #: ../../library/sys.rst:1496 ../../library/sys.rst:1583 msgid "The events have the following meaning:" -msgstr "" +msgstr "Os eventos têm o seguinte significado:" #: ../../library/sys.rst:1498 ../../library/sys.rst:1585 msgid "``'call'``" @@ -2311,6 +2562,8 @@ msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" +"Uma função é chamada (ou algum outro bloco de código é inserido). A função " +"de perfil é chamada; *arg* é ``None``." #: ../../library/sys.rst:1502 ../../library/sys.rst:1600 msgid "``'return'``" @@ -2322,6 +2575,9 @@ msgid "" "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" +"Uma função (ou outro bloco de código) está prestes a retornar. A função de " +"perfilação é chamada; *arg* é o valor que será retornado, ou ``None`` se o " +"evento for causado por uma exceção sendo levantada." #: ../../library/sys.rst:1507 msgid "``'c_call'``" @@ -2332,6 +2588,8 @@ msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" +"Uma função C está prestes a ser chamada. Pode ser uma função de extensão ou " +"uma embutida. *arg* é o objeto da função C." #: ../../library/sys.rst:1511 msgid "``'c_return'``" @@ -2339,7 +2597,7 @@ msgstr "``'c_return'``" #: ../../library/sys.rst:1512 msgid "A C function has returned. *arg* is the C function object." -msgstr "" +msgstr "Uma função C foi retornada. *arg* é o objeto da função C." #: ../../library/sys.rst:1514 msgid "``'c_exception'``" @@ -2347,13 +2605,15 @@ msgstr "``'c_exception'``" #: ../../library/sys.rst:1515 msgid "A C function has raised an exception. *arg* is the C function object." -msgstr "" +msgstr "Uma função C levantou uma exceção. *arg* é o objeto da função C." #: ../../library/sys.rst:1517 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sys.setprofile`` sem " +"argumentos." #: ../../library/sys.rst:1522 msgid "" @@ -2361,6 +2621,9 @@ msgid "" "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" +"Define a profundidade máxima da pilha do interpretador Python para *limit*. " +"Esse limite impede que a recursão infinita cause um estouro da pilha C e " +"trave o Python." #: ../../library/sys.rst:1526 msgid "" @@ -2369,18 +2632,26 @@ msgid "" "platform that supports a higher limit. This should be done with care, " "because a too-high limit can lead to a crash." msgstr "" +"O limite mais alto possível depende da plataforma. Um usuário pode precisar " +"definir o limite mais alto quando tiver um programa que exija recursão " +"profunda e uma plataforma que dê suporte a um limite mais alto. Isso deve " +"ser feito com cuidado, porque um limite muito alto pode levar a uma falha." #: ../../library/sys.rst:1531 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" +"Se o novo limite for muito baixo na profundidade de recursão atual, uma " +"exceção :exc:`RecursionError` será levantada." #: ../../library/sys.rst:1534 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" +"Uma exceção :exc:`RecursionError` agora é levantada se o novo limite for " +"muito baixo na profundidade de recursão atual." #: ../../library/sys.rst:1541 msgid "" @@ -2392,6 +2663,13 @@ msgid "" "the operating system's decision. The interpreter doesn't have its own " "scheduler." msgstr "" +"Define o intervalo de troca de thread do interpretador (em segundos). Este " +"valor de ponto flutuante determina a duração ideal das \"fatias de tempo\" " +"alocadas para threads Python em execução simultânea. Observe que o valor " +"real pode ser maior, especialmente se funções ou métodos internos de " +"execução longa forem usados. Além disso, qual thread se torna agendada no " +"final do intervalo é uma decisão do sistema operacional. O interpretador não " +"tem seu próprio escalonador." #: ../../library/sys.rst:1558 msgid "" @@ -2401,6 +2679,11 @@ msgid "" "using :func:`settrace` for each thread being debugged or use :func:" "`threading.settrace`." msgstr "" +"Define a função trace do sistema, que permite que você implemente um " +"depurador de código-fonte Python em Python. A função é específica de thread; " +"para um depurador suportar múltiplas threads, ele deve registrar uma função " +"trace usando :func:`settrace` para cada thread que está sendo depurada ou " +"usar :func:`threading.settrace`." #: ../../library/sys.rst:1563 msgid "" @@ -2409,6 +2692,10 @@ msgid "" "``'line'``, ``'return'``, ``'exception'`` or ``'opcode'``. *arg* depends on " "the event type." msgstr "" +"As funções de rastreamento devem ter três argumentos: *frame*, *event* e " +"*arg*. *frame* é o quadro de pilha atual. *event* é uma string: ``'call'``, " +"``'line'``, ``'return'``, ``'exception'`` ou ``'opcode'``. *arg* depende do " +"tipo de evento." #: ../../library/sys.rst:1568 msgid "" @@ -2417,24 +2704,36 @@ msgid "" "function to be used for the new scope, or ``None`` if the scope shouldn't be " "traced." msgstr "" +"A função de rastreamento é invocada (com *event* definido como ``'call'``) " +"sempre que um novo escopo local é inserido; ela deve retornar uma referência " +"a uma função de rastreamento local a ser usada para o novo escopo, ou " +"``None`` se o escopo não deve ser rastreado." #: ../../library/sys.rst:1573 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" +"A função de rastreamento local deve retornar uma referência a si mesma ou a " +"outra função que seria então usada como a função de rastreamento local para " +"o escopo." #: ../../library/sys.rst:1576 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" +"Se ocorrer algum erro na função de rastreamento, ela será desativada, assim " +"como ``settrace(None)`` é chamado." #: ../../library/sys.rst:1580 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" +"O rastreamento é desabilitado ao chamar a função de rastreamento (por " +"exemplo, uma função definida por :func:`!settrace`). Para rastreamento " +"recursivo, veja :func:`call_tracing`." #: ../../library/sys.rst:1586 msgid "" @@ -2442,6 +2741,9 @@ msgid "" "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" +"Uma função é chamada (ou algum outro bloco de código é inserido). A função " +"de rastreamento global é chamada; *arg* é ``None``; o valor de retorno " +"especifica a função de rastreamento local." #: ../../library/sys.rst:1590 msgid "``'line'``" @@ -2456,6 +2758,13 @@ msgid "" "events may be disabled for a frame by setting :attr:`~frame.f_trace_lines` " "to :const:`False` on that :ref:`frame `." msgstr "" +"O interpretador está prestes a executar uma nova linha de código ou " +"reexecutar a condição de um laço. A função de rastreamento local é chamada; " +"*arg* é ``None``; o valor de retorno especifica a nova função de " +"rastreamento local. Veja :file:`Objects/lnotab_notes.txt` para uma " +"explicação detalhada de como isso funciona. Eventos por linha podem ser " +"desabilitados para um quadro definindo :attr:`~frame.f_trace_lines` como :" +"const:`False` naquele :ref:`quadro `." #: ../../library/sys.rst:1601 msgid "" @@ -2464,6 +2773,10 @@ msgid "" "the event is caused by an exception being raised. The trace function's " "return value is ignored." msgstr "" +"Uma função (ou outro bloco de código) está prestes a retornar. A função de " +"rastreamento local é chamada; *arg* é o valor que será retornado, ou " +"``None`` se o evento for causado por uma exceção sendo levantada. O valor de " +"retorno da função de rastreamento é ignorado." #: ../../library/sys.rst:1606 msgid "``'exception'``" @@ -2475,6 +2788,9 @@ msgid "" "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" +"Ocorreu uma exceção. A função de rastreamento local é chamada; *arg* é uma " +"tupla ``(exception, value, traceback)``; o valor de retorno especifica a " +"nova função de rastreamento local." #: ../../library/sys.rst:1611 msgid "``'opcode'``" @@ -2489,12 +2805,20 @@ msgid "" "`~frame.f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" +"O interpretador está prestes a executar um novo opcode (veja :mod:`dis` para " +"detalhes do opcode). A função de rastreamento local é chamada; *arg* é " +"``None``; o valor de retorno especifica a nova função de rastreamento local. " +"Eventos por opcode não são emitidos por padrão: eles devem ser " +"explicitamente solicitados definindo :attr:`~frame.f_trace_opcodes` como :" +"const:`True` no :ref:`quadro `." #: ../../library/sys.rst:1619 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" +"Observe que, à medida que uma exceção é propagada pela cadeia de chamadores, " +"um evento ``'exception'`` é gerado em cada nível." #: ../../library/sys.rst:1622 msgid "" @@ -2509,16 +2833,31 @@ msgid "" "tracing function that simply returns ``None`` to disable itself immediately " "on each frame)." msgstr "" +"Para um uso mais refinado, é possível definir uma função de rastreamento " +"atribuindo ``frame.f_trace = tracefunc`` explicitamente, em vez de depender " +"de ser definida indiretamente por meio do valor de retorno de uma função de " +"rastreamento já instalada. Isso também é necessário para ativar a função de " +"rastreamento no quadro atual, o que :func:`settrace` não faz. Observe que, " +"para que isso funcione, uma função de rastreamento global deve ter sido " +"instalada com :func:`settrace` para habilitar o maquinário de rastreamento " +"em tempo de execução, mas não precisa ser a mesma função de rastreamento " +"(por exemplo, pode ser uma função de rastreamento de baixa sobrecarga que " +"simplesmente retorna ``None`` para se desabilitar imediatamente em cada " +"quadro)." #: ../../library/sys.rst:1633 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" +"Para mais informações sobre objetos de código e quadro, consulte :ref:" +"`types`." #: ../../library/sys.rst:1635 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sys.settrace`` sem " +"argumentos." #: ../../library/sys.rst:1639 msgid "" @@ -2527,12 +2866,18 @@ msgid "" "implementation platform, rather than part of the language definition, and " "thus may not be available in all Python implementations." msgstr "" +"A função :func:`settrace` destina-se apenas à implementação de depuradores, " +"perfiladores, ferramentas de cobertura e similares. Seu comportamento faz " +"parte da plataforma de implementação, e não da definição da linguagem e, " +"portanto, pode não estar disponível em todas as implementações do Python." #: ../../library/sys.rst:1646 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" +"Tipo de evento ``'opcode'`` adicionado; atributos :attr:`~frame." +"f_trace_lines` e :attr:`~frame.f_trace_opcodes` adicionados a quadros" #: ../../library/sys.rst:1649 msgid "" @@ -2550,24 +2895,35 @@ msgid "" "first time. The *finalizer* will be called when an asynchronous generator is " "about to be garbage collected." msgstr "" +"Aceita dois argumentos nomeados opcionais que são chamáveis que aceitam um :" +"term:`iterador gerador assíncrono` como argumento. O chamável *firstiter* " +"será chamado quando um gerador assíncrono for iterado pela primeira vez. O " +"*finalizer* será chamado quando um gerador assíncrono estiver prestes a ser " +"coletado como lixo." #: ../../library/sys.rst:1663 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sys." +"set_asyncgen_hooks_firstiter`` sem argumentos." #: ../../library/sys.rst:1665 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``sys." +"set_asyncgen_hooks_finalizer`` sem argumentos." #: ../../library/sys.rst:1667 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" +"Dois eventos de auditoria são gerados porque a API subjacente consiste em " +"duas chamadas, cada uma das quais deve levantar seu próprio evento." #: ../../library/sys.rst:1670 msgid "" @@ -2575,6 +2931,9 @@ msgid "" "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" +"Veja a :pep:`525` para mais detalhes, e para um exemplo de referência de um " +"método *finalizer* veja a implementação de ``asyncio.Loop." +"shutdown_asyncgens`` em :source:`Lib/asyncio/base_events.py`" #: ../../library/sys.rst:1682 msgid "" @@ -2584,6 +2943,11 @@ msgid "" "the coroutine object was created, with the most recent call first. When " "disabled, ``cr_origin`` will be ``None``." msgstr "" +"Permite habilitar ou desabilitar o rastreamento de origem de corrotina. " +"Quando habilitado, o atributo ``cr_origin`` em objetos de corrotina conterá " +"uma tupla de tuplas (nome do arquivo, número da linha, nome da função) " +"descrevendo o traceback onde o objeto corrotina foi criado, com a chamada " +"mais recente primeiro. Quando desabilitado, ``cr_origin`` será ``None``." #: ../../library/sys.rst:1689 msgid "" @@ -2591,16 +2955,21 @@ msgid "" "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" +"Para habilitar, passe um valor *depth* maior que zero; isso define o número " +"de quadros cujas informações serão capturadas. Para desabilitar, defina " +"*depth* para zero." #: ../../library/sys.rst:1693 msgid "This setting is thread-specific." -msgstr "" +msgstr "Esta configuração é específica do thread." #: ../../library/sys.rst:1703 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" +"Ativa o trampolim do perfilador de pilha *backend*. O único backend " +"suportado é ``\"perf\"``." #: ../../library/sys.rst:1706 ../../library/sys.rst:1721 #: ../../library/sys.rst:1729 @@ -2609,41 +2978,49 @@ msgstr ":ref:`Disponibilidade `: Linux." #: ../../library/sys.rst:1712 msgid ":ref:`perf_profiling`" -msgstr "" +msgstr ":ref:`perf_profiling`" #: ../../library/sys.rst:1713 msgid "https://perf.wiki.kernel.org" -msgstr "" +msgstr "https://perf.wiki.kernel.org" #: ../../library/sys.rst:1717 msgid "Deactivate the current stack profiler trampoline backend." -msgstr "" +msgstr "Desativa o backend trampolim do perfilador de pilha atual." #: ../../library/sys.rst:1719 msgid "If no stack profiler is activated, this function has no effect." msgstr "" +"Se nenhum perfilador de pilha estiver ativado, esta função não terá efeito." #: ../../library/sys.rst:1727 msgid "Return ``True`` if a stack profiler trampoline is active." -msgstr "" +msgstr "Retorna ``True`` se um trampolim de perfilador de pilha estiver ativo." #: ../../library/sys.rst:1735 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" +"Altera :term:`tratador de erros e codificação do sistema de arquivos` para " +"'replace' e 'mbcs' respectivamente, para consistência com versões do Python " +"anteriores à 3.6." #: ../../library/sys.rst:1739 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" +"Isso é equivalente a definir a variável de ambiente :envvar:" +"`PYTHONLEGACYWINDOWSFSENCODING` antes de iniciar o Python." #: ../../library/sys.rst:1742 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" +"Veja também :func:`sys.getfilesystemencoding` e :func:`sys." +"getfilesystemencodeerrors`." #: ../../library/sys.rst:1747 msgid "See :pep:`529` for more details." @@ -2654,34 +3031,47 @@ msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" +":term:`Objetos arquivo ` usados ​​pelo interpretador para entrada " +"padrão, saída e erros:" #: ../../library/sys.rst:1757 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" +"``stdin`` é usado para todas as entradas interativas (incluindo chamadas " +"para :func:`input`);" #: ../../library/sys.rst:1759 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" +"``stdout`` é usado para a saída das instruções :func:`print` e :term:" +"`expressões ` e para os prompts de :func:`input`;" #: ../../library/sys.rst:1761 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" +"Os prompts do próprio interpretador e suas mensagens de erro vão para " +"``stderr``." #: ../../library/sys.rst:1763 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" +"Esses fluxos são :term:`arquivos texto ` regulares como aqueles " +"retornados pela função :func:`open`. Seus parâmetros são escolhidos da " +"seguinte forma:" #: ../../library/sys.rst:1767 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" +"A codificação e o tratamento de erros são inicializados a partir de :c:" +"member:`PyConfig.stdio_encoding` e :c:member:`PyConfig.stdio_errors`." #: ../../library/sys.rst:1770 msgid "" @@ -2693,6 +3083,14 @@ msgid "" "defaults to the system :term:`locale encoding` if the process is not " "initially attached to a console." msgstr "" +"No Windows, o UTF-8 é usado para o dispositivo de console. Dispositivos não-" +"caracteres, como arquivos de disco e pipes, usam a codificação da localidade " +"do sistema (ou seja, a página de código ANSI). Dispositivos de caracteres " +"não-console, como NUL (ou seja, onde ``isatty()`` retorna ``True``) usam o " +"valor das páginas de código de entrada e saída do console na inicialização, " +"respectivamente para stdin e stdout/stderr. Isso assume como padrão a :term:" +"`codificação da localidade` do sistema se o processo não for inicialmente " +"anexado a um console." #: ../../library/sys.rst:1779 msgid "" @@ -2700,6 +3098,10 @@ msgid "" "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" +"O comportamento especial do console pode ser substituído definindo a " +"variável de ambiente PYTHONLEGACYWINDOWSSTDIO antes de iniciar o Python. " +"Nesse caso, as páginas de código do console são usadas como para qualquer " +"outro dispositivo de caractere." #: ../../library/sys.rst:1784 msgid "" @@ -2709,6 +3111,12 @@ msgid "" "`PYTHONUTF8` environment variable. However, for the Windows console, this " "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" +"Em todas as plataformas, você pode substituir a codificação de caracteres " +"definindo a variável de ambiente :envvar:`PYTHONIOENCODING` antes de iniciar " +"o Python ou usando a nova opção de linha de comando :option:`-X` ``utf8`` e " +"a variável de ambiente :envvar:`PYTHONUTF8`. No entanto, para o console do " +"Windows, isso só se aplica quando :envvar:`PYTHONLEGACYWINDOWSSTDIO` também " +"está definido." #: ../../library/sys.rst:1791 msgid "" @@ -2718,11 +3126,18 @@ msgid "" "the :option:`-u` command-line option or setting the :envvar:" "`PYTHONUNBUFFERED` environment variable." msgstr "" +"Quando interativo, o fluxo ``stdout`` é armazenado em buffer de linha. Caso " +"contrário, ele é armazenado em buffer de bloco como arquivos texto comuns. O " +"fluxo ``stderr`` é armazenado em buffer de linha em ambos os casos. Você " +"pode tornar ambos os fluxos sem buffer passando a opção de linha de comando :" +"option:`-u` ou definindo a variável de ambiente :envvar:`PYTHONUNBUFFERED`." #: ../../library/sys.rst:1797 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" +"``stderr`` não interativo agora é armazenado em buffer de linha em vez de " +"totalmente armazenado em buffer." #: ../../library/sys.rst:1803 msgid "" @@ -2730,6 +3145,9 @@ msgid "" "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" +"Para escrever ou ler dados binários de/para os fluxos padrão, use o objeto " +"binário subjacente :data:`~io.TextIOBase.buffer`. Por exemplo, para escrever " +"bytes em :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." #: ../../library/sys.rst:1807 msgid "" @@ -2738,6 +3156,10 @@ msgid "" "replaced with file-like objects like :class:`io.StringIO` which do not " "support the :attr:`!buffer` attribute." msgstr "" +"Entretanto, se você estiver escrevendo uma biblioteca (e não controlar em " +"qual contexto seu código será executado), esteja ciente de que os fluxos " +"padrão podem ser substituídos por objetos arquivo ou similar, como :class:" +"`io.StringIO`, que não oferecem suporte ao atributo :attr:`!buffer`." #: ../../library/sys.rst:1817 msgid "" @@ -2746,6 +3168,10 @@ msgid "" "and could be useful to print to the actual standard stream no matter if the " "``sys.std*`` object has been redirected." msgstr "" +"Esses objetos contêm os valores originais de ``stdin``, ``stderr`` e " +"``stdout`` no início do programa. Eles são usados ​​durante a finalização e " +"podem ser úteis para imprimir no fluxo padrão real, não importa se o objeto " +"``sys.std*`` foi redirecionado." #: ../../library/sys.rst:1822 msgid "" @@ -2754,6 +3180,11 @@ msgid "" "the preferred way to do this is to explicitly save the previous stream " "before replacing it, and restore the saved object." msgstr "" +"Ele também pode ser usado para restaurar os arquivos reais para objetos " +"arquivo de trabalho conhecidos, caso tenham sido substituídos por um objeto " +"quebrado. No entanto, a maneira preferida de fazer isso é salvar " +"explicitamente o fluxo anterior antes de substituí-lo e restaurar o objeto " +"salvo." #: ../../library/sys.rst:1828 msgid "" @@ -2762,11 +3193,17 @@ msgid "" "``None``. It is usually the case for Windows GUI apps that aren't connected " "to a console and Python apps started with :program:`pythonw`." msgstr "" +"Sob algumas condições, ``stdin``, ``stdout`` e ``stderr``, bem como os " +"valores originais de ``__stdin__``, ``__stdout__`` e ``__stderr__`` podem " +"ser ``None``. Geralmente é o caso de aplicativos GUI do Windows que não " +"estão conectados a um console e aplicativos Python iniciados com :program:" +"`pythonw`." #: ../../library/sys.rst:1836 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" +"Um frozenset de strings contendo os nomes dos módulos da biblioteca padrão." #: ../../library/sys.rst:1838 msgid "" @@ -2775,6 +3212,10 @@ msgid "" "kinds are listed: pure Python, built-in, frozen and extension modules. Test " "modules are excluded." msgstr "" +"É o mesmo em todas as plataformas. Módulos que não estão disponíveis em " +"algumas plataformas e módulos desabilitados na construção do Python também " +"são listados. Todos os tipos de módulos são listados: Python puro, módulos " +"embutidos, congelados e de extensão. Módulos de teste são excluídos." #: ../../library/sys.rst:1843 msgid "" @@ -2783,27 +3224,32 @@ msgid "" "``email.mime`` sub-package and the ``email.message`` sub-module are not " "listed." msgstr "" +"Para pacotes, somente o pacote principal é listado: subpacotes e submódulos " +"não são listados. Por exemplo, o pacote ``email`` é listado, mas o subpacote " +"``email.mime`` e o submódulo ``email.message`` não são listados." #: ../../library/sys.rst:1848 msgid "See also the :data:`sys.builtin_module_names` list." -msgstr "" +msgstr "Veja também a lista de :data:`sys.builtin_module_names`." #: ../../library/sys.rst:1855 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" +"Uma :term:`tupla nomeada` contendo informações sobre a implementação de " +"threads." #: ../../library/sys.rst:1860 msgid "The name of the thread implementation:" -msgstr "" +msgstr "O nome da implementação da thread:" #: ../../library/sys.rst:1862 msgid "``\"nt\"``: Windows threads" -msgstr "" +msgstr "``\"nt\"``: Threads do Windows" #: ../../library/sys.rst:1863 msgid "``\"pthread\"``: POSIX threads" -msgstr "" +msgstr "``\"pthread\"``: Threads do POSIX" #: ../../library/sys.rst:1864 msgid "" @@ -2813,29 +3259,31 @@ msgstr "" #: ../../library/sys.rst:1866 msgid "``\"solaris\"``: Solaris threads" -msgstr "" +msgstr "``\"solaris\"``: Threads do Solaris" #: ../../library/sys.rst:1870 msgid "The name of the lock implementation:" -msgstr "" +msgstr "O nome da implementação de trava." #: ../../library/sys.rst:1872 msgid "``\"semaphore\"``: a lock uses a semaphore" -msgstr "" +msgstr "``\"semaphore\"``: uma trava usa um semáforo" #: ../../library/sys.rst:1873 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" -msgstr "" +msgstr "``\"mutex+cond\"``: uma trava usa um mutex e uma variável de condição" #: ../../library/sys.rst:1874 msgid "``None`` if this information is unknown" -msgstr "" +msgstr "``None`` se essa informação for desconhecida" #: ../../library/sys.rst:1878 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" +"O nome e a versão da biblioteca de threads. É uma string, ou ``None`` se " +"essa informação for desconhecida." #: ../../library/sys.rst:1886 msgid "" @@ -2845,10 +3293,15 @@ msgid "" "traceback information is suppressed and only the exception type and value " "are printed." msgstr "" +"Quando essa variável é definida como um valor inteiro, ela determina o " +"número máximo de níveis de informações de traceback impressas quando ocorre " +"uma exceção não tratada. O padrão é ``1000``. Quando definida como ``0`` ou " +"menos, todas as informações de traceback são suprimidas e apenas o tipo e o " +"valor da exceção são impressos." #: ../../library/sys.rst:1894 msgid "Handle an unraisable exception." -msgstr "" +msgstr "Manipula uma exceção não levantada" #: ../../library/sys.rst:1896 msgid "" @@ -2856,30 +3309,33 @@ msgid "" "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" +"Chamada quando uma exceção ocorreu, mas não há como o Python manipulá-la. " +"Por exemplo, quando um destrutor levanta uma exceção ou durante a coleta de " +"lixo (:func:`gc.collect`)." #: ../../library/sys.rst:1900 msgid "The *unraisable* argument has the following attributes:" -msgstr "" +msgstr "O argumento *unraisable* tem os seguintes atributos:" #: ../../library/sys.rst:1902 msgid ":attr:`!exc_type`: Exception type." -msgstr "" +msgstr ":attr:`!exc_type`: Tipo de exceção." #: ../../library/sys.rst:1903 msgid ":attr:`!exc_value`: Exception value, can be ``None``." -msgstr "" +msgstr ":attr:`!exc_value`: Valor da exceção, pode ser ``None``." #: ../../library/sys.rst:1904 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." -msgstr "" +msgstr ":attr:`!exc_traceback`: Traceback da exceção, pode ser ``None``." #: ../../library/sys.rst:1905 msgid ":attr:`!err_msg`: Error message, can be ``None``." -msgstr "" +msgstr ":attr:`!err_msg`: Mensagem de erro, pode ser ``None``." #: ../../library/sys.rst:1906 msgid ":attr:`!object`: Object causing the exception, can be ``None``." -msgstr "" +msgstr ":attr:`!object`: O objeto que causa a exceção pode ser ``None``." #: ../../library/sys.rst:1908 msgid "" @@ -2887,16 +3343,21 @@ msgid "" "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" +"Os formatos de gancho padrão :attr:`!err_msg` e :attr:`!object` como: " +"``f'{err_msg}: {object!r}'``; usa a mensagem de erro \"Exception ignored " +"in\" se :attr:`!err_msg` for ``None``." #: ../../library/sys.rst:1912 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" +":func:`sys.unraisablehook` pode ser substituída para controlar como exceções " +"não levantáveis ​​são manipuladas." #: ../../library/sys.rst:1917 msgid ":func:`excepthook` which handles uncaught exceptions." -msgstr "" +msgstr ":func:`excepthook`, que manipula exceções não capturadas." #: ../../library/sys.rst:1921 msgid "" @@ -2904,6 +3365,9 @@ msgid "" "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" +"Armazena :attr:`!exc_value` usando um gancho personalizado pode criar um " +"ciclo de referência. Ele deve ser limpo explicitamente para quebrar o ciclo " +"de referência quando a exceção não for mais necessária." #: ../../library/sys.rst:1925 msgid "" @@ -2911,6 +3375,10 @@ msgid "" "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" +"Armazenar :attr:`!object` usando um gancho personalizado pode ressuscitá-lo " +"se ele for definido como um objeto que está sendo finalizado. Evite " +"armazenar :attr:`!object` após o gancho personalizado ser concluído para " +"evitar ressuscitar objetos." #: ../../library/sys.rst:1929 msgid "" @@ -2925,6 +3393,10 @@ msgid "" "*unraisable* object is the same as what will be passed to the hook. If no " "hook has been set, *hook* may be ``None``." msgstr "" +"Levanta um evento de auditoria ``sys.unraisablehook`` com argumentos *hook* " +"e *unraisable* quando ocorrer uma exceção que não puder ser manipulada. O " +"objeto *unraisable* é o mesmo que será passado para o gancho. Se nenhum " +"gancho tiver sido definido, *hook* pode ser ``None``." #: ../../library/sys.rst:1940 msgid "" @@ -2934,12 +3406,19 @@ msgid "" "version information out of it, rather, use :data:`version_info` and the " "functions provided by the :mod:`platform` module." msgstr "" +"Uma string contendo o número da versão do interpretador Python mais " +"informações adicionais sobre o número da construção e o compilador usado. " +"Esta string é exibida quando o interpretador interativo é iniciado. Não " +"extraia informações de versão dela, em vez disso, use :data:`version_info` e " +"as funções fornecidas pelo módulo :mod:`platform`." #: ../../library/sys.rst:1949 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" +"A versão da API C para este interpretador. Programadores podem achar isso " +"útil ao depurar conflitos de versão entre Python e módulos de extensão." #: ../../library/sys.rst:1955 msgid "" @@ -2951,6 +3430,13 @@ msgid "" "also be accessed by name, so ``sys.version_info[0]`` is equivalent to ``sys." "version_info.major`` and so on." msgstr "" +"Uma tupla contendo os cinco componentes do número da versão: *major*, " +"*minor*, *micro*, *releaselevel* e *serial*. Todos os valores, exceto " +"*releaselevel*, são inteiros; o nível de versão é ``'alpha'``, ``'beta'``, " +"``'candidate'`` ou ``'final'``. O valor ``version_info`` correspondente à " +"versão 2.0 do Python é ``(2, 0, 0, 'final', 0)``. Os componentes também " +"podem ser acessados ​​por nome, então ``sys.version_info[0]`` é equivalente a " +"``sys.version_info.major`` e assim por diante." #: ../../library/sys.rst:1963 msgid "Added named component attributes." @@ -2962,6 +3448,9 @@ msgid "" "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" +"Este é um detalhe de implementação do framework de avisos; não modifique " +"este valor. Consulte o módulo :mod:`warnings` para obter mais informações " +"sobre o framework de avisos." #: ../../library/sys.rst:1975 msgid "" @@ -2971,12 +3460,21 @@ msgid "" "in the :mod:`sys` module for informational purposes; modifying this value " "has no effect on the registry keys used by Python." msgstr "" +"O número da versão usado para formar chaves de registro em plataformas " +"Windows. Isso é armazenado como recurso de string 1000 na DLL do Python. O " +"valor normalmente é a versão principal e secundária do interpretador Python " +"em execução. Ele é fornecido no módulo :mod:`sys` para fins informativos; " +"modificar esse valor não tem efeito nas chaves de registro usadas pelo " +"Python." #: ../../library/sys.rst:1987 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" +"Espaço de nomes contendo funções e constantes para função de retorno de " +"registro e controle de eventos de monitoramento. Veja :mod:`sys.monitoring` " +"para detalhes." #: ../../library/sys.rst:1993 msgid "" @@ -2984,6 +3482,10 @@ msgid "" "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" +"Um dicionário dos vários sinalizadores específicos de implementação passados ​​" +"pela opção de linha de comando :option:`-X`. Os nomes de opção são mapeados " +"para seus valores, se fornecidos explicitamente, ou para :const:`True`. " +"Exemplo:" #: ../../library/sys.rst:2009 msgid "" @@ -2991,10 +3493,13 @@ msgid "" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" +"Esta é uma maneira específica do CPython de acessar opções passadas por :" +"option:`-X`. Outras implementações podem exportá-las por outros meios, ou " +"não exportá-las." #: ../../library/sys.rst:2017 msgid "Citations" -msgstr "" +msgstr "Citações" #: ../../library/sys.rst:2018 msgid "" @@ -3002,10 +3507,13 @@ msgid "" "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" "n1256.pdf\\ ." msgstr "" +"ISO/IEC 9899:1999. \"Programming languages -- C.\" Um rascunho público " +"desta norma está disponível em https://www.open-std.org/jtc1/sc22/wg14/www/" +"docs/n1256.pdf\\ ." #: ../../library/sys.rst:99 msgid "auditing" -msgstr "" +msgstr "auditoria" #: ../../library/sys.rst:451 msgid "object" @@ -3017,11 +3525,11 @@ msgstr "traceback" #: ../../library/sys.rst:912 ../../library/sys.rst:1471 msgid "profile function" -msgstr "" +msgstr "função de perfilação" #: ../../library/sys.rst:912 ../../library/sys.rst:1471 msgid "profiler" -msgstr "" +msgstr "perfilador" #: ../../library/sys.rst:921 ../../library/sys.rst:1554 msgid "trace function" @@ -3045,11 +3553,11 @@ msgstr "caminho" #: ../../library/sys.rst:1435 msgid "interpreter prompts" -msgstr "" +msgstr "prompts do interpretador" #: ../../library/sys.rst:1435 msgid "prompts, interpreter" -msgstr "" +msgstr "interpretador, prompts" #: ../../library/sys.rst:1435 msgid ">>>" @@ -3057,7 +3565,7 @@ msgstr ">>>" #: ../../library/sys.rst:1435 msgid "interpreter prompt" -msgstr "" +msgstr "prompt do interpretador" #: ../../library/sys.rst:1435 msgid "..." diff --git a/library/sys_path_init.po b/library/sys_path_init.po index 18b76bf61..716bc2da6 100644 --- a/library/sys_path_init.po +++ b/library/sys_path_init.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/sysconfig.po b/library/sysconfig.po index 59af5a651..d36da3dc0 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -32,6 +32,7 @@ msgstr "" msgid "" ":mod:`!sysconfig` --- Provide access to Python's configuration information" msgstr "" +":mod:`!sysconfig` --- Fornece acesso às informações de configuração do Python" #: ../../library/sysconfig.rst:12 msgid "**Source code:** :source:`Lib/sysconfig.py`" @@ -72,7 +73,7 @@ msgstr "" #: ../../library/sysconfig.rst:34 msgid "Notice that on Windows, it's a much smaller set." -msgstr "Notice that on Windows, it's a much smaller set." +msgstr "Note que no Windows, é um conjunto muito menor." #: ../../library/sysconfig.rst:38 msgid "" diff --git a/library/syslog.po b/library/syslog.po index 9d83745d9..58f1dc2d1 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/syslog.rst:2 msgid ":mod:`!syslog` --- Unix syslog library routines" -msgstr "" +msgstr ":mod:`!syslog` --- Rotinas da biblioteca syslog do Unix" #: ../../library/syslog.rst:10 msgid "" @@ -87,7 +87,7 @@ msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``syslog.syslog`` com " +"Levanta um :ref:`evento de auditoria ` ``syslog.syslog`` com os " "argumentos ``priority``, ``message``." #: ../../library/syslog.rst:38 @@ -145,7 +145,7 @@ msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``syslog.openlog`` com " +"Levanta um :ref:`evento de auditoria ` ``syslog.openlog`` com os " "argumentos ``ident``, ``logoption``, ``facility``." #: ../../library/syslog.rst:66 @@ -192,8 +192,8 @@ msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``syslog.closelog`` com " -"nenhum argumento." +"Levanta um :ref:`evento de auditoria ` ``syslog.closelog`` sem " +"argumentos." #: ../../library/syslog.rst:99 msgid "" @@ -216,7 +216,7 @@ msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``syslog.setlogmask`` com " +"Levanta um :ref:`evento de auditoria ` ``syslog.setlogmask`` com o " "argumento ``maskpri``." #: ../../library/syslog.rst:108 diff --git a/library/tabnanny.po b/library/tabnanny.po index e5f93c817..235fd296e 100644 --- a/library/tabnanny.po +++ b/library/tabnanny.po @@ -19,16 +19,16 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tabnanny.rst:2 msgid ":mod:`!tabnanny` --- Detection of ambiguous indentation" -msgstr "" +msgstr ":mod:`!tabnanny` --- Detecção de indentação ambígua" #: ../../library/tabnanny.rst:13 msgid "**Source code:** :source:`Lib/tabnanny.py`" diff --git a/library/tarfile.po b/library/tarfile.po index 92c829dbe..3045af8ab 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Marco Rougeth , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tarfile.rst:2 msgid ":mod:`!tarfile` --- Read and write tar archive files" -msgstr "" +msgstr ":mod:`!tarfile` --- Ler e gravar arquivos do tipo tar" #: ../../library/tarfile.rst:10 msgid "**Source code:** :source:`Lib/tarfile.py`" @@ -109,7 +109,7 @@ msgstr "modo" #: ../../library/tarfile.rst:57 msgid "action" -msgstr "action" +msgstr "ação" #: ../../library/tarfile.rst:59 msgid "``'r' or 'r:*'``" @@ -133,7 +133,7 @@ msgstr "``'r:gz'``" #: ../../library/tarfile.rst:65 msgid "Open for reading with gzip compression." -msgstr "" +msgstr "Aberto para leitura com compactação gzip." #: ../../library/tarfile.rst:67 msgid "``'r:bz2'``" @@ -141,7 +141,7 @@ msgstr "``'r:bz2'``" #: ../../library/tarfile.rst:67 msgid "Open for reading with bzip2 compression." -msgstr "" +msgstr "Aberto para leitura com compactação bzip2." #: ../../library/tarfile.rst:69 msgid "``'r:xz'``" @@ -149,11 +149,11 @@ msgstr "``'r:xz'``" #: ../../library/tarfile.rst:69 msgid "Open for reading with lzma compression." -msgstr "" +msgstr "Aberto para leitura com compactação lzma." #: ../../library/tarfile.rst:71 msgid "``'x'`` or ``'x:'``" -msgstr "" +msgstr "``'x'`` ou ``'x:'``" #: ../../library/tarfile.rst:71 msgid "" @@ -193,7 +193,7 @@ msgstr "" #: ../../library/tarfile.rst:88 msgid "``'a' or 'a:'``" -msgstr "" +msgstr "``'a' or 'a:'``" #: ../../library/tarfile.rst:88 msgid "" @@ -203,11 +203,11 @@ msgstr "" #: ../../library/tarfile.rst:91 msgid "``'w' or 'w:'``" -msgstr "" +msgstr "``'w' or 'w:'``" #: ../../library/tarfile.rst:91 msgid "Open for uncompressed writing." -msgstr "" +msgstr "Aberto para gravação não compactada." #: ../../library/tarfile.rst:93 msgid "``'w:gz'``" @@ -215,7 +215,7 @@ msgstr "``'w:gz'``" #: ../../library/tarfile.rst:93 msgid "Open for gzip compressed writing." -msgstr "" +msgstr "Aberto para gravação compactada com gzip." #: ../../library/tarfile.rst:95 msgid "``'w:bz2'``" @@ -223,7 +223,7 @@ msgstr "``'w:bz2'``" #: ../../library/tarfile.rst:95 msgid "Open for bzip2 compressed writing." -msgstr "" +msgstr "Aberto para gravação compactada com bzip2." #: ../../library/tarfile.rst:97 msgid "``'w:xz'``" @@ -231,7 +231,7 @@ msgstr "``'w:xz'``" #: ../../library/tarfile.rst:97 msgid "Open for lzma compressed writing." -msgstr "" +msgstr "Aberto para gravação compactada com lzma." #: ../../library/tarfile.rst:100 msgid "" @@ -280,7 +280,7 @@ msgstr "Modo" #: ../../library/tarfile.rst:129 msgid "Action" -msgstr "" +msgstr "Ação" #: ../../library/tarfile.rst:131 msgid "``'r|*'``" @@ -289,6 +289,7 @@ msgstr "``'r|*'``" #: ../../library/tarfile.rst:131 msgid "Open a *stream* of tar blocks for reading with transparent compression." msgstr "" +"Abre um *stream* de blocos tar para leitura com compactação transparente." #: ../../library/tarfile.rst:134 msgid "``'r|'``" @@ -296,7 +297,7 @@ msgstr "``'r|'``" #: ../../library/tarfile.rst:134 msgid "Open a *stream* of uncompressed tar blocks for reading." -msgstr "" +msgstr "Abre um *stream* de blocos tar não compactados para leitura." #: ../../library/tarfile.rst:137 msgid "``'r|gz'``" @@ -304,7 +305,7 @@ msgstr "``'r|gz'``" #: ../../library/tarfile.rst:137 msgid "Open a gzip compressed *stream* for reading." -msgstr "" +msgstr "Abre um *stream* compactado com gzip para leitura." #: ../../library/tarfile.rst:140 msgid "``'r|bz2'``" @@ -312,7 +313,7 @@ msgstr "``'r|bz2'``" #: ../../library/tarfile.rst:140 msgid "Open a bzip2 compressed *stream* for reading." -msgstr "" +msgstr "Abre um *stream* compactado com bzip2 para leitura." #: ../../library/tarfile.rst:143 msgid "``'r|xz'``" @@ -320,7 +321,7 @@ msgstr "``'r|xz'``" #: ../../library/tarfile.rst:143 msgid "Open an lzma compressed *stream* for reading." -msgstr "" +msgstr "Abre um *stream* compactado com lzma para leitura." #: ../../library/tarfile.rst:146 msgid "``'w|'``" @@ -328,7 +329,7 @@ msgstr "``'w|'``" #: ../../library/tarfile.rst:146 msgid "Open an uncompressed *stream* for writing." -msgstr "" +msgstr "Abre um *stream* descompactado para gravação." #: ../../library/tarfile.rst:148 msgid "``'w|gz'``" @@ -336,7 +337,7 @@ msgstr "``'w|gz'``" #: ../../library/tarfile.rst:148 msgid "Open a gzip compressed *stream* for writing." -msgstr "" +msgstr "Abre um *stream* compactado com gzip para gravação." #: ../../library/tarfile.rst:151 msgid "``'w|bz2'``" @@ -344,7 +345,7 @@ msgstr "``'w|bz2'``" #: ../../library/tarfile.rst:151 msgid "Open a bzip2 compressed *stream* for writing." -msgstr "" +msgstr "Abre um *stream* compactado com bzip2 para gravação." #: ../../library/tarfile.rst:154 msgid "``'w|xz'``" @@ -352,7 +353,7 @@ msgstr "``'w|xz'``" #: ../../library/tarfile.rst:154 msgid "Open an lzma compressed *stream* for writing." -msgstr "" +msgstr "Abre um *stream* compactado com lzma para gravação." #: ../../library/tarfile.rst:158 ../../library/tarfile.rst:422 msgid "The ``'x'`` (exclusive creation) mode was added." @@ -390,7 +391,7 @@ msgstr "" #: ../../library/tarfile.rst:189 msgid "Base class for all :mod:`tarfile` exceptions." -msgstr "" +msgstr "Classe base para todas as exceções de :mod:`tarfile`." #: ../../library/tarfile.rst:194 msgid "" @@ -465,7 +466,7 @@ msgstr "" #: ../../library/tarfile.rst:263 msgid "A regular file :attr:`~TarInfo.type`." -msgstr "" +msgstr "Um arquivo normal :attr:`~TarInfo.type`." #: ../../library/tarfile.rst:267 msgid "A link (inside tarfile) :attr:`~TarInfo.type`." @@ -516,7 +517,7 @@ msgstr "" #: ../../library/tarfile.rst:313 msgid "POSIX.1-1988 (ustar) format." -msgstr "" +msgstr "formato POSIX.1-1988 (ustar)." #: ../../library/tarfile.rst:318 msgid "GNU tar format." @@ -524,7 +525,7 @@ msgstr "Formato tar GNU" #: ../../library/tarfile.rst:323 msgid "POSIX.1-2001 (pax) format." -msgstr "" +msgstr "formato POSIX.1-2001 (pax)." #: ../../library/tarfile.rst:328 msgid "" @@ -540,7 +541,7 @@ msgstr "" #: ../../library/tarfile.rst:337 msgid "Module :mod:`zipfile`" -msgstr "" +msgstr "Módulo :mod:`zipfile`" #: ../../library/tarfile.rst:338 msgid "Documentation of the :mod:`zipfile` standard module." @@ -777,7 +778,7 @@ msgstr "" #: ../../library/tarfile.rst:506 ../../library/tarfile.rst:542 msgid "Added the *numeric_owner* parameter." -msgstr "" +msgstr "Adicionado o parâmetro *numeric_owner*." #: ../../library/tarfile.rst:509 ../../library/tarfile.rst:545 msgid "The *path* parameter accepts a :term:`path-like object`." @@ -786,7 +787,7 @@ msgstr "O parâmetro *path* aceita um :term:`objeto caminho ou similar`." #: ../../library/tarfile.rst:512 ../../library/tarfile.rst:548 #: ../../library/tarfile.rst:626 msgid "Added the *filter* parameter." -msgstr "" +msgstr "Adicionado o parâmetro *filter*." #: ../../library/tarfile.rst:518 msgid "" @@ -951,11 +952,11 @@ msgstr "" #: ../../library/tarfile.rst:673 msgid "A dictionary containing key-value pairs of pax global headers." -msgstr "" +msgstr "Um dicionário contendo pares de chave-valor de cabeçalhos globais pax." #: ../../library/tarfile.rst:680 msgid "TarInfo Objects" -msgstr "" +msgstr "Objetos TarInfo" #: ../../library/tarfile.rst:682 msgid "" @@ -996,23 +997,25 @@ msgstr "" #: ../../library/tarfile.rst:703 msgid ":meth:`~TarFile.addfile` will fail." -msgstr "" +msgstr ":meth:`~TarFile.addfile` falhará." #: ../../library/tarfile.rst:704 msgid ":meth:`~TarFile.list` will print a placeholder string." -msgstr "" +msgstr ":meth:`~TarFile.list` imprimirá uma string como um espaço reservado." #: ../../library/tarfile.rst:708 msgid "Create a :class:`TarInfo` object." -msgstr "" +msgstr "Cria um objeto :class:`TarInfo`." #: ../../library/tarfile.rst:713 msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" +"Cria e retorna um objeto :class:`TarInfo` a partir do buffer de string do " +"parâmetro *buf*." #: ../../library/tarfile.rst:715 msgid "Raises :exc:`HeaderError` if the buffer is invalid." -msgstr "" +msgstr "Levanta :exc:`HeaderError` se o buffer for inválido." #: ../../library/tarfile.rst:720 msgid "" @@ -1032,11 +1035,11 @@ msgstr "" #: ../../library/tarfile.rst:739 msgid "Name of the archive member." -msgstr "" +msgstr "Nome do arquivo." #: ../../library/tarfile.rst:745 msgid "Size in bytes." -msgstr "" +msgstr "Tamanho em bytes." #: ../../library/tarfile.rst:751 msgid "" @@ -1080,39 +1083,39 @@ msgstr "" #: ../../library/tarfile.rst:795 msgid "User ID of the user who originally stored this member." -msgstr "" +msgstr "ID do usuário do usuário que originalmente armazenou este membro." #: ../../library/tarfile.rst:806 msgid "Group ID of the user who originally stored this member." -msgstr "" +msgstr "ID do grupo do usuário que originalmente armazenou este membro." #: ../../library/tarfile.rst:817 msgid "User name." -msgstr "" +msgstr "Nome do usuário." #: ../../library/tarfile.rst:828 msgid "Group name." -msgstr "" +msgstr "Nome do grupo." #: ../../library/tarfile.rst:839 msgid "Header checksum." -msgstr "" +msgstr "Cabeçalho de soma de verificação." #: ../../library/tarfile.rst:845 msgid "Device major number." -msgstr "" +msgstr "Número principal do dispositivo." #: ../../library/tarfile.rst:851 msgid "Device minor number." -msgstr "" +msgstr "Número menor do dispositivo." #: ../../library/tarfile.rst:857 msgid "The tar header starts here." -msgstr "" +msgstr "O cabeçalho do tar começa aqui." #: ../../library/tarfile.rst:863 msgid "The file's data starts here." -msgstr "" +msgstr "Os dados do arquivo começam aqui." #: ../../library/tarfile.rst:868 msgid "Sparse member information." @@ -1147,23 +1150,23 @@ msgstr "" #: ../../library/tarfile.rst:902 msgid "Same as :meth:`isfile`." -msgstr "" +msgstr "Igual a :meth:`isfile`." #: ../../library/tarfile.rst:907 msgid "Return :const:`True` if it is a directory." -msgstr "" +msgstr "Retorna :const:`True` se for um diretório." #: ../../library/tarfile.rst:912 msgid "Return :const:`True` if it is a symbolic link." -msgstr "" +msgstr "Retorna :const:`True` se for um link simbólico." #: ../../library/tarfile.rst:917 msgid "Return :const:`True` if it is a hard link." -msgstr "" +msgstr "Retorna :const:`True` se for um link físico." #: ../../library/tarfile.rst:922 msgid "Return :const:`True` if it is a character device." -msgstr "" +msgstr "Retorna :const:`True` se for um caractere." #: ../../library/tarfile.rst:927 msgid "Return :const:`True` if it is a block device." @@ -1171,7 +1174,7 @@ msgstr "" #: ../../library/tarfile.rst:932 msgid "Return :const:`True` if it is a FIFO." -msgstr "" +msgstr "Retorna :const:`True` se for um FIFO." #: ../../library/tarfile.rst:937 msgid "" @@ -1180,7 +1183,7 @@ msgstr "" #: ../../library/tarfile.rst:943 msgid "Extraction filters" -msgstr "" +msgstr "Filtros de extração" #: ../../library/tarfile.rst:947 msgid "" @@ -1201,11 +1204,11 @@ msgstr "" #: ../../library/tarfile.rst:961 msgid ":pep:`706`" -msgstr "" +msgstr ":pep:`706`" #: ../../library/tarfile.rst:962 msgid "Contains further motivation and rationale behind the design." -msgstr "" +msgstr "Contém a motivação e lógica escolhida para este design." #: ../../library/tarfile.rst:964 msgid "" @@ -1295,7 +1298,7 @@ msgstr "" #: ../../library/tarfile.rst:1016 msgid "Return *member* unchanged." -msgstr "" +msgstr "Retorna *member* inalterado." #: ../../library/tarfile.rst:1018 msgid "This implements the ``'fully_trusted'`` filter." @@ -1364,7 +1367,7 @@ msgstr "" #: ../../library/tarfile.rst:1055 msgid "For regular files, including hard links:" -msgstr "" +msgstr "Para arquivos comuns, incluindo links físicos:" #: ../../library/tarfile.rst:1057 msgid "" @@ -1405,7 +1408,7 @@ msgstr "" #: ../../library/tarfile.rst:1084 msgid "Hints for further verification" -msgstr "" +msgstr "Dicas para verificação adicional" #: ../../library/tarfile.rst:1086 msgid "" @@ -1417,7 +1420,7 @@ msgstr "" #: ../../library/tarfile.rst:1091 msgid "Here is an incomplete list of things to consider:" -msgstr "" +msgstr "Aqui está uma lista incompleta de itens a serem considerados:" #: ../../library/tarfile.rst:1093 msgid "" @@ -1457,7 +1460,7 @@ msgstr "" #: ../../library/tarfile.rst:1107 msgid "Also note that:" -msgstr "" +msgstr "Observe também que:" #: ../../library/tarfile.rst:1109 msgid "" @@ -1475,7 +1478,7 @@ msgstr "" #: ../../library/tarfile.rst:1119 msgid "Supporting older Python versions" -msgstr "" +msgstr "Suporte a versões mais antigas do Python" #: ../../library/tarfile.rst:1121 msgid "" @@ -1504,15 +1507,15 @@ msgstr "" #: ../../library/tarfile.rst:1142 msgid "Use the ``'data'`` filter; *fail* if it is not available::" -msgstr "" +msgstr "Use o filtro ``'data'``; *fail* se ele não estiver disponível::" #: ../../library/tarfile.rst:1146 msgid "or::" -msgstr "or::" +msgstr "ou::" #: ../../library/tarfile.rst:1151 msgid "Use the ``'data'`` filter; *warn* if it is not available::" -msgstr "" +msgstr "Use o filtro ``'data'``; *warn* se ele não estiver disponível::" #: ../../library/tarfile.rst:1162 msgid "Stateful extraction filter example" @@ -1547,7 +1550,7 @@ msgstr "" #: ../../library/tarfile.rst:1207 msgid "Passing a directory is also acceptable:" -msgstr "Passar um diretório também é aceito:" +msgstr "Passar um diretório também é aceitável:" #: ../../library/tarfile.rst:1213 msgid "" @@ -1571,11 +1574,11 @@ msgstr "Opções de linha de comando" #: ../../library/tarfile.rst:1240 msgid "List files in a tarfile." -msgstr "" +msgstr "Lista os arquivos em um arquivo tar." #: ../../library/tarfile.rst:1245 msgid "Create tarfile from source files." -msgstr "" +msgstr "Cria um arquivo tar a partir dos arquivos de origem." #: ../../library/tarfile.rst:1250 msgid "" @@ -1588,7 +1591,7 @@ msgstr "" #: ../../library/tarfile.rst:1259 msgid "Verbose output." -msgstr "" +msgstr "Saída detalhada." #: ../../library/tarfile.rst:1263 msgid "" @@ -1633,7 +1636,7 @@ msgstr "" #: ../../library/tarfile.rst:1340 msgid "Supported tar formats" -msgstr "" +msgstr "Formatos tar suportados" #: ../../library/tarfile.rst:1342 msgid "" @@ -1700,7 +1703,7 @@ msgstr "" #: ../../library/tarfile.rst:1382 msgid "Unicode issues" -msgstr "" +msgstr "Problemas de Unicode" #: ../../library/tarfile.rst:1384 msgid "" diff --git a/library/telnetlib.po b/library/telnetlib.po index a328519e6..b9026a512 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/tempfile.po b/library/tempfile.po index 83aa2bdd1..0aa93c35b 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -118,6 +118,8 @@ msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkstemp`` with " "argument ``fullpath``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``tempfile.mkstemp`` com o " +"argumento ``fullpath``." #: ../../library/tempfile.rst:72 msgid "The :py:const:`os.O_TMPFILE` flag is now used if available." @@ -311,6 +313,8 @@ msgid "" "Raises an :ref:`auditing event ` ``tempfile.mkdtemp`` with " "argument ``fullpath``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``tempfile.mkdtemp`` com o " +"argumento ``fullpath``." #: ../../library/tempfile.rst:214 msgid "Added *ignore_cleanup_errors* parameter." diff --git a/library/termios.po b/library/termios.po index 82bf144d3..9021c9400 100644 --- a/library/termios.po +++ b/library/termios.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/termios.rst:2 msgid ":mod:`!termios` --- POSIX style tty control" -msgstr "" +msgstr ":mod:`!termios` --- Controle de tty no estilo POSIX" #: ../../library/termios.rst:14 msgid "" diff --git a/library/test.po b/library/test.po index cacebbb02..b49998a4d 100644 --- a/library/test.po +++ b/library/test.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -779,6 +779,10 @@ msgid "" "that ``__del__`` methods may be called later than expected and weakrefs may " "remain alive for longer than expected." msgstr "" +"Força a coleta de tantos objetos quanto possível. Isso é necessário porque a " +"desalocação oportuna não é garantida pelo coletor de lixo. Isso significa " +"que os métodos ``__del__`` podem ser chamados mais tarde do que o esperado e " +"as referência fraca podem permanecer ativas por mais tempo do que o esperado." #: ../../library/test.rst:599 msgid "" diff --git a/library/text.po b/library/text.po index 15db840f9..fa5e65292 100644 --- a/library/text.po +++ b/library/text.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/textwrap.po b/library/textwrap.po index 57eedc849..0d4fc14fc 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/textwrap.rst:2 msgid ":mod:`!textwrap` --- Text wrapping and filling" -msgstr "" +msgstr ":mod:`!textwrap` --- Quebra automática e preenchimento de texto" #: ../../library/textwrap.rst:10 msgid "**Source code:** :source:`Lib/textwrap.py`" @@ -42,6 +42,11 @@ msgid "" "should be good enough; otherwise, you should use an instance of :class:" "`TextWrapper` for efficiency." msgstr "" +"O módulo :mod:`textwrap` fornece algumas funções convenientes, assim como :" +"class:`TextWrapper`, a classe que faz todo o trabalho. Se você estiver " +"apenas preenchendo ou fazendo quebra de linha de uma ou duas strings, as " +"funções de conveniência deverão ser boas o suficiente; caso contrário, você " +"deve usar uma instância de :class:`TextWrapper` para eficiência." #: ../../library/textwrap.rst:27 msgid "" @@ -49,34 +54,47 @@ msgid "" "*width* characters long. Returns a list of output lines, without final " "newlines." msgstr "" +"Quebra do parágrafo único em *text* (uma string) para que cada linha tenha " +"no máximo *width* caracteres. Retorna uma lista de linhas de saída, sem " +"novas linhas ao final." #: ../../library/textwrap.rst:31 msgid "" "Optional keyword arguments correspond to the instance attributes of :class:" "`TextWrapper`, documented below." msgstr "" +"Argumentos nomeados opcionais correspondem aos atributos de instância de :" +"class:`TextWrapper`, documentados abaixo." #: ../../library/textwrap.rst:34 msgid "" "See the :meth:`TextWrapper.wrap` method for additional details on how :func:" "`wrap` behaves." msgstr "" +"Veja o método :meth:`TextWrapper.wrap` para detalhes adicionais sobre como :" +"func:`wrap` se comporta." #: ../../library/textwrap.rst:45 msgid "" "Wraps the single paragraph in *text*, and returns a single string containing " "the wrapped paragraph. :func:`fill` is shorthand for ::" msgstr "" +"Quebra o parágrafo único em *text* e retorna uma única string contendo o " +"parágrafo quebrado. :func:`fill` é uma abreviação de ::" #: ../../library/textwrap.rst:50 msgid "" "In particular, :func:`fill` accepts exactly the same keyword arguments as :" "func:`wrap`." msgstr "" +"Em particular, :func:`fill` aceita exatamente os mesmos argumentos nomeados " +"que :func:`wrap`." #: ../../library/textwrap.rst:58 msgid "Collapse and truncate the given *text* to fit in the given *width*." msgstr "" +"Recolhe e trunca o texto *text* fornecido para caber na largura *width* " +"fornecida." #: ../../library/textwrap.rst:60 msgid "" @@ -85,6 +103,11 @@ msgid "" "Otherwise, enough words are dropped from the end so that the remaining words " "plus the *placeholder* fit within *width*::" msgstr "" +"Primeiro, o espaço em branco em *text* é recolhido (todos os espaços em " +"branco são substituídos por espaços simples). Se o resultado couber em " +"*width*, ele será retornado. Caso contrário, palavras suficientes serão " +"eliminadas do final para que as palavras restantes mais o *placeholder* " +"caibam em *largura*::" #: ../../library/textwrap.rst:72 msgid "" @@ -94,16 +117,26 @@ msgid "" "so changing the value of :attr:`.tabsize`, :attr:`.expand_tabs`, :attr:`." "drop_whitespace`, and :attr:`.replace_whitespace` will have no effect." msgstr "" +"Argumentos nomeados opcionais correspondem aos atributos de instância de :" +"class:`TextWrapper`, documentados abaixo. Observe que o espaço em branco é " +"recolhido antes do texto ser passado para a função :class:`TextWrapper` :" +"meth:`fill`, alterando assim o valor de :attr:`.tabsize`, :attr:`." +"expand_tabs`, :attr:`.drop_whitespace` e :attr:`.replace_whitespace` não " +"terão efeito." #: ../../library/textwrap.rst:82 msgid "Remove any common leading whitespace from every line in *text*." msgstr "" +"Remove qualquer espaço em branco inicial em comum de toda linha em *text*." #: ../../library/textwrap.rst:84 msgid "" "This can be used to make triple-quoted strings line up with the left edge of " "the display, while still presenting them in the source code in indented form." msgstr "" +"Isso pode ser usado para alinhar strings entre aspas triplas com a borda " +"esquerda da tela, enquanto ainda as apresenta no código-fonte em formato com " +"indentação." #: ../../library/textwrap.rst:87 msgid "" @@ -111,12 +144,17 @@ msgid "" "equal: the lines ``\" hello\"`` and ``\"\\thello\"`` are considered to have " "no common leading whitespace." msgstr "" +"Observe que tabulações e espaços são tratados como espaços em branco, mas " +"não são iguais: as linhas ``\" hello\"`` e ``\"\\thello\"`` são " +"consideradas como não tendo espaços em branco iniciais comuns." #: ../../library/textwrap.rst:91 msgid "" "Lines containing only whitespace are ignored in the input and normalized to " "a single newline character in the output." msgstr "" +"Linhas contendo apenas espaços em branco são ignoradas na entrada e " +"normalizadas para um único caractere de nova linha na saída." #: ../../library/textwrap.rst:94 ../../library/textwrap.rst:115 msgid "For example::" @@ -124,17 +162,19 @@ msgstr "Por exemplo::" #: ../../library/textwrap.rst:108 msgid "Add *prefix* to the beginning of selected lines in *text*." -msgstr "" +msgstr "Adiciona *prefix* ao início das linhas selecionadas em *text*." #: ../../library/textwrap.rst:110 msgid "Lines are separated by calling ``text.splitlines(True)``." -msgstr "" +msgstr "As linhas são separadas chamando ``text.splitlines(True)``." #: ../../library/textwrap.rst:112 msgid "" "By default, *prefix* is added to all lines that do not consist solely of " "whitespace (including any line endings)." msgstr "" +"Por padrão, *prefix* é adicionado a todas as linhas que não consistem apenas " +"em espaços em branco (incluindo quaisquer finais de linha)." #: ../../library/textwrap.rst:121 msgid "" @@ -142,6 +182,9 @@ msgid "" "indented. For example, it is easy to add *prefix* to even empty and " "whitespace-only lines::" msgstr "" +"O argumento opcional *predicate* pode ser usado para controlar quais linhas " +"têm indentação. Por exemplo, é fácil adicionar *prefix* até mesmo em linhas " +"vazias e apenas com espaços em branco::" #: ../../library/textwrap.rst:134 msgid "" @@ -151,6 +194,11 @@ msgid "" "`wrap` and/or :func:`fill`, it may be more efficient to create your own :" "class:`TextWrapper` object." msgstr "" +":func:`wrap`, :func:`fill` e :func:`shorten` funcionam criando uma " +"instância :class:`TextWrapper` e chamando um único método nela. Essa " +"instância não é reutilizada, então para aplicações que processam muitas " +"strings de texto usando :func:`wrap` e/ou :func:`fill`, pode ser mais " +"eficiente criar seu próprio objeto :class:`TextWrapper`." #: ../../library/textwrap.rst:140 msgid "" @@ -158,6 +206,10 @@ msgid "" "hyphenated words; only then will long words be broken if necessary, unless :" "attr:`TextWrapper.break_long_words` is set to false." msgstr "" +"O texto é preferencialmente colocado em espaços em branco e logo após os " +"hífens nas palavras hifenizadas; somente então palavras longas serão " +"quebradas se necessário, a menos que :attr:`TextWrapper.break_long_words` " +"seja definido como falso." #: ../../library/textwrap.rst:146 msgid "" @@ -165,6 +217,9 @@ msgid "" "arguments. Each keyword argument corresponds to an instance attribute, so " "for example ::" msgstr "" +"O construtor :class:`TextWrapper` aceita vários argumentos nomeados " +"opcionais. Cada argumento nomeado corresponde a um atributo de instância, " +"por exemplo::" #: ../../library/textwrap.rst:152 msgid "is the same as ::" @@ -182,6 +237,8 @@ msgid "" "The :class:`TextWrapper` instance attributes (and keyword arguments to the " "constructor) are as follows:" msgstr "" +"Os atributos de instância :class:`TextWrapper` (e argumentos nomeados para o " +"construtor) são os seguintes:" #: ../../library/textwrap.rst:167 msgid "" @@ -190,12 +247,19 @@ msgid "" "`TextWrapper` guarantees that no output line will be longer than :attr:" "`width` characters." msgstr "" +"(padrão: ``70``) O comprimento máximo das linhas quebradas. Contanto que não " +"existam palavras individuais no texto de entrada maiores que :attr:`width`, :" +"class:`TextWrapper` garante que nenhuma linha de saída será maior que :attr:" +"`width` caracteres." #: ../../library/textwrap.rst:175 msgid "" "(default: ``True``) If true, then all tab characters in *text* will be " "expanded to spaces using the :meth:`~str.expandtabs` method of *text*." msgstr "" +"(padrão: ``True``) Se verdadeiro, então todos os caracteres de tabulação em " +"*text* serão expandidos para espaços usando o método :meth:`~str.expandtabs` " +"de *text*." #: ../../library/textwrap.rst:181 msgid "" @@ -203,6 +267,9 @@ msgid "" "*text* will be expanded to zero or more spaces, depending on the current " "column and the given tab size." msgstr "" +"(padrão: ``8``) Se :attr:`expand_tabs` for verdadeiro, então todos os " +"caracteres de tabulação em *text* serão expandidos para zero ou mais " +"espaços, dependendo da coluna atual e do tamanho da tabulação fornecido." #: ../../library/textwrap.rst:190 msgid "" @@ -211,6 +278,11 @@ msgid "" "space. The whitespace characters replaced are as follows: tab, newline, " "vertical tab, formfeed, and carriage return (``'\\t\\n\\v\\f\\r'``)." msgstr "" +"(padrão: ``True``) Se verdadeiro, após a expansão da tabulação, mas antes da " +"quebra, o método :meth:`wrap` substituirá cada caractere de espaço em branco " +"por um único espaço. Os caracteres de espaço em branco substituídos são os " +"seguintes: tabulação, nova linha, tabulação vertical, feed de formulário e " +"retorno de carro (``'\\t\\n\\v\\f\\r'``)." #: ../../library/textwrap.rst:198 msgid "" @@ -218,6 +290,9 @@ msgid "" "tab character will be replaced by a single space, which is *not* the same as " "tab expansion." msgstr "" +"Se :attr:`expand_tabs` for falso e :attr:`replace_whitespace` for " +"verdadeiro, cada caractere de tabulação será substituído por um único " +"espaço, que *não* é o mesmo que expansão de tabulação." #: ../../library/textwrap.rst:204 msgid "" @@ -226,6 +301,10 @@ msgid "" "paragraphs (using :meth:`str.splitlines` or similar) which are wrapped " "separately." msgstr "" +"Se :attr:`replace_whitespace` for falso, novas linhas podem aparecer no meio " +"de uma linha e causar uma saída estranha. Por esta razão, o texto deve ser " +"dividido em parágrafos (usando :meth:`str.splitlines` ou similar) que são " +"agrupados separadamente." #: ../../library/textwrap.rst:212 msgid "" @@ -235,6 +314,11 @@ msgid "" "follows it. If whitespace being dropped takes up an entire line, the whole " "line is dropped." msgstr "" +"(padrão: ``True``) Se verdadeiro, os espaços em branco no início e no final " +"de cada linha (após quebra automática, mas antes do recuo) são eliminados. O " +"espaço em branco no início do parágrafo, entretanto, não será eliminado se " +"não houver espaço em branco após ele. Se o espaço em branco eliminado ocupar " +"uma linha inteira, a linha inteira será eliminada." #: ../../library/textwrap.rst:221 msgid "" @@ -242,6 +326,9 @@ msgid "" "output. Counts towards the length of the first line. The empty string is " "not indented." msgstr "" +"(padrão: ``''``) String que será anexada à primeira linha da saída com " +"quebra de linha. Conta para o comprimento da primeira linha. A string vazia " +"não recebe indentação." #: ../../library/textwrap.rst:228 msgid "" @@ -249,6 +336,9 @@ msgid "" "output except the first. Counts towards the length of each line except the " "first." msgstr "" +"(padrão: ``''``) String que será anexada a todas as linhas da saída com " +"quebra de linha, exceto a primeira. Conta para o comprimento de cada linha, " +"exceto a primeira." #: ../../library/textwrap.rst:235 msgid "" @@ -261,6 +351,14 @@ msgid "" "followed by a space. One problem with this algorithm is that it is unable " "to detect the difference between \"Dr.\" in ::" msgstr "" +"(padrão: ``False``) Se verdadeiro, :class:`TextWrapper` tenta detectar " +"finais de sentenças e garantir que as sentenças sejam sempre separadas por " +"exatamente dois espaços. Isso geralmente é desejado para texto em fonte " +"monoespaçada. No entanto, o algoritmo de detecção de frase é imperfeito: ele " +"presume que o final de uma frase consiste em uma letra minúscula seguida por " +"uma de ``'.'``, ``'!'`` ou ``'?'``, possivelmente seguido por um de ``'\"'`` " +"ou ``\"'\"``, seguido por um espaço. Um problema com este algoritmo é que " +"ele é incapaz de detectar a diferença entre \"Dr.\" em ::" #: ../../library/textwrap.rst:246 msgid "and \"Spot.\" in ::" @@ -268,7 +366,7 @@ msgstr "e \"Spot.\" em ::" #: ../../library/textwrap.rst:250 msgid ":attr:`fix_sentence_endings` is false by default." -msgstr "" +msgstr ":attr:`fix_sentence_endings` é falso por padrão" #: ../../library/textwrap.rst:252 msgid "" @@ -277,6 +375,10 @@ msgid "" "after a period to separate sentences on the same line, it is specific to " "English-language texts." msgstr "" +"Como o algoritmo de detecção de frase depende de ``string.lowercase`` para a " +"definição de \"letra minúscula\" e de uma convenção de usar dois espaços " +"após um ponto final para separar frases na mesma linha, ele é específico " +"para textos em inglês." #: ../../library/textwrap.rst:260 msgid "" @@ -286,6 +388,11 @@ msgid "" "than :attr:`width`. (Long words will be put on a line by themselves, in " "order to minimize the amount by which :attr:`width` is exceeded.)" msgstr "" +"(padrão: ``True``) Se verdadeiro, palavras maiores que :attr:`width` serão " +"quebradas para garantir que nenhuma linha seja maior que :attr:`width`. Se " +"for falso, palavras longas não serão quebradas e algumas linhas poderão ser " +"maiores que :attr:`width`. (Palavras longas serão colocadas sozinhas em uma " +"linha, a fim de minimizar o valor pelo qual :attr:`width` é excedido.)" #: ../../library/textwrap.rst:269 msgid "" @@ -296,24 +403,37 @@ msgid "" "want truly insecable words. Default behaviour in previous versions was to " "always allow breaking hyphenated words." msgstr "" +"(padrão: ``True``) Se verdadeiro, a quebra ocorrerá preferencialmente em " +"espaços em branco e logo após hífens em palavras compostas, como é habitual " +"em inglês. Se for falso, apenas os espaços em branco serão considerados " +"locais potencialmente bons para quebras de linha, mas você precisa definir :" +"attr:`break_long_words` como falso se quiser palavras verdadeiramente " +"inseparáveis. O comportamento padrão nas versões anteriores era sempre " +"permitir a quebra de palavras hifenizadas." #: ../../library/textwrap.rst:279 msgid "" "(default: ``None``) If not ``None``, then the output will contain at most " "*max_lines* lines, with *placeholder* appearing at the end of the output." msgstr "" +"(padrão: ``None``) Se não for ``None``, então a saída conterá no máximo " +"*max_lines* linhas, com *placeholder* aparecendo no final da saída." #: ../../library/textwrap.rst:289 msgid "" "(default: ``' [...]'``) String that will appear at the end of the output " "text if it has been truncated." msgstr "" +"(padrão: ``' [...]'``) String que aparecerá no final do texto de saída se " +"ele tiver sido truncado." #: ../../library/textwrap.rst:295 msgid "" ":class:`TextWrapper` also provides some public methods, analogous to the " "module-level convenience functions:" msgstr "" +":class:`TextWrapper` também fornece alguns métodos públicos, análogos às " +"funções de conveniência em nível de módulo:" #: ../../library/textwrap.rst:300 msgid "" @@ -323,12 +443,19 @@ msgid "" "lines, without final newlines. If the wrapped output has no content, the " "returned list is empty." msgstr "" +"Quebra o parágrafo único em *text* (uma string) para que cada linha tenha no " +"máximo :attr:`width` caracteres. Todas as opções de quebra de linha são " +"obtidas dos atributos da instância :class:`TextWrapper`. Retorna uma lista " +"de linhas de saída, sem novas linhas finais. Se a saída agrupada não tiver " +"conteúdo, a lista retornada estará vazia." #: ../../library/textwrap.rst:309 msgid "" "Wraps the single paragraph in *text*, and returns a single string containing " "the wrapped paragraph." msgstr "" +"Quebra o parágrafo único em *text* e retorna uma única string contendo o " +"parágrafo quebrado." #: ../../library/textwrap.rst:285 msgid "..." diff --git a/library/threading.po b/library/threading.po index 9e2611c0a..ed1d2ac0e 100644 --- a/library/threading.po +++ b/library/threading.po @@ -24,10 +24,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -344,7 +344,7 @@ msgstr ":ref:`Disponibilidade `: Windows, pthreads." #: ../../library/threading.rst:228 msgid "Unix platforms with POSIX threads support." -msgstr "" +msgstr "Plataformas Unix com suporte a threads POSIX." #: ../../library/threading.rst:231 msgid "This module also defines the following constant:" @@ -1497,4 +1497,4 @@ msgstr "depurador" #: ../../library/threading.rst:184 ../../library/threading.rst:202 msgid "profile function" -msgstr "" +msgstr "função de perfilação" diff --git a/library/time.po b/library/time.po index 68dd6cb77..f4dff0400 100644 --- a/library/time.po +++ b/library/time.po @@ -28,16 +28,16 @@ msgstr "" "Last-Translator: Marco Rougeth , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/time.rst:2 msgid ":mod:`!time` --- Time access and conversions" -msgstr "" +msgstr ":mod:`!time` --- Acesso ao horário e conversões" #: ../../library/time.rst:9 msgid "" @@ -70,6 +70,8 @@ msgid "" "The :dfn:`epoch` is the point where the time starts, the return value of " "``time.gmtime(0)``. It is January 1, 1970, 00:00:00 (UTC) on all platforms." msgstr "" +"O :dfn:`epoch` é o ponto onde o tempo começa, o valor de retorno de ``time." +"gmtime(0)``. É 1º de janeiro de 1970, 00:00:00 (UTC) em todas as plataformas." #: ../../library/time.rst:31 msgid "" @@ -88,6 +90,9 @@ msgid "" "epoch_ or far in the future. The cut-off point in the future is determined " "by the C library; for 32-bit systems, it is typically in 2038." msgstr "" +"As funções desse módulo podem não conseguir tratar de datas e horários antes " +"da era_ ou muito distantes no futuro. O limite no futuro é determinado pela " +"biblioteca C; para sistemas de 32 bit, geralmente é 2038." #: ../../library/time.rst:45 msgid "" @@ -171,12 +176,18 @@ msgid "" "`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` attributes when " "platform supports corresponding ``struct tm`` members." msgstr "" +"O tipo :class:`struct_time` foi estendido para prover os atributos :attr:" +"`~struct_time.tm_gmtoff` e :attr:`~struct_time.tm_zone` quando a plataforma " +"suporta os membros ``struct tm`` correspondentes" #: ../../library/time.rst:92 msgid "" "The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` and :attr:" "`~struct_time.tm_zone` are now available on all platforms." msgstr "" +"Os atributos :attr:`~struct_time.tm_gmtoff` e :attr:`~struct_time.tm_zone` " +"da classe :class:`struct_time` estão disponíveis em todas as plataformas " +"agora." #: ../../library/time.rst:97 msgid "Use the following functions to convert between time representations:" @@ -293,6 +304,8 @@ msgid "" "See the man page for :manpage:`pthread_getcpuclockid(3)` for further " "information." msgstr "" +"Veja a página man para :manpage:`pthread_getcpuclockid(3)` para mais " +"informações." #: ../../library/time.rst:158 msgid "" @@ -359,6 +372,10 @@ msgid "" "characters long and is space padded if the day is a single digit, e.g.: " "``'Wed Jun 9 04:26:40 1993'``." msgstr "" +"Converte um tempo expresso em segundos desde a era_ para uma string de " +"forma: ``'Sun Jun 20 23:21:05 1993'`` representando tempo local. O campo dia " +"tem comprimento de dois caracteres e é deslocado por um espaço se o dia tem " +"um único dígito. Por exemplo, ``'Wed Jun 9 04:26:40 1993'``." #: ../../library/time.rst:217 msgid "" @@ -442,6 +459,12 @@ msgid "" "the :class:`struct_time` object. See :func:`calendar.timegm` for the inverse " "of this function." msgstr "" +"Converte um tempo expresso em segundos desde a era_ para uma :class:" +"`struct_time` em UTC onde o sinalizador de horário de verão é sempre zero. " +"Se *secs* não é fornecido ou :const:`None`, o tempo atual como retornado " +"por :func:`.time` é utilizado. Frações de segundo são ignoradas. Veja acima " +"para uma descrição do objeto :class:`struct_time`. Veja :func:`calendar." +"timegm` para o inverso desta função." #: ../../library/time.rst:260 msgid "" @@ -534,7 +557,7 @@ msgid "" msgstr "" "Retorna o valor (em frações de segundo) de um contador de desempenho, i.e. " "um relógio com a maior resolução disponível para medir uma duração curta. " -"Inclui o tempo decorrido durante o sono e é de todo o sistema. O ponto de " +"Inclui o tempo decorrido durante a pausa e é de todo o sistema. O ponto de " "referência é do valor retornado é indefinido, portanto apenas a diferença " "entre resultados de duas chamadas é válida." @@ -564,9 +587,9 @@ msgid "" "of two calls is valid." msgstr "" "Retorna o valor (em frações de segundo) da soma dos tempos do sistema e CPU " -"de usuário do processo atual. Não inclui o tempo decorrido durante o sono. É " -"de todo o processo por definição. O ponto de referência do valor retornado é " -"indefinido, então apenas a diferença dos resultados de duas chamadas é " +"de usuário do processo atual. Não inclui o tempo decorrido durante a pausa. " +"É de todo o processo por definição. O ponto de referência do valor retornado " +"é indefinido, então apenas a diferença dos resultados de duas chamadas é " "válida." #: ../../library/time.rst:347 @@ -594,12 +617,17 @@ msgid "" "If the sleep is interrupted by a signal and no exception is raised by the " "signal handler, the sleep is restarted with a recomputed timeout." msgstr "" +"Se a pausa for interrompida por um sinal e nenhuma exceção for levantada " +"pelo manipulador de sinal, a pausa será reiniciada com um tempo limite " +"recalculado." #: ../../library/time.rst:367 msgid "" "The suspension time may be longer than requested by an arbitrary amount, " "because of the scheduling of other activity in the system." msgstr "" +"O tempo de suspensão pode ser maior do que o solicitado por um valor " +"arbitrário, devido ao agendamento de outras atividades no sistema." #: ../../library/time.rst:370 msgid "" @@ -611,22 +639,30 @@ msgid "" "drivers/kernel/high-resolution-timers>`_ which provides resolution of 100 " "nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" +"No Windows, se *secs* é zero, a thread renuncia ao restante de sua fatia de " +"tempo para qualquer outra thread que esteja pronto para executar. Se nenhuma " +"outra thread estiver pronta pra ser executada, a função retorna " +"imediatamente, e a thread continua a execução. No Windows 8.1 e mais novos a " +"implementação usa um `temporizador de alta resolução `_ que " +"provê uma resolução de 100 nanossegundos. Se *secs* é zero, é usado " +"``Sleep(0)``." #: ../../library/time.rst:378 msgid "Unix implementation:" -msgstr "" +msgstr "Implementação no Unix:" #: ../../library/time.rst:380 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" -msgstr "" +msgstr "Usa ``clock_nanosleep()`` se disponível (resolução: 1 nanossegundo);" #: ../../library/time.rst:381 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" -msgstr "" +msgstr "Ou usa ``nanosleep()`` se disponível (resolução: 1 nanossegunda);" #: ../../library/time.rst:382 msgid "Or use ``select()`` (resolution: 1 microsecond)." -msgstr "" +msgstr "Ou usa ``select()`` (resolução: 1 microssegundo)." #: ../../library/time.rst:384 msgid "" @@ -634,7 +670,7 @@ msgid "" "a signal, except if the signal handler raises an exception (see :pep:`475` " "for the rationale)." msgstr "" -"A função agora dorme por pelo menos *secs* mesmo se o sono é interrompido " +"A função agora pausa por pelo menos *secs* mesmo se a pausa é interrompido " "por um sinal, exceto se o tratador de sinal levanta uma exceção (veja :pep:" "`475` para a explicação)." @@ -643,6 +679,9 @@ msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." msgstr "" +"No Unix, as funções ``clock_nanosleep()`` e ``nanosleep()`` são agora usadas " +"se estiverem disponíveis. No Windows, um temporizador aguardável é agora " +"usado." #: ../../library/time.rst:398 msgid "" @@ -656,8 +695,8 @@ msgstr "" "retornado por :func:`gmtime` ou :func:`localtime` para uma string como " "especificado pelo argumento *format*. Se *t* não é fornecido, o tempo atual " "como retornado pela :func:`localtime` é utilizado. *format* deve ser uma " -"string. :exc:`ValueError` é levantado se qualquer campo em *t* está fora do " -"intervalo permitido." +"string. A exceção :exc:`ValueError` é levantada se qualquer campo em *t* " +"está fora do intervalo permitido." #: ../../library/time.rst:404 msgid "" @@ -744,11 +783,11 @@ msgstr "``%f``" #: ../../library/time.rst:430 msgid "Microseconds as a decimal number" -msgstr "" +msgstr "Microssegundos como um número decimal" #: ../../library/time.rst:431 msgid "[000000,999999]." -msgstr "" +msgstr "[000000,999999]." #: ../../library/time.rst:430 msgid "\\(1)" @@ -934,6 +973,10 @@ msgid "" "`datetime.datetime.strftime` where the ``%f`` format directive :ref:`applies " "to microseconds `." msgstr "" +"A diretiva de formatação ``%f`` é somente aplicada para :func:`strptime`, " +"não para :func:`strftime`. Contudo, veja também :meth:`datetime.datetime." +"strptime` e :meth:`datetime.datetime.strftime` onde a diretiva de formatação " +"``%f`` :ref:`é aplicada para microssegundos `." #: ../../library/time.rst:507 msgid "" @@ -1123,6 +1166,7 @@ msgstr "5" #: ../../library/time.rst:610 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" +"intervalo [0, 61]; veja :ref:`Nota (2) ` em :func:`strftime`" #: ../../library/time.rst:612 msgid "6" @@ -1130,7 +1174,7 @@ msgstr "6" #: ../../library/time.rst:614 msgid "range [0, 6]; Monday is 0" -msgstr "" +msgstr "intervalo [0, 6]; segunda-feira é 0" #: ../../library/time.rst:616 msgid "7" @@ -1254,10 +1298,10 @@ msgid "" "of two calls in the same thread is valid." msgstr "" "Retorna o valor (em fração de segundos) da soma dos tempos de sistema e CPU " -"de usuário para a thread atual. Não inclui o tempo decorrido durante sono. É " -"específico a thread por definição. O ponto de referência do valor retornado " -"é indefinido, então apenas a diferença dos resultados de duas chamadas é " -"válida." +"de usuário para a thread atual. Não inclui o tempo decorrido durante a " +"pausa. É específico a thread por definição. O ponto de referência do valor " +"retornado é indefinido, então apenas a diferença dos resultados de duas " +"chamadas é válida." #: ../../library/time.rst:689 msgid "" @@ -1273,7 +1317,7 @@ msgstr ":ref:`Disponibilidade `: Linux, Unix, Windows." #: ../../library/time.rst:694 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." -msgstr "" +msgstr "Sistemas Unix possuem suporte para ``CLOCK_THREAD_CPUTIME_ID``." #: ../../library/time.rst:701 msgid "Similar to :func:`thread_time` but return time as nanoseconds." @@ -1352,7 +1396,7 @@ msgstr "" "adicionado adicionou o horário local para chegar a UTC. Se precedido por um " "'-', o fuso horário está a leste do Meridiano Primário; do contrário, está a " "oeste. Se nenhum deslocamento segue o horário de verão, o tempo no verão é " -"assumido como estando uma hora a frente do horário padrão." +"presumido como estando uma hora a frente do horário padrão." #: ../../library/time.rst:743 msgid "``start[/time], end[/time]``" @@ -1629,6 +1673,13 @@ msgid "" "attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` results from :" "func:`localtime` to obtain timezone information." msgstr "" +"Para as constantes de Fuso Horário acima (:data:`altzone`, :data:" +"`daylight`, :data:`timezone`, e :data:`tzname`), o valor é determinado pelas " +"regras de fuso horário em efeito no módulo de carregamento de tempo ou a " +"última vez que :func:`tzset` é chamada e pode estar incorreto para tempos no " +"passado. É recomendado utilizar os resultados :attr:`~struct_time.tm_gmtoff` " +"e :attr:`~struct_time.tm_zone` da :func:`localtime` para obter informação de " +"fuso horário." #: ../../library/time.rst:957 msgid "Module :mod:`datetime`" @@ -1689,44 +1740,44 @@ msgstr "" #: ../../library/time.rst:22 msgid "epoch" -msgstr "" +msgstr "era" #: ../../library/time.rst:36 msgid "Year 2038" -msgstr "" +msgstr "Ano 2038" #: ../../library/time.rst:42 msgid "2-digit years" -msgstr "" +msgstr "Anos de 2 dígitos" #: ../../library/time.rst:50 msgid "UTC" -msgstr "" +msgstr "UTC" #: ../../library/time.rst:50 msgid "Coordinated Universal Time" -msgstr "" +msgstr "Tempo Universal Coordenado" #: ../../library/time.rst:50 msgid "Greenwich Mean Time" -msgstr "" +msgstr "Tempo Médio de Greenwich" #: ../../library/time.rst:59 msgid "Daylight Saving Time" -msgstr "" +msgstr "Horário de verão" #: ../../library/time.rst:310 ../../library/time.rst:336 #: ../../library/time.rst:678 msgid "benchmarking" -msgstr "" +msgstr "benchmarking" #: ../../library/time.rst:336 ../../library/time.rst:678 msgid "CPU time" -msgstr "" +msgstr "tempo da CPU" #: ../../library/time.rst:336 ../../library/time.rst:678 msgid "processor time" -msgstr "" +msgstr "tempo do processador" #: ../../library/time.rst:393 ../../library/time.rst:539 msgid "% (percent)" diff --git a/library/timeit.po b/library/timeit.po index 829fad097..478797cd0 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -21,16 +21,17 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/timeit.rst:2 msgid ":mod:`!timeit` --- Measure execution time of small code snippets" msgstr "" +":mod:`!timeit` --- Mede o tempo de execução de pequenos trechos de código" #: ../../library/timeit.rst:7 msgid "**Source code:** :source:`Lib/timeit.py`" diff --git a/library/tk.po b/library/tk.po index f0b8408f2..31f4c6d42 100644 --- a/library/tk.po +++ b/library/tk.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index 8fe4355d2..8161619b7 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tkinter.colorchooser.rst:2 msgid ":mod:`!tkinter.colorchooser` --- Color choosing dialog" -msgstr "" +msgstr ":mod:`!tkinter.colorchooser` --- Diálogo de escolha de cor" #: ../../library/tkinter.colorchooser.rst:8 msgid "**Source code:** :source:`Lib/tkinter/colorchooser.py`" diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index c6b5d190c..d8df54a3d 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tkinter.dnd.rst:2 msgid ":mod:`!tkinter.dnd` --- Drag and drop support" -msgstr "" +msgstr ":mod:`!tkinter.dnd` --- Suporte para arrastar e soltar" #: ../../library/tkinter.dnd.rst:8 msgid "**Source code:** :source:`Lib/tkinter/dnd.py`" @@ -76,10 +76,12 @@ msgid "" "If *dnd_accept* is not present or returns ``None``, search moves to parent " "widget" msgstr "" +"Se *dnd_accept* não estiver presente ou retornar ``None``, a pesquisa vai " +"para o widget pai" #: ../../library/tkinter.dnd.rst:29 msgid "If no target widget is found, then the target object is ``None``" -msgstr "" +msgstr "Se nenhum widget de destino for encontrado, o objeto alvo é ``None``" #: ../../library/tkinter.dnd.rst:31 msgid "Call to *.dnd_leave(source, event)*" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 22f36ed7d..e0c13ef94 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -16,30 +16,32 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tkinter.font.rst:2 msgid ":mod:`!tkinter.font` --- Tkinter font wrapper" -msgstr "" +msgstr ":mod:`!tkinter.font` --- Invólucro de fontes Tkinter" #: ../../library/tkinter.font.rst:8 msgid "**Source code:** :source:`Lib/tkinter/font.py`" -msgstr "" +msgstr "**Código-fonte:** :source:`Lib/tkinter/font.py`" #: ../../library/tkinter.font.rst:12 msgid "" "The :mod:`tkinter.font` module provides the :class:`Font` class for creating " "and using named fonts." msgstr "" +"O módulo :mod:`tkinter.font` apresenta a classe :class:`Font` para criação e " +"utilização de fontes nomeadas." #: ../../library/tkinter.font.rst:15 msgid "The different font weights and slants are:" -msgstr "" +msgstr "Os diferentes pesos e inclinações de fontes são:" #: ../../library/tkinter.font.rst:24 msgid "" @@ -49,6 +51,11 @@ msgid "" "as a single object, rather than specifying a font by its attributes with " "each occurrence." msgstr "" +"A classe :class:`Font` representa uma fonte nomeada. Instâncias *font* " +"recebem nomes únicos e podem ser especificadas por família, tamanho e " +"configuração de estilo. Fontes nomeadas são os métodos Tk para criação e " +"identificação de fontes de um objeto singular, ao invés de especificar a " +"fonte por seus atributos em cada ocorrência." #: ../../library/tkinter.font.rst:30 msgid "arguments:" @@ -56,27 +63,28 @@ msgstr "argumentos:" #: ../../library/tkinter.font.rst:0 msgid "*font* - font specifier tuple (family, size, options)" -msgstr "" +msgstr "*font* - tupla de especificação da fonte (família, tamanho, opções)" #: ../../library/tkinter.font.rst:0 msgid "*name* - unique font name" -msgstr "" +msgstr "*name* - nome único da fonte" #: ../../library/tkinter.font.rst:0 msgid "*exists* - self points to existing named font if true" -msgstr "" +msgstr "*exists* - aponta para uma fonte nomeada existente se for verdadeiro" #: ../../library/tkinter.font.rst:36 msgid "additional keyword options (ignored if *font* is specified):" msgstr "" +"palavras reservadas opcionais (ignoradas caso *font* seja especificado):" #: ../../library/tkinter.font.rst:0 msgid "*family* - font family i.e. Courier, Times" -msgstr "" +msgstr "*family* - a família da fonte e.x. Courier, Times" #: ../../library/tkinter.font.rst:0 msgid "*size* - font size" -msgstr "" +msgstr "*size* - tamanho da fonte" #: ../../library/tkinter.font.rst:0 msgid "If *size* is positive it is interpreted as size in points." @@ -84,43 +92,44 @@ msgstr "Se *size* for positivo, ele é interpretado como tamanho em pontos." #: ../../library/tkinter.font.rst:0 msgid "If *size* is a negative number its absolute value is treated" -msgstr "" +msgstr "Caso *size* seja um número negativo, seu valor absoluto é tratado" #: ../../library/tkinter.font.rst:0 msgid "as size in pixels." -msgstr "" +msgstr "como tamanho em pixels." #: ../../library/tkinter.font.rst:0 msgid "*weight* - font emphasis (NORMAL, BOLD)" -msgstr "" +msgstr "*weight* - ênfase da fonte (normal,negrito)" #: ../../library/tkinter.font.rst:0 msgid "*slant* - ROMAN, ITALIC" -msgstr "" +msgstr "*slant* - ROMAN, ITALIC" #: ../../library/tkinter.font.rst:0 msgid "*underline* - font underlining (0 - none, 1 - underline)" msgstr "" +"*underline* - sublinhamento da fonte (0 - sem sublinhamento, 1 - sublinhado)" #: ../../library/tkinter.font.rst:0 msgid "*overstrike* - font strikeout (0 - none, 1 - strikeout)" -msgstr "" +msgstr "*overstrike* - fonte riscada (0 - sem risco, 1 - letras riscadas)" #: ../../library/tkinter.font.rst:50 msgid "Return the attributes of the font." -msgstr "" +msgstr "Retorna os atributos da fonte." #: ../../library/tkinter.font.rst:54 msgid "Retrieve an attribute of the font." -msgstr "" +msgstr "Recupera um atributo da fonte." #: ../../library/tkinter.font.rst:58 msgid "Modify attributes of the font." -msgstr "" +msgstr "Modifica atributos da fonte." #: ../../library/tkinter.font.rst:62 msgid "Return new instance of the current font." -msgstr "" +msgstr "Retorna uma nova instância da fonte atual." #: ../../library/tkinter.font.rst:66 msgid "" @@ -128,47 +137,52 @@ msgid "" "formatted in the current font. If no display is specified then the main " "application window is assumed." msgstr "" +"Retorna a quantidade de espaço que o texto ocuparia na exibição especificada " +"ao ser formatado na fonte atual. Caso nenhuma exibição seja especificada, a " +"exibição presumida será a da janela principal da aplicação." #: ../../library/tkinter.font.rst:72 msgid "Return font-specific data. Options include:" -msgstr "" +msgstr "Retorna dados específicos da fonte. Opções inclusas:" #: ../../library/tkinter.font.rst:75 msgid "*ascent* - distance between baseline and highest point that a" -msgstr "" +msgstr "*ascent* - distância entre a linha de base e o ponto mais alto que um" #: ../../library/tkinter.font.rst:76 ../../library/tkinter.font.rst:79 msgid "character of the font can occupy" -msgstr "" +msgstr "caractere da fonte pode ocupar" #: ../../library/tkinter.font.rst:78 msgid "*descent* - distance between baseline and lowest point that a" msgstr "" +"*descent* - distância entre a linha de base e o ponto mais baixo que um" #: ../../library/tkinter.font.rst:81 msgid "*linespace* - minimum vertical separation necessary between any two" -msgstr "" +msgstr "*linespace* - separação vertical mínima necessária entre dois" #: ../../library/tkinter.font.rst:82 msgid "characters of the font that ensures no vertical overlap between lines." msgstr "" +"caracteres da fonte que garante que não ocorra sobreposição entre as linhas." #: ../../library/tkinter.font.rst:84 msgid "*fixed* - 1 if font is fixed-width else 0" -msgstr "" +msgstr "*fixed* - 1 caso a fonte seja de largura fixa, 0 caso contrário" #: ../../library/tkinter.font.rst:88 msgid "Return the different font families." -msgstr "" +msgstr "Retorna as diferentes famílias de fontes." #: ../../library/tkinter.font.rst:92 msgid "Return the names of defined fonts." -msgstr "" +msgstr "Retorna os nomes das fontes definidas." #: ../../library/tkinter.font.rst:96 msgid "Return a :class:`Font` representation of a tk named font." -msgstr "" +msgstr "Retorna a representação :class:`Font` de uma fonte nomeada do tk. " #: ../../library/tkinter.font.rst:98 msgid "The *root* parameter was added." -msgstr "" +msgstr "O parâmetro *root* foi adicionado." diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index 38e7f7901..d60a3c94b 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tkinter.messagebox.rst:2 msgid ":mod:`!tkinter.messagebox` --- Tkinter message prompts" -msgstr "" +msgstr ":mod:`!tkinter.messagebox` --- Prompts de mensagem do Tkinter" #: ../../library/tkinter.messagebox.rst:8 msgid "**Source code:** :source:`Lib/tkinter/messagebox.py`" diff --git a/library/tkinter.po b/library/tkinter.po index 6a7752745..c1b4d1a08 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -29,16 +29,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tkinter.rst:2 msgid ":mod:`!tkinter` --- Python interface to Tcl/Tk" -msgstr "" +msgstr ":mod:`!tkinter` --- Interface Python para Tcl/Tk" #: ../../library/tkinter.rst:9 msgid "**Source code:** :source:`Lib/tkinter/__init__.py`" @@ -1202,8 +1202,8 @@ msgid "" msgstr "" "Bibliotecas Tcl/Tk podem ser construídas de forma que não reconheçam thread. " "Neste caso, :mod:`tkinter` chama a biblioteca da thread originadora do " -"Python, mesmo que seja diferente da thread que criou o interpretador Tcl. Um " -"bloqueio global garante que apenas uma chamada ocorra por vez." +"Python, mesmo que seja diferente da thread que criou o interpretador Tcl. " +"Uma trava global garante que apenas uma chamada ocorra por vez." #: ../../library/tkinter.rst:544 msgid "" @@ -1539,7 +1539,7 @@ msgstr "" #: ../../library/tkinter.rst:689 msgid "padx and pady" -msgstr "padx and pady" +msgstr "padx e pady" #: ../../library/tkinter.rst:690 msgid "" @@ -1862,7 +1862,7 @@ msgstr "sendo que:" #: ../../library/tkinter.rst:882 msgid "sequence" -msgstr "sequence" +msgstr "sequência" #: ../../library/tkinter.rst:883 msgid "" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index d8a78dd6c..81c080c02 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tkinter.scrolledtext.rst:2 msgid ":mod:`!tkinter.scrolledtext` --- Scrolled Text Widget" -msgstr "" +msgstr ":mod:`!tkinter.scrolledtext` --- Widget de texto de rolado" #: ../../library/tkinter.scrolledtext.rst:10 msgid "**Source code:** :source:`Lib/tkinter/scrolledtext.py`" diff --git a/library/tkinter.tix.po b/library/tkinter.tix.po index 5aee66638..2c783c553 100644 --- a/library/tkinter.tix.po +++ b/library/tkinter.tix.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 017ba3a5d..17c4c5d03 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -26,16 +26,16 @@ msgstr "" "Last-Translator: Italo Penaforte , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tkinter.ttk.rst:2 msgid ":mod:`!tkinter.ttk` --- Tk themed widgets" -msgstr "" +msgstr ":mod:`!tkinter.ttk` --- Widgets temáticos do Tk" #: ../../library/tkinter.ttk.rst:9 msgid "**Source code:** :source:`Lib/tkinter/ttk.py`" @@ -48,6 +48,11 @@ msgid "" "font rendering under X11 and window transparency (requiring a composition " "window manager on X11)." msgstr "" +"O módulo :mod:`tkinter.ttk` introduzido no Tk 8.5, fornece acesso ao " +"conjunto de widgets temáticos do Tk, Alguns dos beneficios incluídos são a " +"renderização de fontes com suavização de serrilhamento no x11 e " +"transparência de janelas (requer um gerenciador de composição de janelas no " +"x11)." #: ../../library/tkinter.ttk.rst:20 msgid "" @@ -91,6 +96,11 @@ msgid "" "`Radiobutton`, :class:`Scale` and :class:`Scrollbar`) to automatically " "replace the Tk widgets." msgstr "" +"Esse código faz com que vários widgets :mod:`tkinter.ttk` (:class:`Button`, :" +"class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`, :class:" +"`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`, :class:" +"`Radiobutton`, :class:`Scale` e :class:`Scrollbar`) substituam " +"automaticamente os widgets Tk." #: ../../library/tkinter.ttk.rst:49 msgid "" @@ -101,22 +111,32 @@ msgid "" "Ttk widgets. Instead, use the :class:`ttk.Style` class for improved " "styling effects." msgstr "" +"Isso traz o benefício direto de utilizar os widgets novos que possuem melhor " +"aparência e sensação de uso entre as plataformas, contudo, os widgets " +"substitutos não são completamente compatíveis. A maior diferença é que as " +"opções como \"fg\", \"bg\" e outras relacionadas à estilização do widget não " +"estão mais presentes nos widgets Ttk. Em vez disso, use a classe :class:" +"`ttk.Style` para melhores efeitos de estilização." #: ../../library/tkinter.ttk.rst:59 msgid "" "`Converting existing applications to use Tile widgets `_" msgstr "" +"`Convertendo aplicações existentes para utilização dos widgets Tile `_" #: ../../library/tkinter.ttk.rst:60 msgid "" "A monograph (using Tcl terminology) about differences typically encountered " "when moving applications to use the new widgets." msgstr "" +"Uma monografia (utilizando a terminologia Tcl) sobre diferenças tipicamente " +"encontradas ao mover aplicações para utilização de novos widgets." #: ../../library/tkinter.ttk.rst:65 msgid "Ttk Widgets" -msgstr "" +msgstr "Widgets Ttk" #: ../../library/tkinter.ttk.rst:67 msgid "" @@ -128,12 +148,22 @@ msgid "" "class:`Progressbar`, :class:`Separator`, :class:`Sizegrip` and :class:" "`Treeview`. And all them are subclasses of :class:`Widget`." msgstr "" +"Ttk traz 18 widgets, das quais doze já existiam no tkinter: :class:" +"`Button`, :class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:" +"`Label`, :class:`LabelFrame`, :class:`Menubutton`, :class:`PanedWindow`, :" +"class:`Radiobutton`, :class:`Scale`, :class:`Scrollbar`, e :class:`Spinbox`. " +"As outras seis são novas: :class:`Combobox`, :class:`Notebook`, :class:" +"`Progressbar`, :class:`Separator`, :class:`Sizegrip` e :class:`Treeview`. E " +"todas elas são subclasses de :class:`Widget`." #: ../../library/tkinter.ttk.rst:75 msgid "" "Using the Ttk widgets gives the application an improved look and feel. As " "discussed above, there are differences in how the styling is coded." msgstr "" +"Utilizar os widgets Ttk melhora a experiência de uso e o visual da " +"aplicação. Conforme discutido anteriormente, existem diferenças em como a " +"estilização é codificada." #: ../../library/tkinter.ttk.rst:78 msgid "Tk code::" @@ -148,24 +178,28 @@ msgid "" "For more information about TtkStyling_, see the :class:`Style` class " "documentation." msgstr "" +"Para mais informações sobre TtkStyling_, veja a documentação da classe :" +"class:`Style`." #: ../../library/tkinter.ttk.rst:96 msgid "Widget" -msgstr "Ferramenta" +msgstr "Widget" #: ../../library/tkinter.ttk.rst:98 msgid "" ":class:`ttk.Widget` defines standard options and methods supported by Tk " "themed widgets and is not supposed to be directly instantiated." msgstr "" +":class:`ttk.Widget` define opções padrão e métodos suportados pelos widgets " +"temáticos Tk e não deve ser instanciada diretamente." #: ../../library/tkinter.ttk.rst:103 msgid "Standard Options" -msgstr "Opções padrões" +msgstr "Opções padrão" #: ../../library/tkinter.ttk.rst:105 msgid "All the :mod:`ttk` Widgets accept the following options:" -msgstr "" +msgstr "Todos os Widgets :mod:`ttk` aceitam as seguintes opções:" #: ../../library/tkinter.ttk.rst:110 ../../library/tkinter.ttk.rst:145 #: ../../library/tkinter.ttk.rst:171 ../../library/tkinter.ttk.rst:214 @@ -190,7 +224,7 @@ msgstr "Descrição" #: ../../library/tkinter.ttk.rst:112 msgid "class" -msgstr "class" +msgstr "classe" #: ../../library/tkinter.ttk.rst:112 msgid "" @@ -209,10 +243,12 @@ msgid "" "Specifies the mouse cursor to be used for the widget. If set to the empty " "string (the default), the cursor is inherited for the parent widget." msgstr "" +"Especifica o cursor do mouse a ser utilizado pelo widget. Caso seja definido " +"como uma string vazia (padrão), o cursor é herdado do widget pai." #: ../../library/tkinter.ttk.rst:123 msgid "takefocus" -msgstr "" +msgstr "takefocus" #: ../../library/tkinter.ttk.rst:123 msgid "" @@ -223,6 +259,12 @@ msgid "" "And an empty string means that the traversal scripts make the decision about " "whether or not to focus on the window." msgstr "" +"Determina se a janela aceitará foco durante a navegação com o teclado. " +"Retorna 0, 1 ou uma string vazia. Caso retorne 0, significa que a janela " +"deve ser completamente ignorada durante a navegação com o teclado. Caso " +"retorne 1, significa que a janela receberá as entradas do teclado enquanto " +"estiver visível. E a string vazia significa que os scripts de navegação " +"determinam quando a janela recebe foco ou não." #: ../../library/tkinter.ttk.rst:132 msgid "style" @@ -230,7 +272,7 @@ msgstr "estilo" #: ../../library/tkinter.ttk.rst:132 msgid "May be used to specify a custom widget style." -msgstr "" +msgstr "Pode ser utilizado para especificar um estilo customizado do widget." #: ../../library/tkinter.ttk.rst:137 msgid "Scrollable Widget Options" @@ -241,20 +283,24 @@ msgid "" "The following options are supported by widgets that are controlled by a " "scrollbar." msgstr "" +"As opções a seguir são suportadas pelos widgets que são controlados por uma " +"barra de rolagem." #: ../../library/tkinter.ttk.rst:147 msgid "xscrollcommand" -msgstr "" +msgstr "xscrollcommand" #: ../../library/tkinter.ttk.rst:147 msgid "Used to communicate with horizontal scrollbars." -msgstr "" +msgstr "Utilizado para comunicação com barras de rolagem horizontais." #: ../../library/tkinter.ttk.rst:149 msgid "" "When the view in the widget's window change, the widget will generate a Tcl " "command based on the scrollcommand." msgstr "" +"Quando a visualização na janela do widget mudar, o widget irá gerar um " +"comando Tcl baseado no comando da barra de rolagem." #: ../../library/tkinter.ttk.rst:152 msgid "" @@ -262,16 +308,21 @@ msgid "" "scrollbar. This will cause the scrollbar to be updated whenever the view in " "the window changes." msgstr "" +"Geralmente essa opção consiste no método :meth:`Scrollbar.set` de alguma " +"barra de rolagem. Isso fará com que a barra de rolagem seja atualizada " +"sempre que a visualização da janela mude." #: ../../library/tkinter.ttk.rst:157 msgid "yscrollcommand" -msgstr "" +msgstr "yscrollcommand" #: ../../library/tkinter.ttk.rst:157 msgid "" "Used to communicate with vertical scrollbars. For some more information, see " "above." msgstr "" +"Utilizado para comunicação com barras de rolagem verticais. Para mais " +"informações, veja acima." #: ../../library/tkinter.ttk.rst:163 msgid "Label Options" @@ -282,19 +333,21 @@ msgid "" "The following options are supported by labels, buttons and other button-like " "widgets." msgstr "" +"As opções a seguir são suportadas por rótulos, botões e outros widgets " +"semelhantes." #: ../../library/tkinter.ttk.rst:173 ../../library/tkinter.ttk.rst:521 #: ../../library/tkinter.ttk.rst:861 msgid "text" -msgstr "texto" +msgstr "text" #: ../../library/tkinter.ttk.rst:173 msgid "Specifies a text string to be displayed inside the widget." -msgstr "" +msgstr "Especifica uma string para exibição dentro do widget." #: ../../library/tkinter.ttk.rst:175 ../../library/tkinter.ttk.rst:339 msgid "textvariable" -msgstr "" +msgstr "textvariable" #: ../../library/tkinter.ttk.rst:175 msgid "" @@ -304,18 +357,21 @@ msgstr "" #: ../../library/tkinter.ttk.rst:178 ../../library/tkinter.ttk.rst:530 msgid "underline" -msgstr "" +msgstr "underline" #: ../../library/tkinter.ttk.rst:178 msgid "" "If set, specifies the index (0-based) of a character to underline in the " "text string. The underline character is used for mnemonic activation." msgstr "" +"Caso definido, especifica o índice (base-0) de um caractere para " +"sublinhamento na string de texto. O caractere sublinhado é utilizado para " +"ativação mnemônica." #: ../../library/tkinter.ttk.rst:182 ../../library/tkinter.ttk.rst:523 #: ../../library/tkinter.ttk.rst:863 ../../library/tkinter.ttk.rst:895 msgid "image" -msgstr "" +msgstr "image" #: ../../library/tkinter.ttk.rst:182 msgid "" @@ -365,6 +421,10 @@ msgid "" "allocate for the text label, if less than zero, specifies a minimum width. " "If zero or unspecified, the natural width of the text label is used." msgstr "" +"Caso maior que zero, especifica quanto espaço, em largura de caracteres, " +"alocar para o rótulo do texto, se menor que zero, especifica a largura " +"mínima. Se zero ou inespecífico, é utilizada a largura normal do rótulo de " +"texto." #: ../../library/tkinter.ttk.rst:209 msgid "Compatibility Options" @@ -384,11 +444,12 @@ msgstr "" #: ../../library/tkinter.ttk.rst:223 msgid "Widget States" -msgstr "" +msgstr "Estados de Widget" #: ../../library/tkinter.ttk.rst:225 msgid "The widget state is a bitmap of independent state flags." msgstr "" +"O estado do widget é um bitmap de sinalizadores de estado independentes." #: ../../library/tkinter.ttk.rst:230 msgid "Flag" @@ -396,17 +457,19 @@ msgstr "Sinalizador" #: ../../library/tkinter.ttk.rst:232 msgid "active" -msgstr "" +msgstr "active" #: ../../library/tkinter.ttk.rst:232 msgid "" "The mouse cursor is over the widget and pressing a mouse button will cause " "some action to occur" msgstr "" +"O cursor do mouse está sobre o widget e pressionar um botão do mouse causará " +"alguma ação" #: ../../library/tkinter.ttk.rst:235 msgid "disabled" -msgstr "inválido" +msgstr "disabled" #: ../../library/tkinter.ttk.rst:235 msgid "Widget is disabled under program control" @@ -418,19 +481,19 @@ msgstr "focus" #: ../../library/tkinter.ttk.rst:237 msgid "Widget has keyboard focus" -msgstr "" +msgstr "Widget tem foco do teclado" #: ../../library/tkinter.ttk.rst:239 msgid "pressed" -msgstr "" +msgstr "pressed" #: ../../library/tkinter.ttk.rst:239 msgid "Widget is being pressed" -msgstr "" +msgstr "Widget está sendo pressionado" #: ../../library/tkinter.ttk.rst:241 msgid "selected" -msgstr "selecionado" +msgstr "selected" #: ../../library/tkinter.ttk.rst:241 msgid "" @@ -448,6 +511,9 @@ msgid "" "*background* state is set for widgets in a background window, and cleared " "for those in the foreground window" msgstr "" +"Windows e Mac possuem uma noção de janela \"ativa\" ou em primeiro plano. O " +"estado de \"plano de fundo\" é definido para widgets em uma janela no plano " +"de fundo, e limpo para aqueles na janela de primeiro plano" #: ../../library/tkinter.ttk.rst:249 msgid "readonly" @@ -455,7 +521,7 @@ msgstr "readonly" #: ../../library/tkinter.ttk.rst:249 msgid "Widget should not allow user modification" -msgstr "" +msgstr "Widget não deve permitir modificação do usuário" #: ../../library/tkinter.ttk.rst:251 msgid "alternate" @@ -463,41 +529,49 @@ msgstr "alternate" #: ../../library/tkinter.ttk.rst:251 msgid "A widget-specific alternate display format" -msgstr "" +msgstr "Um formato de exibição específico do widget" #: ../../library/tkinter.ttk.rst:253 msgid "invalid" -msgstr "" +msgstr "invalid" #: ../../library/tkinter.ttk.rst:253 msgid "The widget's value is invalid" -msgstr "" +msgstr "O valor do widget é inválido" #: ../../library/tkinter.ttk.rst:256 msgid "" "A state specification is a sequence of state names, optionally prefixed with " "an exclamation point indicating that the bit is off." msgstr "" +"Uma especificação de estado é uma sequência de nomes de estado, " +"opcionalmente prefixada por um ponto de exclamação indicando que o bit está " +"desligado." #: ../../library/tkinter.ttk.rst:261 msgid "ttk.Widget" -msgstr "" +msgstr "ttk.Widget" #: ../../library/tkinter.ttk.rst:263 msgid "" "Besides the methods described below, the :class:`ttk.Widget` supports the " "methods :meth:`tkinter.Widget.cget` and :meth:`tkinter.Widget.configure`." msgstr "" +"Além dos métodos descritos abaixo, a classe :class:`ttk.Widget` oferece " +"suporte aos métodos :meth:`tkinter.Widget.cget` e :meth:`tkinter.Widget." +"configure`." #: ../../library/tkinter.ttk.rst:270 msgid "" "Returns the name of the element at position *x* *y*, or the empty string if " "the point does not lie within any element." msgstr "" +"Retorna o nome do elemento na posição *x* *y*, ou a string vazia caso o " +"ponto não esteja dentro de algum elemento." #: ../../library/tkinter.ttk.rst:273 msgid "*x* and *y* are pixel coordinates relative to the widget." -msgstr "" +msgstr "*x* e *y* são coordenadas de pixel relativas ao widget." #: ../../library/tkinter.ttk.rst:278 msgid "" @@ -672,7 +746,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:405 msgid "from" -msgstr "de" +msgstr "from" #: ../../library/tkinter.ttk.rst:405 msgid "" @@ -1066,7 +1140,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:681 msgid "value" -msgstr "value" +msgstr "valor" #: ../../library/tkinter.ttk.rst:681 msgid "" diff --git a/library/token.po b/library/token.po index 1ac323785..1ef2f50da 100644 --- a/library/token.po +++ b/library/token.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/token.rst:2 msgid ":mod:`!token` --- Constants used with Python parse trees" -msgstr "" +msgstr ":mod:`!token` --- Constantes usadas com árvores de análises do Python" #: ../../library/token.rst:9 msgid "**Source code:** :source:`Lib/token.py`" diff --git a/library/tokenize.po b/library/tokenize.po index 80c13580a..f8ec82db4 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -216,7 +216,7 @@ msgstr "" #: ../../library/tokenize.rst:145 msgid "or::" -msgstr "or::" +msgstr "ou::" #: ../../library/tokenize.rst:154 msgid "Command-Line Usage" diff --git a/library/tomllib.po b/library/tomllib.po index 2eaa1c675..b91caf96a 100644 --- a/library/tomllib.po +++ b/library/tomllib.po @@ -24,16 +24,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tomllib.rst:2 msgid ":mod:`!tomllib` --- Parse TOML files" -msgstr "" +msgstr ":mod:`!tomllib` --- Analisa arquivos TOML" #: ../../library/tomllib.rst:12 msgid "**Source code:** :source:`Lib/tomllib`" diff --git a/library/trace.po b/library/trace.po index 5916e0e70..1fbd6b04e 100644 --- a/library/trace.po +++ b/library/trace.po @@ -18,16 +18,17 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/trace.rst:2 msgid ":mod:`!trace` --- Trace or track Python statement execution" msgstr "" +":mod:`!trace` --- Rastreia ou acompanha a execução de instruções Python" #: ../../library/trace.rst:7 msgid "**Source code:** :source:`Lib/trace.py`" @@ -81,7 +82,7 @@ msgstr "" #: ../../library/trace.rst:39 msgid "Display usage and exit." -msgstr "Exibe o uso e sai." +msgstr "Exibe o modo de uso e sai." #: ../../library/trace.rst:43 msgid "Display the version of the module and exit." diff --git a/library/traceback.po b/library/traceback.po index 21cac2f5c..9eac4fa78 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/tracemalloc.po b/library/tracemalloc.po index 92b4ab6bf..e8516e109 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/tty.po b/library/tty.po index 0668c0fb1..5353e3486 100644 --- a/library/tty.po +++ b/library/tty.po @@ -16,16 +16,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/tty.rst:2 msgid ":mod:`!tty` --- Terminal control functions" -msgstr "" +msgstr ":mod:`!tty` --- Funções de controle de terminal" #: ../../library/tty.rst:11 msgid "**Source code:** :source:`Lib/tty.py`" @@ -101,6 +101,7 @@ msgstr "" msgid "" "The return value is now the original tty attributes, instead of ``None``." msgstr "" +"O valor de retorno agora é o atributos originais do tty, em vez de ``None``." #: ../../library/tty.rst:61 msgid "" diff --git a/library/turtle.po b/library/turtle.po index 3e6da30c8..2d5741812 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -27,10 +27,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/types.po b/library/types.po index d4643a47c..53a3751ad 100644 --- a/library/types.po +++ b/library/types.po @@ -18,16 +18,17 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/types.rst:2 msgid ":mod:`!types` --- Dynamic type creation and names for built-in types" msgstr "" +":mod:`!types` --- Criação de tipos dinâmicos e nomes para tipos embutidos" #: ../../library/types.rst:7 msgid "**Source code:** :source:`Lib/types.py`" @@ -165,7 +166,7 @@ msgid "" msgstr "" "Esta função procura por itens em *bases* que não sejam instâncias de :class:" "`type` e retorna uma tupla onde cada objeto que possui um método :meth:" -"`~object.__mro_entries__` é substituído por um resultado descompactado da " +"`~object.__mro_entries__` é substituído por um resultado desempacotado da " "chamada desse método. Se um item *bases* é uma instância de :class:`type`, " "ou não possui o método :meth:`!__mro_entries__`, ele é incluído na tupla de " "retorno inalterada." diff --git a/library/typing.po b/library/typing.po index 3f609860b..b3d60db20 100644 --- a/library/typing.po +++ b/library/typing.po @@ -28,10 +28,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -445,7 +445,7 @@ msgid "" "in the container will be of the same type. For example::" msgstr "" "Para a maior parte dos tipos containers em Python, o sistema de tipagem " -"assume que todos os elementos do contêiner são do mesmo tipo. Por exemplo::" +"presume que todos os elementos do contêiner são do mesmo tipo. Por exemplo::" #: ../../library/typing.rst:354 msgid "" @@ -960,32 +960,40 @@ msgid "" ":data:`!Never` and :data:`!NoReturn` represent the `bottom type `_, a type that has no members." msgstr "" +":data:`!Never` e :data:`!NoReturn` representam o `tipo inferior `_, um tipo que não possui membros." #: ../../library/typing.rst:851 msgid "" "They can be used to indicate that a function never returns, such as :func:" "`sys.exit`::" msgstr "" +"Eles podem ser usados ​​para indicar que uma função nunca retorna, como :func:" +"`sys.exit`::" #: ../../library/typing.rst:859 msgid "" "Or to define a function that should never be called, as there are no valid " "arguments, such as :func:`assert_never`::" msgstr "" +"Ou para definir uma função que nunca deve ser chamada, pois não existem " +"argumentos válidos, como :func:`assert_never`::" #: ../../library/typing.rst:878 msgid "" ":data:`!Never` and :data:`!NoReturn` have the same meaning in the type " "system and static type checkers treat both equivalently." msgstr "" +":data:`!Never` e :data:`!NoReturn` têm o mesmo significado no sistema de " +"tipos e os verificadores de tipo estático tratam ambos de forma equivalente." #: ../../library/typing.rst:883 msgid "Added :data:`NoReturn`." -msgstr "" +msgstr "Adicionado :data:`NoReturn`." #: ../../library/typing.rst:887 msgid "Added :data:`Never`." -msgstr "" +msgstr "Adicionado :data:`Never`." #: ../../library/typing.rst:891 msgid "Special type to represent the current enclosed class." @@ -1034,6 +1042,9 @@ msgid "" "You should not use ``Self`` as the return annotation if the method is not " "guaranteed to return an instance of a subclass when the class is subclassed::" msgstr "" +"Você não deveria usar ``Self`` como a anotação de retorno se não for " +"garantido que o método retorne uma instância de uma subclasse quando a " +"classe for subclassificada::" #: ../../library/typing.rst:942 msgid "See :pep:`673` for more details." @@ -1053,6 +1064,10 @@ msgid "" "aliases that make use of forward references, as it can be hard for type " "checkers to distinguish these from normal variable assignments:" msgstr "" +"``TypeAlias`` é particularmente útil em versões mais antigas do Python para " +"anotar apelidos que fazem uso de referências futuras, pois pode ser difícil " +"para os verificadores de tipo distingui-los das atribuições normais de " +"variáveis:" #: ../../library/typing.rst:976 msgid "See :pep:`613` for more details." @@ -1068,6 +1083,13 @@ msgid "" "`TypeAlias` is not currently planned, but users are encouraged to migrate " "to :keyword:`type` statements." msgstr "" +":data:`TypeAlias` foi descontinuado em favor da instrução :keyword:`type`, " +"que cria instâncias de :class:`TypeAliasType` e que oferece suporte a " +"nativamente referências futuras. Observe que embora :data:`TypeAlias` e :" +"class:`TypeAliasType` sirvam propósitos semelhantes e tenham nomes " +"semelhantes, eles são distintos e o último não é o tipo do primeiro. A " +"remoção de :data:`TypeAlias` não está planejada atualmente, mas os usuários " +"são encorajados a migrar para instruções :keyword:`type`." #: ../../library/typing.rst:991 msgid "Special forms" @@ -1078,34 +1100,39 @@ msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" +"Eles podem ser usados ​​como tipos em anotações. Todos eles oferecem suporte a " +"subscrição usando ``[]``, mas cada um tem uma sintaxe única." #: ../../library/typing.rst:998 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" +"Tipo de união; ``Union[X, Y]`` é equivalente a ``X | Y`` e significa X ou Y." #: ../../library/typing.rst:1000 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" +"Para definir uma união, use, por exemplo. ``Union[int, str]`` ou a " +"abreviatura ``int | str``. Usar essa abreviação é recomendado. Detalhes:" #: ../../library/typing.rst:1002 msgid "The arguments must be types and there must be at least one." -msgstr "" +msgstr "Os argumentos devem ser tipos e deve haver pelo menos um." #: ../../library/typing.rst:1004 msgid "Unions of unions are flattened, e.g.::" -msgstr "" +msgstr "As uniões de uniões são achatadas, por exemplo::" #: ../../library/typing.rst:1008 msgid "Unions of a single argument vanish, e.g.::" -msgstr "" +msgstr "As uniões de um único argumento desaparecem, por exemplo::" #: ../../library/typing.rst:1012 msgid "Redundant arguments are skipped, e.g.::" -msgstr "" +msgstr "Argumento redundantes são pulados, e.g.::" #: ../../library/typing.rst:1016 msgid "When comparing unions, the argument order is ignored, e.g.::" @@ -1113,11 +1140,11 @@ msgstr "" #: ../../library/typing.rst:1020 msgid "You cannot subclass or instantiate a ``Union``." -msgstr "" +msgstr "Você não pode estender ou instanciar uma ``Union``" #: ../../library/typing.rst:1022 msgid "You cannot write ``Union[X][Y]``." -msgstr "" +msgstr "Você não pode escrever ``Union[X][Y]``." #: ../../library/typing.rst:1024 msgid "Don't remove explicit subclasses from unions at runtime." @@ -1156,7 +1183,7 @@ msgstr "" #: ../../library/typing.rst:1056 msgid "Special form for annotating higher-order functions." -msgstr "" +msgstr "Forma especial para anotar funções de ordem superior." #: ../../library/typing.rst:1058 msgid "" diff --git a/library/unicodedata.po b/library/unicodedata.po index 106eb6216..88bef36af 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index f6165ba27..76ffad4ee 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/unittest.mock-examples.rst:2 msgid ":mod:`!unittest.mock` --- getting started" -msgstr "" +msgstr ":mod:`!unittest.mock` --- primeiros passos" #: ../../library/unittest.mock-examples.rst:27 msgid "Using Mock" @@ -43,7 +43,7 @@ msgstr "Usos comuns para objetos :class:`Mock` incluem:" #: ../../library/unittest.mock-examples.rst:34 msgid "Patching methods" -msgstr "" +msgstr "Métodos de aplicação de patches" #: ../../library/unittest.mock-examples.rst:35 msgid "Recording method calls on objects" @@ -54,12 +54,17 @@ msgid "" "You might want to replace a method on an object to check that it is called " "with the correct arguments by another part of the system:" msgstr "" +"Talvez você queira substituir um método em um objeto para verificar se ele " +"foi chamado com os argumentos corretos por outra parte do sistema:" #: ../../library/unittest.mock-examples.rst:45 msgid "" "Once our mock has been used (``real.method`` in this example) it has methods " "and attributes that allow you to make assertions about how it has been used." msgstr "" +"Depois que nosso mock for usado (``real.method`` neste exemplo), ele terá " +"métodos e atributos que permitem que você faça afirmações sobre como ele foi " +"usado." #: ../../library/unittest.mock-examples.rst:50 msgid "" @@ -67,6 +72,9 @@ msgid "" "are interchangeable. As the ``MagicMock`` is the more capable class it makes " "a sensible one to use by default." msgstr "" +"Na maioria desses exemplos, as classes :class:`Mock` e :class:`MagicMock` " +"são intercambiáveis. Como a ``MagicMock`` é a classe mais capaz, ela faz " +"sentido para ser usada por padrão." #: ../../library/unittest.mock-examples.rst:54 msgid "" @@ -75,16 +83,22 @@ msgid "" "or :meth:`~Mock.assert_called_once_with` method to check that it was called " "with the correct arguments." msgstr "" +"Uma vez que o mock foi chamado, seu atributo :attr:`~Mock.called` é definido " +"como ``True``. Mais importante, podemos usar o método :meth:`~Mock." +"assert_called_with` ou :meth:`~Mock.assert_called_once_with` para verificar " +"se ele foi chamado com os argumentos corretos." #: ../../library/unittest.mock-examples.rst:59 msgid "" "This example tests that calling ``ProductionClass().method`` results in a " "call to the ``something`` method:" msgstr "" +"Este exemplo testa se a chamada de ``ProductionClass().method`` resulta em " +"uma chamada para o método ``something``:" #: ../../library/unittest.mock-examples.rst:76 msgid "Mock for Method Calls on an Object" -msgstr "" +msgstr "Mock de chamadas de métodos em um objeto" #: ../../library/unittest.mock-examples.rst:78 msgid "" @@ -93,18 +107,26 @@ msgid "" "method (or some part of the system under test) and then check that it is " "used in the correct way." msgstr "" +"No último exemplo, aplicamos um patch em um método diretamente em um objeto " +"para verificar se ele foi chamado corretamente. Outro caso de uso comum é " +"passar um objeto para um método (ou alguma parte do sistema em teste) e " +"então verificar se ele é usado da maneira correta." #: ../../library/unittest.mock-examples.rst:83 msgid "" "The simple ``ProductionClass`` below has a ``closer`` method. If it is " "called with an object then it calls ``close`` on it." msgstr "" +"O ``ProductionClass`` simples abaixo tem um método ``closer``. Se ele for " +"chamado com um objeto, então ele chama ``close`` nele." #: ../../library/unittest.mock-examples.rst:91 msgid "" "So to test it we need to pass in an object with a ``close`` method and check " "that it was called correctly." msgstr "" +"Então, para testá-lo, precisamos passar um objeto com um método ``close`` e " +"verificar se ele foi chamado corretamente." #: ../../library/unittest.mock-examples.rst:99 msgid "" @@ -113,6 +135,10 @@ msgid "" "accessing it in the test will create it, but :meth:`~Mock." "assert_called_with` will raise a failure exception." msgstr "" +"Não precisamos fazer nenhum trabalho para fornecer o método 'close' em nosso " +"mock. Acessar close o cria. Então, se 'close' ainda não foi chamado, acessá-" +"lo no teste o criará, mas :meth:`~Mock.assert_called_with` levantará uma " +"exceção de falha." #: ../../library/unittest.mock-examples.rst:106 msgid "Mocking Classes" @@ -148,7 +174,7 @@ msgstr "" #: ../../library/unittest.mock-examples.rst:144 msgid "Tracking all Calls" -msgstr "" +msgstr "Rastreando todas as chamadas" #: ../../library/unittest.mock-examples.rst:146 msgid "" @@ -156,6 +182,9 @@ msgid "" "`~Mock.mock_calls` attribute records all calls to child attributes of the " "mock - and also to their children." msgstr "" +"Frequentemente você quer rastrear mais de uma chamada para um método. O " +"atributo :attr:`~Mock.mock_calls` registra todas as chamadas para atributos " +"filhos do mock - e também para seus filhos." #: ../../library/unittest.mock-examples.rst:158 msgid "" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 547bb355c..8e392294f 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Vitor Buxbaum Orlandi, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/unittest.po b/library/unittest.po index daef7748c..e49a438b1 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -26,10 +26,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -589,7 +589,7 @@ msgid "" "the location you intended, so you will not get the warning." msgstr "" "Se você configurar o diretório de início como sendo um nome de pacote, não " -"um caminho para um diretório, o descobridor irá assumir que qualquer local " +"um caminho para um diretório, o descobridor irá presumir que qualquer local " "do qual ele importar é o local correto. Neste caso, nenhum alerta será " "emitido." @@ -1621,7 +1621,7 @@ msgstr "" #: ../../library/unittest.rst:1046 ../../library/unittest.rst:1114 msgid "or::" -msgstr "or::" +msgstr "ou::" #: ../../library/unittest.rst:1051 msgid "Added under the name ``assertRaisesRegexp``." diff --git a/library/unix.po b/library/unix.po index 249b47ba4..36943fad5 100644 --- a/library/unix.po +++ b/library/unix.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/urllib.error.po b/library/urllib.error.po index 010b39cae..9e0c42623 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -16,16 +16,17 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/urllib.error.rst:2 msgid ":mod:`!urllib.error` --- Exception classes raised by urllib.request" msgstr "" +":mod:`!urllib.error` --- Classes de exceção levantadas por urllib.request" #: ../../library/urllib.error.rst:10 msgid "**Source code:** :source:`Lib/urllib/error.py`" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index d0b64edce..4fafef76f 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/urllib.parse.rst:2 msgid ":mod:`!urllib.parse` --- Parse URLs into components" -msgstr "" +msgstr ":mod:`!urllib.parse` --- Analisa URLs para componentes" #: ../../library/urllib.parse.rst:7 msgid "**Source code:** :source:`Lib/urllib/parse.py`" @@ -74,6 +74,11 @@ msgid "" "by :rfc:`3986`, which introduced the term ``authority`` as its replacement. " "The use of ``netloc`` is continued for backward compatibility." msgstr "" +"As funções deste módulo usam o termo descontinuado ``netloc`` (ou " +"``net_loc``), que foi introduzido no :rfc:`1808`. No entanto, este termo foi " +"descontinuado pelo :rfc:`3986`, que introduziu o termo ``authority`` como " +"seu substituto. O uso de ``netloc`` continua para compatibilidade com " +"versões anteriores." #: ../../library/urllib.parse.rst:40 msgid "URL Parsing" @@ -345,6 +350,8 @@ msgid "" ":func:`urlparse` does not perform validation. See :ref:`URL parsing " "security ` for details." msgstr "" +":func:`urlparse` não realiza validação. Veja :ref:`Segurança ao analisar " +"URLs ` para detalhes." #: ../../library/urllib.parse.rst:172 msgid "Added IPv6 URL parsing capabilities." @@ -601,7 +608,7 @@ msgstr "" #: ../../library/urllib.parse.rst:438 msgid "URL parsing security" -msgstr "" +msgstr "Segurança ao analisar URLs" #: ../../library/urllib.parse.rst:440 msgid "" diff --git a/library/urllib.po b/library/urllib.po index 63ba26662..dcb9ebccc 100644 --- a/library/urllib.po +++ b/library/urllib.po @@ -17,16 +17,16 @@ msgstr "" "Last-Translator: Marco Rougeth , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/urllib.rst:2 msgid ":mod:`!urllib` --- URL handling modules" -msgstr "" +msgstr ":mod:`!urllib` --- Módulos de manipulação de URL" #: ../../library/urllib.rst:6 msgid "**Source code:** :source:`Lib/urllib/`" @@ -46,7 +46,7 @@ msgstr ":mod:`urllib.request` para abrir e ler URLs" msgid "" ":mod:`urllib.error` containing the exceptions raised by :mod:`urllib.request`" msgstr "" -":mod:`urllib.error` containing the exceptions raised by :mod:`urllib.request`" +":mod:`urllib.error` contendo as exceções levantadas por :mod:`urllib.request`" #: ../../library/urllib.rst:14 msgid ":mod:`urllib.parse` for parsing URLs" diff --git a/library/urllib.request.po b/library/urllib.request.po index 9cd4491c9..aa0417cff 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -234,7 +234,7 @@ msgid "" "taken from the request object." msgstr "" "O abridor padrão levanta um :ref:`evento de auditoria` ``urllib." -"Request`` com argumentos ``fullurl``, ``data``, ``headers``, ``method`` " +"Request`` com os argumentos ``fullurl``, ``data``, ``headers``, ``method`` " "obtidos do objeto de requisição." #: ../../library/urllib.request.rst:105 @@ -1883,4 +1883,4 @@ msgstr "" #: ../../library/urllib.request.rst:1568 msgid "HTML" -msgstr "" +msgstr "HTML" diff --git a/library/urllib.robotparser.po b/library/urllib.robotparser.po index 0c121da40..0e31abc9c 100644 --- a/library/urllib.robotparser.po +++ b/library/urllib.robotparser.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/uu.po b/library/uu.po index 0fd8fe2d4..b40c3d1e4 100644 --- a/library/uu.po +++ b/library/uu.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/uuid.po b/library/uuid.po index ff9052d1b..05748fea2 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -317,7 +317,7 @@ msgstr "As seguintes opções são aceitas:" #: ../../library/uuid.rst:294 msgid "Show the help message and exit." -msgstr "" +msgstr "Mostra a mensagem de ajuda e saia." #: ../../library/uuid.rst:299 msgid "" diff --git a/library/venv.po b/library/venv.po index f8ca96a72..161dfe0fe 100644 --- a/library/venv.po +++ b/library/venv.po @@ -22,16 +22,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/venv.rst:2 msgid ":mod:`!venv` --- Creation of virtual environments" -msgstr "" +msgstr ":mod:`!venv` --- Criação de ambientes virtuais" #: ../../library/venv.rst:12 msgid "**Source code:** :source:`Lib/venv/`" diff --git a/library/warnings.po b/library/warnings.po index 290711eef..54aca6249 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -826,4 +826,4 @@ msgstr "" #: ../../library/warnings.rst:9 msgid "warnings" -msgstr "warnings" +msgstr "avisos" diff --git a/library/wave.po b/library/wave.po index fe648baf9..ea3aac142 100644 --- a/library/wave.po +++ b/library/wave.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/weakref.po b/library/weakref.po index 72da2e19b..5e2fd467f 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -320,23 +320,31 @@ msgid "" "Accessing an attribute of the proxy object after the referent is garbage " "collected raises :exc:`ReferenceError`." msgstr "" +"Acessar um atributo do objeto intermediário depois que o referente é " +"coletado como lixo levanta :exc:`ReferenceError`." #: ../../library/weakref.rst:152 msgid "" "Extended the operator support on proxy objects to include the matrix " "multiplication operators ``@`` and ``@=``." msgstr "" +"Estendeu o suporte ao operador em objetos intermediários para incluir os " +"operadores ``@`` e ``@=`` para multiplicação de matrizes." #: ../../library/weakref.rst:159 msgid "" "Return the number of weak references and proxies which refer to *object*." msgstr "" +"Retorna o número de referências fracas e intermediários que fazem referência " +"a *object*." #: ../../library/weakref.rst:164 msgid "" "Return a list of all weak reference and proxy objects which refer to " "*object*." msgstr "" +"Retorna uma lista de todos os objetos intermediários e de referência fraca " +"que fazem referência a *object*." #: ../../library/weakref.rst:169 msgid "" @@ -346,6 +354,12 @@ msgid "" "of an application without adding attributes to those objects. This can be " "especially useful with objects that override attribute accesses." msgstr "" +"Classe de mapeamento que faz referência fraca a chaves. Entradas no " +"dicionário serão descartadas quando não houver mais uma referência forte à " +"chave. Isso pode ser usado para associar dados adicionais a um objeto de " +"propriedade de outras partes de uma aplicação sem adicionar atributos a " +"esses objetos. Isso pode ser especialmente útil com objetos que substituem " +"acessos de atributos." #: ../../library/weakref.rst:175 msgid "" @@ -354,10 +368,14 @@ msgid "" "not replace the existing key. Due to this, when the reference to the " "original key is deleted, it also deletes the entry in the dictionary::" msgstr "" +"Note que quando uma chave com valor igual a uma chave existente (mas não " +"identidade igual) é inserida no dicionário, ela substitui o valor, mas não " +"substitui a chave existente. Devido a isso, quando a referência à chave " +"original é excluída, ela também exclui a entrada no dicionário::" #: ../../library/weakref.rst:188 msgid "A workaround would be to remove the key prior to reassignment::" -msgstr "" +msgstr "Uma solução alternativa seria remover a chave antes da reatribuição::" #: ../../library/weakref.rst:199 msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`." @@ -374,37 +392,52 @@ msgid "" "references that will cause the garbage collector to keep the keys around " "longer than needed." msgstr "" +"Objetos :class:`WeakKeyDictionary` têm um método adicional que expõe as " +"referências internas diretamente. Não há garantia de que as referências " +"estejam \"ativas\" no momento em que são usadas, então o resultado da " +"chamada das referências precisa ser verificado antes de ser usado. Isso pode " +"ser usado para evitar a criação de referências que farão com que o coletor " +"de lixo mantenha as chaves por mais tempo do que o necessário." #: ../../library/weakref.rst:212 msgid "Return an iterable of the weak references to the keys." -msgstr "" +msgstr "Retorna um iterável das referências fracas às chaves." #: ../../library/weakref.rst:217 msgid "" "Mapping class that references values weakly. Entries in the dictionary will " "be discarded when no strong reference to the value exists any more." msgstr "" +"Classe de mapeamento que faz referência fraca a valores. Entradas no " +"dicionário serão descartadas quando nenhuma referência forte ao valor " +"existir mais." #: ../../library/weakref.rst:220 msgid "" "Added support for ``|`` and ``|=`` operators, as specified in :pep:`584`." msgstr "" +"Adicionado suporte para operadores ``|`` e ``|=``, conforme especificado na :" +"pep:`584`." #: ../../library/weakref.rst:223 msgid "" ":class:`WeakValueDictionary` objects have an additional method that has the " "same issues as the :meth:`WeakKeyDictionary.keyrefs` method." msgstr "" +"Os objetos :class:`WeakValueDictionary` têm um método adicional que " +"apresenta os mesmos problemas que o método :meth:`WeakKeyDictionary.keyrefs`." #: ../../library/weakref.rst:229 msgid "Return an iterable of the weak references to the values." -msgstr "" +msgstr "Retorna um iterável das referências fracas aos valores." #: ../../library/weakref.rst:234 msgid "" "Set class that keeps weak references to its elements. An element will be " "discarded when no strong reference to it exists any more." msgstr "" +"Define a classe que mantém referências fracas para seus elementos. Um " +"elemento será descartado quando nenhuma referência forte a ele existir mais." #: ../../library/weakref.rst:240 msgid "" @@ -414,12 +447,19 @@ msgid "" "hold of it. :class:`WeakMethod` has special code to recreate the bound " "method until either the object or the original function dies::" msgstr "" +"Uma subclasse personalizada de :class:`ref` que simula uma referência fraca " +"a um método vinculado (ou seja, um método definido em uma classe e " +"pesquisado em uma instância). Como um método vinculado é efêmero, uma " +"referência fraca padrão não pode mantê-lo. :class:`WeakMethod` tem um código " +"especial para recriar o método vinculado até que o objeto ou a função " +"original morra::" #: ../../library/weakref.rst:264 msgid "" "*callback* is the same as the parameter of the same name to the :func:`ref` " "function." msgstr "" +"*callback* é o mesmo que o parâmetro de mesmo nome da função :func:`ref`." #: ../../library/weakref.rst:270 msgid "" @@ -428,6 +468,10 @@ msgid "" "always survive until the reference object is collected, greatly simplifying " "lifecycle management." msgstr "" +"Retorna um objeto finalizador chamável que será chamado quando *obj* for " +"coletado como lixo. Diferentemente de uma referência fraca comum, um " +"finalizador sempre sobreviverá até que o objeto referência seja coletado, " +"simplificando muito o gerenciamento do ciclo de vida." #: ../../library/weakref.rst:275 msgid "" @@ -436,6 +480,10 @@ msgid "" "finalizer returns the result of evaluating ``func(*arg, **kwargs)``, whereas " "calling a dead finalizer returns :const:`None`." msgstr "" +"Um finalizador é considerado *alive* (vivo) até ser chamado (explicitamente " +"ou na coleta de lixo), e depois disso ele é *dead* (morto). Chamar um " +"finalizador vivo retorna o resultado da avaliação de ``func(*arg, " +"**kwargs)``, enquanto chamar um finalizador morto retorna :const:`None`." #: ../../library/weakref.rst:280 msgid "" @@ -444,6 +492,11 @@ msgid "" "handled in the same way as exceptions raised from an object's :meth:`~object." "__del__` method or a weak reference's callback." msgstr "" +"Exceções levantadas por funções de retorno do finalizador durante a coleta " +"de lixo serão mostradas na saída de erro padrão, mas não podem ser " +"propagadas. Elas são tratadas da mesma forma que exceções levantadas de um " +"método :meth:`~object.__del__` de um objeto ou de uma função de retorno da " +"referência fraca." #: ../../library/weakref.rst:286 msgid "" @@ -451,6 +504,9 @@ msgid "" "attr:`atexit` attribute has been set to false. They are called in reverse " "order of creation." msgstr "" +"Quando o programa é encerrado, cada finalizador vivo restante é chamado, a " +"menos que seu atributo :attr:`atexit` tenha sido definido como falso. Eles " +"são chamados na ordem reversa da criação." #: ../../library/weakref.rst:290 msgid "" @@ -458,28 +514,39 @@ msgid "" "term:`interpreter shutdown` when module globals are liable to have been " "replaced by :const:`None`." msgstr "" +"Um finalizador nunca vai invocar sua função de retorno durante a parte " +"posterior do :term:`desligamento do interpretador` quando os globais do " +"módulo podem ter sido substituídos por :const:`None`." #: ../../library/weakref.rst:296 msgid "" "If *self* is alive then mark it as dead and return the result of calling " "``func(*args, **kwargs)``. If *self* is dead then return :const:`None`." msgstr "" +"Se *self* estiver vivo, marca-o como morto e retorna o resultado da chamada " +"``func(*args, **kwargs)``. Se *self* estiver morto, retorna :const:`None`." #: ../../library/weakref.rst:302 msgid "" "If *self* is alive then mark it as dead and return the tuple ``(obj, func, " "args, kwargs)``. If *self* is dead then return :const:`None`." msgstr "" +"Se *self* estiver vivo, marca-o como morto e retorna a tupla ``(obj, func, " +"args, kwargs)``. Se *self* estiver morto, retorna :const:`None`." #: ../../library/weakref.rst:308 msgid "" "If *self* is alive then return the tuple ``(obj, func, args, kwargs)``. If " "*self* is dead then return :const:`None`." msgstr "" +"Se *self* estiver vivo, retorna a tupla ``(obj, func, args, kwargs)``. Se " +"*self* estiver morto, retorna :const:`None`." #: ../../library/weakref.rst:313 msgid "Property which is true if the finalizer is alive, false otherwise." msgstr "" +"Propriedade que é verdadeiro se o finalizador estiver ativo, falsa caso " +"contrário." #: ../../library/weakref.rst:317 msgid "" @@ -487,6 +554,10 @@ msgid "" "exits, it calls all remaining live finalizers for which :attr:`.atexit` is " "true. They are called in reverse order of creation." msgstr "" +"Uma propriedade booleana gravável que por padrão é verdadeiro. Quando o " +"programa sai, ele chama todos os finalizadores vivos restantes para os " +"quais :attr:`.atexit` é verdadeiro. Eles são chamados na ordem reversa da " +"criação." #: ../../library/weakref.rst:324 msgid "" @@ -495,18 +566,22 @@ msgid "" "will never be garbage collected. In particular, *func* should not be a " "bound method of *obj*." msgstr "" +"É importante garantir que *func*, *args* e *kwargs* não possuam nenhuma " +"referência a *obj*, direta ou indiretamente, pois, caso contrário, *obj* " +"nunca será coletado como lixo. Em particular, *func* não deve ser um método " +"vinculado de *obj*." #: ../../library/weakref.rst:334 msgid "The type object for weak references objects." -msgstr "" +msgstr "O objeto tipo para objetos referências fracas." #: ../../library/weakref.rst:339 msgid "The type object for proxies of objects which are not callable." -msgstr "" +msgstr "O tipo de objeto para intermediários de objetos que não são chamáveis." #: ../../library/weakref.rst:344 msgid "The type object for proxies of callable objects." -msgstr "" +msgstr "O objeto de tipo para intermediários de objetos chamáveis." #: ../../library/weakref.rst:349 msgid "" @@ -514,6 +589,9 @@ msgid "" "simpler to test if an object is a proxy without being dependent on naming " "both proxy types." msgstr "" +"Sequência contendo todos os objetos de tipo para intermediários. Isso pode " +"tornar mais simples testar se um objeto é um intermediário sem depender da " +"nomeação de ambos os tipos de intermediário." #: ../../library/weakref.rst:356 msgid ":pep:`205` - Weak References" @@ -524,10 +602,13 @@ msgid "" "The proposal and rationale for this feature, including links to earlier " "implementations and information about similar features in other languages." msgstr "" +"A proposta e a justificativa para esse recurso, incluindo links para " +"implementações anteriores e informações sobre recursos semelhantes em outras " +"linguagens." #: ../../library/weakref.rst:364 msgid "Weak Reference Objects" -msgstr "Objetos de referência fraca" +msgstr "Objetos referência fraca" #: ../../library/weakref.rst:366 msgid "" @@ -535,12 +616,17 @@ msgid "" "__callback__`. A weak reference object allows the referent to be obtained, " "if it still exists, by calling it:" msgstr "" +"Objetos referência fraca não têm métodos nem atributos além de :attr:`ref." +"__callback__`. Um objeto referência fraca permite que o referente seja " +"obtido, se ele ainda existir, chamando-o:" #: ../../library/weakref.rst:380 msgid "" "If the referent no longer exists, calling the reference object returns :" "const:`None`:" msgstr "" +"Se o referente não existir mais, chamar o objeto referência retornará :const:" +"`None`:" #: ../../library/weakref.rst:387 msgid "" @@ -548,6 +634,9 @@ msgid "" "expression ``ref() is not None``. Normally, application code that needs to " "use a reference object should follow this pattern::" msgstr "" +"O teste de se um objeto referência fraca ainda está vivo deve ser feito " +"usando a expressão ``ref() is not None``. Normalmente, o código da aplicação " +"que precisa usar um objeto de referência deve seguir este padrão::" #: ../../library/weakref.rst:400 msgid "" @@ -556,6 +645,11 @@ msgid "" "invalidated before the weak reference is called; the idiom shown above is " "safe in threaded applications as well as single-threaded applications." msgstr "" +"Usar um teste separado para \"vivacidade\" cria condições de corrida em " +"aplicações que usam mais de uma thread; uma outra thread pode fazer com que " +"uma referência fraca seja invalidada antes que a referência fraca seja " +"chamada; o idioma mostrado acima é seguro em aplicações que usam mais de uma " +"thread, bem como em aplicações de thread única." #: ../../library/weakref.rst:405 msgid "" @@ -566,6 +660,12 @@ msgid "" "reference, but could also be used to insert additional processing on calls " "to retrieve the referent." msgstr "" +"Versões especializadas de objetos :class:`ref` podem ser criadas por meio de " +"subclasse. Isso é usado na implementação do :class:`WeakValueDictionary` " +"para reduzir a sobrecarga de memória para cada entrada no mapeamento. Isso " +"pode ser mais útil para associar informações adicionais a uma referência, " +"mas também pode ser usado para inserir processamento adicional em chamadas " +"para recuperar o referente." #: ../../library/weakref.rst:411 msgid "" @@ -573,6 +673,9 @@ msgid "" "additional information about an object and affect the value that's returned " "when the referent is accessed::" msgstr "" +"Este exemplo mostra como uma subclasse de :class:`ref` pode ser usada para " +"armazenar informações adicionais sobre um objeto e afetar o valor retornado " +"quando o referente é acessado::" #: ../../library/weakref.rst:438 msgid "Example" @@ -585,6 +688,10 @@ msgid "" "other data structures without forcing the objects to remain alive, but the " "objects can still be retrieved by ID if they do." msgstr "" +"Este exemplo simples mostra como uma aplicação pode usar IDs de objeto para " +"recuperar objetos que ele viu antes. Os IDs dos objetos podem então ser " +"usados ​​em outras estruturas de dados sem forçar os objetos a permanecerem " +"vivos, mas os objetos ainda podem ser recuperados por ID se o fizerem." #: ../../library/weakref.rst:465 msgid "Finalizer Objects" @@ -596,12 +703,17 @@ msgid "" "register a callback without needing to preserve the returned finalizer " "object. For instance" msgstr "" +"O principal benefício de usar :class:`finalize` é que ele simplifica o " +"registro de um retorno de chamada sem precisar preservar o objeto " +"finalizador retornado. Por exemplo" #: ../../library/weakref.rst:481 msgid "" "The finalizer can be called directly as well. However the finalizer will " "invoke the callback at most once." msgstr "" +"O finalizador pode ser chamado diretamente também. No entanto, o finalizador " +"vai invocar a função de retorno no máximo uma vez." #: ../../library/weakref.rst:497 msgid "" @@ -609,6 +721,9 @@ msgid "" "This kills the finalizer and returns the arguments passed to the constructor " "when it was created." msgstr "" +"Você pode desfazer o registro de um finalizador usando seu método :meth:" +"`~finalize.detach`. Isso elimina o finalizador e retorna os argumentos " +"passados ​​ao construtor quando ele foi criado." #: ../../library/weakref.rst:511 msgid "" @@ -616,10 +731,13 @@ msgid "" "finalizer will be called when the program exits if it is still alive. For " "instance" msgstr "" +"A menos que você defina o atributo :attr:`~finalize.atexit` como :const:" +"`False`, um finalizador será chamado quando o programa sair se ele ainda " +"estiver vivo. Por exemplo" #: ../../library/weakref.rst:526 msgid "Comparing finalizers with :meth:`~object.__del__` methods" -msgstr "" +msgstr "Comparando finalizadores com métodos :meth:`~object.__del__`" #: ../../library/weakref.rst:528 msgid "" @@ -627,14 +745,17 @@ msgid "" "directories. The directories should be deleted with their contents when the " "first of the following events occurs:" msgstr "" +"Suponha que queremos criar uma classe cujas instâncias representam " +"diretórios temporários. Os diretórios devem ser excluídos com seus conteúdos " +"quando o primeiro dos seguintes eventos ocorrer:" #: ../../library/weakref.rst:532 msgid "the object is garbage collected," -msgstr "" +msgstr "o objeto é um lixo coletado," #: ../../library/weakref.rst:533 msgid "the object's :meth:`!remove` method is called, or" -msgstr "" +msgstr "o método :meth:`!remove` do objeto é chamado, ou" #: ../../library/weakref.rst:534 msgid "the program exits." @@ -645,6 +766,8 @@ msgid "" "We might try to implement the class using a :meth:`~object.__del__` method " "as follows::" msgstr "" +"Podemos tentar implementar a classe usando um método :meth:`~object.__del__` " +"da seguinte maneira::" #: ../../library/weakref.rst:555 msgid "" @@ -653,6 +776,10 @@ msgid "" "longer forced to :const:`None` during :term:`interpreter shutdown`. So this " "code should work without any issues on CPython." msgstr "" +"A partir do Python 3.4, os métodos :meth:`~object.__del__` não impedem mais " +"que os ciclos de referência sejam coletados como lixo, e os módulos globais " +"não são mais forçados a :const:`None` durante :term:`desligamento do " +"interpretador`. Então, esse código deve funcionar sem problemas no CPython." #: ../../library/weakref.rst:560 msgid "" @@ -660,6 +787,9 @@ msgid "" "implementation specific, since it depends on internal details of the " "interpreter's garbage collector implementation." msgstr "" +"Entretanto, o tratamento dos métodos :meth:`~object.__del__` é notoriamente " +"específico da implementação, pois depende de detalhes internos da " +"implementação do coletor de lixo do interpretador." #: ../../library/weakref.rst:564 msgid "" @@ -667,6 +797,9 @@ msgid "" "the specific functions and objects that it needs, rather than having access " "to the full state of the object::" msgstr "" +"Uma alternativa mais robusta pode ser definir um finalizador que faça " +"referência apenas às funções e objetos específicos de que necessita, em vez " +"de ter acesso ao estado completo do objeto::" #: ../../library/weakref.rst:580 msgid "" @@ -674,6 +807,9 @@ msgid "" "needs to clean up the directory appropriately. If the object never gets " "garbage collected the finalizer will still be called at exit." msgstr "" +"Definido assim, nosso finalizador recebe apenas uma referência aos detalhes " +"que ele precisa para limpar o diretório apropriadamente. Se o objeto nunca " +"for coletado como lixo, o finalizador ainda será chamado na saída." #: ../../library/weakref.rst:584 msgid "" @@ -681,6 +817,10 @@ msgid "" "register finalizers for classes where the definition is controlled by a " "third party, such as running code when a module is unloaded::" msgstr "" +"A outra vantagem dos finalizadores baseados em referências fracas é que eles " +"podem ser usados ​​para registrar finalizadores para classes onde a definição " +"é controlada por terceiros, como executar código quando um módulo é " +"descarregado::" #: ../../library/weakref.rst:596 msgid "" @@ -689,3 +829,8 @@ msgid "" "at exit. However, in a daemonic thread :func:`atexit.register`, ``try: ... " "finally: ...`` and ``with: ...`` do not guarantee that cleanup occurs either." msgstr "" +"Se você criar um objeto finalizador em uma thread em um daemon assim que o " +"programa sair, então há a possibilidade de que o finalizador não seja " +"chamado na saída. No entanto, em um thread em um daemon :func:`atexit." +"register`, ``try: ... finally: ...`` e ``with: ...`` não garantem que a " +"limpeza ocorra também." diff --git a/library/webbrowser.po b/library/webbrowser.po index 57b2951f7..5882de6f0 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -126,6 +126,8 @@ msgid "" "Raises an :ref:`auditing event ` ``webbrowser.open`` with argument " "``url``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``webbrowser.open`` com o " +"argumento ``url``." #: ../../library/webbrowser.rst:74 msgid "" diff --git a/library/windows.po b/library/windows.po index b08692175..a199a4e5c 100644 --- a/library/windows.po +++ b/library/windows.po @@ -17,10 +17,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/winreg.po b/library/winreg.po index 707b12b52..f08c19043 100644 --- a/library/winreg.po +++ b/library/winreg.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -96,6 +96,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.ConnectRegistry`` with " "arguments ``computer_name``, ``key``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.ConnectRegistry`` " +"com os argumentos ``computer_name``, ``key``." #: ../../library/winreg.rst:58 ../../library/winreg.rst:84 #: ../../library/winreg.rst:118 ../../library/winreg.rst:139 @@ -143,6 +145,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.CreateKey`` with " "arguments ``key``, ``sub_key``, ``access``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.CreateKey`` com os " +"argumentos ``key``, ``sub_key``, ``access``." #: ../../library/winreg.rst:82 ../../library/winreg.rst:114 #: ../../library/winreg.rst:324 @@ -150,6 +154,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey/result`` with " "argument ``key``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.OpenKey/result`` " +"com o argumento ``key``." #: ../../library/winreg.rst:98 ../../library/winreg.rst:154 msgid "" @@ -189,6 +195,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteKey`` with " "arguments ``key``, ``sub_key``, ``access``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.DeleteKey`` com os " +"argumentos ``key``, ``sub_key``, ``access``." #: ../../library/winreg.rst:150 msgid "" @@ -222,6 +230,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.DeleteValue`` with " "arguments ``key``, ``value``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.DeleteValue`` com " +"os argumentos ``key``, ``value``." #: ../../library/winreg.rst:190 msgid "Enumerates subkeys of an open registry key, returning a string." @@ -243,6 +253,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumKey`` with arguments " "``key``, ``index``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.EnumKey`` com os " +"argumentos ``key``, ``index``." #: ../../library/winreg.rst:209 msgid "Enumerates values of an open registry key, returning a tuple." @@ -309,6 +321,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.EnumValue`` with " "arguments ``key``, ``index``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.EnumValue`` com os " +"argumentos ``key``, ``index``." #: ../../library/winreg.rst:247 msgid "" @@ -321,6 +335,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg." "ExpandEnvironmentStrings`` with argument ``str``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg." +"ExpandEnvironmentStrings`` com o argumento ``str``." #: ../../library/winreg.rst:258 msgid "Writes all the attributes of a key to the registry." @@ -385,6 +401,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.LoadKey`` with arguments " "``key``, ``sub_key``, ``file_name``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.LoadKey`` com os " +"argumentos ``key``, ``sub_key``, ``file_name``." #: ../../library/winreg.rst:305 msgid "" @@ -420,6 +438,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.OpenKey`` with arguments " "``key``, ``sub_key``, ``access``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.OpenKey`` com os " +"argumentos ``key``, ``sub_key``, ``access``." #: ../../library/winreg.rst:326 msgid "Allow the use of named arguments." @@ -448,6 +468,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryInfoKey`` with " "argument ``key``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.QueryInfoKey`` com " +"o argumento ``key``." #: ../../library/winreg.rst:361 msgid "Retrieves the unnamed value for a key, as a string." @@ -474,6 +496,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryValue`` with " "arguments ``key``, ``sub_key``, ``value_name``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.QueryValue`` com " +"os argumentos ``key``, ``sub_key``, ``value_name``." #: ../../library/winreg.rst:380 msgid "" @@ -530,6 +554,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.SaveKey`` with arguments " "``key``, ``file_name``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.SaveKey`` com os " +"argumentos ``key``, ``file_name``." #: ../../library/winreg.rst:430 msgid "Associates a value with a specified key." @@ -576,6 +602,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.SetValue`` with " "arguments ``key``, ``sub_key``, ``type``, ``value``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.SetValue`` com os " +"argumentos ``key``, ``sub_key``, ``type``, ``value``." #: ../../library/winreg.rst:458 msgid "Stores data in the value field of an open registry key." @@ -633,6 +661,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.DisableReflectionKey`` " "with argument ``key``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg." +"DisableReflectionKey`` com o argumento ``key``." #: ../../library/winreg.rst:506 msgid "Restores registry reflection for the specified disabled key." @@ -648,6 +678,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.EnableReflectionKey`` " "with argument ``key``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg." +"EnableReflectionKey`` com o argumento ``key``." #: ../../library/winreg.rst:521 msgid "Determines the reflection state for the specified key." @@ -662,6 +694,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.QueryReflectionKey`` " "with argument ``key``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg." +"QueryReflectionKey`` com o argumento ``key``." #: ../../library/winreg.rst:537 msgid "Constants" @@ -954,6 +988,8 @@ msgid "" "Raises an :ref:`auditing event ` ``winreg.PyHKEY.Detach`` with " "argument ``key``." msgstr "" +"Levanta um :ref:`evento de auditoria ` ``winreg.PyHKEY.Detach`` " +"com o argumento ``key``." #: ../../library/winreg.rst:790 msgid "" diff --git a/library/winsound.po b/library/winsound.po index 7555864be..7265a720f 100644 --- a/library/winsound.po +++ b/library/winsound.po @@ -19,10 +19,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/wsgiref.po b/library/wsgiref.po index cf2cc6152..2b94d377c 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xdrlib.po b/library/xdrlib.po index 870addb86..123a8cd71 100644 --- a/library/xdrlib.po +++ b/library/xdrlib.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.dom.minidom.po b/library/xml.dom.minidom.po index 83871a5e8..a6d9b91e8 100644 --- a/library/xml.dom.minidom.po +++ b/library/xml.dom.minidom.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.dom.po b/library/xml.dom.po index 815fafcd1..6363eb815 100644 --- a/library/xml.dom.po +++ b/library/xml.dom.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.dom.pulldom.po b/library/xml.dom.pulldom.po index 4a0fb3a57..18f2725fb 100644 --- a/library/xml.dom.pulldom.po +++ b/library/xml.dom.pulldom.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 7c584c781..145405fae 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -23,16 +23,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/xml.etree.elementtree.rst:2 msgid ":mod:`!xml.etree.ElementTree` --- The ElementTree XML API" -msgstr "" +msgstr ":mod:`!xml.etree.ElementTree` --- A API XML ElementTree" #: ../../library/xml.etree.elementtree.rst:9 msgid "**Source code:** :source:`Lib/xml/etree/ElementTree.py`" @@ -199,6 +199,11 @@ msgid "" "data incrementally with :meth:`XMLPullParser.feed` calls. To get the parsed " "XML elements, call :meth:`XMLPullParser.read_events`. Here is an example::" msgstr "" +"A ferramenta mais poderosa para fazer isso é :class:`XMLPullParser`. Ela não " +"requer uma leitura bloqueante para obter os dados XML e, em vez disso, é " +"alimentada com dados de forma incremental com chamadas de :meth:" +"`XMLPullParser.feed`. Para obter os elementos XML analisados, chame :meth:" +"`XMLPullParser.read_events`. Aqui está um exemplo::" #: ../../library/xml.etree.elementtree.rst:159 msgid "" @@ -206,6 +211,10 @@ msgid "" "where the XML data is being received from a socket or read incrementally " "from some storage device. In such cases, blocking reads are unacceptable." msgstr "" +"O caso de uso óbvio são aplicações que operam sem bloqueio, onde os dados " +"XML são recebidos de um soquete ou lidos de forma incremental de algum " +"dispositivo de armazenamento. Nesses casos, leituras bloqueantes são " +"inaceitáveis." #: ../../library/xml.etree.elementtree.rst:163 msgid "" @@ -216,6 +225,12 @@ msgid "" "you're reading a large XML document and don't want to hold it wholly in " "memory." msgstr "" +"Por ser tão flexível, :class:`XMLPullParser` pode ser inconveniente de usar " +"em casos de uso mais simples. Se você não se importa que sua aplicação " +"bloqueie a leitura de dados XML, mas ainda assim gostaria de ter recursos de " +"análise incremental, dê uma olhada em :func:`iterparse`. Pode ser útil " +"quando você está lendo um documento XML grande e não deseja mantê-lo " +"totalmente na memória." #: ../../library/xml.etree.elementtree.rst:169 msgid "" @@ -223,10 +238,13 @@ msgid "" "`XMLPullParser.flush` can help reduce delay; please make sure to study the " "related security notes." msgstr "" +"Onde o feedback *imediato* através de eventos é desejado, chamar o método :" +"meth:`XMLPullParser.flush` pode ajudar a reduzir o atraso; certifique-se de " +"estudar as notas de segurança relacionadas." #: ../../library/xml.etree.elementtree.rst:175 msgid "Finding interesting elements" -msgstr "" +msgstr "Encontrando elementos interessantes" #: ../../library/xml.etree.elementtree.rst:177 msgid "" @@ -234,6 +252,9 @@ msgid "" "all the sub-tree below it (its children, their children, and so on). For " "example, :meth:`Element.iter`::" msgstr "" +":class:`Element` possui alguns métodos úteis que ajudam a iterar " +"recursivamente sobre toda a subárvore abaixo dele (seus filhos, seus filhos " +"e assim por diante). Por exemplo, :meth:`Element.iter`::" #: ../../library/xml.etree.elementtree.rst:190 msgid "" @@ -242,22 +263,31 @@ msgid "" "child with a particular tag, and :attr:`Element.text` accesses the element's " "text content. :meth:`Element.get` accesses the element's attributes::" msgstr "" +":meth:`Element.findall` encontra apenas elementos com uma tag que são filhos " +"diretos do elemento atual. :meth:`Element.find` encontra o *primeiro* filho " +"com uma tag específica, e :attr:`Element.text` acessa o conteúdo de texto do " +"elemento. :meth:`Element.get` acessa os atributos do elemento::" #: ../../library/xml.etree.elementtree.rst:204 msgid "" "More sophisticated specification of which elements to look for is possible " "by using :ref:`XPath `." msgstr "" +"Uma especificação mais sofisticada de quais elementos procurar é possível " +"usando :ref:`XPath `." #: ../../library/xml.etree.elementtree.rst:208 msgid "Modifying an XML File" -msgstr "" +msgstr "Modificando um arquivo XML" #: ../../library/xml.etree.elementtree.rst:210 msgid "" ":class:`ElementTree` provides a simple way to build XML documents and write " "them to files. The :meth:`ElementTree.write` method serves this purpose." msgstr "" +":class:`ElementTree` fornece uma maneira simples de construir documentos XML " +"e escrevê-los em arquivos. O método :meth:`ElementTree.write` serve para " +"esse propósito." #: ../../library/xml.etree.elementtree.rst:213 msgid "" @@ -266,23 +296,31 @@ msgid "" "attributes (:meth:`Element.set` method), as well as adding new children (for " "example with :meth:`Element.append`)." msgstr "" +"Uma vez criado, um objeto :class:`Element` pode ser manipulado alterando " +"diretamente seus campos (como :attr:`Element.text`), adicionando e " +"modificando atributos (método :meth:`Element.set`), bem como como adicionar " +"novos filhos (por exemplo, com :meth:`Element.append`)." #: ../../library/xml.etree.elementtree.rst:218 msgid "" "Let's say we want to add one to each country's rank, and add an ``updated`` " "attribute to the rank element::" msgstr "" +"Digamos que queremos adicionar um à classificação de cada país e adicionar " +"um atributo ``updated`` ao elemento de classificação::" #: ../../library/xml.etree.elementtree.rst:228 #: ../../library/xml.etree.elementtree.rst:272 msgid "Our XML now looks like this:" -msgstr "" +msgstr "Nosso XML agora se parece com isto:" #: ../../library/xml.etree.elementtree.rst:256 msgid "" "We can remove elements using :meth:`Element.remove`. Let's say we want to " "remove all countries with a rank higher than 50::" msgstr "" +"Podemos remover elementos usando :meth:`Element.remove`. Digamos que " +"queremos remover todos os países com classificação superior a 50::" #: ../../library/xml.etree.elementtree.rst:267 msgid "" @@ -291,20 +329,26 @@ msgid "" "example first collects all matching elements with ``root.findall()``, and " "only then iterates over the list of matches." msgstr "" +"Observe que a modificação simultânea durante a iteração pode levar a " +"problemas, assim como ao iterar e modificar listas ou dicionários do Python. " +"Portanto, o exemplo primeiro coleta todos os elementos correspondentes com " +"``root.findall()``, e só então itera sobre a lista de correspondências." #: ../../library/xml.etree.elementtree.rst:294 msgid "Building XML documents" -msgstr "" +msgstr "Construindo documentos XML" #: ../../library/xml.etree.elementtree.rst:296 msgid "" "The :func:`SubElement` function also provides a convenient way to create new " "sub-elements for a given element::" msgstr "" +"A função :func:`SubElement` também fornece uma maneira conveniente de criar " +"novos subelementos para um determinado elemento::" #: ../../library/xml.etree.elementtree.rst:307 msgid "Parsing XML with Namespaces" -msgstr "" +msgstr "Analisando XML com espaços de nomes" #: ../../library/xml.etree.elementtree.rst:309 msgid "" @@ -315,12 +359,20 @@ msgid "" "TR/xml-names/#defaulting>`__, that full URI gets prepended to all of the non-" "prefixed tags." msgstr "" +"Se a entrada XML tiver `espaços de nomes `__, tags e atributos com prefixos no formato ``prefixo:" +"algumatag`` serão expandidos para ``{uri}algumatag`` onde *prefixo* é " +"substituído pelo *URI* completo. Além disso, se houver um `espaço de nomes " +"padrão `__, esse URI completo " +"será anexado a todas as tags não prefixadas." #: ../../library/xml.etree.elementtree.rst:317 msgid "" "Here is an XML example that incorporates two namespaces, one with the prefix " "\"fictional\" and the other serving as the default namespace:" msgstr "" +"Aqui está um exemplo XML que incorpora dois espaços de nomes, um com o " +"prefixo \"fictional\" e outro servindo como espaço de nomes padrão:" #: ../../library/xml.etree.elementtree.rst:338 msgid "" @@ -328,20 +380,25 @@ msgid "" "every tag or attribute in the xpath of a :meth:`~Element.find` or :meth:" "`~Element.findall`::" msgstr "" +"Uma maneira de pesquisar e explorar este exemplo XML é adicionar manualmente " +"o URI a cada tag ou atributo no xpath de um :meth:`~Element.find` ou :meth:" +"`~Element.findall`::" #: ../../library/xml.etree.elementtree.rst:349 msgid "" "A better way to search the namespaced XML example is to create a dictionary " "with your own prefixes and use those in the search functions::" msgstr "" +"A melhor maneira de pesquisar o exemplo XML com espaço de nomes é criar um " +"dicionário com seus próprios prefixos e usá-los nas funções de pesquisa::" #: ../../library/xml.etree.elementtree.rst:361 msgid "These two approaches both output::" -msgstr "" +msgstr "Essas duas abordagens resultam no seguinte::" #: ../../library/xml.etree.elementtree.rst:375 msgid "XPath support" -msgstr "" +msgstr "Suporte a XPath" #: ../../library/xml.etree.elementtree.rst:377 msgid "" @@ -350,6 +407,10 @@ msgid "" "small subset of the abbreviated syntax; a full XPath engine is outside the " "scope of the module." msgstr "" +"Este módulo fornece suporte limitado para `expressões XPath `_ para localizar elementos em uma árvore. O objetivo é " +"oferecer suporte a um pequeno subconjunto da sintaxe abreviada; um mecanismo " +"XPath completo está fora do escopo do módulo." #: ../../library/xml.etree.elementtree.rst:383 #: ../../library/xml.etree.elementtree.rst:777 @@ -362,12 +423,17 @@ msgid "" "module. We'll be using the ``countrydata`` XML document from the :ref:" "`Parsing XML ` section::" msgstr "" +"Aqui está um exemplo que demonstra alguns dos recursos XPath do módulo. " +"Estaremos usando o documento XML ``countrydata`` da seção :ref:`Analisando " +"XML `::" #: ../../library/xml.etree.elementtree.rst:409 msgid "" "For XML with namespaces, use the usual qualified ``{namespace}tag`` " "notation::" msgstr "" +"Para XML com espaços de nomes, use a notação qualificada usual ``{espaço-de-" +"nomes}tag``::" #: ../../library/xml.etree.elementtree.rst:416 msgid "Supported XPath syntax" diff --git a/library/xml.po b/library/xml.po index 68bcde817..a767ac322 100644 --- a/library/xml.po +++ b/library/xml.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.sax.handler.po b/library/xml.sax.handler.po index 62fc2955e..5017def72 100644 --- a/library/xml.sax.handler.po +++ b/library/xml.sax.handler.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Hemílio Lauro , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.sax.po b/library/xml.sax.po index 02360d868..f02912dcf 100644 --- a/library/xml.sax.po +++ b/library/xml.sax.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.sax.reader.po b/library/xml.sax.reader.po index 87f6b9f6c..6ed49380d 100644 --- a/library/xml.sax.reader.po +++ b/library/xml.sax.reader.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po index 5be291dcb..0de3f8dfc 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index c45d6139d..10587c5f6 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Julio Biason, 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xmlrpc.po b/library/xmlrpc.po index e93d39b00..0ac906274 100644 --- a/library/xmlrpc.po +++ b/library/xmlrpc.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index 35fd05b0d..5efe527c5 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -18,16 +18,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/xmlrpc.server.rst:2 msgid ":mod:`!xmlrpc.server` --- Basic XML-RPC servers" -msgstr "" +msgstr ":mod:`!xmlrpc.server` --- Servidores XML-RPC básicos" #: ../../library/xmlrpc.server.rst:10 msgid "**Source code:** :source:`Lib/xmlrpc/server.py`" diff --git a/library/zipapp.po b/library/zipapp.po index d02a3c78a..58940c3a3 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: i17obot , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/zipfile.po b/library/zipfile.po index c6f6e86ba..88f88e5ed 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -23,16 +23,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/zipfile.rst:2 msgid ":mod:`!zipfile` --- Work with ZIP archives" -msgstr "" +msgstr ":mod:`!zipfile` --- Trabalha com arquivos ZIP" #: ../../library/zipfile.rst:10 msgid "**Source code:** :source:`Lib/zipfile/`" @@ -48,7 +48,7 @@ msgstr "" "O formato de arquivo ZIP é um padrão de compactação e arquivamento. Este " "módulo fornece ferramentas para criar, ler, escrever, adicionar, e listar um " "arquivo ZIP. Qualquer uso avançado deste módulo vai exigir um entendimento " -"do formato, como definido em `PKZIP Application Note`_." +"do formato, como definido nas `Notas de Aplicação do PKZIP`_." #: ../../library/zipfile.rst:19 msgid "" @@ -136,9 +136,9 @@ msgid "" "number, otherwise returns ``False``. *filename* may be a file or file-like " "object too." msgstr "" -"Retorna ``True`` se *filename* é um arquivo ZIP válido baseado no seu magic " -"number, caso contrário retorna ``False``. *filename* pode ser um arquivo ou " -"um objeto arquivo ou similar também." +"Retorna ``True`` se *filename* é um arquivo ZIP válido baseado no seu " +"\"magic number\", caso contrário retorna ``False``. *filename* pode ser um " +"arquivo ou um objeto arquivo ou similar também." #: ../../library/zipfile.rst:87 msgid "Support for file and file-like objects." @@ -188,7 +188,7 @@ msgstr "" #: ../../library/zipfile.rst:127 msgid "`PKZIP Application Note`_" -msgstr "`PKZIP Notas da Aplicação`_" +msgstr "`Notas da Aplicação do PKZIP`_" #: ../../library/zipfile.rst:128 msgid "" @@ -500,7 +500,7 @@ msgid "" "as the *name* parameter." msgstr "" "Ao gravar um arquivo, se o tamanho do arquivo não é conhecido mas pode " -"exceder 2 Gb, passe ``force_zip64=True`` para assegurar que o formato do " +"exceder 2 GiB, passe ``force_zip64=True`` para assegurar que o formato do " "header é capaz de suportar arquivos grandes. Se o tamanho do arquivo é " "conhecido, construa um objeto :class:`ZipInfo` com :attr:`~ZipInfo." "file_size` informado, então use-o como parâmetro *name*." diff --git a/library/zipimport.po b/library/zipimport.po index 00d19f3e4..e8aa8ee2e 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Vinicius Gubiani Ferreira , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -84,7 +84,7 @@ msgstr "" #: ../../library/zipimport.rst:42 msgid ":pep:`273` - Import Modules from Zip Archives" -msgstr ":pep:`273` - Importar módulos de arquivos Zip" +msgstr ":pep:`273` - Import Modules from Zip Archives" #: ../../library/zipimport.rst:43 msgid "" @@ -204,7 +204,7 @@ msgstr "" #: ../../library/zipimport.rst:150 msgid "Use :meth:`exec_module` instead." -msgstr "" +msgstr "Use :meth:`exec_module`." #: ../../library/zipimport.rst:155 msgid "" diff --git a/library/zlib.po b/library/zlib.po index 1f1a74e0a..0b9907868 100644 --- a/library/zlib.po +++ b/library/zlib.po @@ -20,16 +20,16 @@ msgstr "" "2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/zlib.rst:2 msgid ":mod:`!zlib` --- Compression compatible with :program:`gzip`" -msgstr "" +msgstr ":mod:`!zlib` --- Compactação compatível com :program:`gzip`" #: ../../library/zlib.rst:10 msgid "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 09714c83c..6de225eed 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 9853557df..e350b936c 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -26,10 +26,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -117,10 +117,11 @@ msgid "" "keyword:`if` statements to be indented)." msgstr "" "Note que instruções sempre terminam em uma ``NEWLINE`` possivelmente seguida " -"por uma ``DEDENT``. Note também que cláusulas de continuação sempre começam " -"com uma palavra reservada que não pode iniciar uma instrução, desta forma " -"não há ambiguidades (o problema do \":keyword:`else` pendurado\" é resolvido " -"em Python obrigando que instruções :keyword:`if` aninhadas tenham indentação)" +"por uma ``DEDENT``. Note também que cláusulas opcionais de continuação " +"sempre começam com uma palavra reservada que não pode iniciar uma instrução, " +"desta forma não há ambiguidades (o problema do \":keyword:`else` pendurado\" " +"é resolvido em Python obrigando que instruções :keyword:`if` aninhadas " +"tenham indentação)" #: ../../reference/compound_stmts.rst:75 msgid "" @@ -407,7 +408,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:334 msgid ":keyword:`!except*` clause" -msgstr "" +msgstr "Cláusula :keyword:`!except*`" #: ../../reference/compound_stmts.rst:336 msgid "" @@ -421,6 +422,15 @@ msgid "" "in the group is handled by at most one :keyword:`!except*` clause, the first " "that matches it. ::" msgstr "" +"As cláusulas :keyword:`!except*` são usadas para manipular :exc:" +"`ExceptionGroup`\\s. O tipo de exceção para correspondência é interpretado " +"como no caso de :keyword:`except`, mas no caso de grupos de exceção, podemos " +"ter correspondências parciais quando o tipo corresponde a algumas das " +"exceções no grupo. Isso significa que várias cláusulas :keyword:`!except*` " +"podem ser executadas, cada uma manipulando parte do grupo de exceções. Cada " +"cláusula é executada no máximo uma vez e manipula um grupo de exceções de " +"todas as exceções correspondentes. Cada exceção no grupo é manipulada por no " +"máximo uma cláusula :keyword:`!except*`, a primeira que corresponde a ela. ::" #: ../../reference/compound_stmts.rst:364 msgid "" @@ -429,6 +439,11 @@ msgid "" "from within the :keyword:`!except*` clauses. If this list contains more than " "one exception to reraise, they are combined into an exception group." msgstr "" +"Quaisquer exceções restantes que não foram manipuladas por nenhuma cláusula :" +"keyword:`!except*` são levantadas novamente no final, junto com todas as " +"exceções que foram levantadas de dentro das cláusulas :keyword:`!except*`. " +"Se esta lista contiver mais de uma exceção para levantar novamente, elas " +"serão combinadas em um grupo de exceções." #: ../../reference/compound_stmts.rst:370 msgid "" @@ -436,6 +451,9 @@ msgid "" "of the :keyword:`!except*` clauses, it is caught and wrapped by an exception " "group with an empty message string. ::" msgstr "" +"Se a exceção levantada não for um grupo de exceções e seu tipo corresponder " +"a uma das cláusulas :keyword:`!except*`, ela será capturada e encapsulada " +"por um grupo de exceções com uma string de mensagem vazia. ::" #: ../../reference/compound_stmts.rst:381 msgid "" @@ -448,7 +466,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:398 msgid ":keyword:`!else` clause" -msgstr "" +msgstr "Cláusula :keyword:`!else`" #: ../../reference/compound_stmts.rst:400 msgid "" @@ -458,10 +476,15 @@ msgid "" "Exceptions in the :keyword:`!else` clause are not handled by the preceding :" "keyword:`except` clauses." msgstr "" +"A cláusula opcional :keyword:`!else` é executada se o fluxo de controle " +"deixar o conjunto :keyword:`try`, nenhuma exceção foi levantada e nenhuma " +"instrução :keyword:`return`, :keyword:`continue` ou :keyword:`break` foi " +"executada. Exceções na cláusula :keyword:`!else` não são manipuladas pelas " +"cláusulas :keyword:`except` precedentes." #: ../../reference/compound_stmts.rst:412 msgid ":keyword:`!finally` clause" -msgstr "" +msgstr "Cláusula :keyword:`!finally`" #: ../../reference/compound_stmts.rst:414 msgid "" @@ -476,12 +499,24 @@ msgid "" "`return`, :keyword:`break` or :keyword:`continue` statement, the saved " "exception is discarded::" msgstr "" +"Se :keyword:`!finally` estiver presente, especifica um manipulador de " +"\"limpeza\". A cláusula :keyword:`try` é executada, incluindo quaisquer " +"cláusulas :keyword:`except` e :keyword:`else`. Se uma exceção ocorrer em " +"qualquer uma das cláusulas e não for manipulada, a exceção será salva " +"temporariamente. A cláusula :keyword:`!finally` é executada. Se houver uma " +"exceção salva, ela será levantada novamente no final da cláusula :keyword:`!" +"finally`. Se a cláusula :keyword:`!finally` levantar outra exceção, a " +"exceção salva será definida como o contexto da nova exceção. Se a cláusula :" +"keyword:`!finally` executar uma instrução :keyword:`return`, :keyword:" +"`break` ou :keyword:`continue`, a exceção salva será descartada::" #: ../../reference/compound_stmts.rst:433 msgid "" "The exception information is not available to the program during execution " "of the :keyword:`!finally` clause." msgstr "" +"As informações de exceção não estão disponíveis para o programa durante a " +"execução da cláusula :keyword:`!finally`." #: ../../reference/compound_stmts.rst:441 msgid "" @@ -490,6 +525,10 @@ msgid "" "finally` statement, the :keyword:`!finally` clause is also executed 'on the " "way out.'" msgstr "" +"Quando uma instrução :keyword:`return`, :keyword:`break` ou :keyword:" +"`continue` é executada no conjunto :keyword:`try` de uma instrução :keyword:" +"`!try`...\\ :keyword:`!finally`, a cláusula :keyword:`!finally` também é " +"executada \"na saída\"." #: ../../reference/compound_stmts.rst:445 msgid "" @@ -498,16 +537,22 @@ msgid "" "a :keyword:`!return` statement executed in the :keyword:`!finally` clause " "will always be the last one executed::" msgstr "" +"O valor de retorno de uma função é determinado pela última instrução :" +"keyword:`return` executada. Como a cláusula :keyword:`!finally` sempre é " +"executada, uma instrução :keyword:`!return` executada na cláusula :keyword:`!" +"finally` sempre será a última executada::" #: ../../reference/compound_stmts.rst:459 msgid "" "Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" "keyword:`!finally` clause due to a problem with the implementation." msgstr "" +"Antes do Python 3.8, uma instrução :keyword:`continue` era ilegal na " +"cláusula :keyword:`!finally` devido a um problema com a implementação." #: ../../reference/compound_stmts.rst:468 msgid "The :keyword:`!with` statement" -msgstr "" +msgstr "A instrução :keyword:`!with`" #: ../../reference/compound_stmts.rst:477 msgid "" @@ -516,37 +561,53 @@ msgid "" "This allows common :keyword:`try`...\\ :keyword:`except`...\\ :keyword:" "`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" +"A instrução :keyword:`with` é usada para envolver em um invólucro a execução " +"de um bloco com métodos definidos por um gerenciador de contexto (veja a " +"seção :ref:`context-managers`). Isso permite que padrões comuns de uso de :" +"keyword:`try`...\\ :keyword:`except`...\\ :keyword:`finally` sejam " +"encapsulados para reutilização conveniente." #: ../../reference/compound_stmts.rst:487 msgid "" "The execution of the :keyword:`with` statement with one \"item\" proceeds as " "follows:" msgstr "" +"A execução da instrução :keyword:`with` com um \"item\" ocorre da seguinte " +"maneira:" #: ../../reference/compound_stmts.rst:489 msgid "" "The context expression (the expression given in the :token:`~python-grammar:" "with_item`) is evaluated to obtain a context manager." msgstr "" +"A expressão de contexto (a expressão fornecida em :token:`~python-grammar:" +"with_item`) é avaliada para obter um gerenciador de contexto." #: ../../reference/compound_stmts.rst:492 msgid "" "The context manager's :meth:`~object.__enter__` is loaded for later use." msgstr "" +"O :meth:`~object.__enter__` do gerenciador de contexto é carregado para uso " +"posterior." #: ../../reference/compound_stmts.rst:494 msgid "The context manager's :meth:`~object.__exit__` is loaded for later use." msgstr "" +"O :meth:`~object.__exit__` do gerenciador de contexto é carregado para uso " +"posterior." #: ../../reference/compound_stmts.rst:496 msgid "The context manager's :meth:`~object.__enter__` method is invoked." msgstr "" +"O método :meth:`~object.__enter__` do gerenciador de contexto é invocado." #: ../../reference/compound_stmts.rst:498 msgid "" "If a target was included in the :keyword:`with` statement, the return value " "from :meth:`~object.__enter__` is assigned to it." msgstr "" +"Se um alvo foi incluído na instrução :keyword:`with`, o valor de retorno de :" +"meth:`~object.__enter__` é atribuído a ele." #: ../../reference/compound_stmts.rst:503 msgid "" @@ -556,10 +617,15 @@ msgid "" "target list, it will be treated the same as an error occurring within the " "suite would be. See step 7 below." msgstr "" +"A instrução :keyword:`with` garante que se o método :meth:`~object." +"__enter__` retornar sem um erro, então :meth:`~object.__exit__` sempre será " +"chamado. Assim, se ocorrer um erro durante a atribuição à lista de alvos, " +"ele será tratado da mesma forma que um erro ocorrendo dentro do conjunto " +"seria. Veja a etapa 7 abaixo." #: ../../reference/compound_stmts.rst:509 msgid "The suite is executed." -msgstr "" +msgstr "O conjunto é executado." #: ../../reference/compound_stmts.rst:511 msgid "" @@ -568,6 +634,10 @@ msgid "" "passed as arguments to :meth:`~object.__exit__`. Otherwise, three :const:" "`None` arguments are supplied." msgstr "" +"O método :meth:`~object.__exit__` do gerenciador de contexto é invocado. Se " +"uma exceção fez com que o conjunto fosse encerrado, seu tipo, valor e " +"traceback são passados ​​como argumentos para :meth:`~object.__exit__`. Caso " +"contrário, três argumentos :const:`None` são fornecidos." #: ../../reference/compound_stmts.rst:516 msgid "" @@ -576,6 +646,10 @@ msgid "" "return value was true, the exception is suppressed, and execution continues " "with the statement following the :keyword:`with` statement." msgstr "" +"Se o conjunto foi encerrado devido a uma exceção, e o valor de retorno do " +"método :meth:`~object.__exit__` foi falso, a exceção é levantada novamente. " +"Se o valor de retorno era verdadeiro, a exceção é suprimida, e a execução " +"continua com a instrução após a instrução :keyword:`with`." #: ../../reference/compound_stmts.rst:521 msgid "" @@ -583,40 +657,49 @@ msgid "" "value from :meth:`~object.__exit__` is ignored, and execution proceeds at " "the normal location for the kind of exit that was taken." msgstr "" +"Se o conjunto foi encerrado por qualquer motivo diferente de uma exceção, o " +"valor de retorno de :meth:`~object.__exit__` é ignorado e a execução " +"prossegue no local normal para o tipo de saída que foi realizada." #: ../../reference/compound_stmts.rst:525 #: ../../reference/compound_stmts.rst:1540 #: ../../reference/compound_stmts.rst:1581 msgid "The following code::" -msgstr "" +msgstr "O seguinte código::" #: ../../reference/compound_stmts.rst:530 #: ../../reference/compound_stmts.rst:555 #: ../../reference/compound_stmts.rst:1586 msgid "is semantically equivalent to::" -msgstr "" +msgstr "é semanticamente equivalente a::" #: ../../reference/compound_stmts.rst:549 msgid "" "With more than one item, the context managers are processed as if multiple :" "keyword:`with` statements were nested::" msgstr "" +"Com mais de um item, os gerenciadores de contexto são processados ​​como se " +"várias instruções :keyword:`with` estivessem aninhadas::" #: ../../reference/compound_stmts.rst:561 msgid "" "You can also write multi-item context managers in multiple lines if the " "items are surrounded by parentheses. For example::" msgstr "" +"Você também pode escrever gerenciadores de contexto multi-item em várias " +"linhas se os itens estiverem entre parênteses. Por exemplo::" #: ../../reference/compound_stmts.rst:570 msgid "Support for multiple context expressions." -msgstr "" +msgstr "Suporte para múltiplas expressões de contexto." #: ../../reference/compound_stmts.rst:573 msgid "" "Support for using grouping parentheses to break the statement in multiple " "lines." msgstr "" +"Suporte para usar parênteses de agrupamento para dividir a instrução em " +"várias linhas." #: ../../reference/compound_stmts.rst:578 msgid ":pep:`343` - The \"with\" statement" @@ -632,17 +715,19 @@ msgstr "" #: ../../reference/compound_stmts.rst:585 msgid "The :keyword:`!match` statement" -msgstr "" +msgstr "A instrução :keyword:`!match`" #: ../../reference/compound_stmts.rst:599 msgid "The match statement is used for pattern matching. Syntax:" -msgstr "" +msgstr "A instrução match é usada para correspondência de padrões. Sintaxe:" #: ../../reference/compound_stmts.rst:608 msgid "" "This section uses single quotes to denote :ref:`soft keywords `." msgstr "" +"Esta seção usa aspas simples para denotar :ref:`palavras reservadas " +"contextuais `." #: ../../reference/compound_stmts.rst:611 msgid "" @@ -650,21 +735,30 @@ msgid "" "value (following ``match``). The pattern (which may contain subpatterns) is " "matched against the subject value. The outcomes are:" msgstr "" +"A correspondência de padrões aceita um padrão como entrada (seguindo " +"``case``) e um valor de sujeito (seguindo ``match``). O padrão (que pode " +"conter subpadrões) é correspondido ao valor de assunto. Os resultados são:" #: ../../reference/compound_stmts.rst:615 msgid "A match success or failure (also termed a pattern success or failure)." msgstr "" +"Um sucesso ou falha de correspondência (também chamado de sucesso ou falha " +"de padrão)." #: ../../reference/compound_stmts.rst:617 msgid "" "Possible binding of matched values to a name. The prerequisites for this " "are further discussed below." msgstr "" +"Possível vinculação de valores correspondentes a um nome. Os pré-requisitos " +"para isso são discutidos mais adiante." #: ../../reference/compound_stmts.rst:620 msgid "" "The ``match`` and ``case`` keywords are :ref:`soft keywords `." msgstr "" +"As palavras reservadas ``match`` e ``case`` são :ref:`palavras reservadas " +"contextuais `." #: ../../reference/compound_stmts.rst:624 #: ../../reference/compound_stmts.rst:1181 @@ -674,7 +768,7 @@ msgstr ":pep:`634` -- Structural Pattern Matching: Specification" #: ../../reference/compound_stmts.rst:625 #: ../../reference/compound_stmts.rst:1182 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" -msgstr "" +msgstr ":pep:`636` -- Correspondência de padrões estruturais: Tutorial" #: ../../reference/compound_stmts.rst:629 msgid "Overview" @@ -682,7 +776,7 @@ msgstr "Visão Geral" #: ../../reference/compound_stmts.rst:631 msgid "Here's an overview of the logical flow of a match statement:" -msgstr "" +msgstr "Aqui está uma visão geral do fluxo lógico de uma instrução match:" #: ../../reference/compound_stmts.rst:634 msgid "" @@ -690,6 +784,9 @@ msgid "" "value obtained. If the subject expression contains a comma, a tuple is " "constructed using :ref:`the standard rules `." msgstr "" +"A expressão de sujeito ``subject_expr`` é avaliada e um valor de sujeito " +"resultante é obtido. Se a expressão de sujeito contiver uma vírgula, uma " +"tupla é construída usando :ref:`as regras padrão `." #: ../../reference/compound_stmts.rst:638 msgid "" @@ -700,6 +797,13 @@ msgid "" "specified below. **Name bindings made during a successful pattern match " "outlive the executed block and can be used after the match statement**." msgstr "" +"Cada padrão em um ``case_block`` é tentado para corresponder ao valor de " +"sujeito. As regras específicas para sucesso ou falha são descritas abaixo. A " +"tentativa de correspondência também pode vincular alguns ou todos os nomes " +"autônomos dentro do padrão. As regras precisas de vinculação de padrão " +"variam por tipo de padrão e são especificadas abaixo. **As vinculações de " +"nome feitas durante uma correspondência de padrão bem-sucedida sobrevivem ao " +"bloco executado e podem ser usadas após a instrução match**." #: ../../reference/compound_stmts.rst:647 msgid "" @@ -709,26 +813,39 @@ msgid "" "dependent on implementation and may vary. This is an intentional decision " "made to allow different implementations to add optimizations." msgstr "" +"Durante correspondências de padrões com falha, alguns subpadrões podem ter " +"sucesso. Não confie em vinculações sendo feitas para uma correspondência com " +"falha. Por outro lado, não confie em variáveis ​​permanecendo inalteradas após " +"uma correspondência com falha. O comportamento exato depende da " +"implementação e pode variar. Esta é uma decisão intencional feita para " +"permitir que diferentes implementações adicionem otimizações." #: ../../reference/compound_stmts.rst:654 msgid "" "If the pattern succeeds, the corresponding guard (if present) is evaluated. " "In this case all name bindings are guaranteed to have happened." msgstr "" +"Se o padrão for bem-sucedido, o *guard* correspondente (se presente) é " +"avaliado. Neste caso, todas as vinculações de nome são garantidas como tendo " +"acontecido." #: ../../reference/compound_stmts.rst:657 msgid "" "If the guard evaluates as true or is missing, the ``block`` inside " "``case_block`` is executed." msgstr "" +"Se o *guard* for avaliado como verdadeiro ou estiver ausente, o ``block`` " +"dentro de ``case_block`` será executado." #: ../../reference/compound_stmts.rst:660 msgid "Otherwise, the next ``case_block`` is attempted as described above." msgstr "" +"Caso contrário, o próximo ``case_block`` será tentado conforme descrito " +"acima." #: ../../reference/compound_stmts.rst:662 msgid "If there are no further case blocks, the match statement is completed." -msgstr "" +msgstr "Se não houver mais blocos de caso, a instrução match será concluída." #: ../../reference/compound_stmts.rst:666 msgid "" @@ -736,20 +853,24 @@ msgid "" "on implementation, the interpreter may cache values or use other " "optimizations which skip repeated evaluations." msgstr "" +"Os usuários geralmente nunca devem confiar em um padrão sendo avaliado. " +"Dependendo da implementação, o interpretador pode armazenar valores em cache " +"ou usar outras otimizações que pulam avaliações repetidas." #: ../../reference/compound_stmts.rst:670 msgid "A sample match statement::" -msgstr "" +msgstr "Um exemplo de instrução match::" #: ../../reference/compound_stmts.rst:686 msgid "" "In this case, ``if flag`` is a guard. Read more about that in the next " "section." msgstr "" +"Neste caso, ``if flag`` é um *guard*. Leia mais sobre isso na próxima seção." #: ../../reference/compound_stmts.rst:689 msgid "Guards" -msgstr "" +msgstr "Guards" #: ../../reference/compound_stmts.rst:696 msgid "" @@ -757,10 +878,13 @@ msgid "" "``case`` block to execute. It takes the form: :keyword:`if` followed by an " "expression." msgstr "" +"Um ``guard`` (que faz parte do ``case``) deve ter sucesso para que o código " +"dentro do bloco ``case`` seja executado. Ele assume a forma: :keyword:`if` " +"seguido por uma expressão." #: ../../reference/compound_stmts.rst:701 msgid "The logical flow of a ``case`` block with a ``guard`` follows:" -msgstr "" +msgstr "O fluxo lógico de um bloco ``case`` com um ``guard`` é o seguinte:" #: ../../reference/compound_stmts.rst:703 msgid "" @@ -768,27 +892,34 @@ msgid "" "failed, the ``guard`` is not evaluated and the next ``case`` block is " "checked." msgstr "" +"Verifique se o padrão no bloco ``case`` foi bem-sucedido. Se o padrão " +"falhou, o ``guard`` não é avaliado e o próximo bloco ``case`` é verificado." #: ../../reference/compound_stmts.rst:707 msgid "If the pattern succeeded, evaluate the ``guard``." -msgstr "" +msgstr "Se o padrão for bem-sucedido, avalia o ``guard``." #: ../../reference/compound_stmts.rst:709 msgid "" "If the ``guard`` condition evaluates as true, the case block is selected." msgstr "" +"Se a condição ``guard`` for avaliada como verdadeira, o bloco de caso será " +"selecionado." #: ../../reference/compound_stmts.rst:712 msgid "" "If the ``guard`` condition evaluates as false, the case block is not " "selected." msgstr "" +"Se a condição ``guard`` for avaliada como falsa, o bloco de caso não será " +"selecionado." #: ../../reference/compound_stmts.rst:715 msgid "" "If the ``guard`` raises an exception during evaluation, the exception " "bubbles up." msgstr "" +"Se o ``guard`` levantar uma exceção durante a avaliação, a exceção surgirá." #: ../../reference/compound_stmts.rst:718 msgid "" @@ -798,16 +929,24 @@ msgid "" "evaluation must happen in order.) Guard evaluation must stop once a case " "block is selected." msgstr "" +"Guards podem ter efeitos colaterais, pois são expressões. A avaliação de " +"guards deve prosseguir do primeiro ao último bloco de caso, um de cada vez, " +"pulando blocos de caso cujos padrões não são todos bem-sucedidos. (Isto é, a " +"avaliação de guardas deve acontecer em ordem.) A avaliação de guards deve " +"parar quando um bloco de caso for selecionado." #: ../../reference/compound_stmts.rst:728 msgid "Irrefutable Case Blocks" -msgstr "" +msgstr "Blocos irrefutáveis de case" #: ../../reference/compound_stmts.rst:732 msgid "" "An irrefutable case block is a match-all case block. A match statement may " "have at most one irrefutable case block, and it must be last." msgstr "" +"Um bloco irrefutável de case é um bloco de case que corresponde a qualquer " +"valor. Uma instrução match pode ter no máximo um bloco irrefutável de case, " +"e ele deve ser o último." #: ../../reference/compound_stmts.rst:735 msgid "" @@ -816,42 +955,47 @@ msgid "" "syntax alone that it will always succeed. Only the following patterns are " "irrefutable:" msgstr "" +"Um bloco de case é considerado irrefutável se não tiver guard e seu padrão " +"for irrefutável. Um padrão é considerado irrefutável se pudermos provar " +"somente por sua sintaxe que ele sempre terá sucesso. Somente os seguintes " +"padrões são irrefutáveis:" #: ../../reference/compound_stmts.rst:740 msgid ":ref:`as-patterns` whose left-hand side is irrefutable" -msgstr "" +msgstr ":ref:`as-patterns` cujo lado esquerdo é irrefutável" #: ../../reference/compound_stmts.rst:742 msgid ":ref:`or-patterns` containing at least one irrefutable pattern" -msgstr "" +msgstr ":ref:`or-patterns` contendo pelo menos um padrão irrefutável" #: ../../reference/compound_stmts.rst:744 msgid ":ref:`capture-patterns`" -msgstr "" +msgstr ":ref:`capture-patterns`" #: ../../reference/compound_stmts.rst:746 msgid ":ref:`wildcard-patterns`" -msgstr "" +msgstr ":ref:`wildcard-patterns`" #: ../../reference/compound_stmts.rst:748 msgid "parenthesized irrefutable patterns" -msgstr "" +msgstr "padrões irrefutáveis entre parêteses" #: ../../reference/compound_stmts.rst:752 msgid "Patterns" -msgstr "" +msgstr "Padrões" #: ../../reference/compound_stmts.rst:759 msgid "This section uses grammar notations beyond standard EBNF:" -msgstr "" +msgstr "Esta seção usa notações de gramática para além do padrão de EBNF:" #: ../../reference/compound_stmts.rst:761 msgid "the notation ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``" -msgstr "" +msgstr "a notação ``SEP.RULE+`` é uma abreviação para ``RULE (SEP RULE)*``" #: ../../reference/compound_stmts.rst:763 msgid "the notation ``!RULE`` is shorthand for a negative lookahead assertion" msgstr "" +"a notação ``!RULE`` é uma abreviação para uma asserção de negação antecipada." #: ../../reference/compound_stmts.rst:766 msgid "The top-level syntax for ``patterns`` is:" @@ -1644,7 +1788,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:1360 msgid ":pep:`484` - Type Hints" -msgstr ":pep:`484` - Dicas de tipos" +msgstr ":pep:`484` - Dicas de tipo" #: ../../reference/compound_stmts.rst:1361 msgid "Definition of a standard meaning for annotations: type hints." @@ -1699,7 +1843,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:1409 msgid "is equivalent to ::" -msgstr "é equivalente a::" +msgstr "é equivalente a ::" #: ../../reference/compound_stmts.rst:1414 msgid "" @@ -1792,7 +1936,7 @@ msgstr "Corrotinas" #: ../../reference/compound_stmts.rst:1494 msgid "Coroutine function definition" -msgstr "" +msgstr "Definição de função de corrotina" #: ../../reference/compound_stmts.rst:1504 msgid "" @@ -2119,7 +2263,7 @@ msgstr "" #: ../../reference/compound_stmts.rst:1854 msgid ":class:`array.array`" -msgstr "" +msgstr ":class:`array.array`" #: ../../reference/compound_stmts.rst:1855 msgid ":class:`collections.deque`" @@ -2127,11 +2271,11 @@ msgstr ":class:`collections.deque`" #: ../../reference/compound_stmts.rst:1857 msgid ":class:`memoryview`" -msgstr "" +msgstr ":class:`memoryview`" #: ../../reference/compound_stmts.rst:1858 msgid ":class:`range`" -msgstr "" +msgstr ":class:`range`" #: ../../reference/compound_stmts.rst:1861 msgid "" @@ -2460,7 +2604,7 @@ msgstr "nome" #: ../../reference/compound_stmts.rst:1194 #: ../../reference/compound_stmts.rst:1380 msgid "binding" -msgstr "vinculação" +msgstr "vinculação; ligação" #: ../../reference/compound_stmts.rst:1194 msgid "user-defined function" @@ -2486,7 +2630,7 @@ msgstr "default" #: ../../reference/compound_stmts.rst:1271 msgid "value" -msgstr "value" +msgstr "valor" #: ../../reference/compound_stmts.rst:1271 msgid "argument" diff --git a/reference/datamodel.po b/reference/datamodel.po index ea50899a2..0b5c74b3f 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -31,10 +31,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -432,7 +432,7 @@ msgid "" msgstr "" "Estes representam números em um intervalo ilimitado, sujeito apenas à " "memória (virtual) disponível. Para o propósito de operações de deslocamento " -"e máscara, uma representação binária é assumida e os números negativos são " +"e máscara, uma representação binária é presumida e os números negativos são " "representados em uma variante do complemento de 2 que dá a ilusão de uma " "string infinita de bits de sinal estendendo-se para a esquerda." @@ -1347,7 +1347,7 @@ msgstr "" #: ../../reference/datamodel.rst:850 msgid "Class Instances" -msgstr "Instâncias de classes" +msgstr "Instâncias de classe" #: ../../reference/datamodel.rst:852 msgid "" @@ -1487,6 +1487,18 @@ msgid "" "common ancestor. Additional details on the C3 MRO used by Python can be " "found at :ref:`python_2.3_mro`." msgstr "" +"Tipos de classe personalizados são tipicamente criados por definições de " +"classe (veja a seção :ref:`class`). Uma classe possui um espaço de nomes " +"implementado por um objeto dicionário. As referências de atributos de classe " +"são traduzidas para pesquisas neste dicionário, por exemplo, ``C.x`` é " +"traduzido para ``C.__dict__[\"x\"]`` (embora haja uma série de ganchos que " +"permitem outros meios de localizar atributos). Quando o nome do atributo não " +"é encontrado lá, a pesquisa do atributo continua nas classes base. Essa " +"pesquisa das classes base usa a ordem de resolução de métodos C3, que se " +"comporta corretamente mesmo na presença de estruturas de herança em losango, " +"onde há vários caminhos de herança que levam de volta a um ancestral comum. " +"Detalhes adicionais sobre a ordem de resolução de métodos (MRO) C3 usado " +"pelo Python podem ser encontrados em :ref:`python_2.3_mro`." #: ../../reference/datamodel.rst:947 msgid "" @@ -1498,6 +1510,14 @@ msgid "" "which attributes retrieved from a class may differ from those actually " "contained in its :attr:`~object.__dict__`." msgstr "" +"Quando uma referência de atributo de classe (para uma classe :class:`!C`, " +"digamos) produziria um objeto método de classe, ele é transformado em um " +"objeto método de instância cujo atributo :attr:`~method.__self__` é :class:`!" +"C`. Quando produziria um objeto :class:`staticmethod`, ele é transformado no " +"objeto encapsulado pelo objeto método estático. Veja a seção :ref:" +"`descriptors` para outra maneira em que os atributos recuperados de uma " +"classe podem diferir daqueles realmente contidos em seu :attr:`~object." +"__dict__`." #: ../../reference/datamodel.rst:958 msgid "" @@ -1602,6 +1622,20 @@ msgid "" "class attribute is found, and the object's class has a :meth:`~object." "__getattr__` method, that is called to satisfy the lookup." msgstr "" +"Uma instância de classe é criada chamando um objeto classe (veja acima). Uma " +"instância de classe tem um espaço de nomes implementado como um dicionário " +"que é o primeiro lugar no qual as referências de atributos são pesquisadas. " +"Quando um atributo não é encontrado lá, e a classe da instância possui um " +"atributo com esse nome, a pesquisa continua com os atributos da classe. Se " +"for encontrado um atributo de classe que seja um objeto função definido pelo " +"usuário, ele é transformado em um objeto método de instância cujo atributo :" +"attr:`~method.__self__` é a instância. Métodos estáticos e métodos de classe " +"também são transformados; veja acima em \"Classes\". Veja a seção :ref:" +"`descriptors` para outra maneira em que os atributos de uma classe " +"recuperados através de suas instâncias podem diferir dos objetos realmente " +"armazenados no :attr:`~object.__dict__` da classe. Se nenhum atributo de " +"classe for encontrado, e a classe do objeto tiver um método :meth:`~object." +"__getattr__`, este é chamado para satisfazer a pesquisa." #: ../../reference/datamodel.rst:1029 msgid "" @@ -1703,11 +1737,11 @@ msgstr "" #: ../../reference/datamodel.rst:1132 msgid "The function name" -msgstr "" +msgstr "O nome da função" #: ../../reference/datamodel.rst:1135 msgid "The fully qualified function name" -msgstr "" +msgstr "O nome completo da função" #: ../../reference/datamodel.rst:1140 msgid "" @@ -1715,87 +1749,110 @@ msgid "" "positional-only parameters and parameters with default values) that the " "function has" msgstr "" +"O número total de :term:`parâmetros ` posicionais (incluindo " +"parâmetros somente-posicionais e parâmetros com valores padrão) que a função " +"possui" #: ../../reference/datamodel.rst:1145 msgid "" "The number of positional-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" +"O número de :term:`parâmetros ` somente-posicionais (incluindo " +"argumentos com valores padrão) que a função possui" #: ../../reference/datamodel.rst:1149 msgid "" "The number of keyword-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" +"O número de :term:`parâmetros ` somente-nomeados (incluindo " +"argumentos com valores padrão) que a função possui" #: ../../reference/datamodel.rst:1153 msgid "" "The number of :ref:`local variables ` used by the function " "(including parameters)" msgstr "" +"O número de :ref:`variáveis locais ` usadas pela função (incluindo " +"parâmetros)" #: ../../reference/datamodel.rst:1157 msgid "" "A :class:`tuple` containing the names of the local variables in the function " "(starting with the parameter names)" msgstr "" +"Uma :class:`tuple` contendo os nomes das variáveis ​​locais na função " +"(começando com os nomes dos parâmetros)" #: ../../reference/datamodel.rst:1161 msgid "" "A :class:`tuple` containing the names of :ref:`local variables ` " "that are referenced by nested functions inside the function" msgstr "" +"Uma :class:`tuple` contendo os nomes de :ref:`variáveis ​​locais ` que " +"são referenciadas por funções aninhadas dentro da função" #: ../../reference/datamodel.rst:1165 msgid "A :class:`tuple` containing the names of free variables in the function" -msgstr "" +msgstr "Uma :class:`tuple` contendo os nomes das variáveis ​​livres na função" #: ../../reference/datamodel.rst:1168 msgid "" "A string representing the sequence of :term:`bytecode` instructions in the " "function" msgstr "" +"Uma string representando a sequência de instruções :term:`bytecode` na função" #: ../../reference/datamodel.rst:1172 msgid "" "A :class:`tuple` containing the literals used by the :term:`bytecode` in the " "function" msgstr "" +"Um :class:`tuple` contendo os literais usados ​​pelo :term:`bytecode` na função" #: ../../reference/datamodel.rst:1176 msgid "" "A :class:`tuple` containing the names used by the :term:`bytecode` in the " "function" msgstr "" +"Um :class:`tuple` contendo os nomes usados ​​pelo :term:`bytecode` na função" #: ../../reference/datamodel.rst:1180 msgid "The name of the file from which the code was compiled" -msgstr "" +msgstr "O nome do arquivo do qual o código foi compilado" #: ../../reference/datamodel.rst:1183 msgid "The line number of the first line of the function" -msgstr "" +msgstr "O número da linha da primeira linha da função" #: ../../reference/datamodel.rst:1186 msgid "" "A string encoding the mapping from :term:`bytecode` offsets to line numbers. " "For details, see the source code of the interpreter." msgstr "" +"Uma string que codifica o mapeamento de :term:`bytecode` compensa para " +"números de linha. Para obter detalhes, consulte o código-fonte do " +"interpretador." #: ../../reference/datamodel.rst:1189 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " "3.14." msgstr "" +"Este atributo de objetos código está descontinuado e pode ser removido no " +"Python 3.14." #: ../../reference/datamodel.rst:1194 msgid "The required stack size of the code object" -msgstr "" +msgstr "O tamanho de pilha necessário do objeto código" #: ../../reference/datamodel.rst:1197 msgid "" "An :class:`integer ` encoding a number of flags for the interpreter." msgstr "" +"Um número :class:`inteiro ` codificando uma série de sinalizadores para " +"o interpretador." #: ../../reference/datamodel.rst:1202 msgid "" @@ -1807,6 +1864,13 @@ msgid "" "`inspect-module-co-flags` for details on the semantics of each flags that " "might be present." msgstr "" +"Os seguintes bits sinalizadores são definidos para :attr:`~codeobject." +"co_flags`: o bit ``0x04`` é definido se a função usa a sintaxe " +"``*arguments`` para aceitar um número arbitrário de argumentos posicionais; " +"o bit ``0x08`` é definido se a função usa a sintaxe ``**keywords`` para " +"aceitar argumentos nomeados arbitrários; o bit ``0x20`` é definido se a " +"função for um gerador. Veja :ref:`inspect-module-co-flags` para detalhes na " +"semântica de cada sinalizadores que podem estar presentes." #: ../../reference/datamodel.rst:1210 msgid "" @@ -1816,11 +1880,17 @@ msgid "" "function was compiled with future division enabled; bits ``0x10`` and " "``0x1000`` were used in earlier versions of Python." msgstr "" +"Declarações de recursos futuros (``from __future__ import division``) também " +"usam bits em :attr:`~codeobject.co_flags` para indicar se um objeto código " +"foi compilado com um recurso específico habilitado: o bit ``0x2000`` é " +"definido se a função foi compilada com divisão futura habilitada; os bits " +"``0x10`` e ``0x1000`` foram usados em versões anteriores do Python." #: ../../reference/datamodel.rst:1216 msgid "" "Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" +"Outros bits em :attr:`~codeobject.co_flags` são reservados para uso interno." #: ../../reference/datamodel.rst:1220 msgid "" @@ -1828,16 +1898,21 @@ msgid "" "co_consts` is the documentation string of the function, or ``None`` if " "undefined." msgstr "" +"Se um objeto código representa uma função, o primeiro item em :attr:" +"`~codeobject.co_consts` é a string de documentação da função, ou ``None`` se " +"indefinido." #: ../../reference/datamodel.rst:1225 msgid "Methods on code objects" -msgstr "" +msgstr "Métodos de objetos código" #: ../../reference/datamodel.rst:1229 msgid "" "Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" +"Retorna um iterável das posições no código-fonte de cada instrução :term:" +"`bytecode` no objeto código." #: ../../reference/datamodel.rst:1232 msgid "" @@ -1906,18 +1981,25 @@ msgid "" "`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" "`tuple`:" msgstr "" +"Retorna um iterador que produz informações sobre intervalos sucessivos de :" +"term:`bytecode`\\s. Cada item gerado é uma :class:`tuple` de ``(start, end, " +"lineno)``:" #: ../../reference/datamodel.rst:1266 msgid "" "``start`` (an :class:`int`) represents the offset (inclusive) of the start " "of the :term:`bytecode` range" msgstr "" +"``start`` (um :class:`int`) representa o deslocamento (inclusivo) do início " +"do intervalo :term:`bytecode`" #: ../../reference/datamodel.rst:1268 msgid "" "``end`` (an :class:`int`) represents the offset (exclusive) of the end of " "the :term:`bytecode` range" msgstr "" +"``end`` (um :class:`int`) representa o deslocamento (exclusivo) do fim do " +"intervalo :term:`bytecode`" #: ../../reference/datamodel.rst:1270 msgid "" @@ -1925,14 +2007,17 @@ msgid "" "`bytecode` range, or ``None`` if the bytecodes in the given range have no " "line number" msgstr "" +"``lineno`` é um :class:`int` representando o número da linha do intervalo " +"do :term:`bytecode`, ou ``None`` se os bytecodes no intervalo fornecido não " +"tiverem número de linha" #: ../../reference/datamodel.rst:1274 msgid "The items yielded will have the following properties:" -msgstr "" +msgstr "Os itens gerados terão as seguintes propriedades:" #: ../../reference/datamodel.rst:1276 msgid "The first range yielded will have a ``start`` of 0." -msgstr "" +msgstr "O primeiro intervalo gerado terá um ``start`` de 0." #: ../../reference/datamodel.rst:1277 msgid "" @@ -1940,16 +2025,21 @@ msgid "" "for any pair of :class:`tuple`\\s, the ``start`` of the second will be equal " "to the ``end`` of the first." msgstr "" +"Os intervalos ``(start, end)`` serão não decrescentes e consecutivos. Ou " +"seja, para qualquer par de :class:`tuple`\\s, o ``start`` do segundo será " +"igual ao ``end`` do primeiro." #: ../../reference/datamodel.rst:1280 msgid "No range will be backwards: ``end >= start`` for all triples." -msgstr "" +msgstr "Nenhum intervalo será inverso: ``end >= start`` para todos os trios." #: ../../reference/datamodel.rst:1281 msgid "" "The last :class:`tuple` yielded will have ``end`` equal to the size of the :" "term:`bytecode`." msgstr "" +"A última :class:`tuple` gerada terá ``end`` igual ao tamanho do :term:" +"`bytecode`." #: ../../reference/datamodel.rst:1284 msgid "" @@ -1957,14 +2047,18 @@ msgid "" "are used for lines that are present in the source code, but have been " "eliminated by the :term:`bytecode` compiler." msgstr "" +"Intervalos de largura zero, onde ``start == end``, são permitidos. " +"Intervalos de largura zero são usados ​​para linhas que estão presentes no " +"código-fonte, mas foram eliminadas pelo compilador de :term:`bytecode`." #: ../../reference/datamodel.rst:1292 msgid ":pep:`626` - Precise line numbers for debugging and other tools." msgstr "" +":pep:`626` - Números de linha precisos para depuração e outras ferramentas." #: ../../reference/datamodel.rst:1293 msgid "The PEP that introduced the :meth:`!co_lines` method." -msgstr "" +msgstr "A PEP que introduziu o método :meth:`!co_lines`." #: ../../reference/datamodel.rst:1297 msgid "" @@ -1983,12 +2077,17 @@ msgid "" "objects `, and are also passed to registered trace " "functions." msgstr "" +"Objetos quadro representam quadros de execução. Eles podem ocorrer em :ref:" +"`objetos traceback ` e também são passados para funções " +"de rastreamento registradas." #: ../../reference/datamodel.rst:1327 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" +"Aponta para o quadro de pilha anterior (em direção ao chamador), ou ``None`` " +"se este for o quadro de pilha mais abaixo." #: ../../reference/datamodel.rst:1331 msgid "" @@ -1996,6 +2095,9 @@ msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." msgstr "" +"O :ref:`objeto código ` sendo executado neste quadro. Acessar " +"este atributo levanta um :ref:`evento de auditoria ` ``object." +"__getattr__`` com os argumentos ``obj`` e ``\"f_code\"``." #: ../../reference/datamodel.rst:1336 msgid "" @@ -2006,18 +2108,24 @@ msgstr "" msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" +"O dicionário usado pelo quadro para procurar :ref:`variáveis ​​globais " +"`" #: ../../reference/datamodel.rst:1344 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" +"O dicionário usado pelo quadro para procurar :ref:`nomes embutidos " +"(intrínsecos) `" #: ../../reference/datamodel.rst:1348 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" +"A \"instrução precisa\" do objeto quadro (este é um índice na string :term:" +"`bytecode` do :ref:`objeto código `)" #: ../../reference/datamodel.rst:1364 msgid "" @@ -2025,12 +2133,17 @@ msgid "" "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" +"Se não for ``None``, esta é uma função chamada para vários eventos durante a " +"execução do código (isso é usado por depuradores). Normalmente, um evento é " +"disparado para cada nova linha de origem (veja :attr:`~frame.f_trace_lines`)." #: ../../reference/datamodel.rst:1369 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" +"Defina este atributo como :const:`False` para desabilitar o acionamento de " +"um evento de rastreamento para cada linha de origem." #: ../../reference/datamodel.rst:1373 msgid "" @@ -2038,6 +2151,10 @@ msgid "" "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" +"Defina este atributo para :const:`True` para permitir que eventos por opcode " +"sejam solicitados. Observe que isso pode levar a um comportamento indefinido " +"do interpretador se as exceções levantadas pela função de rastreamento " +"escaparem para a função que está sendo rastreada." #: ../../reference/datamodel.rst:1379 msgid "" @@ -2046,10 +2163,14 @@ msgid "" "debugger can implement a Jump command (aka Set Next Statement) by writing to " "this attribute." msgstr "" +"O número da linha atual do quadro -- escrever para isso de dentro de uma " +"função de rastreamento faz saltar para a linha dada (apenas para o quadro " +"mais abaixo). Um depurador pode implementar um comando Jump (também " +"conhecido como Set Next Statement) escrevendo para esse atributo." #: ../../reference/datamodel.rst:1385 msgid "Frame object methods" -msgstr "" +msgstr "Métodos de objetos quadro" #: ../../reference/datamodel.rst:1387 msgid "Frame objects support one method:" @@ -2063,6 +2184,12 @@ msgid "" "objects (for example when catching an :ref:`exception ` " "and storing its :ref:`traceback ` for later use)." msgstr "" +"Este método limpa todas as referências a :ref:`variáveis locais ` " +"mantidas pelo quadro. Além disso, se o quadro pertencer a um :term:" +"`gerador`, o gerador é finalizado. Isso ajuda a quebrar os ciclos de " +"referência que envolvem objetos quadro (por exemplo, ao capturar uma :ref:" +"`exceção ` e armazenar seu :ref:`traceback ` para uso posterior)." #: ../../reference/datamodel.rst:1397 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." @@ -2078,10 +2205,16 @@ msgid "" "errors>`. A traceback object is implicitly created when an exception occurs, " "and may also be explicitly created by calling :class:`types.TracebackType`." msgstr "" +"Objetos traceback representam o stack trace (situação da pilha de execução) " +"de uma :ref:`exceção `. Um objeto traceback é criado " +"implicitamente quando ocorre uma exceção e também pode ser criado " +"explicitamente chamando :class:`types.TracebackType`." #: ../../reference/datamodel.rst:1423 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" +"Objetos traceback agora podem ser instanciados explicitamente a partir de " +"código Python." #: ../../reference/datamodel.rst:1426 msgid "" @@ -2093,6 +2226,13 @@ msgid "" "`sys.exc_info`, and as the :attr:`~BaseException.__traceback__` attribute of " "the caught exception." msgstr "" +"Para tracebacks criados implicitamente, quando a busca por um manipulador de " +"exceção desenrola a pilha de execução, em cada nível desenrolado um objeto " +"traceback é inserido na frente do traceback atual. Quando um manipulador de " +"exceção é inserido, o stack trace é disponibilizado para o programa. (Veja a " +"seção :ref:`try`.) É acessível como o terceiro item da tupla retornada por :" +"func:`sys.exc_info`, e como o atributo :attr:`~BaseException.__traceback__` " +"da exceção capturada." #: ../../reference/datamodel.rst:1435 msgid "" @@ -2101,6 +2241,10 @@ msgid "" "interactive, it is also made available to the user as :data:`sys." "last_traceback`." msgstr "" +"Quando o programa não contém um manipulador adequado, o stack trace é " +"escrito (formatado de maneira adequada) no fluxo de erro padrão; se o " +"interpretador for interativo, ele também é disponibilizado ao usuário como :" +"data:`sys.last_traceback`." #: ../../reference/datamodel.rst:1440 msgid "" @@ -2108,25 +2252,31 @@ msgid "" "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" +"Para tracebacks criados explicitamente, cabe ao criador do traceback " +"determinar como os atributos :attr:`~traceback.tb_next` devem ser vinculados " +"para formar um stack trace completo." #: ../../reference/datamodel.rst:1455 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" +"Aponta para o :ref:`quadro ` de execução do nível atual." #: ../../reference/datamodel.rst:1458 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." msgstr "" +"Acessar este atributo levanta um :ref:`evento de auditoria ` " +"``object.__getattr__`` com os argumentos ``obj`` e ``\"tb_frame\"``." #: ../../reference/datamodel.rst:1463 msgid "Gives the line number where the exception occurred" -msgstr "" +msgstr "Fornece o número da linha onde ocorreu a exceção" #: ../../reference/datamodel.rst:1466 msgid "Indicates the \"precise instruction\"." -msgstr "" +msgstr "Indica a \"instrução precisa\"." #: ../../reference/datamodel.rst:1468 msgid "" @@ -2135,6 +2285,10 @@ msgid "" "occurred in a :keyword:`try` statement with no matching except clause or " "with a :keyword:`finally` clause." msgstr "" +"O número da linha e a última instrução no traceback podem diferir do número " +"da linha do seu :ref:`objeto quadro ` se a exceção ocorreu em " +"uma instrução :keyword:`try` sem cláusula except correspondente ou com uma " +"cláusula :keyword:`finally`." #: ../../reference/datamodel.rst:1479 msgid "" @@ -2142,10 +2296,13 @@ msgid "" "stack trace (towards the frame where the exception occurred), or ``None`` if " "there is no next level." msgstr "" +"O atributo especial de escrita :attr:`!tb_next` é o próximo nível no stack " +"trace (em direção ao quadro onde a exceção ocorreu), ou ``None`` se não " +"houver próximo nível." #: ../../reference/datamodel.rst:1483 msgid "This attribute is now writable" -msgstr "" +msgstr "Este atributo agora é gravável" #: ../../reference/datamodel.rst:1488 msgid "Slice objects" @@ -2226,6 +2383,12 @@ msgid "" "methods>`. Class method objects are created by the built-in :func:" "`classmethod` constructor." msgstr "" +"Um objeto método de classe, como um objeto método estático, é um invólucro " +"em torno de outro objeto que altera a maneira como esse objeto é recuperado " +"de classes e instâncias de classe. O comportamento dos objetos método de " +"classe após tal recuperação é descrito acima, sob :ref:`\"métodos de " +"instância\" `. Objetos método de classe são criados pelo " +"construtor embutido :func:`classmethod`." #: ../../reference/datamodel.rst:1542 msgid "Special method names" @@ -2631,6 +2794,14 @@ msgid "" "statement), Python will call :func:`bool` on the value to determine if the " "result is true or false." msgstr "" +"Um método de comparação rica pode retornar o singleton :data:" +"`NotImplemented` se não implementar a operação para um determinado par de " +"argumentos. Por convenção, ``False`` e ``True`` são retornados para uma " +"comparação bem-sucedida. No entanto, esses métodos podem retornar qualquer " +"valor, portanto, se o operador de comparação for usado em um contexto " +"booleano (por exemplo, na condição de uma instrução ``if``), Python irá " +"chamar :func:`bool` no valor para determinar se o resultado for verdadeiro " +"ou falso." #: ../../reference/datamodel.rst:1790 msgid "" @@ -2643,6 +2814,14 @@ msgid "" "``x<=y``. To automatically generate ordering operations from a single root " "operation, see :func:`functools.total_ordering`." msgstr "" +"Por padrão, ``object`` implementa :meth:`__eq__` usando ``is``, retornando :" +"data:`NotImplemented` no caso de uma comparação falsa: ``True if x is y else " +"NotImplemented``. Para :meth:`__ne__`, por padrão ele delega para :meth:" +"`__eq__` e inverte o resultado a menos que seja :data:`!NotImplemented`. Não " +"há outras relações implícitas entre os operadores de comparação ou " +"implementações padrão; por exemplo, o valor verdadeiro de ``(x` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" "Para acessos a certos atributos sensíveis, levanta um :ref:`evento de " -"auditoria ` ``object.__getattr__`` com argumentos ``obj`` e " +"auditoria ` ``object.__getattr__`` com os argumentos ``obj`` e " "``name``." #: ../../reference/datamodel.rst:1968 @@ -2970,7 +3166,7 @@ msgid "" "``value``." msgstr "" "Para atribuições de certos atributos sensíveis, levanta um :ref:`evento de " -"auditoria ` ``object.__setattr__`` com argumentos ``obj``, " +"auditoria ` ``object.__setattr__`` com os argumentos ``obj``, " "``name`` e ``value``." #: ../../reference/datamodel.rst:1985 @@ -2997,7 +3193,7 @@ msgid "" "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" "Para exclusões a certos atributos sensíveis, levanta um :ref:`evento de " -"auditoria ` ``object.__delattr__`` com argumentos ``obj`` e " +"auditoria ` ``object.__delattr__`` com os argumentos ``obj`` e " "``name``." #: ../../reference/datamodel.rst:1997 @@ -3969,7 +4165,7 @@ msgstr "" "Os usos potenciais para metaclasses são ilimitados. Algumas ideias que foram " "exploradas incluem enumeradores, criação de log, verificação de interface, " "delegação automática, criação automática de propriedade, proxies, estruturas " -"e bloqueio/sincronização automático/a de recursos." +"e travamento/sincronização automático/a de recursos." #: ../../reference/datamodel.rst:2568 msgid "Customizing instance and subclass checks" @@ -4094,7 +4290,7 @@ msgid "" msgstr "" "Documentação sobre como implementar classes genéricas que podem ser " "parametrizadas em tempo de execução e compreendidas por verificadores de " -"tipo estático" +"tipo estático." #: ../../reference/datamodel.rst:2627 msgid "" @@ -4646,8 +4842,8 @@ msgid "" "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" "Os usos típicos de gerenciadores de contexto incluem salvar e restaurar " -"vários tipos de estado global, bloquear e desbloquear recursos, fechar " -"arquivos abertos, etc." +"vários tipos de estado global, travar e destravar recursos, fechar arquivos " +"abertos, etc." #: ../../reference/datamodel.rst:3132 msgid "" @@ -4962,7 +5158,7 @@ msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -"A segunda assinatura \\(tipo\\[, valor\\[, traceback\\]\\]\\]\\) foi " +"A segunda assinatura \\(tipo\\[, valor\\[, traceback\\]\\]\\) foi " "descontinuada e pode ser removida em uma versão futura do Python." #: ../../reference/datamodel.rst:3401 @@ -5271,7 +5467,7 @@ msgstr "ponto flutuante" #: ../../reference/datamodel.rst:261 ../../reference/datamodel.rst:279 msgid "number" -msgstr "number" +msgstr "número" #: ../../reference/datamodel.rst:261 msgid "Java" @@ -5350,7 +5546,7 @@ msgstr "" #: ../../reference/datamodel.rst:359 msgid "empty" -msgstr "vazio" +msgstr "vazia" #: ../../reference/datamodel.rst:372 ../../reference/datamodel.rst:1730 msgid "bytes" @@ -5565,7 +5761,7 @@ msgstr "embutido" #: ../../reference/datamodel.rst:859 msgid "import" -msgstr "importação" +msgstr "import" #: ../../reference/datamodel.rst:879 msgid "__name__ (module attribute)" @@ -5857,15 +6053,15 @@ msgstr "" #: ../../reference/datamodel.rst:1407 msgid "sys.exc_info" -msgstr "" +msgstr "sys.exc_info" #: ../../reference/datamodel.rst:1407 msgid "sys.exception" -msgstr "" +msgstr "sys.exception" #: ../../reference/datamodel.rst:1407 msgid "sys.last_traceback" -msgstr "" +msgstr "sys.last_traceback" #: ../../reference/datamodel.rst:1444 msgid "tb_frame (traceback attribute)" @@ -5893,7 +6089,7 @@ msgstr "fatia" #: ../../reference/datamodel.rst:1496 msgid "start (slice object attribute)" -msgstr "início (atributo de objeto fatia)" +msgstr "start (atributo de objeto fatia)" #: ../../reference/datamodel.rst:1496 msgid "stop (slice object attribute)" @@ -5905,7 +6101,7 @@ msgstr "step (atributo de objeto fatia)" #: ../../reference/datamodel.rst:1544 msgid "operator" -msgstr "operator" +msgstr "operador" #: ../../reference/datamodel.rst:1544 msgid "overloading" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 272c7c45d..40d113c13 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -408,7 +408,7 @@ msgstr "" #: ../../reference/executionmodel.rst:210 msgid "The value of type aliases (:ref:`lazily evaluated `)." msgstr "" -"O valor dos apelidos de tipo (:ref:`avaliado de forma preguiçosa `)." #: ../../reference/executionmodel.rst:212 @@ -515,8 +515,8 @@ msgid "" msgstr "" "Esse comportamento é útil principalmente para referências a tipos que ainda " "não foram definidos quando o alias de tipo ou variável de tipo é criado. Por " -"exemplo, a avaliação lenta permite a criação de apelidos de tipo mutuamente " -"recursivos::" +"exemplo, a avaliação preguiçosa permite a criação de apelidos de tipo " +"mutuamente recursivos::" #: ../../reference/executionmodel.rst:277 msgid "" @@ -526,8 +526,8 @@ msgid "" msgstr "" "Valores avaliados preguiçosamente são avaliados em :ref:`escopo de anotação " "`, o que significa que os nomes que aparecem dentro do " -"valor avaliado lentamente são pesquisados como se fossem usados no escopo " -"imediatamente envolvente." +"valor avaliado preguiçosamente são pesquisados como se fossem usados no " +"escopo imediatamente envolvente." #: ../../reference/executionmodel.rst:286 msgid "Builtins and restricted execution" @@ -733,7 +733,7 @@ msgstr "nome" #: ../../reference/executionmodel.rst:51 msgid "binding" -msgstr "vinculação" +msgstr "vinculação; ligação" #: ../../reference/executionmodel.rst:57 msgid "from" diff --git a/reference/expressions.po b/reference/expressions.po index 7b7a830c5..214b68a7d 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -28,10 +28,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -497,7 +497,7 @@ msgstr "" #: ../../reference/expressions.rst:333 msgid "Unpacking into dictionary displays, originally proposed by :pep:`448`." msgstr "" -"Descompactando em sintaxes de criação de dicionário, originalmente proposto " +"Desempacotando em sintaxes de criação de dicionário, originalmente proposto " "pela :pep:`448`." #: ../../reference/expressions.rst:336 @@ -792,7 +792,7 @@ msgstr "" #: ../../reference/expressions.rst:511 msgid ":pep:`255` - Simple Generators" -msgstr ":pep:`255` - Geradores simples" +msgstr ":pep:`255` - Simple Generators" #: ../../reference/expressions.rst:512 msgid "" @@ -1647,8 +1647,8 @@ msgstr "" "Se a sintaxe ``**expressão`` aparecer na chamada de função, ``expressão`` " "deve ser avaliada como um :term:`mapeamento`, cujo conteúdo é tratado como " "argumentos nomeados adicionais. Se um parâmetro que corresponde a uma chave " -"já recebeu um valor (por um argumento nomeado explícito ou de outra " -"descompactação), uma exceção :exc:`TypeError` é levantada." +"já recebeu um valor (por um argumento nomeado explícito ou de outro " +"desempacotamento), uma exceção :exc:`TypeError` é levantada." #: ../../reference/expressions.rst:1081 msgid "" @@ -1685,9 +1685,9 @@ msgid "" "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -"Chamadas de função aceitam qualquer número de descompactações ``*`` e " -"``**``, argumentos posicionais podem seguir descompactações iteráveis " -"(``*``) e argumentos nomeados podem seguir descompactações de dicionário " +"Chamadas de função aceitam qualquer número de desempacotamentos ``*`` e " +"``**``, argumentos posicionais podem seguir desempacotamentos iteráveis " +"(``*``) e argumentos nomeados podem seguir desempacotamentos de dicionário " "(``**``). Originalmente proposto pela :pep:`448`." #: ../../reference/expressions.rst:1100 @@ -2384,7 +2384,7 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" "As sequências são comparadas lexicograficamente usando a comparação de " -"elementos correspondentes. Os contêineres embutidos normalmente assumem que " +"elementos correspondentes. Os contêineres embutidos normalmente presumem que " "objetos idênticos são iguais a si mesmos. Isso permite ignorar testes de " "igualdade para objetos idênticos para melhorar o desempenho e manter seus " "invariantes internos." @@ -2866,16 +2866,16 @@ msgid "" "which are included in the new tuple, list, or set, at the site of the " "unpacking." msgstr "" -"Um asterisco ``*`` denota :dfn:`descompactação de iterável`. Seu operando " +"Um asterisco ``*`` denota :dfn:`desempacotamento de iterável`. Seu operando " "deve ser um :term:`iterável`. O iterável é expandido em uma sequência de " -"itens, que são incluídos na nova tupla, lista ou conjunto, no local da " -"descompactação." +"itens, que são incluídos na nova tupla, lista ou conjunto, no local do " +"desempacotamento." #: ../../reference/expressions.rst:1881 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -"Descompactação de iterável em listas de expressões, originalmente proposta " +"Desempacotamento de iterável em listas de expressões, originalmente proposta " "pela :pep:`448`." #: ../../reference/expressions.rst:1886 @@ -3125,10 +3125,10 @@ msgid "" msgstr "" "Embora ``abs(x%y) < abs(y)`` seja verdadeiro matematicamente, para números " "flutuantes pode não ser verdadeiro numericamente devido ao arredondamento. " -"Por exemplo, e assumindo uma plataforma na qual um float Python é um número " -"de precisão dupla IEEE 754, para que ``-1e-100 % 1e100`` tenha o mesmo sinal " -"que ``1e100``, o resultado calculado é ``-1e-100 + 1e100``, que é " -"numericamente exatamente igual a ``1e100``. A função :func:`math.fmod` " +"Por exemplo, e presumindo uma plataforma na qual um float Python seja um " +"número de precisão dupla IEEE 754, para que ``-1e-100 % 1e100`` tenha o " +"mesmo sinal que ``1e100``, o resultado calculado é ``-1e-100 + 1e100``, que " +"é numericamente exatamente igual a ``1e100``. A função :func:`math.fmod` " "retorna um resultado cujo sinal corresponde ao sinal do primeiro argumento " "e, portanto, retorna ``-1e-100`` neste caso. Qual abordagem é mais " "apropriada depende da aplicação." diff --git a/reference/grammar.po b/reference/grammar.po index 3d88b5957..fe855a3cc 100644 --- a/reference/grammar.po +++ b/reference/grammar.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/reference/import.po b/reference/import.po index f01c59bb0..7c308e017 100644 --- a/reference/import.po +++ b/reference/import.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -499,7 +499,7 @@ msgid "" msgstr "" "O mecanismo de importação é desenhado para ser extensível; o mecanismo " "primário para isso são os *ganchos de importação*. Existem dois tipos de " -"ganchos de importação: *meta ganchos* e *ganchos de importação de caminho*." +"ganchos de importação: *metaganchos* e *ganchos de importação de caminho*." #: ../../reference/import.rst:261 msgid "" @@ -509,11 +509,11 @@ msgid "" "modules, or even built-in modules. Meta hooks are registered by adding new " "finder objects to :data:`sys.meta_path`, as described below." msgstr "" -"Meta ganchos são chamados no início do processo de importação, antes que " +"Metaganchos são chamados no início do processo de importação, antes que " "qualquer outro processo de importação tenha ocorrido, que não seja busca de " -"cache de :data:`sys.modules`. Isso permite aos meta ganchos substituir " +"cache de :data:`sys.modules`. Isso permite aos metaganchos substituir " "processamento de :data:`sys.path`, módulos congelados ou mesmo módulos " -"embutidos. Meta ganchos são registrados adicionando novos objetos " +"embutidos. Metaganchos são registrados adicionando novos objetos " "localizadores a :data:`sys.meta_path`, conforme descrito abaixo." #: ../../reference/import.rst:267 @@ -606,7 +606,7 @@ msgid "" "will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``." msgstr "" "O metacaminho pode ser percorrido múltiplas vezes para uma requisição de " -"importação individual. Por exemplo, assumindo que nenhum dos módulos " +"importação individual. Por exemplo, presumindo que nenhum dos módulos " "envolvidos já tenha sido cacheado, importar ``foo.bar.baz`` irá primeiro " "executar uma importação de alto nível, chamando ``mpf.find_spec(\"foo\", " "None, None)`` em cada localizador de metacaminho (``mpf``). Depois que " @@ -760,7 +760,7 @@ msgid "" "loaders. These were previously performed by the :meth:`importlib.abc.Loader." "load_module` method." msgstr "" -"O sistema de importação tem tomado conta das responsabilidades padrões dos " +"O sistema de importação tem tomado conta das responsabilidades inerentes dos " "carregadores. Essas responsabilidades eram anteriormente executadas pelo " "método :meth:`importlib.abc.Loader.load_module`." @@ -843,7 +843,7 @@ msgid "" msgstr "" "O método :meth:`~importlib.abc.Loader.load_module` foi substituído por :meth:" "`~importlib.abc.Loader.exec_module` e o mecanismo de importação assumiu " -"todas as responsabilidades padronizadas de carregamento." +"todas as responsabilidades inerentes de carregamento." #: ../../reference/import.rst:448 msgid "" @@ -864,9 +864,9 @@ msgid "" "functionality described above in addition to executing the module. All the " "same constraints apply, with some additional clarification:" msgstr "" -"O método ``load_module()`` deve implementar toda a funcionalidade de " -"carregamento padrão descrita acima, além de executar o módulo. Todas as " -"mesmas restrições se aplicam, com alguns esclarecimentos adicionais:" +"O método ``load_module()`` deve implementar toda a funcionalidade inerente " +"de carregamento descrita acima, além de executar o módulo. Todas as mesmas " +"restrições se aplicam, com alguns esclarecimentos adicionais:" #: ../../reference/import.rst:457 msgid "" @@ -999,7 +999,7 @@ msgstr "" "transferido entre componentes do sistema de importação, por exemplo. entre o " "localizador que cria a especificação do módulo e o carregador que o executa. " "Mais importante ainda, permite que o mecanismo de importação execute as " -"operações padrão de carregamento, enquanto que sem uma especificação de " +"operações inerentes de carregamento, enquanto que sem uma especificação de " "módulo o carregador tinha essa responsabilidade." #: ../../reference/import.rst:530 @@ -1632,10 +1632,10 @@ msgstr "" "path_importer_cache` (apesar do nome, este cache na verdade armazena objetos " "localizadores em vez de ser limitado a objetos :term:`importador`). Desta " "forma, a dispendiosa busca pelo :term:`localizador de entrada de caminho` de " -"lpcal específicode term:`entrada de caminho` só precisa ser feita uma vez. O " -"código do usuário é livre para remover entradas de cache de :data:`sys." -"path_importer_cache`, forçando o localizador baseado no caminho a realizar a " -"pesquisa de entrada de caminho novamente." +"local específico de uma :term:`entrada de caminho` só precisa ser feita uma " +"vez. O código do usuário é livre para remover entradas de cache de :data:" +"`sys.path_importer_cache`, forçando o localizador baseado no caminho a " +"realizar a pesquisa de entrada de caminho novamente." #: ../../reference/import.rst:846 msgid "" @@ -1652,6 +1652,20 @@ msgid "" "file system encoding, UTF-8, or something else), and if the hook cannot " "decode the argument, it should raise :exc:`ImportError`." msgstr "" +"Se a entrada de caminho não estiver presente no cache, o localizador baseado " +"no caminho itera sobre cada chamável em :data:`sys.path_hooks`. Cada um dos :" +"term:`ganchos de entrada de caminho ` nesta lista é chamado " +"com um único argumento, a entrada de caminho a ser pesquisada. Este chamável " +"pode retornar um :term:`localizador de entrada de caminho` que pode " +"manipular a entrada de caminho ou pode levantar :exc:`ImportError`. Um :exc:" +"`ImportError` é usado pelo localizador baseado no caminho para sinalizar que " +"o gancho não consegue encontrar um :term:`localizador de entrada de caminho` " +"para aquela :term:`entrada de caminho`. A exceção é ignorada e a iteração " +"com o :term:`caminho de importação` continua. O gancho deve esperar um " +"objeto string ou bytes; a codificação de objetos bytes depende do gancho " +"(por exemplo, pode ser uma codificação de sistema de arquivos, UTF-8 ou " +"outra coisa) e, se o gancho não puder decodificar o argumento, ele deve " +"levantar :exc:`ImportError`." #: ../../reference/import.rst:860 msgid "" @@ -1662,6 +1676,13 @@ msgid "" "entry) and return ``None``, indicating that this :term:`meta path finder` " "could not find the module." msgstr "" +"Se a iteração :data:`sys.path_hooks` terminar sem que nenhum :term:" +"`localizador de entrada de caminho` seja retornado, o método :meth:" +"`~importlib.machinery.PathFinder.find_spec` do localizador baseado no " +"caminho armazenará ``None`` em :data:`sys.path_importer_cache` (para indicar " +"que não há um localizador para esta entrada de caminho) e retornará " +"``None``, indicando que este :term:`localizador de metacaminho` não " +"conseguiu encontrar o módulo." #: ../../reference/import.rst:867 msgid "" @@ -1670,6 +1691,10 @@ msgid "" "used to ask the finder for a module spec, which is then used when loading " "the module." msgstr "" +"Se um :term:`localizador de entrada de caminho` *for* retornado por um dos " +"chamáveis de :term:`gancho de entrada de caminho` ​​em :data:`sys.path_hooks`, " +"então o seguinte protocolo é usado para solicitar ao localizador uma " +"especificação de módulo, que é então usada ao carregar o módulo." #: ../../reference/import.rst:872 msgid "" @@ -1682,10 +1707,18 @@ msgid "" "machinery.PathFinder.find_spec` will be the actual current working directory " "and not the empty string." msgstr "" +"O diretório de trabalho atual -- denotado por uma string vazia -- é tratado " +"de forma ligeiramente diferente de outras entradas em :data:`sys.path`. " +"Primeiro, se o diretório de trabalho atual for considerado inexistente, " +"nenhum valor será armazenado em :data:`sys.path_importer_cache`. Segundo, o " +"valor para o diretório de trabalho atual é pesquisado novamente para cada " +"pesquisa de módulo. Terceiro, o caminho usado para :data:`sys." +"path_importer_cache` e retornado por :meth:`importlib.machinery.PathFinder." +"find_spec` será o diretório de trabalho atual real e não a string vazia." #: ../../reference/import.rst:882 msgid "Path entry finder protocol" -msgstr "" +msgstr "Protocolo do localizador de entrada de caminho" #: ../../reference/import.rst:884 msgid "" @@ -1693,6 +1726,10 @@ msgid "" "contribute portions to namespace packages, path entry finders must implement " "the :meth:`~importlib.abc.PathEntryFinder.find_spec` method." msgstr "" +"Para dar suporte a importações de módulos e pacotes inicializados e também " +"contribuir com partes para pacotes de espaço de nomes, os localizadores de " +"entrada de caminho devem implementar o método :meth:`~importlib.abc." +"PathEntryFinder.find_spec`." #: ../../reference/import.rst:888 msgid "" @@ -1701,6 +1738,11 @@ msgid "" "module. ``find_spec()`` returns a fully populated spec for the module. This " "spec will always have \"loader\" set (with one exception)." msgstr "" +":meth:`~importlib.abc.PathEntryFinder.find_spec` recebe dois argumentos: o " +"nome totalmente qualificado do módulo que está sendo importado e o módulo de " +"destino (opcional). ``find_spec()`` retorna uma especificação totalmente " +"preenchida para o módulo. Esta especificação sempre terá \"loader\" definido " +"(com uma exceção)." #: ../../reference/import.rst:893 msgid "" @@ -1708,6 +1750,9 @@ msgid "" "term:`portion`, the path entry finder sets ``submodule_search_locations`` to " "a list containing the portion." msgstr "" +"Para indicar ao maquinário de importação que a especificação representa uma :" +"term:`porção` de espaço de nomes, o localizador de entrada de caminho define " +"``submodule_search_locations`` como uma lista contendo a porção." #: ../../reference/import.rst:897 msgid "" @@ -1715,6 +1760,9 @@ msgid "" "find_loader` and :meth:`!find_module`, both of which are now deprecated, but " "will be used if ``find_spec()`` is not defined." msgstr "" +":meth:`~importlib.abc.PathEntryFinder.find_spec` substituiu :meth:`!" +"find_loader` e :meth:`!find_module`, ambos descontinuados, mas serão usados ​​" +"se ``find_spec()`` não estiver definido." #: ../../reference/import.rst:903 msgid "" @@ -1723,6 +1771,11 @@ msgid "" "backward compatibility. However, if ``find_spec()`` is implemented on the " "path entry finder, the legacy methods are ignored." msgstr "" +"Os localizadores de entrada de caminho mais antigos podem implementar um " +"desses dois métodos descontinuados em vez de ``find_spec()``. Os métodos " +"ainda são respeitados para fins de compatibilidade com versões anteriores. " +"No entanto, se ``find_spec()`` for implementado no localizador de entrada de " +"caminho, os métodos legados serão ignorados." #: ../../reference/import.rst:908 msgid "" @@ -1730,6 +1783,10 @@ msgid "" "module being imported. ``find_loader()`` returns a 2-tuple where the first " "item is the loader and the second item is a namespace :term:`portion`." msgstr "" +":meth:`!find_loader` recebe um argumento, o nome totalmente qualificado do " +"módulo que está sendo importado. ``find_loader()`` retorna uma tupla 2 onde " +"o primeiro item é o carregador e o segundo item é uma :term:`porção` de " +"espaço de nomes." #: ../../reference/import.rst:913 msgid "" @@ -1740,6 +1797,13 @@ msgid "" "(they are expected to record the appropriate path information from the " "initial call to the path hook)." msgstr "" +"Para compatibilidade com versões anteriores de outras implementações do " +"protocolo de importação, muitos localizadores de entrada de caminho também " +"dão suporte ao mesmo método tradicional ``find_module()`` que os " +"localizadores de metacaminho. No entanto, os métodos ``find_module()`` do " +"localizador de entrada de caminho nunca são chamados com um argumento " +"``path`` (espera-se que eles registrem as informações de caminho apropriadas " +"da chamada inicial para o gancho de caminho)." #: ../../reference/import.rst:920 msgid "" @@ -1749,12 +1813,20 @@ msgid "" "entry finder, the import system will always call ``find_loader()`` in " "preference to ``find_module()``." msgstr "" +"O método ``find_module()`` em localizadores de entrada de caminho foi " +"descontinuado, pois não permite que o localizador de entrada de caminho " +"contribua com porções para pacotes de espaço de nomes. Se ``find_loader()`` " +"e ``find_module()`` existirem em um localizador de entrada de caminho, o " +"sistema de importação sempre chamará ``find_loader()`` em preferência a " +"``find_module()``." #: ../../reference/import.rst:926 msgid "" "Calls to :meth:`!find_module` and :meth:`!find_loader` by the import system " "will raise :exc:`ImportWarning`." msgstr "" +"Chamadas para :meth:`!find_module` e :meth:`!find_loader` pelo sistema de " +"importação vão levantar :exc:`ImportWarning`." #: ../../reference/import.rst:931 msgid "``find_module()`` and ``find_loader()`` have been removed." @@ -1762,7 +1834,7 @@ msgstr "``find_module()`` e ``find_loader()`` foram removidos." #: ../../reference/import.rst:936 msgid "Replacing the standard import system" -msgstr "" +msgstr "Substituindo o sistema de importação padrão" #: ../../reference/import.rst:938 msgid "" @@ -1770,6 +1842,9 @@ msgid "" "delete the default contents of :data:`sys.meta_path`, replacing them " "entirely with a custom meta path hook." msgstr "" +"O mecanismo mais confiável para substituir todo o sistema de importação é " +"excluir o conteúdo padrão de :data:`sys.meta_path`, substituindo-o " +"inteiramente por um gancho de metacaminho personalizado." #: ../../reference/import.rst:942 msgid "" @@ -1779,6 +1854,11 @@ msgid "" "also be employed at the module level to only alter the behaviour of import " "statements within that module." msgstr "" +"Se for aceitável alterar apenas o comportamento de instruções de importação " +"sem afetar outras APIs que acessam o sistema de importação, então substituir " +"a função embutida :func:`__import__` pode ser suficiente. Essa técnica " +"também pode ser empregada no nível do módulo para alterar apenas o " +"comportamento de instruções de importação dentro desse módulo." #: ../../reference/import.rst:948 msgid "" @@ -1789,6 +1869,12 @@ msgid "" "latter indicates that the meta path search should continue, while raising an " "exception terminates it immediately." msgstr "" +"Para impedir seletivamente a importação de alguns módulos de um gancho no " +"início do metacaminho (em vez de desabilitar o sistema de importação padrão " +"completamente), é suficiente levantar :exc:`ModuleNotFoundError` diretamente " +"de :meth:`~importlib.abc.MetaPathFinder.find_spec` em vez de retornar " +"``None``. O último indica que a busca do metacaminho deve continuar, " +"enquanto levantar uma exceção a encerra imediatamente." #: ../../reference/import.rst:958 msgid "Package Relative Imports" @@ -1801,12 +1887,19 @@ msgid "" "a relative import to the parent(s) of the current package, one level per dot " "after the first. For example, given the following package layout::" msgstr "" +"Importações relativas usam caracteres de ponto no início. Um único ponto no " +"início indica uma importação relativa, começando com o pacote atual. Dois ou " +"mais pontos no início indicam uma importação relativa para o(s) pai(s) do " +"pacote atual, um nível por ponto após o primeiro. Por exemplo, dado o " +"seguinte layout de pacote::" #: ../../reference/import.rst:976 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" +"Em ``subpackage1/moduleX.py`` ou ``subpackage1/__init__.py``, as seguintes " +"são importações relativas válidas:" #: ../../reference/import.rst:986 msgid "" @@ -1814,16 +1907,21 @@ msgid "" "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" +"Importações absolutas podem usar a sintaxe ``import <>`` ou ``from <> import " +"<>``, mas importações relativas podem usar apenas a segunda forma; o motivo " +"para isso é que:" #: ../../reference/import.rst:992 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" +"deve expor ``XXX.YYY.ZZZ`` como uma expressão utilizável, mas .moduleY não é " +"uma expressão válida." #: ../../reference/import.rst:999 msgid "Special considerations for __main__" -msgstr "" +msgstr "Considerações especiais para __main__" #: ../../reference/import.rst:1001 msgid "" @@ -1835,16 +1933,26 @@ msgid "" "initialized depends on the flags and other options with which the " "interpreter is invoked." msgstr "" +"O módulo :mod:`__main__` é um caso especial em relação ao sistema de " +"importação do Python. Conforme observado em :ref:`em outro lugar " +"`, o módulo ``__main__`` é inicializado diretamente na " +"inicialização do interpretador, muito parecido com :mod:`sys` e :mod:" +"`builtins`. No entanto, diferentemente desses dois, ele não se qualifica " +"estritamente como um módulo integrado. Isso ocorre porque a maneira como " +"``__main__`` é inicializado depende dos sinalizadores e outras opções com as " +"quais o interpretador é invocado." #: ../../reference/import.rst:1012 msgid "__main__.__spec__" -msgstr "" +msgstr "__main__.__spec__" #: ../../reference/import.rst:1014 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" +"Dependendo de como :mod:`__main__` é inicializado, ``__main__.__spec__`` é " +"definido apropriadamente ou como ``None``." #: ../../reference/import.rst:1017 msgid "" @@ -1853,6 +1961,10 @@ msgid "" "populated when the ``__main__`` module is loaded as part of executing a " "directory, zipfile or other :data:`sys.path` entry." msgstr "" +"Quando o Python é iniciado com a opção :option:`-m`, ``__spec__`` é definido " +"como a especificação do módulo ou pacote correspondente. ``__spec__`` também " +"é preenchido quando o módulo ``__main__`` é carregado como parte da execução " +"de um diretório, arquivo zip ou outra entrada :data:`sys.path`." #: ../../reference/import.rst:1022 msgid "" @@ -1860,22 +1972,25 @@ msgid "" "__spec__`` is set to ``None``, as the code used to populate the :mod:" "`__main__` does not correspond directly with an importable module:" msgstr "" +":ref:`Nos demais casos `, ``__main__.__spec__`` " +"é definido como ``None``, pois o código usado para preencher o :mod:" +"`__main__` não corresponde diretamente a um módulo importável:" #: ../../reference/import.rst:1026 msgid "interactive prompt" -msgstr "" +msgstr "prompt interativo" #: ../../reference/import.rst:1027 msgid ":option:`-c` option" -msgstr "" +msgstr "opção :option:`-c`" #: ../../reference/import.rst:1028 msgid "running from stdin" -msgstr "" +msgstr "executar a partir de stdin" #: ../../reference/import.rst:1029 msgid "running directly from a source or bytecode file" -msgstr "" +msgstr "executar diretamente de um arquivo de código-fonte ou bytecode" #: ../../reference/import.rst:1031 msgid "" @@ -1884,6 +1999,10 @@ msgid "" "the :option:`-m` switch if valid module metadata is desired in :mod:" "`__main__`." msgstr "" +"Note que ``__main__.__spec__`` é sempre ``None`` no último caso, *mesmo se* " +"o arquivo pudesse ser importado diretamente como um módulo. Use a opção :" +"option:`-m` se metadados de módulo válidos forem desejados em :mod:" +"`__main__`." #: ../../reference/import.rst:1036 msgid "" @@ -1893,6 +2012,12 @@ msgid "" "__name__ == \"__main__\":`` checks only execute when the module is used to " "populate the ``__main__`` namespace, and not during normal import." msgstr "" +"Note também que mesmo quando ``__main__`` corresponde a um módulo importável " +"e ``__main__.__spec__`` é definido adequadamente, eles ainda são " +"considerados módulos *distintos*. Isso se deve ao fato de que os blocos " +"protegidos por verificações ``if __name__ == \"__main__\":`` são executados " +"somente quando o módulo é usado para preencher o espaço de nomes " +"``__main__``, e não durante a importação normal." #: ../../reference/import.rst:1044 msgid "References" @@ -1905,12 +2030,18 @@ msgid "" "packages/>`_ is still available to read, although some details have changed " "since the writing of that document." msgstr "" +"O maquinário de importação evoluiu consideravelmente desde os primeiros dias " +"do Python. A `especificação original para pacotes `_ ainda está disponível para leitura, embora alguns " +"detalhes tenham mudado desde a escrita desse documento." #: ../../reference/import.rst:1051 msgid "" "The original specification for :data:`sys.meta_path` was :pep:`302`, with " "subsequent extension in :pep:`420`." msgstr "" +"A especificação original para :data:`sys.meta_path` era :pep:`302`, com " +"extensão subsequente em :pep:`420`." #: ../../reference/import.rst:1054 msgid "" @@ -1918,12 +2049,17 @@ msgid "" "Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " "an alternative to :meth:`!find_module`." msgstr "" +":pep:`420` introduziu :term:`pacotes de espaço de nomes ` " +"para Python 3.3. :pep:`420` também introduziu o protocolo :meth:`!" +"find_loader` como uma alternativa ao :meth:`!find_module`." #: ../../reference/import.rst:1058 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" +":pep:`366` descreve a adição do atributo ``__package__`` para importações " +"relativas explícitas em módulos principais." #: ../../reference/import.rst:1061 msgid "" @@ -1931,10 +2067,13 @@ msgid "" "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" +":pep:`328` introduziu importações relativas absolutas e explícitas e " +"inicialmente propôs ``__name__`` para semântica. :pep:`366` eventualmente " +"especificaria ``__package__``." #: ../../reference/import.rst:1065 msgid ":pep:`338` defines executing modules as scripts." -msgstr "" +msgstr ":pep:`338` define módulos de execução como scripts." #: ../../reference/import.rst:1067 msgid "" @@ -1944,6 +2083,12 @@ msgid "" "of several APIs in the import system and also addition of new methods to " "finders and loaders." msgstr "" +":pep:`451` adiciona o encapsulamento do estado de importação por módulo em " +"objetos de especificação. Ele também descarrega a maioria das " +"responsabilidades inerentes dos carregadores de volta para o maquinário de " +"importação. Essas mudanças permitem a descontinuação de várias APIs no " +"sistema de importação e também a adição de novos métodos para localizadores " +"e carregadores." #: ../../reference/import.rst:1074 msgid "Footnotes" @@ -1951,7 +2096,7 @@ msgstr "Notas de rodapé" #: ../../reference/import.rst:1075 msgid "See :class:`types.ModuleType`." -msgstr "" +msgstr "Veja :class:`types.ModuleType`." #: ../../reference/import.rst:1077 msgid "" @@ -1961,10 +2106,16 @@ msgid "" "replace itself in :data:`sys.modules`. This is implementation-specific " "behavior that is not guaranteed to work in other Python implementations." msgstr "" +"A implementação de importlib evita usar o valor de retorno diretamente. Em " +"vez disso, ela obtém o objeto do módulo procurando o nome do módulo em :data:" +"`sys.modules`. O efeito indireto disso é que um módulo importado pode " +"substituir a si mesmo em :data:`sys.modules`. Esse é um comportamento " +"específico da implementação que não tem garantia de funcionar em outras " +"implementações do Python." #: ../../reference/import.rst:8 msgid "import machinery" -msgstr "" +msgstr "maquinário de importação" #: ../../reference/import.rst:64 ../../reference/import.rst:95 #: ../../reference/import.rst:129 @@ -1973,7 +2124,7 @@ msgstr "pacote" #: ../../reference/import.rst:95 msgid "regular" -msgstr "" +msgstr "regular" #: ../../reference/import.rst:129 msgid "namespace" @@ -1985,7 +2136,7 @@ msgstr "porção" #: ../../reference/import.rst:175 msgid "sys.modules" -msgstr "" +msgstr "sys.modules" #: ../../reference/import.rst:210 ../../reference/import.rst:276 msgid "finder" @@ -2001,27 +2152,27 @@ msgstr "módulo spec" #: ../../reference/import.rst:249 msgid "import hooks" -msgstr "" +msgstr "ganchos de importação" #: ../../reference/import.rst:249 msgid "meta hooks" -msgstr "" +msgstr "metaganchos" #: ../../reference/import.rst:249 msgid "path hooks" -msgstr "" +msgstr "ganchos de caminho" #: ../../reference/import.rst:249 msgid "hooks" -msgstr "" +msgstr "ganchos" #: ../../reference/import.rst:249 msgid "import" -msgstr "importação" +msgstr "import" #: ../../reference/import.rst:249 msgid "meta" -msgstr "" +msgstr "meta" #: ../../reference/import.rst:249 msgid "path" @@ -2029,11 +2180,11 @@ msgstr "caminho" #: ../../reference/import.rst:276 msgid "sys.meta_path" -msgstr "" +msgstr "sys.meta_path" #: ../../reference/import.rst:276 msgid "find_spec" -msgstr "" +msgstr "find_spec" #: ../../reference/import.rst:745 msgid "path based finder" @@ -2041,16 +2192,16 @@ msgstr "localizador baseado no caminho" #: ../../reference/import.rst:794 msgid "sys.path" -msgstr "" +msgstr "sys.path" #: ../../reference/import.rst:794 msgid "sys.path_hooks" -msgstr "" +msgstr "sys.path_hooks" #: ../../reference/import.rst:794 msgid "sys.path_importer_cache" -msgstr "" +msgstr "sys.path_importer_cache" #: ../../reference/import.rst:794 msgid "PYTHONPATH" -msgstr "" +msgstr "PYTHONPATH" diff --git a/reference/index.po b/reference/index.po index 3bbabe6c4..d512311cd 100644 --- a/reference/index.po +++ b/reference/index.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Raphael Mendonça, 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/reference/introduction.po b/reference/introduction.po index 029b8f573..c358f50c0 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 5ff82d1c5..57e4c0240 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 87c6c5108..51129cd38 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -374,7 +374,7 @@ msgstr "" #: ../../reference/simple_stmts.rst:254 msgid ":pep:`3132` - Extended Iterable Unpacking" -msgstr ":pep:`3132` - Descompactação de Iterável Estendida" +msgstr ":pep:`3132` - Desempacotamento estendido de iterável" #: ../../reference/simple_stmts.rst:255 msgid "The specification for the ``*target`` feature." @@ -409,7 +409,7 @@ msgid "" "evaluated once." msgstr "" "Uma atribuição aumentada avalia o alvo (que, diferentemente das instruções " -"de atribuição normais, não pode ser um descompactação) e a lista de " +"de atribuição normais, não pode ser um desempacotamento) e a lista de " "expressões, executa a operação binária específica para o tipo de atribuição " "nos dois operandos e atribui o resultado ao alvo original. O alvo é avaliado " "apenas uma vez." @@ -606,7 +606,7 @@ msgid "" "it is unnecessary to include the source code for the expression that failed " "in the error message; it will be displayed as part of the stack trace." msgstr "" -"Essas equivalências assumem que :const:`__debug__` e :exc:`AssertionError` " +"Essas equivalências presumem que :const:`__debug__` e :exc:`AssertionError` " "referem-se às variáveis embutidas com esses nomes. Na implementação atual, a " "variável embutida :const:`__debug__` é ``True`` em circunstâncias normais, " "``False`` quando a otimização é solicitada (opção de linha de comando :" @@ -1053,8 +1053,8 @@ msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -"Se o nome do módulo é seguido pela palavra reservada :keyword:`!as`, o nome " -"a seguir é vinculado diretamente ao módulo importado." +"Se o nome do módulo é seguido pela palavra-chave :keyword:`!as`, o nome a " +"seguir é vinculado diretamente ao módulo importado." #: ../../reference/simple_stmts.rst:786 msgid "" @@ -1214,8 +1214,8 @@ msgid "" "``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." "path_hooks``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``import`` com argumentos " -"``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." +"Levanta um :ref:`evento de auditoria ` ``import`` com os " +"argumentos ``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." "path_hooks``." #: ../../reference/simple_stmts.rst:868 diff --git a/reference/toplevel_components.po b/reference/toplevel_components.po index 688d68731..552dc3887 100644 --- a/reference/toplevel_components.po +++ b/reference/toplevel_components.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 4c7d04d21..85a7a6d95 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -96,7 +96,7 @@ msgid "" "(``'\\r\\n'``) line ending. Note that the hash, or pound, character, " "``'#'``, is used to start a comment in Python." msgstr "" -"(assumindo que o interpretador está na :envvar:`PATH` do usuário) no começo " +"(presumindo que o interpretador está na :envvar:`PATH` do usuário) no começo " "do script e configurando o arquivo no modo executável. Os dois primeiros " "caracteres do arquivo devem ser ``#!``. Em algumas plataformas, essa " "primeira linha deve terminar com uma quebra de linha em estilo Unix " diff --git a/tutorial/appetite.po b/tutorial/appetite.po index 7d69822bb..cc39f657a 100644 --- a/tutorial/appetite.po +++ b/tutorial/appetite.po @@ -18,10 +18,10 @@ msgstr "" "Last-Translator: David Macedo, 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/classes.po b/tutorial/classes.po index 87cd7e87c..90009b3c5 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -551,7 +551,7 @@ msgid "" msgstr "" "Para *instanciar* uma classe, usa-se a mesma sintaxe de invocar uma função. " "Apenas finja que o objeto classe do exemplo é uma função sem parâmetros, que " -"devolve uma nova instância da classe. Por exemplo (assumindo a classe " +"devolve uma nova instância da classe. Por exemplo (presumindo a classe " "acima)::" #: ../../tutorial/classes.rst:288 diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 4cb7be8c6..084f9a136 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -398,7 +398,7 @@ msgstr "" "também pode definir uma posição específica para atributos em padrões " "configurando o atributo especial ``__match_args__`` em suas classes. Se for " "definido como (\"x\", \"y\"), os seguintes padrões são todos equivalentes (e " -"todos vinculam o atributo ``y`` à variável ``var``)::" +"todos ligam o atributo ``y`` à variável ``var``)::" #: ../../tutorial/controlflow.rst:345 msgid "" @@ -481,7 +481,7 @@ msgstr "" #: ../../tutorial/controlflow.rst:399 msgid "Subpatterns may be captured using the ``as`` keyword::" -msgstr "Subpadrões podem ser capturados usando a palavra reservada ``as``::" +msgstr "Subpadrões podem ser capturados usando a palavra reservada ``as`` ::" #: ../../tutorial/controlflow.rst:403 msgid "" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index c62ed2ea6..3e72e75d4 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -165,6 +165,12 @@ msgid "" "other types. Also, there are some types that don't have a defined ordering " "relation. For example, ``3+4j < 5+7j`` isn't a valid comparison." msgstr "" +"Outro aspecto que você pode notar é que nem todos os dados podem ser " +"classificados ou comparados. Por exemplo, ``[None, 'hello', 10]`` não é " +"ordenável porque os inteiros não podem ser comparados a strings e ``None`` " +"não pode ser comparado a outros tipos. Além disso, há alguns tipos que não " +"têm uma relação de ordenação definida. Por exemplo, ``3+4j < 5+7j`` não é " +"uma comparação válida." #: ../../tutorial/datastructures.rst:138 msgid "Using Lists as Stacks" @@ -214,7 +220,7 @@ msgstr "" #: ../../tutorial/datastructures.rst:196 msgid "List Comprehensions" -msgstr "Compreensões de lista" +msgstr "List Comprehensions" #: ../../tutorial/datastructures.rst:198 msgid "" diff --git a/tutorial/errors.po b/tutorial/errors.po index 9546f6aea..838c4ea0b 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index 6bc089c46..013612082 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -416,8 +416,8 @@ msgid "" "perform an exact analysis of cases like this yourself. Basic familiarity " "with binary floating-point representation is assumed." msgstr "" -"Esta seção explica o exemplo do \"0,1\" em detalhes, e mostra como poderás " -"realizar uma análise exata de casos semelhantes. Assumimos que tenhas uma " +"Esta seção explica o exemplo do \"0.1\" em detalhes, e mostra como poderás " +"realizar uma análise exata de casos semelhantes. Presumimos que tenhas uma " "familiaridade básica com a representação binária de ponto flutuante." #: ../../tutorial/floatingpoint.rst:266 diff --git a/tutorial/index.po b/tutorial/index.po index 29c1fa168..cf275abb2 100644 --- a/tutorial/index.po +++ b/tutorial/index.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 6282677ef..242f4717b 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -394,7 +394,7 @@ msgstr "" "prévio será apagado), e ``'a'`` para abrir o arquivo para adição; qualquer " "escrita será adicionada ao final do arquivo. A opção ``'r+'`` abre o arquivo " "tanto para leitura como para escrita. O argumento *modo* é opcional, em caso " -"de omissão será assumido ``'r'``." +"de omissão será presumido ``'r'``." #: ../../tutorial/inputoutput.rst:313 msgid "" @@ -489,7 +489,7 @@ msgid "" "The rest of the examples in this section will assume that a file object " "called ``f`` has already been created." msgstr "" -"Para simplificar, o resto dos exemplos nesta seção assumem que um objeto " +"Para simplificar, o resto dos exemplos nesta seção presumem que um objeto " "arquivo chamado ``f`` já foi criado." #: ../../tutorial/inputoutput.rst:376 diff --git a/tutorial/interactive.po b/tutorial/interactive.po index df7fc3dd8..8bdb24db3 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/interpreter.po b/tutorial/interpreter.po index ba814b27c..bbc117271 100644 --- a/tutorial/interpreter.po +++ b/tutorial/interpreter.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 6eccb510d..796134c42 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/modules.po b/tutorial/modules.po index d78562376..a5d85a194 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -667,7 +667,7 @@ msgid "" msgstr "" "Observe que ao utilizar ``from pacote import item``, o item pode ser um " "subpacote, submódulo, classe, função ou variável. A instrução ``import`` " -"primeiro testa se o item está definido no pacote, senão assume que é um " +"primeiro testa se o item está definido no pacote, senão presume que é um " "módulo e tenta carregá-lo. Se falhar em encontrar o módulo, uma exceção :exc:" "`ImportError` é levantada." diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 41933f4c5..48fd6272e 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index 34c543f56..083eb7bf0 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -210,8 +210,7 @@ msgstr "" "O principal desafio para as aplicações que usam múltiplas threads é " "coordenar as threads que compartilham dados ou outros recursos. Para esta " "finalidade, o módulo threading oferece alguns mecanismos primitivos de " -"sincronização, como travas (locks), eventos, variáveis de condição e " -"semáforos." +"sincronização, como travas, eventos, variáveis de condição e semáforos." #: ../../tutorial/stdlib2.rst:203 msgid "" diff --git a/tutorial/venv.po b/tutorial/venv.po index 83caba079..2c1263f58 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/tutorial/whatnow.po b/tutorial/whatnow.po index 1ad784fa9..b7d5d9136 100644 --- a/tutorial/whatnow.po +++ b/tutorial/whatnow.po @@ -19,10 +19,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/using/cmdline.po b/using/cmdline.po index 2991007b4..e646cccf2 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -169,7 +169,7 @@ msgid "" "argument ``command``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython.run_command`` com " -"argumento ``command``." +"o argumento ``command``." #: ../../using/cmdline.rst:77 msgid "" @@ -256,7 +256,7 @@ msgid "" "argument ``module-name``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython.run_module`` com " -"argumento ``module-name``." +"o argumento ``module-name``." #: ../../using/cmdline.rst:118 msgid ":func:`runpy.run_module`" @@ -300,8 +300,8 @@ msgid "" "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " "arguments." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``cpython.run_stdin`` com " -"nenhum argumento." +"Levanta um :ref:`evento de auditoria ` ``cpython.run_stdin`` sem " +"argumentos." #: ../../using/cmdline.rst:146 msgid "" @@ -359,7 +359,7 @@ msgid "" "Raises an :ref:`auditing event ` ``cpython.run_file`` with " "argument ``filename``." msgstr "" -"Levanta um :ref:`evento de auditoria ` ``cpython.run_file`` com " +"Levanta um :ref:`evento de auditoria ` ``cpython.run_file`` com o " "argumento ``filename``." #: ../../using/cmdline.rst:170 @@ -620,7 +620,8 @@ msgstr "" msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -"Não exibe as mensagens de copyright e de versão nem mesmo no modo interativo." +"Não exibe as mensagens de direitos autorais e de versão nem mesmo no modo " +"interativo." #: ../../using/cmdline.rst:361 msgid "" @@ -1168,7 +1169,7 @@ msgid "" msgstr "" "Se este for o nome de um arquivo legível, os comandos Python nesse arquivo " "serão executados antes que o primeiro prompt seja exibido no modo " -"interativo. O arquivo é executado no mesmo namespace onde os comandos " +"interativo. O arquivo é executado no mesmo espaço de nomes onde os comandos " "interativos são executados para que os objetos definidos ou importados nele " "possam ser usados sem qualificação na sessão interativa. Você também pode " "alterar os prompts :data:`sys.ps1` e :data:`sys.ps2` e o gancho :data:`sys." @@ -1388,7 +1389,7 @@ msgid "" "` to :data:`sys.path`." msgstr "" "Se estiver definido, o Python não adicionará o :data:`diretório site-" -"packages de usuário ` a :data:`sys.path`." +"packages do usuário ` a :data:`sys.path`." #: ../../using/cmdline.rst:815 msgid "" diff --git a/using/configure.po b/using/configure.po index b410df4a8..2e12e40b6 100644 --- a/using/configure.po +++ b/using/configure.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -534,6 +534,12 @@ msgid "" "disable these warnings on Clang, manually suppress them by adding ``-Wno-" "profile-instr-unprofiled`` to :envvar:`CFLAGS`." msgstr "" +"Durante a construção, você poderá encontrar avisos do compilador sobre a " +"indisponibilidade de dados de perfil para alguns arquivos fonte. Esses " +"avisos são inofensivos, pois apenas um subconjunto do código é exercido " +"durante a aquisição de dados de perfil. Para desativar esses avisos no " +"Clang, suprima-os manualmente adicionando ``-Wno-profile-instr-unprofiled`` " +"a :envvar:`CFLAGS`." #: ../../using/configure.rst:316 msgid "Use ``-fno-semantic-interposition`` on GCC." @@ -1257,6 +1263,8 @@ msgstr "Arquivos C (``.c``) são construídos como arquivos objeto (``.o``)." #: ../../using/configure.rst:737 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" +"Uma biblioteca estática ``libpython`` (``.a``) é criada a partir de arquivos " +"de objetos." #: ../../using/configure.rst:738 msgid "" @@ -1269,10 +1277,11 @@ msgstr "" #: ../../using/configure.rst:740 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" +"Extensões C são construídas pelo Makefile (veja :file:`Modules/Setup`)." #: ../../using/configure.rst:743 msgid "Main Makefile targets" -msgstr "" +msgstr "Alvos principais do Makefile" #: ../../using/configure.rst:745 msgid "``make``: Build Python with the standard library." @@ -1322,7 +1331,7 @@ msgstr "" #: ../../using/configure.rst:764 msgid "C extensions" -msgstr "" +msgstr "Extensões C" #: ../../using/configure.rst:766 msgid "" @@ -1330,6 +1339,9 @@ msgid "" "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute:" msgstr "" +"Algumas extensões C são construídas como módulos embutidos, como o módulo " +"``sys``. Eles são construídos com a macro ``Py_BUILD_CORE_BUILTIN`` " +"definida. Módulos embutidos não possuem nenhum atributo ``__file__``:" #: ../../using/configure.rst:780 msgid "" @@ -1337,6 +1349,9 @@ msgid "" "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64:" msgstr "" +"Outras extensões C são construídas como bibliotecas dinâmicas, como o módulo " +"``_asyncio``. Eles são construídos com a macro ``Py_BUILD_CORE_MODULE`` " +"definida. Exemplo no Linux x86-64:" #: ../../using/configure.rst:792 msgid "" @@ -1345,6 +1360,10 @@ msgid "" "in modules. Extensions defined after the ``*shared*`` marker are built as " "dynamic libraries." msgstr "" +":file:`Modules/Setup` é usado para gerar alvos Makefile para construir " +"extensões C. No início dos arquivos, as extensões C são construídas como " +"módulos embutidos. Extensões definidas após o marcador ``*shared*`` são " +"construídas como bibliotecas dinâmicas." #: ../../using/configure.rst:796 msgid "" @@ -1352,14 +1371,18 @@ msgid "" "`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" +"As macros :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` e :c:macro:" +"`PyMODINIT_FUNC` de :file:`Include/exports.h` são definidas de forma " +"diferente dependendo se a macro ``Py_BUILD_CORE_MODULE`` está definida:" #: ../../using/configure.rst:800 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "" +"Usa ``Py_EXPORTED_SYMBOL`` se ``Py_BUILD_CORE_MODULE`` estiver definido" #: ../../using/configure.rst:801 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." -msgstr "" +msgstr "Do contrário, usa ``Py_IMPORTED_SYMBOL``." #: ../../using/configure.rst:803 msgid "" @@ -1367,6 +1390,9 @@ msgid "" "built as a shared library, its :samp:`PyInit_{xxx}()` function is not " "exported, causing an :exc:`ImportError` on import." msgstr "" +"Se a macro ``Py_BUILD_CORE_BUILTIN`` for usada por engano em uma extensão C " +"construída como uma biblioteca compartilhada, sua função :samp:`PyInit_{xxx}" +"()` não será exportada, causando um :exc:`ImportError` na importação." #: ../../using/configure.rst:809 msgid "Compiler and linker flags" @@ -1377,21 +1403,27 @@ msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" +"Opções definidas pelo script ``./configure`` e variáveis ​​de ambiente e " +"usadas por ``Makefile``." #: ../../using/configure.rst:815 msgid "Preprocessor flags" -msgstr "" +msgstr "Sinalizadores do pré-processador" #: ../../using/configure.rst:819 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" +"Valor da variável :envvar:`CPPFLAGS` passado para o script ``./configure``." #: ../../using/configure.rst:825 msgid "" "(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " "have headers in a nonstandard directory *include_dir*." msgstr "" +"Sinalizadores de pré-processador C++ / (Objective) C, p.ex. :samp:`-" +"I{include_dir}` se você tiver cabeçalhos em um diretório não padrão " +"*include_dir*." #: ../../using/configure.rst:828 ../../using/configure.rst:1018 msgid "" @@ -1399,41 +1431,48 @@ msgid "" "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" +"Tanto :envvar:`CPPFLAGS` quanto :envvar:`LDFLAGS` precisam conter o valor do " +"shell para poder construir módulos de extensão usando os diretórios " +"especificados nas variáveis ​​de ambiente." #: ../../using/configure.rst:838 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" +"Sinalizadores extras de pré-processador adicionados para construir os " +"arquivos de objeto do interpretador." #: ../../using/configure.rst:840 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" +"Padrão: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " +"$(CPPFLAGS)``." #: ../../using/configure.rst:845 msgid "Compiler flags" -msgstr "" +msgstr "Sinalizadores do compilador" #: ../../using/configure.rst:849 msgid "C compiler command." -msgstr "" +msgstr "Comando do compilador C." #: ../../using/configure.rst:851 msgid "Example: ``gcc -pthread``." -msgstr "" +msgstr "Exemplo: ``gcc -pthread``." #: ../../using/configure.rst:855 msgid "C++ compiler command." -msgstr "" +msgstr "Comando do compilador C++." #: ../../using/configure.rst:857 msgid "Example: ``g++ -pthread``." -msgstr "" +msgstr "Exemplo: ``g++ -pthread``." #: ../../using/configure.rst:861 msgid "C compiler flags." -msgstr "" +msgstr "Sinalizadores do compilador C." #: ../../using/configure.rst:865 msgid "" @@ -1441,10 +1480,13 @@ msgid "" "extensions. Use it when a compiler flag should *not* be part of :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" +":envvar:`CFLAGS_NODIST` é usado para construir o interpretador e extensões C " +"da stdlib. Use-o quando um sinalizador do compilador *não* deve fazer parte " +"de :envvar:`CFLAGS` depois que o Python estiver instalado (:gh:`65320`)." #: ../../using/configure.rst:869 msgid "In particular, :envvar:`CFLAGS` should not contain:" -msgstr "" +msgstr "Em particular, :envvar:`CFLAGS` não deve conter:" #: ../../using/configure.rst:871 msgid "" @@ -1452,107 +1494,138 @@ msgid "" "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" +"o sinalizador do compilador ``-I`` (para definir o caminho de pesquisa para " +"arquivos incluídos). Os sinalizadores ``-I`` são processadas da esquerda " +"para a direita, e quaisquer sinalizadores em :envvar:`CFLAGS` terão " +"precedência sobre os sinalizadores ``-I`` fornecidos pelo usuário e pelo " +"pacote." #: ../../using/configure.rst:876 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" +"sinalizadores de segurança como ``-Werror`` porque as distribuições não " +"podem controlar se os pacotes instalados pelos usuários estão em " +"conformidade com esses padrões elevados." #: ../../using/configure.rst:884 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" +"Opções passadas para a linha de comando :mod:`compileall` ao construir " +"arquivos PYC em ``make install``. Padrão: ``-j0``." #: ../../using/configure.rst:891 msgid "Extra C compiler flags." -msgstr "" +msgstr "Sinalizadores extra do compilador C." #: ../../using/configure.rst:895 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" +"Valor da variável :envvar:`CFLAGS` passado para o script ``./configure``." #: ../../using/configure.rst:902 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" +"Valor da variável :envvar:`CFLAGS_NODIST` passado para o script ``./" +"configure``." #: ../../using/configure.rst:909 msgid "Base compiler flags." -msgstr "" +msgstr "Sinalizadores base do compilador." #: ../../using/configure.rst:913 msgid "Optimization flags." -msgstr "" +msgstr "Sinalizadores de otimização." #: ../../using/configure.rst:917 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" +"Sinalizadores de alias estritos ou não estritos usados ​​para compilar " +"``Python/dtoa.c``." #: ../../using/configure.rst:923 msgid "Compiler flags used to build a shared library." msgstr "" +"Sinalizadores de compilador usados ​​para construir uma biblioteca " +"compartilhada." #: ../../using/configure.rst:925 msgid "For example, ``-fPIC`` is used on Linux and on BSD." -msgstr "" +msgstr "Por exemplo, ``-fPIC`` é usado no Linux e no BSD." #: ../../using/configure.rst:929 msgid "Extra C flags added for building the interpreter object files." msgstr "" +"Sinalizadores extras de C adicionados para construir os arquivos de objeto " +"do interpretador." #: ../../using/configure.rst:931 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" +"Padrão: ``$(CCSHARED)`` quando :option:`--enable-shared` é usado, ou uma " +"string vazia caso contrário." #: ../../using/configure.rst:936 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" +"Padrão: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " +"$(EXTRA_CFLAGS)``." #: ../../using/configure.rst:940 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" +"Padrão: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" +"internal``." #: ../../using/configure.rst:946 msgid "C flags used for building the interpreter object files." msgstr "" +"Sinalizadores do C usados para construir os arquivos de objeto do " +"interpretador." #: ../../using/configure.rst:948 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" +"Padrão: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " +"$(CFLAGSFORSHARED)``." #: ../../using/configure.rst:954 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." -msgstr "" +msgstr "Padrão: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." #: ../../using/configure.rst:960 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" +"Sinalizadores do compilador para construir um módulo de extensão de " +"biblioteca padrão como um módulo embutido, como o módulo :mod:`posix`." #: ../../using/configure.rst:963 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." -msgstr "" +msgstr "Padrão: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." #: ../../using/configure.rst:969 msgid "Purify command. Purify is a memory debugger program." -msgstr "" +msgstr "Comando de Purify. Purify é um programa depurador de memória." #: ../../using/configure.rst:971 msgid "Default: empty string (not used)." -msgstr "" +msgstr "Padrão: string vazia (não usada)." #: ../../using/configure.rst:975 msgid "Linker flags" @@ -1567,12 +1640,13 @@ msgstr "" #: ../../using/configure.rst:981 msgid "Default: ``$(PURIFY) $(CC)``." -msgstr "" +msgstr "Padrão: ``$(PURIFY) $(CC)``." #: ../../using/configure.rst:985 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" +"Valor da variável :envvar:`LDFLAGS` passado para o script ``./configure``." #: ../../using/configure.rst:987 msgid "" @@ -1580,6 +1654,9 @@ msgid "" "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" +"Evite atribuir :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. para que os " +"usuários possam usá-los na linha de comando para anexar a esses valores sem " +"pisotear os valores predefinidos." #: ../../using/configure.rst:995 msgid "" @@ -1593,7 +1670,7 @@ msgstr "" #: ../../using/configure.rst:999 msgid "In particular, :envvar:`LDFLAGS` should not contain:" -msgstr "" +msgstr "Em particular, :envvar:`LDFLAGS` não deve conter:" #: ../../using/configure.rst:1001 msgid "" @@ -1601,12 +1678,19 @@ msgid "" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" +"o sinalizador do compilador ``-L`` (para definir o caminho de pesquisa para " +"arquivos incluídos). Os sinalizadores ``-L`` são processadas da esquerda " +"para a direita, e quaisquer sinalizadores em :envvar:`LDFLAGS` terão " +"precedência sobre os sinalizadores ``-L`` fornecidos pelo usuário e pelo " +"pacote." #: ../../using/configure.rst:1008 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" +"Valor da variável :envvar:`LDFLAGS_NODIST` passado para o script ``./" +"configure``." #: ../../using/configure.rst:1015 msgid "" @@ -1626,31 +1710,31 @@ msgstr "" #: ../../using/configure.rst:1027 msgid "Example: ``-lrt``." -msgstr "" +msgstr "Exemplo: ``-lrt``." #: ../../using/configure.rst:1031 msgid "Command to build a shared library." -msgstr "" +msgstr "Comando para construir uma biblioteca compartilhada." #: ../../using/configure.rst:1033 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." -msgstr "" +msgstr "Padrão: ``@LDSHARED@ $(PY_LDFLAGS)``." #: ../../using/configure.rst:1037 msgid "Command to build ``libpython`` shared library." -msgstr "" +msgstr "Comando para construir a biblioteca compartilhada ``libpython``." #: ../../using/configure.rst:1039 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." -msgstr "" +msgstr "Padrão: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." #: ../../using/configure.rst:1043 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." -msgstr "" +msgstr "Padrão: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." #: ../../using/configure.rst:1047 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." -msgstr "" +msgstr "Padrão: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." #: ../../using/configure.rst:1053 msgid "Linker flags used for building the interpreter object files." diff --git a/using/editors.po b/using/editors.po index 6958996a9..979ca2c4b 100644 --- a/using/editors.po +++ b/using/editors.po @@ -18,10 +18,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/using/index.po b/using/index.po index c3b50a615..aed8b1cb2 100644 --- a/using/index.po +++ b/using/index.po @@ -16,10 +16,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/using/mac.po b/using/mac.po index 8ea430c9e..1f02e924f 100644 --- a/using/mac.po +++ b/using/mac.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/using/unix.po b/using/unix.po index a9ba1dff8..8c59e2418 100644 --- a/using/unix.po +++ b/using/unix.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/using/windows.po b/using/windows.po index e44b286f6..0230ab3e7 100644 --- a/using/windows.po +++ b/using/windows.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -53,6 +53,15 @@ msgid "" "users of a single machine, and a separate ZIP file is available for " "application-local distributions." msgstr "" +"Diferente da maioria dos sistemas e serviços Unix, o Windows não inclui uma " +"instalação suportada do Python. Para deixar o Python disponível, o time " +"CPython compilou os instaladores do Windows com cada `versão `_ por vários anos. Esses instaladores têm a intenção " +"primária de adicionar uma instalação de Python por usuário, com o " +"interpretador e as bibliotecas núcleo sendo utilizadas por um único usuário. " +"O instalador também é capaz de instalar para todos os usuários de uma única " +"máquina, e um arquivo ZIP separado está disponível para distribuições locais " +"de aplicação." #: ../../using/windows.rst:24 msgid "" @@ -309,6 +318,8 @@ msgid "" "The following options (found by executing the installer with ``/?``) can be " "passed into the installer:" msgstr "" +"As seguintes opções (encontradas executando o instalador com ``/?``) podem " +"ser passadas para o instalador:" #: ../../using/windows.rst:133 ../../using/windows.rst:153 #: ../../using/windows.rst:1082 @@ -322,51 +333,51 @@ msgstr "Descrição" #: ../../using/windows.rst:135 msgid "/passive" -msgstr "" +msgstr "/passive" #: ../../using/windows.rst:135 msgid "to display progress without requiring user interaction" -msgstr "" +msgstr "para exibir o progresso sem exigir interação do usuário" #: ../../using/windows.rst:137 msgid "/quiet" -msgstr "" +msgstr "/quiet" #: ../../using/windows.rst:137 msgid "to install/uninstall without displaying any UI" -msgstr "" +msgstr "para instalar/desinstalar sem exibir nenhuma UI" #: ../../using/windows.rst:139 msgid "/simple" -msgstr "" +msgstr "/simple" #: ../../using/windows.rst:139 msgid "to prevent user customization" -msgstr "" +msgstr "para evitar a personalização do usuário" #: ../../using/windows.rst:141 msgid "/uninstall" -msgstr "" +msgstr "/uninstall" #: ../../using/windows.rst:141 msgid "to remove Python (without confirmation)" -msgstr "" +msgstr "para remover o Python (sem exigir confirmação)" #: ../../using/windows.rst:143 msgid "/layout [directory]" -msgstr "" +msgstr "/layout [diretório]" #: ../../using/windows.rst:143 msgid "to pre-download all components" -msgstr "" +msgstr "para pré-baixar todos os componentes" #: ../../using/windows.rst:145 msgid "/log [filename]" -msgstr "" +msgstr "/log [nome-de-arquivo]" #: ../../using/windows.rst:145 msgid "to specify log files location" -msgstr "" +msgstr "para especificar a localização dos arquivos de log" #: ../../using/windows.rst:148 msgid "" @@ -1522,7 +1533,7 @@ msgstr "" "usando os direcionamentos em :ref:`setting-envvars`. Você precisa definir " "sua variável de ambiente :envvar:`PATH` para incluir o diretório da sua " "instalação Python, delimitado por um ponto e vírgula de outras entradas. Uma " -"variável exemplo pode parecer com isso (assumindo que as duas primeiras " +"variável exemplo pode parecer com isso (presumindo que as duas primeiras " "entradas já existem)::" #: ../../using/windows.rst:662 @@ -1807,9 +1818,9 @@ msgid "" msgstr "" "Re-executar o comando agora deve exibir informações da última versão do " "Python 3.x. Como nos exemplos da linha de comando acima, você pode " -"especificar um qualificador de versão mais explícito. Assumindo que você tem " -"o Python 3.7 instalado, tente mudar a primeira linha para ``#! python3.7`` e " -"você deve ver as informações da versão 3.7 sendo exibidas." +"especificar um qualificador de versão mais explícito. Presumindo que você " +"tem o Python 3.7 instalado, tente mudar a primeira linha para ``#! " +"python3.7`` e você deve ver as informações da versão 3.7 sendo exibidas." #: ../../using/windows.rst:828 msgid "" @@ -2307,11 +2318,11 @@ msgstr "Valor" #: ../../using/windows.rst:1084 msgid "RC_BAD_VENV_CFG" -msgstr "" +msgstr "RC_BAD_VENV_CFG" #: ../../using/windows.rst:1084 msgid "107" -msgstr "" +msgstr "107" #: ../../using/windows.rst:1084 msgid "A :file:`pyvenv.cfg` was found but is corrupt." @@ -2319,11 +2330,11 @@ msgstr "" #: ../../using/windows.rst:1086 msgid "RC_CREATE_PROCESS" -msgstr "" +msgstr "RC_CREATE_PROCESS" #: ../../using/windows.rst:1086 msgid "101" -msgstr "" +msgstr "101" #: ../../using/windows.rst:1086 msgid "Failed to launch Python." @@ -2331,11 +2342,11 @@ msgstr "" #: ../../using/windows.rst:1088 msgid "RC_INSTALLING" -msgstr "" +msgstr "RC_INSTALLING" #: ../../using/windows.rst:1088 msgid "111" -msgstr "" +msgstr "111" #: ../../using/windows.rst:1088 msgid "" @@ -2345,11 +2356,11 @@ msgstr "" #: ../../using/windows.rst:1091 msgid "RC_INTERNAL_ERROR" -msgstr "" +msgstr "RC_INTERNAL_ERROR" #: ../../using/windows.rst:1091 msgid "109" -msgstr "" +msgstr "109" #: ../../using/windows.rst:1091 msgid "Unexpected error. Please report a bug." @@ -2357,11 +2368,11 @@ msgstr "" #: ../../using/windows.rst:1093 msgid "RC_NO_COMMANDLINE" -msgstr "" +msgstr "RC_NO_COMMANDLINE" #: ../../using/windows.rst:1093 msgid "108" -msgstr "" +msgstr "108" #: ../../using/windows.rst:1093 msgid "Unable to obtain command line from the operating system." @@ -2369,11 +2380,11 @@ msgstr "" #: ../../using/windows.rst:1096 msgid "RC_NO_PYTHON" -msgstr "" +msgstr "RC_NO_PYTHON" #: ../../using/windows.rst:1096 msgid "103" -msgstr "" +msgstr "103" #: ../../using/windows.rst:1096 msgid "Unable to locate the requested version." @@ -2381,11 +2392,11 @@ msgstr "" #: ../../using/windows.rst:1098 msgid "RC_NO_VENV_CFG" -msgstr "" +msgstr "RC_NO_VENV_CFG" #: ../../using/windows.rst:1098 msgid "106" -msgstr "" +msgstr "106" #: ../../using/windows.rst:1098 msgid "A :file:`pyvenv.cfg` was required but not found." @@ -2457,13 +2468,14 @@ msgid "" "on that folder. Otherwise, the core Python path is constructed from the " "PythonPath stored in the registry." msgstr "" -"Se a variável de ambiente :envvar:`PYTHONHOME` está definida, ela é assumida " -"como \"Python Home\". Caso contrário, o caminho do principal executável do " -"Python é usado para localizar um \"arquivo de referência\" (ou ``Lib\\os." -"py`` ou ``pythonXY.zip``) para deduzir o \"Python Home\". Se um Python Home " -"é encontrado, os subdiretórios relevantes adicionados ao :data:`sys.path` " -"(``Lib``, ``plat-win``, etc) são baseados naquela pasta. Se não, o caminho " -"núcleo do Python é construído a partir do PythonPath armazenado no registro." +"Se a variável de ambiente :envvar:`PYTHONHOME` está definida, ela é " +"presumida como \"Python Home\". Caso contrário, o caminho do principal " +"executável do Python é usado para localizar um \"arquivo de referência\" (ou " +"``Lib\\os.py`` ou ``pythonXY.zip``) para deduzir o \"Python Home\". Se um " +"Python Home é encontrado, os subdiretórios relevantes adicionados ao :data:" +"`sys.path` (``Lib``, ``plat-win``, etc) são baseados naquela pasta. Se não, " +"o caminho núcleo do Python é construído a partir do PythonPath armazenado no " +"registro." #: ../../using/windows.rst:1137 msgid "" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 98f24bf2e..6ad356c7c 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -21,16 +21,16 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../whatsnew/2.0.rst:3 msgid "What's New in Python 2.0" -msgstr "O que há de novo no Python 2.0" +msgstr "What's New in Python 2.0" #: ../../whatsnew/2.0.rst:0 msgid "Author" @@ -38,7 +38,7 @@ msgstr "Autor" #: ../../whatsnew/2.0.rst:5 msgid "A.M. Kuchling and Moshe Zadka" -msgstr "A.M. Kuchling e Moshe Zadka" +msgstr "A.M. Kuchling and Moshe Zadka" #: ../../whatsnew/2.0.rst:13 msgid "Introduction" @@ -51,10 +51,10 @@ msgid "" "useful changes, and points out a few incompatible changes that may require " "rewriting code." msgstr "" -"Uma nova versão do Python, versão 2.0, foi lançada em 16 de outubro de 2000. " -"Este artigo aborda os novos recursos interessantes da versão, destaca " -"algumas outras mudanças úteis e aponta algumas alterações incompatíveis que " -"podem exigir a reescrita do código." +"A new release of Python, version 2.0, was released on October 16, 2000. This " +"article covers the exciting new features in 2.0, highlights some other " +"useful changes, and points out a few incompatible changes that may require " +"rewriting code." #: ../../whatsnew/2.0.rst:20 msgid "" @@ -67,10 +67,18 @@ msgid "" "for PythonLabs are now getting paid to spend their days fixing bugs, and " "also due to the improved communication resulting from moving to SourceForge." msgstr "" +"Python's development never completely stops between releases, and a steady " +"flow of bug fixes and improvements are always being submitted. A host of " +"minor fixes, a few optimizations, additional docstrings, and better error " +"messages went into 2.0; to list them all would be impossible, but they're " +"certainly significant. Consult the publicly available CVS logs if you want " +"to see the full list. This progress is due to the five developers working " +"for PythonLabs are now getting paid to spend their days fixing bugs, and " +"also due to the improved communication resulting from moving to SourceForge." #: ../../whatsnew/2.0.rst:33 msgid "What About Python 1.6?" -msgstr "E quanto ao Python 1.6?" +msgstr "What About Python 1.6?" #: ../../whatsnew/2.0.rst:35 msgid "" @@ -83,15 +91,14 @@ msgid "" "received a few fixes to ensure that it's forward-compatible with Python " "2.0. 1.6 is therefore part of Python's evolution, and not a side branch." msgstr "" -"Python 1.6 pode ser considerado a versão de obrigações contratuais do " -"Python. Depois que a equipe de desenvolvimento principal deixou o CNRI em " -"maio de 2000, o CNRI solicitou que uma versão 1.6 fosse criada, contendo " -"todo o trabalho em Python que havia sido executado no CNRI. Python 1.6, " -"portanto, representa o estado da árvore CVS em maio de 2000, com o novo " -"recurso mais significativo sendo o suporte a Unicode. O desenvolvimento " -"continuou depois de maio, é claro, então a árvore 1.6 recebeu algumas " -"correções para garantir que seja compatível com o Python 2.0. 1.6 é, " -"portanto, parte da evolução do Python, e não um ramo secundário." +"Python 1.6 can be thought of as the Contractual Obligations Python release. " +"After the core development team left CNRI in May 2000, CNRI requested that a " +"1.6 release be created, containing all the work on Python that had been " +"performed at CNRI. Python 1.6 therefore represents the state of the CVS " +"tree as of May 2000, with the most significant new feature being Unicode " +"support. Development continued after May, of course, so the 1.6 tree " +"received a few fixes to ensure that it's forward-compatible with Python " +"2.0. 1.6 is therefore part of Python's evolution, and not a side branch." #: ../../whatsnew/2.0.rst:44 msgid "" @@ -104,18 +111,18 @@ msgid "" "2.0. Most of the really interesting features described in this document are " "only in 2.0, because a lot of work was done between May and September." msgstr "" -"Então, você deve se interessar muito pelo Python 1.6? Provavelmente não. Os " -"lançamentos 1.6final e 2.0beta1 foram feitos no mesmo dia (5 de setembro de " -"2000), e o plano era finalizar o Python 2.0 em cerca de um mês. Se você tem " -"aplicativos para manter, parece que não faz muito sentido interromper as " -"coisas mudando para 1.6, consertá-las e, em seguida, ter outra rodada de " -"interrupções em um mês mudando para 2.0; é melhor ir direto para 2.0. A " -"maioria dos recursos realmente interessantes descritos neste documento estão " -"apenas na versão 2.0, porque muito trabalho foi feito entre maio e setembro." +"So, should you take much interest in Python 1.6? Probably not. The " +"1.6final and 2.0beta1 releases were made on the same day (September 5, " +"2000), the plan being to finalize Python 2.0 within a month or so. If you " +"have applications to maintain, there seems little point in breaking things " +"by moving to 1.6, fixing them, and then having another round of breakage " +"within a month by moving to 2.0; you're better off just going straight to " +"2.0. Most of the really interesting features described in this document are " +"only in 2.0, because a lot of work was done between May and September." #: ../../whatsnew/2.0.rst:57 msgid "New Development Process" -msgstr "Novo processo de desenvolvimento" +msgstr "New Development Process" #: ../../whatsnew/2.0.rst:59 msgid "" @@ -127,14 +134,13 @@ msgid "" "available from Python's project page, located at https://sourceforge.net/" "projects/python/." msgstr "" -"A mudança mais importante no Python 2.0 pode não ser no código, mas em como " -"o Python é desenvolvido: em maio de 2000, os desenvolvedores do Python " -"começaram a usar as ferramentas disponibilizadas pelo SourceForge para " -"armazenar o código-fonte, rastrear relatórios de bug e gerenciar a fila de " -"envios de patch. Para relatar bugs ou enviar patches para Python 2.0, use o " -"rastreamento de bugs e ferramentas de gerenciamento de patch disponíveis na " -"página do projeto Python, localizada em https://sourceforge.net/projects/" -"python/." +"The most important change in Python 2.0 may not be to the code at all, but " +"to how Python is developed: in May 2000 the Python developers began using " +"the tools made available by SourceForge for storing source code, tracking " +"bug reports, and managing the queue of patch submissions. To report bugs or " +"submit patches for Python 2.0, use the bug tracking and patch manager tools " +"available from Python's project page, located at https://sourceforge.net/" +"projects/python/." #: ../../whatsnew/2.0.rst:66 msgid "" @@ -155,24 +161,22 @@ msgid "" "access, probably that task would have been viewed as \"nice, but not worth " "the time and effort needed\" and it would never have gotten done." msgstr "" -"O mais importante dos serviços agora hospedados no SourceForge é a árvore " -"CVS do Python, o repositório controlado por versão que contém o código-fonte " -"do Python. Anteriormente, havia aproximadamente 7 ou mais pessoas que tinham " -"acesso de escrita à árvore CVS, e todos os patches tinham que ser " -"inspecionados e verificados por uma das pessoas nesta pequena lista. " -"Obviamente, isso não era muito escalonável. Ao mover a árvore CVS para o " -"SourceForge, tornou-se possível conceder acesso de escrita a mais pessoas; " -"em setembro de 2000, havia 27 pessoas capazes de verificar as mudanças, um " -"aumento de quatro vezes. Isso possibilita mudanças em grande escala que não " -"seriam tentadas se tivessem que ser filtradas pelo pequeno grupo de " -"desenvolvedores centrais. Por exemplo, um dia Peter Schneider-Kamp pensou em " -"abandonar a compatibilidade K&R C e converter o código-fonte C para Python " -"em ANSI C. Depois de obter aprovação na lista de e-mails python-dev, ele " -"começou uma enxurrada de verificações que duraram cerca de uma semana, " -"outros desenvolvedores juntaram-se para ajudar e o trabalho estava feito. Se " -"houvesse apenas 5 pessoas com acesso de escrita, provavelmente essa tarefa " -"teria sido vista como \"legal, mas não vale o tempo e esforço necessários\" " -"e nunca teria sido realizada." +"The most important of the services now hosted at SourceForge is the Python " +"CVS tree, the version-controlled repository containing the source code for " +"Python. Previously, there were roughly 7 or so people who had write access " +"to the CVS tree, and all patches had to be inspected and checked in by one " +"of the people on this short list. Obviously, this wasn't very scalable. By " +"moving the CVS tree to SourceForge, it became possible to grant write access " +"to more people; as of September 2000 there were 27 people able to check in " +"changes, a fourfold increase. This makes possible large-scale changes that " +"wouldn't be attempted if they'd have to be filtered through the small group " +"of core developers. For example, one day Peter Schneider-Kamp took it into " +"his head to drop K&R C compatibility and convert the C source for Python to " +"ANSI C. After getting approval on the python-dev mailing list, he launched " +"into a flurry of checkins that lasted about a week, other developers joined " +"in to help, and the job was done. If there were only 5 people with write " +"access, probably that task would have been viewed as \"nice, but not worth " +"the time and effort needed\" and it would never have gotten done." #: ../../whatsnew/2.0.rst:83 msgid "" @@ -188,18 +192,17 @@ msgid "" "notification e-mail messages that are completely unhelpful, so Ka-Ping Yee " "wrote an HTML screen-scraper that sends more useful messages." msgstr "" -"A mudança para o uso dos serviços do SourceForge resultou em um aumento " -"notável na velocidade de desenvolvimento. Os patches agora são enviados, " -"comentados, revisados por outras pessoas que não o remetente original e " -"devolvidos para frente e para trás entre as pessoas até que o patch valha a " -"pena ser verificado. Os bugs são rastreados em um local central e podem ser " -"atribuídos a uma pessoa específica para correção, e podemos contar o número " -"de bugs abertos para medir o progresso. Isso não veio sem custo: os " -"desenvolvedores agora têm mais e-mail para lidar, mais listas de e-mail a " -"seguir e ferramentas especiais tiveram que ser escritas para o novo " -"ambiente. Por exemplo, SourceForge envia mensagens de e-mail de notificação " -"de patch e bug padrão que são completamente inúteis, então Ka-Ping Yee " -"escreveu um raspador de tela HTML que envia mensagens mais úteis." +"The shift to using SourceForge's services has resulted in a remarkable " +"increase in the speed of development. Patches now get submitted, commented " +"on, revised by people other than the original submitter, and bounced back " +"and forth between people until the patch is deemed worth checking in. Bugs " +"are tracked in one central location and can be assigned to a specific person " +"for fixing, and we can count the number of open bugs to measure progress. " +"This didn't come without a cost: developers now have more e-mail to deal " +"with, more mailing lists to follow, and special tools had to be written for " +"the new environment. For example, SourceForge sends default patch and bug " +"notification e-mail messages that are completely unhelpful, so Ka-Ping Yee " +"wrote an HTML screen-scraper that sends more useful messages." #: ../../whatsnew/2.0.rst:95 msgid "" @@ -215,18 +218,17 @@ msgid "" "can still ignore the result of a vote, and approve or reject a change even " "if the community disagrees with him." msgstr "" -"A facilidade de adicionar código causou alguns problemas iniciais de " -"crescimento, como a entrada de código antes de estar pronto ou sem um acordo " -"claro do grupo de desenvolvedores. O processo de aprovação que surgiu é um " -"pouco semelhante ao usado pelo grupo Apache. Os desenvolvedores podem votar " -"+1, +0, -0 ou -1 em um patch; +1 e -1 denotam aceitação ou rejeição, " -"enquanto +0 e -0 significam que o desenvolvedor é indiferente à mudança, " -"embora com uma ligeira inclinação positiva ou negativa. A mudança mais " -"significativa do modelo Apache é que a votação é essencialmente consultiva, " -"permitindo que Guido van Rossum, que tem o status de Ditador Benevolente " -"pela Vida, saiba qual é a opinião geral. Ele ainda pode ignorar o resultado " -"de uma votação e aprovar ou rejeitar uma alteração, mesmo se a comunidade " -"discordar dele." +"The ease of adding code caused a few initial growing pains, such as code was " +"checked in before it was ready or without getting clear agreement from the " +"developer group. The approval process that has emerged is somewhat similar " +"to that used by the Apache group. Developers can vote +1, +0, -0, or -1 on a " +"patch; +1 and -1 denote acceptance or rejection, while +0 and -0 mean the " +"developer is mostly indifferent to the change, though with a slight positive " +"or negative slant. The most significant change from the Apache model is " +"that the voting is essentially advisory, letting Guido van Rossum, who has " +"Benevolent Dictator For Life status, know what the general opinion is. He " +"can still ignore the result of a vote, and approve or reject a change even " +"if the community disagrees with him." #: ../../whatsnew/2.0.rst:106 msgid "" @@ -241,6 +243,16 @@ msgid "" "accepting or rejecting the proposal. Quoting from the introduction to :pep:" "`1`, \"PEP Purpose and Guidelines\":" msgstr "" +"Producing an actual patch is the last step in adding a new feature, and is " +"usually easy compared to the earlier task of coming up with a good design. " +"Discussions of new features can often explode into lengthy mailing list " +"threads, making the discussion hard to follow, and no one can read every " +"posting to python-dev. Therefore, a relatively formal process has been set " +"up to write Python Enhancement Proposals (PEPs), modelled on the internet " +"RFC process. PEPs are draft documents that describe a proposed new feature, " +"and are continually revised until the community reaches a consensus, either " +"accepting or rejecting the proposal. Quoting from the introduction to :pep:" +"`1`, \"PEP Purpose and Guidelines\":" #: ../../whatsnew/2.0.rst:120 msgid "" @@ -249,10 +261,10 @@ msgid "" "for Python. The PEP should provide a concise technical specification of the " "feature and a rationale for the feature." msgstr "" -"PEP significa *Python Enhancement Proposal*. Uma PEP é um documento de " -"design que fornece informações para a comunidade Python ou descreve um novo " -"recurso para Python. A PEP deve fornecer uma especificação técnica concisa " -"do recurso e uma justificativa para o recurso." +"PEP stands for Python Enhancement Proposal. A PEP is a design document " +"providing information to the Python community, or describing a new feature " +"for Python. The PEP should provide a concise technical specification of the " +"feature and a rationale for the feature." #: ../../whatsnew/2.0.rst:125 msgid "" @@ -261,11 +273,10 @@ msgid "" "decisions that have gone into Python. The PEP author is responsible for " "building consensus within the community and documenting dissenting opinions." msgstr "" -"Pretendemos que as PEPs sejam os principais mecanismos para propor novos " -"recursos, para coletar a opinião da comunidade sobre um problema e para " -"documentar as decisões de design que foram para o Python. O autor da PEP é " -"responsável por construir consenso dentro da comunidade e documentar " -"opiniões divergentes." +"We intend PEPs to be the primary mechanisms for proposing new features, for " +"collecting community input on an issue, and for documenting the design " +"decisions that have gone into Python. The PEP author is responsible for " +"building consensus within the community and documenting dissenting opinions." #: ../../whatsnew/2.0.rst:130 msgid "" @@ -276,6 +287,12 @@ msgid "" "there are 25 PEPs, ranging from :pep:`201`, \"Lockstep Iteration\", to PEP " "225, \"Elementwise/Objectwise Operators\"." msgstr "" +"Read the rest of :pep:`1` for the details of the PEP editorial process, " +"style, and format. PEPs are kept in the Python CVS tree on SourceForge, " +"though they're not part of the Python 2.0 distribution, and are also " +"available in HTML form from https://peps.python.org/. As of September 2000, " +"there are 25 PEPs, ranging from :pep:`201`, \"Lockstep Iteration\", to PEP " +"225, \"Elementwise/Objectwise Operators\"." #: ../../whatsnew/2.0.rst:141 msgid "Unicode" @@ -288,10 +305,10 @@ msgid "" "instead of the 8-bit number used by ASCII, meaning that 65,536 distinct " "characters can be supported." msgstr "" -"O maior novo recurso no Python 2.0 é um novo tipo de dados fundamental: " -"strings Unicode. O Unicode usa números de 16 bits para representar os " -"caracteres em vez do número de 8 bits usado pelo ASCII, o que significa que " -"65.536 caracteres distintos podem ser suportados." +"The largest new feature in Python 2.0 is a new fundamental data type: " +"Unicode strings. Unicode uses 16-bit numbers to represent characters " +"instead of the 8-bit number used by ASCII, meaning that 65,536 distinct " +"characters can be supported." #: ../../whatsnew/2.0.rst:148 msgid "" @@ -302,13 +319,12 @@ msgid "" "was written up as :pep:`100`, \"Python Unicode Integration\". This article " "will simply cover the most significant points about the Unicode interfaces." msgstr "" -"A interface final para suporte Unicode foi alcançada por meio de inúmeras " -"discussões frequentemente tempestuosas na lista de discussão python-dev, e " -"implementada principalmente por Marc-André Lemburg, com base na " -"implementação de um tipo de string Unicode por Fredrik Lundh. Uma explicação " -"detalhada da interface foi escrita como :pep:`100`, \"Python Unicode " -"Integration\". Este artigo irá simplesmente cobrir os pontos mais " -"significativos sobre as interfaces Unicode." +"The final interface for Unicode support was arrived at through countless " +"often-stormy discussions on the python-dev mailing list, and mostly " +"implemented by Marc-André Lemburg, based on a Unicode string type " +"implementation by Fredrik Lundh. A detailed explanation of the interface " +"was written up as :pep:`100`, \"Python Unicode Integration\". This article " +"will simply cover the most significant points about the Unicode interfaces." #: ../../whatsnew/2.0.rst:155 msgid "" @@ -319,6 +335,12 @@ msgid "" "and octal escapes can be used for characters up to U+01FF, which is " "represented by ``\\777``." msgstr "" +"In Python source code, Unicode strings are written as ``u\"string\"``. " +"Arbitrary Unicode characters can be written using a new escape sequence, :" +"samp:`\\\\u{HHHH}`, where *HHHH* is a 4-digit hexadecimal number from 0000 " +"to FFFF. The existing :samp:`\\\\x{HH}` escape sequence can also be used, " +"and octal escapes can be used for characters up to U+01FF, which is " +"represented by ``\\777``." #: ../../whatsnew/2.0.rst:161 msgid "" @@ -333,49 +355,48 @@ msgid "" "installation by calling the ``sys.setdefaultencoding(encoding)`` function in " "a customized version of :file:`site.py`." msgstr "" -"Strings Unicode, assim como strings regulares, são um tipo de sequência " -"imutável. Elas podem ser indexadas e fatiadas, mas não modificadas no local. " -"Strings Unicode têm um método ``encode( [encoding] )`` que retorna uma " -"string de 8 bits na codificação desejada. Codificações são nomeadas por " -"strings, como ``'ascii'``, ``'utf-8'``, ``'iso-8859-1'`` ou qualquer outra " -"coisa. Uma API de codec é definida para implementar e registrar novas " -"codificações que estarão disponíveis em um programa Python. Se uma " -"codificação não for especificada, a codificação padrão é geralmente ASCII de " -"7 bits, embora possa ser alterada para sua instalação Python chamando a " -"função ``sys.setdefaultencoding(encoding)`` em uma versão personalizada de :" -"file:`site.py`." +"Unicode strings, just like regular strings, are an immutable sequence type. " +"They can be indexed and sliced, but not modified in place. Unicode strings " +"have an ``encode( [encoding] )`` method that returns an 8-bit string in the " +"desired encoding. Encodings are named by strings, such as ``'ascii'``, " +"``'utf-8'``, ``'iso-8859-1'``, or whatever. A codec API is defined for " +"implementing and registering new encodings that are then available " +"throughout a Python program. If an encoding isn't specified, the default " +"encoding is usually 7-bit ASCII, though it can be changed for your Python " +"installation by calling the ``sys.setdefaultencoding(encoding)`` function in " +"a customized version of :file:`site.py`." #: ../../whatsnew/2.0.rst:172 msgid "" "Combining 8-bit and Unicode strings always coerces to Unicode, using the " "default ASCII encoding; the result of ``'a' + u'bc'`` is ``u'abc'``." msgstr "" -"Combinar strings de 8 bits e Unicode sempre força o uso de Unicode, usando a " -"codificação ASCII padrão; o resultado de ``'a' + u'bc'`` é ``u'abc'``." +"Combining 8-bit and Unicode strings always coerces to Unicode, using the " +"default ASCII encoding; the result of ``'a' + u'bc'`` is ``u'abc'``." #: ../../whatsnew/2.0.rst:175 msgid "" "New built-in functions have been added, and existing built-ins modified to " "support Unicode:" msgstr "" -"Novas funções embutidas foram adicionadas e embutidas existentes modificadas " -"para oferecer suporte a Unicode:" +"New built-in functions have been added, and existing built-ins modified to " +"support Unicode:" #: ../../whatsnew/2.0.rst:178 msgid "" "``unichr(ch)`` returns a Unicode string 1 character long, containing the " "character *ch*." msgstr "" -"``unichr(ch)`` retorna uma string Unicode com 1 caractere, contendo o " -"caractere *ch*." +"``unichr(ch)`` returns a Unicode string 1 character long, containing the " +"character *ch*." #: ../../whatsnew/2.0.rst:181 msgid "" "``ord(u)``, where *u* is a 1-character regular or Unicode string, returns " "the number of the character as an integer." msgstr "" -"``ord(u)``, onde *u* é uma string regular ou Unicode de 1 caractere, retorna " -"o número do caractere como um inteiro." +"``ord(u)``, where *u* is a 1-character regular or Unicode string, returns " +"the number of the character as an integer." #: ../../whatsnew/2.0.rst:184 msgid "" @@ -387,14 +408,13 @@ msgid "" "errors to be silently ignored and ``'replace'`` uses U+FFFD, the official " "replacement character, in case of any problems." msgstr "" -"``unicode(string [, encoding] [, errors] )`` cria uma string Unicode a " -"partir de uma string de 8 bits. ``encoding`` é uma string que nomeia a " -"codificação a ser usada. O parâmetro ``errors`` especifica o tratamento de " -"caracteres que são inválidos para a codificação atual; passar ``'strict'`` " -"como o valor faz com que uma exceção seja levantada em qualquer erro de " -"codificação, enquanto ``'ignore'`` faz com que os erros sejam ignorados " -"silenciosamente e ``'replace'`` usa U+FFFD, o caráter oficial de " -"substituição, em caso de quaisquer problemas." +"``unicode(string [, encoding] [, errors] )`` creates a Unicode string from " +"an 8-bit string. ``encoding`` is a string naming the encoding to use. The " +"``errors`` parameter specifies the treatment of characters that are invalid " +"for the current encoding; passing ``'strict'`` as the value causes an " +"exception to be raised on any encoding error, while ``'ignore'`` causes " +"errors to be silently ignored and ``'replace'`` uses U+FFFD, the official " +"replacement character, in case of any problems." #: ../../whatsnew/2.0.rst:192 msgid "" @@ -404,11 +424,11 @@ msgid "" "built-ins; if you find a built-in function that accepts strings but doesn't " "accept Unicode strings at all, please report it as a bug.)" msgstr "" -"A instrução ``exec``, e vários embutidos como ``eval()``, ``getattr()`` e " -"``setattr()`` também aceitarão strings Unicode assim como strings regulares. " -"(É possível que o processo de consertar isso tenha perdido algumas funções " -"embutidas; se você encontrar uma função embutida que aceita strings, mas não " -"aceita strings Unicode, informe-o como um bug.)" +"The ``exec`` statement, and various built-ins such as ``eval()``, " +"``getattr()``, and ``setattr()`` will also accept Unicode strings as well as " +"regular strings. (It's possible that the process of fixing this missed some " +"built-ins; if you find a built-in function that accepts strings but doesn't " +"accept Unicode strings at all, please report it as a bug.)" #: ../../whatsnew/2.0.rst:198 msgid "" @@ -418,12 +438,11 @@ msgid "" "it's uppercase. ``unicodedata.bidirectional(u'\\u0660')`` returns 'AN', " "meaning that U+0660 is an Arabic number." msgstr "" -"Um novo módulo, :mod:`unicodedata`, fornece uma interface para as " -"propriedades de caracteres Unicode. Por exemplo, ``unicodedata." -"category(u'A')`` retorna a string de 2 caracteres 'Lu', o 'L' denotando sua " -"letra e 'u' significando que é em maiúsculo. ``unicodedata." -"bidirectional(u'\\u0660')`` retorna 'AN', significando que U+0660 é um " -"número árabe." +"A new module, :mod:`unicodedata`, provides an interface to Unicode character " +"properties. For example, ``unicodedata.category(u'A')`` returns the 2-" +"character string 'Lu', the 'L' denoting it's a letter, and 'u' meaning that " +"it's uppercase. ``unicodedata.bidirectional(u'\\u0660')`` returns 'AN', " +"meaning that U+0660 is an Arabic number." #: ../../whatsnew/2.0.rst:204 msgid "" @@ -432,11 +451,10 @@ msgid "" "most often use the ``codecs.lookup(encoding)`` function, which returns a 4-" "element tuple: ``(encode_func, decode_func, stream_reader, stream_writer)``." msgstr "" -"O módulo :mod:`codecs` contém funções para pesquisar codificações existentes " -"e registrar novas. A menos que você queira implementar uma nova codificação, " -"você usará mais frequentemente a função ``codecs.lookup(encoding)``, a qual " -"retorna uma tupla de 4 elementos: ``(encode_func, decode_func, " -"stream_reader, stream_writer)``." +"The :mod:`codecs` module contains functions to look up existing encodings " +"and register new ones. Unless you want to implement a new encoding, you'll " +"most often use the ``codecs.lookup(encoding)`` function, which returns a 4-" +"element tuple: ``(encode_func, decode_func, stream_reader, stream_writer)``." #: ../../whatsnew/2.0.rst:209 msgid "" @@ -446,10 +464,11 @@ msgid "" "encoding, and *length* tells you how much of the Unicode string was " "converted." msgstr "" -"*encode_func* é uma função que recebe uma string Unicode e retorna uma tupla " -"de 2 elementos ``(string, length)``. *string* é uma string de 8 bits que " -"contém uma parte (talvez toda) da string Unicode convertida na codificação " -"fornecida e *length* informa quanto da string Unicode foi convertida." +"*encode_func* is a function that takes a Unicode string, and returns a 2-" +"tuple ``(string, length)``. *string* is an 8-bit string containing a " +"portion (perhaps all) of the Unicode string converted into the given " +"encoding, and *length* tells you how much of the Unicode string was " +"converted." #: ../../whatsnew/2.0.rst:214 msgid "" @@ -458,10 +477,10 @@ msgid "" "Unicode string *ustring* and the integer *length* telling how much of the 8-" "bit string was consumed." msgstr "" -"*decode_func* é o oposto de *encode_func*, pegando uma string de 8 bits e " -"retornando uma tupla de 2 elementos ``(ustring, length)``, consistindo na " -"string Unicode resultante *ustring* e o inteiro *length* informando quanto " -"do String de 8 bits foi consumida." +"*decode_func* is the opposite of *encode_func*, taking an 8-bit string and " +"returning a 2-tuple ``(ustring, length)``, consisting of the resulting " +"Unicode string *ustring* and the integer *length* telling how much of the 8-" +"bit string was consumed." #: ../../whatsnew/2.0.rst:219 msgid "" @@ -470,6 +489,10 @@ msgid "" "read`, :meth:`!readline`, and :meth:`!readlines` methods. These methods " "will all translate from the given encoding and return Unicode strings." msgstr "" +"*stream_reader* is a class that supports decoding input from a stream. " +"*stream_reader(file_obj)* returns an object that supports the :meth:`!" +"read`, :meth:`!readline`, and :meth:`!readlines` methods. These methods " +"will all translate from the given encoding and return Unicode strings." #: ../../whatsnew/2.0.rst:224 msgid "" @@ -478,16 +501,22 @@ msgid "" "`!write` and :meth:`!writelines` methods. These methods expect Unicode " "strings, translating them to the given encoding on output." msgstr "" +"*stream_writer*, similarly, is a class that supports encoding output to a " +"stream. *stream_writer(file_obj)* returns an object that supports the :meth:" +"`!write` and :meth:`!writelines` methods. These methods expect Unicode " +"strings, translating them to the given encoding on output." #: ../../whatsnew/2.0.rst:229 msgid "" "For example, the following code writes a Unicode string into a file, " "encoding it as UTF-8::" msgstr "" +"For example, the following code writes a Unicode string into a file, " +"encoding it as UTF-8::" #: ../../whatsnew/2.0.rst:243 msgid "The following code would then read UTF-8 input from the file::" -msgstr "" +msgstr "The following code would then read UTF-8 input from the file::" #: ../../whatsnew/2.0.rst:249 msgid "" @@ -495,6 +524,9 @@ msgid "" "module, which has a new underlying implementation called SRE written by " "Fredrik Lundh of Secret Labs AB." msgstr "" +"Unicode-aware regular expressions are available through the :mod:`re` " +"module, which has a new underlying implementation called SRE written by " +"Fredrik Lundh of Secret Labs AB." #: ../../whatsnew/2.0.rst:253 msgid "" @@ -504,10 +536,15 @@ msgid "" "future version of Python may drop support for 8-bit strings and provide only " "Unicode strings." msgstr "" +"A ``-U`` command line option was added which causes the Python compiler to " +"interpret all string literals as Unicode string literals. This is intended " +"to be used in testing and future-proofing your Python code, since some " +"future version of Python may drop support for 8-bit strings and provide only " +"Unicode strings." #: ../../whatsnew/2.0.rst:262 msgid "List Comprehensions" -msgstr "Compreensões de lista" +msgstr "List Comprehensions" #: ../../whatsnew/2.0.rst:264 msgid "" @@ -518,6 +555,12 @@ msgid "" "might want to pull out all the strings containing a given substring, or " "strip off trailing whitespace from each line." msgstr "" +"Lists are a workhorse data type in Python, and many programs manipulate a " +"list at some point. Two common operations on lists are to loop over them, " +"and either pick out the elements that meet a certain criterion, or apply " +"some function to each element. For example, given a list of strings, you " +"might want to pull out all the strings containing a given substring, or " +"strip off trailing whitespace from each line." #: ../../whatsnew/2.0.rst:271 msgid "" @@ -530,6 +573,14 @@ msgid "" "paragraph, finding all the strings in the list containing a given " "substring. You could write the following to do it::" msgstr "" +"The existing :func:`map` and :func:`filter` functions can be used for this " +"purpose, but they require a function as one of their arguments. This is " +"fine if there's an existing built-in function that can be passed directly, " +"but if there isn't, you have to create a little function to do the required " +"work, and Python's scoping rules make the result ugly if the little function " +"needs additional information. Take the first example in the previous " +"paragraph, finding all the strings in the list containing a given " +"substring. You could write the following to do it::" #: ../../whatsnew/2.0.rst:286 msgid "" @@ -537,10 +588,13 @@ msgid "" "anonymous function created by the :keyword:`lambda` expression knows what " "substring is being searched for. List comprehensions make this cleaner::" msgstr "" +"Because of Python's scoping rules, a default argument is used so that the " +"anonymous function created by the :keyword:`lambda` expression knows what " +"substring is being searched for. List comprehensions make this cleaner::" #: ../../whatsnew/2.0.rst:292 msgid "List comprehensions have the form::" -msgstr "" +msgstr "List comprehensions have the form::" #: ../../whatsnew/2.0.rst:299 msgid "" @@ -552,12 +606,21 @@ msgid "" "keyword:`!if` clause is optional; if present, *expression* is only evaluated " "and added to the result if *condition* is true." msgstr "" +"The :keyword:`!for`...\\ :keyword:`!in` clauses contain the sequences to be " +"iterated over. The sequences do not have to be the same length, because " +"they are *not* iterated over in parallel, but from left to right; this is " +"explained more clearly in the following paragraphs. The elements of the " +"generated list will be the successive values of *expression*. The final :" +"keyword:`!if` clause is optional; if present, *expression* is only evaluated " +"and added to the result if *condition* is true." #: ../../whatsnew/2.0.rst:307 msgid "" "To make the semantics very clear, a list comprehension is equivalent to the " "following Python code::" msgstr "" +"To make the semantics very clear, a list comprehension is equivalent to the " +"following Python code::" #: ../../whatsnew/2.0.rst:319 msgid "" @@ -566,6 +629,10 @@ msgid "" "all the sequences. If you have two lists of length 3, the output list is 9 " "elements long::" msgstr "" +"This means that when there are multiple :keyword:`!for`...\\ :keyword:`!in` " +"clauses, the resulting list will be equal to the product of the lengths of " +"all the sequences. If you have two lists of length 3, the output list is 9 " +"elements long::" #: ../../whatsnew/2.0.rst:330 msgid "" @@ -573,6 +640,9 @@ msgid "" "creating a tuple, it must be surrounded with parentheses. The first list " "comprehension below is a syntax error, while the second one is correct::" msgstr "" +"To avoid introducing an ambiguity into Python's grammar, if *expression* is " +"creating a tuple, it must be surrounded with parentheses. The first list " +"comprehension below is a syntax error, while the second one is correct::" #: ../../whatsnew/2.0.rst:339 msgid "" @@ -582,10 +652,15 @@ msgid "" "comprehension patch, which was then discussed for a seemingly endless time " "on the python-dev mailing list and kept up-to-date by Skip Montanaro." msgstr "" +"The idea of list comprehensions originally comes from the functional " +"programming language Haskell (https://www.haskell.org). Greg Ewing argued " +"most effectively for adding them to Python and wrote the initial list " +"comprehension patch, which was then discussed for a seemingly endless time " +"on the python-dev mailing list and kept up-to-date by Skip Montanaro." #: ../../whatsnew/2.0.rst:349 msgid "Augmented Assignment" -msgstr "" +msgstr "Augmented Assignment" #: ../../whatsnew/2.0.rst:351 msgid "" @@ -595,6 +670,11 @@ msgid "" "value of the variable ``a`` by 2, equivalent to the slightly lengthier ``a " "= a + 2``." msgstr "" +"Augmented assignment operators, another long-requested feature, have been " +"added to Python 2.0. Augmented assignment operators include ``+=``, ``-=``, " +"``*=``, and so forth. For example, the statement ``a += 2`` increments the " +"value of the variable ``a`` by 2, equivalent to the slightly lengthier ``a " +"= a + 2``." #: ../../whatsnew/2.0.rst:356 msgid "" @@ -605,6 +685,12 @@ msgid "" "following :class:`!Number` class stores a number and supports using += to " "create a new instance with an incremented value." msgstr "" +"The full list of supported assignment operators is ``+=``, ``-=``, ``*=``, " +"``/=``, ``%=``, ``**=``, ``&=``, ``|=``, ``^=``, ``>>=``, and ``<<=``. " +"Python classes can override the augmented assignment operators by defining " +"methods named :meth:`!__iadd__`, :meth:`!__isub__`, etc. For example, the " +"following :class:`!Number` class stores a number and supports using += to " +"create a new instance with an incremented value." #: ../../whatsnew/2.0.rst:377 msgid "" @@ -613,6 +699,10 @@ msgid "" "value; this return value is bound as the new value of the variable on the " "left-hand side." msgstr "" +"The :meth:`!__iadd__` special method is called with the value of the " +"increment, and should return a new instance with an appropriately modified " +"value; this return value is bound as the new value of the variable on the " +"left-hand side." #: ../../whatsnew/2.0.rst:381 msgid "" @@ -621,10 +711,14 @@ msgid "" "Perl, and PHP also support them. The augmented assignment patch was " "implemented by Thomas Wouters." msgstr "" +"Augmented assignment operators were first introduced in the C programming " +"language, and most C-derived languages, such as :program:`awk`, C++, Java, " +"Perl, and PHP also support them. The augmented assignment patch was " +"implemented by Thomas Wouters." #: ../../whatsnew/2.0.rst:390 msgid "String Methods" -msgstr "Métodos de string" +msgstr "String Methods" #: ../../whatsnew/2.0.rst:392 msgid "" @@ -636,6 +730,13 @@ msgid "" "replace`, which takes 3 string arguments, that means eight possible " "permutations, and correspondingly complicated code." msgstr "" +"Until now string-manipulation functionality was in the :mod:`string` module, " +"which was usually a front-end for the :mod:`!strop` module written in C. " +"The addition of Unicode posed a difficulty for the :mod:`!strop` module, " +"because the functions would all need to be rewritten in order to accept " +"either 8-bit or Unicode strings. For functions such as :func:`!string." +"replace`, which takes 3 string arguments, that means eight possible " +"permutations, and correspondingly complicated code." #: ../../whatsnew/2.0.rst:400 msgid "" @@ -643,6 +744,9 @@ msgid "" "manipulation functionality available through methods on both 8-bit strings " "and Unicode strings. ::" msgstr "" +"Instead, Python 2.0 pushes the problem onto the string type, making string " +"manipulation functionality available through methods on both 8-bit strings " +"and Unicode strings. ::" #: ../../whatsnew/2.0.rst:411 msgid "" @@ -651,13 +755,19 @@ msgid "" "methods return new strings, and do not modify the string on which they " "operate." msgstr "" +"One thing that hasn't changed, a noteworthy April Fools' joke " +"notwithstanding, is that Python strings are immutable. Thus, the string " +"methods return new strings, and do not modify the string on which they " +"operate." #: ../../whatsnew/2.0.rst:415 msgid "" "The old :mod:`string` module is still around for backwards compatibility, " "but it mostly acts as a front-end to the new string methods." msgstr "" - +"The old :mod:`string` module is still around for backwards compatibility, " +"but it mostly acts as a front-end to the new string methods." + #: ../../whatsnew/2.0.rst:418 msgid "" "Two methods which have no parallel in pre-2.0 versions, although they did " @@ -665,6 +775,10 @@ msgid "" "endswith`. ``s.startswith(t)`` is equivalent to ``s[:len(t)] == t``, while " "``s.endswith(t)`` is equivalent to ``s[-len(t):] == t``." msgstr "" +"Two methods which have no parallel in pre-2.0 versions, although they did " +"exist in JPython for quite some time, are :meth:`!startswith` and :meth:`!" +"endswith`. ``s.startswith(t)`` is equivalent to ``s[:len(t)] == t``, while " +"``s.endswith(t)`` is equivalent to ``s[-len(t):] == t``." #: ../../whatsnew/2.0.rst:423 msgid "" @@ -674,10 +788,15 @@ msgid "" "`string` module, with the arguments reversed. In other words, ``s." "join(seq)`` is equivalent to the old ``string.join(seq, s)``." msgstr "" +"One other method which deserves special mention is :meth:`!join`. The :meth:" +"`!join` method of a string receives one parameter, a sequence of strings, " +"and is equivalent to the :func:`!string.join` function from the old :mod:" +"`string` module, with the arguments reversed. In other words, ``s." +"join(seq)`` is equivalent to the old ``string.join(seq, s)``." #: ../../whatsnew/2.0.rst:433 msgid "Garbage Collection of Cycles" -msgstr "" +msgstr "Garbage Collection of Cycles" #: ../../whatsnew/2.0.rst:435 msgid "" @@ -688,6 +807,12 @@ msgid "" "no longer accessible, since you need to have a reference to an object to " "access it, and if the count is zero, no references exist any longer." msgstr "" +"The C implementation of Python uses reference counting to implement garbage " +"collection. Every Python object maintains a count of the number of " +"references pointing to itself, and adjusts the count as references are " +"created or destroyed. Once the reference count reaches zero, the object is " +"no longer accessible, since you need to have a reference to an object to " +"access it, and if the count is zero, no references exist any longer." #: ../../whatsnew/2.0.rst:442 msgid "" @@ -698,12 +823,20 @@ msgid "" "doesn't realise that objects are no longer accessible, resulting in a memory " "leak. This happens when there are cycles of references." msgstr "" +"Reference counting has some pleasant properties: it's easy to understand and " +"implement, and the resulting implementation is portable, fairly fast, and " +"reacts well with other libraries that implement their own memory handling " +"schemes. The major problem with reference counting is that it sometimes " +"doesn't realise that objects are no longer accessible, resulting in a memory " +"leak. This happens when there are cycles of references." #: ../../whatsnew/2.0.rst:449 msgid "" "Consider the simplest possible cycle, a class instance which has a " "reference to itself::" msgstr "" +"Consider the simplest possible cycle, a class instance which has a " +"reference to itself::" #: ../../whatsnew/2.0.rst:455 msgid "" @@ -711,6 +844,9 @@ msgid "" "``instance`` is 2; one reference is from the variable named ``'instance'``, " "and the other is from the ``myself`` attribute of the instance." msgstr "" +"After the above two lines of code have been executed, the reference count of " +"``instance`` is 2; one reference is from the variable named ``'instance'``, " +"and the other is from the ``myself`` attribute of the instance." #: ../../whatsnew/2.0.rst:459 msgid "" @@ -721,6 +857,12 @@ msgid "" "objects can participate in a cycle if they have references to each other, " "causing all of the objects to be leaked." msgstr "" +"If the next line of code is ``del instance``, what happens? The reference " +"count of ``instance`` is decreased by 1, so it has a reference count of 1; " +"the reference in the ``myself`` attribute still exists. Yet the instance is " +"no longer accessible through Python code, and it could be deleted. Several " +"objects can participate in a cycle if they have references to each other, " +"causing all of the objects to be leaked." #: ../../whatsnew/2.0.rst:466 msgid "" @@ -730,6 +872,11 @@ msgid "" "collection, obtain debugging statistics, and tuning the collector's " "parameters." msgstr "" +"Python 2.0 fixes this problem by periodically executing a cycle detection " +"algorithm which looks for inaccessible cycles and deletes the objects " +"involved. A new :mod:`gc` module provides functions to perform a garbage " +"collection, obtain debugging statistics, and tuning the collector's " +"parameters." #: ../../whatsnew/2.0.rst:471 msgid "" @@ -744,6 +891,16 @@ msgid "" "buggy, by specifying the :option:`!--without-cycle-gc` switch when running " "the :program:`configure` script." msgstr "" +"Running the cycle detection algorithm takes some time, and therefore will " +"result in some additional overhead. It is hoped that after we've gotten " +"experience with the cycle collection from using 2.0, Python 2.1 will be able " +"to minimize the overhead with careful tuning. It's not yet obvious how much " +"performance is lost, because benchmarking this is tricky and depends " +"crucially on how often the program creates and destroys objects. The " +"detection of cycles can be disabled when Python is compiled, if you can't " +"afford even a tiny speed penalty or suspect that the cycle collection is " +"buggy, by specifying the :option:`!--without-cycle-gc` switch when running " +"the :program:`configure` script." #: ../../whatsnew/2.0.rst:482 msgid "" @@ -757,10 +914,19 @@ msgid "" "threads titled \"Reference cycle collection for Python\" and \"Finalization " "again\"." msgstr "" +"Several people tackled this problem and contributed to a solution. An early " +"implementation of the cycle detection approach was written by Toby Kelsey. " +"The current algorithm was suggested by Eric Tiedemann during a visit to " +"CNRI, and Guido van Rossum and Neil Schemenauer wrote two different " +"implementations, which were later integrated by Neil. Lots of other people " +"offered suggestions along the way; the March 2000 archives of the python-dev " +"mailing list contain most of the relevant discussion, especially in the " +"threads titled \"Reference cycle collection for Python\" and \"Finalization " +"again\"." #: ../../whatsnew/2.0.rst:495 msgid "Other Core Changes" -msgstr "" +msgstr "Other Core Changes" #: ../../whatsnew/2.0.rst:497 msgid "" @@ -768,10 +934,13 @@ msgid "" "functions. None of the changes are very far-reaching, but they're handy " "conveniences." msgstr "" +"Various minor changes have been made to Python's syntax and built-in " +"functions. None of the changes are very far-reaching, but they're handy " +"conveniences." #: ../../whatsnew/2.0.rst:502 msgid "Minor Language Changes" -msgstr "Alterações Menores na Linguagem" +msgstr "Minor Language Changes" #: ../../whatsnew/2.0.rst:504 msgid "" @@ -784,6 +953,14 @@ msgid "" "and clearer way to achieve the same effect. This syntax is symmetrical with " "the syntax for defining functions::" msgstr "" +"A new syntax makes it more convenient to call a given function with a tuple " +"of arguments and/or a dictionary of keyword arguments. In Python 1.5 and " +"earlier, you'd use the :func:`!apply` built-in function: ``apply(f, args, " +"kw)`` calls the function :func:`!f` with the argument tuple *args* and the " +"keyword arguments in the dictionary *kw*. :func:`!apply` is the same in " +"2.0, but thanks to a patch from Greg Ewing, ``f(*args, **kw)`` is a shorter " +"and clearer way to achieve the same effect. This syntax is symmetrical with " +"the syntax for defining functions::" #: ../../whatsnew/2.0.rst:518 msgid "" @@ -795,6 +972,13 @@ msgid "" "``sys.stdout`` and then restore the old value. For sending output to " "standard error, it's much easier to write this::" msgstr "" +"The ``print`` statement can now have its output directed to a file-like " +"object by following the ``print`` with ``>> file``, similar to the " +"redirection operator in Unix shells. Previously you'd either have to use " +"the :meth:`!write` method of the file-like object, which lacks the " +"convenience and simplicity of ``print``, or you could assign a new value to " +"``sys.stdout`` and then restore the old value. For sending output to " +"standard error, it's much easier to write this::" #: ../../whatsnew/2.0.rst:528 msgid "" @@ -802,6 +986,9 @@ msgid "" "module as name`` or ``from module import name as othername``. The patch was " "submitted by Thomas Wouters." msgstr "" +"Modules can now be renamed on importing them, using the syntax ``import " +"module as name`` or ``from module import name as othername``. The patch was " +"submitted by Thomas Wouters." #: ../../whatsnew/2.0.rst:532 msgid "" @@ -811,6 +998,11 @@ msgid "" "which inserts the :func:`str` of its argument. For example, ``'%r %s' % " "('abc', 'abc')`` returns a string containing ``'abc' abc``." msgstr "" +"A new format style is available when using the ``%`` operator; '%r' will " +"insert the :func:`repr` of its argument. This was also added from symmetry " +"considerations, this time for symmetry with the existing '%s' format style, " +"which inserts the :func:`str` of its argument. For example, ``'%r %s' % " +"('abc', 'abc')`` returns a string containing ``'abc' abc``." #: ../../whatsnew/2.0.rst:538 msgid "" @@ -824,6 +1016,15 @@ msgid "" "built-in objects written in C can define what :keyword:`!in` means for them " "via a new slot in the sequence protocol." msgstr "" +"Previously there was no way to implement a class that overrode Python's " +"built-in :keyword:`in` operator and implemented a custom version. ``obj in " +"seq`` returns true if *obj* is present in the sequence *seq*; Python " +"computes this by simply trying every index of the sequence until either " +"*obj* is found or an :exc:`IndexError` is encountered. Moshe Zadka " +"contributed a patch which adds a :meth:`!__contains__` magic method for " +"providing a custom implementation for :keyword:`!in`. Additionally, new " +"built-in objects written in C can define what :keyword:`!in` means for them " +"via a new slot in the sequence protocol." #: ../../whatsnew/2.0.rst:547 msgid "" @@ -834,6 +1035,12 @@ msgid "" "and crashed; Jeremy Hylton rewrote the code to no longer crash, producing a " "useful result instead. For example, after this code::" msgstr "" +"Earlier versions of Python used a recursive algorithm for deleting objects. " +"Deeply nested data structures could cause the interpreter to fill up the C " +"stack and crash; Christian Tismer rewrote the deletion logic to fix this " +"problem. On a related note, comparing recursive objects recursed infinitely " +"and crashed; Jeremy Hylton rewrote the code to no longer crash, producing a " +"useful result instead. For example, after this code::" #: ../../whatsnew/2.0.rst:559 msgid "" @@ -846,6 +1053,14 @@ msgid "" "even if a user-defined :meth:`!__cmp__` method encountered an error, since " "the resulting exception would simply be silently swallowed." msgstr "" +"The comparison ``a==b`` returns true, because the two recursive data " +"structures are isomorphic. See the thread \"trashcan and PR#7\" in the April " +"2000 archives of the python-dev mailing list for the discussion leading up " +"to this implementation, and some useful relevant links. Note that " +"comparisons can now also raise exceptions. In earlier versions of Python, a " +"comparison operation such as ``cmp(a,b)`` would always produce an answer, " +"even if a user-defined :meth:`!__cmp__` method encountered an error, since " +"the resulting exception would simply be silently swallowed." #: ../../whatsnew/2.0.rst:571 msgid "" @@ -856,6 +1071,12 @@ msgid "" "supports Windows CE; see the Python CE page at https://pythonce.sourceforge." "net/ for more information." msgstr "" +"Work has been done on porting Python to 64-bit Windows on the Itanium " +"processor, mostly by Trent Mick of ActiveState. (Confusingly, ``sys." +"platform`` is still ``'win32'`` on Win64 because it seems that for ease of " +"porting, MS Visual C++ treats code as 32 bit on Itanium.) PythonWin also " +"supports Windows CE; see the Python CE page at https://pythonce.sourceforge." +"net/ for more information." #: ../../whatsnew/2.0.rst:577 msgid "" @@ -864,6 +1085,10 @@ msgid "" "suffix=.x\". Consult the README in the Python source distribution for more " "instructions." msgstr "" +"Another new platform is Darwin/MacOS X; initial support for it is in Python " +"2.0. Dynamic loading works, if you specify \"configure --with-dyld --with-" +"suffix=.x\". Consult the README in the Python source distribution for more " +"instructions." #: ../../whatsnew/2.0.rst:581 msgid "" @@ -876,6 +1101,14 @@ msgid "" "exc:`NameError`, so any existing code that expects :exc:`NameError` to be " "raised should still work. ::" msgstr "" +"An attempt has been made to alleviate one of Python's warts, the often-" +"confusing :exc:`NameError` exception when code refers to a local variable " +"before the variable has been assigned a value. For example, the following " +"code raises an exception on the ``print`` statement in both 1.5.2 and 2.0; " +"in 1.5.2 a :exc:`NameError` exception is raised, while 2.0 raises a new :exc:" +"`UnboundLocalError` exception. :exc:`UnboundLocalError` is a subclass of :" +"exc:`NameError`, so any existing code that expects :exc:`NameError` to be " +"raised should still work. ::" #: ../../whatsnew/2.0.rst:595 msgid "" @@ -883,10 +1116,13 @@ msgid "" "introduced. They're both subclasses of :exc:`SyntaxError`, and are raised " "when Python code is found to be improperly indented." msgstr "" +"Two new exceptions, :exc:`TabError` and :exc:`IndentationError`, have been " +"introduced. They're both subclasses of :exc:`SyntaxError`, and are raised " +"when Python code is found to be improperly indented." #: ../../whatsnew/2.0.rst:601 msgid "Changes to Built-in Functions" -msgstr "" +msgstr "Changes to Built-in Functions" #: ../../whatsnew/2.0.rst:603 msgid "" @@ -897,6 +1133,12 @@ msgid "" "``None`` if the sequences aren't all of the same length, while :func:`zip` " "truncates the returned list to the length of the shortest argument sequence." msgstr "" +"A new built-in, ``zip(seq1, seq2, ...)``, has been added. :func:`zip` " +"returns a list of tuples where each tuple contains the i-th element from " +"each of the argument sequences. The difference between :func:`zip` and " +"``map(None, seq1, seq2)`` is that :func:`map` pads the sequences with " +"``None`` if the sequences aren't all of the same length, while :func:`zip` " +"truncates the returned list to the length of the shortest argument sequence." #: ../../whatsnew/2.0.rst:610 msgid "" @@ -906,6 +1148,11 @@ msgid "" "`TypeError` exception with the message \"can't convert non-string with " "explicit base\"." msgstr "" +"The :func:`int` and :func:`!long` functions now accept an optional \"base\" " +"parameter when the first argument is a string. ``int('123', 10)`` returns " +"123, while ``int('123', 16)`` returns 291. ``int(123, 16)`` raises a :exc:" +"`TypeError` exception with the message \"can't convert non-string with " +"explicit base\"." #: ../../whatsnew/2.0.rst:616 msgid "" @@ -915,6 +1162,11 @@ msgid "" "version_info`` would be ``(2, 0, 1, 'beta', 1)``. *level* is a string such " "as ``\"alpha\"``, ``\"beta\"``, or ``\"final\"`` for a final release." msgstr "" +"A new variable holding more detailed version information has been added to " +"the :mod:`sys` module. ``sys.version_info`` is a tuple ``(major, minor, " +"micro, level, serial)`` For example, in a hypothetical 2.0.1beta1, ``sys." +"version_info`` would be ``(2, 0, 1, 'beta', 1)``. *level* is a string such " +"as ``\"alpha\"``, ``\"beta\"``, or ``\"final\"`` for a final release." #: ../../whatsnew/2.0.rst:622 msgid "" @@ -924,11 +1176,17 @@ msgid "" "`!get` would do, and also inserts it into the dictionary as the value for " "*key*. Thus, the following lines of code::" msgstr "" +"Dictionaries have an odd new method, ``setdefault(key, default)``, which " +"behaves similarly to the existing :meth:`!get` method. However, if the key " +"is missing, :meth:`!setdefault` both returns the value of *default* as :meth:" +"`!get` would do, and also inserts it into the dictionary as the value for " +"*key*. Thus, the following lines of code::" #: ../../whatsnew/2.0.rst:633 msgid "" "can be reduced to a single ``return dict.setdefault(key, [])`` statement." msgstr "" +"can be reduced to a single ``return dict.setdefault(key, [])`` statement." #: ../../whatsnew/2.0.rst:635 msgid "" @@ -940,10 +1198,17 @@ msgid "" "1000, and a rough maximum value for a given platform can be found by running " "a new script, :file:`Misc/find_recursionlimit.py`." msgstr "" +"The interpreter sets a maximum recursion depth in order to catch runaway " +"recursion before filling the C stack and causing a core dump or GPF.. " +"Previously this limit was fixed when you compiled Python, but in 2.0 the " +"maximum recursion depth can be read and modified using :func:`sys." +"getrecursionlimit` and :func:`sys.setrecursionlimit`. The default value is " +"1000, and a rough maximum value for a given platform can be found by running " +"a new script, :file:`Misc/find_recursionlimit.py`." #: ../../whatsnew/2.0.rst:647 msgid "Porting to 2.0" -msgstr "" +msgstr "Porting to 2.0" #: ../../whatsnew/2.0.rst:649 msgid "" @@ -954,6 +1219,12 @@ msgid "" "always be avoided. This section lists the changes in Python 2.0 that may " "cause old Python code to break." msgstr "" +"New Python releases try hard to be compatible with previous releases, and " +"the record has been pretty good. However, some changes are considered " +"useful enough, usually because they fix initial design decisions that turned " +"out to be actively mistaken, that breaking backward compatibility can't " +"always be avoided. This section lists the changes in Python 2.0 that may " +"cause old Python code to break." #: ../../whatsnew/2.0.rst:656 msgid "" @@ -967,6 +1238,15 @@ msgid "" "to simply add an extra set of parentheses to pass both values as a tuple: " "``L.append( (1,2) )``." msgstr "" +"The change which will probably break the most code is tightening up the " +"arguments accepted by some methods. Some methods would take multiple " +"arguments and treat them as a tuple, particularly various list methods such " +"as :meth:`!append` and :meth:`!insert`. In earlier versions of Python, if " +"``L`` is a list, ``L.append( 1,2 )`` appends the tuple ``(1,2)`` to the " +"list. In Python 2.0 this causes a :exc:`TypeError` exception to be raised, " +"with the message: 'append requires exactly 1 argument; 2 given'. The fix is " +"to simply add an extra set of parentheses to pass both values as a tuple: " +"``L.append( (1,2) )``." #: ../../whatsnew/2.0.rst:665 msgid "" @@ -979,6 +1259,14 @@ msgid "" "preprocessor symbol ``NO_STRICT_LIST_APPEND`` to preserve the old behaviour; " "this isn't recommended." msgstr "" +"The earlier versions of these methods were more forgiving because they used " +"an old function in Python's C interface to parse their arguments; 2.0 " +"modernizes them to use :c:func:`PyArg_ParseTuple`, the current argument " +"parsing function, which provides more helpful error messages and treats " +"multi-argument calls as errors. If you absolutely must use 2.0 but can't " +"fix your code, you can edit :file:`Objects/listobject.c` and define the " +"preprocessor symbol ``NO_STRICT_LIST_APPEND`` to preserve the old behaviour; " +"this isn't recommended." #: ../../whatsnew/2.0.rst:673 msgid "" @@ -995,6 +1283,18 @@ msgid "" "marked as deprecated; it *will* be tightened up again in a future Python " "version." msgstr "" +"Some of the functions in the :mod:`socket` module are still forgiving in " +"this way. For example, ``socket.connect( ('hostname', 25) )`` is the " +"correct form, passing a tuple representing an IP address, but ``socket." +"connect('hostname', 25)`` also works. :meth:`socket.connect_ex ` and :meth:`socket.bind ` are " +"similarly easy-going. 2.0alpha1 tightened these functions up, but because " +"the documentation actually used the erroneous multiple argument form, many " +"people wrote code which would break with the stricter checking. GvR backed " +"out the changes in the face of public reaction, so for the :mod:`socket` " +"module, the documentation was fixed and the multiple argument form is simply " +"marked as deprecated; it *will* be tightened up again in a future Python " +"version." #: ../../whatsnew/2.0.rst:684 msgid "" @@ -1003,6 +1303,10 @@ msgid "" "the lowest 8 bits of the result, so ``\\x123456`` was equivalent to " "``\\x56``." msgstr "" +"The ``\\x`` escape in string literals now takes exactly 2 hex digits. " +"Previously it would consume all the hex digits following the 'x' and take " +"the lowest 8 bits of the result, so ``\\x123456`` was equivalent to " +"``\\x56``." #: ../../whatsnew/2.0.rst:688 msgid "" @@ -1012,6 +1316,11 @@ msgid "" "error message was just the missing attribute name ``eggs``, and code written " "to take advantage of this fact will break in 2.0." msgstr "" +"The :exc:`AttributeError` and :exc:`NameError` exceptions have a more " +"friendly error message, whose text will be something like ``'Spam' instance " +"has no attribute 'eggs'`` or ``name 'eggs' is not defined``. Previously the " +"error message was just the missing attribute name ``eggs``, and code written " +"to take advantage of this fact will break in 2.0." #: ../../whatsnew/2.0.rst:694 msgid "" @@ -1029,6 +1338,19 @@ msgid "" "the ``%`` operator (``%d``, ``%i``, ``%x``, etc.). For example, ``\"%d\" % " "2L**64`` will produce the string ``18446744073709551616``." msgstr "" +"Some work has been done to make integers and long integers a bit more " +"interchangeable. In 1.5.2, large-file support was added for Solaris, to " +"allow reading files larger than 2 GiB; this made the :meth:`!tell` method of " +"file objects return a long integer instead of a regular integer. Some code " +"would subtract two file offsets and attempt to use the result to multiply a " +"sequence or slice a string, but this raised a :exc:`TypeError`. In 2.0, " +"long integers can be used to multiply or slice a sequence, and it'll behave " +"as you'd intuitively expect it to; ``3L * 'abc'`` produces 'abcabcabc', and " +"``(0,1,2,3)[2L:4L]`` produces (2,3). Long integers can also be used in " +"various contexts where previously only integers were accepted, such as in " +"the :meth:`!seek` method of file objects, and in the formats supported by " +"the ``%`` operator (``%d``, ``%i``, ``%x``, etc.). For example, ``\"%d\" % " +"2L**64`` will produce the string ``18446744073709551616``." #: ../../whatsnew/2.0.rst:708 msgid "" @@ -1040,6 +1362,13 @@ msgid "" "which does ``str(longval)[:-1]`` and assumes the 'L' is there, will now lose " "the final digit." msgstr "" +"The subtlest long integer change of all is that the :func:`str` of a long " +"integer no longer has a trailing 'L' character, though :func:`repr` still " +"includes it. The 'L' annoyed many people who wanted to print long integers " +"that looked just like regular integers, since they had to go out of their " +"way to chop off the character. This is no longer a problem in 2.0, but code " +"which does ``str(longval)[:-1]`` and assumes the 'L' is there, will now lose " +"the final digit." #: ../../whatsnew/2.0.rst:716 msgid "" @@ -1051,6 +1380,13 @@ msgid "" "in binary, so ``repr(8.1)`` is ``'8.0999999999999996'``, while str(8.1) is " "``'8.1'``." msgstr "" +"Taking the :func:`repr` of a float now uses a different formatting precision " +"than :func:`str`. :func:`repr` uses ``%.17g`` format string for C's :func:`!" +"sprintf`, while :func:`str` uses ``%.12g`` as before. The effect is that :" +"func:`repr` may occasionally show more decimal places than :func:`str`, for " +"certain numbers. For example, the number 8.1 can't be represented exactly " +"in binary, so ``repr(8.1)`` is ``'8.0999999999999996'``, while str(8.1) is " +"``'8.1'``." #: ../../whatsnew/2.0.rst:724 msgid "" @@ -1060,10 +1396,15 @@ msgid "" "standard exceptions was translated from Python to a built-in C module, " "written by Barry Warsaw and Fredrik Lundh." msgstr "" +"The ``-X`` command-line option, which turned all standard exceptions into " +"strings instead of classes, has been removed; the standard exceptions will " +"now always be classes. The :mod:`!exceptions` module containing the " +"standard exceptions was translated from Python to a built-in C module, " +"written by Barry Warsaw and Fredrik Lundh." #: ../../whatsnew/2.0.rst:740 msgid "Extending/Embedding Changes" -msgstr "" +msgstr "Extending/Embedding Changes" #: ../../whatsnew/2.0.rst:742 msgid "" @@ -1072,6 +1413,10 @@ msgid "" "larger application. If you aren't dealing with Python's C API, you can " "safely skip this section." msgstr "" +"Some of the changes are under the covers, and will only be apparent to " +"people writing C extension modules or embedding a Python interpreter in a " +"larger application. If you aren't dealing with Python's C API, you can " +"safely skip this section." #: ../../whatsnew/2.0.rst:747 msgid "" @@ -1081,6 +1426,11 @@ msgid "" "built for Python 1.5.x due to how Windows DLLs work, so Python will raise an " "exception and the import will fail." msgstr "" +"The version number of the Python C API was incremented, so C extensions " +"compiled for 1.5.2 must be recompiled in order to work with 2.0. On " +"Windows, it's not possible for Python 2.0 to import a third party extension " +"built for Python 1.5.x due to how Windows DLLs work, so Python will raise an " +"exception and the import will fail." #: ../../whatsnew/2.0.rst:753 msgid "" @@ -1090,6 +1440,11 @@ msgid "" "remember to write code such as ``if type(obj) == myExtensionClass``, but can " "use the more natural ``if isinstance(obj, myExtensionClass)``." msgstr "" +"Users of Jim Fulton's ExtensionClass module will be pleased to find out that " +"hooks have been added so that ExtensionClasses are now supported by :func:" +"`isinstance` and :func:`issubclass`. This means you no longer have to " +"remember to write code such as ``if type(obj) == myExtensionClass``, but can " +"use the more natural ``if isinstance(obj, myExtensionClass)``." #: ../../whatsnew/2.0.rst:759 msgid "" @@ -1101,6 +1456,13 @@ msgid "" "Include/ directory that held various portability hacks; they've been merged " "into a single file, :file:`Include/pyport.h`." msgstr "" +"The :file:`Python/importdl.c` file, which was a mass of #ifdefs to support " +"dynamic loading on many different platforms, was cleaned up and reorganised " +"by Greg Stein. :file:`importdl.c` is now quite small, and platform-specific " +"code has been moved into a bunch of :file:`Python/dynload_\\*.c` files. " +"Another cleanup: there were also a number of :file:`my\\*.h` files in the " +"Include/ directory that held various portability hacks; they've been merged " +"into a single file, :file:`Include/pyport.h`." #: ../../whatsnew/2.0.rst:767 msgid "" @@ -1111,6 +1473,12 @@ msgid "" "discussions during which the interface was hammered out, see the web " "archives of the 'patches' and 'python-dev' lists at python.org." msgstr "" +"Vladimir Marangozov's long-awaited malloc restructuring was completed, to " +"make it easy to have the Python interpreter use a custom allocator instead " +"of C's standard :c:func:`malloc`. For documentation, read the comments in :" +"file:`Include/pymem.h` and :file:`Include/objimpl.h`. For the lengthy " +"discussions during which the interface was hammered out, see the web " +"archives of the 'patches' and 'python-dev' lists at python.org." #: ../../whatsnew/2.0.rst:774 msgid "" @@ -1119,6 +1487,10 @@ msgid "" "Macintosh. Threading support using the user-space GNU ``pth`` library was " "also contributed." msgstr "" +"Recent versions of the GUSI development environment for MacOS support POSIX " +"threads. Therefore, Python's POSIX threading support now works on the " +"Macintosh. Threading support using the user-space GNU ``pth`` library was " +"also contributed." #: ../../whatsnew/2.0.rst:779 msgid "" @@ -1129,6 +1501,12 @@ msgid "" "as an unthreaded version; with the 2.0 changes, the difference is only 10%. " "These improvements were contributed by Yakov Markovitch." msgstr "" +"Threading support on Windows was enhanced, too. Windows supports thread " +"locks that use kernel objects only in case of contention; in the common case " +"when there's no contention, they use simpler functions which are an order of " +"magnitude faster. A threaded version of Python 1.5.2 on NT is twice as slow " +"as an unthreaded version; with the 2.0 changes, the difference is only 10%. " +"These improvements were contributed by Yakov Markovitch." #: ../../whatsnew/2.0.rst:786 msgid "" @@ -1136,6 +1514,9 @@ msgid "" "requires an ANSI C compiler, and can no longer be done using a compiler that " "only supports K&R C." msgstr "" +"Python 2.0's source now uses only ANSI C prototypes, so compiling Python now " +"requires an ANSI C compiler, and can no longer be done using a compiler that " +"only supports K&R C." #: ../../whatsnew/2.0.rst:790 msgid "" @@ -1144,7 +1525,12 @@ msgid "" "size of literal lists and dictionaries in Python source; occasionally people " "who are generating Python code would run into this limit. A patch by " "Charles G. Waldman raises the limit from ``2**16`` to ``2**32``." -msgstr "" +msgstr "" +"Previously the Python virtual machine used 16-bit numbers in its bytecode, " +"limiting the size of source files. In particular, this affected the maximum " +"size of literal lists and dictionaries in Python source; occasionally people " +"who are generating Python code would run into this limit. A patch by " +"Charles G. Waldman raises the limit from ``2**16`` to ``2**32``." #: ../../whatsnew/2.0.rst:796 msgid "" @@ -1156,6 +1542,13 @@ msgid "" "third argument for the value to be assigned to the name. This third " "argument is, respectively, a Python object, a C long, or a C string." msgstr "" +"Three new convenience functions intended for adding constants to a module's " +"dictionary at module initialization time were added: :c:func:" +"`PyModule_AddObject`, :c:func:`PyModule_AddIntConstant`, and :c:func:" +"`PyModule_AddStringConstant`. Each of these functions takes a module " +"object, a null-terminated C string containing the name to be added, and a " +"third argument for the value to be assigned to the name. This third " +"argument is, respectively, a Python object, a C long, or a C string." #: ../../whatsnew/2.0.rst:804 msgid "" @@ -1163,10 +1556,13 @@ msgid "" "`PyOS_getsig` gets a signal handler and :c:func:`PyOS_setsig` will set a new " "handler." msgstr "" +"A wrapper API was added for Unix-style signal handlers. :c:func:" +"`PyOS_getsig` gets a signal handler and :c:func:`PyOS_setsig` will set a new " +"handler." #: ../../whatsnew/2.0.rst:811 msgid "Distutils: Making Modules Easy to Install" -msgstr "" +msgstr "Distutils: Making Modules Easy to Install" #: ../../whatsnew/2.0.rst:813 msgid "" @@ -1179,6 +1575,14 @@ msgid "" "different extension packages, which made administering a Python installation " "something of a chore." msgstr "" +"Before Python 2.0, installing modules was a tedious affair -- there was no " +"way to figure out automatically where Python is installed, or what compiler " +"options to use for extension modules. Software authors had to go through an " +"arduous ritual of editing Makefiles and configuration files, which only " +"really work on Unix and leave Windows and MacOS unsupported. Python users " +"faced wildly differing installation instructions which varied between " +"different extension packages, which made administering a Python installation " +"something of a chore." #: ../../whatsnew/2.0.rst:821 msgid "" @@ -1195,6 +1599,18 @@ msgid "" "separating the build from the install, building or installing in non-default " "directories, and more." msgstr "" +"The SIG for distribution utilities, shepherded by Greg Ward, has created the " +"Distutils, a system to make package installation much easier. They form the " +"``distutils`` package, a new part of Python's standard library. In the best " +"case, installing a Python module from source will require the same steps: " +"first you simply mean unpack the tarball or zip archive, and the run " +"\"``python setup.py install``\". The platform will be automatically " +"detected, the compiler will be recognized, C extension modules will be " +"compiled, and the distribution installed into the proper directory. " +"Optional command-line arguments provide more control over the installation " +"process, the distutils package offers many places to override defaults -- " +"separating the build from the install, building or installing in non-default " +"directories, and more." #: ../../whatsnew/2.0.rst:833 msgid "" @@ -1202,18 +1618,25 @@ msgid "" "For the simple case, when the software contains only .py files, a minimal :" "file:`setup.py` can be just a few lines long::" msgstr "" +"In order to use the Distutils, you need to write a :file:`setup.py` script. " +"For the simple case, when the software contains only .py files, a minimal :" +"file:`setup.py` can be just a few lines long::" #: ../../whatsnew/2.0.rst:841 msgid "" "The :file:`setup.py` file isn't much more complicated if the software " "consists of a few packages::" msgstr "" +"The :file:`setup.py` file isn't much more complicated if the software " +"consists of a few packages::" #: ../../whatsnew/2.0.rst:848 msgid "" "A C extension can be the most complicated case; here's an example taken from " "the PyXML package::" msgstr "" +"A C extension can be the most complicated case; here's an example taken from " +"the PyXML package::" #: ../../whatsnew/2.0.rst:864 msgid "" @@ -1226,16 +1649,26 @@ msgid "" "distribution formats such as Debian packages and Solaris :file:`.pkg` files " "are in various stages of development." msgstr "" +"The Distutils can also take care of creating source and binary " +"distributions. The \"sdist\" command, run by \"``python setup.py sdist``', " +"builds a source distribution such as :file:`foo-1.0.tar.gz`. Adding new " +"commands isn't difficult, \"bdist_rpm\" and \"bdist_wininst\" commands have " +"already been contributed to create an RPM distribution and a Windows " +"installer for the software, respectively. Commands to create other " +"distribution formats such as Debian packages and Solaris :file:`.pkg` files " +"are in various stages of development." #: ../../whatsnew/2.0.rst:873 msgid "" "All this is documented in a new manual, *Distributing Python Modules*, that " "joins the basic set of Python documentation." msgstr "" +"All this is documented in a new manual, *Distributing Python Modules*, that " +"joins the basic set of Python documentation." #: ../../whatsnew/2.0.rst:880 msgid "XML Modules" -msgstr "" +msgstr "XML Modules" #: ../../whatsnew/2.0.rst:882 msgid "" @@ -1251,10 +1684,21 @@ msgid "" "documentation or the source code for complete details. The Python XML SIG is " "also working on improved documentation." msgstr "" +"Python 1.5.2 included a simple XML parser in the form of the :mod:`!xmllib` " +"module, contributed by Sjoerd Mullender. Since 1.5.2's release, two " +"different interfaces for processing XML have become common: SAX2 (version 2 " +"of the Simple API for XML) provides an event-driven interface with some " +"similarities to :mod:`!xmllib`, and the DOM (Document Object Model) provides " +"a tree-based interface, transforming an XML document into a tree of nodes " +"that can be traversed and modified. Python 2.0 includes a SAX2 interface " +"and a stripped-down DOM interface as part of the :mod:`xml` package. Here we " +"will give a brief overview of these new interfaces; consult the Python " +"documentation or the source code for complete details. The Python XML SIG is " +"also working on improved documentation." #: ../../whatsnew/2.0.rst:896 msgid "SAX2 Support" -msgstr "" +msgstr "SAX2 Support" #: ../../whatsnew/2.0.rst:898 msgid "" @@ -1267,6 +1711,14 @@ msgid "" "meth:`~xml.sax.handler.ContentHandler.characters` method is called for every " "chunk of character data, and so forth." msgstr "" +"SAX defines an event-driven interface for parsing XML. To use SAX, you must " +"write a SAX handler class. Handler classes inherit from various classes " +"provided by SAX, and override various methods that will then be called by " +"the XML parser. For example, the :meth:`~xml.sax.handler.ContentHandler." +"startElement` and :meth:`~xml.sax.handler.ContentHandler.endElement` methods " +"are called for every starting and end tag encountered by the parser, the :" +"meth:`~xml.sax.handler.ContentHandler.characters` method is called for every " +"chunk of character data, and so forth." #: ../../whatsnew/2.0.rst:906 msgid "" @@ -1276,6 +1728,11 @@ msgid "" "class can get very complicated if you're trying to modify the document " "structure in some elaborate way." msgstr "" +"The advantage of the event-driven approach is that the whole document " +"doesn't have to be resident in memory at any one time, which matters if you " +"are processing really huge documents. However, writing the SAX handler " +"class can get very complicated if you're trying to modify the document " +"structure in some elaborate way." #: ../../whatsnew/2.0.rst:912 msgid "" @@ -1283,16 +1740,21 @@ msgid "" "message for every starting and ending tag, and then parses the file :file:" "`hamlet.xml` using it::" msgstr "" +"For example, this little example program defines a handler that prints a " +"message for every starting and ending tag, and then parses the file :file:" +"`hamlet.xml` using it::" #: ../../whatsnew/2.0.rst:935 msgid "" "For more information, consult the Python documentation, or the XML HOWTO at " "https://pyxml.sourceforge.net/topics/howto/xml-howto.html." msgstr "" +"For more information, consult the Python documentation, or the XML HOWTO at " +"https://pyxml.sourceforge.net/topics/howto/xml-howto.html." #: ../../whatsnew/2.0.rst:940 msgid "DOM Support" -msgstr "" +msgstr "DOM Support" #: ../../whatsnew/2.0.rst:942 msgid "" @@ -1305,6 +1767,14 @@ msgid "" "access element and attribute values, insert and delete nodes, and convert " "the tree back into XML." msgstr "" +"The Document Object Model is a tree-based representation for an XML " +"document. A top-level :class:`!Document` instance is the root of the tree, " +"and has a single child which is the top-level :class:`!Element` instance. " +"This :class:`!Element` has children nodes representing character data and " +"any sub-elements, which may have further children of their own, and so " +"forth. Using the DOM you can traverse the resulting tree any way you like, " +"access element and attribute values, insert and delete nodes, and convert " +"the tree back into XML." #: ../../whatsnew/2.0.rst:950 msgid "" @@ -1315,6 +1785,12 @@ msgid "" "producing XML output than simply writing ````...\\ ```` to a " "file." msgstr "" +"The DOM is useful for modifying XML documents, because you can create a DOM " +"tree, modify it by adding new nodes or rearranging subtrees, and then " +"produce a new XML document as output. You can also construct a DOM tree " +"manually and convert it to XML, which can be a more flexible way of " +"producing XML output than simply writing ````...\\ ```` to a " +"file." #: ../../whatsnew/2.0.rst:956 msgid "" @@ -1323,6 +1799,10 @@ msgid "" "support for XML namespaces. The :func:`!parse` and :func:`!parseString` " "convenience functions are provided for generating a DOM tree::" msgstr "" +"The DOM implementation included with Python lives in the :mod:`xml.dom." +"minidom` module. It's a lightweight implementation of the Level 1 DOM with " +"support for XML namespaces. The :func:`!parse` and :func:`!parseString` " +"convenience functions are provided for generating a DOM tree::" #: ../../whatsnew/2.0.rst:964 msgid "" @@ -1335,10 +1815,18 @@ msgid "" "and :class:`!Document` instances have a method to find all child elements " "with a given tag name. Continuing from the previous 2-line example::" msgstr "" +"``doc`` is a :class:`!Document` instance. :class:`!Document`, like all the " +"other DOM classes such as :class:`!Element` and :class:`Text`, is a subclass " +"of the :class:`!Node` base class. All the nodes in a DOM tree therefore " +"support certain common methods, such as :meth:`!toxml` which returns a " +"string containing the XML representation of the node and its children. Each " +"class also has special methods of its own; for example, :class:`!Element` " +"and :class:`!Document` instances have a method to find all child elements " +"with a given tag name. Continuing from the previous 2-line example::" #: ../../whatsnew/2.0.rst:977 msgid "For the *Hamlet* XML file, the above few lines output::" -msgstr "" +msgstr "For the *Hamlet* XML file, the above few lines output::" #: ../../whatsnew/2.0.rst:982 msgid "" @@ -1346,16 +1834,21 @@ msgid "" "and its children can be easily modified by deleting, adding, or removing " "nodes::" msgstr "" +"The root element of the document is available as ``doc.documentElement``, " +"and its children can be easily modified by deleting, adding, or removing " +"nodes::" #: ../../whatsnew/2.0.rst:997 msgid "" "Again, I will refer you to the Python documentation for a complete listing " "of the different :class:`!Node` classes and their various methods." msgstr "" +"Again, I will refer you to the Python documentation for a complete listing " +"of the different :class:`!Node` classes and their various methods." #: ../../whatsnew/2.0.rst:1002 msgid "Relationship to PyXML" -msgstr "" +msgstr "Relationship to PyXML" #: ../../whatsnew/2.0.rst:1004 msgid "" @@ -1366,6 +1859,12 @@ msgid "" "written programs that used PyXML, you're probably wondering about its " "compatibility with the 2.0 :mod:`xml` package." msgstr "" +"The XML Special Interest Group has been working on XML-related Python code " +"for a while. Its code distribution, called PyXML, is available from the " +"SIG's web pages at https://www.python.org/community/sigs/current/xml-sig. " +"The PyXML distribution also used the package name ``xml``. If you've " +"written programs that used PyXML, you're probably wondering about its " +"compatibility with the 2.0 :mod:`xml` package." #: ../../whatsnew/2.0.rst:1010 msgid "" @@ -1378,22 +1877,31 @@ msgid "" "a strict superset of the standard package, adding a bunch of additional " "features. Some of the additional features in PyXML include:" msgstr "" +"The answer is that Python 2.0's :mod:`xml` package isn't compatible with " +"PyXML, but can be made compatible by installing a recent version PyXML. " +"Many applications can get by with the XML support that is included with " +"Python 2.0, but more complicated applications will require that the full " +"PyXML package will be installed. When installed, PyXML versions 0.6.0 or " +"greater will replace the :mod:`xml` package shipped with Python, and will be " +"a strict superset of the standard package, adding a bunch of additional " +"features. Some of the additional features in PyXML include:" #: ../../whatsnew/2.0.rst:1019 msgid "4DOM, a full DOM implementation from FourThought, Inc." -msgstr "" +msgstr "4DOM, a full DOM implementation from FourThought, Inc." #: ../../whatsnew/2.0.rst:1021 msgid "The xmlproc validating parser, written by Lars Marius Garshol." -msgstr "" +msgstr "The xmlproc validating parser, written by Lars Marius Garshol." #: ../../whatsnew/2.0.rst:1023 msgid "The :mod:`!sgmlop` parser accelerator module, written by Fredrik Lundh." msgstr "" +"The :mod:`!sgmlop` parser accelerator module, written by Fredrik Lundh." #: ../../whatsnew/2.0.rst:1029 msgid "Module changes" -msgstr "" +msgstr "Module changes" #: ../../whatsnew/2.0.rst:1031 msgid "" @@ -1416,12 +1924,22 @@ msgid "" "and :mod:`urllib` modules were also changed to support ``https://`` URLs, " "though no one has implemented FTP or SMTP over SSL." msgstr "" +"Brian Gallew contributed OpenSSL support for the :mod:`socket` module. " +"OpenSSL is an implementation of the Secure Socket Layer, which encrypts the " +"data being sent over a socket. When compiling Python, you can edit :file:" +"`Modules/Setup` to include SSL support, which adds an additional function to " +"the :mod:`socket` module: ``socket.ssl(socket, keyfile, certfile)``, which " +"takes a socket object and returns an SSL socket. The :mod:`httplib ` " +"and :mod:`urllib` modules were also changed to support ``https://`` URLs, " +"though no one has implemented FTP or SMTP over SSL." #: ../../whatsnew/2.0.rst:1046 msgid "" "The :mod:`httplib ` module has been rewritten by Greg Stein to support " "HTTP/1.1." msgstr "" +"The :mod:`httplib ` module has been rewritten by Greg Stein to support " +"HTTP/1.1." #: ../../whatsnew/2.0.rst:1048 msgid "" @@ -1429,6 +1947,9 @@ msgid "" "though using HTTP/1.1 features such as pipelining will require rewriting " "code to use a different set of interfaces." msgstr "" +"Backward compatibility with the 1.5 version of :mod:`!httplib` is provided, " +"though using HTTP/1.1 features such as pipelining will require rewriting " +"code to use a different set of interfaces." #: ../../whatsnew/2.0.rst:1052 msgid "" @@ -1438,6 +1959,11 @@ msgid "" "contributed an optimization which makes operations like ``create_line`` and " "``create_polygon`` much faster, especially when using lots of coordinates." msgstr "" +"The :mod:`!Tkinter` module now supports Tcl/Tk version 8.1, 8.2, or 8.3, and " +"support for the older 7.x versions has been dropped. The Tkinter module now " +"supports displaying Unicode strings in Tk widgets. Also, Fredrik Lundh " +"contributed an optimization which makes operations like ``create_line`` and " +"``create_polygon`` much faster, especially when using lots of coordinates." #: ../../whatsnew/2.0.rst:1058 msgid "" @@ -1448,6 +1974,12 @@ msgid "" "operating systems that only have BSD curses, but there don't seem to be any " "currently maintained OSes that fall into this category." msgstr "" +"The :mod:`curses` module has been greatly extended, starting from Oliver " +"Andrich's enhanced version, to provide many additional functions from " +"ncurses and SYSV curses, such as colour, alternative character set support, " +"pads, and mouse support. This means the module is no longer compatible with " +"operating systems that only have BSD curses, but there don't seem to be any " +"currently maintained OSes that fall into this category." #: ../../whatsnew/2.0.rst:1065 msgid "" @@ -1457,10 +1989,15 @@ msgid "" "by Fredrik Lundh and partially funded by Hewlett Packard, supports matching " "against both 8-bit strings and Unicode strings." msgstr "" +"As mentioned in the earlier discussion of 2.0's Unicode support, the " +"underlying implementation of the regular expressions provided by the :mod:" +"`re` module has been changed. SRE, a new regular expression engine written " +"by Fredrik Lundh and partially funded by Hewlett Packard, supports matching " +"against both 8-bit strings and Unicode strings." #: ../../whatsnew/2.0.rst:1075 msgid "New modules" -msgstr "" +msgstr "Novos módulos" #: ../../whatsnew/2.0.rst:1077 msgid "" @@ -1468,6 +2005,9 @@ msgid "" "descriptions; consult the 2.0 documentation for the details of a particular " "module." msgstr "" +"A number of new modules were added. We'll simply list them with brief " +"descriptions; consult the 2.0 documentation for the details of a particular " +"module." #: ../../whatsnew/2.0.rst:1081 msgid "" @@ -1477,12 +2017,19 @@ msgid "" "and calling :func:`atexit.register` with the function to be called on exit. " "(Contributed by Skip Montanaro.)" msgstr "" +":mod:`atexit`: For registering functions to be called before the Python " +"interpreter exits. Code that currently sets ``sys.exitfunc`` directly should " +"be changed to use the :mod:`atexit` module instead, importing :mod:`atexit` " +"and calling :func:`atexit.register` with the function to be called on exit. " +"(Contributed by Skip Montanaro.)" #: ../../whatsnew/2.0.rst:1087 msgid "" ":mod:`codecs`, :mod:`!encodings`, :mod:`unicodedata`: Added as part of the " "new Unicode support." msgstr "" +":mod:`codecs`, :mod:`!encodings`, :mod:`unicodedata`: Added as part of the " +"new Unicode support." #: ../../whatsnew/2.0.rst:1090 msgid "" @@ -1490,6 +2037,9 @@ msgid "" "dircmp` modules, which have now become deprecated. (Contributed by Gordon " "MacMillan and Moshe Zadka.)" msgstr "" +":mod:`filecmp`: Supersedes the old :mod:`!cmp`, :mod:`!cmpcache` and :mod:`!" +"dircmp` modules, which have now become deprecated. (Contributed by Gordon " +"MacMillan and Moshe Zadka.)" #: ../../whatsnew/2.0.rst:1094 msgid "" @@ -1499,6 +2049,11 @@ msgid "" "separate contributions by Martin von Löwis, Peter Funk, and James " "Henstridge.)" msgstr "" +":mod:`gettext`: This module provides internationalization (I18N) and " +"localization (L10N) support for Python programs by providing an interface to " +"the GNU gettext message catalog library. (Integrated by Barry Warsaw, from " +"separate contributions by Martin von Löwis, Peter Funk, and James " +"Henstridge.)" #: ../../whatsnew/2.0.rst:1099 msgid "" @@ -1506,6 +2061,9 @@ msgid "" "twin to the existing :mod:`!sunaudiodev` module. (Contributed by Peter " "Bosch, with fixes by Jeremy Hylton.)" msgstr "" +":mod:`!linuxaudiodev`: Support for the :file:`/dev/audio` device on Linux, a " +"twin to the existing :mod:`!sunaudiodev` module. (Contributed by Peter " +"Bosch, with fixes by Jeremy Hylton.)" #: ../../whatsnew/2.0.rst:1103 msgid "" @@ -1516,12 +2074,20 @@ msgid "" "the :mod:`re` module. (Contributed by Sam Rushing, with some extensions by A." "M. Kuchling.)" msgstr "" +":mod:`mmap`: An interface to memory-mapped files on both Windows and Unix. " +"A file's contents can be mapped directly into memory, at which point it " +"behaves like a mutable string, so its contents can be read and modified. " +"They can even be passed to functions that expect ordinary strings, such as " +"the :mod:`re` module. (Contributed by Sam Rushing, with some extensions by A." +"M. Kuchling.)" #: ../../whatsnew/2.0.rst:1109 msgid "" ":mod:`!pyexpat`: An interface to the Expat XML parser. (Contributed by Paul " "Prescod.)" msgstr "" +":mod:`!pyexpat`: An interface to the Expat XML parser. (Contributed by Paul " +"Prescod.)" #: ../../whatsnew/2.0.rst:1112 msgid "" @@ -1531,18 +2097,27 @@ msgid "" "builds a set of rules from it, and can then answer questions about the " "fetchability of a given URL. (Contributed by Skip Montanaro.)" msgstr "" +":mod:`robotparser `: Parse a :file:`robots.txt` file, " +"which is used for writing web spiders that politely avoid certain areas of a " +"web site. The parser accepts the contents of a :file:`robots.txt` file, " +"builds a set of rules from it, and can then answer questions about the " +"fetchability of a given URL. (Contributed by Skip Montanaro.)" #: ../../whatsnew/2.0.rst:1118 msgid "" ":mod:`tabnanny`: A module/script to check Python source code for ambiguous " "indentation. (Contributed by Tim Peters.)" msgstr "" +":mod:`tabnanny`: A module/script to check Python source code for ambiguous " +"indentation. (Contributed by Tim Peters.)" #: ../../whatsnew/2.0.rst:1121 msgid "" ":mod:`!UserString`: A base class useful for deriving objects that behave " "like strings." msgstr "" +":mod:`!UserString`: A base class useful for deriving objects that behave " +"like strings." #: ../../whatsnew/2.0.rst:1124 msgid "" @@ -1555,6 +2130,14 @@ msgid "" "file:`Tools/idle/BrowserControl.py`, and adapted for the standard library by " "Fred.)" msgstr "" +":mod:`webbrowser`: A module that provides a platform independent way to " +"launch a web browser on a specific URL. For each platform, various browsers " +"are tried in a specific order. The user can alter which browser is launched " +"by setting the *BROWSER* environment variable. (Originally inspired by Eric " +"S. Raymond's patch to :mod:`urllib` which added similar functionality, but " +"the final module comes from code originally implemented by Fred Drake as :" +"file:`Tools/idle/BrowserControl.py`, and adapted for the standard library by " +"Fred.)" #: ../../whatsnew/2.0.rst:1133 msgid "" @@ -1564,6 +2147,11 @@ msgid "" "to support Unicode. :mod:`!_winreg` was written by Bill Tutt and Mark " "Hammond." msgstr "" +":mod:`_winreg `: An interface to the Windows registry. :mod:`!" +"_winreg` is an adaptation of functions that have been part of PythonWin " +"since 1995, but has now been added to the core distribution, and enhanced " +"to support Unicode. :mod:`!_winreg` was written by Bill Tutt and Mark " +"Hammond." #: ../../whatsnew/2.0.rst:1138 msgid "" @@ -1572,6 +2160,10 @@ msgid "" "on Unix, not to be confused with :program:`gzip`\\ -format files (which are " "supported by the :mod:`gzip` module) (Contributed by James C. Ahlstrom.)" msgstr "" +":mod:`zipfile`: A module for reading and writing ZIP-format archives. These " +"are archives produced by :program:`PKZIP` on DOS/Windows or :program:`zip` " +"on Unix, not to be confused with :program:`gzip`\\ -format files (which are " +"supported by the :mod:`gzip` module) (Contributed by James C. Ahlstrom.)" #: ../../whatsnew/2.0.rst:1143 msgid "" @@ -1580,10 +2172,14 @@ msgid "" "(Implemented by Greg Stein, with much discussion on python-dev along the " "way.)" msgstr "" +":mod:`!imputil`: A module that provides a simpler way for writing customized " +"import hooks, in comparison to the existing :mod:`!ihooks` module. " +"(Implemented by Greg Stein, with much discussion on python-dev along the " +"way.)" #: ../../whatsnew/2.0.rst:1151 msgid "IDLE Improvements" -msgstr "" +msgstr "IDLE Improvements" #: ../../whatsnew/2.0.rst:1153 msgid "" @@ -1591,58 +2187,73 @@ msgid "" "Python 2.0 includes IDLE 0.6, which adds a number of new features and " "improvements. A partial list:" msgstr "" +"IDLE is the official Python cross-platform IDE, written using Tkinter. " +"Python 2.0 includes IDLE 0.6, which adds a number of new features and " +"improvements. A partial list:" #: ../../whatsnew/2.0.rst:1157 msgid "" "UI improvements and optimizations, especially in the area of syntax " "highlighting and auto-indentation." msgstr "" +"UI improvements and optimizations, especially in the area of syntax " +"highlighting and auto-indentation." #: ../../whatsnew/2.0.rst:1160 msgid "" "The class browser now shows more information, such as the top level " "functions in a module." msgstr "" +"The class browser now shows more information, such as the top level " +"functions in a module." #: ../../whatsnew/2.0.rst:1163 msgid "" "Tab width is now a user settable option. When opening an existing Python " "file, IDLE automatically detects the indentation conventions, and adapts." msgstr "" +"Tab width is now a user settable option. When opening an existing Python " +"file, IDLE automatically detects the indentation conventions, and adapts." #: ../../whatsnew/2.0.rst:1166 msgid "" "There is now support for calling browsers on various platforms, used to open " "the Python documentation in a browser." msgstr "" +"There is now support for calling browsers on various platforms, used to open " +"the Python documentation in a browser." #: ../../whatsnew/2.0.rst:1169 msgid "" "IDLE now has a command line, which is largely similar to the vanilla Python " "interpreter." msgstr "" +"IDLE now has a command line, which is largely similar to the vanilla Python " +"interpreter." #: ../../whatsnew/2.0.rst:1172 msgid "Call tips were added in many places." -msgstr "" +msgstr "Call tips were added in many places." #: ../../whatsnew/2.0.rst:1174 msgid "IDLE can now be installed as a package." -msgstr "" +msgstr "IDLE can now be installed as a package." #: ../../whatsnew/2.0.rst:1176 msgid "In the editor window, there is now a line/column bar at the bottom." -msgstr "" +msgstr "In the editor window, there is now a line/column bar at the bottom." #: ../../whatsnew/2.0.rst:1178 msgid "" "Three new keystroke commands: Check module (:kbd:`Alt-F5`), Import module (:" "kbd:`F5`) and Run script (:kbd:`Ctrl-F5`)." msgstr "" +"Three new keystroke commands: Check module (:kbd:`Alt-F5`), Import module (:" +"kbd:`F5`) and Run script (:kbd:`Ctrl-F5`)." #: ../../whatsnew/2.0.rst:1185 msgid "Deleted and Deprecated Modules" -msgstr "Módulos apagados e desativados" +msgstr "Deleted and Deprecated Modules" #: ../../whatsnew/2.0.rst:1187 msgid "" @@ -1651,6 +2262,10 @@ msgid "" "gone; it was for a platform-independent windowing toolkit that's no longer " "developed." msgstr "" +"A few modules have been dropped because they're obsolete, or because there " +"are now better ways to do the same thing. The :mod:`!stdwin` module is " +"gone; it was for a platform-independent windowing toolkit that's no longer " +"developed." #: ../../whatsnew/2.0.rst:1191 msgid "" @@ -1662,6 +2277,13 @@ msgid "" "path`` to get them back, but you're encouraged to update any code that " "uses these modules." msgstr "" +"A number of modules have been moved to the :file:`lib-old` subdirectory: :" +"mod:`!cmp`, :mod:`!cmpcache`, :mod:`!dircmp`, :mod:`!dump`, :mod:`!find`, :" +"mod:`!grep`, :mod:`!packmail`, :mod:`!poly`, :mod:`!util`, :mod:`!" +"whatsound`, :mod:`!zmod`. If you have code which relies on a module that's " +"been moved to :file:`lib-old`, you can simply add that directory to ``sys." +"path`` to get them back, but you're encouraged to update any code that " +"uses these modules." #: ../../whatsnew/2.0.rst:1200 msgid "Acknowledgements" @@ -1675,8 +2297,8 @@ msgid "" "Skip Montanaro, Vladimir Marangozov, Tobias Polzin, Guido van Rossum, Neil " "Schemenauer, and Russ Schmidt." msgstr "" -"Os autores agradecem as seguintes pessoas por oferecer sugestões sobre " -"vários rascunhos deste artigo: David Bolen, Mark Hammond, Gregg Hauser, " -"Jeremy Hylton, Fredrik Lundh, Detlef Lannert, Aahz Maruch, Skip Montanaro, " -"Vladimir Marangozov, Tobias Polzin, Guido Van Rossum, Neil Schemenauer e " -"Russ Schmidt." +"The authors would like to thank the following people for offering " +"suggestions on various drafts of this article: David Bolen, Mark Hammond, " +"Gregg Hauser, Jeremy Hylton, Fredrik Lundh, Detlef Lannert, Aahz Maruch, " +"Skip Montanaro, Vladimir Marangozov, Tobias Polzin, Guido van Rossum, Neil " +"Schemenauer, and Russ Schmidt." diff --git a/whatsnew/2.1.po b/whatsnew/2.1.po index 361ca54e5..a962f79ae 100644 --- a/whatsnew/2.1.po +++ b/whatsnew/2.1.po @@ -24,16 +24,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../whatsnew/2.1.rst:3 msgid "What's New in Python 2.1" -msgstr "O que há de novo no Python 2.1" +msgstr "What's New in Python 2.1" #: ../../whatsnew/2.1.rst:0 msgid "Author" @@ -116,6 +116,14 @@ msgid "" "find local variables being copied by passing them as the default values of " "arguments. ::" msgstr "" +"The function :func:`!g` will always raise a :exc:`NameError` exception, " +"because the binding of the name ``g`` isn't in either its local namespace or " +"in the module-level namespace. This isn't much of a problem in practice " +"(how often do you recursively define interior functions like this?), but " +"this also made using the :keyword:`lambda` expression clumsier, and this was " +"a problem in practice. In code which uses :keyword:`lambda` you can often " +"find local variables being copied by passing them as the default values of " +"arguments. ::" #: ../../whatsnew/2.1.rst:65 msgid "" @@ -197,6 +205,9 @@ msgid "" "would define a new local variable named ``x`` whose value should be accessed " "by :func:`!g`." msgstr "" +"Line 4 containing the ``exec`` statement is a syntax error, since ``exec`` " +"would define a new local variable named ``x`` whose value should be accessed " +"by :func:`!g`." #: ../../whatsnew/2.1.rst:109 msgid "" @@ -218,14 +229,13 @@ msgid "" "off, but users will have had all of 2.1's lifetime to fix any breakage " "resulting from their introduction." msgstr "" -"As preocupações com a compatibilidade levaram aos escopos aninhados a serem " -"introduzidos gradualmente; no Python 2.1, eles não estão habilitados por " -"padrão, mas podem ser habilitados dentro de um módulo usando uma instrução " -"futura conforme descrito em :pep:`236`. (Consulte a seção a seguir para uma " -"discussão mais aprofundada sobre :pep:`236`.) No Python 2.2, escopos " -"aninhados se tornarão o padrão e não haverá maneira de desativá-los, mas os " -"usuários terão todo o tempo de vida do 2.1 para consertar qualquer quebra " -"resultante de sua introdução." +"Compatibility concerns have led to nested scopes being introduced gradually; " +"in Python 2.1, they aren't enabled by default, but can be turned on within a " +"module by using a future statement as described in :pep:`236`. (See the " +"following section for further discussion of :pep:`236`.) In Python 2.2, " +"nested scopes will become the default and there will be no way to turn them " +"off, but users will have had all of 2.1's lifetime to fix any breakage " +"resulting from their introduction." #: ../../whatsnew/2.1.rst:123 msgid ":pep:`227` - Statically Nested Scopes" @@ -272,13 +282,12 @@ msgid "" "how the Python bytecode compiler parses code and generates bytecode, so they " "must precede any statement that will result in bytecodes being produced." msgstr "" -"Embora pareça uma instrução :keyword:`import` normal, não é; existem regras " -"estritas sobre onde tal instrução futura pode ser colocada. Eles só podem " -"estar no topo de um módulo e devem preceder qualquer código Python ou " -"instruções :keyword:`!import` regulares. Isso ocorre porque tais instruções " -"podem afetar como o compilador de bytecode Python analisa o código e gera " -"bytecode, portanto, devem preceder qualquer instrução que resulte na " -"produção de bytecodes." +"While it looks like a normal :keyword:`import` statement, it's not; there " +"are strict rules on where such a future statement can be put. They can only " +"be at the top of a module, and must precede any Python code or regular :" +"keyword:`!import` statements. This is because such statements can affect " +"how the Python bytecode compiler parses code and generates bytecode, so they " +"must precede any statement that will result in bytecodes being produced." #: ../../whatsnew/2.1.rst:153 msgid ":pep:`236` - Back to the :mod:`__future__`" @@ -307,6 +316,18 @@ msgid "" "sizes, then the compare has to be able to raise an exception to signal the " "error." msgstr "" +"In earlier versions, Python's support for implementing comparisons on user-" +"defined classes and extension types was quite simple. Classes could " +"implement a :meth:`!__cmp__` method that was given two instances of a class, " +"and could only return 0 if they were equal or +1 or -1 if they weren't; the " +"method couldn't raise an exception or return anything other than a Boolean " +"value. Users of Numeric Python often found this model too weak and " +"restrictive, because in the number-crunching programs that numeric Python is " +"used for, it would be more useful to be able to perform elementwise " +"comparisons of two matrices, returning a matrix containing the results of a " +"given comparison for each element. If the two matrices are of different " +"sizes, then the compare has to be able to raise an exception to signal the " +"error." #: ../../whatsnew/2.1.rst:174 msgid "" @@ -333,7 +354,7 @@ msgstr "``<``" #: ../../whatsnew/2.1.rst:181 msgid ":meth:`~object.__lt__`" -msgstr "" +msgstr ":meth:`~object.__lt__`" #: ../../whatsnew/2.1.rst:183 msgid "``<=``" @@ -341,7 +362,7 @@ msgstr "``<=``" #: ../../whatsnew/2.1.rst:183 msgid ":meth:`~object.__le__`" -msgstr "" +msgstr ":meth:`~object.__le__`" #: ../../whatsnew/2.1.rst:185 msgid "``>``" @@ -349,7 +370,7 @@ msgstr "``>``" #: ../../whatsnew/2.1.rst:185 msgid ":meth:`~object.__gt__`" -msgstr "" +msgstr ":meth:`~object.__gt__`" #: ../../whatsnew/2.1.rst:187 msgid "``>=``" @@ -357,7 +378,7 @@ msgstr "``>=``" #: ../../whatsnew/2.1.rst:187 msgid ":meth:`~object.__ge__`" -msgstr "" +msgstr ":meth:`~object.__ge__`" #: ../../whatsnew/2.1.rst:189 msgid "``==``" @@ -365,7 +386,7 @@ msgstr "``==``" #: ../../whatsnew/2.1.rst:189 msgid ":meth:`~object.__eq__`" -msgstr "" +msgstr ":meth:`~object.__eq__`" #: ../../whatsnew/2.1.rst:191 msgid "``!=``" @@ -373,7 +394,7 @@ msgstr "``!=``" #: ../../whatsnew/2.1.rst:191 msgid ":meth:`~object.__ne__`" -msgstr "" +msgstr ":meth:`~object.__ne__`" #: ../../whatsnew/2.1.rst:194 msgid "" @@ -419,6 +440,13 @@ msgid "" "previous versions of Python; otherwise it will call the appropriate method " "and can return any Python object." msgstr "" +"The built-in ``cmp(A,B)`` function can use the rich comparison machinery, " +"and now accepts an optional argument specifying which comparison operation " +"to use; this is given as one of the strings ``\"<\"``, ``\"<=\"``, " +"``\">\"``, ``\">=\"``, ``\"==\"``, or ``\"!=\"``. If called without the " +"optional third argument, :func:`!cmp` will only return -1, 0, or +1 as in " +"previous versions of Python; otherwise it will call the appropriate method " +"and can return any Python object." #: ../../whatsnew/2.1.rst:214 msgid "" @@ -428,11 +456,11 @@ msgid "" "`207`, or to 2.1's C API documentation, for the full list of related " "functions." msgstr "" -"Existem também alterações correspondentes de interesse para programadores C; " -"há um novo slot ``tp_richcmp`` em objetos de tipo e uma API para realizar " -"uma determinada comparação rica. Não vou cobrir a API C aqui, mas vou me " -"referir a :pep:`207`, ou a documentação da API C do 2.1, para a lista " -"completa de funções relacionadas." +"There are also corresponding changes of interest to C programmers; there's a " +"new slot ``tp_richcmp`` in type objects and an API for performing a given " +"rich comparison. I won't cover the C API here, but will refer you to :pep:" +"`207`, or to 2.1's C API documentation, for the full list of related " +"functions." #: ../../whatsnew/2.1.rst:222 msgid ":pep:`207` - Rich Comparisons" @@ -491,6 +519,8 @@ msgid "" "For example, in Python 2.1 the :mod:`!regex` module is deprecated, so " "importing it causes a warning to be printed::" msgstr "" +"For example, in Python 2.1 the :mod:`!regex` module is deprecated, so " +"importing it causes a warning to be printed::" #: ../../whatsnew/2.1.rst:256 msgid "Warnings can be issued by calling the :func:`warnings.warn` function::" @@ -512,6 +542,11 @@ msgid "" "`!regex` module and not want to spare the time to convert it to use the :mod:" "`re` module right now. The warning can be suppressed by calling ::" msgstr "" +"Filters can be added to disable certain warnings; a regular expression " +"pattern can be applied to the message or to the module name in order to " +"suppress a warning. For example, you may have a program that uses the :mod:" +"`!regex` module and not want to spare the time to convert it to use the :mod:" +"`re` module right now. The warning can be suppressed by calling ::" #: ../../whatsnew/2.1.rst:275 msgid "" @@ -523,6 +558,13 @@ msgid "" "executed, or turned into exceptions that will cause the program to stop " "(unless the exceptions are caught in the usual way, of course)." msgstr "" +"This adds a filter that will apply only to warnings of the class :class:" +"`DeprecationWarning` triggered in the :mod:`__main__` module, and applies a " +"regular expression to only match the message about the :mod:`!regex` module " +"being deprecated, and will cause such warnings to be ignored. Warnings can " +"also be printed only once, printed every time the offending code is " +"executed, or turned into exceptions that will cause the program to stop " +"(unless the exceptions are caught in the usual way, of course)." #: ../../whatsnew/2.1.rst:283 msgid "" @@ -679,6 +721,12 @@ msgid "" "object, or a data structure that takes up a lot of memory, this can be a " "problem." msgstr "" +"This version works for simple things such as integers, but it has a side " +"effect; the ``_cache`` dictionary holds a reference to the return values, so " +"they'll never be deallocated until the Python process exits and cleans up. " +"This isn't very noticeable for integers, but if :func:`!f` returns an " +"object, or a data structure that takes up a lot of memory, this can be a " +"problem." #: ../../whatsnew/2.1.rst:374 msgid "" @@ -705,6 +753,8 @@ msgid "" "This makes it possible to write a :func:`!memoize` function whose cache " "doesn't keep objects alive, by storing weak references in the cache. ::" msgstr "" +"This makes it possible to write a :func:`!memoize` function whose cache " +"doesn't keep objects alive, by storing weak references in the cache. ::" #: ../../whatsnew/2.1.rst:400 msgid "" @@ -716,6 +766,13 @@ msgid "" "to use a proxy will cause a :exc:`!weakref.ReferenceError` exception to be " "raised. ::" msgstr "" +"The :mod:`weakref` module also allows creating proxy objects which behave " +"like weak references --- an object referenced only by proxy objects is " +"deallocated -- but instead of requiring an explicit call to retrieve the " +"object, the proxy transparently forwards all operations to the object as " +"long as the object still exists. If the object is deallocated, attempting " +"to use a proxy will cause a :exc:`!weakref.ReferenceError` exception to be " +"raised. ::" #: ../../whatsnew/2.1.rst:416 msgid ":pep:`205` - Weak References" @@ -742,6 +799,16 @@ msgid "" "documentation; for example, it means you can't properly document functions " "intended for private use in Zope." msgstr "" +"In Python 2.1, functions can now have arbitrary information attached to " +"them. People were often using docstrings to hold information about functions " +"and methods, because the :attr:`~function.__doc__` attribute was the only " +"way of attaching any information to a function. For example, in the Zope " +"web application server, functions are marked as safe for public access by " +"having a docstring, and in John Aycock's SPARK parsing framework, docstrings " +"hold parts of the BNF grammar to be parsed. This overloading is " +"unfortunate, since docstrings are really intended to hold a function's " +"documentation; for example, it means you can't properly document functions " +"intended for private use in Zope." #: ../../whatsnew/2.1.rst:436 msgid "" @@ -760,6 +827,12 @@ msgid "" "dictionary; you *can't* be tricky and set it to a :class:`!UserDict` " "instance, or any other random object that behaves like a mapping." msgstr "" +"The dictionary containing attributes can be accessed as the function's :attr:" +"`~object.__dict__`. Unlike the :attr:`~object.__dict__` attribute of class " +"instances, in functions you can actually assign a new dictionary to :attr:" +"`~object.__dict__`, though the new value is restricted to a regular Python " +"dictionary; you *can't* be tricky and set it to a :class:`!UserDict` " +"instance, or any other random object that behaves like a mapping." #: ../../whatsnew/2.1.rst:455 msgid ":pep:`232` - Function Attributes" @@ -868,7 +941,7 @@ msgstr "" "``Py_NotImplemented`` singleton value. The numeric functions of the other " "type will then be tried, and perhaps they can handle the operation; if the " "other type also returns ``Py_NotImplemented``, then a :exc:`TypeError` will " -"be raised. Numeric methods written in Python can also return " +"be raised. Numeric methods written in Python can also return " "``Py_NotImplemented``, causing the interpreter to act as if the method did " "not exist (perhaps raising a :exc:`TypeError`, perhaps trying another " "object's numeric methods)." @@ -901,13 +974,13 @@ msgid "" "but registering software at the Vaults is optional, and many people did not " "bother." msgstr "" -"Uma queixa comum de pessoas que usam Python é que não existe um catálogo " -"único de todos os módulos existentes. Vaults of Parnassus de T. Middleton em " -"``www.vex.net/parnassus/`` (aposentado em fevereiro de 2009, `disponível no " +"A common complaint from Python users is that there's no single catalog of " +"all the Python modules in existence. T. Middleton's Vaults of Parnassus at " +"``www.vex.net/parnassus/`` (retired in February 2009, `available in the " "Internet Archive Wayback Machine `_) foi o maior catálogo de módulos Python, " -"mas registrar software no Vaults é opcional, e muitas pessoas não se " -"importam em fazer isso." +"http://www.vex.net/parnassus/>`_) was the largest catalog of Python modules, " +"but registering software at the Vaults is optional, and many people did not " +"bother." #: ../../whatsnew/2.1.rst:552 msgid "" @@ -924,19 +997,18 @@ msgid "" "and :command:`bdist_\\*` commands could support an ``upload`` option that " "would automatically upload your package to a catalog server." msgstr "" -"Como um primeiro pequeno passo para corrigir o problema, o software Python " -"empacotado usando o comando Distutils :command:`sdist` incluirá um arquivo " -"chamado :file:`PKG-INFO` contendo informações sobre o pacote, como seu nome, " -"versão e autor (metadados, na terminologia de catalogação). :pep:`241` " -"contém a lista completa de campos que podem estar presentes no arquivo :file:" -"`PKG-INFO`. À medida que as pessoas começaram a empacotar seus softwares " -"usando o Python 2.1, mais e mais pacotes incluirão metadados, tornando " -"possível construir sistemas de catalogação automatizados e fazer " -"experiências com eles. Com a experiência dos resultados, talvez seja " -"possível projetar um catálogo realmente bom e, em seguida, construir suporte " -"para ele no Python 2.2. Por exemplo, os comandos Distutils :command:`sdist` " -"e :command:`bdist_\\*` poderiam suportar uma opção ``upload`` que carregaria " -"automaticamente seu pacote para um servidor de catálogo." +"As a first small step toward fixing the problem, Python software packaged " +"using the Distutils :command:`sdist` command will include a file named :file:" +"`PKG-INFO` containing information about the package such as its name, " +"version, and author (metadata, in cataloguing terminology). :pep:`241` " +"contains the full list of fields that can be present in the :file:`PKG-INFO` " +"file. As people began to package their software using Python 2.1, more and " +"more packages will include metadata, making it possible to build automated " +"cataloguing systems and experiment with them. With the result experience, " +"perhaps it'll be possible to design a really good catalog and then build " +"support for it into Python 2.2. For example, the Distutils :command:`sdist` " +"and :command:`bdist_\\*` commands could support an ``upload`` option that " +"would automatically upload your package to a catalog server." #: ../../whatsnew/2.1.rst:565 msgid "" @@ -947,12 +1019,12 @@ msgid "" "enhancements. It will be available from the Distutils SIG at https://www." "python.org/community/sigs/current/distutils-sig/." msgstr "" -"Você pode começar a criar pacotes contendo :file:`PKG-INFO` mesmo se você " -"não estiver usando Python 2.1, já que uma nova versão do Distutils será " -"feita para usuários de versões anteriores do Python. A versão 1.0.2 do " -"Distutils inclui as alterações descritas em :pep:`241`, bem como várias " -"correções de bugs e melhorias. Ele estará disponível no Distutils SIG em " -"https://www.python.org/community/sigs/current/distutils-sig/." +"You can start creating packages containing :file:`PKG-INFO` even if you're " +"not using Python 2.1, since a new release of the Distutils will be made for " +"users of earlier Python versions. Version 1.0.2 of the Distutils includes " +"the changes described in :pep:`241`, as well as various bugfixes and " +"enhancements. It will be available from the Distutils SIG at https://www." +"python.org/community/sigs/current/distutils-sig/." #: ../../whatsnew/2.1.rst:574 msgid ":pep:`241` - Metadata for Python Software Packages" @@ -983,6 +1055,12 @@ msgid "" "pydoc.py` to display documentation given a Python module, package, or class " "name. For example, ``pydoc xml.dom`` displays the following::" msgstr "" +"Ka-Ping Yee contributed two new modules: :mod:`!inspect.py`, a module for " +"getting information about live Python code, and :mod:`!pydoc.py`, a module " +"for interactively converting docstrings to HTML or text. As a bonus, :file:" +"`Tools/scripts/pydoc`, which is now automatically installed, uses :mod:`!" +"pydoc.py` to display documentation given a Python module, package, or class " +"name. For example, ``pydoc xml.dom`` displays the following::" #: ../../whatsnew/2.1.rst:609 msgid "" @@ -1002,14 +1080,13 @@ msgid "" "adaptation of Kent Beck's Smalltalk testing framework. See https://pyunit." "sourceforge.net/ for more information about PyUnit." msgstr "" -"Dois módulos diferentes para teste de unidade foram adicionados à biblioteca " -"padrão. O módulo :mod:`doctest`, contribuído por Tim Peters, fornece um " -"framework de teste baseada na execução de exemplos incorporados em " -"docstrings e na comparação dos resultados com a saída esperada. PyUnit, " -"contribuído por Steve Purcell, é um framework de teste de unidade inspirada " -"em JUnit, que por sua vez foi uma adaptação do framework de teste Smalltalk " -"de Kent Beck. Consulte https://pyunit.sourceforge.net/ para obter mais " -"informações sobre o PyUnit." +"Two different modules for unit testing were added to the standard library. " +"The :mod:`doctest` module, contributed by Tim Peters, provides a testing " +"framework based on running embedded examples in docstrings and comparing the " +"results against the expected output. PyUnit, contributed by Steve Purcell, " +"is a unit testing framework inspired by JUnit, which was in turn an " +"adaptation of Kent Beck's Smalltalk testing framework. See https://pyunit." +"sourceforge.net/ for more information about PyUnit." #: ../../whatsnew/2.1.rst:620 msgid "" @@ -1020,6 +1097,12 @@ msgid "" "in fact the sample program :file:`Tools/scripts/ndiff.py` demonstrates how " "to write such a script." msgstr "" +"The :mod:`difflib` module contains a class, :class:`~difflib." +"SequenceMatcher`, which compares two sequences and computes the changes " +"required to transform one sequence into the other. For example, this module " +"can be used to write a tool similar to the Unix :program:`diff` program, and " +"in fact the sample program :file:`Tools/scripts/ndiff.py` demonstrates how " +"to write such a script." #: ../../whatsnew/2.1.rst:626 msgid "" @@ -1043,6 +1126,11 @@ msgid "" "ability for Expat parsers to handle files in any encoding supported by " "Python, and various bugfixes for SAX, DOM, and the :mod:`!minidom` module." msgstr "" +"The PyXML package has gone through a few releases since Python 2.0, and " +"Python 2.1 includes an updated version of the :mod:`xml` package. Some of " +"the noteworthy changes include support for Expat 1.2 and later versions, the " +"ability for Expat parsers to handle files in any encoding supported by " +"Python, and various bugfixes for SAX, DOM, and the :mod:`!minidom` module." #: ../../whatsnew/2.1.rst:638 msgid "" @@ -1147,7 +1235,7 @@ msgstr "" #: ../../whatsnew/2.1.rst:688 msgid "Other Changes and Fixes" -msgstr "Other Changes and Fixes" +msgstr "Outras alterações e correções" #: ../../whatsnew/2.1.rst:690 msgid "" @@ -1171,6 +1259,13 @@ msgid "" "`configure` script; see :file:`Objects/obmalloc.c` for the implementation " "details." msgstr "" +"A specialized object allocator is now optionally available, that should be " +"faster than the system :c:func:`malloc` and have less memory overhead. The " +"allocator uses C's :c:func:`!malloc` function to get large pools of memory, " +"and then fulfills smaller memory requests from these pools. It can be " +"enabled by providing the :option:`!--with-pymalloc` option to the :program:" +"`configure` script; see :file:`Objects/obmalloc.c` for the implementation " +"details." #: ../../whatsnew/2.1.rst:702 msgid "" @@ -1188,6 +1283,19 @@ msgid "" "be fixed; doubtless there are more third-party modules that will have the " "same problem." msgstr "" +"Authors of C extension modules should test their code with the object " +"allocator enabled, because some incorrect code may break, causing core dumps " +"at runtime. There are a bunch of memory allocation functions in Python's C " +"API that have previously been just aliases for the C library's :c:func:" +"`malloc` and :c:func:`free`, meaning that if you accidentally called " +"mismatched functions, the error wouldn't be noticeable. When the object " +"allocator is enabled, these functions aren't aliases of :c:func:`!malloc` " +"and :c:func:`!free` any more, and calling the wrong function to free memory " +"will get you a core dump. For example, if memory was allocated using :c:" +"macro:`PyMem_New`, it has to be freed using :c:func:`PyMem_Del`, not :c:func:" +"`!free`. A few modules included with Python fell afoul of this and had to " +"be fixed; doubtless there are more third-party modules that will have the " +"same problem." #: ../../whatsnew/2.1.rst:715 msgid "The object allocator was contributed by Vladimir Marangozov." @@ -1204,6 +1312,14 @@ msgid "" "operating systems. Tim Peters did much of the benchmarking and coding for " "this change, motivated by a discussion in comp.lang.python." msgstr "" +"The speed of line-oriented file I/O has been improved because people often " +"complain about its lack of speed, and because it's often been used as a " +"naïve benchmark. The :meth:`readline` method of file objects has therefore " +"been rewritten to be much faster. The exact amount of the speedup will vary " +"from platform to platform depending on how slow the C library's :c:func:`!" +"getc` was, but is around 66%, and potentially much faster on some particular " +"operating systems. Tim Peters did much of the benchmarking and coding for " +"this change, motivated by a discussion in comp.lang.python." #: ../../whatsnew/2.1.rst:726 msgid "" @@ -1214,6 +1330,12 @@ msgid "" "but not reading the entire file into memory as the existing :meth:`!" "readlines` method does. You'd use it like this::" msgstr "" +"A new module and method for file objects was also added, contributed by Jeff " +"Epler. The new method, :meth:`!xreadlines`, is similar to the existing :func:" +"`!xrange` built-in. :func:`!xreadlines` returns an opaque sequence object " +"that only supports being iterated over, reading a line on every iteration " +"but not reading the entire file into memory as the existing :meth:`!" +"readlines` method does. You'd use it like this::" #: ../../whatsnew/2.1.rst:737 msgid "" @@ -1235,6 +1357,13 @@ msgid "" "was implemented mostly by Tim Peters and Guido van Rossum, after a " "suggestion and preliminary patch by Moshe Zadka." msgstr "" +"A new method, :meth:`~dict.popitem`, was added to dictionaries to enable " +"destructively iterating through the contents of a dictionary; this can be " +"faster for large dictionaries because there's no need to construct a list " +"containing all the keys or values. ``D.popitem()`` removes a random ``(key, " +"value)`` pair from the dictionary ``D`` and returns it as a 2-tuple. This " +"was implemented mostly by Tim Peters and Guido van Rossum, after a " +"suggestion and preliminary patch by Moshe Zadka." #: ../../whatsnew/2.1.rst:748 msgid "" @@ -1295,6 +1424,10 @@ msgid "" "that have been installed. This is also encouraged for third-party " "extensions that need to import some other module from C code." msgstr "" +"C extensions which import other modules have been changed to use :c:func:" +"`PyImport_ImportModule`, which means that they will use any import hooks " +"that have been installed. This is also encouraged for third-party " +"extensions that need to import some other module from C code." #: ../../whatsnew/2.1.rst:778 msgid "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 54e326659..090506f1b 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -21,16 +21,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../whatsnew/2.2.rst:3 msgid "What's New in Python 2.2" -msgstr "O que há de novo no Python 2.2" +msgstr "What's New in Python 2.2" #: ../../whatsnew/2.2.rst:0 msgid "Author" @@ -50,6 +50,9 @@ msgid "" "14, 2002. Python 2.2.2 is a bugfix release of Python 2.2, originally " "released on December 21, 2001." msgstr "" +"This article explains the new features in Python 2.2.2, released on October " +"14, 2002. Python 2.2.2 is a bugfix release of Python 2.2, originally " +"released on December 21, 2001." #: ../../whatsnew/2.2.rst:19 msgid "" @@ -58,6 +61,10 @@ msgid "" "of the changes, significant and far-reaching though they may be, are aimed " "at cleaning up irregularities and dark corners of the language design." msgstr "" +"Python 2.2 can be thought of as the \"cleanup release\". There are some " +"features such as generators and iterators that are completely new, but most " +"of the changes, significant and far-reaching though they may be, are aimed " +"at cleaning up irregularities and dark corners of the language design." #: ../../whatsnew/2.2.rst:24 msgid "" @@ -69,10 +76,17 @@ msgid "" "you want to understand the complete implementation and design rationale for " "a change, refer to the PEP for a particular new feature." msgstr "" +"This article doesn't attempt to provide a complete specification of the new " +"features, but instead provides a convenient overview. For full details, you " +"should refer to the documentation for Python 2.2, such as the `Python " +"Library Reference `_ and the " +"`Python Reference Manual `_. If " +"you want to understand the complete implementation and design rationale for " +"a change, refer to the PEP for a particular new feature." #: ../../whatsnew/2.2.rst:43 msgid "PEPs 252 and 253: Type and Class Changes" -msgstr "" +msgstr "PEPs 252 and 253: Type and Class Changes" #: ../../whatsnew/2.2.rst:45 msgid "" @@ -83,6 +97,12 @@ msgid "" "and most complicated section of this article, I'll provide an overview of " "the changes and offer some comments." msgstr "" +"The largest and most far-reaching changes in Python 2.2 are to Python's " +"model of objects and classes. The changes should be backward compatible, so " +"it's likely that your code will continue to run unchanged, but the changes " +"provide some amazing new capabilities. Before beginning this, the longest " +"and most complicated section of this article, I'll provide an overview of " +"the changes and offer some comments." #: ../../whatsnew/2.2.rst:52 msgid "" @@ -95,24 +115,38 @@ msgid "" "there's lots of C code that expects a regular Python list and won't accept " "a :class:`~collections.UserList` instance." msgstr "" +"A long time ago I wrote a web page listing flaws in Python's design. One of " +"the most significant flaws was that it's impossible to subclass Python types " +"implemented in C. In particular, it's not possible to subclass built-in " +"types, so you can't just subclass, say, lists in order to add a single " +"useful method to them. The :mod:`!UserList` module provides a class that " +"supports all of the methods of lists and that can be subclassed further, but " +"there's lots of C code that expects a regular Python list and won't accept " +"a :class:`~collections.UserList` instance." #: ../../whatsnew/2.2.rst:61 msgid "" "Python 2.2 fixes this, and in the process adds some exciting new " "capabilities. A brief summary:" msgstr "" +"Python 2.2 fixes this, and in the process adds some exciting new " +"capabilities. A brief summary:" #: ../../whatsnew/2.2.rst:64 msgid "" "You can subclass built-in types such as lists and even integers, and your " "subclasses should work in every place that requires the original type." msgstr "" +"You can subclass built-in types such as lists and even integers, and your " +"subclasses should work in every place that requires the original type." #: ../../whatsnew/2.2.rst:67 msgid "" "It's now possible to define static and class methods, in addition to the " "instance methods available in previous versions of Python." msgstr "" +"It's now possible to define static and class methods, in addition to the " +"instance methods available in previous versions of Python." #: ../../whatsnew/2.2.rst:70 msgid "" @@ -122,6 +156,11 @@ msgid "" "instead, making the resulting code simpler and faster. As a small side " "benefit, attributes can now have docstrings, too." msgstr "" +"It's also possible to automatically call methods on accessing or setting an " +"instance attribute by using a new mechanism called :dfn:`properties`. Many " +"uses of :meth:`~object.__getattr__` can be rewritten to use properties " +"instead, making the resulting code simpler and faster. As a small side " +"benefit, attributes can now have docstrings, too." #: ../../whatsnew/2.2.rst:76 msgid "" @@ -129,6 +168,9 @@ msgid "" "set using :dfn:`slots`, making it possible to safeguard against typos and " "perhaps make more optimizations possible in future versions of Python." msgstr "" +"The list of legal attributes for an instance can be limited to a particular " +"set using :dfn:`slots`, making it possible to safeguard against typos and " +"perhaps make more optimizations possible in future versions of Python." #: ../../whatsnew/2.2.rst:80 msgid "" @@ -139,6 +181,12 @@ msgid "" "recommended Python for its simplicity, and feel that its simplicity is being " "lost." msgstr "" +"Some users have voiced concern about all these changes. Sure, they say, the " +"new features are neat and lend themselves to all sorts of tricks that " +"weren't possible in previous versions of Python, but they also make the " +"language more complicated. Some people have said that they've always " +"recommended Python for its simplicity, and feel that its simplicity is being " +"lost." #: ../../whatsnew/2.2.rst:86 msgid "" @@ -150,6 +198,13 @@ msgid "" "only possible from C will now be possible in pure Python, and to my mind " "that's all for the better." msgstr "" +"Personally, I think there's no need to worry. Many of the new features are " +"quite esoteric, and you can write a lot of Python code without ever needed " +"to be aware of them. Writing a simple class is no more difficult than it " +"ever was, so you don't need to bother learning or teaching them unless " +"they're actually needed. Some very complicated tasks that were previously " +"only possible from C will now be possible in pure Python, and to my mind " +"that's all for the better." #: ../../whatsnew/2.2.rst:93 msgid "" @@ -159,10 +214,15 @@ msgid "" "Links\", for further sources of information about Python 2.2's new object " "model." msgstr "" +"I'm not going to attempt to cover every single corner case and small change " +"that were required to make the new features work. Instead this section will " +"paint only the broad strokes. See section :ref:`sect-rellinks`, \"Related " +"Links\", for further sources of information about Python 2.2's new object " +"model." #: ../../whatsnew/2.2.rst:100 msgid "Old and New Classes" -msgstr "" +msgstr "Old and New Classes" #: ../../whatsnew/2.2.rst:102 msgid "" @@ -173,6 +233,12 @@ msgid "" "classes. This divergence isn't intended to last forever; eventually old-" "style classes will be dropped, possibly in Python 3.0." msgstr "" +"First, you should know that Python 2.2 really has two kinds of classes: " +"classic or old-style classes, and new-style classes. The old-style class " +"model is exactly the same as the class model in earlier versions of Python. " +"All the new features described in this section apply only to new-style " +"classes. This divergence isn't intended to last forever; eventually old-" +"style classes will be dropped, possibly in Python 3.0." #: ../../whatsnew/2.2.rst:109 msgid "" @@ -183,6 +249,12 @@ msgid "" "types, has also been added so if no built-in type is suitable, you can just " "subclass :class:`object`::" msgstr "" +"So how do you define a new-style class? You do it by subclassing an " +"existing new-style class. Most of Python's built-in types, such as " +"integers, lists, dictionaries, and even files, are new-style classes now. A " +"new-style class named :class:`object`, the base class for all built-in " +"types, has also been added so if no built-in type is suitable, you can just " +"subclass :class:`object`::" #: ../../whatsnew/2.2.rst:121 msgid "" @@ -192,6 +264,11 @@ msgid "" "see :pep:`253` for the details --- but it's easier to just subclass :class:" "`object`.)" msgstr "" +"This means that :keyword:`class` statements that don't have any base classes " +"are always classic classes in Python 2.2. (Actually you can also change " +"this by setting a module-level variable named :attr:`!__metaclass__` --- " +"see :pep:`253` for the details --- but it's easier to just subclass :class:" +"`object`.)" #: ../../whatsnew/2.2.rst:126 msgid "" @@ -200,6 +277,10 @@ msgid "" "`int`, :func:`float`, and :func:`str`. In 2.2, they aren't functions any " "more, but type objects that behave as factories when called. ::" msgstr "" +"The type objects for the built-in types are available as built-ins, named " +"using a clever trick. Python has always had built-in functions named :func:" +"`int`, :func:`float`, and :func:`str`. In 2.2, they aren't functions any " +"more, but type objects that behave as factories when called. ::" #: ../../whatsnew/2.2.rst:136 msgid "" @@ -207,6 +288,9 @@ msgid "" "and :func:`!file` have been added. Here's a more interesting example, " "adding a :meth:`!lock` method to file objects::" msgstr "" +"To make the set of types complete, new type objects such as :func:`dict` " +"and :func:`!file` have been added. Here's a more interesting example, " +"adding a :meth:`!lock` method to file objects::" #: ../../whatsnew/2.2.rst:146 msgid "" @@ -215,10 +299,14 @@ msgid "" "this class couldn't be passed to internal functions that expected a built-in " "file, something which is possible with our new :class:`!LockableFile`." msgstr "" +"The now-obsolete :mod:`!posixfile` module contained a class that emulated " +"all of a file object's methods and also added a :meth:`!lock` method, but " +"this class couldn't be passed to internal functions that expected a built-in " +"file, something which is possible with our new :class:`!LockableFile`." #: ../../whatsnew/2.2.rst:153 msgid "Descriptors" -msgstr "" +msgstr "Descriptors" #: ../../whatsnew/2.2.rst:155 msgid "" @@ -231,6 +319,14 @@ msgid "" "inheritance or an arbitrary :meth:`!__getattr__` hook were in use this could " "still be inaccurate." msgstr "" +"In previous versions of Python, there was no consistent way to discover what " +"attributes and methods were supported by an object. There were some informal " +"conventions, such as defining :attr:`!__members__` and :attr:`!__methods__` " +"attributes that were lists of names, but often the author of an extension " +"type or a class wouldn't bother to define them. You could fall back on " +"inspecting the :attr:`~object.__dict__` of an object, but when class " +"inheritance or an arbitrary :meth:`!__getattr__` hook were in use this could " +"still be inaccurate." #: ../../whatsnew/2.2.rst:163 msgid "" @@ -240,41 +336,53 @@ msgid "" "it's a method or a field. With the descriptor API, static methods and class " "methods become possible, as well as more exotic constructs." msgstr "" +"The one big idea underlying the new class model is that an API for " +"describing the attributes of an object using :dfn:`descriptors` has been " +"formalized. Descriptors specify the value of an attribute, stating whether " +"it's a method or a field. With the descriptor API, static methods and class " +"methods become possible, as well as more exotic constructs." #: ../../whatsnew/2.2.rst:169 msgid "" "Attribute descriptors are objects that live inside class objects, and have a " "few attributes of their own:" msgstr "" +"Attribute descriptors are objects that live inside class objects, and have a " +"few attributes of their own:" #: ../../whatsnew/2.2.rst:172 msgid ":attr:`~definition.__name__` is the attribute's name." -msgstr "" +msgstr ":attr:`~definition.__name__` is the attribute's name." #: ../../whatsnew/2.2.rst:174 msgid ":attr:`!__doc__` is the attribute's docstring." -msgstr "" +msgstr ":attr:`!__doc__` is the attribute's docstring." #: ../../whatsnew/2.2.rst:176 msgid "" "``__get__(object)`` is a method that retrieves the attribute value from " "*object*." msgstr "" +"``__get__(object)`` is a method that retrieves the attribute value from " +"*object*." #: ../../whatsnew/2.2.rst:179 msgid "``__set__(object, value)`` sets the attribute on *object* to *value*." -msgstr "" +msgstr "``__set__(object, value)`` sets the attribute on *object* to *value*." #: ../../whatsnew/2.2.rst:181 msgid "" "``__delete__(object, value)`` deletes the *value* attribute of *object*." msgstr "" +"``__delete__(object, value)`` deletes the *value* attribute of *object*." #: ../../whatsnew/2.2.rst:183 msgid "" "For example, when you write ``obj.x``, the steps that Python actually " "performs are::" msgstr "" +"For example, when you write ``obj.x``, the steps that Python actually " +"performs are::" #: ../../whatsnew/2.2.rst:189 msgid "" @@ -287,6 +395,14 @@ msgid "" "methods are passed the class of the object, but not the object itself. " "Static and class methods are defined like this::" msgstr "" +"For methods, :meth:`!descriptor.__get__` returns a temporary object that's " +"callable, and wraps up the instance and the method to be called on it. This " +"is also why static methods and class methods are now possible; they have " +"descriptors that wrap up just the method, or the method and the class. As a " +"brief explanation of these new kinds of methods, static methods aren't " +"passed the instance, and therefore resemble regular functions. Class " +"methods are passed the class of the object, but not the object itself. " +"Static and class methods are defined like this::" #: ../../whatsnew/2.2.rst:207 msgid "" @@ -296,6 +412,11 @@ msgid "" "static f``, ``defstatic f()``, or something like that) but no such syntax " "has been defined yet; that's been left for future versions of Python." msgstr "" +"The :func:`staticmethod` function takes the function :func:`!f`, and returns " +"it wrapped up in a descriptor so it can be stored in the class object. You " +"might expect there to be special syntax for creating such methods (``def " +"static f``, ``defstatic f()``, or something like that) but no such syntax " +"has been defined yet; that's been left for future versions of Python." #: ../../whatsnew/2.2.rst:213 msgid "" @@ -306,6 +427,12 @@ msgid "" "and postconditions for a method. A class that used this feature might be " "defined like this::" msgstr "" +"More new features, such as slots and properties, are also implemented as new " +"kinds of descriptors, and it's not difficult to write a descriptor class " +"that does something novel. For example, it would be possible to write a " +"descriptor class that made it possible to write Eiffel-style preconditions " +"and postconditions for a method. A class that used this feature might be " +"defined like this::" #: ../../whatsnew/2.2.rst:235 msgid "" @@ -316,10 +443,16 @@ msgid "" "the ZODB or whatever, but most users will just write code on top of the " "resulting libraries and ignore the implementation details." msgstr "" +"Note that a person using the new :func:`!eiffelmethod` doesn't have to " +"understand anything about descriptors. This is why I think the new features " +"don't increase the basic complexity of the language. There will be a few " +"wizards who need to know about it in order to write :func:`!eiffelmethod` or " +"the ZODB or whatever, but most users will just write code on top of the " +"resulting libraries and ignore the implementation details." #: ../../whatsnew/2.2.rst:244 msgid "Multiple Inheritance: The Diamond Rule" -msgstr "" +msgstr "Multiple Inheritance: The Diamond Rule" #: ../../whatsnew/2.2.rst:246 msgid "" @@ -327,6 +460,9 @@ msgid "" "rules under which names are resolved. Consider this set of classes (diagram " "taken from :pep:`253` by Guido van Rossum)::" msgstr "" +"Multiple inheritance has also been made more useful through changing the " +"rules under which names are resolved. Consider this set of classes (diagram " +"taken from :pep:`253` by Guido van Rossum)::" #: ../../whatsnew/2.2.rst:264 msgid "" @@ -338,6 +474,13 @@ msgid "" "meth:`!save` method is saving some internal state specific to :class:`!C`, " "not calling it will result in that state never getting saved." msgstr "" +"The lookup rule for classic classes is simple but not very smart; the base " +"classes are searched depth-first, going from left to right. A reference to :" +"meth:`!D.save` will search the classes :class:`!D`, :class:`!B`, and then :" +"class:`!A`, where :meth:`!save` would be found and returned. :meth:`!C." +"save` would never be found at all. This is bad, because if :class:`!C`'s :" +"meth:`!save` method is saving some internal state specific to :class:`!C`, " +"not calling it will result in that state never getting saved." #: ../../whatsnew/2.2.rst:272 msgid "" @@ -347,6 +490,11 @@ msgid "" "cases, but produces more useful results for really complicated inheritance " "graphs.)" msgstr "" +"New-style classes follow a different algorithm that's a bit more complicated " +"to explain, but does the right thing in this situation. (Note that Python " +"2.3 changes this algorithm to one that produces the same results in most " +"cases, but produces more useful results for really complicated inheritance " +"graphs.)" #: ../../whatsnew/2.2.rst:277 msgid "" @@ -355,6 +503,10 @@ msgid "" "list of visited classes is [:class:`!D`, :class:`!B`, :class:`!A`, :class:`!" "C`, :class:`!A`]." msgstr "" +"List all the base classes, following the classic lookup rule and include a " +"class multiple times if it's visited repeatedly. In the above example, the " +"list of visited classes is [:class:`!D`, :class:`!B`, :class:`!A`, :class:`!" +"C`, :class:`!A`]." #: ../../whatsnew/2.2.rst:282 msgid "" @@ -363,6 +515,10 @@ msgid "" "list becomes [:class:`!D`, :class:`!B`, :class:`!C`, :class:`!A`] after " "dropping duplicates." msgstr "" +"Scan the list for duplicated classes. If any are found, remove all but one " +"occurrence, leaving the *last* one in the list. In the above example, the " +"list becomes [:class:`!D`, :class:`!B`, :class:`!C`, :class:`!A`] after " +"dropping duplicates." #: ../../whatsnew/2.2.rst:287 msgid "" @@ -376,6 +532,15 @@ msgid "" "the superclass; for example, :class:`!D`'s :meth:`!save` method would look " "like this::" msgstr "" +"Following this rule, referring to :meth:`!D.save` will return :meth:`!C." +"save`, which is the behaviour we're after. This lookup rule is the same as " +"the one followed by Common Lisp. A new built-in function, :func:`super`, " +"provides a way to get at a class's superclasses without having to " +"reimplement Python's algorithm. The most commonly used form will be " +"``super(class, obj)``, which returns a bound superclass object (not the " +"actual class object). This form will be used in methods to call a method in " +"the superclass; for example, :class:`!D`'s :meth:`!save` method would look " +"like this::" #: ../../whatsnew/2.2.rst:303 msgid "" @@ -383,10 +548,13 @@ msgid "" "``super(class)`` or ``super(class1, class2)``, but this probably won't often " "be useful." msgstr "" +":func:`super` can also return unbound superclass objects when called as " +"``super(class)`` or ``super(class1, class2)``, but this probably won't often " +"be useful." #: ../../whatsnew/2.2.rst:309 msgid "Attribute Access" -msgstr "" +msgstr "Attribute Access" #: ../../whatsnew/2.2.rst:311 msgid "" @@ -396,6 +564,11 @@ msgid "" "attribute access such as ``obj.parent`` into a method call such as ``obj." "get_parent``. Python 2.2 adds some new ways of controlling attribute access." msgstr "" +"A fair number of sophisticated Python classes define hooks for attribute " +"access using :meth:`~object.__getattr__`; most commonly this is done for " +"convenience, to make code more readable by automatically mapping an " +"attribute access such as ``obj.parent`` into a method call such as ``obj." +"get_parent``. Python 2.2 adds some new ways of controlling attribute access." #: ../../whatsnew/2.2.rst:317 msgid "" @@ -404,6 +577,10 @@ msgid "" "attempt is made to access ``obj.foo`` and no attribute named ``foo`` is " "found in the instance's dictionary." msgstr "" +"First, ``__getattr__(attr_name)`` is still supported by new-style classes, " +"and nothing about it has changed. As before, it will be called when an " +"attempt is made to access ``obj.foo`` and no attribute named ``foo`` is " +"found in the instance's dictionary." #: ../../whatsnew/2.2.rst:322 msgid "" @@ -413,6 +590,11 @@ msgid "" "attribute is accessed, while the old :meth:`~object.__getattr__` is only " "called if ``foo`` isn't found in the instance's dictionary." msgstr "" +"New-style classes also support a new method, " +"``__getattribute__(attr_name)``. The difference between the two methods is " +"that :meth:`~object.__getattribute__` is *always* called whenever any " +"attribute is accessed, while the old :meth:`~object.__getattr__` is only " +"called if ``foo`` isn't found in the instance's dictionary." #: ../../whatsnew/2.2.rst:328 msgid "" @@ -426,6 +608,15 @@ msgid "" "this in mind. Finally, calling a function on every attribute access results " "in a sizable performance loss." msgstr "" +"However, Python 2.2's support for :dfn:`properties` will often be a simpler " +"way to trap attribute references. Writing a :meth:`!__getattr__` method is " +"complicated because to avoid recursion you can't use regular attribute " +"accesses inside them, and instead have to mess around with the contents of :" +"attr:`~object.__dict__`. :meth:`~object.__getattr__` methods also end up " +"being called by Python when it checks for other methods such as :meth:" +"`~object.__repr__` or :meth:`!__coerce__`, and so have to be written with " +"this in mind. Finally, calling a function on every attribute access results " +"in a sizable performance loss." #: ../../whatsnew/2.2.rst:337 msgid "" @@ -434,6 +625,10 @@ msgid "" "want to define a :attr:`!size` attribute that's computed, but also settable, " "you could write::" msgstr "" +":class:`property` is a new built-in type that packages up three functions " +"that get, set, or delete an attribute, and a docstring. For example, if you " +"want to define a :attr:`!size` attribute that's computed, but also settable, " +"you could write::" #: ../../whatsnew/2.2.rst:357 msgid "" @@ -444,6 +639,12 @@ msgid "" "the only ones which have to perform the work of calling a function, so " "references to other attributes run at their usual speed." msgstr "" +"That is certainly clearer and easier to write than a pair of :meth:`!" +"__getattr__`/:meth:`!__setattr__` methods that check for the :attr:`!size` " +"attribute and handle it specially while retrieving all other attributes from " +"the instance's :attr:`~object.__dict__`. Accesses to :attr:`!size` are also " +"the only ones which have to perform the work of calling a function, so " +"references to other attributes run at their usual speed." #: ../../whatsnew/2.2.rst:364 msgid "" @@ -455,16 +656,25 @@ msgid "" "`~object.__slots__` to limit the legal attributes to a particular set of " "names. An example will make this clear::" msgstr "" +"Finally, it's possible to constrain the list of attributes that can be " +"referenced on an object using the new :attr:`~object.__slots__` class " +"attribute. Python objects are usually very dynamic; at any time it's " +"possible to define a new attribute on an instance by just doing ``obj." +"new_attr=1``. A new-style class can define a class attribute named :attr:" +"`~object.__slots__` to limit the legal attributes to a particular set of " +"names. An example will make this clear::" #: ../../whatsnew/2.2.rst:385 msgid "" "Note how you get an :exc:`AttributeError` on the attempt to assign to an " "attribute not listed in :attr:`~object.__slots__`." msgstr "" +"Note how you get an :exc:`AttributeError` on the attempt to assign to an " +"attribute not listed in :attr:`~object.__slots__`." #: ../../whatsnew/2.2.rst:392 msgid "Related Links" -msgstr "" +msgstr "Related Links" #: ../../whatsnew/2.2.rst:394 msgid "" @@ -473,6 +683,10 @@ msgid "" "been simplified or ignored. Where should you go to get a more complete " "picture?" msgstr "" +"This section has just been a quick overview of the new features, giving " +"enough of an explanation to start you programming, but many details have " +"been simplified or ignored. Where should you go to get a more complete " +"picture?" #: ../../whatsnew/2.2.rst:398 msgid "" @@ -481,6 +695,10 @@ msgid "" "whetted your appetite, go read this tutorial next, because it goes into much " "more detail about the new features while still remaining quite easy to read." msgstr "" +"The :ref:`descriptorhowto` is a lengthy tutorial introduction to the " +"descriptor features, written by Guido van Rossum. If my description has " +"whetted your appetite, go read this tutorial next, because it goes into much " +"more detail about the new features while still remaining quite easy to read." #: ../../whatsnew/2.2.rst:403 msgid "" @@ -493,6 +711,14 @@ msgid "" "explode. Both PEPs were written and implemented by Guido van Rossum, with " "substantial assistance from the rest of the Zope Corp. team." msgstr "" +"Next, there are two relevant PEPs, :pep:`252` and :pep:`253`. :pep:`252` is " +"titled \"Making Types Look More Like Classes\", and covers the descriptor " +"API. :pep:`253` is titled \"Subtyping Built-in Types\", and describes the " +"changes to type objects that make it possible to subtype built-in objects. :" +"pep:`253` is the more complicated PEP of the two, and at a few points the " +"necessary explanations of types and meta-types may cause your head to " +"explode. Both PEPs were written and implemented by Guido van Rossum, with " +"substantial assistance from the rest of the Zope Corp. team." #: ../../whatsnew/2.2.rst:412 msgid "" @@ -501,10 +727,14 @@ msgid "" "should only resort to it after all other avenues have been exhausted, " "including posting a question to python-list or python-dev." msgstr "" +"Finally, there's the ultimate authority: the source code. Most of the " +"machinery for the type handling is in :file:`Objects/typeobject.c`, but you " +"should only resort to it after all other avenues have been exhausted, " +"including posting a question to python-list or python-dev." #: ../../whatsnew/2.2.rst:421 msgid "PEP 234: Iterators" -msgstr "" +msgstr "PEP 234: Iterators" #: ../../whatsnew/2.2.rst:423 msgid "" @@ -512,6 +742,9 @@ msgid "" "and Python levels. Objects can define how they can be looped over by " "callers." msgstr "" +"Another significant addition to 2.2 is an iteration interface at both the C " +"and Python levels. Objects can define how they can be looped over by " +"callers." #: ../../whatsnew/2.2.rst:426 msgid "" @@ -519,6 +752,9 @@ msgid "" "is to define a :meth:`~object.__getitem__` method that looks something like " "this::" msgstr "" +"In Python versions up to 2.1, the usual way to make ``for item in obj`` work " +"is to define a :meth:`~object.__getitem__` method that looks something like " +"this::" #: ../../whatsnew/2.2.rst:432 msgid "" @@ -533,6 +769,16 @@ msgid "" "using ``file[5]`` to randomly access the sixth element will work, though it " "really should." msgstr "" +":meth:`~object.__getitem__` is more properly used to define an indexing " +"operation on an object so that you can write ``obj[5]`` to retrieve the " +"sixth element. It's a bit misleading when you're using this only to " +"support :keyword:`for` loops. Consider some file-like object that wants to " +"be looped over; the *index* parameter is essentially meaningless, as the " +"class probably assumes that a series of :meth:`~object.__getitem__` calls " +"will be made with *index* incrementing by one each time. In other words, " +"the presence of the :meth:`~object.__getitem__` method doesn't mean that " +"using ``file[5]`` to randomly access the sixth element will work, though it " +"really should." #: ../../whatsnew/2.2.rst:442 msgid "" @@ -544,6 +790,13 @@ msgid "" "sentinel)`` returns an iterator that will invoke the callable object *C* " "until it returns *sentinel* to signal that the iterator is done." msgstr "" +"In Python 2.2, iteration can be implemented separately, and :meth:`~object." +"__getitem__` methods can be limited to classes that really do support random " +"access. The basic idea of iterators is simple. A new built-in function, " +"``iter(obj)`` or ``iter(C, sentinel)``, is used to get an iterator. " +"``iter(obj)`` returns an iterator for the object *obj*, while ``iter(C, " +"sentinel)`` returns an iterator that will invoke the callable object *C* " +"until it returns *sentinel* to signal that the iterator is done." #: ../../whatsnew/2.2.rst:450 msgid "" @@ -555,6 +808,13 @@ msgid "" "extension types that want to behave as iterators can define a :c:member:" "`~PyTypeObject.tp_iternext` function." msgstr "" +"Python classes can define an :meth:`!__iter__` method, which should create " +"and return a new iterator for the object; if the object is its own iterator, " +"this method can just return ``self``. In particular, iterators will usually " +"be their own iterators. Extension types implemented in C can implement a :c:" +"member:`~PyTypeObject.tp_iter` function in order to return an iterator, and " +"extension types that want to behave as iterators can define a :c:member:" +"`~PyTypeObject.tp_iternext` function." #: ../../whatsnew/2.2.rst:457 msgid "" @@ -563,6 +823,10 @@ msgid "" "When there are no more values to be returned, calling :meth:`next` should " "raise the :exc:`StopIteration` exception. ::" msgstr "" +"So, after all this, what do iterators actually do? They have one required " +"method, :meth:`next`, which takes no arguments and returns the next value. " +"When there are no more values to be returned, calling :meth:`next` should " +"raise the :exc:`StopIteration` exception. ::" #: ../../whatsnew/2.2.rst:478 msgid "" @@ -575,6 +839,14 @@ msgid "" "changed to use the iterator protocol. This means you can do things like " "this::" msgstr "" +"In 2.2, Python's :keyword:`for` statement no longer expects a sequence; it " +"expects something for which :func:`iter` will return an iterator. For " +"backward compatibility and convenience, an iterator is automatically " +"constructed for sequences that don't implement :meth:`!__iter__` or a :c:" +"member:`~PyTypeObject.tp_iter` slot, so ``for i in [1,2,3]`` will still " +"work. Wherever the Python interpreter loops over a sequence, it's been " +"changed to use the iterator protocol. This means you can do things like " +"this::" #: ../../whatsnew/2.2.rst:492 msgid "" @@ -582,6 +854,9 @@ msgid "" "func:`iter` on a dictionary will return an iterator which loops over its " "keys::" msgstr "" +"Iterator support has been added to some of Python's basic types. Calling :" +"func:`iter` on a dictionary will return an iterator which loops over its " +"keys::" #: ../../whatsnew/2.2.rst:512 msgid "" @@ -591,6 +866,11 @@ msgid "" "iterator. In a minor related change, the :keyword:`in` operator now works on " "dictionaries, so ``key in dict`` is now equivalent to ``dict.has_key(key)``." msgstr "" +"That's just the default behaviour. If you want to iterate over keys, " +"values, or key/value pairs, you can explicitly call the :meth:`!iterkeys`, :" +"meth:`!itervalues`, or :meth:`!iteritems` methods to get an appropriate " +"iterator. In a minor related change, the :keyword:`in` operator now works on " +"dictionaries, so ``key in dict`` is now equivalent to ``dict.has_key(key)``." #: ../../whatsnew/2.2.rst:518 msgid "" @@ -598,6 +878,9 @@ msgid "" "until there are no more lines in the file. This means you can now read each " "line of a file using code like this::" msgstr "" +"Files also provide an iterator, which calls the :meth:`readline` method " +"until there are no more lines in the file. This means you can now read each " +"line of a file using code like this::" #: ../../whatsnew/2.2.rst:526 msgid "" @@ -606,26 +889,34 @@ msgid "" "object could provide such additional capabilities, but the iterator protocol " "only requires a :meth:`next` method." msgstr "" +"Note that you can only go forward in an iterator; there's no way to get the " +"previous element, reset the iterator, or make a copy of it. An iterator " +"object could provide such additional capabilities, but the iterator protocol " +"only requires a :meth:`next` method." #: ../../whatsnew/2.2.rst:534 msgid ":pep:`234` - Iterators" -msgstr ":pep:`234` - Iteradores" +msgstr ":pep:`234` - Iterators" #: ../../whatsnew/2.2.rst:535 msgid "" "Written by Ka-Ping Yee and GvR; implemented by the Python Labs crew, mostly " "by GvR and Tim Peters." msgstr "" +"Written by Ka-Ping Yee and GvR; implemented by the Python Labs crew, mostly " +"by GvR and Tim Peters." #: ../../whatsnew/2.2.rst:542 msgid "PEP 255: Simple Generators" -msgstr "PEP 255: Geradores Simples" +msgstr "PEP 255: Simple Generators" #: ../../whatsnew/2.2.rst:544 msgid "" "Generators are another new feature, one that interacts with the introduction " "of iterators." msgstr "" +"Generators are another new feature, one that interacts with the introduction " +"of iterators." #: ../../whatsnew/2.2.rst:547 msgid "" @@ -639,10 +930,19 @@ msgid "" "This is what generators provide; they can be thought of as resumable " "functions." msgstr "" +"You're doubtless familiar with how function calls work in Python or C. When " +"you call a function, it gets a private namespace where its local variables " +"are created. When the function reaches a :keyword:`return` statement, the " +"local variables are destroyed and the resulting value is returned to the " +"caller. A later call to the same function will get a fresh new set of local " +"variables. But, what if the local variables weren't thrown away on exiting a " +"function? What if you could later resume the function where it left off? " +"This is what generators provide; they can be thought of as resumable " +"functions." #: ../../whatsnew/2.2.rst:556 msgid "Here's the simplest example of a generator function::" -msgstr "" +msgstr "Here's the simplest example of a generator function::" #: ../../whatsnew/2.2.rst:562 msgid "" @@ -654,6 +954,13 @@ msgid "" "import generators`` statement near the top of the module's source code. In " "Python 2.3 this statement will become unnecessary." msgstr "" +"A new keyword, :keyword:`yield`, was introduced for generators. Any " +"function containing a :keyword:`!yield` statement is a generator function; " +"this is detected by Python's bytecode compiler which compiles the function " +"specially as a result. Because a new keyword was introduced, generators " +"must be explicitly enabled in a module by including a ``from __future__ " +"import generators`` statement near the top of the module's source code. In " +"Python 2.3 this statement will become unnecessary." #: ../../whatsnew/2.2.rst:570 msgid "" @@ -670,17 +977,29 @@ msgid "" "`try`...\\ :keyword:`finally` statement; read :pep:`255` for a full " "explanation of the interaction between :keyword:`!yield` and exceptions.)" msgstr "" +"When you call a generator function, it doesn't return a single value; " +"instead it returns a generator object that supports the iterator protocol. " +"On executing the :keyword:`yield` statement, the generator outputs the value " +"of ``i``, similar to a :keyword:`return` statement. The big difference " +"between :keyword:`!yield` and a :keyword:`!return` statement is that on " +"reaching a :keyword:`!yield` the generator's state of execution is suspended " +"and local variables are preserved. On the next call to the generator's " +"``next()`` method, the function will resume executing immediately after the :" +"keyword:`!yield` statement. (For complicated reasons, the :keyword:`!yield` " +"statement isn't allowed inside the :keyword:`!try` block of a :keyword:" +"`try`...\\ :keyword:`finally` statement; read :pep:`255` for a full " +"explanation of the interaction between :keyword:`!yield` and exceptions.)" #: ../../whatsnew/2.2.rst:583 msgid "Here's a sample usage of the :func:`!generate_ints` generator::" -msgstr "" +msgstr "Here's a sample usage of the :func:`!generate_ints` generator::" #: ../../whatsnew/2.2.rst:600 msgid "" "You could equally write ``for i in generate_ints(5)``, or ``a,b,c = " "generate_ints(3)``." msgstr "" -"Você pode igualmente escrever ``for i in generate_ints(5)``,ou ``a,b,c = " +"You could equally write ``for i in generate_ints(5)``, or ``a,b,c = " "generate_ints(3)``." #: ../../whatsnew/2.2.rst:603 @@ -693,6 +1012,13 @@ msgid "" "indicated by raising :exc:`StopIteration` manually, or by just letting the " "flow of execution fall off the bottom of the function." msgstr "" +"Inside a generator function, the :keyword:`return` statement can only be " +"used without a value, and signals the end of the procession of values; " +"afterwards the generator cannot return any further values. :keyword:`!" +"return` with a value, such as ``return 5``, is a syntax error inside a " +"generator function. The end of the generator's results can also be " +"indicated by raising :exc:`StopIteration` manually, or by just letting the " +"flow of execution fall off the bottom of the function." #: ../../whatsnew/2.2.rst:611 msgid "" @@ -706,6 +1032,15 @@ msgid "" "The simplest one implements an in-order traversal of a tree using generators " "recursively. ::" msgstr "" +"You could achieve the effect of generators manually by writing your own " +"class and storing all the local variables of the generator as instance " +"variables. For example, returning a list of integers could be done by " +"setting ``self.count`` to 0, and having the :meth:`next` method increment " +"``self.count`` and return it. However, for a moderately complicated " +"generator, writing a corresponding class would be much messier. :file:`Lib/" +"test/test_generators.py` contains a number of more interesting examples. " +"The simplest one implements an in-order traversal of a tree using generators " +"recursively. ::" #: ../../whatsnew/2.2.rst:629 msgid "" @@ -715,6 +1050,11 @@ msgid "" "knight to every square of an $NxN$ chessboard without visiting any square " "twice)." msgstr "" +"Two other examples in :file:`Lib/test/test_generators.py` produce solutions " +"for the N-Queens problem (placing $N$ queens on an $NxN$ chess board so that " +"no queen threatens another) and the Knight's Tour (a route that takes a " +"knight to every square of an $NxN$ chessboard without visiting any square " +"twice)." #: ../../whatsnew/2.2.rst:634 msgid "" @@ -725,6 +1065,12 @@ msgid "" "Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea " "of what this looks like::" msgstr "" +"The idea of generators comes from other programming languages, especially " +"Icon (https://www2.cs.arizona.edu/icon/), where the idea of generators is " +"central. In Icon, every expression and function call behaves like a " +"generator. One example from \"An Overview of the Icon Programming " +"Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea " +"of what this looks like::" #: ../../whatsnew/2.2.rst:644 msgid "" @@ -735,6 +1081,12 @@ msgid "" "5, so the comparison now succeeds, and the code prints the value 23 to the " "screen." msgstr "" +"In Icon the :func:`!find` function returns the indexes at which the " +"substring \"or\" is found: 3, 23, 33. In the :keyword:`if` statement, ``i`` " +"is first assigned a value of 3, but 3 is less than 5, so the comparison " +"fails, and Icon retries it with the second value of 23. 23 is greater than " +"5, so the comparison now succeeds, and the code prints the value 23 to the " +"screen." #: ../../whatsnew/2.2.rst:650 msgid "" @@ -746,10 +1098,17 @@ msgid "" "represented as a concrete object (the iterator) that can be passed around to " "other functions or stored in a data structure." msgstr "" +"Python doesn't go nearly as far as Icon in adopting generators as a central " +"concept. Generators are considered a new part of the core Python language, " +"but learning or using them isn't compulsory; if they don't solve any " +"problems that you have, feel free to ignore them. One novel feature of " +"Python's interface as compared to Icon's is that a generator's state is " +"represented as a concrete object (the iterator) that can be passed around to " +"other functions or stored in a data structure." #: ../../whatsnew/2.2.rst:661 msgid ":pep:`255` - Simple Generators" -msgstr ":pep:`255` - Geradores simples" +msgstr ":pep:`255` - Simple Generators" #: ../../whatsnew/2.2.rst:662 msgid "" @@ -757,10 +1116,13 @@ msgid "" "mostly by Neil Schemenauer and Tim Peters, with other fixes from the Python " "Labs crew." msgstr "" +"Written by Neil Schemenauer, Tim Peters, Magnus Lie Hetland. Implemented " +"mostly by Neil Schemenauer and Tim Peters, with other fixes from the Python " +"Labs crew." #: ../../whatsnew/2.2.rst:669 msgid "PEP 237: Unifying Long Integers and Integers" -msgstr "PEP 237: Unificando inteiros longos e inteiros" +msgstr "PEP 237: Unifying Long Integers and Integers" #: ../../whatsnew/2.2.rst:671 msgid "" @@ -774,6 +1136,15 @@ msgid "" "be used as a slice index, and ``'abc'[1L:]`` would raise a :exc:`TypeError` " "exception with the message 'slice index must be int'." msgstr "" +"In recent versions, the distinction between regular integers, which are 32-" +"bit values on most machines, and long integers, which can be of arbitrary " +"size, was becoming an annoyance. For example, on platforms that support " +"files larger than ``2**32`` bytes, the :meth:`!tell` method of file objects " +"has to return a long integer. However, there were various bits of Python " +"that expected plain integers and would raise an error if a long integer was " +"provided instead. For example, in Python 1.5, only regular integers could " +"be used as a slice index, and ``'abc'[1L:]`` would raise a :exc:`TypeError` " +"exception with the message 'slice index must be int'." #: ../../whatsnew/2.2.rst:681 msgid "" @@ -785,6 +1156,13 @@ msgid "" "to raise an :exc:`OverflowError` will now return a long integer as their " "result. For example::" msgstr "" +"Python 2.2 will shift values from short to long integers as required. The " +"'L' suffix is no longer needed to indicate a long integer literal, as now " +"the compiler will choose the appropriate type. (Using the 'L' suffix will " +"be discouraged in future 2.x versions of Python, triggering a warning in " +"Python 2.4, and probably dropped in Python 3.0.) Many operations that used " +"to raise an :exc:`OverflowError` will now return a long integer as their " +"result. For example::" #: ../../whatsnew/2.2.rst:694 msgid "" @@ -792,20 +1170,25 @@ msgid "" "You can still distinguish them with the :func:`type` built-in function, but " "that's rarely needed." msgstr "" +"In most cases, integers and long integers will now be treated identically. " +"You can still distinguish them with the :func:`type` built-in function, but " +"that's rarely needed." #: ../../whatsnew/2.2.rst:701 msgid ":pep:`237` - Unifying Long Integers and Integers" -msgstr ":pep:`237` - Unificando inteiros longos e inteiros" +msgstr ":pep:`237` - Unifying Long Integers and Integers" #: ../../whatsnew/2.2.rst:702 msgid "" "Written by Moshe Zadka and Guido van Rossum. Implemented mostly by Guido " "van Rossum." msgstr "" +"Written by Moshe Zadka and Guido van Rossum. Implemented mostly by Guido " +"van Rossum." #: ../../whatsnew/2.2.rst:709 msgid "PEP 238: Changing the Division Operator" -msgstr "" +msgstr "PEP 238: Changing the Division Operator" #: ../../whatsnew/2.2.rst:711 msgid "" @@ -819,6 +1202,15 @@ msgid "" "the two operands and because Python is dynamically typed, it can be " "difficult to determine the possible types of the operands." msgstr "" +"The most controversial change in Python 2.2 heralds the start of an effort " +"to fix an old design flaw that's been in Python from the beginning. " +"Currently Python's division operator, ``/``, behaves like C's division " +"operator when presented with two integer arguments: it returns an integer " +"result that's truncated down when there would be a fractional part. For " +"example, ``3/2`` is 1, not 1.5, and ``(-1)/2`` is -1, not -0.5. This means " +"that the results of division can vary unexpectedly depending on the type of " +"the two operands and because Python is dynamically typed, it can be " +"difficult to determine the possible types of the operands." #: ../../whatsnew/2.2.rst:721 msgid "" @@ -829,6 +1221,12 @@ msgid "" "either side here and will stick to describing what's implemented in 2.2. " "Read :pep:`238` for a summary of arguments and counter-arguments.)" msgstr "" +"(The controversy is over whether this is *really* a design flaw, and whether " +"it's worth breaking existing code to fix this. It's caused endless " +"discussions on python-dev, and in July 2001 erupted into a storm of acidly " +"sarcastic postings on :newsgroup:`comp.lang.python`. I won't argue for " +"either side here and will stick to describing what's implemented in 2.2. " +"Read :pep:`238` for a summary of arguments and counter-arguments.)" #: ../../whatsnew/2.2.rst:728 msgid "" @@ -836,6 +1234,9 @@ msgid "" "Python 2.2 begins the transition, but the switch won't be complete until " "Python 3.0." msgstr "" +"Because this change might break code, it's being introduced very gradually. " +"Python 2.2 begins the transition, but the switch won't be complete until " +"Python 3.0." #: ../../whatsnew/2.2.rst:732 msgid "" @@ -848,10 +1249,18 @@ msgid "" "operands are integers, and returns the result of true division when one of " "the operands is a floating-point number." msgstr "" +"First, I'll borrow some terminology from :pep:`238`. \"True division\" is " +"the division that most non-programmers are familiar with: 3/2 is 1.5, 1/4 is " +"0.25, and so forth. \"Floor division\" is what Python's ``/`` operator " +"currently does when given integer operands; the result is the floor of the " +"value returned by true division. \"Classic division\" is the current mixed " +"behaviour of ``/``; it returns the result of floor division when the " +"operands are integers, and returns the result of true division when one of " +"the operands is a floating-point number." #: ../../whatsnew/2.2.rst:740 msgid "Here are the changes 2.2 introduces:" -msgstr "" +msgstr "Here are the changes 2.2 introduces:" #: ../../whatsnew/2.2.rst:742 msgid "" @@ -860,12 +1269,18 @@ msgid "" "no matter what the types of its operands are, so ``1 // 2`` is 0 and " "``1.0 // 2.0`` is also 0.0." msgstr "" +"A new operator, ``//``, is the floor division operator. (Yes, we know it " +"looks like C++'s comment symbol.) ``//`` *always* performs floor division " +"no matter what the types of its operands are, so ``1 // 2`` is 0 and " +"``1.0 // 2.0`` is also 0.0." #: ../../whatsnew/2.2.rst:747 msgid "" "``//`` is always available in Python 2.2; you don't need to enable it using " "a ``__future__`` statement." msgstr "" +"``//`` is always available in Python 2.2; you don't need to enable it using " +"a ``__future__`` statement." #: ../../whatsnew/2.2.rst:750 msgid "" @@ -874,6 +1289,10 @@ msgid "" "is 0.5. Without the ``__future__`` statement, ``/`` still means classic " "division. The default meaning of ``/`` will not change until Python 3.0." msgstr "" +"By including a ``from __future__ import division`` in a module, the ``/`` " +"operator will be changed to return the result of true division, so ``1/2`` " +"is 0.5. Without the ``__future__`` statement, ``/`` still means classic " +"division. The default meaning of ``/`` will not change until Python 3.0." #: ../../whatsnew/2.2.rst:755 msgid "" @@ -882,6 +1301,10 @@ msgid "" "level, there are also slots in the :c:type:`PyNumberMethods` structure so " "extension types can define the two operators." msgstr "" +"Classes can define methods called :meth:`~object.__truediv__` and :meth:" +"`~object.__floordiv__` to overload the two division operators. At the C " +"level, there are also slots in the :c:type:`PyNumberMethods` structure so " +"extension types can define the two operators." #: ../../whatsnew/2.2.rst:760 msgid "" @@ -892,20 +1315,28 @@ msgid "" "and fix it. By default, Python 2.2 will simply perform classic division " "without a warning; the warning will be turned on by default in Python 2.3." msgstr "" +"Python 2.2 supports some command-line arguments for testing whether code " +"will work with the changed division semantics. Running python with :option:" +"`!-Q warn` will cause a warning to be issued whenever division is applied to " +"two integers. You can use this to find code that's affected by the change " +"and fix it. By default, Python 2.2 will simply perform classic division " +"without a warning; the warning will be turned on by default in Python 2.3." #: ../../whatsnew/2.2.rst:770 msgid ":pep:`238` - Changing the Division Operator" -msgstr "" +msgstr ":pep:`238` - Changing the Division Operator" #: ../../whatsnew/2.2.rst:771 msgid "" "Written by Moshe Zadka and Guido van Rossum. Implemented by Guido van " "Rossum.." msgstr "" +"Written by Moshe Zadka and Guido van Rossum. Implemented by Guido van " +"Rossum.." #: ../../whatsnew/2.2.rst:777 msgid "Unicode Changes" -msgstr "" +msgstr "Unicode Changes" #: ../../whatsnew/2.2.rst:779 msgid "" @@ -916,6 +1347,12 @@ msgid "" "script. (It's also possible to specify :option:`!--disable-unicode` to " "completely disable Unicode support.)" msgstr "" +"Python's Unicode support has been enhanced a bit in 2.2. Unicode strings " +"are usually stored as UCS-2, as 16-bit unsigned integers. Python 2.2 can " +"also be compiled to use UCS-4, 32-bit unsigned integers, as its internal " +"encoding by supplying :option:`!--enable-unicode=ucs4` to the configure " +"script. (It's also possible to specify :option:`!--disable-unicode` to " +"completely disable Unicode support.)" #: ../../whatsnew/2.2.rst:786 msgid "" @@ -927,6 +1364,13 @@ msgid "" "exception. This is all described in :pep:`261`, \"Support for 'wide' Unicode " "characters\"; consult it for further details." msgstr "" +"When built to use UCS-4 (a \"wide Python\"), the interpreter can natively " +"handle Unicode characters from U+000000 to U+110000, so the range of legal " +"values for the :func:`!unichr` function is expanded accordingly. Using an " +"interpreter compiled to use UCS-2 (a \"narrow Python\"), values greater than " +"65535 will still cause :func:`!unichr` to raise a :exc:`ValueError` " +"exception. This is all described in :pep:`261`, \"Support for 'wide' Unicode " +"characters\"; consult it for further details." #: ../../whatsnew/2.2.rst:794 msgid "" @@ -938,6 +1382,13 @@ msgid "" "the specified encoding and decodes it, returning whatever is returned by the " "codec." msgstr "" +"Another change is simpler to explain. Since their introduction, Unicode " +"strings have supported an :meth:`!encode` method to convert the string to a " +"selected encoding such as UTF-8 or Latin-1. A symmetric " +"``decode([*encoding*])`` method has been added to 8-bit strings (though not " +"to Unicode strings) in 2.2. :meth:`!decode` assumes that the string is in " +"the specified encoding and decodes it, returning whatever is returned by the " +"codec." #: ../../whatsnew/2.2.rst:801 msgid "" @@ -945,12 +1396,17 @@ msgid "" "related to Unicode. For example, codecs have been added for uu-encoding, " "MIME's base64 encoding, and compression with the :mod:`zlib` module::" msgstr "" +"Using this new feature, codecs have been added for tasks not directly " +"related to Unicode. For example, codecs have been added for uu-encoding, " +"MIME's base64 encoding, and compression with the :mod:`zlib` module::" #: ../../whatsnew/2.2.rst:822 msgid "" "To convert a class instance to Unicode, a :meth:`!__unicode__` method can be " "defined by a class, analogous to :meth:`!__str__`." msgstr "" +"To convert a class instance to Unicode, a :meth:`!__unicode__` method can be " +"defined by a class, analogous to :meth:`!__str__`." #: ../../whatsnew/2.2.rst:825 msgid "" @@ -958,14 +1414,17 @@ msgid "" "by Marc-André Lemburg. The changes to support using UCS-4 internally were " "implemented by Fredrik Lundh and Martin von Löwis." msgstr "" +":meth:`!encode`, :meth:`!decode`, and :meth:`!__unicode__` were implemented " +"by Marc-André Lemburg. The changes to support using UCS-4 internally were " +"implemented by Fredrik Lundh and Martin von Löwis." #: ../../whatsnew/2.2.rst:832 msgid ":pep:`261` - Support for 'wide' Unicode characters" -msgstr "" +msgstr ":pep:`261` - Support for 'wide' Unicode characters" #: ../../whatsnew/2.2.rst:833 msgid "Written by Paul Prescod." -msgstr "" +msgstr "Written by Paul Prescod." #: ../../whatsnew/2.2.rst:839 msgid "PEP 227: Nested Scopes" @@ -980,16 +1439,28 @@ msgid "" "scopes from my \"What's New in Python 2.1\" document; if you read it when " "2.1 came out, you can skip the rest of this section." msgstr "" - -#: ../../whatsnew/2.2.rst:848 -msgid "" +"In Python 2.1, statically nested scopes were added as an optional feature, " +"to be enabled by a ``from __future__ import nested_scopes`` directive. In " +"2.2 nested scopes no longer need to be specially enabled, and are now always " +"present. The rest of this section is a copy of the description of nested " +"scopes from my \"What's New in Python 2.1\" document; if you read it when " +"2.1 came out, you can skip the rest of this section." + +#: ../../whatsnew/2.2.rst:848 +msgid "" +"The largest change introduced in Python 2.1, and made complete in 2.2, is to " +"Python's scoping rules. In Python 2.0, at any given time there are at most " +"three namespaces used to look up variable names: local, module-level, and " +"the built-in namespace. This often surprised people because it didn't match " +"their intuitive expectations. For example, a nested recursive function " +"definition doesn't work::" +msgstr "" "The largest change introduced in Python 2.1, and made complete in 2.2, is to " "Python's scoping rules. In Python 2.0, at any given time there are at most " "three namespaces used to look up variable names: local, module-level, and " "the built-in namespace. This often surprised people because it didn't match " "their intuitive expectations. For example, a nested recursive function " "definition doesn't work::" -msgstr "" #: ../../whatsnew/2.2.rst:862 msgid "" @@ -1002,6 +1473,14 @@ msgid "" "find local variables being copied by passing them as the default values of " "arguments. ::" msgstr "" +"The function :func:`!g` will always raise a :exc:`NameError` exception, " +"because the binding of the name ``g`` isn't in either its local namespace or " +"in the module-level namespace. This isn't much of a problem in practice " +"(how often do you recursively define interior functions like this?), but " +"this also made using the :keyword:`lambda` expression clumsier, and this was " +"a problem in practice. In code which uses :keyword:`!lambda` you can often " +"find local variables being copied by passing them as the default values of " +"arguments. ::" #: ../../whatsnew/2.2.rst:876 msgid "" @@ -1022,6 +1501,14 @@ msgid "" "local namespace of the enclosing scope. A more detailed explanation of the " "rules, and a dissection of the implementation, can be found in the PEP." msgstr "" +"The most significant change to Python 2.2 is that static scoping has been " +"added to the language to fix this problem. As a first effect, the " +"``name=name`` default argument is now unnecessary in the above example. Put " +"simply, when a given variable name is not assigned a value within a function " +"(by an assignment, or the :keyword:`def`, :keyword:`class`, or :keyword:" +"`import` statements), references to the variable will be looked up in the " +"local namespace of the enclosing scope. A more detailed explanation of the " +"rules, and a dissection of the implementation, can be found in the PEP." #: ../../whatsnew/2.2.rst:888 msgid "" @@ -1075,6 +1562,9 @@ msgid "" "would define a new local variable named ``x`` whose value should be accessed " "by :func:`!g`." msgstr "" +"Line 4 containing the ``exec`` statement is a syntax error, since ``exec`` " +"would define a new local variable named ``x`` whose value should be accessed " +"by :func:`!g`." #: ../../whatsnew/2.2.rst:920 msgid "" @@ -1107,6 +1597,12 @@ msgid "" "from the O'Reilly Network, and then lists the recent headlines for one " "channel::" msgstr "" +"The :mod:`xmlrpclib ` module was contributed to the standard " +"library by Fredrik Lundh, providing support for writing XML-RPC clients. " +"XML-RPC is a simple remote procedure call protocol built on top of HTTP and " +"XML. For example, the following snippet retrieves a list of RSS channels " +"from the O'Reilly Network, and then lists the recent headlines for one " +"channel::" #: ../../whatsnew/2.2.rst:959 msgid "" @@ -1114,12 +1610,17 @@ msgid "" "straightforward XML-RPC servers. See http://xmlrpc.scripting.com/ for more " "information about XML-RPC." msgstr "" +"The :mod:`SimpleXMLRPCServer ` module makes it easy to create " +"straightforward XML-RPC servers. See http://xmlrpc.scripting.com/ for more " +"information about XML-RPC." #: ../../whatsnew/2.2.rst:962 msgid "" "The new :mod:`hmac` module implements the HMAC algorithm described by :rfc:" "`2104`. (Contributed by Gerhard Häring.)" msgstr "" +"The new :mod:`hmac` module implements the HMAC algorithm described by :rfc:" +"`2104`. (Contributed by Gerhard Häring.)" #: ../../whatsnew/2.2.rst:965 msgid "" @@ -1131,6 +1632,13 @@ msgid "" "localtime`, :func:`~time.gmtime`, and :func:`~time.strptime` in the :mod:" "`time` module." msgstr "" +"Several functions that originally returned lengthy tuples now return pseudo-" +"sequences that still behave like tuples but also have mnemonic attributes " +"such as :attr:`!memberst_mtime` or :attr:`~time.struct_time.tm_year`. The " +"enhanced functions include :func:`~os.stat`, :func:`~os.fstat`, :func:`~os." +"statvfs`, and :func:`~os.fstatvfs` in the :mod:`os` module, and :func:`~time." +"localtime`, :func:`~time.gmtime`, and :func:`~time.strptime` in the :mod:" +"`time` module." #: ../../whatsnew/2.2.rst:972 msgid "" @@ -1139,10 +1647,14 @@ msgid "" "now this can be written more clearly as ``file_size = os.stat(filename)." "st_size``." msgstr "" +"For example, to obtain a file's size using the old tuples, you'd end up " +"writing something like ``file_size = os.stat(filename)[stat.ST_SIZE]``, but " +"now this can be written more clearly as ``file_size = os.stat(filename)." +"st_size``." #: ../../whatsnew/2.2.rst:976 msgid "The original patch for this feature was contributed by Nick Mathewson." -msgstr "" +msgstr "The original patch for this feature was contributed by Nick Mathewson." #: ../../whatsnew/2.2.rst:978 msgid "" @@ -1150,6 +1662,9 @@ msgid "" "output have been corrected. (Contributed by Fred L. Drake, Jr. and Tim " "Peters.)" msgstr "" +"The Python profiler has been extensively reworked and various errors in its " +"output have been corrected. (Contributed by Fred L. Drake, Jr. and Tim " +"Peters.)" #: ../../whatsnew/2.2.rst:981 msgid "" @@ -1157,6 +1672,9 @@ msgid "" "option:`!--enable-ipv6` option to Python's configure script. (Contributed " "by Jun-ichiro \"itojun\" Hagino.)" msgstr "" +"The :mod:`socket` module can be compiled to support IPv6; specify the :" +"option:`!--enable-ipv6` option to Python's configure script. (Contributed " +"by Jun-ichiro \"itojun\" Hagino.)" #: ../../whatsnew/2.2.rst:985 msgid "" @@ -1165,6 +1683,10 @@ msgid "" "for a signed 64-bit integer, and ``Q`` is for an unsigned one. The value is " "returned in Python's long integer type. (Contributed by Tim Peters.)" msgstr "" +"Two new format characters were added to the :mod:`struct` module for 64-bit " +"integers on platforms that support the C :c:expr:`long long` type. ``q`` is " +"for a signed 64-bit integer, and ``Q`` is for an unsigned one. The value is " +"returned in Python's long integer type. (Contributed by Tim Peters.)" #: ../../whatsnew/2.2.rst:990 msgid "" @@ -1176,6 +1698,13 @@ msgid "" "their help text. (Contributed by Guido van Rossum, using Ka-Ping Yee's :mod:" "`pydoc` module.)" msgstr "" +"In the interpreter's interactive mode, there's a new built-in function :func:" +"`help` that uses the :mod:`pydoc` module introduced in Python 2.1 to provide " +"interactive help. ``help(object)`` displays any available help text about " +"*object*. :func:`help` with no argument puts you in an online help utility, " +"where you can enter the names of functions, classes, or modules to read " +"their help text. (Contributed by Guido van Rossum, using Ka-Ping Yee's :mod:" +"`pydoc` module.)" #: ../../whatsnew/2.2.rst:998 msgid "" @@ -1187,6 +1716,13 @@ msgid "" "all the non-overlapping matches in a given string. (SRE is maintained by " "Fredrik Lundh. The BIGCHARSET patch was contributed by Martin von Löwis.)" msgstr "" +"Various bugfixes and performance improvements have been made to the SRE " +"engine underlying the :mod:`re` module. For example, the :func:`re.sub` " +"and :func:`re.split` functions have been rewritten in C. Another " +"contributed patch speeds up certain Unicode character ranges by a factor of " +"two, and a new :meth:`~re.finditer` method that returns an iterator over " +"all the non-overlapping matches in a given string. (SRE is maintained by " +"Fredrik Lundh. The BIGCHARSET patch was contributed by Martin von Löwis.)" #: ../../whatsnew/2.2.rst:1006 msgid "" @@ -1195,6 +1731,10 @@ msgid "" "program and the mail transport agent being handed a message. :mod:`smtplib` " "also supports SMTP authentication. (Contributed by Gerhard Häring.)" msgstr "" +"The :mod:`smtplib` module now supports :rfc:`2487`, \"Secure SMTP over " +"TLS\", so it's now possible to encrypt the SMTP traffic between a Python " +"program and the mail transport agent being handed a message. :mod:`smtplib` " +"also supports SMTP authentication. (Contributed by Gerhard Häring.)" #: ../../whatsnew/2.2.rst:1011 msgid "" @@ -1203,6 +1743,10 @@ msgid "" "SORT, GETACL and SETACL. (Contributed by Anthony Baxter and Michel " "Pelletier.)" msgstr "" +"The :mod:`imaplib` module, maintained by Piers Lauder, has support for " +"several new extensions: the NAMESPACE extension defined in :rfc:`2342`, " +"SORT, GETACL and SETACL. (Contributed by Anthony Baxter and Michel " +"Pelletier.)" #: ../../whatsnew/2.2.rst:1015 msgid "" @@ -1212,6 +1756,11 @@ msgid "" "been added for parsing and generating e-mail messages. (Contributed by " "Barry Warsaw, and arising out of his work on Mailman.)" msgstr "" +"The :mod:`!rfc822` module's parsing of email addresses is now compliant " +"with :rfc:`2822`, an update to :rfc:`822`. (The module's name is *not* " +"going to be changed to ``rfc2822``.) A new package, :mod:`email`, has also " +"been added for parsing and generating e-mail messages. (Contributed by " +"Barry Warsaw, and arising out of his work on Mailman.)" #: ../../whatsnew/2.2.rst:1021 msgid "" @@ -1223,6 +1772,13 @@ msgid "" "contributed by David Goodger, from ndiff.py code by Tim Peters who then did " "the generatorization.)" msgstr "" +"The :mod:`difflib` module now contains a new :class:`!Differ` class for " +"producing human-readable lists of changes (a \"delta\") between two " +"sequences of lines of text. There are also two generator functions, :func:`!" +"ndiff` and :func:`!restore`, which respectively return a delta from two " +"sequences, or one of the original sequences from a delta. (Grunt work " +"contributed by David Goodger, from ndiff.py code by Tim Peters who then did " +"the generatorization.)" #: ../../whatsnew/2.2.rst:1028 msgid "" @@ -1235,6 +1791,14 @@ msgid "" "been fixed to use :const:`!ascii_letters` instead. (Reported by an unknown " "person; fixed by Fred L. Drake, Jr.)" msgstr "" +"New constants :const:`!ascii_letters`, :const:`!ascii_lowercase`, and :const:" +"`!ascii_uppercase` were added to the :mod:`string` module. There were " +"several modules in the standard library that used :const:`!string.letters` " +"to mean the ranges A-Za-z, but that assumption is incorrect when locales are " +"in use, because :const:`!string.letters` varies depending on the set of " +"legal characters defined by the current locale. The buggy modules have all " +"been fixed to use :const:`!ascii_letters` instead. (Reported by an unknown " +"person; fixed by Fred L. Drake, Jr.)" #: ../../whatsnew/2.2.rst:1037 msgid "" @@ -1242,6 +1806,9 @@ msgid "" "databases by the addition of a :class:`~mimetypes.MimeTypes` class, which " "takes a list of filenames to be parsed. (Contributed by Fred L. Drake, Jr.)" msgstr "" +"The :mod:`mimetypes` module now makes it easier to use alternative MIME-type " +"databases by the addition of a :class:`~mimetypes.MimeTypes` class, which " +"takes a list of filenames to be parsed. (Contributed by Fred L. Drake, Jr.)" #: ../../whatsnew/2.2.rst:1041 msgid "" @@ -1249,10 +1816,13 @@ msgid "" "that allows scheduling an activity to happen at some future time. " "(Contributed by Itamar Shtull-Trauring.)" msgstr "" +"A :class:`~threading.Timer` class was added to the :mod:`threading` module " +"that allows scheduling an activity to happen at some future time. " +"(Contributed by Itamar Shtull-Trauring.)" #: ../../whatsnew/2.2.rst:1049 msgid "Interpreter Changes and Fixes" -msgstr "" +msgstr "Interpreter Changes and Fixes" #: ../../whatsnew/2.2.rst:1051 msgid "" @@ -1262,6 +1832,11 @@ msgid "" "write Python code, none of the changes described here will affect you very " "much." msgstr "" +"Some of the changes only affect people who deal with the Python interpreter " +"at the C level because they're writing Python extension modules, embedding " +"the interpreter, or just hacking on the interpreter itself. If you only " +"write Python code, none of the changes described here will affect you very " +"much." #: ../../whatsnew/2.2.rst:1056 msgid "" @@ -1274,6 +1849,14 @@ msgid "" "exist, and have simply been changed to use the new C-level interface. " "(Contributed by Fred L. Drake, Jr.)" msgstr "" +"Profiling and tracing functions can now be implemented in C, which can " +"operate at much higher speeds than Python-based functions and should reduce " +"the overhead of profiling and tracing. This will be of interest to authors " +"of development environments for Python. Two new C functions were added to " +"Python's API, :c:func:`PyEval_SetProfile` and :c:func:`PyEval_SetTrace`. The " +"existing :func:`sys.setprofile` and :func:`sys.settrace` functions still " +"exist, and have simply been changed to use the new C-level interface. " +"(Contributed by Fred L. Drake, Jr.)" #: ../../whatsnew/2.2.rst:1065 msgid "" @@ -1296,39 +1879,51 @@ msgid "" "collection, so updating them for 2.2 should be considered fairly high " "priority." msgstr "" +"The C-level interface to the garbage collector has been changed to make it " +"easier to write extension types that support garbage collection and to debug " +"misuses of the functions. Various functions have slightly different " +"semantics, so a bunch of functions had to be renamed. Extensions that use " +"the old API will still compile but will *not* participate in garbage " +"collection, so updating them for 2.2 should be considered fairly high " +"priority." #: ../../whatsnew/2.2.rst:1079 msgid "" "To upgrade an extension module to the new API, perform the following steps:" msgstr "" +"To upgrade an extension module to the new API, perform the following steps:" #: ../../whatsnew/2.2.rst:1081 msgid "Rename :c:macro:`!Py_TPFLAGS_GC` to :c:macro:`Py_TPFLAGS_HAVE_GC`." -msgstr "" +msgstr "Rename :c:macro:`!Py_TPFLAGS_GC` to :c:macro:`Py_TPFLAGS_HAVE_GC`." #: ../../whatsnew/2.2.rst:1083 msgid "" "Use :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar` to allocate" msgstr "" +"Use :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar` to allocate" #: ../../whatsnew/2.2.rst:1084 msgid "objects, and :c:func:`PyObject_GC_Del` to deallocate them." -msgstr "" +msgstr "objects, and :c:func:`PyObject_GC_Del` to deallocate them." #: ../../whatsnew/2.2.rst:1086 msgid "" "Rename :c:func:`!PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and :c:" "func:`!PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`." msgstr "" +"Rename :c:func:`!PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and :c:" +"func:`!PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`." #: ../../whatsnew/2.2.rst:1089 msgid "Remove :c:macro:`!PyGC_HEAD_SIZE` from object size calculations." -msgstr "" +msgstr "Remove :c:macro:`!PyGC_HEAD_SIZE` from object size calculations." #: ../../whatsnew/2.2.rst:1091 msgid "" "Remove calls to :c:func:`!PyObject_AS_GC` and :c:func:`!PyObject_FROM_GC`." msgstr "" +"Remove calls to :c:func:`!PyObject_AS_GC` and :c:func:`!PyObject_FROM_GC`." #: ../../whatsnew/2.2.rst:1093 msgid "" @@ -1341,6 +1936,14 @@ msgid "" "converts them to the specified new encoding. (Contributed by M.-A. Lemburg, " "and used for the MBCS support on Windows described in the following section.)" msgstr "" +"A new ``et`` format sequence was added to :c:func:`PyArg_ParseTuple`; ``et`` " +"takes both a parameter and an encoding name, and converts the parameter to " +"the given encoding if the parameter turns out to be a Unicode string, or " +"leaves it alone if it's an 8-bit string, assuming it to already be in the " +"desired encoding. This differs from the ``es`` format character, which " +"assumes that 8-bit strings are in Python's default ASCII encoding and " +"converts them to the specified new encoding. (Contributed by M.-A. Lemburg, " +"and used for the MBCS support on Windows described in the following section.)" #: ../../whatsnew/2.2.rst:1102 msgid "" @@ -1350,6 +1953,11 @@ msgid "" "expected, and a set of pointers to :c:expr:`PyObject*` variables that will " "be filled in with argument values." msgstr "" +"A different argument parsing function, :c:func:`PyArg_UnpackTuple`, has been " +"added that's simpler and presumably faster. Instead of specifying a format " +"string, the caller simply gives the minimum and maximum number of arguments " +"expected, and a set of pointers to :c:expr:`PyObject*` variables that will " +"be filled in with argument values." #: ../../whatsnew/2.2.rst:1108 msgid "" @@ -1360,6 +1968,12 @@ msgid "" "`METH_VARARGS`. Also, the old :c:macro:`!METH_OLDARGS` style of writing C " "methods is now officially deprecated." msgstr "" +"Two new flags :c:macro:`METH_NOARGS` and :c:macro:`METH_O` are available in " +"method definition tables to simplify implementation of methods with no " +"arguments or a single untyped argument. Calling such methods is more " +"efficient than calling a corresponding method that uses :c:macro:" +"`METH_VARARGS`. Also, the old :c:macro:`!METH_OLDARGS` style of writing C " +"methods is now officially deprecated." #: ../../whatsnew/2.2.rst:1114 msgid "" @@ -1370,6 +1984,12 @@ msgid "" "functions, the Python versions check the bounds of the buffer used to " "protect against buffer overruns. (Contributed by M.-A. Lemburg.)" msgstr "" +"Two new wrapper functions, :c:func:`PyOS_snprintf` and :c:func:" +"`PyOS_vsnprintf` were added to provide cross-platform implementations for " +"the relatively new :c:func:`snprintf` and :c:func:`vsnprintf` C lib APIs. In " +"contrast to the standard :c:func:`sprintf` and :c:func:`!vsprintf` " +"functions, the Python versions check the bounds of the buffer used to " +"protect against buffer overruns. (Contributed by M.-A. Lemburg.)" #: ../../whatsnew/2.2.rst:1121 msgid "" @@ -1378,10 +1998,14 @@ msgid "" "can simply be discarded when porting code from earlier versions to Python " "2.2." msgstr "" +"The :c:func:`_PyTuple_Resize` function has lost an unused parameter, so now " +"it takes 2 parameters instead of 3. The third argument was never used, and " +"can simply be discarded when porting code from earlier versions to Python " +"2.2." #: ../../whatsnew/2.2.rst:1129 msgid "Other Changes and Fixes" -msgstr "Other Changes and Fixes" +msgstr "Outras alterações e correções" #: ../../whatsnew/2.2.rst:1131 msgid "" @@ -1391,10 +2015,15 @@ msgid "" "2.2; 2.2.1 applied 139 patches and fixed 143 bugs; 2.2.2 applied 106 patches " "and fixed 82 bugs. These figures are likely to be underestimates." msgstr "" +"As usual there were a bunch of other improvements and bugfixes scattered " +"throughout the source tree. A search through the CVS change logs finds " +"there were 527 patches applied and 683 bugs fixed between Python 2.1 and " +"2.2; 2.2.1 applied 139 patches and fixed 143 bugs; 2.2.2 applied 106 patches " +"and fixed 82 bugs. These figures are likely to be underestimates." #: ../../whatsnew/2.2.rst:1137 msgid "Some of the more notable changes are:" -msgstr "" +msgstr "Some of the more notable changes are:" #: ../../whatsnew/2.2.rst:1139 msgid "" @@ -1402,6 +2031,9 @@ msgid "" "kept in the main Python CVS tree, and many changes have been made to support " "MacOS X." msgstr "" +"The code for the MacOS port for Python, maintained by Jack Jansen, is now " +"kept in the main Python CVS tree, and many changes have been made to support " +"MacOS X." #: ../../whatsnew/2.2.rst:1142 msgid "" @@ -1416,6 +2048,16 @@ msgid "" "application, porting the MacPython IDE, possibly using Python as a standard " "OSA scripting language and much more.\"" msgstr "" +"The most significant change is the ability to build Python as a framework, " +"enabled by supplying the :option:`!--enable-framework` option to the " +"configure script when compiling Python. According to Jack Jansen, \"This " +"installs a self-contained Python installation plus the OS X framework " +"\"glue\" into :file:`/Library/Frameworks/Python.framework` (or another " +"location of choice). For now there is little immediate added benefit to this " +"(actually, there is the disadvantage that you have to change your PATH to be " +"able to find Python), but it is the basis for creating a full-blown Python " +"application, porting the MacPython IDE, possibly using Python as a standard " +"OSA scripting language and much more.\"" #: ../../whatsnew/2.2.rst:1153 msgid "" @@ -1424,6 +2066,10 @@ msgid "" "been left commented out in :file:`setup.py`. People who want to experiment " "with these modules can uncomment them manually." msgstr "" +"Most of the MacPython toolbox modules, which interface to MacOS APIs such as " +"windowing, QuickTime, scripting, etc. have been ported to OS X, but they've " +"been left commented out in :file:`setup.py`. People who want to experiment " +"with these modules can uncomment them manually." #: ../../whatsnew/2.2.rst:1176 msgid "" @@ -1431,6 +2077,9 @@ msgid "" "cause a :exc:`TypeError` exception to be raised, with the message " "\"*function* takes no keyword arguments\"." msgstr "" +"Keyword arguments passed to built-in functions that don't take them now " +"cause a :exc:`TypeError` exception to be raised, with the message " +"\"*function* takes no keyword arguments\"." #: ../../whatsnew/2.2.rst:1180 msgid "" @@ -1439,6 +2088,10 @@ msgid "" "The :exc:`ReferenceError` exception has therefore moved from the :mod:" "`weakref` module to become a built-in exception." msgstr "" +"Weak references, added in Python 2.1 as an extension module, are now part of " +"the core because they're used in the implementation of new-style classes. " +"The :exc:`ReferenceError` exception has therefore moved from the :mod:" +"`weakref` module to become a built-in exception." #: ../../whatsnew/2.2.rst:1185 msgid "" @@ -1446,6 +2099,9 @@ msgid "" "automatically removes obsolete ``__future__`` statements from Python source " "code." msgstr "" +"A new script, :file:`Tools/scripts/cleanfuture.py` by Tim Peters, " +"automatically removes obsolete ``__future__`` statements from Python source " +"code." #: ../../whatsnew/2.2.rst:1189 msgid "" @@ -1455,6 +2111,11 @@ msgid "" "other development environments. This is described in :pep:`264`. " "(Contributed by Michael Hudson.)" msgstr "" +"An additional *flags* argument has been added to the built-in function :func:" +"`compile`, so the behaviour of ``__future__`` statements can now be " +"correctly observed in simulated shells, such as those presented by IDLE and " +"other development environments. This is described in :pep:`264`. " +"(Contributed by Michael Hudson.)" #: ../../whatsnew/2.2.rst:1195 msgid "" @@ -1465,6 +2126,12 @@ msgid "" "BSD license, same as it always was. The license changes were also applied " "to the Python 2.0.1 and 2.1.1 releases." msgstr "" +"The new license introduced with Python 1.6 wasn't GPL-compatible. This is " +"fixed by some minor textual changes to the 2.2 license, so it's now legal to " +"embed Python inside a GPLed program again. Note that Python itself is not " +"GPLed, but instead is under a license that's essentially equivalent to the " +"BSD license, same as it always was. The license changes were also applied " +"to the Python 2.0.1 and 2.1.1 releases." #: ../../whatsnew/2.2.rst:1202 msgid "" @@ -1476,17 +2143,27 @@ msgid "" "was contributed by Mark Hammond with assistance from Marc-André Lemburg. " "Unix support was added by Martin von Löwis.)" msgstr "" +"When presented with a Unicode filename on Windows, Python will now convert " +"it to an MBCS encoded string, as used by the Microsoft file APIs. As MBCS " +"is explicitly used by the file APIs, Python's choice of ASCII as the default " +"encoding turns out to be an annoyance. On Unix, the locale's character set " +"is used if ``locale.nl_langinfo(CODESET)`` is available. (Windows support " +"was contributed by Mark Hammond with assistance from Marc-André Lemburg. " +"Unix support was added by Martin von Löwis.)" #: ../../whatsnew/2.2.rst:1210 msgid "" "Large file support is now enabled on Windows. (Contributed by Tim Peters.)" msgstr "" +"Large file support is now enabled on Windows. (Contributed by Tim Peters.)" #: ../../whatsnew/2.2.rst:1212 msgid "" "The :file:`Tools/scripts/ftpmirror.py` script now parses a :file:`.netrc` " "file, if you have one. (Contributed by Mike Romberg.)" msgstr "" +"The :file:`Tools/scripts/ftpmirror.py` script now parses a :file:`.netrc` " +"file, if you have one. (Contributed by Mike Romberg.)" #: ../../whatsnew/2.2.rst:1215 msgid "" @@ -1500,6 +2177,15 @@ msgid "" "fourth argument to the :c:func:`!PyRange_New` function, ``repeat``, has also " "been deprecated." msgstr "" +"Some features of the object returned by the :func:`!xrange` function are now " +"deprecated, and trigger warnings when they're accessed; they'll disappear in " +"Python 2.3. :class:`!xrange` objects tried to pretend they were full " +"sequence types by supporting slicing, sequence multiplication, and the :" +"keyword:`in` operator, but these features were rarely used and therefore " +"buggy. The :meth:`!tolist` method and the :attr:`!start`, :attr:`!stop`, " +"and :attr:`!step` attributes are also being deprecated. At the C level, the " +"fourth argument to the :c:func:`!PyRange_New` function, ``repeat``, has also " +"been deprecated." #: ../../whatsnew/2.2.rst:1224 msgid "" @@ -1510,6 +2196,12 @@ msgid "" "case that dumped core, Tim Peters fixing the bug, Michael finding another " "case, and round and round it went." msgstr "" +"There were a bunch of patches to the dictionary implementation, mostly to " +"fix potential core dumps if a dictionary contains objects that sneakily " +"changed their hash value, or mutated the dictionary they were contained in. " +"For a while python-dev fell into a gentle rhythm of Michael Hudson finding a " +"case that dumped core, Tim Peters fixing the bug, Michael finding another " +"case, and round and round it went." #: ../../whatsnew/2.2.rst:1231 msgid "" @@ -1517,6 +2209,9 @@ msgid "" "patches contributed by Stephen Hansen, though the result isn't fully " "functional yet. (But this *is* progress...)" msgstr "" +"On Windows, Python can now be compiled with Borland C thanks to a number of " +"patches contributed by Stephen Hansen, though the result isn't fully " +"functional yet. (But this *is* progress...)" #: ../../whatsnew/2.2.rst:1235 msgid "" @@ -1525,6 +2220,10 @@ msgid "" "installers used Wise 5.0a, which was beginning to show its age. (Packaged " "up by Tim Peters.)" msgstr "" +"Another Windows enhancement: Wise Solutions generously offered PythonLabs " +"use of their InstallerMaster 8.1 system. Earlier PythonLabs Windows " +"installers used Wise 5.0a, which was beginning to show its age. (Packaged " +"up by Tim Peters.)" #: ../../whatsnew/2.2.rst:1239 msgid "" @@ -1535,6 +2234,12 @@ msgid "" "such scripts, in case they're also usable as modules. (Implemented by David " "Bolen.)" msgstr "" +"Files ending in ``.pyw`` can now be imported on Windows. ``.pyw`` is a " +"Windows-only thing, used to indicate that a script needs to be run using " +"PYTHONW.EXE instead of PYTHON.EXE in order to prevent a DOS console from " +"popping up to display the output. This patch makes it possible to import " +"such scripts, in case they're also usable as modules. (Implemented by David " +"Bolen.)" #: ../../whatsnew/2.2.rst:1245 msgid "" @@ -1543,6 +2248,10 @@ msgid "" "`dlopen` using the :func:`sys.getdlopenflags` and :func:`sys.setdlopenflags` " "functions. (Contributed by Bram Stolk.)" msgstr "" +"On platforms where Python uses the C :c:func:`dlopen` function to load " +"extension modules, it's now possible to set the flags used by :c:func:" +"`dlopen` using the :func:`sys.getdlopenflags` and :func:`sys.setdlopenflags` " +"functions. (Contributed by Bram Stolk.)" #: ../../whatsnew/2.2.rst:1250 msgid "" @@ -1568,3 +2277,11 @@ msgid "" "Paalasma, Tim Peters, Jens Quade, Tom Reinhardt, Neil Schemenauer, Guido van " "Rossum, Greg Ward, Edward Welbourne." msgstr "" +"The author would like to thank the following people for offering " +"suggestions, corrections and assistance with various drafts of this article: " +"Fred Bremmer, Keith Briggs, Andrew Dalke, Fred L. Drake, Jr., Carel " +"Fellinger, David Goodger, Mark Hammond, Stephen Hansen, Michael Hudson, Jack " +"Jansen, Marc-André Lemburg, Martin von Löwis, Fredrik Lundh, Michael McLay, " +"Nick Mathewson, Paul Moore, Gustavo Niemeyer, Don O'Donnell, Joonas " +"Paalasma, Tim Peters, Jens Quade, Tom Reinhardt, Neil Schemenauer, Guido van " +"Rossum, Greg Ward, Edward Welbourne." diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 26626d3f3..113f7d912 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../whatsnew/2.3.rst:3 msgid "What's New in Python 2.3" -msgstr "O que há de novo no Python 2.3" +msgstr "What's New in Python 2.3" #: ../../whatsnew/2.3.rst:0 msgid "Author" @@ -43,8 +43,8 @@ msgid "" "This article explains the new features in Python 2.3. Python 2.3 was " "released on July 29, 2003." msgstr "" -"Este artigo explica as novas funções do Python 2.3. O Python 2.3 foi lançado " -"dia 29 de Julho de 2003." +"This article explains the new features in Python 2.3. Python 2.3 was " +"released on July 29, 2003." #: ../../whatsnew/2.3.rst:14 msgid "" @@ -57,15 +57,14 @@ msgid "" "and :func:`enumerate`. The :keyword:`in` operator can now be used for " "substring searches (e.g. ``\"ab\" in \"abc\"`` returns :const:`True`)." msgstr "" -"Os principais temas para o Python 2.3 são o refinamento de algumas " -"funcionalidades adicionadas na versão 2.2, adição de pequenos mas úteis " -"aprimoramentos para a linguagem base, e a expansão da biblioteca padrão. O " -"novo modelo de objeto introduzido na versão anterior foi beneficiado por 18 " -"meses de reparo de bugs e pelos esforços de otimização que melhoraram o " -"desempenho de classe estilo novo. Algumas novas funções embutidas como :func:" -"`sum` e :func:`enumerate`. O operador :keyword:`in` agora pode ser usado " -"para pesquisas em substrings (por exemplo: ``\"ab\" in \"abc\"`` retorna :" -"const:`True`)." +"The main themes for Python 2.3 are polishing some of the features added in " +"2.2, adding various small but useful enhancements to the core language, and " +"expanding the standard library. The new object model introduced in the " +"previous version has benefited from 18 months of bugfixes and from " +"optimization efforts that have improved the performance of new-style " +"classes. A few new built-in functions have been added such as :func:`sum` " +"and :func:`enumerate`. The :keyword:`in` operator can now be used for " +"substring searches (e.g. ``\"ab\" in \"abc\"`` returns :const:`True`)." #: ../../whatsnew/2.3.rst:23 msgid "" @@ -76,6 +75,12 @@ msgid "" "processing command-line options, using BerkeleyDB databases... the list of " "new and enhanced modules is lengthy." msgstr "" +"Some of the many new library features include Boolean, set, heap, and date/" +"time data types, the ability to import modules from ZIP-format archives, " +"metadata support for the long-awaited Python catalog, an updated version of " +"IDLE, and modules for logging messages, wrapping text, parsing CSV files, " +"processing command-line options, using BerkeleyDB databases... the list of " +"new and enhanced modules is lengthy." #: ../../whatsnew/2.3.rst:30 msgid "" @@ -86,10 +91,16 @@ msgid "" "complete implementation and design rationale, refer to the PEP for a " "particular new feature." msgstr "" +"This article doesn't attempt to provide a complete specification of the new " +"features, but instead provides a convenient overview. For full details, you " +"should refer to the documentation for Python 2.3, such as the Python Library " +"Reference and the Python Reference Manual. If you want to understand the " +"complete implementation and design rationale, refer to the PEP for a " +"particular new feature." #: ../../whatsnew/2.3.rst:41 msgid "PEP 218: A Standard Set Datatype" -msgstr "" +msgstr "PEP 218: A Standard Set Datatype" #: ../../whatsnew/2.3.rst:43 msgid "" @@ -100,10 +111,16 @@ msgid "" "dictionary keys. Sets are built on top of dictionaries, so the elements " "within a set must be hashable." msgstr "" +"The new :mod:`!sets` module contains an implementation of a set datatype. " +"The :class:`Set` class is for mutable sets, sets that can have members added " +"and removed. The :class:`!ImmutableSet` class is for sets that can't be " +"modified, and instances of :class:`!ImmutableSet` can therefore be used as " +"dictionary keys. Sets are built on top of dictionaries, so the elements " +"within a set must be hashable." #: ../../whatsnew/2.3.rst:50 msgid "Here's a simple example::" -msgstr "" +msgstr "Here's a simple example::" #: ../../whatsnew/2.3.rst:66 msgid "" @@ -113,6 +130,11 @@ msgid "" "sets also have in-place versions of these methods, :meth:`!union_update` " "and :meth:`~frozenset.intersection_update`. ::" msgstr "" +"The union and intersection of sets can be computed with the :meth:" +"`~frozenset.union` and :meth:`~frozenset.intersection` methods; an " +"alternative notation uses the bitwise operators ``&`` and ``|``. Mutable " +"sets also have in-place versions of these methods, :meth:`!union_update` " +"and :meth:`~frozenset.intersection_update`. ::" #: ../../whatsnew/2.3.rst:86 msgid "" @@ -123,26 +145,36 @@ msgid "" "notation (``^``), and an in-place version with the ungainly name :meth:" "`~frozenset.symmetric_difference_update`. ::" msgstr "" +"It's also possible to take the symmetric difference of two sets. This is " +"the set of all elements in the union that aren't in the intersection. " +"Another way of putting it is that the symmetric difference contains all " +"elements that are in exactly one set. Again, there's an alternative " +"notation (``^``), and an in-place version with the ungainly name :meth:" +"`~frozenset.symmetric_difference_update`. ::" #: ../../whatsnew/2.3.rst:100 msgid "" "There are also :meth:`!issubset` and :meth:`!issuperset` methods for " "checking whether one set is a subset or superset of another::" msgstr "" +"There are also :meth:`!issubset` and :meth:`!issuperset` methods for " +"checking whether one set is a subset or superset of another::" #: ../../whatsnew/2.3.rst:116 msgid ":pep:`218` - Adding a Built-In Set Object Type" -msgstr "" +msgstr ":pep:`218` - Adding a Built-In Set Object Type" #: ../../whatsnew/2.3.rst:117 msgid "" "PEP written by Greg V. Wilson. Implemented by Greg V. Wilson, Alex Martelli, " "and GvR." msgstr "" +"PEP written by Greg V. Wilson. Implemented by Greg V. Wilson, Alex Martelli, " +"and GvR." #: ../../whatsnew/2.3.rst:126 msgid "PEP 255: Simple Generators" -msgstr "PEP 255: Geradores Simples" +msgstr "PEP 255: Simple Generators" #: ../../whatsnew/2.3.rst:128 msgid "" @@ -154,6 +186,13 @@ msgid "" "2.2\" document; if you read it back when Python 2.2 came out, you can skip " "the rest of this section." msgstr "" +"In Python 2.2, generators were added as an optional feature, to be enabled " +"by a ``from __future__ import generators`` directive. In 2.3 generators no " +"longer need to be specially enabled, and are now always present; this means " +"that :keyword:`yield` is now always a keyword. The rest of this section is " +"a copy of the description of generators from the \"What's New in Python " +"2.2\" document; if you read it back when Python 2.2 came out, you can skip " +"the rest of this section." #: ../../whatsnew/2.3.rst:136 msgid "" @@ -167,10 +206,19 @@ msgid "" "This is what generators provide; they can be thought of as resumable " "functions." msgstr "" +"You're doubtless familiar with how function calls work in Python or C. When " +"you call a function, it gets a private namespace where its local variables " +"are created. When the function reaches a :keyword:`return` statement, the " +"local variables are destroyed and the resulting value is returned to the " +"caller. A later call to the same function will get a fresh new set of local " +"variables. But, what if the local variables weren't thrown away on exiting a " +"function? What if you could later resume the function where it left off? " +"This is what generators provide; they can be thought of as resumable " +"functions." #: ../../whatsnew/2.3.rst:145 msgid "Here's the simplest example of a generator function::" -msgstr "" +msgstr "Here's the simplest example of a generator function::" #: ../../whatsnew/2.3.rst:151 msgid "" @@ -179,6 +227,10 @@ msgid "" "this is detected by Python's bytecode compiler which compiles the function " "specially as a result." msgstr "" +"A new keyword, :keyword:`yield`, was introduced for generators. Any " +"function containing a :keyword:`!yield` statement is a generator function; " +"this is detected by Python's bytecode compiler which compiles the function " +"specially as a result." #: ../../whatsnew/2.3.rst:156 msgid "" @@ -195,17 +247,29 @@ msgid "" "try`...\\ :keyword:`!finally` statement; read :pep:`255` for a full " "explanation of the interaction between :keyword:`!yield` and exceptions.)" msgstr "" +"When you call a generator function, it doesn't return a single value; " +"instead it returns a generator object that supports the iterator protocol. " +"On executing the :keyword:`yield` statement, the generator outputs the value " +"of ``i``, similar to a :keyword:`return` statement. The big difference " +"between :keyword:`!yield` and a :keyword:`!return` statement is that on " +"reaching a :keyword:`!yield` the generator's state of execution is suspended " +"and local variables are preserved. On the next call to the generator's ``." +"next()`` method, the function will resume executing immediately after the :" +"keyword:`!yield` statement. (For complicated reasons, the :keyword:`!yield` " +"statement isn't allowed inside the :keyword:`try` block of a :keyword:`!" +"try`...\\ :keyword:`!finally` statement; read :pep:`255` for a full " +"explanation of the interaction between :keyword:`!yield` and exceptions.)" #: ../../whatsnew/2.3.rst:169 msgid "Here's a sample usage of the :func:`!generate_ints` generator::" -msgstr "" +msgstr "Here's a sample usage of the :func:`!generate_ints` generator::" #: ../../whatsnew/2.3.rst:186 msgid "" "You could equally write ``for i in generate_ints(5)``, or ``a,b,c = " "generate_ints(3)``." msgstr "" -"Você pode igualmente escrever ``for i in generate_ints(5)``,ou ``a,b,c = " +"You could equally write ``for i in generate_ints(5)``, or ``a,b,c = " "generate_ints(3)``." #: ../../whatsnew/2.3.rst:189 @@ -218,6 +282,13 @@ msgid "" "indicated by raising :exc:`StopIteration` manually, or by just letting the " "flow of execution fall off the bottom of the function." msgstr "" +"Inside a generator function, the :keyword:`return` statement can only be " +"used without a value, and signals the end of the procession of values; " +"afterwards the generator cannot return any further values. :keyword:`!" +"return` with a value, such as ``return 5``, is a syntax error inside a " +"generator function. The end of the generator's results can also be " +"indicated by raising :exc:`StopIteration` manually, or by just letting the " +"flow of execution fall off the bottom of the function." #: ../../whatsnew/2.3.rst:197 msgid "" @@ -231,6 +302,15 @@ msgid "" "The simplest one implements an in-order traversal of a tree using generators " "recursively. ::" msgstr "" +"You could achieve the effect of generators manually by writing your own " +"class and storing all the local variables of the generator as instance " +"variables. For example, returning a list of integers could be done by " +"setting ``self.count`` to 0, and having the :meth:`next` method increment " +"``self.count`` and return it. However, for a moderately complicated " +"generator, writing a corresponding class would be much messier. :file:`Lib/" +"test/test_generators.py` contains a number of more interesting examples. " +"The simplest one implements an in-order traversal of a tree using generators " +"recursively. ::" #: ../../whatsnew/2.3.rst:215 msgid "" @@ -240,6 +320,11 @@ msgid "" "knight to every square of an $NxN$ chessboard without visiting any square " "twice)." msgstr "" +"Two other examples in :file:`Lib/test/test_generators.py` produce solutions " +"for the N-Queens problem (placing $N$ queens on an $NxN$ chess board so that " +"no queen threatens another) and the Knight's Tour (a route that takes a " +"knight to every square of an $NxN$ chessboard without visiting any square " +"twice)." #: ../../whatsnew/2.3.rst:220 msgid "" @@ -250,6 +335,12 @@ msgid "" "Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea " "of what this looks like::" msgstr "" +"The idea of generators comes from other programming languages, especially " +"Icon (https://www2.cs.arizona.edu/icon/), where the idea of generators is " +"central. In Icon, every expression and function call behaves like a " +"generator. One example from \"An Overview of the Icon Programming " +"Language\" at https://www2.cs.arizona.edu/icon/docs/ipd266.htm gives an idea " +"of what this looks like::" #: ../../whatsnew/2.3.rst:230 msgid "" @@ -260,6 +351,12 @@ msgid "" "5, so the comparison now succeeds, and the code prints the value 23 to the " "screen." msgstr "" +"In Icon the :func:`!find` function returns the indexes at which the " +"substring \"or\" is found: 3, 23, 33. In the :keyword:`if` statement, ``i`` " +"is first assigned a value of 3, but 3 is less than 5, so the comparison " +"fails, and Icon retries it with the second value of 23. 23 is greater than " +"5, so the comparison now succeeds, and the code prints the value 23 to the " +"screen." #: ../../whatsnew/2.3.rst:236 msgid "" @@ -271,10 +368,17 @@ msgid "" "as a concrete object (the iterator) that can be passed around to other " "functions or stored in a data structure." msgstr "" +"Python doesn't go nearly as far as Icon in adopting generators as a central " +"concept. Generators are considered part of the core Python language, but " +"learning or using them isn't compulsory; if they don't solve any problems " +"that you have, feel free to ignore them. One novel feature of Python's " +"interface as compared to Icon's is that a generator's state is represented " +"as a concrete object (the iterator) that can be passed around to other " +"functions or stored in a data structure." #: ../../whatsnew/2.3.rst:247 msgid ":pep:`255` - Simple Generators" -msgstr ":pep:`255` - Geradores simples" +msgstr ":pep:`255` - Simple Generators" #: ../../whatsnew/2.3.rst:248 msgid "" @@ -282,10 +386,13 @@ msgid "" "mostly by Neil Schemenauer and Tim Peters, with other fixes from the Python " "Labs crew." msgstr "" +"Written by Neil Schemenauer, Tim Peters, Magnus Lie Hetland. Implemented " +"mostly by Neil Schemenauer and Tim Peters, with other fixes from the Python " +"Labs crew." #: ../../whatsnew/2.3.rst:257 msgid "PEP 263: Source Code Encodings" -msgstr "" +msgstr "PEP 263: Source Code Encodings" #: ../../whatsnew/2.3.rst:259 msgid "" @@ -294,6 +401,10 @@ msgid "" "comment in the first or second line of the source file. For example, a " "UTF-8 file can be declared with::" msgstr "" +"Python source files can now be declared as being in different character set " +"encodings. Encodings are declared by including a specially formatted " +"comment in the first or second line of the source file. For example, a " +"UTF-8 file can be declared with::" #: ../../whatsnew/2.3.rst:267 msgid "" @@ -303,6 +414,11 @@ msgid "" "`DeprecationWarning` being signalled by Python 2.3; in 2.4 this will be a " "syntax error." msgstr "" +"Without such an encoding declaration, the default encoding used is 7-bit " +"ASCII. Executing or importing modules that contain string literals with 8-" +"bit characters and have no encoding declaration will result in a :exc:" +"`DeprecationWarning` being signalled by Python 2.3; in 2.4 this will be a " +"syntax error." #: ../../whatsnew/2.3.rst:273 msgid "" @@ -311,20 +427,26 @@ msgid "" "identifiers are still restricted to ASCII characters, so you can't have " "variable names that use characters outside of the usual alphanumerics." msgstr "" +"The encoding declaration only affects Unicode string literals, which will be " +"converted to Unicode using the specified encoding. Note that Python " +"identifiers are still restricted to ASCII characters, so you can't have " +"variable names that use characters outside of the usual alphanumerics." #: ../../whatsnew/2.3.rst:281 msgid ":pep:`263` - Defining Python Source Code Encodings" -msgstr "" +msgstr ":pep:`263` - Defining Python Source Code Encodings" #: ../../whatsnew/2.3.rst:282 msgid "" "Written by Marc-André Lemburg and Martin von Löwis; implemented by Suzuki " "Hisao and Martin von Löwis." msgstr "" +"Written by Marc-André Lemburg and Martin von Löwis; implemented by Suzuki " +"Hisao and Martin von Löwis." #: ../../whatsnew/2.3.rst:289 msgid "PEP 273: Importing Modules from ZIP Archives" -msgstr "" +msgstr "PEP 273: Importing Modules from ZIP Archives" #: ../../whatsnew/2.3.rst:291 msgid "" @@ -333,6 +455,10 @@ msgid "" "be automatically imported if a ZIP archive's filename is added to ``sys." "path``. For example:" msgstr "" +"The new :mod:`zipimport` module adds support for importing modules from a " +"ZIP-format archive. You don't need to import the module explicitly; it will " +"be automatically imported if a ZIP archive's filename is added to ``sys." +"path``. For example:" #: ../../whatsnew/2.3.rst:314 msgid "" @@ -343,6 +469,12 @@ msgid "" "by adding the corresponding :file:`\\*.pyc` file, meaning that if a ZIP " "archive doesn't contain :file:`\\*.pyc` files, importing may be rather slow." msgstr "" +"An entry in ``sys.path`` can now be the filename of a ZIP archive. The ZIP " +"archive can contain any kind of files, but only files named :file:`\\*.py`, :" +"file:`\\*.pyc`, or :file:`\\*.pyo` can be imported. If an archive only " +"contains :file:`\\*.py` files, Python will not attempt to modify the archive " +"by adding the corresponding :file:`\\*.pyc` file, meaning that if a ZIP " +"archive doesn't contain :file:`\\*.pyc` files, importing may be rather slow." #: ../../whatsnew/2.3.rst:321 msgid "" @@ -350,10 +482,13 @@ msgid "" "subdirectory; for example, the path :file:`/tmp/example.zip/lib/` would only " "import from the :file:`lib/` subdirectory within the archive." msgstr "" +"A path within the archive can also be specified to only import from a " +"subdirectory; for example, the path :file:`/tmp/example.zip/lib/` would only " +"import from the :file:`lib/` subdirectory within the archive." #: ../../whatsnew/2.3.rst:328 msgid ":pep:`273` - Import Modules from Zip Archives" -msgstr ":pep:`273` - Importar módulos de arquivos Zip" +msgstr ":pep:`273` - Import Modules from Zip Archives" #: ../../whatsnew/2.3.rst:329 msgid "" @@ -363,10 +498,15 @@ msgid "" "`302`. See section :ref:`section-pep302` for a description of the new import " "hooks." msgstr "" +"Written by James C. Ahlstrom, who also provided an implementation. Python " +"2.3 follows the specification in :pep:`273`, but uses an implementation " +"written by Just van Rossum that uses the import hooks described in :pep:" +"`302`. See section :ref:`section-pep302` for a description of the new import " +"hooks." #: ../../whatsnew/2.3.rst:338 msgid "PEP 277: Unicode file name support for Windows NT" -msgstr "" +msgstr "PEP 277: Unicode file name support for Windows NT" #: ../../whatsnew/2.3.rst:340 msgid "" @@ -374,6 +514,9 @@ msgid "" "strings. Traditionally, Python has represented file names as byte strings, " "which is inadequate because it renders some file names inaccessible." msgstr "" +"On Windows NT, 2000, and XP, the system stores file names as Unicode " +"strings. Traditionally, Python has represented file names as byte strings, " +"which is inadequate because it renders some file names inaccessible." #: ../../whatsnew/2.3.rst:344 msgid "" @@ -383,12 +526,19 @@ msgid "" "listdir`, Python now returns a list of Unicode strings. A new function, :" "func:`!os.getcwdu`, returns the current directory as a Unicode string." msgstr "" +"Python now allows using arbitrary Unicode strings (within the limitations of " +"the file system) for all functions that expect file names, most notably the :" +"func:`open` built-in function. If a Unicode string is passed to :func:`os." +"listdir`, Python now returns a list of Unicode strings. A new function, :" +"func:`!os.getcwdu`, returns the current directory as a Unicode string." #: ../../whatsnew/2.3.rst:350 msgid "" "Byte strings still work as file names, and on Windows Python will " "transparently convert them to Unicode using the ``mbcs`` encoding." msgstr "" +"Byte strings still work as file names, and on Windows Python will " +"transparently convert them to Unicode using the ``mbcs`` encoding." #: ../../whatsnew/2.3.rst:353 msgid "" @@ -398,24 +548,31 @@ msgid "" "strings are supported as file names by checking :attr:`os.path." "supports_unicode_filenames`, a Boolean value." msgstr "" +"Other systems also allow Unicode strings as file names but convert them to " +"byte strings before passing them to the system, which can cause a :exc:" +"`UnicodeError` to be raised. Applications can test whether arbitrary Unicode " +"strings are supported as file names by checking :attr:`os.path." +"supports_unicode_filenames`, a Boolean value." #: ../../whatsnew/2.3.rst:359 msgid "Under MacOS, :func:`os.listdir` may now return Unicode filenames." -msgstr "" +msgstr "Under MacOS, :func:`os.listdir` may now return Unicode filenames." #: ../../whatsnew/2.3.rst:364 msgid ":pep:`277` - Unicode file name support for Windows NT" -msgstr "" +msgstr ":pep:`277` - Unicode file name support for Windows NT" #: ../../whatsnew/2.3.rst:365 msgid "" "Written by Neil Hodgson; implemented by Neil Hodgson, Martin von Löwis, and " "Mark Hammond." msgstr "" +"Written by Neil Hodgson; implemented by Neil Hodgson, Martin von Löwis, and " +"Mark Hammond." #: ../../whatsnew/2.3.rst:375 msgid "PEP 278: Universal Newline Support" -msgstr "" +msgstr "PEP 278: Universal Newline Support" #: ../../whatsnew/2.3.rst:377 msgid "" @@ -426,6 +583,12 @@ msgid "" "character 10), MacOS uses the carriage return (ASCII character 13), and " "Windows uses a two-character sequence of a carriage return plus a newline." msgstr "" +"The three major operating systems used today are Microsoft Windows, Apple's " +"Macintosh OS, and the various Unix derivatives. A minor irritation of cross-" +"platform work is that these three platforms all use different characters to " +"mark the ends of lines in text files. Unix uses the linefeed (ASCII " +"character 10), MacOS uses the carriage return (ASCII character 13), and " +"Windows uses a two-character sequence of a carriage return plus a newline." #: ../../whatsnew/2.3.rst:384 msgid "" @@ -436,6 +599,12 @@ msgid "" "translated to a ``'\\n'`` in the strings returned by the various file " "methods such as :meth:`!read` and :meth:`!readline`." msgstr "" +"Python's file objects can now support end of line conventions other than the " +"one followed by the platform on which Python is running. Opening a file with " +"the mode ``'U'`` or ``'rU'`` will open a file for reading in :term:" +"`universal newlines` mode. All three line ending conventions will be " +"translated to a ``'\\n'`` in the strings returned by the various file " +"methods such as :meth:`!read` and :meth:`!readline`." #: ../../whatsnew/2.3.rst:391 msgid "" @@ -444,6 +613,10 @@ msgid "" "Python modules can be shared between all three operating systems without " "needing to convert the line-endings." msgstr "" +"Universal newline support is also used when importing modules and when " +"executing a file with the :func:`!execfile` function. This means that " +"Python modules can be shared between all three operating systems without " +"needing to convert the line-endings." #: ../../whatsnew/2.3.rst:396 msgid "" @@ -451,18 +624,21 @@ msgid "" "`!--without-universal-newlines` switch when running Python's :program:" "`configure` script." msgstr "" +"This feature can be disabled when compiling Python by specifying the :option:" +"`!--without-universal-newlines` switch when running Python's :program:" +"`configure` script." #: ../../whatsnew/2.3.rst:403 msgid ":pep:`278` - Universal Newline Support" -msgstr "" +msgstr ":pep:`278` - Universal Newline Support" #: ../../whatsnew/2.3.rst:404 msgid "Written and implemented by Jack Jansen." -msgstr "" +msgstr "Written and implemented by Jack Jansen." #: ../../whatsnew/2.3.rst:412 msgid "PEP 279: enumerate()" -msgstr "" +msgstr "PEP 279: enumerate()" #: ../../whatsnew/2.3.rst:414 msgid "" @@ -471,26 +647,30 @@ msgid "" "sequence, returns an iterator that will return ``(0, thing[0])``, ``(1, " "thing[1])``, ``(2, thing[2])``, and so forth." msgstr "" +"A new built-in function, :func:`enumerate`, will make certain loops a bit " +"clearer. ``enumerate(thing)``, where *thing* is either an iterator or a " +"sequence, returns an iterator that will return ``(0, thing[0])``, ``(1, " +"thing[1])``, ``(2, thing[2])``, and so forth." #: ../../whatsnew/2.3.rst:419 msgid "A common idiom to change every element of a list looks like this::" -msgstr "" +msgstr "A common idiom to change every element of a list looks like this::" #: ../../whatsnew/2.3.rst:426 msgid "This can be rewritten using :func:`enumerate` as::" -msgstr "" +msgstr "This can be rewritten using :func:`enumerate` as::" #: ../../whatsnew/2.3.rst:435 msgid ":pep:`279` - The enumerate() built-in function" -msgstr "" +msgstr ":pep:`279` - The enumerate() built-in function" #: ../../whatsnew/2.3.rst:436 msgid "Written and implemented by Raymond D. Hettinger." -msgstr "" +msgstr "Written and implemented by Raymond D. Hettinger." #: ../../whatsnew/2.3.rst:442 msgid "PEP 282: The logging Package" -msgstr "" +msgstr "PEP 282: The logging Package" #: ../../whatsnew/2.3.rst:444 msgid "" @@ -503,6 +683,14 @@ msgid "" "log, or even e-mail them to a particular address; of course, it's also " "possible to write your own handler classes." msgstr "" +"A standard package for writing logs, :mod:`logging`, has been added to " +"Python 2.3. It provides a powerful and flexible mechanism for generating " +"logging output which can then be filtered and processed in various ways. A " +"configuration file written in a standard format can be used to control the " +"logging behavior of a program. Python includes handlers that will write log " +"records to standard error or to a file or socket, send them to the system " +"log, or even e-mail them to a particular address; of course, it's also " +"possible to write your own handler classes." #: ../../whatsnew/2.3.rst:453 msgid "" @@ -518,12 +706,25 @@ msgid "" "records logged to ``server.auth`` and ``server.network``. There's also a " "root :class:`~logging.Logger` that's the parent of all other loggers." msgstr "" +"The :class:`~logging.Logger` class is the primary class. Most application " +"code will deal with one or more :class:`~logging.Logger` objects, each one " +"used by a particular subsystem of the application. Each :class:`~logging." +"Logger` is identified by a name, and names are organized into a hierarchy " +"using ``.`` as the component separator. For example, you might have :class:" +"`~logging.Logger` instances named ``server``, ``server.auth`` and ``server." +"network``. The latter two instances are below ``server`` in the hierarchy. " +"This means that if you turn up the verbosity for ``server`` or direct " +"``server`` messages to a different handler, the changes will also apply to " +"records logged to ``server.auth`` and ``server.network``. There's also a " +"root :class:`~logging.Logger` that's the parent of all other loggers." #: ../../whatsnew/2.3.rst:464 msgid "" "For simple uses, the :mod:`logging` package contains some convenience " "functions that always use the root log::" msgstr "" +"For simple uses, the :mod:`logging` package contains some convenience " +"functions that always use the root log::" #: ../../whatsnew/2.3.rst:475 ../../whatsnew/2.3.rst:500 msgid "This produces the following output::" @@ -536,6 +737,10 @@ msgid "" "display of informational and debugging messages by calling the :meth:" "`~logging.Logger.setLevel` method on the root logger." msgstr "" +"In the default configuration, informational and debugging messages are " +"suppressed and the output is sent to standard error. You can enable the " +"display of informational and debugging messages by calling the :meth:" +"`~logging.Logger.setLevel` method on the root logger." #: ../../whatsnew/2.3.rst:486 msgid "" @@ -544,6 +749,10 @@ msgid "" "``(msg, arg1, arg2, ...)`` and log the string resulting from ``msg % (arg1, " "arg2, ...)``." msgstr "" +"Notice the :func:`~logging.warning` call's use of string formatting " +"operators; all of the functions for logging messages take the arguments " +"``(msg, arg1, arg2, ...)`` and log the string resulting from ``msg % (arg1, " +"arg2, ...)``." #: ../../whatsnew/2.3.rst:490 msgid "" @@ -551,6 +760,9 @@ msgid "" "recent traceback. Any of the other functions will also record the traceback " "if you specify a true value for the keyword argument *exc_info*. ::" msgstr "" +"There's also an :func:`~logging.exception` function that records the most " +"recent traceback. Any of the other functions will also record the traceback " +"if you specify a true value for the keyword argument *exc_info*. ::" #: ../../whatsnew/2.3.rst:508 msgid "" @@ -559,6 +771,10 @@ msgid "" "creating it if it doesn't exist yet. ``getLogger(None)`` returns the root " "logger. ::" msgstr "" +"Slightly more advanced programs will use a logger other than the root " +"logger. The ``getLogger(name)`` function is used to get a particular log, " +"creating it if it doesn't exist yet. ``getLogger(None)`` returns the root " +"logger. ::" #: ../../whatsnew/2.3.rst:519 msgid "" @@ -567,6 +783,10 @@ msgid "" "`~logging.Logger` can prevent this by setting its :attr:`~logging.Logger." "propagate` attribute to :const:`False`." msgstr "" +"Log records are usually propagated up the hierarchy, so a message logged to " +"``server.auth`` is also seen by ``server`` and ``root``, but a :class:" +"`~logging.Logger` can prevent this by setting its :attr:`~logging.Logger." +"propagate` attribute to :const:`False`." #: ../../whatsnew/2.3.rst:523 msgid "" @@ -581,8 +801,18 @@ msgid "" "class. All of these classes can be replaced by your own specially written " "classes." msgstr "" - -#: ../../whatsnew/2.3.rst:533 +"There are more classes provided by the :mod:`logging` package that can be " +"customized. When a :class:`~logging.Logger` instance is told to log a " +"message, it creates a :class:`~logging.LogRecord` instance that is sent to " +"any number of different :class:`~logging.Handler` instances. Loggers and " +"handlers can also have an attached list of filters, and each filter can " +"cause the :class:`~logging.LogRecord` to be ignored or can modify the record " +"before passing it along. When they're finally output, :class:`~logging." +"LogRecord` instances are converted to text by a :class:`~logging.Formatter` " +"class. All of these classes can be replaced by your own specially written " +"classes." + +#: ../../whatsnew/2.3.rst:533 msgid "" "With all of these features the :mod:`logging` package should provide enough " "flexibility for even the most complicated applications. This is only an " @@ -590,18 +820,23 @@ msgid "" "documentation for all of the details. Reading :pep:`282` will also be " "helpful." msgstr "" +"With all of these features the :mod:`logging` package should provide enough " +"flexibility for even the most complicated applications. This is only an " +"incomplete overview of its features, so please see the package's reference " +"documentation for all of the details. Reading :pep:`282` will also be " +"helpful." #: ../../whatsnew/2.3.rst:541 msgid ":pep:`282` - A Logging System" -msgstr "" +msgstr ":pep:`282` - A Logging System" #: ../../whatsnew/2.3.rst:542 msgid "Written by Vinay Sajip and Trent Mick; implemented by Vinay Sajip." -msgstr "" +msgstr "Written by Vinay Sajip and Trent Mick; implemented by Vinay Sajip." #: ../../whatsnew/2.3.rst:550 msgid "PEP 285: A Boolean Type" -msgstr "" +msgstr "PEP 285: A Boolean Type" #: ../../whatsnew/2.3.rst:552 msgid "" @@ -611,6 +846,11 @@ msgid "" "2.2.1, but the 2.2.1 versions are simply set to integer values of 1 and 0 " "and aren't a different type.)" msgstr "" +"A Boolean type was added to Python 2.3. Two new constants were added to " +"the :mod:`!__builtin__` module, :const:`True` and :const:`False`. (:const:" +"`True` and :const:`False` constants were added to the built-ins in Python " +"2.2.1, but the 2.2.1 versions are simply set to integer values of 1 and 0 " +"and aren't a different type.)" #: ../../whatsnew/2.3.rst:558 msgid "" @@ -618,12 +858,17 @@ msgid "" "for it takes any Python value and converts it to :const:`True` or :const:" "`False`. ::" msgstr "" +"The type object for this new type is named :class:`bool`; the constructor " +"for it takes any Python value and converts it to :const:`True` or :const:" +"`False`. ::" #: ../../whatsnew/2.3.rst:570 msgid "" "Most of the standard library modules and built-in functions have been " "changed to return Booleans. ::" msgstr "" +"Most of the standard library modules and built-in functions have been " +"changed to return Booleans. ::" #: ../../whatsnew/2.3.rst:581 msgid "" @@ -634,6 +879,12 @@ msgid "" "the statement is ``return True``, however, the meaning of the return value " "is quite clear." msgstr "" +"Python's Booleans were added with the primary goal of making code clearer. " +"For example, if you're reading a function and encounter the statement " +"``return 1``, you might wonder whether the ``1`` represents a Boolean truth " +"value, an index, or a coefficient that multiplies some other quantity. If " +"the statement is ``return True``, however, the meaning of the return value " +"is quite clear." #: ../../whatsnew/2.3.rst:587 msgid "" @@ -647,6 +898,15 @@ msgid "" "a subclass of the :class:`int` class so that arithmetic using a Boolean " "still works. ::" msgstr "" +"Python's Booleans were *not* added for the sake of strict type-checking. A " +"very strict language such as Pascal would also prevent you performing " +"arithmetic with Booleans, and would require that the expression in an :" +"keyword:`if` statement always evaluate to a Boolean result. Python is not " +"this strict and never will be, as :pep:`285` explicitly says. This means " +"you can still use any expression in an :keyword:`!if` statement, even ones " +"that evaluate to a list or tuple or some random object. The Boolean type is " +"a subclass of the :class:`int` class so that arithmetic using a Boolean " +"still works. ::" #: ../../whatsnew/2.3.rst:605 msgid "" @@ -655,18 +915,22 @@ msgid "" "difference that :func:`str` and :func:`repr` return the strings ``'True'`` " "and ``'False'`` instead of ``'1'`` and ``'0'``." msgstr "" +"To sum up :const:`True` and :const:`False` in a sentence: they're " +"alternative ways to spell the integer values 1 and 0, with the single " +"difference that :func:`str` and :func:`repr` return the strings ``'True'`` " +"and ``'False'`` instead of ``'1'`` and ``'0'``." #: ../../whatsnew/2.3.rst:613 msgid ":pep:`285` - Adding a bool type" -msgstr "" +msgstr ":pep:`285` - Adding a bool type" #: ../../whatsnew/2.3.rst:614 msgid "Written and implemented by GvR." -msgstr "" +msgstr "Written and implemented by GvR." #: ../../whatsnew/2.3.rst:620 msgid "PEP 293: Codec Error Handling Callbacks" -msgstr "" +msgstr "PEP 293: Codec Error Handling Callbacks" #: ../../whatsnew/2.3.rst:622 msgid "" @@ -679,6 +943,14 @@ msgid "" "inserting an XML character reference or HTML entity reference into the " "converted string." msgstr "" +"When encoding a Unicode string into a byte string, unencodable characters " +"may be encountered. So far, Python has allowed specifying the error " +"processing as either \"strict\" (raising :exc:`UnicodeError`), " +"\"ignore\" (skipping the character), or \"replace\" (using a question mark " +"in the output string), with \"strict\" being the default behavior. It may be " +"desirable to specify alternative processing of such errors, such as " +"inserting an XML character reference or HTML entity reference into the " +"converted string." #: ../../whatsnew/2.3.rst:630 msgid "" @@ -691,6 +963,14 @@ msgid "" "target encoding. The handler can then either raise an exception or return a " "replacement string." msgstr "" +"Python now has a flexible framework to add different processing strategies. " +"New error handlers can be added with :func:`codecs.register_error`, and " +"codecs then can access the error handler with :func:`codecs.lookup_error`. " +"An equivalent C API has been added for codecs written in C. The error " +"handler gets the necessary state information such as the string being " +"converted, the position in the string where the error was detected, and the " +"target encoding. The handler can then either raise an exception or return a " +"replacement string." #: ../../whatsnew/2.3.rst:638 msgid "" @@ -698,24 +978,29 @@ msgid "" "\"backslashreplace\" uses Python backslash quoting to represent unencodable " "characters and \"xmlcharrefreplace\" emits XML character references." msgstr "" +"Two additional error handlers have been implemented using this framework: " +"\"backslashreplace\" uses Python backslash quoting to represent unencodable " +"characters and \"xmlcharrefreplace\" emits XML character references." #: ../../whatsnew/2.3.rst:645 msgid ":pep:`293` - Codec Error Handling Callbacks" -msgstr "" +msgstr ":pep:`293` - Codec Error Handling Callbacks" #: ../../whatsnew/2.3.rst:646 msgid "Written and implemented by Walter Dörwald." -msgstr "" +msgstr "Written and implemented by Walter Dörwald." #: ../../whatsnew/2.3.rst:654 msgid "PEP 301: Package Index and Metadata for Distutils" -msgstr "" +msgstr "PEP 301: Package Index and Metadata for Distutils" #: ../../whatsnew/2.3.rst:656 msgid "" "Support for the long-requested Python catalog makes its first appearance in " "2.3." msgstr "" +"Support for the long-requested Python catalog makes its first appearance in " +"2.3." #: ../../whatsnew/2.3.rst:658 msgid "" @@ -725,6 +1010,11 @@ msgid "" "it to a central catalog server. The resulting catalog is available from " "https://pypi.org." msgstr "" +"The heart of the catalog is the new Distutils :command:`register` command. " +"Running ``python setup.py register`` will collect the metadata describing a " +"package, such as its name, version, maintainer, description, &c., and send " +"it to a central catalog server. The resulting catalog is available from " +"https://pypi.org." #: ../../whatsnew/2.3.rst:664 msgid "" @@ -733,30 +1023,38 @@ msgid "" "`Trove `_-style strings can be supplied to help " "classify the software." msgstr "" +"To make the catalog a bit more useful, a new optional *classifiers* keyword " +"argument has been added to the Distutils :func:`!setup` function. A list of " +"`Trove `_-style strings can be supplied to help " +"classify the software." #: ../../whatsnew/2.3.rst:669 msgid "" "Here's an example :file:`setup.py` with classifiers, written to be " "compatible with older versions of the Distutils::" msgstr "" +"Here's an example :file:`setup.py` with classifiers, written to be " +"compatible with older versions of the Distutils::" #: ../../whatsnew/2.3.rst:688 msgid "" "The full list of classifiers can be obtained by running ``python setup.py " "register --list-classifiers``." msgstr "" +"The full list of classifiers can be obtained by running ``python setup.py " +"register --list-classifiers``." #: ../../whatsnew/2.3.rst:694 msgid ":pep:`301` - Package Index and Metadata for Distutils" -msgstr "" +msgstr ":pep:`301` - Package Index and Metadata for Distutils" #: ../../whatsnew/2.3.rst:695 msgid "Written and implemented by Richard Jones." -msgstr "" +msgstr "Written and implemented by Richard Jones." #: ../../whatsnew/2.3.rst:703 msgid "PEP 302: New Import Hooks" -msgstr "" +msgstr "PEP 302: New Import Hooks" #: ../../whatsnew/2.3.rst:705 msgid "" @@ -767,6 +1065,12 @@ msgid "" "and :mod:`!iu` modules, but none of them has ever gained much acceptance, " "and none of them were easily usable from C code." msgstr "" +"While it's been possible to write custom import hooks ever since the :mod:`!" +"ihooks` module was introduced in Python 1.3, no one has ever been really " +"happy with it because writing new import hooks is difficult and messy. " +"There have been various proposed alternatives such as the :mod:`!imputil` " +"and :mod:`!iu` modules, but none of them has ever gained much acceptance, " +"and none of them were easily usable from C code." #: ../../whatsnew/2.3.rst:712 msgid "" @@ -774,6 +1078,9 @@ msgid "" "McMillan's :mod:`!iu` module. Three new items are added to the :mod:`sys` " "module:" msgstr "" +":pep:`302` borrows ideas from its predecessors, especially from Gordon " +"McMillan's :mod:`!iu` module. Three new items are added to the :mod:`sys` " +"module:" #: ../../whatsnew/2.3.rst:716 msgid "" @@ -782,12 +1089,18 @@ msgid "" "an importer object that will handle imports from this path or raises an :exc:" "`ImportError` exception if it can't handle this path." msgstr "" +"``sys.path_hooks`` is a list of callable objects; most often they'll be " +"classes. Each callable takes a string containing a path and either returns " +"an importer object that will handle imports from this path or raises an :exc:" +"`ImportError` exception if it can't handle this path." #: ../../whatsnew/2.3.rst:721 msgid "" "``sys.path_importer_cache`` caches importer objects for each path, so ``sys." "path_hooks`` will only need to be traversed once for each path." msgstr "" +"``sys.path_importer_cache`` caches importer objects for each path, so ``sys." +"path_hooks`` will only need to be traversed once for each path." #: ../../whatsnew/2.3.rst:724 msgid "" @@ -796,6 +1109,10 @@ msgid "" "can add objects to it. Additional built-in and frozen modules can be " "imported by an object added to this list." msgstr "" +"``sys.meta_path`` is a list of importer objects that will be traversed " +"before ``sys.path`` is checked. This list is initially empty, but user code " +"can add objects to it. Additional built-in and frozen modules can be " +"imported by an object added to this list." #: ../../whatsnew/2.3.rst:729 msgid "" @@ -805,25 +1122,33 @@ msgid "" "that has a single method, ``load_module(fullname)``, that creates and " "returns the corresponding module object." msgstr "" +"Importer objects must have a single method, ``find_module(fullname, " +"path=None)``. *fullname* will be a module or package name, e.g. ``string`` " +"or ``distutils.core``. :meth:`!find_module` must return a loader object " +"that has a single method, ``load_module(fullname)``, that creates and " +"returns the corresponding module object." #: ../../whatsnew/2.3.rst:735 msgid "" "Pseudo-code for Python's new import logic, therefore, looks something like " "this (simplified a bit; see :pep:`302` for the full details)::" msgstr "" +"Pseudo-code for Python's new import logic, therefore, looks something like " +"this (simplified a bit; see :pep:`302` for the full details)::" #: ../../whatsnew/2.3.rst:760 msgid ":pep:`302` - New Import Hooks" -msgstr "" +msgstr ":pep:`302` - New Import Hooks" #: ../../whatsnew/2.3.rst:761 msgid "" "Written by Just van Rossum and Paul Moore. Implemented by Just van Rossum." msgstr "" +"Written by Just van Rossum and Paul Moore. Implemented by Just van Rossum." #: ../../whatsnew/2.3.rst:769 msgid "PEP 305: Comma-separated Files" -msgstr "" +msgstr "PEP 305: Comma-separated Files" #: ../../whatsnew/2.3.rst:771 msgid "" @@ -831,22 +1156,29 @@ msgid "" "databases and spreadsheets. Python 2.3 adds a parser for comma-separated " "files." msgstr "" +"Comma-separated files are a format frequently used for exporting data from " +"databases and spreadsheets. Python 2.3 adds a parser for comma-separated " +"files." #: ../../whatsnew/2.3.rst:774 msgid "Comma-separated format is deceptively simple at first glance::" -msgstr "" +msgstr "Comma-separated format is deceptively simple at first glance::" #: ../../whatsnew/2.3.rst:778 msgid "" "Read a line and call ``line.split(',')``: what could be simpler? But toss in " "string data that can contain commas, and things get more complicated::" msgstr "" +"Read a line and call ``line.split(',')``: what could be simpler? But toss in " +"string data that can contain commas, and things get more complicated::" #: ../../whatsnew/2.3.rst:783 msgid "" "A big ugly regular expression can parse this, but using the new :mod:`csv` " "package is much simpler::" msgstr "" +"A big ugly regular expression can parse this, but using the new :mod:`csv` " +"package is much simpler::" #: ../../whatsnew/2.3.rst:793 msgid "" @@ -854,6 +1186,9 @@ msgid "" "field separator isn't limited to the comma and can be changed to any " "character, and so can the quoting and line-ending characters." msgstr "" +"The :func:`~csv.reader` function takes a number of different options. The " +"field separator isn't limited to the comma and can be changed to any " +"character, and so can the quoting and line-ending characters." #: ../../whatsnew/2.3.rst:797 msgid "" @@ -862,20 +1197,26 @@ msgid "" "class:`csv.writer` class will generate comma-separated files from a " "succession of tuples or lists, quoting strings that contain the delimiter." msgstr "" +"Different dialects of comma-separated files can be defined and registered; " +"currently there are two dialects, both used by Microsoft Excel. A separate :" +"class:`csv.writer` class will generate comma-separated files from a " +"succession of tuples or lists, quoting strings that contain the delimiter." #: ../../whatsnew/2.3.rst:805 msgid ":pep:`305` - CSV File API" -msgstr ":pep:`305` - API de arquivo CSV" +msgstr ":pep:`305` - CSV File API" #: ../../whatsnew/2.3.rst:806 msgid "" "Written and implemented by Kevin Altis, Dave Cole, Andrew McNamara, Skip " "Montanaro, Cliff Wells." msgstr "" +"Written and implemented by Kevin Altis, Dave Cole, Andrew McNamara, Skip " +"Montanaro, Cliff Wells." #: ../../whatsnew/2.3.rst:815 msgid "PEP 307: Pickle Enhancements" -msgstr "" +msgstr "PEP 307: Pickle Enhancements" #: ../../whatsnew/2.3.rst:817 msgid "" @@ -885,6 +1226,11 @@ msgid "" "quotes a trivial example where a new-style class results in a pickled string " "three times longer than that for a classic class." msgstr "" +"The :mod:`pickle` and :mod:`!cPickle` modules received some attention during " +"the 2.3 development cycle. In 2.2, new-style classes could be pickled " +"without difficulty, but they weren't pickled very compactly; :pep:`307` " +"quotes a trivial example where a new-style class results in a pickled string " +"three times longer than that for a classic class." #: ../../whatsnew/2.3.rst:823 msgid "" @@ -895,6 +1241,12 @@ msgid "" "format. A new constant, :const:`pickle.HIGHEST_PROTOCOL`, can be used to " "select the fanciest protocol available." msgstr "" +"The solution was to invent a new pickle protocol. The :func:`pickle.dumps` " +"function has supported a text-or-binary flag for a long time. In 2.3, this " +"flag is redefined from a Boolean to an integer: 0 is the old text-mode " +"pickle format, 1 is the old binary format, and now 2 is a new 2.3-specific " +"format. A new constant, :const:`pickle.HIGHEST_PROTOCOL`, can be used to " +"select the fanciest protocol available." #: ../../whatsnew/2.3.rst:830 msgid "" @@ -904,6 +1256,11 @@ msgid "" "this code was ever audited and therefore it's all been ripped out in 2.3. " "You should not unpickle untrusted data in any version of Python." msgstr "" +"Unpickling is no longer considered a safe operation. 2.2's :mod:`pickle` " +"provided hooks for trying to prevent unsafe classes from being unpickled " +"(specifically, a :attr:`!__safe_for_unpickling__` attribute), but none of " +"this code was ever audited and therefore it's all been ripped out in 2.3. " +"You should not unpickle untrusted data in any version of Python." #: ../../whatsnew/2.3.rst:836 msgid "" @@ -913,6 +1270,11 @@ msgid "" "__getnewargs__`. Consult :pep:`307` for the full semantics of these " "methods." msgstr "" +"To reduce the pickling overhead for new-style classes, a new interface for " +"customizing pickling was added using three special methods: :meth:`~object." +"__getstate__`, :meth:`~object.__setstate__`, and :meth:`~object." +"__getnewargs__`. Consult :pep:`307` for the full semantics of these " +"methods." #: ../../whatsnew/2.3.rst:841 msgid "" @@ -921,18 +1283,22 @@ msgid "" "Software Foundation will maintain a list of standardized codes; there's also " "a range of codes for private use. Currently no codes have been specified." msgstr "" +"As a way to compress pickles yet further, it's now possible to use integer " +"codes instead of long strings to identify pickled classes. The Python " +"Software Foundation will maintain a list of standardized codes; there's also " +"a range of codes for private use. Currently no codes have been specified." #: ../../whatsnew/2.3.rst:849 msgid ":pep:`307` - Extensions to the pickle protocol" -msgstr "" +msgstr ":pep:`307` - Extensions to the pickle protocol" #: ../../whatsnew/2.3.rst:850 msgid "Written and implemented by Guido van Rossum and Tim Peters." -msgstr "" +msgstr "Written and implemented by Guido van Rossum and Tim Peters." #: ../../whatsnew/2.3.rst:858 msgid "Extended Slices" -msgstr "" +msgstr "Extended Slices" #: ../../whatsnew/2.3.rst:860 msgid "" @@ -944,21 +1310,31 @@ msgid "" "sequence types have never supported this feature, raising a :exc:`TypeError` " "if you tried it. Michael Hudson contributed a patch to fix this shortcoming." msgstr "" +"Ever since Python 1.4, the slicing syntax has supported an optional third " +"\"step\" or \"stride\" argument. For example, these are all legal Python " +"syntax: ``L[1:10:2]``, ``L[:-1:1]``, ``L[::-1]``. This was added to Python " +"at the request of the developers of Numerical Python, which uses the third " +"argument extensively. However, Python's built-in list, tuple, and string " +"sequence types have never supported this feature, raising a :exc:`TypeError` " +"if you tried it. Michael Hudson contributed a patch to fix this shortcoming." #: ../../whatsnew/2.3.rst:868 msgid "" "For example, you can now easily extract the elements of a list that have " "even indexes::" msgstr "" +"For example, you can now easily extract the elements of a list that have " +"even indexes::" #: ../../whatsnew/2.3.rst:875 msgid "" "Negative values also work to make a copy of the same list in reverse order::" msgstr "" +"Negative values also work to make a copy of the same list in reverse order::" #: ../../whatsnew/2.3.rst:880 msgid "This also works for tuples, arrays, and strings::" -msgstr "" +msgstr "This also works for tuples, arrays, and strings::" #: ../../whatsnew/2.3.rst:888 msgid "" @@ -967,6 +1343,10 @@ msgid "" "assignment to extended and regular slices. Assignment to a regular slice " "can be used to change the length of the sequence::" msgstr "" +"If you have a mutable sequence such as a list or an array you can assign to " +"or delete an extended slice, but there are some differences between " +"assignment to extended and regular slices. Assignment to a regular slice " +"can be used to change the length of the sequence::" #: ../../whatsnew/2.3.rst:900 msgid "" @@ -974,20 +1354,25 @@ msgid "" "the list on the right hand side of the statement must contain the same " "number of items as the slice it is replacing::" msgstr "" +"Extended slices aren't this flexible. When assigning to an extended slice, " +"the list on the right hand side of the statement must contain the same " +"number of items as the slice it is replacing::" #: ../../whatsnew/2.3.rst:917 msgid "Deletion is more straightforward::" -msgstr "" +msgstr "Deletion is more straightforward::" #: ../../whatsnew/2.3.rst:928 msgid "" "One can also now pass slice objects to the :meth:`~object.__getitem__` " "methods of the built-in sequences::" msgstr "" +"One can also now pass slice objects to the :meth:`~object.__getitem__` " +"methods of the built-in sequences::" #: ../../whatsnew/2.3.rst:934 msgid "Or use slice objects directly in subscripts::" -msgstr "" +msgstr "Or use slice objects directly in subscripts::" #: ../../whatsnew/2.3.rst:939 msgid "" @@ -999,6 +1384,13 @@ msgid "" "innocuous phrase hides a welter of confusing details!). The method is " "intended to be used like this::" msgstr "" +"To simplify implementing sequences that support extended slicing, slice " +"objects now have a method ``indices(length)`` which, given the length of a " +"sequence, returns a ``(start, stop, step)`` tuple that can be passed " +"directly to :func:`range`. :meth:`!indices` handles omitted and out-of-" +"bounds indices in a manner consistent with regular slices (and this " +"innocuous phrase hides a welter of confusing details!). The method is " +"intended to be used like this::" #: ../../whatsnew/2.3.rst:957 msgid "" @@ -1007,6 +1399,10 @@ msgid "" "This is consistent with Python 2.2, where :class:`int`, :class:`str`, etc., " "underwent the same change." msgstr "" +"From this example you can also see that the built-in :class:`slice` object " +"is now the type object for the slice type, and is no longer a function. " +"This is consistent with Python 2.2, where :class:`int`, :class:`str`, etc., " +"underwent the same change." #: ../../whatsnew/2.3.rst:966 msgid "Other Language Changes" @@ -1017,18 +1413,24 @@ msgid "" "Here are all of the changes that Python 2.3 makes to the core Python " "language." msgstr "" +"Here are all of the changes that Python 2.3 makes to the core Python " +"language." #: ../../whatsnew/2.3.rst:970 msgid "" "The :keyword:`yield` statement is now always a keyword, as described in " "section :ref:`section-generators` of this document." msgstr "" +"The :keyword:`yield` statement is now always a keyword, as described in " +"section :ref:`section-generators` of this document." #: ../../whatsnew/2.3.rst:973 msgid "" "A new built-in function :func:`enumerate` was added, as described in " "section :ref:`section-enumerate` of this document." msgstr "" +"A new built-in function :func:`enumerate` was added, as described in " +"section :ref:`section-enumerate` of this document." #: ../../whatsnew/2.3.rst:976 msgid "" @@ -1036,6 +1438,9 @@ msgid "" "the built-in :class:`bool` type, as described in section :ref:`section-bool` " "of this document." msgstr "" +"Two new constants, :const:`True` and :const:`False` were added along with " +"the built-in :class:`bool` type, as described in section :ref:`section-bool` " +"of this document." #: ../../whatsnew/2.3.rst:980 msgid "" @@ -1045,12 +1450,19 @@ msgid "" "that ``isinstance(int(expression), int)`` is false, but that seems unlikely " "to cause problems in practice." msgstr "" +"The :func:`int` type constructor will now return a long integer instead of " +"raising an :exc:`OverflowError` when a string or floating-point number is " +"too large to fit into an integer. This can lead to the paradoxical result " +"that ``isinstance(int(expression), int)`` is false, but that seems unlikely " +"to cause problems in practice." #: ../../whatsnew/2.3.rst:986 msgid "" "Built-in types now support the extended slicing syntax, as described in " "section :ref:`section-slices` of this document." msgstr "" +"Built-in types now support the extended slicing syntax, as described in " +"section :ref:`section-slices` of this document." #: ../../whatsnew/2.3.rst:989 msgid "" @@ -1059,6 +1471,10 @@ msgid "" "accepts numbers, meaning that you can't use it to concatenate a bunch of " "strings. (Contributed by Alex Martelli.)" msgstr "" +"A new built-in function, ``sum(iterable, start=0)``, adds up the numeric " +"items in the iterable object and returns their sum. :func:`sum` only " +"accepts numbers, meaning that you can't use it to concatenate a bunch of " +"strings. (Contributed by Alex Martelli.)" #: ../../whatsnew/2.3.rst:994 msgid "" @@ -1067,6 +1483,10 @@ msgid "" "consistent with slice indexing, so when *pos* is -1 the value will be " "inserted before the last element, and so forth." msgstr "" +"``list.insert(pos, value)`` used to insert *value* at the front of the list " +"when *pos* was negative. The behaviour has now been changed to be " +"consistent with slice indexing, so when *pos* is -1 the value will be " +"inserted before the last element, and so forth." #: ../../whatsnew/2.3.rst:999 msgid "" @@ -1074,6 +1494,9 @@ msgid "" "returns its index, now takes optional *start* and *stop* arguments to limit " "the search to only part of the list." msgstr "" +"``list.index(value)``, which searches for *value* within the list and " +"returns its index, now takes optional *start* and *stop* arguments to limit " +"the search to only part of the list." #: ../../whatsnew/2.3.rst:1003 msgid "" @@ -1082,6 +1505,10 @@ msgid "" "dictionary. If the requested key isn't present in the dictionary, *default* " "is returned if it's specified and :exc:`KeyError` raised if it isn't. ::" msgstr "" +"Dictionaries have a new method, ``pop(key[, *default*])``, that returns the " +"value corresponding to *key* and removes that key/value pair from the " +"dictionary. If the requested key isn't present in the dictionary, *default* " +"is returned if it's specified and :exc:`KeyError` raised if it isn't. ::" #: ../../whatsnew/2.3.rst:1025 msgid "" @@ -1089,20 +1516,25 @@ msgid "" "creates a dictionary with keys taken from the supplied iterator *iterable* " "and all values set to *value*, defaulting to ``None``." msgstr "" +"There's also a new class method, ``dict.fromkeys(iterable, value)``, that " +"creates a dictionary with keys taken from the supplied iterator *iterable* " +"and all values set to *value*, defaulting to ``None``." #: ../../whatsnew/2.3.rst:1029 msgid "(Patches contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(Patches contributed by Raymond Hettinger.)" #: ../../whatsnew/2.3.rst:1031 msgid "" "Also, the :func:`dict` constructor now accepts keyword arguments to simplify " "creating small dictionaries::" msgstr "" +"Also, the :func:`dict` constructor now accepts keyword arguments to simplify " +"creating small dictionaries::" #: ../../whatsnew/2.3.rst:1037 msgid "(Contributed by Just van Rossum.)" -msgstr "" +msgstr "(Contributed by Just van Rossum.)" #: ../../whatsnew/2.3.rst:1039 msgid "" @@ -1111,6 +1543,10 @@ msgid "" "Python with the :option:`-O` switch will still generate code that doesn't " "execute any assertions." msgstr "" +"The :keyword:`assert` statement no longer checks the ``__debug__`` flag, so " +"you can no longer disable assertions by assigning to ``__debug__``. Running " +"Python with the :option:`-O` switch will still generate code that doesn't " +"execute any assertions." #: ../../whatsnew/2.3.rst:1044 msgid "" @@ -1120,6 +1556,11 @@ msgid "" "now use the type objects available in the :mod:`types` module.) For example, " "you can create a new module object with the following code:" msgstr "" +"Most type objects are now callable, so you can use them to create new " +"objects such as functions, classes, and modules. (This means that the :mod:" +"`!new` module can be deprecated in a future Python version, because you can " +"now use the type objects available in the :mod:`types` module.) For example, " +"you can create a new module object with the following code:" #: ../../whatsnew/2.3.rst:1059 msgid "" @@ -1130,6 +1571,12 @@ msgid "" "PendingDeprecationWarning:: <-W>` on the command line or use :func:`warnings." "filterwarnings`." msgstr "" +"A new warning, :exc:`PendingDeprecationWarning` was added to indicate " +"features which are in the process of being deprecated. The warning will " +"*not* be printed by default. To check for use of features that will be " +"deprecated in the future, supply :option:`-Walways::" +"PendingDeprecationWarning:: <-W>` on the command line or use :func:`warnings." +"filterwarnings`." #: ../../whatsnew/2.3.rst:1065 msgid "" @@ -1137,6 +1584,9 @@ msgid "" "occurred\"``, has begun. Raising a string will now trigger :exc:" "`PendingDeprecationWarning`." msgstr "" +"The process of deprecating string-based exceptions, as in ``raise \"Error " +"occurred\"``, has begun. Raising a string will now trigger :exc:" +"`PendingDeprecationWarning`." #: ../../whatsnew/2.3.rst:1069 msgid "" @@ -1144,6 +1594,9 @@ msgid "" "warning. In a future version of Python, ``None`` may finally become a " "keyword." msgstr "" +"Using ``None`` as a variable name will now result in a :exc:`SyntaxWarning` " +"warning. In a future version of Python, ``None`` may finally become a " +"keyword." #: ../../whatsnew/2.3.rst:1072 msgid "" @@ -1155,6 +1608,13 @@ msgid "" "encoding used by the file; Unicode strings written to the file will be " "automatically converted to bytes using the given encoding." msgstr "" +"The :meth:`!xreadlines` method of file objects, introduced in Python 2.1, is " +"no longer necessary because files now behave as their own iterator. :meth:`!" +"xreadlines` was originally introduced as a faster way to loop over all the " +"lines in a file, but now you can simply write ``for line in file_obj``. File " +"objects also have a new read-only :attr:`!encoding` attribute that gives the " +"encoding used by the file; Unicode strings written to the file will be " +"automatically converted to bytes using the given encoding." #: ../../whatsnew/2.3.rst:1080 msgid "" @@ -1170,6 +1630,17 @@ msgid "" "pipermail/python-dev/2002-October/029035.html. Samuele Pedroni first pointed " "out the problem and also implemented the fix by coding the C3 algorithm." msgstr "" +"The method resolution order used by new-style classes has changed, though " +"you'll only notice the difference if you have a really complicated " +"inheritance hierarchy. Classic classes are unaffected by this change. " +"Python 2.2 originally used a topological sort of a class's ancestors, but " +"2.3 now uses the C3 algorithm as described in the paper `\"A Monotonic " +"Superclass Linearization for Dylan\" `_. To understand the motivation for this " +"change, read Michele Simionato's article :ref:`python_2.3_mro`, or read the " +"thread on python-dev starting with the message at https://mail.python.org/" +"pipermail/python-dev/2002-October/029035.html. Samuele Pedroni first pointed " +"out the problem and also implemented the fix by coding the C3 algorithm." #: ../../whatsnew/2.3.rst:1093 msgid "" @@ -1181,6 +1652,13 @@ msgid "" "number using ``sys.setcheckinterval(N)``. The limit can be retrieved with " "the new :func:`!sys.getcheckinterval` function." msgstr "" +"Python runs multithreaded programs by switching between threads after " +"executing N bytecodes. The default value for N has been increased from 10 " +"to 100 bytecodes, speeding up single-threaded applications by reducing the " +"switching overhead. Some multithreaded applications may suffer slower " +"response time, but that's easily fixed by setting the limit back to a lower " +"number using ``sys.setcheckinterval(N)``. The limit can be retrieved with " +"the new :func:`!sys.getcheckinterval` function." #: ../../whatsnew/2.3.rst:1101 msgid "" @@ -1189,10 +1667,14 @@ msgid "" "``'.'`` in front of the type name. For example, in Python 2.2, if you " "created a socket and printed its :attr:`!__class__`, you'd get this output::" msgstr "" +"One minor but far-reaching change is that the names of extension types " +"defined by the modules included with Python now contain the module and a " +"``'.'`` in front of the type name. For example, in Python 2.2, if you " +"created a socket and printed its :attr:`!__class__`, you'd get this output::" #: ../../whatsnew/2.3.rst:1110 msgid "In 2.3, you get this::" -msgstr "" +msgstr "In 2.3, you get this::" #: ../../whatsnew/2.3.rst:1115 msgid "" @@ -1203,10 +1685,16 @@ msgid "" "lines of those relating to assigning to an instance's :attr:`~instance." "__class__` attribute." msgstr "" +"One of the noted incompatibilities between old- and new-style classes has " +"been removed: you can now assign to the :attr:`~definition.__name__` and :" +"attr:`~class.__bases__` attributes of new-style classes. There are some " +"restrictions on what can be assigned to :attr:`~class.__bases__` along the " +"lines of those relating to assigning to an instance's :attr:`~instance." +"__class__` attribute." #: ../../whatsnew/2.3.rst:1125 msgid "String Changes" -msgstr "" +msgstr "String Changes" #: ../../whatsnew/2.3.rst:1127 msgid "" @@ -1216,12 +1704,19 @@ msgid "" "and ``X in Y`` will return :const:`True` if *X* is a substring of *Y*. If " "*X* is the empty string, the result is always :const:`True`. ::" msgstr "" +"The :keyword:`in` operator now works differently for strings. Previously, " +"when evaluating ``X in Y`` where *X* and *Y* are strings, *X* could only be " +"a single character. That's now changed; *X* can be a string of any length, " +"and ``X in Y`` will return :const:`True` if *X* is a substring of *Y*. If " +"*X* is the empty string, the result is always :const:`True`. ::" #: ../../whatsnew/2.3.rst:1140 msgid "" "Note that this doesn't tell you where the substring starts; if you need that " "information, use the :meth:`~str.find` string method." msgstr "" +"Note that this doesn't tell you where the substring starts; if you need that " +"information, use the :meth:`~str.find` string method." #: ../../whatsnew/2.3.rst:1143 msgid "" @@ -1229,16 +1724,21 @@ msgid "" "methods now have an optional argument for specifying the characters to " "strip. The default is still to remove all whitespace characters::" msgstr "" +"The :meth:`~str.strip`, :meth:`~str.lstrip`, and :meth:`~str.rstrip` string " +"methods now have an optional argument for specifying the characters to " +"strip. The default is still to remove all whitespace characters::" #: ../../whatsnew/2.3.rst:1157 msgid "(Suggested by Simon Brunning and implemented by Walter Dörwald.)" -msgstr "" +msgstr "(Suggested by Simon Brunning and implemented by Walter Dörwald.)" #: ../../whatsnew/2.3.rst:1159 msgid "" "The :meth:`~str.startswith` and :meth:`~str.endswith` string methods now " "accept negative numbers for the *start* and *end* parameters." msgstr "" +"The :meth:`~str.startswith` and :meth:`~str.endswith` string methods now " +"accept negative numbers for the *start* and *end* parameters." #: ../../whatsnew/2.3.rst:1162 msgid "" @@ -1247,10 +1747,14 @@ msgid "" "zeros on the left until it's the specified width. Note that the ``%`` " "operator is still more flexible and powerful than :meth:`~str.zfill`. ::" msgstr "" +"Another new string method is :meth:`~str.zfill`, originally a function in " +"the :mod:`string` module. :meth:`~str.zfill` pads a numeric string with " +"zeros on the left until it's the specified width. Note that the ``%`` " +"operator is still more flexible and powerful than :meth:`~str.zfill`. ::" #: ../../whatsnew/2.3.rst:1174 msgid "(Contributed by Walter Dörwald.)" -msgstr "" +msgstr "(Contributed by Walter Dörwald.)" #: ../../whatsnew/2.3.rst:1176 msgid "" @@ -1259,6 +1763,10 @@ msgid "" "basestring)`` will return :const:`True` for either kind of string. It's a " "completely abstract type, so you can't create :class:`!basestring` instances." msgstr "" +"A new type object, :class:`!basestring`, has been added. Both 8-bit strings " +"and Unicode strings inherit from this type, so ``isinstance(obj, " +"basestring)`` will return :const:`True` for either kind of string. It's a " +"completely abstract type, so you can't create :class:`!basestring` instances." #: ../../whatsnew/2.3.rst:1181 msgid "" @@ -1266,6 +1774,9 @@ msgid "" "the usual way when the only reference to them is from the internal " "dictionary of interned strings. (Implemented by Oren Tirosh.)" msgstr "" +"Interned strings are no longer immortal and will now be garbage-collected in " +"the usual way when the only reference to them is from the internal " +"dictionary of interned strings. (Implemented by Oren Tirosh.)" #: ../../whatsnew/2.3.rst:1189 msgid "Optimizations" @@ -1276,12 +1787,16 @@ msgid "" "The creation of new-style class instances has been made much faster; they're " "now faster than classic classes!" msgstr "" +"The creation of new-style class instances has been made much faster; they're " +"now faster than classic classes!" #: ../../whatsnew/2.3.rst:1194 msgid "" "The :meth:`~list.sort` method of list objects has been extensively rewritten " "by Tim Peters, and the implementation is significantly faster." msgstr "" +"The :meth:`~list.sort` method of list objects has been extensively rewritten " +"by Tim Peters, and the implementation is significantly faster." #: ../../whatsnew/2.3.rst:1197 msgid "" @@ -1291,6 +1806,11 @@ msgid "" "algorithm. (Original patch by Christopher A. Craig, and significantly " "reworked by Tim Peters.)" msgstr "" +"Multiplication of large long integers is now much faster thanks to an " +"implementation of Karatsuba multiplication, an algorithm that scales better " +"than the *O*\\ (*n*\\ :sup:`2`) required for the grade-school multiplication " +"algorithm. (Original patch by Christopher A. Craig, and significantly " +"reworked by Tim Peters.)" #: ../../whatsnew/2.3.rst:1202 msgid "" @@ -1298,6 +1818,9 @@ msgid "" "increase, depending on your compiler's idiosyncrasies. See section :ref:" "`23section-other` for a longer explanation. (Removed by Michael Hudson.)" msgstr "" +"The ``SET_LINENO`` opcode is now gone. This may provide a small speed " +"increase, depending on your compiler's idiosyncrasies. See section :ref:" +"`23section-other` for a longer explanation. (Removed by Michael Hudson.)" #: ../../whatsnew/2.3.rst:1206 msgid "" @@ -1305,6 +1828,9 @@ msgid "" "xrange(n)`` slightly faster than ``for i in range(n)``. (Patch by Raymond " "Hettinger.)" msgstr "" +":func:`!xrange` objects now have their own iterator, making ``for i in " +"xrange(n)`` slightly faster than ``for i in range(n)``. (Patch by Raymond " +"Hettinger.)" #: ../../whatsnew/2.3.rst:1210 msgid "" @@ -1313,12 +1839,18 @@ msgid "" "(Implemented mostly by GvR, but lots of people have contributed single " "changes.)" msgstr "" +"A number of small rearrangements have been made in various hotspots to " +"improve performance, such as inlining a function or removing some code. " +"(Implemented mostly by GvR, but lots of people have contributed single " +"changes.)" #: ../../whatsnew/2.3.rst:1214 msgid "" "The net result of the 2.3 optimizations is that Python 2.3 runs the pystone " "benchmark around 25% faster than Python 2.2." msgstr "" +"The net result of the 2.3 optimizations is that Python 2.3 runs the pystone " +"benchmark around 25% faster than Python 2.2." #: ../../whatsnew/2.3.rst:1221 msgid "New, Improved, and Deprecated Modules" @@ -1332,6 +1864,11 @@ msgid "" "source tree for a more complete list of changes, or look through the CVS " "logs for all the details." msgstr "" +"As usual, Python's standard library received a number of enhancements and " +"bug fixes. Here's a partial list of the most notable changes, sorted " +"alphabetically by module name. Consult the :file:`Misc/NEWS` file in the " +"source tree for a more complete list of changes, or look through the CVS " +"logs for all the details." #: ../../whatsnew/2.3.rst:1228 msgid "" @@ -1340,6 +1877,10 @@ msgid "" "assignment operator to add another array's contents, and the ``*=`` " "assignment operator to repeat an array. (Contributed by Jason Orendorff.)" msgstr "" +"The :mod:`array` module now supports arrays of Unicode characters using the " +"``'u'`` format character. Arrays also now support using the ``+=`` " +"assignment operator to add another array's contents, and the ``*=`` " +"assignment operator to repeat an array. (Contributed by Jason Orendorff.)" #: ../../whatsnew/2.3.rst:1233 msgid "" @@ -1347,6 +1888,9 @@ msgid "" "`_ package, providing a more complete " "interface to the transactional features of the BerkeleyDB library." msgstr "" +"The :mod:`!bsddb` module has been replaced by version 4.1.6 of the `PyBSDDB " +"`_ package, providing a more complete " +"interface to the transactional features of the BerkeleyDB library." #: ../../whatsnew/2.3.rst:1237 msgid "" @@ -1363,6 +1907,18 @@ msgid "" "importing it as :mod:`!bsddb3`, you will have to change your ``import`` " "statements to import it as :mod:`!bsddb`." msgstr "" +"The old version of the module has been renamed to :mod:`!bsddb185` and is " +"no longer built automatically; you'll have to edit :file:`Modules/Setup` to " +"enable it. Note that the new :mod:`!bsddb` package is intended to be " +"compatible with the old module, so be sure to file bugs if you discover any " +"incompatibilities. When upgrading to Python 2.3, if the new interpreter is " +"compiled with a new version of the underlying BerkeleyDB library, you will " +"almost certainly have to convert your database files to the new version. " +"You can do this fairly easily with the new scripts :file:`db2pickle.py` and :" +"file:`pickle2db.py` which you will find in the distribution's :file:`Tools/" +"scripts` directory. If you've already been using the PyBSDDB package and " +"importing it as :mod:`!bsddb3`, you will have to change your ``import`` " +"statements to import it as :mod:`!bsddb`." #: ../../whatsnew/2.3.rst:1249 msgid "" @@ -1370,12 +1926,17 @@ msgid "" "library. bz2-compressed data is usually smaller than corresponding :mod:" "`zlib`\\ -compressed data. (Contributed by Gustavo Niemeyer.)" msgstr "" +"The new :mod:`bz2` module is an interface to the bz2 data compression " +"library. bz2-compressed data is usually smaller than corresponding :mod:" +"`zlib`\\ -compressed data. (Contributed by Gustavo Niemeyer.)" #: ../../whatsnew/2.3.rst:1253 msgid "" "A set of standard date/time types has been added in the new :mod:`datetime` " "module. See the following section for more details." msgstr "" +"A set of standard date/time types has been added in the new :mod:`datetime` " +"module. See the following section for more details." #: ../../whatsnew/2.3.rst:1256 msgid "" @@ -1386,12 +1947,20 @@ msgid "" "includes the header file :file:`sample.h`, you would create the :class:`!" "Extension` object like this::" msgstr "" +"The Distutils :class:`!Extension` class now supports an extra constructor " +"argument named *depends* for listing additional source files that an " +"extension depends on. This lets Distutils recompile the module if any of " +"the dependency files are modified. For example, if :file:`sampmodule.c` " +"includes the header file :file:`sample.h`, you would create the :class:`!" +"Extension` object like this::" #: ../../whatsnew/2.3.rst:1267 msgid "" "Modifying :file:`sample.h` would then cause the module to be recompiled. " "(Contributed by Jeremy Hylton.)" msgstr "" +"Modifying :file:`sample.h` would then cause the module to be recompiled. " +"(Contributed by Jeremy Hylton.)" #: ../../whatsnew/2.3.rst:1270 msgid "" @@ -1400,6 +1969,10 @@ msgid "" "environment variables, using them to override the settings in Python's " "configuration (contributed by Robert Weber)." msgstr "" +"Other minor changes to Distutils: it now checks for the :envvar:`CC`, :" +"envvar:`CFLAGS`, :envvar:`!CPP`, :envvar:`LDFLAGS`, and :envvar:`CPPFLAGS` " +"environment variables, using them to override the settings in Python's " +"configuration (contributed by Robert Weber)." #: ../../whatsnew/2.3.rst:1275 msgid "" @@ -1408,12 +1981,18 @@ msgid "" "private ones as well. The :func:`~doctest.DocTestSuite` function creates a :" "class:`unittest.TestSuite` object from a set of :mod:`doctest` tests." msgstr "" +"Previously the :mod:`doctest` module would only search the docstrings of " +"public methods and functions for test cases, but it now also examines " +"private ones as well. The :func:`~doctest.DocTestSuite` function creates a :" +"class:`unittest.TestSuite` object from a set of :mod:`doctest` tests." #: ../../whatsnew/2.3.rst:1280 msgid "" "The new ``gc.get_referents(object)`` function returns a list of all the " "objects referenced by *object*." msgstr "" +"The new ``gc.get_referents(object)`` function returns a list of all the " +"objects referenced by *object*." #: ../../whatsnew/2.3.rst:1283 msgid "" @@ -1424,20 +2003,28 @@ msgid "" "encountered, but in GNU-style mode processing continues, meaning that " "options and arguments can be mixed. For example::" msgstr "" +"The :mod:`getopt` module gained a new function, :func:`~getopt.gnu_getopt`, " +"that supports the same arguments as the existing :func:`~getopt.getopt` " +"function but uses GNU-style scanning mode. The existing :func:`~getopt." +"getopt` stops processing options as soon as a non-option argument is " +"encountered, but in GNU-style mode processing continues, meaning that " +"options and arguments can be mixed. For example::" #: ../../whatsnew/2.3.rst:1294 msgid "(Contributed by Peter Åstrand.)" -msgstr "" +msgstr "(Contributed by Peter Åstrand.)" #: ../../whatsnew/2.3.rst:1296 msgid "" "The :mod:`grp`, :mod:`pwd`, and :mod:`resource` modules now return enhanced " "tuples::" msgstr "" +"The :mod:`grp`, :mod:`pwd`, and :mod:`resource` modules now return enhanced " +"tuples::" #: ../../whatsnew/2.3.rst:1304 msgid "The :mod:`gzip` module can now handle files exceeding 2 GiB." -msgstr "" +msgstr "The :mod:`gzip` module can now handle files exceeding 2 GiB." #: ../../whatsnew/2.3.rst:1306 msgid "" @@ -1450,6 +2037,14 @@ msgid "" "priorityque.html for more information about the priority queue data " "structure.)" msgstr "" +"The new :mod:`heapq` module contains an implementation of a heap queue " +"algorithm. A heap is an array-like data structure that keeps items in a " +"partially sorted order such that, for every index *k*, ``heap[k] <= " +"heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]``. This makes it quick to remove " +"the smallest item, and inserting a new item while maintaining the heap " +"property is *O*\\ (log *n*). (See https://xlinux.nist.gov/dads//HTML/" +"priorityque.html for more information about the priority queue data " +"structure.)" #: ../../whatsnew/2.3.rst:1314 msgid "" @@ -1458,10 +2053,14 @@ msgid "" "property on top of some other mutable Python sequence type. Here's an " "example that uses a Python list::" msgstr "" +"The :mod:`heapq` module provides :func:`~heapq.heappush` and :func:`~heapq." +"heappop` functions for adding and removing items while maintaining the heap " +"property on top of some other mutable Python sequence type. Here's an " +"example that uses a Python list::" #: ../../whatsnew/2.3.rst:1332 msgid "(Contributed by Kevin O'Connor.)" -msgstr "" +msgstr "(Contributed by Kevin O'Connor.)" #: ../../whatsnew/2.3.rst:1334 msgid "" @@ -1472,12 +2071,20 @@ msgid "" "operations. IDLE's core code has been incorporated into the standard library " "as the :mod:`idlelib` package." msgstr "" +"The IDLE integrated development environment has been updated using the code " +"from the IDLEfork project (https://idlefork.sourceforge.net). The most " +"notable feature is that the code being developed is now executed in a " +"subprocess, meaning that there's no longer any need for manual ``reload()`` " +"operations. IDLE's core code has been incorporated into the standard library " +"as the :mod:`idlelib` package." #: ../../whatsnew/2.3.rst:1340 msgid "" "The :mod:`imaplib` module now supports IMAP over SSL. (Contributed by Piers " "Lauder and Tino Lange.)" msgstr "" +"The :mod:`imaplib` module now supports IMAP over SSL. (Contributed by Piers " +"Lauder and Tino Lange.)" #: ../../whatsnew/2.3.rst:1343 msgid "" @@ -1490,6 +2097,14 @@ msgid "" "package's reference documentation for details. (Contributed by Raymond " "Hettinger.)" msgstr "" +"The :mod:`itertools` contains a number of useful functions for use with " +"iterators, inspired by various functions provided by the ML and Haskell " +"languages. For example, ``itertools.ifilter(predicate, iterator)`` returns " +"all elements in the iterator for which the function :func:`!predicate` " +"returns :const:`True`, and ``itertools.repeat(obj, N)`` returns ``obj`` *N* " +"times. There are a number of other functions in the module; see the " +"package's reference documentation for details. (Contributed by Raymond " +"Hettinger.)" #: ../../whatsnew/2.3.rst:1352 msgid "" @@ -1501,6 +2116,13 @@ msgid "" "logarithms for bases other than ``e`` and ``10``. (Contributed by Raymond " "Hettinger.)" msgstr "" +"Two new functions in the :mod:`math` module, ``degrees(rads)`` and " +"``radians(degs)``, convert between radians and degrees. Other functions in " +"the :mod:`math` module such as :func:`math.sin` and :func:`math.cos` have " +"always required input values measured in radians. Also, an optional *base* " +"argument was added to :func:`math.log` to make it easier to compute " +"logarithms for bases other than ``e`` and ``10``. (Contributed by Raymond " +"Hettinger.)" #: ../../whatsnew/2.3.rst:1359 msgid "" @@ -1510,6 +2132,11 @@ msgid "" "the :mod:`os` module. (Contributed by Gustavo Niemeyer, Geert Jansen, and " "Denis S. Otkidach.)" msgstr "" +"Several new POSIX functions (:func:`!getpgid`, :func:`!killpg`, :func:`!" +"lchown`, :func:`!loadavg`, :func:`!major`, :func:`!makedev`, :func:`!minor`, " +"and :func:`!mknod`) were added to the :mod:`posix` module that underlies " +"the :mod:`os` module. (Contributed by Gustavo Niemeyer, Geert Jansen, and " +"Denis S. Otkidach.)" #: ../../whatsnew/2.3.rst:1365 msgid "" @@ -1517,6 +2144,9 @@ msgid "" "report fractions of a second in a timestamp. Such time stamps are " "represented as floats, similar to the value returned by :func:`time.time`." msgstr "" +"In the :mod:`os` module, the :func:`!\\*stat` family of functions can now " +"report fractions of a second in a timestamp. Such time stamps are " +"represented as floats, similar to the value returned by :func:`time.time`." #: ../../whatsnew/2.3.rst:1369 msgid "" @@ -1527,10 +2157,16 @@ msgid "" "stamps are still represented as integers, unless :func:`!os." "stat_float_times` is invoked to enable float return values::" msgstr "" +"During testing, it was found that some applications will break if time " +"stamps are floats. For compatibility, when using the tuple interface of " +"the :class:`~os.stat_result` time stamps will be represented as integers. " +"When using named fields (a feature first introduced in Python 2.2), time " +"stamps are still represented as integers, unless :func:`!os." +"stat_float_times` is invoked to enable float return values::" #: ../../whatsnew/2.3.rst:1382 msgid "In Python 2.4, the default will change to always returning floats." -msgstr "" +msgstr "In Python 2.4, the default will change to always returning floats." #: ../../whatsnew/2.3.rst:1384 msgid "" @@ -1547,6 +2183,10 @@ msgid "" "automatically generate a usage message. See the following section for more " "details." msgstr "" +"The :mod:`optparse` module contains a new parser for command-line arguments " +"that can convert option values to a particular Python type and will " +"automatically generate a usage message. See the following section for more " +"details." #: ../../whatsnew/2.3.rst:1394 msgid "" @@ -1564,6 +2204,10 @@ msgid "" "functions for getting the architecture, CPU type, the Windows OS version, " "and even the Linux distribution version. (Contributed by Marc-André Lemburg.)" msgstr "" +"The new :mod:`platform` module contains a number of functions that try to " +"determine various properties of the platform you're running on. There are " +"functions for getting the architecture, CPU type, the Windows OS version, " +"and even the Linux distribution version. (Contributed by Marc-André Lemburg.)" #: ../../whatsnew/2.3.rst:1405 msgid "" @@ -1573,6 +2217,11 @@ msgid "" "object's :attr:`~xml.parsers.expat.xmlparser.buffer_text` attribute to :" "const:`True` will enable buffering." msgstr "" +"The parser objects provided by the :mod:`pyexpat ` module " +"can now optionally buffer character data, resulting in fewer calls to your " +"character data handler and therefore faster performance. Setting the parser " +"object's :attr:`~xml.parsers.expat.xmlparser.buffer_text` attribute to :" +"const:`True` will enable buffering." #: ../../whatsnew/2.3.rst:1410 msgid "" @@ -1582,6 +2231,11 @@ msgid "" "elements from the population without replacing chosen elements. *k* can be " "any value up to ``len(population)``. For example::" msgstr "" +"The ``sample(population, k)`` function was added to the :mod:`random` " +"module. *population* is a sequence or :class:`!xrange` object containing " +"the elements of a population, and :func:`~random.sample` chooses *k* " +"elements from the population without replacing chosen elements. *k* can be " +"any value up to ``len(population)``. For example::" #: ../../whatsnew/2.3.rst:1432 msgid "" @@ -1589,10 +2243,13 @@ msgid "" "implemented in C. It's faster and more extensively studied than the " "previous algorithm." msgstr "" +"The :mod:`random` module now uses a new algorithm, the Mersenne Twister, " +"implemented in C. It's faster and more extensively studied than the " +"previous algorithm." #: ../../whatsnew/2.3.rst:1436 msgid "(All changes contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(All changes contributed by Raymond Hettinger.)" #: ../../whatsnew/2.3.rst:1438 msgid "" @@ -1600,6 +2257,9 @@ msgid "" "`~readline.get_history_item`, :func:`~readline.get_current_history_length`, " "and :func:`~readline.redisplay`." msgstr "" +"The :mod:`readline` module also gained a number of new functions: :func:" +"`~readline.get_history_item`, :func:`~readline.get_current_history_length`, " +"and :func:`~readline.redisplay`." #: ../../whatsnew/2.3.rst:1442 msgid "" @@ -1610,6 +2270,12 @@ msgid "" "them or time to do so. If you have applications using :mod:`!rexec`, " "rewrite them to use something else." msgstr "" +"The :mod:`!rexec` and :mod:`!Bastion` modules have been declared dead, and " +"attempts to import them will fail with a :exc:`RuntimeError`. New-style " +"classes provide new ways to break out of the restricted execution " +"environment provided by :mod:`!rexec`, and no one has interest in fixing " +"them or time to do so. If you have applications using :mod:`!rexec`, " +"rewrite them to use something else." #: ../../whatsnew/2.3.rst:1448 msgid "" @@ -1617,6 +2283,9 @@ msgid "" "because there are known bugs in the :mod:`!rexec` module in those versions. " "To repeat: if you're using :mod:`!rexec`, stop using it immediately.)" msgstr "" +"(Sticking with Python 2.2 or 2.1 will not make your applications any safer " +"because there are known bugs in the :mod:`!rexec` module in those versions. " +"To repeat: if you're using :mod:`!rexec`, stop using it immediately.)" #: ../../whatsnew/2.3.rst:1452 msgid "" @@ -1624,12 +2293,17 @@ msgid "" "for encryption is not believed to be secure. If you need encryption, use " "one of the several AES Python modules that are available separately." msgstr "" +"The :mod:`!rotor` module has been deprecated because the algorithm it uses " +"for encryption is not believed to be secure. If you need encryption, use " +"one of the several AES Python modules that are available separately." #: ../../whatsnew/2.3.rst:1456 msgid "" "The :mod:`shutil` module gained a ``move(src, dest)`` function that " "recursively moves a file or directory to a new location." msgstr "" +"The :mod:`shutil` module gained a ``move(src, dest)`` function that " +"recursively moves a file or directory to a new location." #: ../../whatsnew/2.3.rst:1459 msgid "" @@ -1637,6 +2311,9 @@ msgid "" "`signal` but then removed again as it proved impossible to make it work " "reliably across platforms." msgstr "" +"Support for more advanced POSIX signal handling was added to the :mod:" +"`signal` but then removed again as it proved impossible to make it work " +"reliably across platforms." #: ../../whatsnew/2.3.rst:1463 msgid "" @@ -1645,6 +2322,10 @@ msgid "" "Subsequent socket operations that take longer than *t* seconds to complete " "will abort and raise a :exc:`socket.timeout` exception." msgstr "" +"The :mod:`socket` module now supports timeouts. You can call the " +"``settimeout(t)`` method on a socket object to set a timeout of *t* seconds. " +"Subsequent socket operations that take longer than *t* seconds to complete " +"will abort and raise a :exc:`socket.timeout` exception." #: ../../whatsnew/2.3.rst:1468 msgid "" @@ -1654,12 +2335,19 @@ msgid "" "parts of it. (This is a good example of a collaborative development process " "in action.)" msgstr "" +"The original timeout implementation was by Tim O'Malley. Michael Gilfix " +"integrated it into the Python :mod:`socket` module and shepherded it through " +"a lengthy review. After the code was checked in, Guido van Rossum rewrote " +"parts of it. (This is a good example of a collaborative development process " +"in action.)" #: ../../whatsnew/2.3.rst:1474 msgid "" "On Windows, the :mod:`socket` module now ships with Secure Sockets Layer " "(SSL) support." msgstr "" +"On Windows, the :mod:`socket` module now ships with Secure Sockets Layer " +"(SSL) support." #: ../../whatsnew/2.3.rst:1477 msgid "" @@ -1667,12 +2355,17 @@ msgid "" "the Python level as ``sys.api_version``. The current exception can be " "cleared by calling the new :func:`!sys.exc_clear` function." msgstr "" +"The value of the C :c:macro:`!PYTHON_API_VERSION` macro is now exposed at " +"the Python level as ``sys.api_version``. The current exception can be " +"cleared by calling the new :func:`!sys.exc_clear` function." #: ../../whatsnew/2.3.rst:1481 msgid "" "The new :mod:`tarfile` module allows reading from and writing to :program:" "`tar`\\ -format archive files. (Contributed by Lars Gustäbel.)" msgstr "" +"The new :mod:`tarfile` module allows reading from and writing to :program:" +"`tar`\\ -format archive files. (Contributed by Lars Gustäbel.)" #: ../../whatsnew/2.3.rst:1484 msgid "" @@ -1684,6 +2377,13 @@ msgid "" "you can guess, :func:`~textwrap.fill` is built on top of :func:`~textwrap." "wrap`. For example::" msgstr "" +"The new :mod:`textwrap` module contains functions for wrapping strings " +"containing paragraphs of text. The ``wrap(text, width)`` function takes a " +"string and returns a list containing the text split into lines of no more " +"than the chosen width. The ``fill(text, width)`` function returns a single " +"string, reformatted to fit into lines no longer than the chosen width. (As " +"you can guess, :func:`~textwrap.fill` is built on top of :func:`~textwrap." +"wrap`. For example::" #: ../../whatsnew/2.3.rst:1506 msgid "" @@ -1694,6 +2394,12 @@ msgid "" "the formatting; consult the module's documentation for details. (Contributed " "by Greg Ward.)" msgstr "" +"The module also contains a :class:`~textwrap.TextWrapper` class that " +"actually implements the text wrapping strategy. Both the :class:`~textwrap." +"TextWrapper` class and the :func:`~textwrap.wrap` and :func:`~textwrap.fill` " +"functions support a number of additional keyword arguments for fine-tuning " +"the formatting; consult the module's documentation for details. (Contributed " +"by Greg Ward.)" #: ../../whatsnew/2.3.rst:1512 msgid "" @@ -1704,6 +2410,12 @@ msgid "" "modules (ones that *don't* rely on threads to run) by putting the following " "code at the top::" msgstr "" +"The :mod:`!thread` and :mod:`threading` modules now have companion modules, :" +"mod:`!dummy_thread` and :mod:`!dummy_threading`, that provide a do-nothing " +"implementation of the :mod:`!thread` module's interface for platforms where " +"threads are not supported. The intention is to simplify thread-aware " +"modules (ones that *don't* rely on threads to run) by putting the following " +"code at the top::" #: ../../whatsnew/2.3.rst:1524 msgid "" @@ -1715,6 +2427,13 @@ msgid "" "magically make multithreaded code run without threads; code that waits for " "another thread to return or to do something will simply hang forever." msgstr "" +"In this example, :mod:`!_threading` is used as the module name to make it " +"clear that the module being used is not necessarily the actual :mod:" +"`threading` module. Code can call functions and use classes in :mod:`!" +"_threading` whether or not threads are supported, avoiding an :keyword:`if` " +"statement and making the code slightly clearer. This module will not " +"magically make multithreaded code run without threads; code that waits for " +"another thread to return or to do something will simply hang forever." #: ../../whatsnew/2.3.rst:1532 msgid "" @@ -1724,6 +2443,11 @@ msgid "" "Cannon contributed a portable implementation that's written in pure Python " "and should behave identically on all platforms." msgstr "" +"The :mod:`time` module's :func:`~time.strptime` function has long been an " +"annoyance because it uses the platform C library's :func:`~time.strptime` " +"implementation, and different platforms sometimes have odd bugs. Brett " +"Cannon contributed a portable implementation that's written in pure Python " +"and should behave identically on all platforms." #: ../../whatsnew/2.3.rst:1538 msgid "" @@ -1734,12 +2458,20 @@ msgid "" "faster to convert an 8-bit string to Unicode by appending an empty Unicode " "string to it or by using the :func:`!unicode` function::" msgstr "" +"The new :mod:`timeit` module helps measure how long snippets of Python code " +"take to execute. The :file:`timeit.py` file can be run directly from the " +"command line, or the module's :class:`~timeit.Timer` class can be imported " +"and used directly. Here's a short example that figures out whether it's " +"faster to convert an 8-bit string to Unicode by appending an empty Unicode " +"string to it or by using the :func:`!unicode` function::" #: ../../whatsnew/2.3.rst:1558 msgid "" "The :mod:`!Tix` module has received various bug fixes and updates for the " "current version of the Tix package." msgstr "" +"The :mod:`!Tix` module has received various bug fixes and updates for the " +"current version of the Tix package." #: ../../whatsnew/2.3.rst:1561 msgid "" @@ -1755,6 +2487,17 @@ msgid "" "December/031107.html for a more detailed explanation of this change. " "(Implemented by Martin von Löwis.)" msgstr "" +"The :mod:`!Tkinter` module now works with a thread-enabled version of Tcl. " +"Tcl's threading model requires that widgets only be accessed from the thread " +"in which they're created; accesses from another thread can cause Tcl to " +"panic. For certain Tcl interfaces, :mod:`!Tkinter` will now automatically " +"avoid this when a widget is accessed from a different thread by marshalling " +"a command, passing it to the correct thread, and waiting for the results. " +"Other interfaces can't be handled automatically but :mod:`!Tkinter` will now " +"raise an exception on such an access so that you can at least find out about " +"the problem. See https://mail.python.org/pipermail/python-dev/2002-" +"December/031107.html for a more detailed explanation of this change. " +"(Implemented by Martin von Löwis.)" #: ../../whatsnew/2.3.rst:1572 msgid "" @@ -1765,6 +2508,12 @@ msgid "" "be controlled through the :meth:`!wantobjects` method of :class:`!tkapp` " "objects." msgstr "" +"Calling Tcl methods through :mod:`!_tkinter` no longer returns only " +"strings. Instead, if Tcl returns other objects those objects are converted " +"to their Python equivalent, if one exists, or wrapped with a :class:`!" +"_tkinter.Tcl_Obj` object if no Python equivalent exists. This behavior can " +"be controlled through the :meth:`!wantobjects` method of :class:`!tkapp` " +"objects." #: ../../whatsnew/2.3.rst:1578 msgid "" @@ -1773,6 +2522,10 @@ msgid "" "cause compatibility problems, since Tkinter would always convert string " "results to Python types where possible." msgstr "" +"When using :mod:`!_tkinter` through the :mod:`!Tkinter` module (as most " +"Tkinter applications will), this feature is always activated. It should not " +"cause compatibility problems, since Tkinter would always convert string " +"results to Python types where possible." #: ../../whatsnew/2.3.rst:1583 msgid "" @@ -1780,10 +2533,13 @@ msgid "" "setting the :attr:`!wantobjects` variable in the :mod:`!Tkinter` module to " "false before creating the first :class:`!tkapp` object. ::" msgstr "" +"If any incompatibilities are found, the old behavior can be restored by " +"setting the :attr:`!wantobjects` variable in the :mod:`!Tkinter` module to " +"false before creating the first :class:`!tkapp` object. ::" #: ../../whatsnew/2.3.rst:1590 msgid "Any breakage caused by this change should be reported as a bug." -msgstr "" +msgstr "Any breakage caused by this change should be reported as a bug." #: ../../whatsnew/2.3.rst:1592 msgid "" @@ -1793,6 +2549,11 @@ msgid "" "substitutable for dictionaries, such as the classes in the :mod:`shelve` " "module." msgstr "" +"The :mod:`!UserDict` module has a new :class:`!DictMixin` class which " +"defines all dictionary methods for classes that already have a minimum " +"mapping interface. This greatly simplifies writing classes that need to be " +"substitutable for dictionaries, such as the classes in the :mod:`shelve` " +"module." #: ../../whatsnew/2.3.rst:1598 msgid "" @@ -1800,6 +2561,9 @@ msgid "" "whenever the class defines :meth:`~object.__getitem__`, :meth:`~object." "__setitem__`, :meth:`~object.__delitem__`, and :meth:`!keys`. For example::" msgstr "" +"Adding the mix-in as a superclass provides the full dictionary interface " +"whenever the class defines :meth:`~object.__getitem__`, :meth:`~object." +"__setitem__`, :meth:`~object.__delitem__`, and :meth:`!keys`. For example::" #: ../../whatsnew/2.3.rst:1639 msgid "(Contributed by Raymond Hettinger.)" @@ -1812,6 +2576,10 @@ msgid "" "meth:`~xml.dom.minidom.Node.toxml` and :meth:`~xml.dom.minidom.Node." "toprettyxml` methods of DOM nodes." msgstr "" +"The DOM implementation in :mod:`xml.dom.minidom` can now generate XML output " +"in a particular encoding by providing an optional encoding argument to the :" +"meth:`~xml.dom.minidom.Node.toxml` and :meth:`~xml.dom.minidom.Node." +"toprettyxml` methods of DOM nodes." #: ../../whatsnew/2.3.rst:1645 msgid "" @@ -1821,6 +2589,11 @@ msgid "" "``None``, you must supply a true value for the *allow_none* parameter when " "creating a :class:`!Marshaller` instance." msgstr "" +"The :mod:`!xmlrpclib` module now supports an XML-RPC extension for handling " +"nil data values such as Python's ``None``. Nil values are always supported " +"on unmarshalling an XML-RPC response. To generate requests containing " +"``None``, you must supply a true value for the *allow_none* parameter when " +"creating a :class:`!Marshaller` instance." #: ../../whatsnew/2.3.rst:1651 msgid "" @@ -1830,6 +2603,11 @@ msgid "" "documentation; pointing xmlrpclib to the server allows invoking the actual " "methods. (Contributed by Brian Quinlan.)" msgstr "" +"The new :mod:`!DocXMLRPCServer` module allows writing self-documenting XML-" +"RPC servers. Run it in demo mode (as a program) to see it in action. " +"Pointing the web browser to the RPC server produces pydoc-style " +"documentation; pointing xmlrpclib to the server allows invoking the actual " +"methods. (Contributed by Brian Quinlan.)" #: ../../whatsnew/2.3.rst:1657 msgid "" @@ -1837,6 +2615,9 @@ msgid "" "has been added. The \"idna\" encoding can be used to convert between a " "Unicode domain name and the ASCII-compatible encoding (ACE) of that name. ::" msgstr "" +"Support for internationalized domain names (RFCs 3454, 3490, 3491, and 3492) " +"has been added. The \"idna\" encoding can be used to convert between a " +"Unicode domain name and the ASCII-compatible encoding (ACE) of that name. ::" #: ../../whatsnew/2.3.rst:1664 msgid "" @@ -1848,16 +2629,25 @@ msgid "" "Unicode URLs with non-ASCII host names as long as the ``path`` part of the " "URL is ASCII only." msgstr "" +"The :mod:`socket` module has also been extended to transparently convert " +"Unicode hostnames to the ACE version before passing them to the C library. " +"Modules that deal with hostnames such as :mod:`!httplib` and :mod:`ftplib`) " +"also support Unicode host names; :mod:`!httplib` also sends HTTP ``Host`` " +"headers using the ACE version of the domain name. :mod:`urllib` supports " +"Unicode URLs with non-ASCII host names as long as the ``path`` part of the " +"URL is ASCII only." #: ../../whatsnew/2.3.rst:1672 msgid "" "To implement this change, the :mod:`stringprep` module, the " "``mkstringprep`` tool and the ``punycode`` encoding have been added." msgstr "" +"To implement this change, the :mod:`stringprep` module, the " +"``mkstringprep`` tool and the ``punycode`` encoding have been added." #: ../../whatsnew/2.3.rst:1679 msgid "Date/Time Type" -msgstr "" +msgstr "Date/Time Type" #: ../../whatsnew/2.3.rst:1681 msgid "" @@ -1865,6 +2655,9 @@ msgid "" "mod:`datetime` module. The types don't support different calendars or many " "fancy features, and just stick to the basics of representing time." msgstr "" +"Date and time types suitable for expressing timestamps were added as the :" +"mod:`datetime` module. The types don't support different calendars or many " +"fancy features, and just stick to the basics of representing time." #: ../../whatsnew/2.3.rst:1685 msgid "" @@ -1876,6 +2669,13 @@ msgid "" "points in time, and time zone logic is implemented by classes inheriting " "from the abstract :class:`~datetime.tzinfo` class." msgstr "" +"The three primary types are: :class:`~datetime.date`, representing a day, " +"month, and year; :class:`~datetime.time`, consisting of hour, minute, and " +"second; and :class:`~datetime.datetime`, which contains all the attributes " +"of both :class:`~datetime.date` and :class:`~datetime.time`. There's also a :" +"class:`~datetime.timedelta` class representing differences between two " +"points in time, and time zone logic is implemented by classes inheriting " +"from the abstract :class:`~datetime.tzinfo` class." #: ../../whatsnew/2.3.rst:1692 msgid "" @@ -1885,12 +2685,19 @@ msgid "" "number of class methods. For example, the :meth:`~datetime.date.today` " "class method returns the current local date." msgstr "" +"You can create instances of :class:`~datetime.date` and :class:`~datetime." +"time` by either supplying keyword arguments to the appropriate constructor, " +"e.g. ``datetime.date(year=1972, month=10, day=15)``, or by using one of a " +"number of class methods. For example, the :meth:`~datetime.date.today` " +"class method returns the current local date." #: ../../whatsnew/2.3.rst:1698 msgid "" "Once created, instances of the date/time classes are all immutable. There " "are a number of methods for producing formatted strings from objects::" msgstr "" +"Once created, instances of the date/time classes are all immutable. There " +"are a number of methods for producing formatted strings from objects::" #: ../../whatsnew/2.3.rst:1710 msgid "" @@ -1898,6 +2705,9 @@ msgid "" "fields of a :class:`~datetime.date` or :class:`~datetime.datetime` " "instance, returning a new instance::" msgstr "" +"The :meth:`~datetime.datetime.replace` method allows modifying one or more " +"fields of a :class:`~datetime.date` or :class:`~datetime.datetime` " +"instance, returning a new instance::" #: ../../whatsnew/2.3.rst:1720 msgid "" @@ -1909,16 +2719,25 @@ msgid "" "parsing strings and getting back a :class:`~datetime.date` or :class:" "`~datetime.datetime`." msgstr "" +"Instances can be compared, hashed, and converted to strings (the result is " +"the same as that of :meth:`~datetime.datetime.isoformat`). :class:" +"`~datetime.date` and :class:`~datetime.datetime` instances can be subtracted " +"from each other, and added to :class:`~datetime.timedelta` instances. The " +"largest missing feature is that there's no standard library support for " +"parsing strings and getting back a :class:`~datetime.date` or :class:" +"`~datetime.datetime`." #: ../../whatsnew/2.3.rst:1727 msgid "" "For more information, refer to the module's reference documentation. " "(Contributed by Tim Peters.)" msgstr "" +"For more information, refer to the module's reference documentation. " +"(Contributed by Tim Peters.)" #: ../../whatsnew/2.3.rst:1734 msgid "The optparse Module" -msgstr "" +msgstr "The optparse Module" #: ../../whatsnew/2.3.rst:1736 msgid "" @@ -1928,48 +2747,63 @@ msgid "" "automatically creates the output for :option:`!--help`, and can perform " "different actions for different options." msgstr "" +"The :mod:`getopt` module provides simple parsing of command-line arguments. " +"The new :mod:`optparse` module (originally named Optik) provides more " +"elaborate command-line parsing that follows the Unix conventions, " +"automatically creates the output for :option:`!--help`, and can perform " +"different actions for different options." #: ../../whatsnew/2.3.rst:1742 msgid "" "You start by creating an instance of :class:`~optparse.OptionParser` and " "telling it what your program's options are. ::" msgstr "" +"You start by creating an instance of :class:`~optparse.OptionParser` and " +"telling it what your program's options are. ::" #: ../../whatsnew/2.3.rst:1756 msgid "" "Parsing a command line is then done by calling the :meth:`~optparse." "OptionParser.parse_args` method. ::" msgstr "" +"Parsing a command line is then done by calling the :meth:`~optparse." +"OptionParser.parse_args` method. ::" #: ../../whatsnew/2.3.rst:1762 msgid "" "This returns an object containing all of the option values, and a list of " "strings containing the remaining arguments." msgstr "" +"This returns an object containing all of the option values, and a list of " +"strings containing the remaining arguments." #: ../../whatsnew/2.3.rst:1765 msgid "" "Invoking the script with the various arguments now works as you'd expect it " "to. Note that the length argument is automatically converted to an integer." msgstr "" +"Invoking the script with the various arguments now works as you'd expect it " +"to. Note that the length argument is automatically converted to an integer." #: ../../whatsnew/2.3.rst:1778 msgid "The help message is automatically generated for you:" -msgstr "" +msgstr "The help message is automatically generated for you:" #: ../../whatsnew/2.3.rst:1793 msgid "See the module's documentation for more details." -msgstr "" +msgstr "See the module's documentation for more details." #: ../../whatsnew/2.3.rst:1796 msgid "" "Optik was written by Greg Ward, with suggestions from the readers of the " "Getopt SIG." msgstr "" +"Optik was written by Greg Ward, with suggestions from the readers of the " +"Getopt SIG." #: ../../whatsnew/2.3.rst:1805 msgid "Pymalloc: A Specialized Object Allocator" -msgstr "" +msgstr "Pymalloc: A Specialized Object Allocator" #: ../../whatsnew/2.3.rst:1807 msgid "" @@ -1980,6 +2814,12 @@ msgid "" "function to get large pools of memory and then fulfills smaller memory " "requests from these pools." msgstr "" +"Pymalloc, a specialized object allocator written by Vladimir Marangozov, was " +"a feature added to Python 2.1. Pymalloc is intended to be faster than the " +"system :c:func:`malloc` and to have less memory overhead for allocation " +"patterns typical of Python programs. The allocator uses C's :c:func:`malloc` " +"function to get large pools of memory and then fulfills smaller memory " +"requests from these pools." #: ../../whatsnew/2.3.rst:1813 msgid "" @@ -1989,6 +2829,11 @@ msgid "" "In 2.3, pymalloc has had further enhancements and is now enabled by default; " "you'll have to supply :option:`!--without-pymalloc` to disable it." msgstr "" +"In 2.1 and 2.2, pymalloc was an experimental feature and wasn't enabled by " +"default; you had to explicitly enable it when compiling Python by providing " +"the :option:`!--with-pymalloc` option to the :program:`configure` script. " +"In 2.3, pymalloc has had further enhancements and is now enabled by default; " +"you'll have to supply :option:`!--without-pymalloc` to disable it." #: ../../whatsnew/2.3.rst:1819 msgid "" @@ -1997,6 +2842,10 @@ msgid "" "their code with pymalloc enabled, because some incorrect code may cause core " "dumps at runtime." msgstr "" +"This change is transparent to code written in Python; however, pymalloc may " +"expose bugs in C extensions. Authors of C extension modules should test " +"their code with pymalloc enabled, because some incorrect code may cause core " +"dumps at runtime." #: ../../whatsnew/2.3.rst:1824 msgid "" @@ -2012,6 +2861,17 @@ msgid "" "included with Python fell afoul of this and had to be fixed; doubtless there " "are more third-party modules that will have the same problem." msgstr "" +"There's one particularly common error that causes problems. There are a " +"number of memory allocation functions in Python's C API that have previously " +"just been aliases for the C library's :c:func:`malloc` and :c:func:`free`, " +"meaning that if you accidentally called mismatched functions the error " +"wouldn't be noticeable. When the object allocator is enabled, these " +"functions aren't aliases of :c:func:`malloc` and :c:func:`free` any more, " +"and calling the wrong function to free memory may get you a core dump. For " +"example, if memory was allocated using :c:func:`PyObject_Malloc`, it has to " +"be freed using :c:func:`PyObject_Free`, not :c:func:`free`. A few modules " +"included with Python fell afoul of this and had to be fixed; doubtless there " +"are more third-party modules that will have the same problem." #: ../../whatsnew/2.3.rst:1836 msgid "" @@ -2021,6 +2881,11 @@ msgid "" "family. There is one family for allocating chunks of memory and another " "family of functions specifically for allocating Python objects." msgstr "" +"As part of this change, the confusing multiple interfaces for allocating " +"memory have been consolidated down into two API families. Memory allocated " +"with one family must not be manipulated with functions from the other " +"family. There is one family for allocating chunks of memory and another " +"family of functions specifically for allocating Python objects." #: ../../whatsnew/2.3.rst:1842 msgid "" @@ -2028,6 +2893,9 @@ msgid "" "memory\" family: :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc`, and :c:" "func:`PyMem_Free`." msgstr "" +"To allocate and free an undistinguished chunk of memory use the \"raw " +"memory\" family: :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc`, and :c:" +"func:`PyMem_Free`." #: ../../whatsnew/2.3.rst:1845 msgid "" @@ -2036,12 +2904,18 @@ msgid "" "allocations: :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc`, and :c:" "func:`PyObject_Free`." msgstr "" +"The \"object memory\" family is the interface to the pymalloc facility " +"described above and is biased towards a large number of \"small\" " +"allocations: :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc`, and :c:" +"func:`PyObject_Free`." #: ../../whatsnew/2.3.rst:1849 msgid "" "To allocate and free Python objects, use the \"object\" family :c:macro:" "`PyObject_New`, :c:macro:`PyObject_NewVar`, and :c:func:`PyObject_Del`." msgstr "" +"To allocate and free Python objects, use the \"object\" family :c:macro:" +"`PyObject_New`, :c:macro:`PyObject_NewVar`, and :c:func:`PyObject_Del`." #: ../../whatsnew/2.3.rst:1852 msgid "" @@ -2051,6 +2925,11 @@ msgid "" "compile a debugging version of the Python interpreter by running :program:" "`configure` with :option:`!--with-pydebug`." msgstr "" +"Thanks to lots of work by Tim Peters, pymalloc in 2.3 also provides " +"debugging features to catch memory overwrites and doubled frees in both " +"extension modules and in the interpreter itself. To enable this support, " +"compile a debugging version of the Python interpreter by running :program:" +"`configure` with :option:`!--with-pydebug`." #: ../../whatsnew/2.3.rst:1858 msgid "" @@ -2060,10 +2939,15 @@ msgid "" "version of Python since 1.5.2. You would copy the file from Python's source " "distribution and bundle it with the source of your extension." msgstr "" +"To aid extension writers, a header file :file:`Misc/pymemcompat.h` is " +"distributed with the source to Python 2.3 that allows Python extensions to " +"use the 2.3 interfaces to memory allocation while compiling against any " +"version of Python since 1.5.2. You would copy the file from Python's source " +"distribution and bundle it with the source of your extension." #: ../../whatsnew/2.3.rst:1867 msgid "https://hg.python.org/cpython/file/default/Objects/obmalloc.c" -msgstr "" +msgstr "https://hg.python.org/cpython/file/default/Objects/obmalloc.c" #: ../../whatsnew/2.3.rst:1868 msgid "" @@ -2071,10 +2955,13 @@ msgid "" "top of the file :file:`Objects/obmalloc.c` in the Python source code. The " "above link points to the file within the python.org SVN browser." msgstr "" +"For the full details of the pymalloc implementation, see the comments at the " +"top of the file :file:`Objects/obmalloc.c` in the Python source code. The " +"above link points to the file within the python.org SVN browser." #: ../../whatsnew/2.3.rst:1876 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/2.3.rst:1878 msgid "Changes to Python's build process and to the C API include:" @@ -2087,6 +2974,10 @@ msgid "" "Python without it, and the :option:`!--with-cycle-gc` switch to :program:" "`configure` has been removed." msgstr "" +"The cycle detection implementation used by the garbage collection has proven " +"to be stable, so it's now been made mandatory. You can no longer compile " +"Python without it, and the :option:`!--with-cycle-gc` switch to :program:" +"`configure` has been removed." #: ../../whatsnew/2.3.rst:1885 msgid "" @@ -2094,6 +2985,9 @@ msgid "" "so`) by supplying :option:`!--enable-shared` when running Python's :program:" "`configure` script. (Contributed by Ondrej Palkovsky.)" msgstr "" +"Python can now optionally be built as a shared library (:file:`libpython2.3." +"so`) by supplying :option:`!--enable-shared` when running Python's :program:" +"`configure` script. (Contributed by Ondrej Palkovsky.)" #: ../../whatsnew/2.3.rst:1889 msgid "" @@ -2103,6 +2997,11 @@ msgid "" "core will generally use the :c:macro:`!PyAPI_FUNC` and :c:macro:`!" "PyAPI_DATA` macros." msgstr "" +"The :c:macro:`!DL_EXPORT` and :c:macro:`!DL_IMPORT` macros are now " +"deprecated. Initialization functions for Python extension modules should now " +"be declared using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python " +"core will generally use the :c:macro:`!PyAPI_FUNC` and :c:macro:`!" +"PyAPI_DATA` macros." #: ../../whatsnew/2.3.rst:1894 msgid "" @@ -2112,6 +3011,11 @@ msgid "" "smaller, but will also mean that you can't get help for Python's built-ins. " "(Contributed by Gustavo Niemeyer.)" msgstr "" +"The interpreter can be compiled without any docstrings for the built-in " +"functions and modules by supplying :option:`!--without-doc-strings` to the :" +"program:`configure` script. This makes the Python executable about 10% " +"smaller, but will also mean that you can't get help for Python's built-ins. " +"(Contributed by Gustavo Niemeyer.)" #: ../../whatsnew/2.3.rst:1900 msgid "" @@ -2123,6 +3027,13 @@ msgid "" "``PyArg_ParseTuple(args, \"\")`` instead, but this will be slower than " "using :c:macro:`METH_NOARGS`." msgstr "" +"The :c:func:`!PyArg_NoArgs` macro is now deprecated, and code that uses it " +"should be changed. For Python 2.2 and later, the method definition table " +"can specify the :c:macro:`METH_NOARGS` flag, signalling that there are no " +"arguments, and the argument checking can then be removed. If compatibility " +"with pre-2.2 versions of Python is important, the code could use " +"``PyArg_ParseTuple(args, \"\")`` instead, but this will be slower than " +"using :c:macro:`METH_NOARGS`." #: ../../whatsnew/2.3.rst:1907 msgid "" @@ -2131,12 +3042,18 @@ msgid "" "`unsigned short int`, ``I`` for :c:expr:`unsigned int`, and ``K`` for :c:" "expr:`unsigned long long`." msgstr "" +":c:func:`PyArg_ParseTuple` accepts new format characters for various sizes " +"of unsigned integers: ``B`` for :c:expr:`unsigned char`, ``H`` for :c:expr:" +"`unsigned short int`, ``I`` for :c:expr:`unsigned int`, and ``K`` for :c:" +"expr:`unsigned long long`." #: ../../whatsnew/2.3.rst:1912 msgid "" "A new function, ``PyObject_DelItemString(mapping, char *key)`` was added as " "shorthand for ``PyObject_DelItem(mapping, PyString_New(key))``." msgstr "" +"A new function, ``PyObject_DelItemString(mapping, char *key)`` was added as " +"shorthand for ``PyObject_DelItem(mapping, PyString_New(key))``." #: ../../whatsnew/2.3.rst:1915 msgid "" @@ -2145,6 +3062,10 @@ msgid "" "`Lib/test/test_bufio.py` speeding up considerably (from 57 seconds to 1.7 " "seconds, according to one measurement)." msgstr "" +"File objects now manage their internal string buffer differently, increasing " +"it exponentially when needed. This results in the benchmark tests in :file:" +"`Lib/test/test_bufio.py` speeding up considerably (from 57 seconds to 1.7 " +"seconds, according to one measurement)." #: ../../whatsnew/2.3.rst:1920 msgid "" @@ -2152,12 +3073,17 @@ msgid "" "by setting either the :c:macro:`METH_CLASS` or :c:macro:`METH_STATIC` flags " "in a method's :c:type:`PyMethodDef` structure." msgstr "" +"It's now possible to define class and static methods for a C extension type " +"by setting either the :c:macro:`METH_CLASS` or :c:macro:`METH_STATIC` flags " +"in a method's :c:type:`PyMethodDef` structure." #: ../../whatsnew/2.3.rst:1924 msgid "" "Python now includes a copy of the Expat XML parser's source code, removing " "any dependence on a system version or local installation of Expat." msgstr "" +"Python now includes a copy of the Expat XML parser's source code, removing " +"any dependence on a system version or local installation of Expat." #: ../../whatsnew/2.3.rst:1927 msgid "" @@ -2169,10 +3095,17 @@ msgid "" "the desired effect. For more detail, read the API reference documentation " "or the source." msgstr "" +"If you dynamically allocate type objects in your extension, you should be " +"aware of a change in the rules relating to the :attr:`!__module__` and :attr:" +"`~definition.__name__` attributes. In summary, you will want to ensure the " +"type's dictionary contains a ``'__module__'`` key; making the module name " +"the part of the type name leading up to the final period will no longer have " +"the desired effect. For more detail, read the API reference documentation " +"or the source." #: ../../whatsnew/2.3.rst:1938 msgid "Port-Specific Changes" -msgstr "" +msgstr "Port-Specific Changes" #: ../../whatsnew/2.3.rst:1940 msgid "" @@ -2186,6 +3119,15 @@ msgid "" "part of the integration of the EMX port into CVS. (Contributed by Andrew " "MacIntyre.)" msgstr "" +"Support for a port to IBM's OS/2 using the EMX runtime environment was " +"merged into the main Python source tree. EMX is a POSIX emulation layer " +"over the OS/2 system APIs. The Python port for EMX tries to support all the " +"POSIX-like capability exposed by the EMX runtime, and mostly succeeds; :func:" +"`!fork` and :func:`fcntl` are restricted by the limitations of the " +"underlying emulation layer. The standard OS/2 port, which uses IBM's Visual " +"Age compiler, also gained support for case-sensitive import semantics as " +"part of the integration of the EMX port into CVS. (Contributed by Andrew " +"MacIntyre.)" #: ../../whatsnew/2.3.rst:1949 msgid "" @@ -2194,6 +3136,10 @@ msgid "" "single routine is missing on the current OS version. Instead calling the " "missing routine will raise an exception. (Contributed by Jack Jansen.)" msgstr "" +"On MacOS, most toolbox modules have been weaklinked to improve backward " +"compatibility. This means that modules will no longer fail to load if a " +"single routine is missing on the current OS version. Instead calling the " +"missing routine will raise an exception. (Contributed by Jack Jansen.)" #: ../../whatsnew/2.3.rst:1954 msgid "" @@ -2201,16 +3147,21 @@ msgid "" "source distribution, were updated for 2.3. (Contributed by Sean " "Reifschneider.)" msgstr "" +"The RPM spec files, found in the :file:`Misc/RPM/` directory in the Python " +"source distribution, were updated for 2.3. (Contributed by Sean " +"Reifschneider.)" #: ../../whatsnew/2.3.rst:1957 msgid "" "Other new platforms now supported by Python include AtheOS (http://www." "atheos.cx/), GNU/Hurd, and OpenVMS." msgstr "" +"Other new platforms now supported by Python include AtheOS (http://www." +"atheos.cx/), GNU/Hurd, and OpenVMS." #: ../../whatsnew/2.3.rst:1966 msgid "Other Changes and Fixes" -msgstr "Other Changes and Fixes" +msgstr "Outras alterações e correções" #: ../../whatsnew/2.3.rst:1968 msgid "" @@ -2219,10 +3170,14 @@ msgid "" "there were 523 patches applied and 514 bugs fixed between Python 2.2 and " "2.3. Both figures are likely to be underestimates." msgstr "" +"As usual, there were a bunch of other improvements and bugfixes scattered " +"throughout the source tree. A search through the CVS change logs finds " +"there were 523 patches applied and 514 bugs fixed between Python 2.2 and " +"2.3. Both figures are likely to be underestimates." #: ../../whatsnew/2.3.rst:1973 msgid "Some of the more notable changes are:" -msgstr "" +msgstr "Some of the more notable changes are:" #: ../../whatsnew/2.3.rst:1975 msgid "" @@ -2232,6 +3187,11 @@ msgid "" "environment variable can be set before running the Python interpreter, or it " "can be set by the Python program as part of its execution." msgstr "" +"If the :envvar:`PYTHONINSPECT` environment variable is set, the Python " +"interpreter will enter the interactive prompt after running a Python " +"program, as if Python had been invoked with the :option:`-i` option. The " +"environment variable can be set before running the Python interpreter, or it " +"can be set by the Python program as part of its execution." #: ../../whatsnew/2.3.rst:1981 msgid "" @@ -2241,12 +3201,19 @@ msgid "" "example, the option '``-uall,-bsddb``' could be used to enable the use of " "all resources except ``bsddb``." msgstr "" +"The :file:`regrtest.py` script now provides a way to allow \"all resources " +"except *foo*.\" A resource name passed to the :option:`!-u` option can now " +"be prefixed with a hyphen (``'-'``) to mean \"remove this resource.\" For " +"example, the option '``-uall,-bsddb``' could be used to enable the use of " +"all resources except ``bsddb``." #: ../../whatsnew/2.3.rst:1987 msgid "" "The tools used to build the documentation now work under Cygwin as well as " "Unix." msgstr "" +"The tools used to build the documentation now work under Cygwin as well as " +"Unix." #: ../../whatsnew/2.3.rst:1990 msgid "" @@ -2258,12 +3225,21 @@ msgid "" "to determine when to call the trace function, removing the need for " "``SET_LINENO`` entirely." msgstr "" +"The ``SET_LINENO`` opcode has been removed. Back in the mists of time, this " +"opcode was needed to produce line numbers in tracebacks and support trace " +"functions (for, e.g., :mod:`pdb`). Since Python 1.5, the line numbers in " +"tracebacks have been computed using a different mechanism that works with " +"\"python -O\". For Python 2.3 Michael Hudson implemented a similar scheme " +"to determine when to call the trace function, removing the need for " +"``SET_LINENO`` entirely." #: ../../whatsnew/2.3.rst:1998 msgid "" "It would be difficult to detect any resulting difference from Python code, " "apart from a slight speed up when Python is run without :option:`-O`." msgstr "" +"It would be difficult to detect any resulting difference from Python code, " +"apart from a slight speed up when Python is run without :option:`-O`." #: ../../whatsnew/2.3.rst:2001 msgid "" @@ -2272,6 +3248,10 @@ msgid "" "have the added effect of making the code work as desired under \"python -O\" " "in earlier versions of Python." msgstr "" +"C extensions that access the :attr:`~frame.f_lineno` field of frame objects " +"should instead call ``PyCode_Addr2Line(f->f_code, f->f_lasti)``. This will " +"have the added effect of making the code work as desired under \"python -O\" " +"in earlier versions of Python." #: ../../whatsnew/2.3.rst:2006 msgid "" @@ -2280,28 +3260,38 @@ msgid "" "executed next. A ``jump`` command has been added to the :mod:`pdb` debugger " "taking advantage of this new feature. (Implemented by Richie Hindle.)" msgstr "" +"A nifty new feature is that trace functions can now assign to the :attr:" +"`~frame.f_lineno` attribute of frame objects, changing the line that will be " +"executed next. A ``jump`` command has been added to the :mod:`pdb` debugger " +"taking advantage of this new feature. (Implemented by Richie Hindle.)" #: ../../whatsnew/2.3.rst:2015 msgid "Porting to Python 2.3" -msgstr "" +msgstr "Porting to Python 2.3" #: ../../whatsnew/2.3.rst:2017 msgid "" "This section lists previously described changes that may require changes to " "your code:" msgstr "" +"This section lists previously described changes that may require changes to " +"your code:" #: ../../whatsnew/2.3.rst:2020 msgid "" ":keyword:`yield` is now always a keyword; if it's used as a variable name in " "your code, a different name must be chosen." msgstr "" +":keyword:`yield` is now always a keyword; if it's used as a variable name in " +"your code, a different name must be chosen." #: ../../whatsnew/2.3.rst:2023 msgid "" "For strings *X* and *Y*, ``X in Y`` now works if *X* is more than one " "character long." msgstr "" +"For strings *X* and *Y*, ``X in Y`` now works if *X* is more than one " +"character long." #: ../../whatsnew/2.3.rst:2026 msgid "" @@ -2309,6 +3299,9 @@ msgid "" "raising an :exc:`OverflowError` when a string or floating-point number is " "too large to fit into an integer." msgstr "" +"The :func:`int` type constructor will now return a long integer instead of " +"raising an :exc:`OverflowError` when a string or floating-point number is " +"too large to fit into an integer." #: ../../whatsnew/2.3.rst:2030 msgid "" @@ -2316,6 +3309,9 @@ msgid "" "the file's encoding (UTF-8, Latin-1, or whatever) by adding a comment to the " "top of the file. See section :ref:`section-encodings` for more information." msgstr "" +"If you have Unicode strings that contain 8-bit characters, you must declare " +"the file's encoding (UTF-8, Latin-1, or whatever) by adding a comment to the " +"top of the file. See section :ref:`section-encodings` for more information." #: ../../whatsnew/2.3.rst:2034 msgid "" @@ -2324,6 +3320,10 @@ msgid "" "to their Python equivalent, if one exists, or wrapped with a :class:`!" "_tkinter.Tcl_Obj` object if no Python equivalent exists." msgstr "" +"Calling Tcl methods through :mod:`!_tkinter` no longer returns only " +"strings. Instead, if Tcl returns other objects those objects are converted " +"to their Python equivalent, if one exists, or wrapped with a :class:`!" +"_tkinter.Tcl_Obj` object if no Python equivalent exists." #: ../../whatsnew/2.3.rst:2039 msgid "" @@ -2331,6 +3331,9 @@ msgid "" "`FutureWarning`. Currently they're stored as 32-bit numbers and result in a " "negative value, but in Python 2.4 they'll become positive long integers." msgstr "" +"Large octal and hex literals such as ``0xffffffff`` now trigger a :exc:" +"`FutureWarning`. Currently they're stored as 32-bit numbers and result in a " +"negative value, but in Python 2.4 they'll become positive long integers." #: ../../whatsnew/2.3.rst:2043 msgid "" @@ -2341,10 +3344,16 @@ msgid "" "bits set and clear the desired upper bits. For example, to clear just the " "top bit (bit 31), you could write ``0xffffffffL &~(1L<<31)``." msgstr "" +"There are a few ways to fix this warning. If you really need a positive " +"number, just add an ``L`` to the end of the literal. If you're trying to " +"get a 32-bit integer with low bits set and have previously used an " +"expression such as ``~(1 << 31)``, it's probably clearest to start with all " +"bits set and clear the desired upper bits. For example, to clear just the " +"top bit (bit 31), you could write ``0xffffffffL &~(1L<<31)``." #: ../../whatsnew/2.3.rst:2050 msgid "You can no longer disable assertions by assigning to ``__debug__``." -msgstr "" +msgstr "You can no longer disable assertions by assigning to ``__debug__``." #: ../../whatsnew/2.3.rst:2052 msgid "" @@ -2354,18 +3363,27 @@ msgid "" "new :func:`!get_distutil_options` function in your :file:`setup.py` and only " "uses the new keywords with a version of the Distutils that supports them::" msgstr "" +"The Distutils :func:`!setup` function has gained various new keyword " +"arguments such as *depends*. Old versions of the Distutils will abort if " +"passed unknown keywords. A solution is to check for the presence of the " +"new :func:`!get_distutil_options` function in your :file:`setup.py` and only " +"uses the new keywords with a version of the Distutils that supports them::" #: ../../whatsnew/2.3.rst:2065 msgid "" "Using ``None`` as a variable name will now result in a :exc:`SyntaxWarning` " "warning." msgstr "" +"Using ``None`` as a variable name will now result in a :exc:`SyntaxWarning` " +"warning." #: ../../whatsnew/2.3.rst:2068 msgid "" "Names of extension types defined by the modules included with Python now " "contain the module and a ``'.'`` in front of the type name." msgstr "" +"Names of extension types defined by the modules included with Python now " +"contain the module and a ``'.'`` in front of the type name." #: ../../whatsnew/2.3.rst:2077 msgid "Acknowledgements" @@ -2382,6 +3400,14 @@ msgid "" "Norwitz, Hans Nowak, Chris Reedy, Francesco Ricciardi, Vinay Sajip, Neil " "Schemenauer, Roman Suzi, Jason Tishler, Just van Rossum." msgstr "" +"The author would like to thank the following people for offering " +"suggestions, corrections and assistance with various drafts of this article: " +"Jeff Bauer, Simon Brunning, Brett Cannon, Michael Chermside, Andrew Dalke, " +"Scott David Daniels, Fred L. Drake, Jr., David Fraser, Kelly Gerber, " +"Raymond Hettinger, Michael Hudson, Chris Lambert, Detlef Lannert, Martin von " +"Löwis, Andrew MacIntyre, Lalo Martins, Chad Netzer, Gustavo Niemeyer, Neal " +"Norwitz, Hans Nowak, Chris Reedy, Francesco Ricciardi, Vinay Sajip, Neil " +"Schemenauer, Roman Suzi, Jason Tishler, Just van Rossum." #: ../../whatsnew/2.3.rst:371 msgid "universal newlines" @@ -2389,4 +3415,4 @@ msgstr "novas linhas universais" #: ../../whatsnew/2.3.rst:371 msgid "What's new" -msgstr "" +msgstr "What's new" diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index 74b794b1d..62b813c82 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -19,16 +19,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../whatsnew/2.4.rst:3 msgid "What's New in Python 2.4" -msgstr "O que há de novo no Python 2.4" +msgstr "What's New in Python 2.4" #: ../../whatsnew/2.4.rst:0 msgid "Author" @@ -43,6 +43,8 @@ msgid "" "This article explains the new features in Python 2.4.1, released on March " "30, 2005." msgstr "" +"This article explains the new features in Python 2.4.1, released on March " +"30, 2005." #: ../../whatsnew/2.4.rst:17 msgid "" @@ -52,6 +54,11 @@ msgid "" "function decorators and generator expressions; most other changes are to the " "standard library." msgstr "" +"Python 2.4 is a medium-sized release. It doesn't introduce as many changes " +"as the radical Python 2.2, but introduces more features than the " +"conservative 2.3 release. The most significant new language features are " +"function decorators and generator expressions; most other changes are to the " +"standard library." #: ../../whatsnew/2.4.rst:22 msgid "" @@ -59,6 +66,9 @@ msgid "" "bugs fixed between Python 2.3 and 2.4. Both figures are likely to be " "underestimates." msgstr "" +"According to the CVS change logs, there were 481 patches applied and 502 " +"bugs fixed between Python 2.3 and 2.4. Both figures are likely to be " +"underestimates." #: ../../whatsnew/2.4.rst:25 msgid "" @@ -69,10 +79,16 @@ msgid "" "Often you will be referred to the PEP for a particular new feature for " "explanations of the implementation and design rationale." msgstr "" +"This article doesn't attempt to provide a complete specification of every " +"single new feature, but instead provides a brief introduction to each " +"feature. For full details, you should refer to the documentation for Python " +"2.4, such as the Python Library Reference and the Python Reference Manual. " +"Often you will be referred to the PEP for a particular new feature for " +"explanations of the implementation and design rationale." #: ../../whatsnew/2.4.rst:36 msgid "PEP 218: Built-In Set Objects" -msgstr "" +msgstr "PEP 218: Built-In Set Objects" #: ../../whatsnew/2.4.rst:38 msgid "" @@ -83,6 +99,12 @@ msgid "" "sequences, and for mathematical operations like unions, intersections, " "differences, and symmetric differences. ::" msgstr "" +"Python 2.3 introduced the :mod:`sets` module. C implementations of set data " +"types have now been added to the Python core as two new built-in types, " +"``set(iterable)`` and ``frozenset(iterable)``. They provide high speed " +"operations for membership testing, for eliminating duplicates from " +"sequences, and for mathematical operations like unions, intersections, " +"differences, and symmetric differences. ::" #: ../../whatsnew/2.4.rst:71 msgid "" @@ -90,6 +112,9 @@ msgid "" "is immutable and hashable, it may be used as a dictionary key or as a member " "of another set." msgstr "" +"The :func:`frozenset` type is an immutable version of :func:`set`. Since it " +"is immutable and hashable, it may be used as a dictionary key or as a member " +"of another set." #: ../../whatsnew/2.4.rst:75 msgid "" @@ -97,20 +122,25 @@ msgid "" "you wish to subclass the :class:`Set` or :class:`ImmutableSet` classes. " "There are currently no plans to deprecate the module." msgstr "" +"The :mod:`sets` module remains in the standard library, and may be useful if " +"you wish to subclass the :class:`Set` or :class:`ImmutableSet` classes. " +"There are currently no plans to deprecate the module." #: ../../whatsnew/2.4.rst:82 msgid ":pep:`218` - Adding a Built-In Set Object Type" -msgstr "" +msgstr ":pep:`218` - Adding a Built-In Set Object Type" #: ../../whatsnew/2.4.rst:83 msgid "" "Originally proposed by Greg Wilson and ultimately implemented by Raymond " "Hettinger." msgstr "" +"Originally proposed by Greg Wilson and ultimately implemented by Raymond " +"Hettinger." #: ../../whatsnew/2.4.rst:90 msgid "PEP 237: Unifying Long Integers and Integers" -msgstr "PEP 237: Unificando inteiros longos e inteiros" +msgstr "PEP 237: Unifying Long Integers and Integers" #: ../../whatsnew/2.4.rst:92 msgid "" @@ -121,6 +151,12 @@ msgid "" "(depending on your platform). In 2.4, these expressions no longer produce a " "warning and instead produce a different result that's usually a long integer." msgstr "" +"The lengthy transition process for this PEP, begun in Python 2.2, takes " +"another step forward in Python 2.4. In 2.3, certain integer operations that " +"would behave differently after int/long unification triggered :exc:" +"`FutureWarning` warnings and returned values limited to 32 or 64 bits " +"(depending on your platform). In 2.4, these expressions no longer produce a " +"warning and instead produce a different result that's usually a long integer." #: ../../whatsnew/2.4.rst:99 msgid "" @@ -129,20 +165,26 @@ msgid "" "warning in 2.3, evaluating to 0 on 32-bit platforms. In Python 2.4, this " "expression now returns the correct answer, 8589934592." msgstr "" +"The problematic expressions are primarily left shifts and lengthy " +"hexadecimal and octal constants. For example, ``2 << 32`` results in a " +"warning in 2.3, evaluating to 0 on 32-bit platforms. In Python 2.4, this " +"expression now returns the correct answer, 8589934592." #: ../../whatsnew/2.4.rst:107 msgid ":pep:`237` - Unifying Long Integers and Integers" -msgstr ":pep:`237` - Unificando inteiros longos e inteiros" +msgstr ":pep:`237` - Unifying Long Integers and Integers" #: ../../whatsnew/2.4.rst:108 msgid "" "Original PEP written by Moshe Zadka and GvR. The changes for 2.4 were " "implemented by Kalle Svensson." msgstr "" +"Original PEP written by Moshe Zadka and GvR. The changes for 2.4 were " +"implemented by Kalle Svensson." #: ../../whatsnew/2.4.rst:115 msgid "PEP 289: Generator Expressions" -msgstr "" +msgstr "PEP 289: Generator Expressions" #: ../../whatsnew/2.4.rst:117 msgid "" @@ -155,10 +197,18 @@ msgid "" "large. When trying to write a functionally styled program, it would be " "natural to write something like::" msgstr "" +"The iterator feature introduced in Python 2.2 and the :mod:`itertools` " +"module make it easier to write programs that loop through large data sets " +"without having the entire data set in memory at one time. List " +"comprehensions don't fit into this picture very well because they produce a " +"Python list object containing all of the items. This unavoidably pulls all " +"of the objects into memory, which can be a problem if your data set is very " +"large. When trying to write a functionally styled program, it would be " +"natural to write something like::" #: ../../whatsnew/2.4.rst:129 msgid "instead of ::" -msgstr "" +msgstr "instead of ::" #: ../../whatsnew/2.4.rst:136 msgid "" @@ -166,6 +216,9 @@ msgid "" "dealing with a large number of link objects you'd have to write the second " "form to avoid having all link objects in memory at the same time." msgstr "" +"The first form is more concise and perhaps more readable, but if you're " +"dealing with a large number of link objects you'd have to write the second " +"form to avoid having all link objects in memory at the same time." #: ../../whatsnew/2.4.rst:140 msgid "" @@ -173,6 +226,9 @@ msgid "" "materialize the entire list; instead they create a generator that will " "return elements one by one. The above example could be written as::" msgstr "" +"Generator expressions work similarly to list comprehensions but don't " +"materialize the entire list; instead they create a generator that will " +"return elements one by one. The above example could be written as::" #: ../../whatsnew/2.4.rst:148 msgid "" @@ -181,6 +237,10 @@ msgid "" "so if you want to create an iterator that will be immediately passed to a " "function you could write::" msgstr "" +"Generator expressions always have to be written inside parentheses, as in " +"the above example. The parentheses signalling a function call also count, " +"so if you want to create an iterator that will be immediately passed to a " +"function you could write::" #: ../../whatsnew/2.4.rst:155 msgid "" @@ -191,20 +251,28 @@ msgid "" "change this, making list comprehensions match generator expressions in this " "respect." msgstr "" +"Generator expressions differ from list comprehensions in various small ways. " +"Most notably, the loop variable (*obj* in the above example) is not " +"accessible outside of the generator expression. List comprehensions leave " +"the variable assigned to its last value; future versions of Python will " +"change this, making list comprehensions match generator expressions in this " +"respect." #: ../../whatsnew/2.4.rst:164 msgid ":pep:`289` - Generator Expressions" -msgstr "" +msgstr ":pep:`289` - Generator Expressions" #: ../../whatsnew/2.4.rst:165 msgid "" "Proposed by Raymond Hettinger and implemented by Jiwon Seo with early " "efforts steered by Hye-Shik Chang." msgstr "" +"Proposed by Raymond Hettinger and implemented by Jiwon Seo with early " +"efforts steered by Hye-Shik Chang." #: ../../whatsnew/2.4.rst:172 msgid "PEP 292: Simpler String Substitutions" -msgstr "" +msgstr "PEP 292: Simpler String Substitutions" #: ../../whatsnew/2.4.rst:174 msgid "" @@ -212,10 +280,14 @@ msgid "" "for substituting variables into strings; this style of substitution may be " "better for applications where untrained users need to edit templates." msgstr "" +"Some new classes in the standard library provide an alternative mechanism " +"for substituting variables into strings; this style of substitution may be " +"better for applications where untrained users need to edit templates." #: ../../whatsnew/2.4.rst:178 msgid "The usual way of substituting variables by name is the ``%`` operator::" msgstr "" +"The usual way of substituting variables by name is the ``%`` operator::" #: ../../whatsnew/2.4.rst:183 msgid "" @@ -229,12 +301,23 @@ msgid "" "users, and if they make a mistake, it's difficult to provide helpful " "feedback to them." msgstr "" +"When writing the template string, it can be easy to forget the ``i`` or " +"``s`` after the closing parenthesis. This isn't a big problem if the " +"template is in a Python module, because you run the code, get an " +"\"Unsupported format character\" :exc:`ValueError`, and fix the problem. " +"However, consider an application such as Mailman where template strings or " +"translations are being edited by users who aren't aware of the Python " +"language. The format string's syntax is complicated to explain to such " +"users, and if they make a mistake, it's difficult to provide helpful " +"feedback to them." #: ../../whatsnew/2.4.rst:192 msgid "" "PEP 292 adds a :class:`Template` class to the :mod:`string` module that uses " "``$`` to indicate a substitution::" msgstr "" +"PEP 292 adds a :class:`Template` class to the :mod:`string` module that uses " +"``$`` to indicate a substitution::" #: ../../whatsnew/2.4.rst:200 msgid "" @@ -242,18 +325,21 @@ msgid "" "raise a :exc:`KeyError`. There's also a :meth:`safe_substitute` method that " "ignores missing keys::" msgstr "" +"If a key is missing from the dictionary, the :meth:`substitute` method will " +"raise a :exc:`KeyError`. There's also a :meth:`safe_substitute` method that " +"ignores missing keys::" #: ../../whatsnew/2.4.rst:211 msgid ":pep:`292` - Simpler String Substitutions" -msgstr "" +msgstr ":pep:`292` - Simpler String Substitutions" #: ../../whatsnew/2.4.rst:212 msgid "Written and implemented by Barry Warsaw." -msgstr "" +msgstr "Written and implemented by Barry Warsaw." #: ../../whatsnew/2.4.rst:218 msgid "PEP 318: Decorators for Functions and Methods" -msgstr "" +msgstr "PEP 318: Decorators for Functions and Methods" #: ../../whatsnew/2.4.rst:220 msgid "" @@ -264,12 +350,20 @@ msgid "" "`staticmethod` or :func:`classmethod` function that would wrap up the " "function as a method of the new type. Your code would look like this::" msgstr "" +"Python 2.2 extended Python's object model by adding static methods and class " +"methods, but it didn't extend Python's syntax to provide any new way of " +"defining static or class methods. Instead, you had to write a :keyword:" +"`def` statement in the usual way, and pass the resulting method to a :func:" +"`staticmethod` or :func:`classmethod` function that would wrap up the " +"function as a method of the new type. Your code would look like this::" #: ../../whatsnew/2.4.rst:233 msgid "" "If the method was very long, it would be easy to miss or forget the :func:" "`classmethod` invocation after the function body." msgstr "" +"If the method was very long, it would be easy to miss or forget the :func:" +"`classmethod` invocation after the function body." #: ../../whatsnew/2.4.rst:236 msgid "" @@ -279,6 +373,11 @@ msgid "" "access to the feature; a new syntactic feature has been added to meet this " "need." msgstr "" +"The intention was always to add some syntax to make such definitions more " +"readable, but at the time of 2.2's release a good syntax was not obvious. " +"Today a good syntax *still* isn't obvious but users are asking for easier " +"access to the feature; a new syntactic feature has been added to meet this " +"need." #: ../../whatsnew/2.4.rst:241 msgid "" @@ -287,22 +386,30 @@ msgid "" "additional information on a function object; they're *decorating* functions " "with more details." msgstr "" +"The new feature is called \"function decorators\". The name comes from the " +"idea that :func:`classmethod`, :func:`staticmethod`, and friends are storing " +"additional information on a function object; they're *decorating* functions " +"with more details." #: ../../whatsnew/2.4.rst:246 msgid "" "The notation borrows from Java and uses the ``'@'`` character as an " "indicator. Using the new syntax, the example above would be written::" msgstr "" +"The notation borrows from Java and uses the ``'@'`` character as an " +"indicator. Using the new syntax, the example above would be written::" #: ../../whatsnew/2.4.rst:256 msgid "" "The ``@classmethod`` is shorthand for the ``meth=classmethod(meth)`` " "assignment. More generally, if you have the following::" msgstr "" +"The ``@classmethod`` is shorthand for the ``meth=classmethod(meth)`` " +"assignment. More generally, if you have the following::" #: ../../whatsnew/2.4.rst:265 msgid "It's equivalent to the following pre-decorator code::" -msgstr "" +msgstr "It's equivalent to the following pre-decorator code::" #: ../../whatsnew/2.4.rst:270 msgid "" @@ -312,6 +419,11 @@ msgid "" "either at the module level or inside a class; you can't decorate class " "definitions." msgstr "" +"Decorators must come on the line before a function definition, one decorator " +"per line, and can't be on the same line as the def statement, meaning that " +"``@A def f(): ...`` is illegal. You can only decorate function definitions, " +"either at the module level or inside a class; you can't decorate class " +"definitions." #: ../../whatsnew/2.4.rst:275 msgid "" @@ -322,18 +434,28 @@ msgid "" "your own decorators. The following simple example just sets an attribute on " "the function object::" msgstr "" +"A decorator is just a function that takes the function to be decorated as an " +"argument and returns either the same function or some new object. The " +"return value of the decorator need not be callable (though it typically is), " +"unless further decorators will be applied to the result. It's easy to write " +"your own decorators. The following simple example just sets an attribute on " +"the function object::" #: ../../whatsnew/2.4.rst:295 msgid "" "As a slightly more realistic example, the following decorator checks that " "the supplied argument is an integer::" msgstr "" +"As a slightly more realistic example, the following decorator checks that " +"the supplied argument is an integer::" #: ../../whatsnew/2.4.rst:313 msgid "" "An example in :pep:`318` contains a fancier version of this idea that lets " "you both specify the required type and check the returned type." msgstr "" +"An example in :pep:`318` contains a fancier version of this idea that lets " +"you both specify the required type and check the returned type." #: ../../whatsnew/2.4.rst:316 msgid "" @@ -343,11 +465,17 @@ msgid "" "function, as previously described. In other words, ``@A @B @C(args)`` " "becomes::" msgstr "" +"Decorator functions can take arguments. If arguments are supplied, your " +"decorator function is called with only those arguments and must return a new " +"decorator function; this function must take a single function and return a " +"function, as previously described. In other words, ``@A @B @C(args)`` " +"becomes::" #: ../../whatsnew/2.4.rst:325 msgid "" "Getting this right can be slightly brain-bending, but it's not too difficult." msgstr "" +"Getting this right can be slightly brain-bending, but it's not too difficult." #: ../../whatsnew/2.4.rst:327 msgid "" @@ -356,10 +484,14 @@ msgid "" "names in tracebacks, so decorators should change the name of any new " "function that's constructed and returned." msgstr "" +"A small related change makes the :attr:`func_name ` " +"attribute of functions writable. This attribute is used to display function " +"names in tracebacks, so decorators should change the name of any new " +"function that's constructed and returned." #: ../../whatsnew/2.4.rst:336 msgid ":pep:`318` - Decorators for Functions, Methods and Classes" -msgstr "" +msgstr ":pep:`318` - Decorators for Functions, Methods and Classes" #: ../../whatsnew/2.4.rst:337 msgid "" @@ -367,30 +499,37 @@ msgid "" "wrote patches implementing function decorators, but the one that was " "actually checked in was patch #979728, written by Mark Russell." msgstr "" +"Written by Kevin D. Smith, Jim Jewett, and Skip Montanaro. Several people " +"wrote patches implementing function decorators, but the one that was " +"actually checked in was patch #979728, written by Mark Russell." #: ../../whatsnew/2.4.rst:341 msgid "https://wiki.python.org/moin/PythonDecoratorLibrary" -msgstr "" +msgstr "https://wiki.python.org/moin/PythonDecoratorLibrary" #: ../../whatsnew/2.4.rst:342 msgid "This Wiki page contains several examples of decorators." -msgstr "" +msgstr "This Wiki page contains several examples of decorators." #: ../../whatsnew/2.4.rst:348 msgid "PEP 322: Reverse Iteration" -msgstr "" +msgstr "PEP 322: Reverse Iteration" #: ../../whatsnew/2.4.rst:350 msgid "" "A new built-in function, ``reversed(seq)``, takes a sequence and returns an " "iterator that loops over the elements of the sequence in reverse order. ::" msgstr "" +"A new built-in function, ``reversed(seq)``, takes a sequence and returns an " +"iterator that loops over the elements of the sequence in reverse order. ::" #: ../../whatsnew/2.4.rst:360 msgid "" "Compared to extended slicing, such as ``range(1,4)[::-1]``, :func:`reversed` " "is easier to read, runs faster, and uses substantially less memory." msgstr "" +"Compared to extended slicing, such as ``range(1,4)[::-1]``, :func:`reversed` " +"is easier to read, runs faster, and uses substantially less memory." #: ../../whatsnew/2.4.rst:363 msgid "" @@ -398,18 +537,21 @@ msgid "" "If you want to reverse an iterator, first convert it to a list with :func:" "`list`. ::" msgstr "" +"Note that :func:`reversed` only accepts sequences, not arbitrary iterators. " +"If you want to reverse an iterator, first convert it to a list with :func:" +"`list`. ::" #: ../../whatsnew/2.4.rst:377 msgid ":pep:`322` - Reverse Iteration" -msgstr "" +msgstr ":pep:`322` - Reverse Iteration" #: ../../whatsnew/2.4.rst:378 msgid "Written and implemented by Raymond Hettinger." -msgstr "" +msgstr "Written and implemented by Raymond Hettinger." #: ../../whatsnew/2.4.rst:384 msgid "PEP 324: New subprocess Module" -msgstr "" +msgstr "PEP 324: New subprocess Module" #: ../../whatsnew/2.4.rst:386 msgid "" @@ -422,6 +564,14 @@ msgid "" "naming is confusing. The :mod:`subprocess` module cleans this up, " "providing a unified interface that offers all the features you might need." msgstr "" +"The standard library provides a number of ways to execute a subprocess, " +"offering different features and different levels of complexity. ``os." +"system(command)`` is easy to use, but slow (it runs a shell process which " +"executes the command) and dangerous (you have to be careful about escaping " +"the shell's metacharacters). The :mod:`!popen2` module offers classes that " +"can capture standard output and standard error from the subprocess, but the " +"naming is confusing. The :mod:`subprocess` module cleans this up, " +"providing a unified interface that offers all the features you might need." #: ../../whatsnew/2.4.rst:395 msgid "" @@ -429,6 +579,9 @@ msgid "" "contains a single class called :class:`subprocess.Popen` whose constructor " "supports a number of different keyword arguments. ::" msgstr "" +"Instead of :mod:`!popen2`'s collection of classes, :mod:`subprocess` " +"contains a single class called :class:`subprocess.Popen` whose constructor " +"supports a number of different keyword arguments. ::" #: ../../whatsnew/2.4.rst:405 msgid "" @@ -437,6 +590,10 @@ msgid "" "*args* can be a string which will then be passed on to the shell for " "interpretation, just as :func:`os.system` does.)" msgstr "" +"*args* is commonly a sequence of strings that will be the arguments to the " +"program executed as the subprocess. (If the *shell* argument is true, " +"*args* can be a string which will then be passed on to the shell for " +"interpretation, just as :func:`os.system` does.)" #: ../../whatsnew/2.4.rst:410 msgid "" @@ -445,37 +602,48 @@ msgid "" "descriptor, or you can use the constant ``subprocess.PIPE`` to create a pipe " "between the subprocess and the parent." msgstr "" +"*stdin*, *stdout*, and *stderr* specify what the subprocess's input, output, " +"and error streams will be. You can provide a file object or a file " +"descriptor, or you can use the constant ``subprocess.PIPE`` to create a pipe " +"between the subprocess and the parent." #: ../../whatsnew/2.4.rst:418 msgid "The constructor has a number of handy options:" -msgstr "" +msgstr "The constructor has a number of handy options:" #: ../../whatsnew/2.4.rst:420 msgid "" "*close_fds* requests that all file descriptors be closed before running the " "subprocess." msgstr "" +"*close_fds* requests that all file descriptors be closed before running the " +"subprocess." #: ../../whatsnew/2.4.rst:423 msgid "" "*cwd* specifies the working directory in which the subprocess will be " "executed (defaulting to whatever the parent's working directory is)." msgstr "" +"*cwd* specifies the working directory in which the subprocess will be " +"executed (defaulting to whatever the parent's working directory is)." #: ../../whatsnew/2.4.rst:426 msgid "*env* is a dictionary specifying environment variables." -msgstr "" +msgstr "*env* is a dictionary specifying environment variables." #: ../../whatsnew/2.4.rst:428 msgid "" "*preexec_fn* is a function that gets called before the child is started." msgstr "" +"*preexec_fn* is a function that gets called before the child is started." #: ../../whatsnew/2.4.rst:430 msgid "" "*universal_newlines* opens the child's input and output using Python's :term:" "`universal newlines` feature." msgstr "" +"*universal_newlines* opens the child's input and output using Python's :term:" +"`universal newlines` feature." #: ../../whatsnew/2.4.rst:433 msgid "" @@ -486,6 +654,12 @@ msgid "" "then reads any data that the subprocess has sent to its standard output or " "standard error, returning a tuple ``(stdout_data, stderr_data)``." msgstr "" +"Once you've created the :class:`Popen` instance, you can call its :meth:" +"`wait` method to pause until the subprocess has exited, :meth:`poll` to " +"check if it's exited without pausing, or ``communicate(data)`` to send the " +"string *data* to the subprocess's standard input. ``communicate(data)`` " +"then reads any data that the subprocess has sent to its standard output or " +"standard error, returning a tuple ``(stdout_data, stderr_data)``." #: ../../whatsnew/2.4.rst:440 msgid "" @@ -494,6 +668,10 @@ msgid "" "status code of the subprocess. It can serve as a safer analog to :func:`os." "system`::" msgstr "" +":func:`call` is a shortcut that passes its arguments along to the :class:" +"`Popen` constructor, waits for the command to complete, and returns the " +"status code of the subprocess. It can serve as a safer analog to :func:`os." +"system`::" #: ../../whatsnew/2.4.rst:452 msgid "" @@ -501,6 +679,9 @@ msgid "" "use the shell, you can add ``shell=True`` as a keyword argument and provide " "a string instead of a sequence::" msgstr "" +"The command is invoked without use of the shell. If you really do want to " +"use the shell, you can add ``shell=True`` as a keyword argument and provide " +"a string instead of a sequence::" #: ../../whatsnew/2.4.rst:458 msgid "" @@ -508,20 +689,25 @@ msgid "" "be translated into Python code that uses :mod:`subprocess`. Reading this " "section of the PEP is highly recommended." msgstr "" +"The PEP takes various examples of shell and Python code and shows how they'd " +"be translated into Python code that uses :mod:`subprocess`. Reading this " +"section of the PEP is highly recommended." #: ../../whatsnew/2.4.rst:465 msgid ":pep:`324` - subprocess - New process module" -msgstr "" +msgstr ":pep:`324` - subprocess - New process module" #: ../../whatsnew/2.4.rst:466 msgid "" "Written and implemented by Peter Åstrand, with assistance from Fredrik Lundh " "and others." msgstr "" +"Written and implemented by Peter Åstrand, with assistance from Fredrik Lundh " +"and others." #: ../../whatsnew/2.4.rst:473 msgid "PEP 327: Decimal Data Type" -msgstr "PEP 327: Tipo de Dados Decimal" +msgstr "PEP 327: Decimal Data Type" #: ../../whatsnew/2.4.rst:475 msgid "" @@ -532,20 +718,28 @@ msgid "" "decimal fractions accurately. The new :class:`Decimal` type can represent " "these fractions accurately, up to a user-specified precision limit." msgstr "" +"Python has always supported floating-point (FP) numbers, based on the " +"underlying C :c:expr:`double` type, as a data type. However, while most " +"programming languages provide a floating-point type, many people (even " +"programmers) are unaware that floating-point numbers don't represent certain " +"decimal fractions accurately. The new :class:`Decimal` type can represent " +"these fractions accurately, up to a user-specified precision limit." #: ../../whatsnew/2.4.rst:484 msgid "Why is Decimal needed?" -msgstr "Por que o Decimal é necessário?" +msgstr "Why is Decimal needed?" #: ../../whatsnew/2.4.rst:486 msgid "" "The limitations arise from the representation used for floating-point " "numbers. FP numbers are made up of three components:" msgstr "" +"The limitations arise from the representation used for floating-point " +"numbers. FP numbers are made up of three components:" #: ../../whatsnew/2.4.rst:489 msgid "The sign, which is positive or negative." -msgstr "" +msgstr "The sign, which is positive or negative." #: ../../whatsnew/2.4.rst:491 msgid "" @@ -553,12 +747,17 @@ msgid "" "fractional part. For example, ``1.01`` in base-2 notation is ``1 + 0/2 + " "1/4``, or 1.25 in decimal notation." msgstr "" +"The mantissa, which is a single-digit binary number followed by a " +"fractional part. For example, ``1.01`` in base-2 notation is ``1 + 0/2 + " +"1/4``, or 1.25 in decimal notation." #: ../../whatsnew/2.4.rst:495 msgid "" "The exponent, which tells where the decimal point is located in the number " "represented." msgstr "" +"The exponent, which tells where the decimal point is located in the number " +"represented." #: ../../whatsnew/2.4.rst:498 msgid "" @@ -568,6 +767,11 @@ msgid "" "because the mantissa is multiplied by 4 (2 to the power of the exponent 2); " "1.25 \\* 4 equals 5." msgstr "" +"For example, the number 1.25 has positive sign, a mantissa value of 1.01 (in " +"binary), and an exponent of 0 (the decimal point doesn't need to be " +"shifted). The number 5 has the same sign and mantissa, but the exponent is 2 " +"because the mantissa is multiplied by 4 (2 to the power of the exponent 2); " +"1.25 \\* 4 equals 5." #: ../../whatsnew/2.4.rst:504 msgid "" @@ -583,10 +787,21 @@ msgid "" "additional terms. IEEE 754 has to chop off that infinitely repeated decimal " "after 52 digits, so the representation is slightly inaccurate." msgstr "" +"Modern systems usually provide floating-point support that conforms to a " +"standard called IEEE 754. C's :c:expr:`double` type is usually implemented " +"as a 64-bit IEEE 754 number, which uses 52 bits of space for the mantissa. " +"This means that numbers can only be specified to 52 bits of precision. If " +"you're trying to represent numbers whose expansion repeats endlessly, the " +"expansion is cut off after 52 bits. Unfortunately, most software needs to " +"produce output in base 10, and common fractions in base 10 are often " +"repeating decimals in binary. For example, 1.1 decimal is binary " +"``1.0001100110011 ...``; .1 = 1/16 + 1/32 + 1/256 plus an infinite number of " +"additional terms. IEEE 754 has to chop off that infinitely repeated decimal " +"after 52 digits, so the representation is slightly inaccurate." #: ../../whatsnew/2.4.rst:516 msgid "Sometimes you can see this inaccuracy when the number is printed::" -msgstr "" +msgstr "Sometimes you can see this inaccuracy when the number is printed::" #: ../../whatsnew/2.4.rst:521 msgid "" @@ -596,6 +811,11 @@ msgid "" "however, the inaccuracy is still there and subsequent operations can magnify " "the error." msgstr "" +"The inaccuracy isn't always visible when you print the number because the FP-" +"to-decimal-string conversion is provided by the C library, and most C " +"libraries try to produce sensible output. Even if it's not displayed, " +"however, the inaccuracy is still there and subsequent operations can magnify " +"the error." #: ../../whatsnew/2.4.rst:526 msgid "" @@ -607,14 +827,21 @@ msgid "" "for applications where it does matter, it's a lot of work to implement your " "own custom arithmetic routines." msgstr "" +"For many applications this doesn't matter. If I'm plotting points and " +"displaying them on my monitor, the difference between 1.1 and " +"1.1000000000000001 is too small to be visible. Reports often limit output " +"to a certain number of decimal places, and if you round the number to two or " +"three or even eight decimal places, the error is never apparent. However, " +"for applications where it does matter, it's a lot of work to implement your " +"own custom arithmetic routines." #: ../../whatsnew/2.4.rst:534 msgid "Hence, the :class:`Decimal` type was created." -msgstr "" +msgstr "Hence, the :class:`Decimal` type was created." #: ../../whatsnew/2.4.rst:538 msgid "The :class:`Decimal` type" -msgstr "" +msgstr "The :class:`Decimal` type" #: ../../whatsnew/2.4.rst:540 msgid "" @@ -624,26 +851,39 @@ msgid "" "used to wrap up various settings such as the precision and default rounding " "mode." msgstr "" - -#: ../../whatsnew/2.4.rst:545 -msgid "" -":class:`Decimal` instances are immutable, like regular Python integers and " +"A new module, :mod:`decimal`, was added to Python's standard library. It " +"contains two classes, :class:`Decimal` and :class:`Context`. :class:" +"`Decimal` instances represent numbers, and :class:`Context` instances are " +"used to wrap up various settings such as the precision and default rounding " +"mode." + +#: ../../whatsnew/2.4.rst:545 +msgid "" +":class:`Decimal` instances are immutable, like regular Python integers and " "FP numbers; once it's been created, you can't change the value an instance " "represents. :class:`Decimal` instances can be created from integers or " "strings::" msgstr "" +":class:`Decimal` instances are immutable, like regular Python integers and " +"FP numbers; once it's been created, you can't change the value an instance " +"represents. :class:`Decimal` instances can be created from integers or " +"strings::" #: ../../whatsnew/2.4.rst:556 msgid "" "You can also provide tuples containing the sign, the mantissa represented " "as a tuple of decimal digits, and the exponent::" msgstr "" +"You can also provide tuples containing the sign, the mantissa represented " +"as a tuple of decimal digits, and the exponent::" #: ../../whatsnew/2.4.rst:562 msgid "" "Cautionary note: the sign bit is a Boolean value, so 0 is positive and 1 is " "negative." msgstr "" +"Cautionary note: the sign bit is a Boolean value, so 0 is positive and 1 is " +"negative." #: ../../whatsnew/2.4.rst:565 msgid "" @@ -654,6 +894,12 @@ msgid "" "convert the floating-point number into a string using the desired precision " "and pass the string to the :class:`Decimal` constructor::" msgstr "" +"Converting from floating-point numbers poses a bit of a problem: should the " +"FP number representing 1.1 turn into the decimal number for exactly 1.1, or " +"for 1.1 plus whatever inaccuracies are introduced? The decision was to dodge " +"the issue and leave such a conversion out of the API. Instead, you should " +"convert the floating-point number into a string using the desired precision " +"and pass the string to the :class:`Decimal` constructor::" #: ../../whatsnew/2.4.rst:578 msgid "" @@ -661,12 +907,17 @@ msgid "" "mathematical operations on them. One limitation: exponentiation requires an " "integer exponent::" msgstr "" +"Once you have :class:`Decimal` instances, you can perform the usual " +"mathematical operations on them. One limitation: exponentiation requires an " +"integer exponent::" #: ../../whatsnew/2.4.rst:599 msgid "" "You can combine :class:`Decimal` instances with integers, but not with " "floating-point numbers::" msgstr "" +"You can combine :class:`Decimal` instances with integers, but not with " +"floating-point numbers::" #: ../../whatsnew/2.4.rst:610 msgid "" @@ -676,6 +927,11 @@ msgid "" "precision and accuracy. You'll also get back a regular floating-point " "number and not a :class:`Decimal`. ::" msgstr "" +":class:`Decimal` numbers can be used with the :mod:`math` and :mod:`cmath` " +"modules, but note that they'll be immediately converted to floating-point " +"numbers before the operation is performed, resulting in a possible loss of " +"precision and accuracy. You'll also get back a regular floating-point " +"number and not a :class:`Decimal`. ::" #: ../../whatsnew/2.4.rst:623 msgid "" @@ -683,20 +939,25 @@ msgid "" "`Decimal`, but if you need other things such as trigonometric functions " "you'll have to implement them. ::" msgstr "" +":class:`Decimal` instances have a :meth:`sqrt` method that returns a :class:" +"`Decimal`, but if you need other things such as trigonometric functions " +"you'll have to implement them. ::" #: ../../whatsnew/2.4.rst:632 msgid "The :class:`Context` type" -msgstr "" +msgstr "The :class:`Context` type" #: ../../whatsnew/2.4.rst:634 msgid "" "Instances of the :class:`Context` class encapsulate several settings for " "decimal operations:" msgstr "" +"Instances of the :class:`Context` class encapsulate several settings for " +"decimal operations:" #: ../../whatsnew/2.4.rst:637 msgid ":attr:`prec` is the precision, the number of decimal places." -msgstr "" +msgstr ":attr:`prec` is the precision, the number of decimal places." #: ../../whatsnew/2.4.rst:639 msgid "" @@ -704,6 +965,9 @@ msgid "" "constants for the various possibilities: :const:`ROUND_DOWN`, :const:" "`ROUND_CEILING`, :const:`ROUND_HALF_EVEN`, and various others." msgstr "" +":attr:`rounding` specifies the rounding mode. The :mod:`decimal` module has " +"constants for the various possibilities: :const:`ROUND_DOWN`, :const:" +"`ROUND_CEILING`, :const:`ROUND_HALF_EVEN`, and various others." #: ../../whatsnew/2.4.rst:643 msgid "" @@ -712,6 +976,10 @@ msgid "" "returned. Some examples of error conditions are division by zero, loss of " "precision, and overflow." msgstr "" +":attr:`traps` is a dictionary specifying what happens on encountering " +"certain error conditions: either an exception is raised or a value is " +"returned. Some examples of error conditions are division by zero, loss of " +"precision, and overflow." #: ../../whatsnew/2.4.rst:648 msgid "" @@ -720,6 +988,10 @@ msgid "" "default precision, rounding, or trap handling. The following example shows " "the effect of changing the precision of the default context::" msgstr "" +"There's a thread-local default context available by calling :func:" +"`getcontext`; you can change the properties of this context to alter the " +"default precision, rounding, or trap handling. The following example shows " +"the effect of changing the precision of the default context::" #: ../../whatsnew/2.4.rst:661 msgid "" @@ -727,42 +999,53 @@ msgid "" "return a special value such as infinity or not-a-number, or exceptions can " "be raised::" msgstr "" +"The default action for error conditions is selectable; the module can either " +"return a special value such as infinity or not-a-number, or exceptions can " +"be raised::" #: ../../whatsnew/2.4.rst:674 msgid "" "The :class:`Context` instance also has various methods for formatting " "numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`." msgstr "" +"The :class:`Context` instance also has various methods for formatting " +"numbers such as :meth:`to_eng_string` and :meth:`to_sci_string`." #: ../../whatsnew/2.4.rst:677 msgid "" "For more information, see the documentation for the :mod:`decimal` module, " "which includes a quick-start tutorial and a reference." msgstr "" +"For more information, see the documentation for the :mod:`decimal` module, " +"which includes a quick-start tutorial and a reference." #: ../../whatsnew/2.4.rst:683 msgid ":pep:`327` - Decimal Data Type" -msgstr "" +msgstr ":pep:`327` - Decimal Data Type" #: ../../whatsnew/2.4.rst:684 msgid "" "Written by Facundo Batista and implemented by Facundo Batista, Eric Price, " "Raymond Hettinger, Aahz, and Tim Peters." msgstr "" +"Written by Facundo Batista and implemented by Facundo Batista, Eric Price, " +"Raymond Hettinger, Aahz, and Tim Peters." #: ../../whatsnew/2.4.rst:687 msgid "http://www.lahey.com/float.htm" -msgstr "" +msgstr "http://www.lahey.com/float.htm" #: ../../whatsnew/2.4.rst:688 msgid "" "The article uses Fortran code to illustrate many of the problems that " "floating-point inaccuracy can cause." msgstr "" +"The article uses Fortran code to illustrate many of the problems that " +"floating-point inaccuracy can cause." #: ../../whatsnew/2.4.rst:691 msgid "http://speleotrove.com/decimal/" -msgstr "" +msgstr "http://speleotrove.com/decimal/" #: ../../whatsnew/2.4.rst:692 msgid "" @@ -771,10 +1054,14 @@ msgid "" "Much of this material was written by Mike Cowlishaw, designer of the Rexx " "language." msgstr "" +"A description of a decimal-based representation. This representation is " +"being proposed as a standard, and underlies the new Python decimal type. " +"Much of this material was written by Mike Cowlishaw, designer of the Rexx " +"language." #: ../../whatsnew/2.4.rst:700 msgid "PEP 328: Multi-line Imports" -msgstr "" +msgstr "PEP 328: Multi-line Imports" #: ../../whatsnew/2.4.rst:702 msgid "" @@ -784,6 +1071,11 @@ msgid "" "sequence is very long, you can either write multiple imports from the same " "module, or you can use backslashes to escape the line endings like this::" msgstr "" +"One language change is a small syntactic tweak aimed at making it easier to " +"import many names from a module. In a ``from module import names`` " +"statement, *names* is a sequence of names separated by commas. If the " +"sequence is very long, you can either write multiple imports from the same " +"module, or you can use backslashes to escape the line endings like this::" #: ../../whatsnew/2.4.rst:713 msgid "" @@ -791,6 +1083,9 @@ msgid "" "parentheses. Python ignores newlines within a parenthesized expression, so " "the backslashes are no longer needed::" msgstr "" +"The syntactic change in Python 2.4 simply allows putting the names within " +"parentheses. Python ignores newlines within a parenthesized expression, so " +"the backslashes are no longer needed::" #: ../../whatsnew/2.4.rst:722 msgid "" @@ -799,6 +1094,10 @@ msgid "" "part of the PEP was not implemented for Python 2.4, but was completed for " "Python 2.5." msgstr "" +"The PEP also proposes that all :keyword:`import` statements be absolute " +"imports, with a leading ``.`` character to indicate a relative import. This " +"part of the PEP was not implemented for Python 2.4, but was completed for " +"Python 2.5." #: ../../whatsnew/2.4.rst:729 msgid ":pep:`328` - Imports: Multi-Line and Absolute/Relative" @@ -806,11 +1105,11 @@ msgstr ":pep:`328` - Importações: Multilinha e absoluta/relativa" #: ../../whatsnew/2.4.rst:730 msgid "Written by Aahz. Multi-line imports were implemented by Dima Dorfman." -msgstr "" +msgstr "Written by Aahz. Multi-line imports were implemented by Dima Dorfman." #: ../../whatsnew/2.4.rst:736 msgid "PEP 331: Locale-Independent Float/String Conversions" -msgstr "" +msgstr "PEP 331: Locale-Independent Float/String Conversions" #: ../../whatsnew/2.4.rst:738 msgid "" @@ -821,6 +1120,12 @@ msgid "" "numeric locale remain set to the ``'C'`` locale. Often this was because the " "code was using the C library's :c:func:`atof` function." msgstr "" +"The :mod:`locale` modules lets Python software select various conversions " +"and display conventions that are localized to a particular country or " +"language. However, the module was careful to not change the numeric locale " +"because various functions in Python's implementation required that the " +"numeric locale remain set to the ``'C'`` locale. Often this was because the " +"code was using the C library's :c:func:`atof` function." #: ../../whatsnew/2.4.rst:745 msgid "" @@ -829,24 +1134,34 @@ msgid "" "set. The motivating example was GTK+, whose user interface widgets weren't " "displaying numbers in the current locale." msgstr "" +"Not setting the numeric locale caused trouble for extensions that used third-" +"party C libraries, however, because they wouldn't have the correct locale " +"set. The motivating example was GTK+, whose user interface widgets weren't " +"displaying numbers in the current locale." #: ../../whatsnew/2.4.rst:750 msgid "" "The solution described in the PEP is to add three new functions to the " "Python API that perform ASCII-only conversions, ignoring the locale setting:" msgstr "" +"The solution described in the PEP is to add three new functions to the " +"Python API that perform ASCII-only conversions, ignoring the locale setting:" #: ../../whatsnew/2.4.rst:753 msgid "" "``PyOS_ascii_strtod(str, ptr)`` and ``PyOS_ascii_atof(str, ptr)`` both " "convert a string to a C :c:expr:`double`." msgstr "" +"``PyOS_ascii_strtod(str, ptr)`` and ``PyOS_ascii_atof(str, ptr)`` both " +"convert a string to a C :c:expr:`double`." #: ../../whatsnew/2.4.rst:756 msgid "" "``PyOS_ascii_formatd(buffer, buf_len, format, d)`` converts a :c:expr:" "`double` to an ASCII string." msgstr "" +"``PyOS_ascii_formatd(buffer, buf_len, format, d)`` converts a :c:expr:" +"`double` to an ASCII string." #: ../../whatsnew/2.4.rst:759 msgid "" @@ -856,14 +1171,19 @@ msgid "" "`locale` module can now change the numeric locale, letting extensions such " "as GTK+ produce the correct results." msgstr "" +"The code for these functions came from the GLib library (https://developer-" +"old.gnome.org/glib/2.26/), whose developers kindly relicensed the relevant " +"functions and donated them to the Python Software Foundation. The :mod:" +"`locale` module can now change the numeric locale, letting extensions such " +"as GTK+ produce the correct results." #: ../../whatsnew/2.4.rst:768 msgid ":pep:`331` - Locale-Independent Float/String Conversions" -msgstr "" +msgstr ":pep:`331` - Locale-Independent Float/String Conversions" #: ../../whatsnew/2.4.rst:769 msgid "Written by Christian R. Reis, and implemented by Gustavo Carneiro." -msgstr "" +msgstr "Written by Christian R. Reis, and implemented by Gustavo Carneiro." #: ../../whatsnew/2.4.rst:775 msgid "Other Language Changes" @@ -874,32 +1194,40 @@ msgid "" "Here are all of the changes that Python 2.4 makes to the core Python " "language." msgstr "" +"Here are all of the changes that Python 2.4 makes to the core Python " +"language." #: ../../whatsnew/2.4.rst:779 msgid "Decorators for functions and methods were added (:pep:`318`)." -msgstr "" +msgstr "Decorators for functions and methods were added (:pep:`318`)." #: ../../whatsnew/2.4.rst:781 msgid "" "Built-in :func:`set` and :func:`frozenset` types were added (:pep:`218`). " "Other new built-ins include the ``reversed(seq)`` function (:pep:`322`)." msgstr "" +"Built-in :func:`set` and :func:`frozenset` types were added (:pep:`218`). " +"Other new built-ins include the ``reversed(seq)`` function (:pep:`322`)." #: ../../whatsnew/2.4.rst:784 msgid "Generator expressions were added (:pep:`289`)." -msgstr "" +msgstr "Generator expressions were added (:pep:`289`)." #: ../../whatsnew/2.4.rst:786 msgid "" "Certain numeric expressions no longer return values restricted to 32 or 64 " "bits (:pep:`237`)." msgstr "" +"Certain numeric expressions no longer return values restricted to 32 or 64 " +"bits (:pep:`237`)." #: ../../whatsnew/2.4.rst:789 msgid "" "You can now put parentheses around the list of names in a ``from module " "import names`` statement (:pep:`328`)." msgstr "" +"You can now put parentheses around the list of names in a ``from module " +"import names`` statement (:pep:`328`)." #: ../../whatsnew/2.4.rst:792 msgid "" @@ -907,6 +1235,9 @@ msgid "" "class:`dict` constructor. This includes any mapping, any iterable of key/" "value pairs, and keyword arguments. (Contributed by Raymond Hettinger.)" msgstr "" +"The :meth:`dict.update` method now accepts the same argument forms as the :" +"class:`dict` constructor. This includes any mapping, any iterable of key/" +"value pairs, and keyword arguments. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:796 msgid "" @@ -914,6 +1245,9 @@ msgid "" "an optional argument for specifying a fill character other than a space. " "(Contributed by Raymond Hettinger.)" msgstr "" +"The string methods :meth:`ljust`, :meth:`rjust`, and :meth:`center` now take " +"an optional argument for specifying a fill character other than a space. " +"(Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:800 msgid "" @@ -921,6 +1255,9 @@ msgid "" "`split` method but splits from the end of the string. (Contributed by Sean " "Reifschneider.) ::" msgstr "" +"Strings also gained an :meth:`rsplit` method that works like the :meth:" +"`split` method but splits from the end of the string. (Contributed by Sean " +"Reifschneider.) ::" #: ../../whatsnew/2.4.rst:809 msgid "" @@ -928,6 +1265,9 @@ msgid "" "meth:`sort` method of lists. These parameters make some common usages of :" "meth:`sort` simpler. All of these parameters are optional." msgstr "" +"Three keyword parameters, *cmp*, *key*, and *reverse*, were added to the :" +"meth:`sort` method of lists. These parameters make some common usages of :" +"meth:`sort` simpler. All of these parameters are optional." #: ../../whatsnew/2.4.rst:813 msgid "" @@ -937,6 +1277,11 @@ msgid "" "Previously this was the only parameter that could be provided to :meth:" "`sort`." msgstr "" +"For the *cmp* parameter, the value should be a comparison function that " +"takes two parameters and returns -1, 0, or +1 depending on how the " +"parameters compare. This function will then be used to sort the list. " +"Previously this was the only parameter that could be provided to :meth:" +"`sort`." #: ../../whatsnew/2.4.rst:818 msgid "" @@ -944,6 +1289,9 @@ msgid "" "returns a comparison key for the element. The list is then sorted using the " "comparison keys. The following example sorts a list case-insensitively::" msgstr "" +"*key* should be a single-parameter function that takes a list element and " +"returns a comparison key for the element. The list is then sorted using the " +"comparison keys. The following example sorts a list case-insensitively::" #: ../../whatsnew/2.4.rst:835 msgid "" @@ -953,6 +1301,11 @@ msgid "" "the list while using *cmp* will call it twice for each comparison, so using " "*key* saves on invocations of the :meth:`lower` method." msgstr "" +"The last example, which uses the *cmp* parameter, is the old way to perform " +"a case-insensitive sort. It works but is slower than using a *key* " +"parameter. Using *key* calls :meth:`lower` method once for each element in " +"the list while using *cmp* will call it twice for each comparison, so using " +"*key* saves on invocations of the :meth:`lower` method." #: ../../whatsnew/2.4.rst:841 msgid "" @@ -960,6 +1313,9 @@ msgid "" "avoid a :keyword:`lambda` expression by using an unbound method instead. " "For example, the above case-insensitive sort is best written as::" msgstr "" +"For simple key functions and comparison functions, it is often possible to " +"avoid a :keyword:`lambda` expression by using an unbound method instead. " +"For example, the above case-insensitive sort is best written as::" #: ../../whatsnew/2.4.rst:849 msgid "" @@ -967,6 +1323,9 @@ msgid "" "true, the list will be sorted into reverse order. Instead of ``L.sort(); L." "reverse()``, you can now write ``L.sort(reverse=True)``." msgstr "" +"Finally, the *reverse* parameter takes a Boolean value. If the value is " +"true, the list will be sorted into reverse order. Instead of ``L.sort(); L." +"reverse()``, you can now write ``L.sort(reverse=True)``." #: ../../whatsnew/2.4.rst:853 msgid "" @@ -976,10 +1335,15 @@ msgid "" "list by age, resulting in a list sorted by age where people with the same " "age are in name-sorted order." msgstr "" +"The results of sorting are now guaranteed to be stable. This means that two " +"entries with equal keys will be returned in the same order as they were " +"input. For example, you can sort a list of people by name, and then sort the " +"list by age, resulting in a list sorted by age where people with the same " +"age are in name-sorted order." #: ../../whatsnew/2.4.rst:859 msgid "(All changes to :meth:`sort` contributed by Raymond Hettinger.)" -msgstr "" +msgstr "(All changes to :meth:`sort` contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:861 msgid "" @@ -987,18 +1351,21 @@ msgid "" "place :meth:`list.sort` method but can be used in expressions. The " "differences are:" msgstr "" +"There is a new built-in function ``sorted(iterable)`` that works like the in-" +"place :meth:`list.sort` method but can be used in expressions. The " +"differences are:" #: ../../whatsnew/2.4.rst:865 msgid "the input may be any iterable;" -msgstr "" +msgstr "the input may be any iterable;" #: ../../whatsnew/2.4.rst:867 msgid "a newly formed copy is sorted, leaving the original intact; and" -msgstr "" +msgstr "a newly formed copy is sorted, leaving the original intact; and" #: ../../whatsnew/2.4.rst:869 msgid "the expression returns the new sorted copy" -msgstr "" +msgstr "the expression returns the new sorted copy" #: ../../whatsnew/2.4.rst:892 ../../whatsnew/2.4.rst:920 #: ../../whatsnew/2.4.rst:1213 @@ -1010,6 +1377,8 @@ msgid "" "Integer operations will no longer trigger an :exc:`OverflowWarning`. The :" "exc:`OverflowWarning` warning will disappear in Python 2.5." msgstr "" +"Integer operations will no longer trigger an :exc:`OverflowWarning`. The :" +"exc:`OverflowWarning` warning will disappear in Python 2.5." #: ../../whatsnew/2.4.rst:897 msgid "" @@ -1018,6 +1387,10 @@ msgid "" "as a script. For example, you can now run the Python profiler with ``python " "-m profile``. (Contributed by Nick Coghlan.)" msgstr "" +"The interpreter gained a new switch, :option:`-m`, that takes a name, " +"searches for the corresponding module on ``sys.path``, and runs the module " +"as a script. For example, you can now run the Python profiler with ``python " +"-m profile``. (Contributed by Nick Coghlan.)" #: ../../whatsnew/2.4.rst:902 msgid "" @@ -1026,6 +1399,10 @@ msgid "" "for the *locals* parameter. Previously this had to be a regular Python " "dictionary. (Contributed by Raymond Hettinger.)" msgstr "" +"The ``eval(expr, globals, locals)`` and ``execfile(filename, globals, " +"locals)`` functions and the ``exec`` statement now accept any mapping type " +"for the *locals* parameter. Previously this had to be a regular Python " +"dictionary. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:907 msgid "" @@ -1034,6 +1411,10 @@ msgid "" "`TypeError` exception. This makes them more suitable for use with variable " "length argument lists::" msgstr "" +"The :func:`zip` built-in function and :func:`itertools.izip` now return an " +"empty list if called with no arguments. Previously they raised a :exc:" +"`TypeError` exception. This makes them more suitable for use with variable " +"length argument lists::" #: ../../whatsnew/2.4.rst:922 msgid "" @@ -1042,12 +1423,18 @@ msgid "" "left behind would fool further imports of the same module into succeeding, " "leading to confusing errors. (Fixed by Tim Peters.)" msgstr "" +"Encountering a failure while importing a module no longer leaves a partially " +"initialized module object in ``sys.modules``. The incomplete module object " +"left behind would fool further imports of the same module into succeeding, " +"leading to confusing errors. (Fixed by Tim Peters.)" #: ../../whatsnew/2.4.rst:927 msgid "" ":const:`None` is now a constant; code that binds a new value to the name " "``None`` is now a syntax error. (Contributed by Raymond Hettinger.)" msgstr "" +":const:`None` is now a constant; code that binds a new value to the name " +"``None`` is now a syntax error. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:934 msgid "Optimizations" @@ -1061,6 +1448,11 @@ msgid "" "`items`, :meth:`iterkeys`, :meth:`itervalues`, and :meth:`iteritems`. " "(Contributed by Raymond Hettinger.)" msgstr "" +"The inner loops for list and tuple slicing were optimized and now run about " +"one-third faster. The inner loops for dictionaries were also optimized, " +"resulting in performance boosts for :meth:`keys`, :meth:`values`, :meth:" +"`items`, :meth:`iterkeys`, :meth:`itervalues`, and :meth:`iteritems`. " +"(Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:942 msgid "" @@ -1071,6 +1463,12 @@ msgid "" "was also optimized and no longer converts its argument into a temporary list " "before extending the base list. (Contributed by Raymond Hettinger.)" msgstr "" +"The machinery for growing and shrinking lists was optimized for speed and " +"for space efficiency. Appending and popping from lists now runs faster due " +"to more efficient code paths and less frequent use of the underlying system :" +"c:func:`realloc`. List comprehensions also benefit. :meth:`list.extend` " +"was also optimized and no longer converts its argument into a temporary list " +"before extending the base list. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:949 msgid "" @@ -1078,6 +1476,9 @@ msgid "" "now run several times faster with non-sequence arguments that supply a :meth:" "`__len__` method. (Contributed by Raymond Hettinger.)" msgstr "" +":func:`list`, :func:`tuple`, :func:`map`, :func:`filter`, and :func:`zip` " +"now run several times faster with non-sequence arguments that supply a :meth:" +"`__len__` method. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:953 msgid "" @@ -1088,6 +1489,12 @@ msgid "" "arguments to functionals: ``map(mydict.__getitem__, keylist)``. (Contributed " "by Raymond Hettinger.)" msgstr "" +"The methods :meth:`list.__getitem__`, :meth:`dict.__getitem__`, and :meth:" +"`dict.__contains__` are now implemented as :class:`method_descriptor` " +"objects rather than :class:`wrapper_descriptor` objects. This form of " +"access doubles their performance and makes them more suitable for use as " +"arguments to functionals: ``map(mydict.__getitem__, keylist)``. (Contributed " +"by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:960 msgid "" @@ -1095,6 +1502,9 @@ msgid "" "for list comprehensions and speeds them up by about a third. (Contributed " "by Raymond Hettinger.)" msgstr "" +"Added a new opcode, ``LIST_APPEND``, that simplifies the generated bytecode " +"for list comprehensions and speeds them up by about a third. (Contributed " +"by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:964 msgid "" @@ -1102,6 +1512,9 @@ msgid "" "faster bytecode; remarkably, the resulting bytecode is more readable. " "(Enhanced by Raymond Hettinger.)" msgstr "" +"The peephole bytecode optimizer has been improved to produce shorter, " +"faster bytecode; remarkably, the resulting bytecode is more readable. " +"(Enhanced by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:968 msgid "" @@ -1112,6 +1525,12 @@ msgid "" "strings is still recommended when you want to efficiently glue a large " "number of strings together. (Contributed by Armin Rigo.)" msgstr "" +"String concatenations in statements of the form ``s = s + \"abc\"`` and ``s " +"+= \"abc\"`` are now performed more efficiently in certain circumstances. " +"This optimization won't be present in other Python implementations such as " +"Jython, so you shouldn't rely on it; using the :meth:`join` method of " +"strings is still recommended when you want to efficiently glue a large " +"number of strings together. (Contributed by Armin Rigo.)" #: ../../whatsnew/2.4.rst:975 msgid "" @@ -1121,6 +1540,11 @@ msgid "" "used measurement of Python's performance. Your own applications may show " "greater or smaller benefits from Python 2.4.)" msgstr "" +"The net result of the 2.4 optimizations is that Python 2.4 runs the pystone " +"benchmark around 5% faster than Python 2.3 and 35% faster than Python 2.2. " +"(pystone is not a particularly good benchmark, but it's the most commonly " +"used measurement of Python's performance. Your own applications may show " +"greater or smaller benefits from Python 2.4.)" #: ../../whatsnew/2.4.rst:991 msgid "New, Improved, and Deprecated Modules" @@ -1134,6 +1558,11 @@ msgid "" "source tree for a more complete list of changes, or look through the CVS " "logs for all the details." msgstr "" +"As usual, Python's standard library received a number of enhancements and " +"bug fixes. Here's a partial list of the most notable changes, sorted " +"alphabetically by module name. Consult the :file:`Misc/NEWS` file in the " +"source tree for a more complete list of changes, or look through the CVS " +"logs for all the details." #: ../../whatsnew/2.4.rst:998 msgid "" @@ -1141,6 +1570,9 @@ msgid "" "parameter that lets you perform a limited number of passes through the " "polling loop. The default is still to loop forever." msgstr "" +"The :mod:`!asyncore` module's :func:`!loop` function now has a *count* " +"parameter that lets you perform a limited number of passes through the " +"polling loop. The default is still to loop forever." #: ../../whatsnew/2.4.rst:1002 msgid "" @@ -1148,46 +1580,57 @@ msgid "" "Base64, Base32, and Base16 encoding and decoding, including optional case " "folding and optional alternative alphabets. (Contributed by Barry Warsaw.)" msgstr "" +"The :mod:`base64` module now has more complete :rfc:`3548` support for " +"Base64, Base32, and Base16 encoding and decoding, including optional case " +"folding and optional alternative alphabets. (Contributed by Barry Warsaw.)" #: ../../whatsnew/2.4.rst:1006 msgid "" "The :mod:`bisect` module now has an underlying C implementation for improved " "performance. (Contributed by Dmitry Vasiliev.)" msgstr "" +"The :mod:`bisect` module now has an underlying C implementation for improved " +"performance. (Contributed by Dmitry Vasiliev.)" #: ../../whatsnew/2.4.rst:1009 msgid "" "The CJKCodecs collections of East Asian codecs, maintained by Hye-Shik " "Chang, was integrated into 2.4. The new encodings are:" msgstr "" +"The CJKCodecs collections of East Asian codecs, maintained by Hye-Shik " +"Chang, was integrated into 2.4. The new encodings are:" #: ../../whatsnew/2.4.rst:1012 msgid "Chinese (PRC): gb2312, gbk, gb18030, big5hkscs, hz" -msgstr "" +msgstr "Chinese (PRC): gb2312, gbk, gb18030, big5hkscs, hz" #: ../../whatsnew/2.4.rst:1014 msgid "Chinese (ROC): big5, cp950" -msgstr "" +msgstr "Chinese (ROC): big5, cp950" #: ../../whatsnew/2.4.rst:1016 msgid "Japanese: cp932, euc-jis-2004, euc-jp, euc-jisx0213, iso-2022-jp," -msgstr "" +msgstr "Japanese: cp932, euc-jis-2004, euc-jp, euc-jisx0213, iso-2022-jp," #: ../../whatsnew/2.4.rst:1017 msgid "" "iso-2022-jp-1, iso-2022-jp-2, iso-2022-jp-3, iso-2022-jp-ext, iso-2022-" "jp-2004, shift-jis, shift-jisx0213, shift-jis-2004" msgstr "" +"iso-2022-jp-1, iso-2022-jp-2, iso-2022-jp-3, iso-2022-jp-ext, iso-2022-" +"jp-2004, shift-jis, shift-jisx0213, shift-jis-2004" #: ../../whatsnew/2.4.rst:1020 msgid "Korean: cp949, euc-kr, johab, iso-2022-kr" -msgstr "" +msgstr "Korean: cp949, euc-kr, johab, iso-2022-kr" #: ../../whatsnew/2.4.rst:1022 msgid "" "Some other new encodings were added: HP Roman8, ISO_8859-11, ISO_8859-16, " "PCTP-154, and TIS-620." msgstr "" +"Some other new encodings were added: HP Roman8, ISO_8859-11, ISO_8859-16, " +"PCTP-154, and TIS-620." #: ../../whatsnew/2.4.rst:1025 msgid "" @@ -1197,6 +1640,11 @@ msgid "" "method will now return as much data as it can and future calls will resume " "decoding where previous ones left off. (Implemented by Walter Dörwald.)" msgstr "" +"The UTF-8 and UTF-16 codecs now cope better with receiving partial input. " +"Previously the :class:`StreamReader` class would try to read more data, " +"making it impossible to resume decoding from the stream. The :meth:`read` " +"method will now return as much data as it can and future calls will resume " +"decoding where previous ones left off. (Implemented by Walter Dörwald.)" #: ../../whatsnew/2.4.rst:1031 msgid "" @@ -1205,6 +1653,10 @@ msgid "" "ended queue that supports efficiently adding and removing elements from " "either end::" msgstr "" +"There is a new :mod:`collections` module for various specialized collection " +"datatypes. Currently it contains just one type, :class:`deque`, a double-" +"ended queue that supports efficiently adding and removing elements from " +"either end::" #: ../../whatsnew/2.4.rst:1051 msgid "" @@ -1212,6 +1664,9 @@ msgid "" "take advantage of :class:`collections.deque` for improved performance. " "(Contributed by Raymond Hettinger.)" msgstr "" +"Several modules, such as the :mod:`Queue` and :mod:`threading` modules, now " +"take advantage of :class:`collections.deque` for improved performance. " +"(Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:1055 msgid "" @@ -1222,14 +1677,24 @@ msgid "" "argument that isn't a string. (Contributed by John Belmonte and David " "Goodger.)" msgstr "" - -#: ../../whatsnew/2.4.rst:1060 -msgid "" -"The :mod:`curses` module now supports the ncurses extension :func:" +"The :mod:`ConfigParser ` classes have been enhanced slightly. " +"The :meth:`~configparser.ConfigParser.read` method now returns a list of the " +"files that were successfully parsed, and the :meth:`~configparser." +"ConfigParser.set` method raises :exc:`TypeError` if passed a *value* " +"argument that isn't a string. (Contributed by John Belmonte and David " +"Goodger.)" + +#: ../../whatsnew/2.4.rst:1060 +msgid "" +"The :mod:`curses` module now supports the ncurses extension :func:" "`use_default_colors`. On platforms where the terminal supports " "transparency, this makes it possible to use a transparent background. " "(Contributed by Jörg Lehmann.)" msgstr "" +"The :mod:`curses` module now supports the ncurses extension :func:" +"`use_default_colors`. On platforms where the terminal supports " +"transparency, this makes it possible to use a transparent background. " +"(Contributed by Jörg Lehmann.)" #: ../../whatsnew/2.4.rst:1065 msgid "" @@ -1237,6 +1702,9 @@ msgid "" "creates an HTML table showing a side by side comparison of two versions of a " "text. (Contributed by Dan Gass.)" msgstr "" +"The :mod:`difflib` module now includes an :class:`HtmlDiff` class that " +"creates an HTML table showing a side by side comparison of two versions of a " +"text. (Contributed by Dan Gass.)" #: ../../whatsnew/2.4.rst:1069 msgid "" @@ -1249,6 +1717,14 @@ msgid "" "the :attr:`defect` attribute of the message. (Developed by Anthony Baxter, " "Barry Warsaw, Thomas Wouters, and others.)" msgstr "" +"The :mod:`email` package was updated to version 3.0, which dropped various " +"deprecated APIs and removes support for Python versions earlier than 2.3. " +"The 3.0 version of the package uses a new incremental parser for MIME " +"messages, available in the :mod:`email.FeedParser` module. The new parser " +"doesn't require reading the entire message into memory, and doesn't raise " +"exceptions if a message is malformed; instead it records any problems in " +"the :attr:`defect` attribute of the message. (Developed by Anthony Baxter, " +"Barry Warsaw, Thomas Wouters, and others.)" #: ../../whatsnew/2.4.rst:1078 msgid "" @@ -1259,6 +1735,12 @@ msgid "" "a dataset without the expense of a full sort. (Contributed by Raymond " "Hettinger.)" msgstr "" +"The :mod:`heapq` module has been converted to C. The resulting tenfold " +"improvement in speed makes the module suitable for handling high volumes of " +"data. In addition, the module has two new functions :func:`nlargest` and :" +"func:`nsmallest` that use heaps to find the N largest or smallest values in " +"a dataset without the expense of a full sort. (Contributed by Raymond " +"Hettinger.)" #: ../../whatsnew/2.4.rst:1084 msgid "" @@ -1268,6 +1750,11 @@ msgid "" "`MOVED_PERMANENTLY`; use pydoc to get a full list. (Contributed by Andrew " "Eland.)" msgstr "" +"The :mod:`httplib ` module now contains constants for HTTP status " +"codes defined in various HTTP-related RFC documents. Constants have names " +"such as :const:`OK`, :const:`CREATED`, :const:`CONTINUE`, and :const:" +"`MOVED_PERMANENTLY`; use pydoc to get a full list. (Contributed by Andrew " +"Eland.)" #: ../../whatsnew/2.4.rst:1090 msgid "" @@ -1275,6 +1762,9 @@ msgid "" "Yves Dionne) and new :meth:`deleteacl` and :meth:`myrights` methods " "(contributed by Arnaud Mazin)." msgstr "" +"The :mod:`imaplib` module now supports IMAP's THREAD command (contributed by " +"Yves Dionne) and new :meth:`deleteacl` and :meth:`myrights` methods " +"(contributed by Arnaud Mazin)." #: ../../whatsnew/2.4.rst:1094 msgid "" @@ -1286,6 +1776,13 @@ msgid "" "which have matching values of the key, and returns a series of 2-tuples " "containing the key value and an iterator over the subsequence." msgstr "" +"The :mod:`itertools` module gained a ``groupby(iterable[, *func*])`` " +"function. *iterable* is something that can be iterated over to return a " +"stream of elements, and the optional *func* parameter is a function that " +"takes an element and returns a key value; if omitted, the key is simply the " +"element itself. :func:`groupby` then groups the elements into subsequences " +"which have matching values of the key, and returns a series of 2-tuples " +"containing the key value and an iterator over the subsequence." #: ../../whatsnew/2.4.rst:1102 msgid "" @@ -1293,6 +1790,9 @@ msgid "" "whether a number is even or odd, so the result of :func:`groupby` is to " "return consecutive runs of odd or even numbers. ::" msgstr "" +"Here's an example to make this clearer. The *key* function simply returns " +"whether a number is even or odd, so the result of :func:`groupby` is to " +"return consecutive runs of odd or even numbers. ::" #: ../../whatsnew/2.4.rst:1118 msgid "" @@ -1300,10 +1800,13 @@ msgid "" "`groupby` is similar to the Unix ``uniq`` filter which makes it handy for " "eliminating, counting, or identifying duplicate elements::" msgstr "" +":func:`groupby` is typically used with sorted input. The logic for :func:" +"`groupby` is similar to the Unix ``uniq`` filter which makes it handy for " +"eliminating, counting, or identifying duplicate elements::" #: ../../whatsnew/2.4.rst:1141 msgid "(Contributed by Hye-Shik Chang.)" -msgstr "" +msgstr "(Contributed by Hye-Shik Chang.)" #: ../../whatsnew/2.4.rst:1143 msgid "" @@ -1311,6 +1814,9 @@ msgid "" "returns *N* independent iterators that replicate *iterator*. If *N* is " "omitted, the default is 2. ::" msgstr "" +":mod:`itertools` also gained a function named ``tee(iterator, N)`` that " +"returns *N* independent iterators that replicate *iterator*. If *N* is " +"omitted, the default is 2. ::" #: ../../whatsnew/2.4.rst:1156 msgid "" @@ -1323,6 +1829,14 @@ msgid "" "include bookmarking, windowing, or lookahead iterators. (Contributed by " "Raymond Hettinger.)" msgstr "" +"Note that :func:`tee` has to keep copies of the values returned by the " +"iterator; in the worst case, it may need to keep all of them. This should " +"therefore be used carefully if the leading iterator can run far ahead of the " +"trailing iterator in a long stream of inputs. If the separation is large, " +"then you might as well use :func:`list` instead. When the iterators track " +"closely with one another, :func:`tee` is ideal. Possible applications " +"include bookmarking, windowing, or lookahead iterators. (Contributed by " +"Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:1165 msgid "" @@ -1331,6 +1845,10 @@ msgid "" "func:`!l\\*gettext` functions that return messages in the chosen encoding. " "(Contributed by Gustavo Niemeyer.)" msgstr "" +"A number of functions were added to the :mod:`locale` module, such as :func:" +"`bind_textdomain_codeset` to specify a particular encoding and a family of :" +"func:`!l\\*gettext` functions that return messages in the chosen encoding. " +"(Contributed by Gustavo Niemeyer.)" #: ../../whatsnew/2.4.rst:1170 msgid "" @@ -1340,6 +1858,11 @@ msgid "" "specified to log to a particular file, change the logging format, or set the " "logging level. For example::" msgstr "" +"Some keyword arguments were added to the :mod:`logging` package's :func:" +"`basicConfig` function to simplify log configuration. The default behavior " +"is to log messages to standard error, but various keyword arguments can be " +"specified to log to a particular file, change the logging format, or set the " +"logging level. For example::" #: ../../whatsnew/2.4.rst:1181 msgid "" @@ -1350,10 +1873,16 @@ msgid "" "certain size. Both classes derive from a new :class:`BaseRotatingHandler` " "class that can be used to implement other rotating handlers." msgstr "" +"Other additions to the :mod:`logging` package include a ``log(level, msg)`` " +"convenience method, as well as a :class:`TimedRotatingFileHandler` class " +"that rotates its log files at a timed interval. The module already had :" +"class:`RotatingFileHandler`, which rotated logs once the file exceeded a " +"certain size. Both classes derive from a new :class:`BaseRotatingHandler` " +"class that can be used to implement other rotating handlers." #: ../../whatsnew/2.4.rst:1188 msgid "(Changes implemented by Vinay Sajip.)" -msgstr "" +msgstr "(Changes implemented by Vinay Sajip.)" #: ../../whatsnew/2.4.rst:1190 msgid "" @@ -1362,6 +1891,10 @@ msgid "" "primary effect is to make :file:`.pyc` files significantly smaller. " "(Contributed by Martin von Löwis.)" msgstr "" +"The :mod:`marshal` module now shares interned strings on unpacking a data " +"structure. This may shrink the size of certain pickle strings, but the " +"primary effect is to make :file:`.pyc` files significantly smaller. " +"(Contributed by Martin von Löwis.)" #: ../../whatsnew/2.4.rst:1195 msgid "" @@ -1378,6 +1911,11 @@ msgid "" "or item; these callables make excellent data extractors when used with :func:" "`map` or :func:`sorted`. For example::" msgstr "" +"Two new functions were added to the :mod:`operator` module, " +"``attrgetter(attr)`` and ``itemgetter(index)``. Both functions return " +"callables that take a single argument and return the corresponding attribute " +"or item; these callables make excellent data extractors when used with :func:" +"`map` or :func:`sorted`. For example::" #: ../../whatsnew/2.4.rst:1215 msgid "" @@ -1387,6 +1925,11 @@ msgid "" "can now include the string ``'%default'``, which will be replaced by the " "option's default value. (Contributed by Greg Ward.)" msgstr "" +"The :mod:`optparse` module was updated in various ways. The module now " +"passes its messages through :func:`gettext.gettext`, making it possible to " +"internationalize Optik's help and error messages. Help messages for options " +"can now include the string ``'%default'``, which will be replaced by the " +"option's default value. (Contributed by Greg Ward.)" #: ../../whatsnew/2.4.rst:1221 msgid "" @@ -1397,6 +1940,12 @@ msgid "" "want to write new e-mail processing code with this in mind. (Change " "implemented by Anthony Baxter.)" msgstr "" +"The long-term plan is to deprecate the :mod:`!rfc822` module in some future " +"Python release in favor of the :mod:`email` package. To this end, the :func:" +"`email.Utils.formatdate ` function has been changed " +"to make it usable as a replacement for :func:`!rfc822.formatdate`. You may " +"want to write new e-mail processing code with this in mind. (Change " +"implemented by Anthony Baxter.)" #: ../../whatsnew/2.4.rst:1227 msgid "" @@ -1405,6 +1954,10 @@ msgid "" "to platform-specific sources of randomness such as :file:`/dev/urandom` on " "Linux or the Windows CryptoAPI. (Contributed by Trevor Perrin.)" msgstr "" +"A new ``urandom(n)`` function was added to the :mod:`os` module, returning a " +"string containing *n* bytes of random data. This function provides access " +"to platform-specific sources of randomness such as :file:`/dev/urandom` on " +"Linux or the Windows CryptoAPI. (Contributed by Trevor Perrin.)" #: ../../whatsnew/2.4.rst:1232 msgid "" @@ -1414,24 +1967,35 @@ msgid "" "false if *path* is a symlink that points to a destination that doesn't " "exist. (Contributed by Beni Cherniavsky.)" msgstr "" +"Another new function: ``os.path.lexists(path)`` returns true if the file " +"specified by *path* exists, whether or not it's a symbolic link. This " +"differs from the existing ``os.path.exists(path)`` function, which returns " +"false if *path* is a symlink that points to a destination that doesn't " +"exist. (Contributed by Beni Cherniavsky.)" #: ../../whatsnew/2.4.rst:1238 msgid "" "A new :func:`getsid` function was added to the :mod:`posix` module that " "underlies the :mod:`os` module. (Contributed by J. Raynor.)" msgstr "" +"A new :func:`getsid` function was added to the :mod:`posix` module that " +"underlies the :mod:`os` module. (Contributed by J. Raynor.)" #: ../../whatsnew/2.4.rst:1241 msgid "" "The :mod:`poplib` module now supports POP over SSL. (Contributed by Hector " "Urtubia.)" msgstr "" +"The :mod:`poplib` module now supports POP over SSL. (Contributed by Hector " +"Urtubia.)" #: ../../whatsnew/2.4.rst:1244 msgid "" "The :mod:`profile` module can now profile C extension functions. " "(Contributed by Nick Bastin.)" msgstr "" +"The :mod:`profile` module can now profile C extension functions. " +"(Contributed by Nick Bastin.)" #: ../../whatsnew/2.4.rst:1247 msgid "" @@ -1441,6 +2005,11 @@ msgid "" "arbitrarily large random numbers more efficient. (Contributed by Raymond " "Hettinger.)" msgstr "" +"The :mod:`random` module has a new method called ``getrandbits(N)`` that " +"returns a long integer *N* bits in length. The existing :meth:`randrange` " +"method now uses :meth:`getrandbits` where appropriate, making generation of " +"arbitrarily large random numbers more efficient. (Contributed by Raymond " +"Hettinger.)" #: ../../whatsnew/2.4.rst:1253 msgid "" @@ -1452,6 +2021,13 @@ msgid "" "group didn't match, the pattern *B* will be used instead. (Contributed by " "Gustavo Niemeyer.)" msgstr "" +"The regular expression language accepted by the :mod:`re` module was " +"extended with simple conditional expressions, written as ``(?(group)A|B)``. " +"*group* is either a numeric group ID or a group name defined with ``(?" +"P...)`` earlier in the expression. If the specified group matched, " +"the regular expression pattern *A* will be tested against the string; if the " +"group didn't match, the pattern *B* will be used instead. (Contributed by " +"Gustavo Niemeyer.)" #: ../../whatsnew/2.4.rst:1260 msgid "" @@ -1466,6 +2042,16 @@ msgid "" "Python 2.4's regular expression engine can match this pattern without " "problems." msgstr "" +"The :mod:`re` module is also no longer recursive, thanks to a massive amount " +"of work by Gustavo Niemeyer. In a recursive regular expression engine, " +"certain patterns result in a large amount of C stack space being consumed, " +"and it was possible to overflow the stack. For example, if you matched a " +"30000-byte string of ``a`` characters against the expression ``(a|b)+``, one " +"stack frame was consumed per character. Python 2.3 tried to check for stack " +"overflow and raise a :exc:`RuntimeError` exception, but certain patterns " +"could sidestep the checking and if you were unlucky Python could segfault. " +"Python 2.4's regular expression engine can match this pattern without " +"problems." #: ../../whatsnew/2.4.rst:1270 msgid "" @@ -1475,6 +2061,11 @@ msgid "" "would quietly accept this, but 2.4 will raise a :exc:`RuntimeError` " "exception." msgstr "" +"The :mod:`signal` module now performs tighter error-checking on the " +"parameters to the :func:`signal.signal` function. For example, you can't " +"set a handler on the :const:`SIGKILL` signal; previous versions of Python " +"would quietly accept this, but 2.4 will raise a :exc:`RuntimeError` " +"exception." #: ../../whatsnew/2.4.rst:1275 msgid "" @@ -1483,6 +2074,10 @@ msgid "" "service name for a given port number. (Contributed by Dave Cole and Barry " "Warsaw.)" msgstr "" +"Two new functions were added to the :mod:`socket` module. :func:`socketpair` " +"returns a pair of connected sockets and ``getservbyport(port)`` looks up the " +"service name for a given port number. (Contributed by Dave Cole and Barry " +"Warsaw.)" #: ../../whatsnew/2.4.rst:1280 msgid "" @@ -1491,12 +2086,18 @@ msgid "" "exit functions. Eventually :func:`sys.exitfunc` will become a purely " "internal interface, accessed only by :mod:`atexit`." msgstr "" +"The :func:`sys.exitfunc` function has been deprecated. Code should be using " +"the existing :mod:`atexit` module, which correctly handles calling multiple " +"exit functions. Eventually :func:`sys.exitfunc` will become a purely " +"internal interface, accessed only by :mod:`atexit`." #: ../../whatsnew/2.4.rst:1285 msgid "" "The :mod:`tarfile` module now generates GNU-format tar files by default. " "(Contributed by Lars Gustäbel.)" msgstr "" +"The :mod:`tarfile` module now generates GNU-format tar files by default. " +"(Contributed by Lars Gustäbel.)" #: ../../whatsnew/2.4.rst:1288 msgid "" @@ -1504,6 +2105,9 @@ msgid "" "thread-local data. The module contains a :class:`local` class whose " "attribute values are local to different threads. ::" msgstr "" +"The :mod:`threading` module now has an elegantly simple way to support " +"thread-local data. The module contains a :class:`local` class whose " +"attribute values are local to different threads. ::" #: ../../whatsnew/2.4.rst:1298 msgid "" @@ -1511,6 +2115,9 @@ msgid "" "`number` and :attr:`url` attributes. You can subclass :class:`local` to " "initialize attributes or to add methods. (Contributed by Jim Fulton.)" msgstr "" +"Other threads can assign and retrieve their own values for the :attr:" +"`number` and :attr:`url` attributes. You can subclass :class:`local` to " +"initialize attributes or to add methods. (Contributed by Jim Fulton.)" #: ../../whatsnew/2.4.rst:1302 msgid "" @@ -1518,6 +2125,9 @@ msgid "" "collection during the timing loop. This change makes consecutive timings " "more comparable. (Contributed by Raymond Hettinger.)" msgstr "" +"The :mod:`timeit` module now automatically disables periodic garbage " +"collection during the timing loop. This change makes consecutive timings " +"more comparable. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:1306 msgid "" @@ -1526,6 +2136,10 @@ msgid "" "sockets, and regular expression pattern objects. (Contributed by Raymond " "Hettinger.)" msgstr "" +"The :mod:`weakref` module now supports a wider variety of objects including " +"Python functions, class instances, sets, frozensets, deques, arrays, files, " +"sockets, and regular expression pattern objects. (Contributed by Raymond " +"Hettinger.)" #: ../../whatsnew/2.4.rst:1311 msgid "" @@ -1533,16 +2147,21 @@ msgid "" "extension for transmitting multiple XML-RPC calls in a single HTTP " "operation. (Contributed by Brian Quinlan.)" msgstr "" +"The :mod:`xmlrpclib ` module now supports a multi-call " +"extension for transmitting multiple XML-RPC calls in a single HTTP " +"operation. (Contributed by Brian Quinlan.)" #: ../../whatsnew/2.4.rst:1315 msgid "" "The :mod:`mpz`, :mod:`rotor`, and :mod:`xreadlines` modules have been " "removed." msgstr "" +"The :mod:`mpz`, :mod:`rotor`, and :mod:`xreadlines` modules have been " +"removed." #: ../../whatsnew/2.4.rst:1324 msgid "cookielib" -msgstr "" +msgstr "cookielib" #: ../../whatsnew/2.4.rst:1326 msgid "" @@ -1553,6 +2172,12 @@ msgid "" "and fetches the cookie from the jar when connecting to the server. As in web " "browsers, policy objects control whether cookies are accepted or not." msgstr "" +"The :mod:`cookielib ` library supports client-side handling " +"for HTTP cookies, mirroring the :mod:`Cookie ` module's server-" +"side cookie support. Cookies are stored in cookie jars; the library " +"transparently stores cookies offered by the web server in the cookie jar, " +"and fetches the cookie from the jar when connecting to the server. As in web " +"browsers, policy objects control whether cookies are accepted or not." #: ../../whatsnew/2.4.rst:1333 msgid "" @@ -1561,6 +2186,10 @@ msgid "" "applications can use the Mozilla or Lynx cookie files, and one that stores " "cookies in the same format as the Perl libwww library." msgstr "" +"In order to store cookies across sessions, two implementations of cookie " +"jars are provided: one that stores cookies in the Netscape format so " +"applications can use the Mozilla or Lynx cookie files, and one that stores " +"cookies in the same format as the Perl libwww library." #: ../../whatsnew/2.4.rst:1338 msgid "" @@ -1568,10 +2197,13 @@ msgid "" "`cookielib `: :class:`HTTPCookieProcessor` manages a cookie " "jar that is used when accessing URLs." msgstr "" +":mod:`urllib2 ` has been changed to interact with :mod:" +"`cookielib `: :class:`HTTPCookieProcessor` manages a cookie " +"jar that is used when accessing URLs." #: ../../whatsnew/2.4.rst:1342 msgid "This module was contributed by John J. Lee." -msgstr "" +msgstr "This module was contributed by John J. Lee." #: ../../whatsnew/2.4.rst:1348 msgid "doctest" @@ -1584,22 +2216,30 @@ msgid "" "func:`doctest.testmod`, but the refactorings allow customizing the module's " "operation in various ways" msgstr "" +"The :mod:`doctest` module underwent considerable refactoring thanks to " +"Edward Loper and Tim Peters. Testing can still be as simple as running :" +"func:`doctest.testmod`, but the refactorings allow customizing the module's " +"operation in various ways" #: ../../whatsnew/2.4.rst:1355 msgid "" "The new :class:`DocTestFinder` class extracts the tests from a given " "object's docstrings::" msgstr "" +"The new :class:`DocTestFinder` class extracts the tests from a given " +"object's docstrings::" #: ../../whatsnew/2.4.rst:1371 msgid "" "The new :class:`DocTestRunner` class then runs individual tests and can " "produce a summary of the results::" msgstr "" +"The new :class:`DocTestRunner` class then runs individual tests and can " +"produce a summary of the results::" #: ../../whatsnew/2.4.rst:1380 msgid "The above example produces the following output::" -msgstr "" +msgstr "The above example produces the following output::" #: ../../whatsnew/2.4.rst:1388 msgid "" @@ -1608,6 +2248,10 @@ msgid "" "number of different flags that customize its behaviour; ambitious users can " "also write a completely new subclass of :class:`OutputChecker`." msgstr "" +":class:`DocTestRunner` uses an instance of the :class:`OutputChecker` class " +"to compare the expected output with the actual output. This class takes a " +"number of different flags that customize its behaviour; ambitious users can " +"also write a completely new subclass of :class:`OutputChecker`." #: ../../whatsnew/2.4.rst:1393 msgid "" @@ -1616,10 +2260,14 @@ msgid "" "expected output matches any substring, making it easier to accommodate " "outputs that vary in minor ways::" msgstr "" +"The default output checker provides a number of handy features. For example, " +"with the :const:`doctest.ELLIPSIS` option flag, an ellipsis (``...``) in the " +"expected output matches any substring, making it easier to accommodate " +"outputs that vary in minor ways::" #: ../../whatsnew/2.4.rst:1404 msgid "Another special string, ````, matches a blank line::" -msgstr "" +msgstr "Another special string, ````, matches a blank line::" #: ../../whatsnew/2.4.rst:1412 msgid "" @@ -1628,20 +2276,26 @@ msgid "" "`doctest.REPORT_CDIFF` (context diffs), or :const:`doctest.REPORT_NDIFF` " "(delta-style) option flags. For example::" msgstr "" +"Another new capability is producing a diff-style display of the output by " +"specifying the :const:`doctest.REPORT_UDIFF` (unified diffs), :const:" +"`doctest.REPORT_CDIFF` (context diffs), or :const:`doctest.REPORT_NDIFF` " +"(delta-style) option flags. For example::" #: ../../whatsnew/2.4.rst:1428 msgid "" "Running the above function's tests with :const:`doctest.REPORT_UDIFF` " "specified, you get the following output:" msgstr "" +"Running the above function's tests with :const:`doctest.REPORT_UDIFF` " +"specified, you get the following output:" #: ../../whatsnew/2.4.rst:1449 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/2.4.rst:1451 msgid "Some of the changes to Python's build process and to the C API are:" -msgstr "" +msgstr "Some of the changes to Python's build process and to the C API are:" #: ../../whatsnew/2.4.rst:1453 msgid "" @@ -1649,12 +2303,17 @@ msgid "" "extension functions: :c:macro:`Py_RETURN_NONE`, :c:macro:`Py_RETURN_TRUE`, " "and :c:macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)" msgstr "" +"Three new convenience macros were added for common return values from " +"extension functions: :c:macro:`Py_RETURN_NONE`, :c:macro:`Py_RETURN_TRUE`, " +"and :c:macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)" #: ../../whatsnew/2.4.rst:1457 msgid "" "Another new macro, :c:macro:`Py_CLEAR`, decreases the reference count of " "*obj* and sets *obj* to the null pointer. (Contributed by Jim Fulton.)" msgstr "" +"Another new macro, :c:macro:`Py_CLEAR`, decreases the reference count of " +"*obj* and sets *obj* to the null pointer. (Contributed by Jim Fulton.)" #: ../../whatsnew/2.4.rst:1460 msgid "" @@ -1662,6 +2321,9 @@ msgid "" "tuples from a variable length argument list of Python objects. (Contributed " "by Raymond Hettinger.)" msgstr "" +"A new function, ``PyTuple_Pack(N, obj1, obj2, ..., objN)``, constructs " +"tuples from a variable length argument list of Python objects. (Contributed " +"by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:1464 msgid "" @@ -1669,12 +2331,17 @@ msgid "" "lookups without masking exceptions raised during the look-up process. " "(Contributed by Raymond Hettinger.)" msgstr "" +"A new function, ``PyDict_Contains(d, k)``, implements fast dictionary " +"lookups without masking exceptions raised during the look-up process. " +"(Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:1468 msgid "" "The :c:expr:`Py_IS_NAN(X)` macro returns 1 if its float or double argument " "*X* is a NaN. (Contributed by Tim Peters.)" msgstr "" +"The :c:expr:`Py_IS_NAN(X)` macro returns 1 if its float or double argument " +"*X* is a NaN. (Contributed by Tim Peters.)" #: ../../whatsnew/2.4.rst:1471 msgid "" @@ -1683,6 +2350,10 @@ msgid "" "been performed. If this function returns false, no lock operations are " "needed. (Contributed by Nick Coghlan.)" msgstr "" +"C code can avoid unnecessary locking by using the new :c:func:`!" +"PyEval_ThreadsInitialized` function to tell if any thread operations have " +"been performed. If this function returns false, no lock operations are " +"needed. (Contributed by Nick Coghlan.)" #: ../../whatsnew/2.4.rst:1476 msgid "" @@ -1690,6 +2361,9 @@ msgid "" "func:`PyArg_ParseTupleAndKeywords` but takes a :c:type:`va_list` instead of " "a number of arguments. (Contributed by Greg Chapman.)" msgstr "" +"A new function, :c:func:`PyArg_VaParseTupleAndKeywords`, is the same as :c:" +"func:`PyArg_ParseTupleAndKeywords` but takes a :c:type:`va_list` instead of " +"a number of arguments. (Contributed by Greg Chapman.)" #: ../../whatsnew/2.4.rst:1480 msgid "" @@ -1698,6 +2372,10 @@ msgid "" "can halve the access time for a method such as :meth:`set.__contains__`. " "(Contributed by Raymond Hettinger.)" msgstr "" +"A new method flag, :c:macro:`METH_COEXIST`, allows a function defined in " +"slots to co-exist with a :c:type:`PyCFunction` having the same name. This " +"can halve the access time for a method such as :meth:`set.__contains__`. " +"(Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.4.rst:1485 msgid "" @@ -1711,32 +2389,47 @@ msgid "" "that processor architecture doesn't call that register \"the TSC " "register\". (Contributed by Jeremy Hylton.)" msgstr "" +"Python can now be built with additional profiling for the interpreter " +"itself, intended as an aid to people developing the Python core. Providing :" +"option:`!--enable-profiling` to the :program:`configure` script will let you " +"profile the interpreter with :program:`gprof`, and providing the :option:`!--" +"with-tsc` switch enables profiling using the Pentium's Time-Stamp-Counter " +"register. Note that the :option:`!--with-tsc` switch is slightly misnamed, " +"because the profiling feature also works on the PowerPC platform, though " +"that processor architecture doesn't call that register \"the TSC " +"register\". (Contributed by Jeremy Hylton.)" #: ../../whatsnew/2.4.rst:1495 msgid "" "The :c:type:`!tracebackobject` type has been renamed to :c:type:" "`PyTracebackObject`." msgstr "" +"The :c:type:`!tracebackobject` type has been renamed to :c:type:" +"`PyTracebackObject`." #: ../../whatsnew/2.4.rst:1502 msgid "Port-Specific Changes" -msgstr "" +msgstr "Port-Specific Changes" #: ../../whatsnew/2.4.rst:1504 msgid "" "The Windows port now builds under MSVC++ 7.1 as well as version 6. " "(Contributed by Martin von Löwis.)" msgstr "" +"The Windows port now builds under MSVC++ 7.1 as well as version 6. " +"(Contributed by Martin von Löwis.)" #: ../../whatsnew/2.4.rst:1511 msgid "Porting to Python 2.4" -msgstr "" +msgstr "Porting to Python 2.4" #: ../../whatsnew/2.4.rst:1513 msgid "" "This section lists previously described changes that may require changes to " "your code:" msgstr "" +"This section lists previously described changes that may require changes to " +"your code:" #: ../../whatsnew/2.4.rst:1516 msgid "" @@ -1744,6 +2437,9 @@ msgid "" "trigger a :exc:`FutureWarning` and return a value limited to 32 or 64 bits; " "instead they return a long integer." msgstr "" +"Left shifts and hexadecimal/octal constants that are too large no longer " +"trigger a :exc:`FutureWarning` and return a value limited to 32 or 64 bits; " +"instead they return a long integer." #: ../../whatsnew/2.4.rst:1523 msgid "" @@ -1751,6 +2447,9 @@ msgid "" "empty list instead of raising a :exc:`TypeError` exception if called with no " "arguments." msgstr "" +"The :func:`zip` built-in function and :func:`itertools.izip` now return an " +"empty list instead of raising a :exc:`TypeError` exception if called with no " +"arguments." #: ../../whatsnew/2.4.rst:1527 msgid "" @@ -1759,12 +2458,18 @@ msgid "" "different classes will now always be unequal, and relative comparisons " "(``<``, ``>``) will raise a :exc:`TypeError`." msgstr "" +"You can no longer compare the :class:`date` and :class:`~datetime.datetime` " +"instances provided by the :mod:`datetime` module. Two instances of " +"different classes will now always be unequal, and relative comparisons " +"(``<``, ``>``) will raise a :exc:`TypeError`." #: ../../whatsnew/2.4.rst:1532 msgid "" ":func:`!dircache.listdir` now passes exceptions to the caller instead of " "returning empty lists." msgstr "" +":func:`!dircache.listdir` now passes exceptions to the caller instead of " +"returning empty lists." #: ../../whatsnew/2.4.rst:1535 msgid "" @@ -1772,29 +2477,39 @@ msgid "" "the wrong order. This has been corrected; applications relying on the wrong " "order need to be fixed." msgstr "" +":func:`LexicalHandler.startDTD` used to receive the public and system IDs in " +"the wrong order. This has been corrected; applications relying on the wrong " +"order need to be fixed." #: ../../whatsnew/2.4.rst:1539 msgid "" ":func:`fcntl.ioctl` now warns if the *mutate* argument is omitted and " "relevant." msgstr "" +":func:`fcntl.ioctl` now warns if the *mutate* argument is omitted and " +"relevant." #: ../../whatsnew/2.4.rst:1542 msgid "" "The :mod:`tarfile` module now generates GNU-format tar files by default." msgstr "" +"The :mod:`tarfile` module now generates GNU-format tar files by default." #: ../../whatsnew/2.4.rst:1544 msgid "" "Encountering a failure while importing a module no longer leaves a partially " "initialized module object in ``sys.modules``." msgstr "" +"Encountering a failure while importing a module no longer leaves a partially " +"initialized module object in ``sys.modules``." #: ../../whatsnew/2.4.rst:1547 msgid "" ":const:`None` is now a constant; code that binds a new value to the name " "``None`` is now a syntax error." msgstr "" +":const:`None` is now a constant; code that binds a new value to the name " +"``None`` is now a syntax error." #: ../../whatsnew/2.4.rst:1550 msgid "" @@ -1803,6 +2518,10 @@ msgid "" "silently. For example, you can no longer set a handler on the :const:" "`SIGKILL` signal." msgstr "" +"The :func:`signals.signal` function now raises a :exc:`RuntimeError` " +"exception for certain illegal values; previously these errors would pass " +"silently. For example, you can no longer set a handler on the :const:" +"`SIGKILL` signal." #: ../../whatsnew/2.4.rst:1560 msgid "Acknowledgements" @@ -1815,6 +2534,10 @@ msgid "" "Koray Can, Hye-Shik Chang, Michael Dyck, Raymond Hettinger, Brian Hurt, " "Hamish Lawson, Fredrik Lundh, Sean Reifschneider, Sadruddin Rejeb." msgstr "" +"The author would like to thank the following people for offering " +"suggestions, corrections and assistance with various drafts of this article: " +"Koray Can, Hye-Shik Chang, Michael Dyck, Raymond Hettinger, Brian Hurt, " +"Hamish Lawson, Fredrik Lundh, Sean Reifschneider, Sadruddin Rejeb." #: ../../whatsnew/2.4.rst:415 msgid "universal newlines" @@ -1822,4 +2545,4 @@ msgstr "novas linhas universais" #: ../../whatsnew/2.4.rst:415 msgid "What's new" -msgstr "" +msgstr "What's new" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 95dfd82cd..07515dd7c 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -23,16 +23,16 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../whatsnew/2.5.rst:3 msgid "What's New in Python 2.5" -msgstr "O que há de novo no Python 2.5" +msgstr "What's New in Python 2.5" #: ../../whatsnew/2.5.rst:0 msgid "Author" @@ -48,6 +48,9 @@ msgid "" "Python 2.5 is scheduled for August 2006; :pep:`356` describes the planned " "release schedule. Python 2.5 was released on September 19, 2006." msgstr "" +"This article explains the new features in Python 2.5. The final release of " +"Python 2.5 is scheduled for August 2006; :pep:`356` describes the planned " +"release schedule. Python 2.5 was released on September 19, 2006." #: ../../whatsnew/2.5.rst:16 msgid "" @@ -58,6 +61,12 @@ msgid "" "SQLite database module (:mod:`sqlite`), and the :mod:`ctypes` module for " "calling C functions." msgstr "" +"The changes in Python 2.5 are an interesting mix of language and library " +"improvements. The library enhancements will be more important to Python's " +"user community, I think, because several widely useful packages were added. " +"New modules include ElementTree for XML processing (:mod:`xml.etree`), the " +"SQLite database module (:mod:`sqlite`), and the :mod:`ctypes` module for " +"calling C functions." #: ../../whatsnew/2.5.rst:23 msgid "" @@ -73,6 +82,17 @@ msgid "" "to one specific language feature or another; none of them are broad " "modifications to Python's semantics." msgstr "" +"The language changes are of middling significance. Some pleasant new " +"features were added, but most of them aren't features that you'll use every " +"day. Conditional expressions were finally added to the language using a " +"novel syntax; see section :ref:`pep-308`. The new ':keyword:`with`' " +"statement will make writing cleanup code easier (section :ref:`pep-343`). " +"Values can now be passed into generators (section :ref:`pep-342`). Imports " +"are now visible as either absolute or relative (section :ref:`pep-328`). " +"Some corner cases of exception handling are handled better (section :ref:" +"`pep-341`). All these improvements are worthwhile, but they're improvements " +"to one specific language feature or another; none of them are broad " +"modifications to Python's semantics." #: ../../whatsnew/2.5.rst:34 msgid "" @@ -81,6 +101,10 @@ msgid "" "change logs finds there were 353 patches applied and 458 bugs fixed between " "Python 2.4 and 2.5. (Both figures are likely to be underestimates.)" msgstr "" +"As well as the language and library additions, other improvements and " +"bugfixes were made throughout the source tree. A search through the SVN " +"change logs finds there were 353 patches applied and 458 bugs fixed between " +"Python 2.4 and 2.5. (Both figures are likely to be underestimates.)" #: ../../whatsnew/2.5.rst:39 msgid "" @@ -91,16 +115,24 @@ msgid "" "implementation and design rationale, refer to the PEP for a particular new " "feature." msgstr "" +"This article doesn't try to be a complete specification of the new features; " +"instead changes are briefly introduced using helpful examples. For full " +"details, you should always refer to the documentation for Python 2.5 at " +"https://docs.python.org. If you want to understand the complete " +"implementation and design rationale, refer to the PEP for a particular new " +"feature." #: ../../whatsnew/2.5.rst:45 msgid "" "Comments, suggestions, and error reports for this document are welcome; " "please e-mail them to the author or open a bug in the Python bug tracker." msgstr "" +"Comments, suggestions, and error reports for this document are welcome; " +"please e-mail them to the author or open a bug in the Python bug tracker." #: ../../whatsnew/2.5.rst:54 msgid "PEP 308: Conditional Expressions" -msgstr "" +msgstr "PEP 308: Conditional Expressions" #: ../../whatsnew/2.5.rst:56 msgid "" @@ -110,6 +142,11 @@ msgid "" "you write a single assignment statement that has the same effect as the " "following::" msgstr "" +"For a long time, people have been requesting a way to write conditional " +"expressions, which are expressions that return value A or value B depending " +"on whether a Boolean value is true or false. A conditional expression lets " +"you write a single assignment statement that has the same effect as the " +"following::" #: ../../whatsnew/2.5.rst:66 msgid "" @@ -119,10 +156,15 @@ msgid "" "was preferred by a clear majority. Candidates included C's ``cond ? true_v : " "false_v``, ``if cond then true_v else false_v``, and 16 other variations." msgstr "" +"There have been endless tedious discussions of syntax on both python-dev and " +"comp.lang.python. A vote was even held that found the majority of voters " +"wanted conditional expressions in some form, but there was no syntax that " +"was preferred by a clear majority. Candidates included C's ``cond ? true_v : " +"false_v``, ``if cond then true_v else false_v``, and 16 other variations." #: ../../whatsnew/2.5.rst:72 msgid "Guido van Rossum eventually chose a surprising syntax::" -msgstr "" +msgstr "Guido van Rossum eventually chose a surprising syntax::" #: ../../whatsnew/2.5.rst:76 msgid "" @@ -132,6 +174,11 @@ msgid "" "condition was true. Similarly, the *false_value* expression is only " "evaluated when the condition is false." msgstr "" +"Evaluation is still lazy as in existing Boolean expressions, so the order of " +"evaluation jumps around a bit. The *condition* expression in the middle is " +"evaluated first, and the *true_value* expression is evaluated only if the " +"condition was true. Similarly, the *false_value* expression is only " +"evaluated when the condition is false." #: ../../whatsnew/2.5.rst:82 msgid "" @@ -144,6 +191,14 @@ msgid "" "when the condition isn't met. The conditional syntax makes this pattern a " "bit more obvious::" msgstr "" +"This syntax may seem strange and backwards; why does the condition go in the " +"*middle* of the expression, and not in the front as in C's ``c ? x : y``? " +"The decision was checked by applying the new syntax to the modules in the " +"standard library and seeing how the resulting code read. In many cases " +"where a conditional expression is used, one value seems to be the 'common " +"case' and one value is an 'exceptional case', used only on rarer occasions " +"when the condition isn't met. The conditional syntax makes this pattern a " +"bit more obvious::" #: ../../whatsnew/2.5.rst:92 msgid "" @@ -152,6 +207,10 @@ msgid "" "an empty string is returned.\" I doubt I will use conditional expressions " "very often where there isn't a clear common and uncommon case." msgstr "" +"I read the above statement as meaning \"here *contents* is usually assigned " +"a value of ``doc+'\\n'``; sometimes *doc* is empty, in which special case " +"an empty string is returned.\" I doubt I will use conditional expressions " +"very often where there isn't a clear common and uncommon case." #: ../../whatsnew/2.5.rst:97 msgid "" @@ -160,6 +219,10 @@ msgid "" "require parentheses in the Python language's grammar, but as a matter of " "style I think you should always use them. Consider these two statements::" msgstr "" +"There was some discussion of whether the language should require surrounding " +"conditional expressions with parentheses. The decision was made to *not* " +"require parentheses in the Python language's grammar, but as a matter of " +"style I think you should always use them. Consider these two statements::" #: ../../whatsnew/2.5.rst:108 msgid "" @@ -169,6 +232,11 @@ msgid "" "better, in my opinion, because it makes it clear that the assignment is " "always performed and the choice is being made between two values." msgstr "" +"In the first version, I think a reader's eye might group the statement into " +"'level = 1', 'if logging', 'else 0', and think that the condition decides " +"whether the assignment to *level* is performed. The second version reads " +"better, in my opinion, because it makes it clear that the assignment is " +"always performed and the choice is being made between two values." #: ../../whatsnew/2.5.rst:114 msgid "" @@ -177,26 +245,34 @@ msgid "" "expressions. See :pep:`308` for some examples. If you put parentheses " "around your conditional expressions, you won't run into this case." msgstr "" +"Another reason for including the brackets: a few odd combinations of list " +"comprehensions and lambdas could look like incorrect conditional " +"expressions. See :pep:`308` for some examples. If you put parentheses " +"around your conditional expressions, you won't run into this case." #: ../../whatsnew/2.5.rst:122 msgid ":pep:`308` - Conditional Expressions" -msgstr "" +msgstr ":pep:`308` - Conditional Expressions" #: ../../whatsnew/2.5.rst:123 msgid "" "PEP written by Guido van Rossum and Raymond D. Hettinger; implemented by " "Thomas Wouters." msgstr "" +"PEP written by Guido van Rossum and Raymond D. Hettinger; implemented by " +"Thomas Wouters." #: ../../whatsnew/2.5.rst:132 msgid "PEP 309: Partial Function Application" -msgstr "" +msgstr "PEP 309: Partial Function Application" #: ../../whatsnew/2.5.rst:134 msgid "" "The :mod:`functools` module is intended to contain tools for functional-" "style programming." msgstr "" +"The :mod:`functools` module is intended to contain tools for functional-" +"style programming." #: ../../whatsnew/2.5.rst:137 msgid "" @@ -207,6 +283,12 @@ msgid "" "c)`` that was equivalent to ``f(1, b, c)``. This is called \"partial " "function application\"." msgstr "" +"One useful tool in this module is the :func:`partial` function. For programs " +"written in a functional style, you'll sometimes want to construct variants " +"of existing functions that have some of the parameters filled in. Consider " +"a Python function ``f(a, b, c)``; you could create a new function ``g(b, " +"c)`` that was equivalent to ``f(1, b, c)``. This is called \"partial " +"function application\"." #: ../../whatsnew/2.5.rst:144 msgid "" @@ -214,6 +296,9 @@ msgid "" "kwarg1=value1, kwarg2=value2)``. The resulting object is callable, so you " "can just call it to invoke *function* with the filled-in arguments." msgstr "" +":func:`partial` takes the arguments ``(function, arg1, arg2, ... " +"kwarg1=value1, kwarg2=value2)``. The resulting object is callable, so you " +"can just call it to invoke *function* with the filled-in arguments." #: ../../whatsnew/2.5.rst:148 msgid "Here's a small but realistic example::" @@ -226,6 +311,10 @@ msgid "" "provided for the menu option is a partially applied version of the :meth:" "`open_item` method, where the first argument has been provided. ::" msgstr "" +"Here's another example, from a program that uses PyGTK. Here a context-" +"sensitive pop-up menu is being constructed dynamically. The callback " +"provided for the menu option is a partially applied version of the :meth:" +"`open_item` method, where the first argument has been provided. ::" #: ../../whatsnew/2.5.rst:173 msgid "" @@ -235,6 +324,11 @@ msgid "" "docstring attribute to a wrapper function so that tracebacks inside the " "wrapped function are easier to understand. For example, you might write::" msgstr "" +"Another function in the :mod:`functools` module is the " +"``update_wrapper(wrapper, wrapped)`` function that helps you write well-" +"behaved decorators. :func:`update_wrapper` copies the name, module, and " +"docstring attribute to a wrapper function so that tracebacks inside the " +"wrapped function are easier to understand. For example, you might write::" #: ../../whatsnew/2.5.rst:186 msgid "" @@ -242,20 +336,25 @@ msgid "" "copy the wrapped function's information. An alternate version of the " "previous example would be::" msgstr "" +":func:`wraps` is a decorator that can be used inside your own decorators to " +"copy the wrapped function's information. An alternate version of the " +"previous example would be::" #: ../../whatsnew/2.5.rst:200 msgid ":pep:`309` - Partial Function Application" -msgstr "" +msgstr ":pep:`309` - Partial Function Application" #: ../../whatsnew/2.5.rst:201 msgid "" "PEP proposed and written by Peter Harris; implemented by Hye-Shik Chang and " "Nick Coghlan, with adaptations by Raymond Hettinger." msgstr "" +"PEP proposed and written by Peter Harris; implemented by Hye-Shik Chang and " +"Nick Coghlan, with adaptations by Raymond Hettinger." #: ../../whatsnew/2.5.rst:210 msgid "PEP 314: Metadata for Python Software Packages v1.1" -msgstr "" +msgstr "PEP 314: Metadata for Python Software Packages v1.1" #: ../../whatsnew/2.5.rst:212 msgid "" @@ -265,6 +364,11 @@ msgid "" "command, the dependency information will be recorded in the :file:`PKG-INFO` " "file." msgstr "" +"Some simple dependency support was added to Distutils. The :func:`setup` " +"function now has ``requires``, ``provides``, and ``obsoletes`` keyword " +"parameters. When you build a source distribution using the ``sdist`` " +"command, the dependency information will be recorded in the :file:`PKG-INFO` " +"file." #: ../../whatsnew/2.5.rst:217 msgid "" @@ -273,6 +377,10 @@ msgid "" "an entry in the package index, determine the dependencies for a package, and " "download the required packages. ::" msgstr "" +"Another new keyword parameter is ``download_url``, which should be set to a " +"URL for the package's source code. This means it's now possible to look up " +"an entry in the package index, determine the dependencies for a package, and " +"download the required packages. ::" #: ../../whatsnew/2.5.rst:231 msgid "" @@ -280,6 +388,9 @@ msgid "" "storing source and binary archives for a package. The new :command:`upload` " "Distutils command will upload a package to the repository." msgstr "" +"Another new enhancement to the Python package index at https://pypi.org is " +"storing source and binary archives for a package. The new :command:`upload` " +"Distutils command will upload a package to the repository." #: ../../whatsnew/2.5.rst:236 msgid "" @@ -289,25 +400,33 @@ msgid "" "Optionally you can GPG-sign the package by supplying the :option:`!--sign` " "and :option:`!--identity` options." msgstr "" +"Before a package can be uploaded, you must be able to build a distribution " +"using the :command:`sdist` Distutils command. Once that works, you can run " +"``python setup.py upload`` to add your package to the PyPI archive. " +"Optionally you can GPG-sign the package by supplying the :option:`!--sign` " +"and :option:`!--identity` options." #: ../../whatsnew/2.5.rst:242 msgid "" "Package uploading was implemented by Martin von Löwis and Richard Jones." msgstr "" +"Package uploading was implemented by Martin von Löwis and Richard Jones." #: ../../whatsnew/2.5.rst:247 msgid ":pep:`314` - Metadata for Python Software Packages v1.1" -msgstr "" +msgstr ":pep:`314` - Metadata for Python Software Packages v1.1" #: ../../whatsnew/2.5.rst:248 msgid "" "PEP proposed and written by A.M. Kuchling, Richard Jones, and Fred Drake; " "implemented by Richard Jones and Fred Drake." msgstr "" +"PEP proposed and written by A.M. Kuchling, Richard Jones, and Fred Drake; " +"implemented by Richard Jones and Fred Drake." #: ../../whatsnew/2.5.rst:257 msgid "PEP 328: Absolute and Relative Imports" -msgstr "" +msgstr "PEP 328: Absolute and Relative Imports" #: ../../whatsnew/2.5.rst:259 msgid "" @@ -316,6 +435,10 @@ msgid "" "``from ... import ...`` statement, making it easier to import many different " "names." msgstr "" +"The simpler part of :pep:`328` was implemented in Python 2.4: parentheses " +"could now be used to enclose the names imported from a module using the " +"``from ... import ...`` statement, making it easier to import many different " +"names." #: ../../whatsnew/2.5.rst:263 msgid "" @@ -324,16 +447,22 @@ msgid "" "plan is to move toward making absolute imports the default in future " "versions of Python." msgstr "" +"The more complicated part has been implemented in Python 2.5: importing a " +"module can be specified to use absolute or package-relative imports. The " +"plan is to move toward making absolute imports the default in future " +"versions of Python." #: ../../whatsnew/2.5.rst:267 msgid "Let's say you have a package directory like this::" -msgstr "" +msgstr "Let's say you have a package directory like this::" #: ../../whatsnew/2.5.rst:274 msgid "" "This defines a package named :mod:`pkg` containing the :mod:`pkg.main` and :" "mod:`pkg.string` submodules." msgstr "" +"This defines a package named :mod:`pkg` containing the :mod:`pkg.main` and :" +"mod:`pkg.string` submodules." #: ../../whatsnew/2.5.rst:277 msgid "" @@ -344,6 +473,12 @@ msgid "" "`pkg.string` module, and that module is bound to the name ``string`` in the :" "mod:`pkg.main` module's namespace." msgstr "" +"Consider the code in the :file:`main.py` module. What happens if it " +"executes the statement ``import string``? In Python 2.4 and earlier, it " +"will first look in the package's directory to perform a relative import, " +"finds :file:`pkg/string.py`, imports the contents of that file as the :mod:" +"`pkg.string` module, and that module is bound to the name ``string`` in the :" +"mod:`pkg.main` module's namespace." #: ../../whatsnew/2.5.rst:284 msgid "" @@ -355,6 +490,13 @@ msgid "" "imports from the standard library, ``import py; py.std.string.join()``, but " "that package isn't available on all Python installations." msgstr "" +"That's fine if :mod:`pkg.string` was what you wanted. But what if you " +"wanted Python's standard :mod:`string` module? There's no clean way to " +"ignore :mod:`pkg.string` and look for the standard module; generally you had " +"to look at the contents of ``sys.modules``, which is slightly unclean. " +"Holger Krekel's :mod:`py.std` package provides a tidier way to perform " +"imports from the standard library, ``import py; py.std.string.join()``, but " +"that package isn't available on all Python installations." #: ../../whatsnew/2.5.rst:292 msgid "" @@ -365,6 +507,12 @@ msgid "" "submodules, but you can't protect against having your submodule's name being " "used for a new module added in a future version of Python." msgstr "" +"Reading code which relies on relative imports is also less clear, because a " +"reader may be confused about which module, :mod:`string` or :mod:`pkg." +"string`, is intended to be used. Python users soon learned not to duplicate " +"the names of standard library modules in the names of their packages' " +"submodules, but you can't protect against having your submodule's name being " +"used for a new module added in a future version of Python." #: ../../whatsnew/2.5.rst:299 msgid "" @@ -376,12 +524,21 @@ msgid "" "that users should begin using absolute imports as much as possible, so it's " "preferable to begin writing ``from pkg import string`` in your code." msgstr "" +"In Python 2.5, you can switch :keyword:`import`'s behaviour to absolute " +"imports using a ``from __future__ import absolute_import`` directive. This " +"absolute-import behaviour will become the default in a future version " +"(probably Python 2.7). Once absolute imports are the default, ``import " +"string`` will always find the standard library's version. It's suggested " +"that users should begin using absolute imports as much as possible, so it's " +"preferable to begin writing ``from pkg import string`` in your code." #: ../../whatsnew/2.5.rst:307 msgid "" "Relative imports are still possible by adding a leading period to the " "module name when using the ``from ... import`` form::" msgstr "" +"Relative imports are still possible by adding a leading period to the " +"module name when using the ``from ... import`` form::" #: ../../whatsnew/2.5.rst:315 msgid "" @@ -391,12 +548,19 @@ msgid "" "from the parent of the current package. For example, code in the :mod:`A.B." "C` module can do::" msgstr "" +"This imports the :mod:`string` module relative to the current package, so " +"in :mod:`pkg.main` this will import *name1* and *name2* from :mod:`pkg." +"string`. Additional leading periods perform the relative import starting " +"from the parent of the current package. For example, code in the :mod:`A.B." +"C` module can do::" #: ../../whatsnew/2.5.rst:324 msgid "" "Leading periods cannot be used with the ``import modname`` form of the " "import statement, only the ``from ... import`` form." msgstr "" +"Leading periods cannot be used with the ``import modname`` form of the " +"import statement, only the ``from ... import`` form." #: ../../whatsnew/2.5.rst:330 msgid ":pep:`328` - Imports: Multi-Line and Absolute/Relative" @@ -404,20 +568,21 @@ msgstr ":pep:`328` - Importações: Multilinha e absoluta/relativa" #: ../../whatsnew/2.5.rst:331 msgid "PEP written by Aahz; implemented by Thomas Wouters." -msgstr "" +msgstr "PEP written by Aahz; implemented by Thomas Wouters." #: ../../whatsnew/2.5.rst:333 msgid "https://pylib.readthedocs.io/" -msgstr "" +msgstr "https://pylib.readthedocs.io/" #: ../../whatsnew/2.5.rst:334 msgid "" "The py library by Holger Krekel, which contains the :mod:`py.std` package." msgstr "" +"The py library by Holger Krekel, which contains the :mod:`py.std` package." #: ../../whatsnew/2.5.rst:342 msgid "PEP 338: Executing Modules as Scripts" -msgstr "" +msgstr "PEP 338: Executing Modules as Scripts" #: ../../whatsnew/2.5.rst:344 msgid "" @@ -426,6 +591,10 @@ msgid "" "the Python interpreter, the switch now uses an implementation in a new " "module, :mod:`runpy`." msgstr "" +"The :option:`-m` switch added in Python 2.4 to execute a module as a script " +"gained a few more abilities. Instead of being implemented in C code inside " +"the Python interpreter, the switch now uses an implementation in a new " +"module, :mod:`runpy`." #: ../../whatsnew/2.5.rst:349 msgid "" @@ -436,18 +605,24 @@ msgid "" "to ``sys.path`` and then use the :option:`-m` switch to execute code from " "the archive." msgstr "" +"The :mod:`runpy` module implements a more sophisticated import mechanism so " +"that it's now possible to run modules in a package such as :mod:`pychecker." +"checker`. The module also supports alternative import mechanisms such as " +"the :mod:`zipimport` module. This means you can add a .zip archive's path " +"to ``sys.path`` and then use the :option:`-m` switch to execute code from " +"the archive." #: ../../whatsnew/2.5.rst:359 msgid ":pep:`338` - Executing modules as scripts" -msgstr "" +msgstr ":pep:`338` - Executing modules as scripts" #: ../../whatsnew/2.5.rst:360 msgid "PEP written and implemented by Nick Coghlan." -msgstr "" +msgstr "PEP written and implemented by Nick Coghlan." #: ../../whatsnew/2.5.rst:368 msgid "PEP 341: Unified try/except/finally" -msgstr "" +msgstr "PEP 341: Unified try/except/finally" #: ../../whatsnew/2.5.rst:370 msgid "" @@ -459,6 +634,13 @@ msgid "" "complicated and it wasn't clear what the semantics of the combined statement " "should be." msgstr "" +"Until Python 2.5, the :keyword:`try` statement came in two flavours. You " +"could use a :keyword:`finally` block to ensure that code is always executed, " +"or one or more :keyword:`except` blocks to catch specific exceptions. You " +"couldn't combine both :keyword:`!except` blocks and a :keyword:`!finally` " +"block, because generating the right bytecode for the combined version was " +"complicated and it wasn't clear what the semantics of the combined statement " +"should be." #: ../../whatsnew/2.5.rst:377 msgid "" @@ -467,6 +649,10 @@ msgid "" "block, and this clarified what the statement should mean. In Python 2.5, " "you can now write::" msgstr "" +"Guido van Rossum spent some time working with Java, which does support the " +"equivalent of combining :keyword:`except` blocks and a :keyword:`finally` " +"block, and this clarified what the statement should mean. In Python 2.5, " +"you can now write::" #: ../../whatsnew/2.5.rst:393 msgid "" @@ -476,6 +662,11 @@ msgid "" "class:`Exception2`, *handler-2* is executed, and so forth. If no exception " "is raised, the *else-block* is executed." msgstr "" +"The code in *block-1* is executed. If the code raises an exception, the " +"various :keyword:`except` blocks are tested: if the exception is of class :" +"class:`Exception1`, *handler-1* is executed; otherwise if it's of class :" +"class:`Exception2`, *handler-2* is executed, and so forth. If no exception " +"is raised, the *else-block* is executed." #: ../../whatsnew/2.5.rst:399 msgid "" @@ -484,18 +675,22 @@ msgid "" "error in an exception handler or the *else-block* and a new exception is " "raised, the code in the *final-block* is still run." msgstr "" +"No matter what happened previously, the *final-block* is executed once the " +"code block is complete and any raised exceptions handled. Even if there's an " +"error in an exception handler or the *else-block* and a new exception is " +"raised, the code in the *final-block* is still run." #: ../../whatsnew/2.5.rst:407 msgid ":pep:`341` - Unifying try-except and try-finally" -msgstr "" +msgstr ":pep:`341` - Unifying try-except and try-finally" #: ../../whatsnew/2.5.rst:408 msgid "PEP written by Georg Brandl; implementation by Thomas Lee." -msgstr "" +msgstr "PEP written by Georg Brandl; implementation by Thomas Lee." #: ../../whatsnew/2.5.rst:416 msgid "PEP 342: New Generator Features" -msgstr "" +msgstr "PEP 342: New Generator Features" #: ../../whatsnew/2.5.rst:418 msgid "" @@ -508,10 +703,18 @@ msgid "" "changing the global variable's value, or passing in some mutable object that " "callers then modify." msgstr "" +"Python 2.5 adds a simple way to pass values *into* a generator. As " +"introduced in Python 2.3, generators only produce output; once a generator's " +"code was invoked to create an iterator, there was no way to pass any new " +"information into the function when its execution is resumed. Sometimes the " +"ability to pass in some information would be useful. Hackish solutions to " +"this include making the generator's code look at a global variable and then " +"changing the global variable's value, or passing in some mutable object that " +"callers then modify." #: ../../whatsnew/2.5.rst:426 msgid "To refresh your memory of basic generators, here's a simple example::" -msgstr "" +msgstr "To refresh your memory of basic generators, here's a simple example::" #: ../../whatsnew/2.5.rst:434 msgid "" @@ -522,6 +725,12 @@ msgid "" "the iterator's :meth:`next` method, picking up after the :keyword:`!yield` " "statement." msgstr "" +"When you call ``counter(10)``, the result is an iterator that returns the " +"values from 0 up to 9. On encountering the :keyword:`yield` statement, the " +"iterator returns the provided value and suspends the function's execution, " +"preserving the local variables. Execution resumes on the following call to " +"the iterator's :meth:`next` method, picking up after the :keyword:`!yield` " +"statement." #: ../../whatsnew/2.5.rst:440 msgid "" @@ -529,6 +738,9 @@ msgid "" "value. In 2.5, :keyword:`!yield` is now an expression, returning a value " "that can be assigned to a variable or otherwise operated on::" msgstr "" +"In Python 2.3, :keyword:`yield` was a statement; it didn't return any " +"value. In 2.5, :keyword:`!yield` is now an expression, returning a value " +"that can be assigned to a variable or otherwise operated on::" #: ../../whatsnew/2.5.rst:446 msgid "" @@ -537,6 +749,10 @@ msgid "" "above example. The parentheses aren't always necessary, but it's easier to " "always add them instead of having to remember when they're needed." msgstr "" +"I recommend that you always put parentheses around a :keyword:`yield` " +"expression when you're doing something with the returned value, as in the " +"above example. The parentheses aren't always necessary, but it's easier to " +"always add them instead of having to remember when they're needed." #: ../../whatsnew/2.5.rst:451 msgid "" @@ -546,6 +762,11 @@ msgid "" "can write ``val = yield i`` but have to use parentheses when there's an " "operation, as in ``val = (yield i) + 12``.)" msgstr "" +"(:pep:`342` explains the exact rules, which are that a :keyword:`yield`\\ -" +"expression must always be parenthesized except when it occurs at the top-" +"level expression on the right-hand side of an assignment. This means you " +"can write ``val = yield i`` but have to use parentheses when there's an " +"operation, as in ``val = (yield i) + 12``.)" #: ../../whatsnew/2.5.rst:458 msgid "" @@ -554,16 +775,22 @@ msgid "" "the specified *value*. If the regular :meth:`next` method is called, the :" "keyword:`!yield` returns :const:`None`." msgstr "" +"Values are sent into a generator by calling its ``send(value)`` method. The " +"generator's code is then resumed and the :keyword:`yield` expression returns " +"the specified *value*. If the regular :meth:`next` method is called, the :" +"keyword:`!yield` returns :const:`None`." #: ../../whatsnew/2.5.rst:463 msgid "" "Here's the previous example, modified to allow changing the value of the " "internal counter. ::" msgstr "" +"Here's the previous example, modified to allow changing the value of the " +"internal counter. ::" #: ../../whatsnew/2.5.rst:476 msgid "And here's an example of changing the counter::" -msgstr "" +msgstr "And here's an example of changing the counter::" #: ../../whatsnew/2.5.rst:493 msgid "" @@ -572,11 +799,16 @@ msgid "" "sure that the :meth:`send` method will be the only method used to resume " "your generator function." msgstr "" +":keyword:`yield` will usually return :const:`None`, so you should always " +"check for this case. Don't just use its value in expressions unless you're " +"sure that the :meth:`send` method will be the only method used to resume " +"your generator function." #: ../../whatsnew/2.5.rst:498 msgid "" "In addition to :meth:`send`, there are two other new methods on generators:" msgstr "" +"In addition to :meth:`send`, there are two other new methods on generators:" #: ../../whatsnew/2.5.rst:500 msgid "" @@ -584,8 +816,11 @@ msgid "" "inside the generator; the exception is raised by the :keyword:`yield` " "expression where the generator's execution is paused." msgstr "" - -#: ../../whatsnew/2.5.rst:504 +"``throw(type, value=None, traceback=None)`` is used to raise an exception " +"inside the generator; the exception is raised by the :keyword:`yield` " +"expression where the generator's execution is paused." + +#: ../../whatsnew/2.5.rst:504 msgid "" ":meth:`close` raises a new :exc:`GeneratorExit` exception inside the " "generator to terminate the iteration. On receiving this exception, the " @@ -596,6 +831,14 @@ msgid "" "meth:`close` will also be called by Python's garbage collector when the " "generator is garbage-collected." msgstr "" +":meth:`close` raises a new :exc:`GeneratorExit` exception inside the " +"generator to terminate the iteration. On receiving this exception, the " +"generator's code must either raise :exc:`GeneratorExit` or :exc:" +"`StopIteration`. Catching the :exc:`GeneratorExit` exception and returning " +"a value is illegal and will trigger a :exc:`RuntimeError`; if the function " +"raises some other exception, that exception is propagated to the caller. :" +"meth:`close` will also be called by Python's garbage collector when the " +"generator is garbage-collected." #: ../../whatsnew/2.5.rst:512 msgid "" @@ -603,12 +846,17 @@ msgid "" "suggest using a ``try: ... finally:`` suite instead of catching :exc:" "`GeneratorExit`." msgstr "" +"If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I " +"suggest using a ``try: ... finally:`` suite instead of catching :exc:" +"`GeneratorExit`." #: ../../whatsnew/2.5.rst:515 msgid "" "The cumulative effect of these changes is to turn generators from one-way " "producers of information into both producers and consumers." msgstr "" +"The cumulative effect of these changes is to turn generators from one-way " +"producers of information into both producers and consumers." #: ../../whatsnew/2.5.rst:518 msgid "" @@ -619,6 +867,12 @@ msgid "" "statements). We'll have to figure out patterns for using coroutines " "effectively in Python." msgstr "" +"Generators also become *coroutines*, a more generalized form of subroutines. " +"Subroutines are entered at one point and exited at another point (the top of " +"the function, and a :keyword:`return` statement), but coroutines can be " +"entered, exited, and resumed at many different points (the :keyword:`yield` " +"statements). We'll have to figure out patterns for using coroutines " +"effectively in Python." #: ../../whatsnew/2.5.rst:524 msgid "" @@ -634,6 +888,17 @@ msgid "" "necessary in order to implement the :keyword:`with` statement described by :" "pep:`343`. I'll look at this new statement in the following section." msgstr "" +"The addition of the :meth:`close` method has one side effect that isn't " +"obvious. :meth:`close` is called when a generator is garbage-collected, so " +"this means the generator's code gets one last chance to run before the " +"generator is destroyed. This last chance means that ``try...finally`` " +"statements in generators can now be guaranteed to work; the :keyword:" +"`finally` clause will now always get a chance to run. The syntactic " +"restriction that you couldn't mix :keyword:`yield` statements with a ``try..." +"finally`` suite has therefore been removed. This seems like a minor bit of " +"language trivia, but using generators and ``try...finally`` is actually " +"necessary in order to implement the :keyword:`with` statement described by :" +"pep:`343`. I'll look at this new statement in the following section." #: ../../whatsnew/2.5.rst:536 msgid "" @@ -642,6 +907,10 @@ msgid "" "possible for :attr:`gi_frame` to be ``None`` once the generator has been " "exhausted." msgstr "" +"Another even more esoteric effect of this change: previously, the :attr:" +"`gi_frame` attribute of a generator was always a frame object. It's now " +"possible for :attr:`gi_frame` to be ``None`` once the generator has been " +"exhausted." #: ../../whatsnew/2.5.rst:544 msgid ":pep:`342` - Coroutines via Enhanced Generators" @@ -652,32 +921,40 @@ msgid "" "PEP written by Guido van Rossum and Phillip J. Eby; implemented by Phillip " "J. Eby. Includes examples of some fancier uses of generators as coroutines." msgstr "" +"PEP written by Guido van Rossum and Phillip J. Eby; implemented by Phillip " +"J. Eby. Includes examples of some fancier uses of generators as coroutines." #: ../../whatsnew/2.5.rst:548 msgid "" "Earlier versions of these features were proposed in :pep:`288` by Raymond " "Hettinger and :pep:`325` by Samuele Pedroni." msgstr "" +"Earlier versions of these features were proposed in :pep:`288` by Raymond " +"Hettinger and :pep:`325` by Samuele Pedroni." #: ../../whatsnew/2.5.rst:551 msgid "https://en.wikipedia.org/wiki/Coroutine" -msgstr "" +msgstr "https://en.wikipedia.org/wiki/Coroutine" #: ../../whatsnew/2.5.rst:552 msgid "The Wikipedia entry for coroutines." -msgstr "" +msgstr "The Wikipedia entry for coroutines." #: ../../whatsnew/2.5.rst:554 msgid "" "https://web.archive.org/web/20160321211320/http://www.sidhe.org/~dan/blog/" "archives/000178.html" msgstr "" +"https://web.archive.org/web/20160321211320/http://www.sidhe.org/~dan/blog/" +"archives/000178.html" #: ../../whatsnew/2.5.rst:555 msgid "" "An explanation of coroutines from a Perl point of view, written by Dan " "Sugalski." msgstr "" +"An explanation of coroutines from a Perl point of view, written by Dan " +"Sugalski." #: ../../whatsnew/2.5.rst:563 msgid "PEP 343: The 'with' statement" @@ -702,6 +979,8 @@ msgid "" "The ':keyword:`with`' statement is a new control-flow structure whose basic " "structure is::" msgstr "" +"The ':keyword:`with`' statement is a new control-flow structure whose basic " +"structure is::" #: ../../whatsnew/2.5.rst:577 msgid "" @@ -709,6 +988,9 @@ msgid "" "the context management protocol (that is, has :meth:`~object.__enter__` and :" "meth:`~object.__exit__` methods." msgstr "" +"The expression is evaluated, and it should result in an object that supports " +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods." #: ../../whatsnew/2.5.rst:581 msgid "" @@ -717,6 +999,10 @@ msgid "" "is bound to the name *variable*, if given. (Note carefully that *variable* " "is *not* assigned the result of *expression*.)" msgstr "" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" #: ../../whatsnew/2.5.rst:586 msgid "" @@ -724,16 +1010,21 @@ msgid "" "__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " +"therefore run clean-up code." #: ../../whatsnew/2.5.rst:590 msgid "" "To enable the statement in Python 2.5, you need to add the following " "directive to your module::" msgstr "" +"To enable the statement in Python 2.5, you need to add the following " +"directive to your module::" #: ../../whatsnew/2.5.rst:595 msgid "The statement will always be enabled in Python 2.6." -msgstr "" +msgstr "The statement will always be enabled in Python 2.6." #: ../../whatsnew/2.5.rst:597 msgid "" @@ -760,6 +1051,8 @@ msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" "`~object.__enter__` returns *self*." msgstr "" +"In this case, *f* is the same object created by :func:`open`, because :meth:" +"`~object.__enter__` returns *self*." #: ../../whatsnew/2.5.rst:614 msgid "" @@ -783,6 +1076,9 @@ msgid "" "easy to save and restore the current decimal context, which encapsulates the " "desired precision and rounding characteristics for computations::" msgstr "" +"The new :func:`localcontext` function in the :mod:`decimal` module makes it " +"easy to save and restore the current decimal context, which encapsulates the " +"desired precision and rounding characteristics for computations::" #: ../../whatsnew/2.5.rst:644 msgid "Writing Context Managers" @@ -796,6 +1092,11 @@ msgid "" "if you like. Authors of new objects will need to understand the details of " "the underlying implementation and should keep reading." msgstr "" +"Under the hood, the ':keyword:`with`' statement is fairly complicated. Most " +"people will only use ':keyword:`!with`' in company with existing objects and " +"don't need to know these details, so you can skip the rest of this section " +"if you like. Authors of new objects will need to understand the details of " +"the underlying implementation and should keep reading." #: ../../whatsnew/2.5.rst:652 msgid "A high-level explanation of the context management protocol is:" @@ -807,6 +1108,9 @@ msgid "" "\"context manager\". The context manager must have :meth:`~object." "__enter__` and :meth:`~object.__exit__` methods." msgstr "" +"The expression is evaluated and should result in an object called a " +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." #: ../../whatsnew/2.5.rst:658 msgid "" @@ -814,6 +1118,9 @@ msgid "" "returned is assigned to *VAR*. If no ``'as VAR'`` clause is present, the " "value is simply discarded." msgstr "" +"The context manager's :meth:`~object.__enter__` method is called. The value " +"returned is assigned to *VAR*. If no ``'as VAR'`` clause is present, the " +"value is simply discarded." #: ../../whatsnew/2.5.rst:662 msgid "The code in *BLOCK* is executed." @@ -829,12 +1136,21 @@ msgid "" "if you do the author of the code containing the ':keyword:`with`' statement " "will never realize anything went wrong." msgstr "" +"If *BLOCK* raises an exception, the ``__exit__(type, value, traceback)`` is " +"called with the exception details, the same values returned by :func:`sys." +"exc_info`. The method's return value controls whether the exception is re-" +"raised: any false value re-raises the exception, and ``True`` will result in " +"suppressing it. You'll only rarely want to suppress the exception, because " +"if you do the author of the code containing the ':keyword:`with`' statement " +"will never realize anything went wrong." #: ../../whatsnew/2.5.rst:672 msgid "" "If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " "is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." #: ../../whatsnew/2.5.rst:675 msgid "" @@ -863,8 +1179,8 @@ msgid "" "Let's assume there's an object representing a database connection. Our goal " "will be to let the user write code like this::" msgstr "" -"Let's assume there's an object representing a database connection. Our goal " -"will be to let the user write code like this::" +"Vamos supor que exista um objeto representando uma conexão com o banco de " +"dados. Nosso objetivo será permitir que o usuário escreva código como este:" #: ../../whatsnew/2.5.rst:693 msgid "" @@ -872,9 +1188,9 @@ msgid "" "or rolled back if there's an exception. Here's the basic interface for :" "class:`DatabaseConnection` that I'll assume::" msgstr "" -"The transaction should be committed if the code in the block runs flawlessly " -"or rolled back if there's an exception. Here's the basic interface for :" -"class:`DatabaseConnection` that I'll assume::" +"A transação deverá ser confirmada se o código no bloco funcionar " +"perfeitamente ou revertida se houver uma exceção. Aqui está a interface " +"básica para :class:`DatabaseConnection` que presumirei::" #: ../../whatsnew/2.5.rst:706 msgid "" @@ -884,6 +1200,11 @@ msgid "" "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " +"cursor`` to their ':keyword:`with`' statement to bind the cursor to a " +"variable name. ::" #: ../../whatsnew/2.5.rst:718 msgid "" @@ -892,6 +1213,10 @@ msgid "" "exception occurred. If there was no exception, the transaction is " "committed. The transaction is rolled back if there was an exception." msgstr "" +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." #: ../../whatsnew/2.5.rst:723 msgid "" @@ -915,6 +1240,9 @@ msgid "" "that are useful for writing objects for use with the ':keyword:`with`' " "statement." msgstr "" +"The new :mod:`contextlib` module provides some functions and a decorator " +"that are useful for writing objects for use with the ':keyword:`with`' " +"statement." #: ../../whatsnew/2.5.rst:748 msgid "" @@ -928,12 +1256,23 @@ msgid "" "method. Any exception raised in the block will be raised by the :keyword:`!" "yield` statement." msgstr "" +"The decorator is called :func:`contextmanager`, and lets you write a single " +"generator function instead of defining a new class. The generator should " +"yield exactly one value. The code up to the :keyword:`yield` will be " +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." #: ../../whatsnew/2.5.rst:757 msgid "" "Our database example from the previous section could be written using this " "decorator as::" msgstr "" +"Our database example from the previous section could be written using this " +"decorator as::" #: ../../whatsnew/2.5.rst:777 msgid "" @@ -943,12 +1282,19 @@ msgid "" "with`' statement both starts a database transaction and acquires a thread " "lock::" msgstr "" +"The :mod:`contextlib` module also has a ``nested(mgr1, mgr2, ...)`` function " +"that combines a number of context managers so you don't need to write nested " +"':keyword:`with`' statements. In this example, the single ':keyword:`!" +"with`' statement both starts a database transaction and acquires a thread " +"lock::" #: ../../whatsnew/2.5.rst:786 msgid "" "Finally, the ``closing(object)`` function returns *object* so that it can be " "bound to a variable, and calls ``object.close`` at the end of the block. ::" msgstr "" +"Finally, the ``closing(object)`` function returns *object* so that it can be " +"bound to a variable, and calls ``object.close`` at the end of the block. ::" #: ../../whatsnew/2.5.rst:799 msgid ":pep:`343` - The \"with\" statement" @@ -972,7 +1318,7 @@ msgstr "The documentation for the :mod:`contextlib` module." #: ../../whatsnew/2.5.rst:813 msgid "PEP 352: Exceptions as New-Style Classes" -msgstr "" +msgstr "PEP 352: Exceptions as New-Style Classes" #: ../../whatsnew/2.5.rst:815 msgid "" @@ -981,12 +1327,18 @@ msgid "" "exceptions (:exc:`NameError`, :exc:`ValueError`, etc.) are now new-style " "classes." msgstr "" +"Exception classes can now be new-style classes, not just classic classes, " +"and the built-in :exc:`Exception` class and all the standard built-in " +"exceptions (:exc:`NameError`, :exc:`ValueError`, etc.) are now new-style " +"classes." #: ../../whatsnew/2.5.rst:819 msgid "" "The inheritance hierarchy for exceptions has been rearranged a bit. In 2.5, " "the inheritance relationships are::" msgstr "" +"The inheritance hierarchy for exceptions has been rearranged a bit. In 2.5, " +"the inheritance relationships are::" #: ../../whatsnew/2.5.rst:828 msgid "" @@ -998,6 +1350,13 @@ msgid "" "exc:`KeyboardInterrupt` and :exc:`SystemExit` in order to re-raise them. " "The usual pattern is::" msgstr "" +"This rearrangement was done because people often want to catch all " +"exceptions that indicate program errors. :exc:`KeyboardInterrupt` and :exc:" +"`SystemExit` aren't errors, though, and usually represent an explicit action " +"such as the user hitting :kbd:`Control-C` or code calling :func:`sys.exit`. " +"A bare ``except:`` will catch all exceptions, so you commonly need to list :" +"exc:`KeyboardInterrupt` and :exc:`SystemExit` in order to re-raise them. " +"The usual pattern is::" #: ../../whatsnew/2.5.rst:843 msgid "" @@ -1006,6 +1365,10 @@ msgid "" "leaving :exc:`KeyboardInterrupt` and :exc:`SystemExit` alone. As in " "previous versions, a bare ``except:`` still catches all exceptions." msgstr "" +"In Python 2.5, you can now write ``except Exception`` to achieve the same " +"result, catching all the exceptions that usually indicate errors but " +"leaving :exc:`KeyboardInterrupt` and :exc:`SystemExit` alone. As in " +"previous versions, a bare ``except:`` still catches all exceptions." #: ../../whatsnew/2.5.rst:848 msgid "" @@ -1017,6 +1380,13 @@ msgid "" "``except:`` form should be removed in Python 3.0, but Guido van Rossum " "hasn't decided whether to do this or not." msgstr "" +"The goal for Python 3.0 is to require any class raised as an exception to " +"derive from :exc:`BaseException` or some descendant of :exc:`BaseException`, " +"and future releases in the Python 2.x series may begin to enforce this " +"constraint. Therefore, I suggest you begin making all your exception classes " +"derive from :exc:`Exception` now. It's been suggested that the bare " +"``except:`` form should be removed in Python 3.0, but Guido van Rossum " +"hasn't decided whether to do this or not." #: ../../whatsnew/2.5.rst:856 msgid "" @@ -1024,20 +1394,25 @@ msgid "" "occurred\"``, is deprecated in Python 2.5 and will trigger a warning. The " "aim is to be able to remove the string-exception feature in a few releases." msgstr "" +"Raising of strings as exceptions, as in the statement ``raise \"Error " +"occurred\"``, is deprecated in Python 2.5 and will trigger a warning. The " +"aim is to be able to remove the string-exception feature in a few releases." #: ../../whatsnew/2.5.rst:863 msgid ":pep:`352` - Required Superclass for Exceptions" -msgstr "" +msgstr ":pep:`352` - Required Superclass for Exceptions" #: ../../whatsnew/2.5.rst:864 msgid "" "PEP written by Brett Cannon and Guido van Rossum; implemented by Brett " "Cannon." msgstr "" +"PEP written by Brett Cannon and Guido van Rossum; implemented by Brett " +"Cannon." #: ../../whatsnew/2.5.rst:872 msgid "PEP 353: Using ssize_t as the index type" -msgstr "" +msgstr "PEP 353: Using ssize_t as the index type" #: ../../whatsnew/2.5.rst:874 msgid "" @@ -1046,6 +1421,10 @@ msgid "" "handle more data on 64-bit platforms. This change doesn't affect Python's " "capacity on 32-bit platforms." msgstr "" +"A wide-ranging change to Python's C API, using a new :c:type:`Py_ssize_t` " +"type definition instead of :c:expr:`int`, will permit the interpreter to " +"handle more data on 64-bit platforms. This change doesn't affect Python's " +"capacity on 32-bit platforms." #: ../../whatsnew/2.5.rst:879 msgid "" @@ -1058,6 +1437,14 @@ msgid "" "unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the most " "commonly available model leaves :c:expr:`int` as 32 bits.)" msgstr "" +"Various pieces of the Python interpreter used C's :c:expr:`int` type to " +"store sizes or counts; for example, the number of items in a list or tuple " +"were stored in an :c:expr:`int`. The C compilers for most 64-bit platforms " +"still define :c:expr:`int` as a 32-bit type, so that meant that lists could " +"only hold up to ``2**31 - 1`` = 2147483647 items. (There are actually a few " +"different programming models that 64-bit C compilers can use -- see https://" +"unix.org/version2/whatsnew/lp64_wp.html for a discussion -- but the most " +"commonly available model leaves :c:expr:`int` as 32 bits.)" #: ../../whatsnew/2.5.rst:888 msgid "" @@ -1067,6 +1454,11 @@ msgid "" "type:`PyObject` representing the item. 2147483647\\*4 is already more bytes " "than a 32-bit address space can contain." msgstr "" +"A limit of 2147483647 items doesn't really matter on a 32-bit platform " +"because you'll run out of memory before hitting the length limit. Each list " +"item requires space for a pointer, which is 4 bytes, plus space for a :c:" +"type:`PyObject` representing the item. 2147483647\\*4 is already more bytes " +"than a 32-bit address space can contain." #: ../../whatsnew/2.5.rst:894 msgid "" @@ -1080,6 +1472,15 @@ msgid "" "users is still relatively small. (In 5 or 10 years, we may *all* be on 64-" "bit machines, and the transition would be more painful then.)" msgstr "" +"It's possible to address that much memory on a 64-bit platform, however. " +"The pointers for a list that size would only require 16 GiB of space, so " +"it's not unreasonable that Python programmers might construct lists that " +"large. Therefore, the Python interpreter had to be changed to use some type " +"other than :c:expr:`int`, and this will be a 64-bit type on 64-bit " +"platforms. The change will cause incompatibilities on 64-bit machines, so " +"it was deemed worth making the transition now, while the number of 64-bit " +"users is still relatively small. (In 5 or 10 years, we may *all* be on 64-" +"bit machines, and the transition would be more painful then.)" #: ../../whatsnew/2.5.rst:904 msgid "" @@ -1089,6 +1490,11 @@ msgid "" "now return :c:type:`Py_ssize_t`. Code in extension modules may therefore " "need to have some variables changed to :c:type:`Py_ssize_t`." msgstr "" +"This change most strongly affects authors of C extension modules. Python " +"strings and container types such as lists and tuples now use :c:type:" +"`Py_ssize_t` to store their size. Functions such as :c:func:`PyList_Size` " +"now return :c:type:`Py_ssize_t`. Code in extension modules may therefore " +"need to have some variables changed to :c:type:`Py_ssize_t`." #: ../../whatsnew/2.5.rst:910 msgid "" @@ -1098,24 +1504,31 @@ msgid "" "default, but you can define the macro :c:macro:`PY_SSIZE_T_CLEAN` before " "including :file:`Python.h` to make them return :c:type:`Py_ssize_t`." msgstr "" +"The :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` functions have a " +"new conversion code, ``n``, for :c:type:`Py_ssize_t`. :c:func:" +"`PyArg_ParseTuple`'s ``s#`` and ``t#`` still output :c:expr:`int` by " +"default, but you can define the macro :c:macro:`PY_SSIZE_T_CLEAN` before " +"including :file:`Python.h` to make them return :c:type:`Py_ssize_t`." #: ../../whatsnew/2.5.rst:916 msgid "" ":pep:`353` has a section on conversion guidelines that extension authors " "should read to learn about supporting 64-bit platforms." msgstr "" +":pep:`353` has a section on conversion guidelines that extension authors " +"should read to learn about supporting 64-bit platforms." #: ../../whatsnew/2.5.rst:922 msgid ":pep:`353` - Using ssize_t as the index type" -msgstr "" +msgstr ":pep:`353` - Using ssize_t as the index type" #: ../../whatsnew/2.5.rst:923 msgid "PEP written and implemented by Martin von Löwis." -msgstr "" +msgstr "PEP written and implemented by Martin von Löwis." #: ../../whatsnew/2.5.rst:931 msgid "PEP 357: The '__index__' method" -msgstr "" +msgstr "PEP 357: The '__index__' method" #: ../../whatsnew/2.5.rst:933 msgid "" @@ -1127,6 +1540,13 @@ msgid "" "8, 16, 32, and 64 bits, but there was no way to signal that these types " "could be used as slice indexes." msgstr "" +"The NumPy developers had a problem that could only be solved by adding a new " +"special method, :meth:`__index__`. When using slice notation, as in " +"``[start:stop:step]``, the values of the *start*, *stop*, and *step* indexes " +"must all be either integers or long integers. NumPy defines a variety of " +"specialized integer types corresponding to unsigned and signed integers of " +"8, 16, 32, and 64 bits, but there was no way to signal that these types " +"could be used as slice indexes." #: ../../whatsnew/2.5.rst:941 msgid "" @@ -1135,6 +1555,10 @@ msgid "" "meth:`__int__`, floating-point numbers would also become legal slice indexes " "and that's clearly an undesirable behaviour." msgstr "" +"Slicing can't just use the existing :meth:`__int__` method because that " +"method is also used to implement coercion to integers. If slicing used :" +"meth:`__int__`, floating-point numbers would also become legal slice indexes " +"and that's clearly an undesirable behaviour." #: ../../whatsnew/2.5.rst:946 msgid "" @@ -1142,6 +1566,9 @@ msgid "" "no arguments and returns an integer giving the slice index to use. For " "example::" msgstr "" +"Instead, a new special method called :meth:`__index__` was added. It takes " +"no arguments and returns an integer giving the slice index to use. For " +"example::" #: ../../whatsnew/2.5.rst:953 msgid "" @@ -1149,6 +1576,9 @@ msgid "" "interpreter will check that the type returned is correct, and raises a :exc:" "`TypeError` if this requirement isn't met." msgstr "" +"The return value must be either a Python integer or long integer. The " +"interpreter will check that the type returned is correct, and raises a :exc:" +"`TypeError` if this requirement isn't met." #: ../../whatsnew/2.5.rst:957 msgid "" @@ -1157,14 +1587,18 @@ msgid "" "this protocol. ``PyNumber_Index(obj)`` can be used in extension code to call " "the :meth:`__index__` function and retrieve its result." msgstr "" +"A corresponding :c:member:`~PyNumberMethods.nb_index` slot was added to the " +"C-level :c:type:`PyNumberMethods` structure to let C extensions implement " +"this protocol. ``PyNumber_Index(obj)`` can be used in extension code to call " +"the :meth:`__index__` function and retrieve its result." #: ../../whatsnew/2.5.rst:965 msgid ":pep:`357` - Allowing Any Object to be Used for Slicing" -msgstr "" +msgstr ":pep:`357` - Allowing Any Object to be Used for Slicing" #: ../../whatsnew/2.5.rst:966 msgid "PEP written and implemented by Travis Oliphant." -msgstr "" +msgstr "PEP written and implemented by Travis Oliphant." #: ../../whatsnew/2.5.rst:974 msgid "Other Language Changes" @@ -1175,6 +1609,8 @@ msgid "" "Here are all of the changes that Python 2.5 makes to the core Python " "language." msgstr "" +"Here are all of the changes that Python 2.5 makes to the core Python " +"language." #: ../../whatsnew/2.5.rst:978 msgid "" @@ -1185,12 +1621,20 @@ msgid "" "`collections` module. The following example defines a dictionary that " "returns zero for any missing key::" msgstr "" +"The :class:`dict` type has a new hook for letting subclasses provide a " +"default value when a key isn't contained in the dictionary. When a key isn't " +"found, the dictionary's ``__missing__(key)`` method will be called. This " +"hook is used to implement the new :class:`defaultdict` class in the :mod:" +"`collections` module. The following example defines a dictionary that " +"returns zero for any missing key::" #: ../../whatsnew/2.5.rst:993 msgid "" "Both 8-bit and Unicode strings have new ``partition(sep)`` and " "``rpartition(sep)`` methods that simplify a common use case." msgstr "" +"Both 8-bit and Unicode strings have new ``partition(sep)`` and " +"``rpartition(sep)`` methods that simplify a common use case." #: ../../whatsnew/2.5.rst:996 msgid "" @@ -1204,6 +1648,15 @@ msgid "" "tuple but starts searching from the end of the string; the ``r`` stands for " "'reverse'." msgstr "" +"The ``find(S)`` method is often used to get an index which is then used to " +"slice the string and obtain the pieces that are before and after the " +"separator. ``partition(sep)`` condenses this pattern into a single method " +"call that returns a 3-tuple containing the substring before the separator, " +"the separator itself, and the substring after the separator. If the " +"separator isn't found, the first element of the tuple is the entire string " +"and the other two elements are empty. ``rpartition(sep)`` also returns a 3-" +"tuple but starts searching from the end of the string; the ``r`` stands for " +"'reverse'." #: ../../whatsnew/2.5.rst:1005 msgid "Some examples::" @@ -1213,16 +1666,19 @@ msgstr "Alguns exemplos:" msgid "" "(Implemented by Fredrik Lundh following a suggestion by Raymond Hettinger.)" msgstr "" +"(Implemented by Fredrik Lundh following a suggestion by Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:1020 msgid "" "The :meth:`startswith` and :meth:`endswith` methods of string types now " "accept tuples of strings to check for. ::" msgstr "" +"The :meth:`startswith` and :meth:`endswith` methods of string types now " +"accept tuples of strings to check for. ::" #: ../../whatsnew/2.5.rst:1026 msgid "(Implemented by Georg Brandl following a suggestion by Tom Lynn.)" -msgstr "" +msgstr "(Implemented by Georg Brandl following a suggestion by Tom Lynn.)" #: ../../whatsnew/2.5.rst:1030 msgid "" @@ -1233,10 +1689,16 @@ msgid "" "with the smallest/largest return value from this function. For example, to " "find the longest string in a list, you can do::" msgstr "" +"The :func:`min` and :func:`max` built-in functions gained a ``key`` keyword " +"parameter analogous to the ``key`` argument for :meth:`sort`. This " +"parameter supplies a function that takes a single argument and is called for " +"every value in the list; :func:`min`/:func:`max` will return the element " +"with the smallest/largest return value from this function. For example, to " +"find the longest string in a list, you can do::" #: ../../whatsnew/2.5.rst:1043 msgid "(Contributed by Steven Bethard and Raymond Hettinger.)" -msgstr "" +msgstr "(Contributed by Steven Bethard and Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:1045 msgid "" @@ -1247,6 +1709,12 @@ msgid "" "values returned by the iterator evaluate as true. (Suggested by Guido van " "Rossum, and implemented by Raymond Hettinger.)" msgstr "" +"Two new built-in functions, :func:`any` and :func:`all`, evaluate whether an " +"iterator contains any true or false values. :func:`any` returns :const:" +"`True` if any value returned by the iterator is true; otherwise it will " +"return :const:`False`. :func:`all` returns :const:`True` only if all of the " +"values returned by the iterator evaluate as true. (Suggested by Guido van " +"Rossum, and implemented by Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:1052 msgid "" @@ -1257,6 +1725,12 @@ msgid "" "return non-negative numbers, and users often seem to use ``id(self)`` in :" "meth:`__hash__` methods (though this is discouraged)." msgstr "" +"The result of a class's :meth:`__hash__` method can now be either a long " +"integer or a regular integer. If a long integer is returned, the hash of " +"that value is taken. In earlier versions the hash value was required to be " +"a regular integer, but in 2.5 the :func:`id` built-in was changed to always " +"return non-negative numbers, and users often seem to use ``id(self)`` in :" +"meth:`__hash__` methods (though this is discouraged)." #: ../../whatsnew/2.5.rst:1061 msgid "" @@ -1266,6 +1740,11 @@ msgid "" "error. See :pep:`263` for how to declare a module's encoding; for example, " "you might add a line like this near the top of the source file::" msgstr "" +"ASCII is now the default encoding for modules. It's now a syntax error if " +"a module contains string literals with 8-bit characters but doesn't have an " +"encoding declaration. In Python 2.4 this triggered a warning, not a syntax " +"error. See :pep:`263` for how to declare a module's encoding; for example, " +"you might add a line like this near the top of the source file::" #: ../../whatsnew/2.5.rst:1069 msgid "" @@ -1274,6 +1753,10 @@ msgid "" "Unicode using the default ASCII encoding. The result of the comparison is " "false::" msgstr "" +"A new warning, :class:`UnicodeWarning`, is triggered when you attempt to " +"compare a Unicode string and an 8-bit string that can't be converted to " +"Unicode using the default ASCII encoding. The result of the comparison is " +"false::" #: ../../whatsnew/2.5.rst:1081 msgid "" @@ -1284,6 +1767,12 @@ msgid "" "resulted in this exception being raised instead of suppressed by the code " "in :file:`dictobject.c` that implements dictionaries." msgstr "" +"Previously this would raise a :class:`UnicodeDecodeError` exception, but in " +"2.5 this could result in puzzling problems when accessing a dictionary. If " +"you looked up ``unichr(128)`` and ``chr(128)`` was being used as a key, " +"you'd get a :class:`UnicodeDecodeError` exception. Other changes in 2.5 " +"resulted in this exception being raised instead of suppressed by the code " +"in :file:`dictobject.c` that implements dictionaries." #: ../../whatsnew/2.5.rst:1088 msgid "" @@ -1291,10 +1780,13 @@ msgid "" "change might have broken code, so instead :class:`UnicodeWarning` was " "introduced." msgstr "" +"Raising an exception for such a comparison is strictly correct, but the " +"change might have broken code, so instead :class:`UnicodeWarning` was " +"introduced." #: ../../whatsnew/2.5.rst:1091 msgid "(Implemented by Marc-André Lemburg.)" -msgstr "" +msgstr "(Implemented by Marc-André Lemburg.)" #: ../../whatsnew/2.5.rst:1093 msgid "" @@ -1308,20 +1800,31 @@ msgid "" "running the Python executable to display the warning message. (Implemented " "by Thomas Wouters.)" msgstr "" +"One error that Python programmers sometimes make is forgetting to include " +"an :file:`__init__.py` module in a package directory. Debugging this mistake " +"can be confusing, and usually requires running Python with the :option:`-v` " +"switch to log all the paths searched. In Python 2.5, a new :exc:" +"`ImportWarning` warning is triggered when an import would have picked up a " +"directory as a package but no :file:`__init__.py` was found. This warning " +"is silently ignored by default; provide the :option:`-Wd <-W>` option when " +"running the Python executable to display the warning message. (Implemented " +"by Thomas Wouters.)" #: ../../whatsnew/2.5.rst:1102 msgid "" "The list of base classes in a class definition can now be empty. As an " "example, this is now legal::" msgstr "" +"The list of base classes in a class definition can now be empty. As an " +"example, this is now legal::" #: ../../whatsnew/2.5.rst:1108 msgid "(Implemented by Brett Cannon.)" -msgstr "" +msgstr "(Implemented by Brett Cannon.)" #: ../../whatsnew/2.5.rst:1116 msgid "Interactive Interpreter Changes" -msgstr "" +msgstr "Interactive Interpreter Changes" #: ../../whatsnew/2.5.rst:1118 msgid "" @@ -1329,6 +1832,9 @@ msgid "" "strings so that new users get a somewhat helpful message when they try to " "quit::" msgstr "" +"In the interactive interpreter, ``quit`` and ``exit`` have long been " +"strings so that new users get a somewhat helpful message when they try to " +"quit::" #: ../../whatsnew/2.5.rst:1124 msgid "" @@ -1337,6 +1843,10 @@ msgid "" "``quit()`` or ``exit()`` will now exit the interpreter as they expect. " "(Implemented by Georg Brandl.)" msgstr "" +"In Python 2.5, ``quit`` and ``exit`` are now objects that still produce " +"string representations of themselves, but are also callable. Newbies who try " +"``quit()`` or ``exit()`` will now exit the interpreter as they expect. " +"(Implemented by Georg Brandl.)" #: ../../whatsnew/2.5.rst:1129 msgid "" @@ -1344,6 +1854,9 @@ msgid "" "help` and :option:`--version`; on Windows, it also accepts the :option:`/? " "<-?>` option for displaying a help message. (Implemented by Georg Brandl.)" msgstr "" +"The Python executable now accepts the standard long options :option:`--" +"help` and :option:`--version`; on Windows, it also accepts the :option:`/? " +"<-?>` option for displaying a help message. (Implemented by Georg Brandl.)" #: ../../whatsnew/2.5.rst:1139 msgid "Optimizations" @@ -1357,6 +1870,11 @@ msgid "" "LLC with local support from CCP Games. Those optimizations added at this " "sprint are specially marked in the following list." msgstr "" +"Several of the optimizations were developed at the NeedForSpeed sprint, an " +"event held in Reykjavik, Iceland, from May 21--28 2006. The sprint focused " +"on speed enhancements to the CPython implementation and was funded by EWT " +"LLC with local support from CCP Games. Those optimizations added at this " +"sprint are specially marked in the following list." #: ../../whatsnew/2.5.rst:1147 msgid "" @@ -1366,6 +1884,11 @@ msgid "" "and as a result sets will use a third less memory and are somewhat faster. " "(Implemented by Raymond Hettinger.)" msgstr "" +"When they were introduced in Python 2.4, the built-in :class:`set` and :" +"class:`frozenset` types were built on top of Python's dictionary type. In " +"2.5 the internal data structure has been customized for implementing sets, " +"and as a result sets will use a third less memory and are somewhat faster. " +"(Implemented by Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:1153 msgid "" @@ -1375,6 +1898,11 @@ msgid "" "Andrew Dalke at the NeedForSpeed sprint. Character maps were improved by " "Walter Dörwald and Martin von Löwis.)" msgstr "" +"The speed of some Unicode operations, such as finding substrings, string " +"splitting, and character map encoding and decoding, has been improved. " +"(Substring search and splitting improvements were added by Fredrik Lundh and " +"Andrew Dalke at the NeedForSpeed sprint. Character maps were improved by " +"Walter Dörwald and Martin von Löwis.)" #: ../../whatsnew/2.5.rst:1161 msgid "" @@ -1383,6 +1911,10 @@ msgid "" "around 800--1000 digits where the function is 6 times faster. (Contributed " "by Alan McIntyre and committed at the NeedForSpeed sprint.)" msgstr "" +"The ``long(str, base)`` function is now faster on long digit strings because " +"fewer intermediate results are calculated. The peak is for strings of " +"around 800--1000 digits where the function is 6 times faster. (Contributed " +"by Alan McIntyre and committed at the NeedForSpeed sprint.)" #: ../../whatsnew/2.5.rst:1168 msgid "" @@ -1394,6 +1926,13 @@ msgid "" "iteration and these methods will now trigger a :exc:`ValueError` from the :" "meth:`!read\\*` method. (Implemented by Thomas Wouters.)" msgstr "" +"It's now illegal to mix iterating over a file with ``for line in file`` and " +"calling the file object's :meth:`read`/:meth:`readline`/:meth:`readlines` " +"methods. Iteration uses an internal buffer and the :meth:`!read\\*` " +"methods don't use that buffer. Instead they would return the data " +"following the buffer, causing the data to appear out of order. Mixing " +"iteration and these methods will now trigger a :exc:`ValueError` from the :" +"meth:`!read\\*` method. (Implemented by Thomas Wouters.)" #: ../../whatsnew/2.5.rst:1178 msgid "" @@ -1401,6 +1940,9 @@ msgid "" "internal representation and caches this representation, yielding a 20% " "speedup. (Contributed by Bob Ippolito at the NeedForSpeed sprint.)" msgstr "" +"The :mod:`struct` module now compiles structure format strings into an " +"internal representation and caches this representation, yielding a 20% " +"speedup. (Contributed by Bob Ippolito at the NeedForSpeed sprint.)" #: ../../whatsnew/2.5.rst:1182 msgid "" @@ -1408,6 +1950,9 @@ msgid "" "allocator functions instead of the system's :c:func:`malloc` and :c:func:" "`free`. (Contributed by Jack Diederich at the NeedForSpeed sprint.)" msgstr "" +"The :mod:`re` module got a 1 or 2% speedup by switching to Python's " +"allocator functions instead of the system's :c:func:`malloc` and :c:func:" +"`free`. (Contributed by Jack Diederich at the NeedForSpeed sprint.)" #: ../../whatsnew/2.5.rst:1186 msgid "" @@ -1416,6 +1961,10 @@ msgid "" "will do the arithmetic and produce code corresponding to ``a = 5``. " "(Proposed and implemented by Raymond Hettinger.)" msgstr "" +"The code generator's peephole optimizer now performs simple constant folding " +"in expressions. If you write something like ``a = 2+3``, the code generator " +"will do the arithmetic and produce code corresponding to ``a = 5``. " +"(Proposed and implemented by Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:1191 msgid "" @@ -1427,6 +1976,13 @@ msgid "" "may improve cache locality and reduce memory usage a bit. (Contributed by " "Neal Norwitz.)" msgstr "" +"Function calls are now faster because code objects now keep the most " +"recently finished frame (a \"zombie frame\") in an internal field of the " +"code object, reusing it the next time the code object is invoked. (Original " +"patch by Michael Hudson, modified by Armin Rigo and Richard Jones; committed " +"at the NeedForSpeed sprint.) Frame objects are also slightly smaller, which " +"may improve cache locality and reduce memory usage a bit. (Contributed by " +"Neal Norwitz.)" #: ../../whatsnew/2.5.rst:1201 msgid "" @@ -1435,6 +1991,10 @@ msgid "" "therefore about 30% faster than in 2.4. (Contributed by Richard Jones, Georg " "Brandl and Sean Reifschneider at the NeedForSpeed sprint.)" msgstr "" +"Python's built-in exceptions are now new-style classes, a change that speeds " +"up instantiation considerably. Exception handling in Python 2.5 is " +"therefore about 30% faster than in 2.4. (Contributed by Richard Jones, Georg " +"Brandl and Sean Reifschneider at the NeedForSpeed sprint.)" #: ../../whatsnew/2.5.rst:1206 msgid "" @@ -1442,10 +2002,13 @@ msgid "" "so that the interpreter makes fewer :c:func:`open` and :c:func:`stat` calls " "on startup. (Contributed by Martin von Löwis and Georg Brandl.)" msgstr "" +"Importing now caches the paths tried, recording whether they exist or not " +"so that the interpreter makes fewer :c:func:`open` and :c:func:`stat` calls " +"on startup. (Contributed by Martin von Löwis and Georg Brandl.)" #: ../../whatsnew/2.5.rst:1218 msgid "New, Improved, and Removed Modules" -msgstr "" +msgstr "New, Improved, and Removed Modules" #: ../../whatsnew/2.5.rst:1220 msgid "" @@ -1455,6 +2018,11 @@ msgid "" "more complete list of changes, or look through the SVN logs for all the " "details." msgstr "" +"The standard library received many enhancements and bug fixes in Python 2.5. " +"Here's a partial list of the most notable changes, sorted alphabetically by " +"module name. Consult the :file:`Misc/NEWS` file in the source tree for a " +"more complete list of changes, or look through the SVN logs for all the " +"details." #: ../../whatsnew/2.5.rst:1225 msgid "" @@ -1475,6 +2043,16 @@ msgid "" "module documentation for details. (Designed and implemented by Walter " "Dörwald.)" msgstr "" +"The :mod:`codecs` module gained support for incremental codecs. The :func:" +"`codec.lookup` function now returns a :class:`CodecInfo` instance instead of " +"a tuple. :class:`CodecInfo` instances behave like a 4-tuple to preserve " +"backward compatibility but also have the attributes :attr:`encode`, :attr:" +"`decode`, :attr:`incrementalencoder`, :attr:`incrementaldecoder`, :attr:" +"`streamwriter`, and :attr:`streamreader`. Incremental codecs can receive " +"input and produce output in multiple chunks; the output is the same as if " +"the entire input was fed to the non-incremental codec. See the :mod:`codecs` " +"module documentation for details. (Designed and implemented by Walter " +"Dörwald.)" #: ../../whatsnew/2.5.rst:1240 msgid "" @@ -1483,6 +2061,10 @@ msgid "" "like a dictionary but constructs a default value when a key isn't present, " "automatically adding it to the dictionary for the requested key value." msgstr "" +"The :mod:`collections` module gained a new type, :class:`defaultdict`, that " +"subclasses the standard :class:`dict` type. The new type mostly behaves " +"like a dictionary but constructs a default value when a key isn't present, " +"automatically adding it to the dictionary for the requested key value." #: ../../whatsnew/2.5.rst:1245 msgid "" @@ -1492,14 +2074,19 @@ msgid "" "constructors such as :func:`list` or :func:`int`. For example, you can " "make an index of words based on their initial letter like this::" msgstr "" +"The first argument to :class:`defaultdict`'s constructor is a factory " +"function that gets called whenever a key is requested but not found. This " +"factory function receives no arguments, so you can use built-in type " +"constructors such as :func:`list` or :func:`int`. For example, you can " +"make an index of words based on their initial letter like this::" #: ../../whatsnew/2.5.rst:1261 msgid "Printing ``index`` results in the following output::" -msgstr "" +msgstr "Printing ``index`` results in the following output::" #: ../../whatsnew/2.5.rst:1269 msgid "(Contributed by Guido van Rossum.)" -msgstr "" +msgstr "(Contributed by Guido van Rossum.)" #: ../../whatsnew/2.5.rst:1271 msgid "" @@ -1508,6 +2095,10 @@ msgid "" "first occurrence of *value* in the queue, raising :exc:`ValueError` if the " "value isn't found. (Contributed by Raymond Hettinger.)" msgstr "" +"The :class:`deque` double-ended queue type supplied by the :mod:" +"`collections` module now has a ``remove(value)`` method that removes the " +"first occurrence of *value* in the queue, raising :exc:`ValueError` if the " +"value isn't found. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:1276 msgid "" @@ -1515,6 +2106,9 @@ msgid "" "with the new ':keyword:`with`' statement. See section :ref:`contextlibmod` " "for more about this module." msgstr "" +"New module: The :mod:`contextlib` module contains helper functions for use " +"with the new ':keyword:`with`' statement. See section :ref:`contextlibmod` " +"for more about this module." #: ../../whatsnew/2.5.rst:1280 msgid "" @@ -1526,6 +2120,13 @@ msgid "" "the :mod:`profile` module's interface, will continue to be maintained in " "future versions of Python. (Contributed by Armin Rigo.)" msgstr "" +"New module: The :mod:`cProfile` module is a C implementation of the " +"existing :mod:`profile` module that has much lower overhead. The module's " +"interface is the same as :mod:`profile`: you run ``cProfile.run('main()')`` " +"to profile a function, can save profile data to a file, etc. It's not yet " +"known if the Hotshot profiler, which is also written in C but doesn't match " +"the :mod:`profile` module's interface, will continue to be maintained in " +"future versions of Python. (Contributed by Armin Rigo.)" #: ../../whatsnew/2.5.rst:1288 msgid "" @@ -1534,6 +2135,10 @@ msgid "" "*stream* argument to the :class:`Stats` constructor. (Contributed by Skip " "Montanaro.)" msgstr "" +"Also, the :mod:`pstats` module for analyzing the data measured by the " +"profiler now supports directing the output to any file object by supplying a " +"*stream* argument to the :class:`Stats` constructor. (Contributed by Skip " +"Montanaro.)" #: ../../whatsnew/2.5.rst:1292 msgid "" @@ -1546,6 +2151,14 @@ msgid "" "the source; records can span multiple physical lines, so :attr:`line_num` is " "not the same as the number of records read." msgstr "" +"The :mod:`csv` module, which parses files in comma-separated value format, " +"received several enhancements and a number of bugfixes. You can now set the " +"maximum size in bytes of a field by calling the ``csv." +"field_size_limit(new_limit)`` function; omitting the *new_limit* argument " +"will return the currently set limit. The :class:`reader` class now has a :" +"attr:`line_num` attribute that counts the number of physical lines read from " +"the source; records can span multiple physical lines, so :attr:`line_num` is " +"not the same as the number of records read." #: ../../whatsnew/2.5.rst:1301 msgid "" @@ -1558,10 +2171,18 @@ msgid "" "fields are important, the input should be split into lines in a manner that " "preserves the newline characters." msgstr "" +"The CSV parser is now stricter about multi-line quoted fields. Previously, " +"if a line ended within a quoted field without a terminating newline " +"character, a newline would be inserted into the returned field. This " +"behavior caused problems when reading files that contained carriage return " +"characters within fields, so the code was changed to return the field " +"without inserting newlines. As a consequence, if newlines embedded within " +"fields are important, the input should be split into lines in a manner that " +"preserves the newline characters." #: ../../whatsnew/2.5.rst:1309 msgid "(Contributed by Skip Montanaro and Andrew McNamara.)" -msgstr "" +msgstr "(Contributed by Skip Montanaro and Andrew McNamara.)" #: ../../whatsnew/2.5.rst:1311 msgid "" @@ -1570,6 +2191,10 @@ msgid "" "by Josh Spoerri. It uses the same format characters as :func:`time.strptime` " "and :func:`time.strftime`::" msgstr "" +"The :class:`~datetime.datetime` class in the :mod:`datetime` module now has " +"a ``strptime(string, format)`` method for parsing date strings, contributed " +"by Josh Spoerri. It uses the same format characters as :func:`time.strptime` " +"and :func:`time.strftime`::" #: ../../whatsnew/2.5.rst:1321 msgid "" @@ -1578,6 +2203,10 @@ msgid "" "subsequences. Previously, the algorithm would occasionally break a block of " "matching elements into two list entries. (Enhancement by Tim Peters.)" msgstr "" +"The :meth:`SequenceMatcher.get_matching_blocks` method in the :mod:`difflib` " +"module now guarantees to return a minimal list of blocks describing matching " +"subsequences. Previously, the algorithm would occasionally break a block of " +"matching elements into two list entries. (Enhancement by Tim Peters.)" #: ../../whatsnew/2.5.rst:1326 msgid "" @@ -1585,6 +2214,9 @@ msgid "" "from being executed at all. This is intended for code snippets that are " "usage examples intended for the reader and aren't actually test cases." msgstr "" +"The :mod:`doctest` module gained a ``SKIP`` option that keeps an example " +"from being executed at all. This is intended for code snippets that are " +"usage examples intended for the reader and aren't actually test cases." #: ../../whatsnew/2.5.rst:1330 msgid "" @@ -1593,12 +2225,18 @@ msgid "" "easier to use non-ASCII characters in tests contained within a docstring. " "(Contributed by Bjorn Tillenius.)" msgstr "" +"An *encoding* parameter was added to the :func:`testfile` function and the :" +"class:`DocFileSuite` class to specify the file's encoding. This makes it " +"easier to use non-ASCII characters in tests contained within a docstring. " +"(Contributed by Bjorn Tillenius.)" #: ../../whatsnew/2.5.rst:1337 msgid "" "The :mod:`email` package has been updated to version 4.0. (Contributed by " "Barry Warsaw.)" msgstr "" +"The :mod:`email` package has been updated to version 4.0. (Contributed by " +"Barry Warsaw.)" #: ../../whatsnew/2.5.rst:1345 msgid "" @@ -1611,6 +2249,14 @@ msgid "" "`~fileinput.fileno` returns the file descriptor for the currently opened " "file. (Contributed by Georg Brandl.)" msgstr "" +"The :mod:`fileinput` module was made more flexible. Unicode filenames are " +"now supported, and a *mode* parameter that defaults to ``\"r\"`` was added " +"to the :func:`input` function to allow opening files in binary or :term:" +"`universal newlines` mode. Another new parameter, *openhook*, lets you use " +"a function other than :func:`open` to open the input files. Once you're " +"iterating over the set of files, the :class:`FileInput` object's new :meth:" +"`~fileinput.fileno` returns the file descriptor for the currently opened " +"file. (Contributed by Georg Brandl.)" #: ../../whatsnew/2.5.rst:1354 msgid "" @@ -1622,6 +2268,13 @@ msgid "" "*generation* argument of 0, 1, or 2 to specify which generation to collect. " "(Contributed by Barry Warsaw.)" msgstr "" +"In the :mod:`gc` module, the new :func:`get_count` function returns a 3-" +"tuple containing the current collection counts for the three GC " +"generations. This is accounting information for the garbage collector; when " +"these counts reach a specified threshold, a garbage collection sweep will be " +"made. The existing :func:`gc.collect` function now takes an optional " +"*generation* argument of 0, 1, or 2 to specify which generation to collect. " +"(Contributed by Barry Warsaw.)" #: ../../whatsnew/2.5.rst:1361 msgid "" @@ -1630,6 +2283,10 @@ msgid "" "by the :func:`min`/:func:`max` functions and the :meth:`sort` methods. For " "example::" msgstr "" +"The :func:`nsmallest` and :func:`nlargest` functions in the :mod:`heapq` " +"module now support a ``key`` keyword parameter similar to the one provided " +"by the :func:`min`/:func:`max` functions and the :meth:`sort` methods. For " +"example::" #: ../../whatsnew/2.5.rst:1373 ../../whatsnew/2.5.rst:1382 msgid "(Contributed by Raymond Hettinger.)" @@ -1641,12 +2298,17 @@ msgid "" "step arguments. This makes it more compatible with the attributes of slice " "objects, so that you can now write the following::" msgstr "" +"The :func:`itertools.islice` function now accepts ``None`` for the start and " +"step arguments. This makes it more compatible with the attributes of slice " +"objects, so that you can now write the following::" #: ../../whatsnew/2.5.rst:1384 msgid "" "The :func:`format` function in the :mod:`locale` module has been modified " "and two new functions were added, :func:`format_string` and :func:`currency`." msgstr "" +"The :func:`format` function in the :mod:`locale` module has been modified " +"and two new functions were added, :func:`format_string` and :func:`currency`." #: ../../whatsnew/2.5.rst:1387 msgid "" @@ -1657,6 +2319,12 @@ msgid "" "locale's rules for formatting currency in placing a separator between groups " "of three digits." msgstr "" +"The :func:`format` function's *val* parameter could previously be a string " +"as long as no more than one %char specifier appeared; now the parameter must " +"be exactly one %char specifier with no surrounding text. An optional " +"*monetary* parameter was also added which, if ``True``, will use the " +"locale's rules for formatting currency in placing a separator between groups " +"of three digits." #: ../../whatsnew/2.5.rst:1393 msgid "" @@ -1664,16 +2332,21 @@ msgid "" "`format_string` function that works like :func:`format` but also supports " "mixing %char specifiers with arbitrary text." msgstr "" +"To format strings with multiple %char specifiers, use the new :func:" +"`format_string` function that works like :func:`format` but also supports " +"mixing %char specifiers with arbitrary text." #: ../../whatsnew/2.5.rst:1397 msgid "" "A new :func:`currency` function was also added that formats a number " "according to the current locale's settings." msgstr "" +"A new :func:`currency` function was also added that formats a number " +"according to the current locale's settings." #: ../../whatsnew/2.5.rst:1400 msgid "(Contributed by Georg Brandl.)" -msgstr "" +msgstr "(Contributed by Georg Brandl.)" #: ../../whatsnew/2.5.rst:1404 msgid "" @@ -1685,12 +2358,21 @@ msgid "" "unlock the mailbox. The following example converts a maildir-format mailbox " "into an mbox-format one::" msgstr "" +"The :mod:`mailbox` module underwent a massive rewrite to add the capability " +"to modify mailboxes in addition to reading them. A new set of classes that " +"include :class:`mbox`, :class:`MH`, and :class:`Maildir` are used to read " +"mailboxes, and have an ``add(message)`` method to add messages, " +"``remove(key)`` to remove messages, and :meth:`lock`/:meth:`unlock` to lock/" +"unlock the mailbox. The following example converts a maildir-format mailbox " +"into an mbox-format one::" #: ../../whatsnew/2.5.rst:1422 msgid "" "(Contributed by Gregory K. Johnson. Funding was provided by Google's 2005 " "Summer of Code.)" msgstr "" +"(Contributed by Gregory K. Johnson. Funding was provided by Google's 2005 " +"Summer of Code.)" #: ../../whatsnew/2.5.rst:1425 msgid "" @@ -1715,6 +2397,12 @@ msgid "" "method's ``key`` parameter lets you easily sort lists using multiple " "fields. (Contributed by Raymond Hettinger.)" msgstr "" +"The :mod:`operator` module's :func:`itemgetter` and :func:`attrgetter` " +"functions now support multiple fields. A call such as ``operator." +"attrgetter('a', 'b')`` will return a function that retrieves the :attr:`a` " +"and :attr:`b` attributes. Combining this new feature with the :meth:`sort` " +"method's ``key`` parameter lets you easily sort lists using multiple " +"fields. (Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:1440 msgid "" @@ -1724,6 +2412,11 @@ msgid "" "method to break reference cycles created by the object. (Contributed by Greg " "Ward.)" msgstr "" +"The :mod:`optparse` module was updated to version 1.5.1 of the Optik " +"library. The :class:`OptionParser` class gained an :attr:`epilog` attribute, " +"a string that will be printed after the help message, and a :meth:`destroy` " +"method to break reference cycles created by the object. (Contributed by Greg " +"Ward.)" #: ../../whatsnew/2.5.rst:1445 msgid "" @@ -1733,6 +2426,11 @@ msgid "" "that :func:`os.stat` will return times that are precise to fractions of a " "second; not all systems support such precision.)" msgstr "" +"The :mod:`os` module underwent several changes. The :attr:" +"`stat_float_times` variable now defaults to true, meaning that :func:`os." +"stat` will now return time values as floats. (This doesn't necessarily mean " +"that :func:`os.stat` will return times that are precise to fractions of a " +"second; not all systems support such precision.)" #: ../../whatsnew/2.5.rst:1451 msgid "" @@ -1741,6 +2439,10 @@ msgid "" "function. Two new constants for locking are :const:`os.O_SHLOCK` and :const:" "`os.O_EXLOCK`." msgstr "" +"Constants named :const:`os.SEEK_SET`, :const:`os.SEEK_CUR`, and :const:`os." +"SEEK_END` have been added; these are the parameters to the :func:`os.lseek` " +"function. Two new constants for locking are :const:`os.O_SHLOCK` and :const:" +"`os.O_EXLOCK`." #: ../../whatsnew/2.5.rst:1456 msgid "" @@ -1753,6 +2455,14 @@ msgid "" "the :func:`resource.getrusage` function. ``wait4(pid)`` does take a process " "ID. (Contributed by Chad J. Schroeder.)" msgstr "" +"Two new functions, :func:`wait3` and :func:`wait4`, were added. They're " +"similar the :func:`waitpid` function which waits for a child process to exit " +"and returns a tuple of the process ID and its exit status, but :func:`wait3` " +"and :func:`wait4` return additional information. :func:`wait3` doesn't take " +"a process ID as input, so it waits for any child process to exit and returns " +"a 3-tuple of *process-id*, *exit-status*, *resource-usage* as returned from " +"the :func:`resource.getrusage` function. ``wait4(pid)`` does take a process " +"ID. (Contributed by Chad J. Schroeder.)" #: ../../whatsnew/2.5.rst:1465 msgid "" @@ -1761,6 +2471,10 @@ msgid "" "`st_birthtime`. The :attr:`st_flags` attribute is also available, if the " "platform supports it. (Contributed by Antti Louko and Diego Pettenò.)" msgstr "" +"On FreeBSD, the :func:`os.stat` function now returns times with nanosecond " +"resolution, and the returned object now has :attr:`st_gen` and :attr:" +"`st_birthtime`. The :attr:`st_flags` attribute is also available, if the " +"platform supports it. (Contributed by Antti Louko and Diego Pettenò.)" #: ../../whatsnew/2.5.rst:1472 msgid "" @@ -1771,6 +2485,12 @@ msgid "" "can include commands that resume execution, such as ``continue`` or " "``next``. (Contributed by Grégoire Dooms.)" msgstr "" +"The Python debugger provided by the :mod:`pdb` module can now store lists of " +"commands to execute when a breakpoint is reached and execution stops. Once " +"breakpoint #1 has been created, enter ``commands 1`` and enter a series of " +"commands to be executed, finishing the list with ``end``. The command list " +"can include commands that resume execution, such as ``continue`` or " +"``next``. (Contributed by Grégoire Dooms.)" #: ../../whatsnew/2.5.rst:1481 msgid "" @@ -1779,6 +2499,10 @@ msgid "" "must return a tuple of arguments instead. The ability to return ``None`` " "was deprecated in Python 2.4, so this completes the removal of the feature." msgstr "" +"The :mod:`pickle` and :mod:`!cPickle` modules no longer accept a return " +"value of ``None`` from the :meth:`~object.__reduce__` method; the method " +"must return a tuple of arguments instead. The ability to return ``None`` " +"was deprecated in Python 2.4, so this completes the removal of the feature." #: ../../whatsnew/2.5.rst:1486 msgid "" @@ -1787,6 +2511,10 @@ msgid "" "works for packages stored in ZIP-format archives. (Contributed by Phillip J. " "Eby.)" msgstr "" +"The :mod:`pkgutil` module, containing various utility functions for finding " +"packages, was enhanced to support :pep:`302`'s import hooks and now also " +"works for packages stored in ZIP-format archives. (Contributed by Phillip J. " +"Eby.)" #: ../../whatsnew/2.5.rst:1490 msgid "" @@ -1798,12 +2526,21 @@ msgid "" "numeric operations, instead of performing many different operations and " "reducing the result to a single number as :file:`pystone.py` does." msgstr "" +"The pybench benchmark suite by Marc-André Lemburg is now included in the :" +"file:`Tools/pybench` directory. The pybench suite is an improvement on the " +"commonly used :file:`pystone.py` program because pybench provides a more " +"detailed measurement of the interpreter's speed. It times particular " +"operations such as function calls, tuple slicing, method lookups, and " +"numeric operations, instead of performing many different operations and " +"reducing the result to a single number as :file:`pystone.py` does." #: ../../whatsnew/2.5.rst:1498 msgid "" "The :mod:`pyexpat` module now uses version 2.0 of the Expat parser. " "(Contributed by Trent Mick.)" msgstr "" +"The :mod:`pyexpat` module now uses version 2.0 of the Expat parser. " +"(Contributed by Trent Mick.)" #: ../../whatsnew/2.5.rst:1501 msgid "" @@ -1814,6 +2551,12 @@ msgid "" "processing for an item has been completed. (Contributed by Raymond " "Hettinger.)" msgstr "" +"The :class:`~queue.Queue` class provided by the :mod:`Queue` module gained " +"two new methods. :meth:`join` blocks until all items in the queue have been " +"retrieved and all processing work on the items have been completed. Worker " +"threads call the other new method, :meth:`task_done`, to signal that " +"processing for an item has been completed. (Contributed by Raymond " +"Hettinger.)" #: ../../whatsnew/2.5.rst:1507 msgid "" @@ -1821,6 +2564,9 @@ msgid "" "ever since Python 2.0, have finally been deleted. Other deleted modules: :" "mod:`statcache`, :mod:`tzparse`, :mod:`whrandom`." msgstr "" +"The old :mod:`regex` and :mod:`regsub` modules, which have been deprecated " +"ever since Python 2.0, have finally been deleted. Other deleted modules: :" +"mod:`statcache`, :mod:`tzparse`, :mod:`whrandom`." #: ../../whatsnew/2.5.rst:1511 msgid "" @@ -1829,6 +2575,10 @@ msgid "" "the default ``sys.path``, so unless your programs explicitly added the " "directory to ``sys.path``, this removal shouldn't affect your code." msgstr "" +"Also deleted: the :file:`lib-old` directory, which includes ancient modules " +"such as :mod:`dircmp` and :mod:`ni`, was removed. :file:`lib-old` wasn't on " +"the default ``sys.path``, so unless your programs explicitly added the " +"directory to ``sys.path``, this removal shouldn't affect your code." #: ../../whatsnew/2.5.rst:1516 msgid "" @@ -1836,6 +2586,9 @@ msgid "" "`readline` module and therefore now works on non-Unix platforms. (Patch from " "Robert Kiendl.)" msgstr "" +"The :mod:`rlcompleter` module is no longer dependent on importing the :mod:" +"`readline` module and therefore now works on non-Unix platforms. (Patch from " +"Robert Kiendl.)" #: ../../whatsnew/2.5.rst:1522 msgid "" @@ -1845,6 +2598,11 @@ msgid "" "to allow only ``'/'`` and ``'/RPC2'``. Setting :attr:`rpc_paths` to " "``None`` or an empty tuple disables this path checking." msgstr "" +"The :mod:`SimpleXMLRPCServer ` and :mod:`DocXMLRPCServer " +"` classes now have a :attr:`rpc_paths` attribute that " +"constrains XML-RPC operations to a limited set of URL paths; the default is " +"to allow only ``'/'`` and ``'/RPC2'``. Setting :attr:`rpc_paths` to " +"``None`` or an empty tuple disables this path checking." #: ../../whatsnew/2.5.rst:1529 msgid "" @@ -1855,6 +2613,12 @@ msgid "" "linuxjournal.com/article/7356. In Python code, netlink addresses are " "represented as a tuple of 2 integers, ``(pid, group_mask)``." msgstr "" +"The :mod:`socket` module now supports :const:`AF_NETLINK` sockets on Linux, " +"thanks to a patch from Philippe Biondi. Netlink sockets are a Linux-" +"specific mechanism for communications between a user-space process and " +"kernel code; an introductory article about them is at https://www." +"linuxjournal.com/article/7356. In Python code, netlink addresses are " +"represented as a tuple of 2 integers, ``(pid, group_mask)``." #: ../../whatsnew/2.5.rst:1536 msgid "" @@ -1864,6 +2628,11 @@ msgid "" "This means you can put the data directly into an array or a memory-mapped " "file." msgstr "" +"Two new methods on socket objects, ``recv_into(buffer)`` and " +"``recvfrom_into(buffer)``, store the received data in an object that " +"supports the buffer protocol instead of returning the data as a string. " +"This means you can put the data directly into an array or a memory-mapped " +"file." #: ../../whatsnew/2.5.rst:1541 msgid "" @@ -1871,6 +2640,9 @@ msgid "" "`getproto` accessor methods to retrieve the family, type, and protocol " "values for the socket." msgstr "" +"Socket objects also gained :meth:`getfamily`, :meth:`gettype`, and :meth:" +"`getproto` accessor methods to retrieve the family, type, and protocol " +"values for the socket." #: ../../whatsnew/2.5.rst:1545 msgid "" @@ -1887,6 +2659,12 @@ msgid "" "func:`unpack` functions; they'll create :class:`Struct` objects and cache " "them. Or you can use :class:`Struct` instances directly::" msgstr "" +"The :mod:`struct` is now faster because it compiles format strings into :" +"class:`Struct` objects with :meth:`pack` and :meth:`unpack` methods. This " +"is similar to how the :mod:`re` module lets you create compiled regular " +"expression objects. You can still use the module-level :func:`pack` and :" +"func:`unpack` functions; they'll create :class:`Struct` objects and cache " +"them. Or you can use :class:`Struct` instances directly::" #: ../../whatsnew/2.5.rst:1560 msgid "" @@ -1895,6 +2673,10 @@ msgid "" "offset)`` methods. This lets you store data directly into an array or a " "memory-mapped file." msgstr "" +"You can also pack and unpack data to and from buffer objects directly using " +"the ``pack_into(buffer, offset, v1, v2, ...)`` and ``unpack_from(buffer, " +"offset)`` methods. This lets you store data directly into an array or a " +"memory-mapped file." #: ../../whatsnew/2.5.rst:1565 msgid "" @@ -1902,6 +2684,9 @@ msgid "" "NeedForSpeed sprint. Support for buffer objects was added by Martin Blais, " "also at the NeedForSpeed sprint.)" msgstr "" +"(:class:`Struct` objects were implemented by Bob Ippolito at the " +"NeedForSpeed sprint. Support for buffer objects was added by Martin Blais, " +"also at the NeedForSpeed sprint.)" #: ../../whatsnew/2.5.rst:1569 msgid "" @@ -1911,6 +2696,11 @@ msgid "" "name, revision-range)``. For example, at the time of writing my copy of 2.5 " "was reporting ``('CPython', 'trunk', '45313:45315')``." msgstr "" +"The Python developers switched from CVS to Subversion during the 2.5 " +"development process. Information about the exact build version is available " +"as the ``sys.subversion`` variable, a 3-tuple of ``(interpreter-name, branch-" +"name, revision-range)``. For example, at the time of writing my copy of 2.5 " +"was reporting ``('CPython', 'trunk', '45313:45315')``." #: ../../whatsnew/2.5.rst:1575 msgid "" @@ -1919,6 +2709,10 @@ msgid "" "this: ``\"trunk:45355:45356M, Apr 13 2006, 07:42:19\"``. (Contributed by " "Barry Warsaw.)" msgstr "" +"This information is also available to C extensions via the :c:func:" +"`Py_GetBuildInfo` function that returns a string of build information like " +"this: ``\"trunk:45355:45356M, Apr 13 2006, 07:42:19\"``. (Contributed by " +"Barry Warsaw.)" #: ../../whatsnew/2.5.rst:1580 msgid "" @@ -1927,6 +2721,10 @@ msgid "" "the topmost stack frame currently active in that thread at the time the " "function is called. (Contributed by Tim Peters.)" msgstr "" +"Another new function, :func:`sys._current_frames`, returns the current stack " +"frames for all running threads as a dictionary mapping thread identifiers to " +"the topmost stack frame currently active in that thread at the time the " +"function is called. (Contributed by Tim Peters.)" #: ../../whatsnew/2.5.rst:1585 msgid "" @@ -1936,12 +2734,19 @@ msgid "" "as the extraction target, and to unpack only a subset of the archive's " "members." msgstr "" +"The :class:`TarFile` class in the :mod:`tarfile` module now has an :meth:" +"`extractall` method that extracts all members from the archive into the " +"current working directory. It's also possible to set a different directory " +"as the extraction target, and to unpack only a subset of the archive's " +"members." #: ../../whatsnew/2.5.rst:1590 msgid "" "The compression used for a tarfile opened in stream mode can now be " "autodetected using the mode ``'r|*'``. (Contributed by Lars Gustäbel.)" msgstr "" +"The compression used for a tarfile opened in stream mode can now be " +"autodetected using the mode ``'r|*'``. (Contributed by Lars Gustäbel.)" #: ../../whatsnew/2.5.rst:1595 msgid "" @@ -1951,6 +2756,11 @@ msgid "" "sets a new value. Not all platforms support changing the stack size, but " "Windows, POSIX threading, and OS/2 all do. (Contributed by Andrew MacIntyre.)" msgstr "" +"The :mod:`threading` module now lets you set the stack size used when new " +"threads are created. The ``stack_size([*size*])`` function returns the " +"currently configured stack size, and supplying the optional *size* parameter " +"sets a new value. Not all platforms support changing the stack size, but " +"Windows, POSIX threading, and OS/2 all do. (Contributed by Andrew MacIntyre.)" #: ../../whatsnew/2.5.rst:1603 msgid "" @@ -1958,6 +2768,9 @@ msgid "" "Unicode character database. Version 3.2.0 is required by some " "specifications, so it's still available as :data:`unicodedata.ucd_3_2_0`." msgstr "" +"The :mod:`unicodedata` module has been updated to use version 4.1.0 of the " +"Unicode character database. Version 3.2.0 is required by some " +"specifications, so it's still available as :data:`unicodedata.ucd_3_2_0`." #: ../../whatsnew/2.5.rst:1607 msgid "" @@ -1970,10 +2783,18 @@ msgid "" "UUIDs are not specified in :rfc:`4122` and are not supported by this " "module.) ::" msgstr "" +"New module: the :mod:`uuid` module generates universally unique " +"identifiers (UUIDs) according to :rfc:`4122`. The RFC defines several " +"different UUID versions that are generated from a starting string, from " +"system properties, or purely randomly. This module contains a :class:`UUID` " +"class and functions named :func:`uuid1`, :func:`uuid3`, :func:`uuid4`, " +"and :func:`uuid5` to generate different versions of UUID. (Version 2 " +"UUIDs are not specified in :rfc:`4122` and are not supported by this " +"module.) ::" #: ../../whatsnew/2.5.rst:1632 msgid "(Contributed by Ka-Ping Yee.)" -msgstr "" +msgstr "(Contributed by Ka-Ping Yee.)" #: ../../whatsnew/2.5.rst:1634 msgid "" @@ -1984,6 +2805,12 @@ msgid "" "`itervaluerefs` and :meth:`valuerefs` were added to :class:" "`WeakValueDictionary`. (Contributed by Fred L. Drake, Jr.)" msgstr "" +"The :mod:`weakref` module's :class:`WeakKeyDictionary` and :class:" +"`WeakValueDictionary` types gained new methods for iterating over the weak " +"references contained in the dictionary. :meth:`iterkeyrefs` and :meth:" +"`keyrefs` methods were added to :class:`WeakKeyDictionary`, and :meth:" +"`itervaluerefs` and :meth:`valuerefs` were added to :class:" +"`WeakValueDictionary`. (Contributed by Fred L. Drake, Jr.)" #: ../../whatsnew/2.5.rst:1641 msgid "" @@ -1998,6 +2825,16 @@ msgid "" "supported list such as Firefox, Opera, Konqueror, and elinks. (Contributed " "by Oleg Broytmann and Georg Brandl.)" msgstr "" +"The :mod:`webbrowser` module received a number of enhancements. It's now " +"usable as a script with ``python -m webbrowser``, taking a URL as the " +"argument; there are a number of switches to control the behaviour (:option:" +"`!-n` for a new browser window, :option:`!-t` for a new tab). New module-" +"level functions, :func:`open_new` and :func:`open_new_tab`, were added to " +"support this. The module's :func:`open` function supports an additional " +"feature, an *autoraise* parameter that signals whether to raise the open " +"window when possible. A number of additional browsers were added to the " +"supported list such as Firefox, Opera, Konqueror, and elinks. (Contributed " +"by Oleg Broytmann and Georg Brandl.)" #: ../../whatsnew/2.5.rst:1653 msgid "" @@ -2007,6 +2844,11 @@ msgid "" "class:`!Unmarshaller` class to enable this feature. (Contributed by Skip " "Montanaro.)" msgstr "" +"The :mod:`xmlrpclib ` module now supports returning :class:" +"`~datetime.datetime` objects for the XML-RPC date type. Supply " +"``use_datetime=True`` to the :func:`~xmlrpc.client.loads` function or the :" +"class:`!Unmarshaller` class to enable this feature. (Contributed by Skip " +"Montanaro.)" #: ../../whatsnew/2.5.rst:1660 msgid "" @@ -2014,6 +2856,9 @@ msgid "" "meaning that a .zip archive can now be larger than 4 GiB and can contain " "individual files larger than 4 GiB. (Contributed by Ronald Oussoren.)" msgstr "" +"The :mod:`zipfile` module now supports the ZIP64 version of the format, " +"meaning that a .zip archive can now be larger than 4 GiB and can contain " +"individual files larger than 4 GiB. (Contributed by Ronald Oussoren.)" #: ../../whatsnew/2.5.rst:1666 msgid "" @@ -2022,10 +2867,14 @@ msgid "" "internal state and returns a new :class:`Compress` or :class:`Decompress` " "object. (Contributed by Chris AtLee.)" msgstr "" +"The :mod:`zlib` module's :class:`Compress` and :class:`Decompress` objects " +"now support a :meth:`copy` method that makes a copy of the object's " +"internal state and returns a new :class:`Compress` or :class:`Decompress` " +"object. (Contributed by Chris AtLee.)" #: ../../whatsnew/2.5.rst:1679 msgid "The ctypes package" -msgstr "" +msgstr "The ctypes package" #: ../../whatsnew/2.5.rst:1681 msgid "" @@ -2035,6 +2884,11 @@ msgid "" "module, which provides functions for loading shared libraries and calling " "functions in them. The :mod:`ctypes` package is much fancier." msgstr "" +"The :mod:`ctypes` package, written by Thomas Heller, has been added to the " +"standard library. :mod:`ctypes` lets you call arbitrary functions in " +"shared libraries or DLLs. Long-time users may remember the :mod:`!dl` " +"module, which provides functions for loading shared libraries and calling " +"functions in them. The :mod:`ctypes` package is much fancier." #: ../../whatsnew/2.5.rst:1687 msgid "" @@ -2043,6 +2897,10 @@ msgid "" "that's done, you can call arbitrary functions by accessing them as " "attributes of the :class:`CDLL` object. ::" msgstr "" +"To load a shared library or DLL, you must create an instance of the :class:" +"`CDLL` class and provide the name or path of the shared library or DLL. Once " +"that's done, you can call arbitrary functions by accessing them as " +"attributes of the :class:`CDLL` object. ::" #: ../../whatsnew/2.5.rst:1697 msgid "" @@ -2055,6 +2913,14 @@ msgid "" "constructor. (And I mean *must*; getting it wrong will often result in the " "interpreter crashing with a segmentation fault.)" msgstr "" +"Type constructors for the various C types are provided: :func:`c_int`, :func:" +"`c_float`, :func:`c_double`, :func:`c_char_p` (equivalent to :c:expr:`char " +"\\*`), and so forth. Unlike Python's types, the C versions are all mutable; " +"you can assign to their :attr:`value` attribute to change the wrapped " +"value. Python integers and strings will be automatically converted to the " +"corresponding C types, but for other types you must call the correct type " +"constructor. (And I mean *must*; getting it wrong will often result in the " +"interpreter crashing with a segmentation fault.)" #: ../../whatsnew/2.5.rst:1706 msgid "" @@ -2063,12 +2929,18 @@ msgid "" "be immutable; breaking this rule will cause puzzling bugs. When you need a " "modifiable memory area, use :func:`create_string_buffer`::" msgstr "" +"You shouldn't use :func:`c_char_p` with a Python string when the C function " +"will be modifying the memory area, because Python strings are supposed to " +"be immutable; breaking this rule will cause puzzling bugs. When you need a " +"modifiable memory area, use :func:`create_string_buffer`::" #: ../../whatsnew/2.5.rst:1715 msgid "" "C functions are assumed to return integers, but you can set the :attr:" "`restype` attribute of the function object to change this::" msgstr "" +"C functions are assumed to return integers, but you can set the :attr:" +"`restype` attribute of the function object to change this::" #: ../../whatsnew/2.5.rst:1724 msgid "" @@ -2094,24 +2966,31 @@ msgid "" "wrappers atop a library accessed through :mod:`ctypes` instead of extension " "modules, now that :mod:`ctypes` is included with core Python." msgstr "" +":mod:`ctypes` has been around for a while, but people still write and " +"distribution hand-coded extension modules because you can't rely on :mod:" +"`ctypes` being present. Perhaps developers will begin to write Python " +"wrappers atop a library accessed through :mod:`ctypes` instead of extension " +"modules, now that :mod:`ctypes` is included with core Python." #: ../../whatsnew/2.5.rst:1749 msgid "" "https://web.archive.org/web/20180410025338/http://starship.python.net/crew/" "theller/ctypes/" msgstr "" +"https://web.archive.org/web/20180410025338/http://starship.python.net/crew/" +"theller/ctypes/" #: ../../whatsnew/2.5.rst:1750 msgid "The pre-stdlib ctypes web page, with a tutorial, reference, and FAQ." -msgstr "" +msgstr "The pre-stdlib ctypes web page, with a tutorial, reference, and FAQ." #: ../../whatsnew/2.5.rst:1752 msgid "The documentation for the :mod:`ctypes` module." -msgstr "" +msgstr "The documentation for the :mod:`ctypes` module." #: ../../whatsnew/2.5.rst:1760 msgid "The ElementTree package" -msgstr "" +msgstr "The ElementTree package" #: ../../whatsnew/2.5.rst:1762 msgid "" @@ -2121,6 +3000,11 @@ msgid "" "ElementTree 1.2.6. The :mod:`cElementTree` accelerator module is also " "included." msgstr "" +"A subset of Fredrik Lundh's ElementTree library for processing XML has been " +"added to the standard library as :mod:`xml.etree`. The available modules " +"are :mod:`ElementTree`, :mod:`ElementPath`, and :mod:`ElementInclude` from " +"ElementTree 1.2.6. The :mod:`cElementTree` accelerator module is also " +"included." #: ../../whatsnew/2.5.rst:1768 msgid "" @@ -2128,6 +3012,9 @@ msgid "" "Full documentation for ElementTree is available at https://web.archive.org/" "web/20201124024954/http://effbot.org/zone/element-index.htm." msgstr "" +"The rest of this section will provide a brief overview of using ElementTree. " +"Full documentation for ElementTree is available at https://web.archive.org/" +"web/20201124024954/http://effbot.org/zone/element-index.htm." #: ../../whatsnew/2.5.rst:1772 msgid "" @@ -2137,19 +3024,29 @@ msgid "" "the Document Object Model; in the DOM there are many different types of " "node, including :class:`TextNode`.)" msgstr "" +"ElementTree represents an XML document as a tree of element nodes. The text " +"content of the document is stored as the :attr:`text` and :attr:`tail` " +"attributes of (This is one of the major differences between ElementTree and " +"the Document Object Model; in the DOM there are many different types of " +"node, including :class:`TextNode`.)" #: ../../whatsnew/2.5.rst:1778 msgid "" "The most commonly used parsing function is :func:`parse`, that takes either " "a string (assumed to contain a filename) or a file-like object and returns " "an :class:`ElementTree` instance::" -msgstr "" +msgstr "" +"The most commonly used parsing function is :func:`parse`, that takes either " +"a string (assumed to contain a filename) or a file-like object and returns " +"an :class:`ElementTree` instance::" #: ../../whatsnew/2.5.rst:1790 msgid "" "Once you have an :class:`ElementTree` instance, you can call its :meth:" "`getroot` method to get the root :class:`Element` node." msgstr "" +"Once you have an :class:`ElementTree` instance, you can call its :meth:" +"`getroot` method to get the root :class:`Element` node." #: ../../whatsnew/2.5.rst:1793 msgid "" @@ -2158,6 +3055,10 @@ msgid "" "provides a tidy way to incorporate XML fragments, approaching the " "convenience of an XML literal::" msgstr "" +"There's also an :func:`XML` function that takes a string literal and returns " +"an :class:`Element` node (not an :class:`ElementTree`). This function " +"provides a tidy way to incorporate XML fragments, approaching the " +"convenience of an XML literal::" #: ../../whatsnew/2.5.rst:1803 msgid "" @@ -2165,6 +3066,9 @@ msgid "" "methods. Dictionary-like operations are used to access attribute values, " "and list-like operations are used to access child nodes." msgstr "" +"Each XML element supports some dictionary-like and some list-like access " +"methods. Dictionary-like operations are used to access attribute values, " +"and list-like operations are used to access child nodes." #: ../../whatsnew/2.5.rst:1808 msgid "Operation" @@ -2180,7 +3084,7 @@ msgstr "``elem[n]``" #: ../../whatsnew/2.5.rst:1810 msgid "Returns n'th child element." -msgstr "" +msgstr "Returns n'th child element." #: ../../whatsnew/2.5.rst:1812 msgid "``elem[m:n]``" @@ -2188,7 +3092,7 @@ msgstr "``elem[m:n]``" #: ../../whatsnew/2.5.rst:1812 msgid "Returns list of m'th through n'th child elements." -msgstr "" +msgstr "Returns list of m'th through n'th child elements." #: ../../whatsnew/2.5.rst:1815 msgid "``len(elem)``" @@ -2196,7 +3100,7 @@ msgstr "``len(elem)``" #: ../../whatsnew/2.5.rst:1815 msgid "Returns number of child elements." -msgstr "" +msgstr "Returns number of child elements." #: ../../whatsnew/2.5.rst:1817 msgid "``list(elem)``" @@ -2204,7 +3108,7 @@ msgstr "``list(elem)``" #: ../../whatsnew/2.5.rst:1817 msgid "Returns list of child elements." -msgstr "" +msgstr "Returns list of child elements." #: ../../whatsnew/2.5.rst:1819 msgid "``elem.append(elem2)``" @@ -2212,23 +3116,23 @@ msgstr "``elem.append(elem2)``" #: ../../whatsnew/2.5.rst:1819 msgid "Adds *elem2* as a child." -msgstr "" +msgstr "Adds *elem2* as a child." #: ../../whatsnew/2.5.rst:1821 msgid "``elem.insert(index, elem2)``" -msgstr "" +msgstr "``elem.insert(index, elem2)``" #: ../../whatsnew/2.5.rst:1821 msgid "Inserts *elem2* at the specified location." -msgstr "" +msgstr "Inserts *elem2* at the specified location." #: ../../whatsnew/2.5.rst:1823 msgid "``del elem[n]``" -msgstr "" +msgstr "``del elem[n]``" #: ../../whatsnew/2.5.rst:1823 msgid "Deletes n'th child element." -msgstr "" +msgstr "Deletes n'th child element." #: ../../whatsnew/2.5.rst:1825 msgid "``elem.keys()``" @@ -2236,7 +3140,7 @@ msgstr "``elem.keys()``" #: ../../whatsnew/2.5.rst:1825 msgid "Returns list of attribute names." -msgstr "" +msgstr "Returns list of attribute names." #: ../../whatsnew/2.5.rst:1827 msgid "``elem.get(name)``" @@ -2244,15 +3148,15 @@ msgstr "``elem.get(name)``" #: ../../whatsnew/2.5.rst:1827 msgid "Returns value of attribute *name*." -msgstr "" +msgstr "Returns value of attribute *name*." #: ../../whatsnew/2.5.rst:1829 msgid "``elem.set(name, value)``" -msgstr "" +msgstr "``elem.set(name, value)``" #: ../../whatsnew/2.5.rst:1829 msgid "Sets new value for attribute *name*." -msgstr "" +msgstr "Sets new value for attribute *name*." #: ../../whatsnew/2.5.rst:1831 msgid "``elem.attrib``" @@ -2260,15 +3164,15 @@ msgstr "``elem.attrib``" #: ../../whatsnew/2.5.rst:1831 msgid "Retrieves the dictionary containing attributes." -msgstr "" +msgstr "Retrieves the dictionary containing attributes." #: ../../whatsnew/2.5.rst:1834 msgid "``del elem.attrib[name]``" -msgstr "" +msgstr "``del elem.attrib[name]``" #: ../../whatsnew/2.5.rst:1834 msgid "Deletes attribute *name*." -msgstr "" +msgstr "Deletes attribute *name*." #: ../../whatsnew/2.5.rst:1837 msgid "" @@ -2276,6 +3180,9 @@ msgid "" "`Element` nodes. To check if a node is a comment or processing " "instructions::" msgstr "" +"Comments and processing instructions are also represented as :class:" +"`Element` nodes. To check if a node is a comment or processing " +"instructions::" #: ../../whatsnew/2.5.rst:1845 msgid "" @@ -2283,6 +3190,9 @@ msgid "" "method. Like :func:`parse`, it can take either a string or a file-like " "object::" msgstr "" +"To generate XML output, you should call the :meth:`ElementTree.write` " +"method. Like :func:`parse`, it can take either a string or a file-like " +"object::" #: ../../whatsnew/2.5.rst:1855 msgid "" @@ -2293,26 +3203,36 @@ msgid "" "Therefore, it's best to specify a different encoding such as UTF-8 that can " "handle any Unicode character.)" msgstr "" +"(Caution: the default encoding used for output is ASCII. For general XML " +"work, where an element's name may contain arbitrary Unicode characters, " +"ASCII isn't a very useful encoding because it will raise an exception if an " +"element's name contains any characters with values greater than 127. " +"Therefore, it's best to specify a different encoding such as UTF-8 that can " +"handle any Unicode character.)" #: ../../whatsnew/2.5.rst:1862 msgid "" "This section is only a partial description of the ElementTree interfaces. " "Please read the package's official documentation for more details." msgstr "" +"This section is only a partial description of the ElementTree interfaces. " +"Please read the package's official documentation for more details." #: ../../whatsnew/2.5.rst:1868 msgid "" "https://web.archive.org/web/20201124024954/http://effbot.org/zone/element-" "index.htm" msgstr "" +"https://web.archive.org/web/20201124024954/http://effbot.org/zone/element-" +"index.htm" #: ../../whatsnew/2.5.rst:1869 msgid "Official documentation for ElementTree." -msgstr "" +msgstr "Official documentation for ElementTree." #: ../../whatsnew/2.5.rst:1877 msgid "The hashlib package" -msgstr "" +msgstr "The hashlib package" #: ../../whatsnew/2.5.rst:1879 msgid "" @@ -2322,6 +3242,11 @@ msgid "" "SHA-512). When available, the module uses OpenSSL for fast platform " "optimized implementations of algorithms." msgstr "" +"A new :mod:`hashlib` module, written by Gregory P. Smith, has been added to " +"replace the :mod:`!md5` and :mod:`!sha` modules. :mod:`hashlib` adds " +"support for additional secure hashes (SHA-224, SHA-256, SHA-384, and " +"SHA-512). When available, the module uses OpenSSL for fast platform " +"optimized implementations of algorithms." #: ../../whatsnew/2.5.rst:1885 msgid "" @@ -2331,6 +3256,11 @@ msgid "" "significant difference is that the constructor functions for creating new " "hashing objects are named differently. ::" msgstr "" +"The old :mod:`!md5` and :mod:`!sha` modules still exist as wrappers around " +"hashlib to preserve backwards compatibility. The new module's interface is " +"very close to that of the old modules, but not identical. The most " +"significant difference is that the constructor functions for creating new " +"hashing objects are named differently. ::" #: ../../whatsnew/2.5.rst:1914 msgid "" @@ -2340,14 +3270,19 @@ msgid "" "binary string or a string of hex digits, and :meth:`copy` returns a new " "hashing object with the same digest state." msgstr "" +"Once a hash object has been created, its methods are the same as before: " +"``update(string)`` hashes the specified string into the current digest " +"state, :meth:`digest` and :meth:`hexdigest` return the digest value as a " +"binary string or a string of hex digits, and :meth:`copy` returns a new " +"hashing object with the same digest state." #: ../../whatsnew/2.5.rst:1923 msgid "The documentation for the :mod:`hashlib` module." -msgstr "" +msgstr "The documentation for the :mod:`hashlib` module." #: ../../whatsnew/2.5.rst:1931 msgid "The sqlite3 package" -msgstr "" +msgstr "The sqlite3 package" #: ../../whatsnew/2.5.rst:1933 msgid "" @@ -2355,6 +3290,9 @@ msgid "" "embedded database, has been added to the standard library under the package " "name :mod:`sqlite3`." msgstr "" +"The pysqlite module (https://www.pysqlite.org), a wrapper for the SQLite " +"embedded database, has been added to the standard library under the package " +"name :mod:`sqlite3`." #: ../../whatsnew/2.5.rst:1937 msgid "" @@ -2377,6 +3315,8 @@ msgid "" "pysqlite was written by Gerhard Häring and provides a SQL interface " "compliant with the DB-API 2.0 specification described by :pep:`249`." msgstr "" +"pysqlite was written by Gerhard Häring and provides a SQL interface " +"compliant with the DB-API 2.0 specification described by :pep:`249`." #: ../../whatsnew/2.5.rst:1947 msgid "" @@ -2386,6 +3326,11 @@ msgid "" "the build process will compile the module when the necessary headers are " "available." msgstr "" +"If you're compiling the Python source yourself, note that the source tree " +"doesn't include the SQLite code, only the wrapper module. You'll need to " +"have the SQLite libraries and headers installed before compiling Python, and " +"the build process will compile the module when the necessary headers are " +"available." #: ../../whatsnew/2.5.rst:1952 msgid "" @@ -2393,18 +3338,25 @@ msgid "" "represents the database. Here the data will be stored in the :file:`/tmp/" "example` file::" msgstr "" +"To use the module, you must first create a :class:`Connection` object that " +"represents the database. Here the data will be stored in the :file:`/tmp/" +"example` file::" #: ../../whatsnew/2.5.rst:1958 msgid "" "You can also supply the special name ``:memory:`` to create a database in " "RAM." msgstr "" +"You can also supply the special name ``:memory:`` to create a database in " +"RAM." #: ../../whatsnew/2.5.rst:1960 msgid "" "Once you have a :class:`Connection`, you can create a :class:`Cursor` " "object and call its :meth:`execute` method to perform SQL commands::" msgstr "" +"Once you have a :class:`Connection`, you can create a :class:`Cursor` " +"object and call its :meth:`execute` method to perform SQL commands::" #: ../../whatsnew/2.5.rst:1974 msgid "" @@ -2413,6 +3365,10 @@ msgid "" "doing so is insecure; it makes your program vulnerable to an SQL injection " "attack." msgstr "" +"Usually your SQL operations will need to use values from Python variables. " +"You shouldn't assemble your query using Python's string operations because " +"doing so is insecure; it makes your program vulnerable to an SQL injection " +"attack." #: ../../whatsnew/2.5.rst:1978 msgid "" @@ -2422,6 +3378,11 @@ msgid "" "(Other database modules may use a different placeholder, such as ``%s`` or " "``:1``.) For example::" msgstr "" +"Instead, use the DB-API's parameter substitution. Put ``?`` as a " +"placeholder wherever you want to use a value, and then provide a tuple of " +"values as the second argument to the cursor's :meth:`execute` method. " +"(Other database modules may use a different placeholder, such as ``%s`` or " +"``:1``.) For example::" #: ../../whatsnew/2.5.rst:1998 msgid "" @@ -2430,24 +3391,30 @@ msgid "" "retrieve a single matching row, or call :meth:`fetchall` to get a list of " "the matching rows." msgstr "" +"To retrieve data after executing a SELECT statement, you can either treat " +"the cursor as an iterator, call the cursor's :meth:`fetchone` method to " +"retrieve a single matching row, or call :meth:`fetchall` to get a list of " +"the matching rows." #: ../../whatsnew/2.5.rst:2003 msgid "This example uses the iterator form::" -msgstr "" +msgstr "This example uses the iterator form::" #: ../../whatsnew/2.5.rst:2016 msgid "" "For more information about the SQL dialect supported by SQLite, see https://" "www.sqlite.org." msgstr "" +"For more information about the SQL dialect supported by SQLite, see https://" +"www.sqlite.org." #: ../../whatsnew/2.5.rst:2022 msgid "https://www.pysqlite.org" -msgstr "" +msgstr "https://www.pysqlite.org" #: ../../whatsnew/2.5.rst:2023 msgid "The pysqlite web page." -msgstr "" +msgstr "The pysqlite web page." #: ../../whatsnew/2.5.rst:2025 msgid "https://www.sqlite.org" @@ -2463,7 +3430,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:2029 msgid "The documentation for the :mod:`sqlite3` module." -msgstr "" +msgstr "The documentation for the :mod:`sqlite3` module." #: ../../whatsnew/2.5.rst:2031 msgid ":pep:`249` - Database API Specification 2.0" @@ -2475,7 +3442,7 @@ msgstr "PEP escrita por Marc-André Lemburg." #: ../../whatsnew/2.5.rst:2040 msgid "The wsgiref package" -msgstr "" +msgstr "The wsgiref package" #: ../../whatsnew/2.5.rst:2042 msgid "" @@ -2484,6 +3451,10 @@ msgid "" "`333`. The :mod:`wsgiref` package is a reference implementation of the WSGI " "specification." msgstr "" +"The Web Server Gateway Interface (WSGI) v1.0 defines a standard interface " +"between web servers and Python web applications and is described in :pep:" +"`333`. The :mod:`wsgiref` package is a reference implementation of the WSGI " +"specification." #: ../../whatsnew/2.5.rst:2049 msgid "" @@ -2491,28 +3462,33 @@ msgid "" "this server is useful for debugging but isn't intended for production use. " "Setting up a server takes only a few lines of code::" msgstr "" +"The package includes a basic HTTP server that will run a WSGI application; " +"this server is useful for debugging but isn't intended for production use. " +"Setting up a server takes only a few lines of code::" #: ../../whatsnew/2.5.rst:2068 msgid "" "https://web.archive.org/web/20160331090247/http://wsgi.readthedocs.org/en/" "latest/" msgstr "" +"https://web.archive.org/web/20160331090247/http://wsgi.readthedocs.org/en/" +"latest/" #: ../../whatsnew/2.5.rst:2069 msgid "A central web site for WSGI-related resources." -msgstr "" +msgstr "A central web site for WSGI-related resources." #: ../../whatsnew/2.5.rst:2071 msgid ":pep:`333` - Python Web Server Gateway Interface v1.0" -msgstr "" +msgstr ":pep:`333` - Python Web Server Gateway Interface v1.0" #: ../../whatsnew/2.5.rst:2072 msgid "PEP written by Phillip J. Eby." -msgstr "" +msgstr "PEP written by Phillip J. Eby." #: ../../whatsnew/2.5.rst:2080 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/2.5.rst:2082 msgid "Changes to Python's build process and to the C API include:" @@ -2524,6 +3500,9 @@ msgid "" "migration procedure that was supervised and flawlessly carried out by Martin " "von Löwis. The procedure was developed as :pep:`347`." msgstr "" +"The Python source tree was converted from CVS to Subversion, in a complex " +"migration procedure that was supervised and flawlessly carried out by Martin " +"von Löwis. The procedure was developed as :pep:`347`." #: ../../whatsnew/2.5.rst:2088 msgid "" @@ -2533,6 +3512,11 @@ msgid "" "were refcounting problems, often occurring in error-handling code. See " "https://scan.coverity.com for the statistics." msgstr "" +"Coverity, a company that markets a source code analysis tool called Prevent, " +"provided the results of their examination of the Python source code. The " +"analysis found about 60 bugs that were quickly fixed. Many of the bugs " +"were refcounting problems, often occurring in error-handling code. See " +"https://scan.coverity.com for the statistics." #: ../../whatsnew/2.5.rst:2094 msgid "" @@ -2541,6 +3525,10 @@ msgid "" "`int`. See the earlier section :ref:`pep-353` for a discussion of this " "change." msgstr "" +"The largest change to the C API came from :pep:`353`, which modifies the " +"interpreter to use a :c:type:`Py_ssize_t` type definition instead of :c:expr:" +"`int`. See the earlier section :ref:`pep-353` for a discussion of this " +"change." #: ../../whatsnew/2.5.rst:2099 msgid "" @@ -2549,6 +3537,10 @@ msgid "" "converted to an abstract syntax tree (or AST), and it is the abstract " "syntax tree that's traversed to produce the bytecode." msgstr "" +"The design of the bytecode compiler has changed a great deal, no longer " +"generating bytecode by traversing the parse tree. Instead the parse tree is " +"converted to an abstract syntax tree (or AST), and it is the abstract " +"syntax tree that's traversed to produce the bytecode." #: ../../whatsnew/2.5.rst:2104 msgid "" @@ -2556,6 +3548,9 @@ msgid "" "`compile` built-in and specifying ``_ast.PyCF_ONLY_AST`` as the value of " "the *flags* parameter::" msgstr "" +"It's possible for Python code to obtain AST objects by using the :func:" +"`compile` built-in and specifying ``_ast.PyCF_ONLY_AST`` as the value of " +"the *flags* parameter::" #: ../../whatsnew/2.5.rst:2117 msgid "" @@ -2570,6 +3565,16 @@ msgid "" "PyAST_Compile`. For more information, read the source code, and then ask " "questions on python-dev." msgstr "" +"No official documentation has been written for the AST code yet, but :pep:" +"`339` discusses the design. To start learning about the code, read the " +"definition of the various AST nodes in :file:`Parser/Python.asdl`. A Python " +"script reads this file and generates a set of C structure definitions in :" +"file:`Include/Python-ast.h`. The :c:func:`PyParser_ASTFromString` and :c:" +"func:`!PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take " +"Python source as input and return the root of an AST representing the " +"contents. This AST can then be turned into a code object by :c:func:`!" +"PyAST_Compile`. For more information, read the source code, and then ask " +"questions on python-dev." #: ../../whatsnew/2.5.rst:2127 msgid "" @@ -2579,6 +3584,11 @@ msgid "" "Schemenauer, plus the participants in a number of AST sprints at conferences " "such as PyCon." msgstr "" +"The AST code was developed under Jeremy Hylton's management, and implemented " +"by (in alphabetical order) Brett Cannon, Nick Coghlan, Grant Edwards, John " +"Ehresman, Kurt Kaiser, Neal Norwitz, Tim Peters, Armin Rigo, and Neil " +"Schemenauer, plus the participants in a number of AST sprints at conferences " +"such as PyCon." #: ../../whatsnew/2.5.rst:2136 msgid "" @@ -2590,6 +3600,13 @@ msgid "" "the memory may be returned to the operating system. (Implemented by Evan " "Jones, and reworked by Tim Peters.)" msgstr "" +"Evan Jones's patch to obmalloc, first described in a talk at PyCon DC 2005, " +"was applied. Python 2.4 allocated small objects in 256K-sized arenas, but " +"never freed arenas. With this patch, Python will free arenas when they're " +"empty. The net effect is that on some platforms, when you allocate many " +"objects, Python's memory usage may actually drop when you delete them and " +"the memory may be returned to the operating system. (Implemented by Evan " +"Jones, and reworked by Tim Peters.)" #: ../../whatsnew/2.5.rst:2144 msgid "" @@ -2601,6 +3618,13 @@ msgid "" "`PyObject_Realloc`, and :c:func:`PyObject_Free` are another family that's " "supposed to be used for creating Python objects." msgstr "" +"Note that this change means extension modules must be more careful when " +"allocating memory. Python's API has many different functions for allocating " +"memory that are grouped into families. For example, :c:func:" +"`PyMem_Malloc`, :c:func:`PyMem_Realloc`, and :c:func:`PyMem_Free` are one " +"family that allocates raw memory, while :c:func:`PyObject_Malloc`, :c:func:" +"`PyObject_Realloc`, and :c:func:`PyObject_Free` are another family that's " +"supposed to be used for creating Python objects." #: ../../whatsnew/2.5.rst:2152 msgid "" @@ -2612,6 +3636,13 @@ msgid "" "segfault. You should carefully test your C extension modules with Python " "2.5." msgstr "" +"Previously these different families all reduced to the platform's :c:func:" +"`malloc` and :c:func:`free` functions. This meant it didn't matter if you " +"got things wrong and allocated memory with the ``PyMem`` function but freed " +"it with the ``PyObject`` function. With 2.5's changes to obmalloc, these " +"families now do different things and mismatches will probably result in a " +"segfault. You should carefully test your C extension modules with Python " +"2.5." #: ../../whatsnew/2.5.rst:2159 msgid "" @@ -2621,6 +3652,11 @@ msgid "" "`PySet_Contains` and :c:func:`PySet_Size` to examine the set's state. " "(Contributed by Raymond Hettinger.)" msgstr "" +"The built-in set types now have an official C API. Call :c:func:`PySet_New` " +"and :c:func:`PyFrozenSet_New` to create a new set, :c:func:`PySet_Add` and :" +"c:func:`PySet_Discard` to add and remove elements, and :c:func:" +"`PySet_Contains` and :c:func:`PySet_Size` to examine the set's state. " +"(Contributed by Raymond Hettinger.)" #: ../../whatsnew/2.5.rst:2165 msgid "" @@ -2629,6 +3665,10 @@ msgid "" "a string of build information like this: ``\"trunk:45355:45356M, Apr 13 " "2006, 07:42:19\"``. (Contributed by Barry Warsaw.)" msgstr "" +"C code can now obtain information about the exact revision of the Python " +"interpreter by calling the :c:func:`Py_GetBuildInfo` function that returns " +"a string of build information like this: ``\"trunk:45355:45356M, Apr 13 " +"2006, 07:42:19\"``. (Contributed by Barry Warsaw.)" #: ../../whatsnew/2.5.rst:2170 msgid "" @@ -2643,12 +3683,24 @@ msgid "" "these optimizations actually make the code faster. (Contributed by Fredrik " "Lundh at the NeedForSpeed sprint.)" msgstr "" +"Two new macros can be used to indicate C functions that are local to the " +"current file so that a faster calling convention can be used. " +"``Py_LOCAL(type)`` declares the function as returning a value of the " +"specified *type* and uses a fast-calling qualifier. " +"``Py_LOCAL_INLINE(type)`` does the same thing and also requests the function " +"be inlined. If macro :c:macro:`!PY_LOCAL_AGGRESSIVE` is defined before :" +"file:`python.h` is included, a set of more aggressive optimizations are " +"enabled for the module; you should benchmark the results to find out if " +"these optimizations actually make the code faster. (Contributed by Fredrik " +"Lundh at the NeedForSpeed sprint.)" #: ../../whatsnew/2.5.rst:2181 msgid "" "``PyErr_NewException(name, base, dict)`` can now accept a tuple of base " "classes as its *base* argument. (Contributed by Georg Brandl.)" msgstr "" +"``PyErr_NewException(name, base, dict)`` can now accept a tuple of base " +"classes as its *base* argument. (Contributed by Georg Brandl.)" #: ../../whatsnew/2.5.rst:2184 msgid "" @@ -2658,6 +3710,11 @@ msgid "" "A *stacklevel* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the " "function above that, and so forth. (Added by Neal Norwitz.)" msgstr "" +"The :c:func:`!PyErr_Warn` function for issuing warnings is now deprecated in " +"favour of ``PyErr_WarnEx(category, message, stacklevel)`` which lets you " +"specify the number of stack frames separating this function and the caller. " +"A *stacklevel* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the " +"function above that, and so forth. (Added by Neal Norwitz.)" #: ../../whatsnew/2.5.rst:2190 msgid "" @@ -2665,6 +3722,9 @@ msgid "" "compiled with a C++ compiler without errors. (Implemented by Anthony " "Baxter, Martin von Löwis, Skip Montanaro.)" msgstr "" +"The CPython interpreter is still written in C, but the code can now be " +"compiled with a C++ compiler without errors. (Implemented by Anthony " +"Baxter, Martin von Löwis, Skip Montanaro.)" #: ../../whatsnew/2.5.rst:2194 msgid "" @@ -2673,16 +3733,22 @@ msgid "" "unlikely case that your extensions were using it, you can replace it by " "something like the following::" msgstr "" +"The :c:func:`!PyRange_New` function was removed. It was never documented, " +"never used in the core code, and had dangerously lax error checking. In the " +"unlikely case that your extensions were using it, you can replace it by " +"something like the following::" #: ../../whatsnew/2.5.rst:2208 msgid "Port-Specific Changes" -msgstr "" +msgstr "Port-Specific Changes" #: ../../whatsnew/2.5.rst:2210 msgid "" "MacOS X (10.3 and higher): dynamic loading of modules now uses the :c:func:" "`dlopen` function instead of MacOS-specific functions." msgstr "" +"MacOS X (10.3 and higher): dynamic loading of modules now uses the :c:func:" +"`dlopen` function instead of MacOS-specific functions." #: ../../whatsnew/2.5.rst:2213 msgid "" @@ -2691,6 +3757,10 @@ msgid "" "binary able to run on both PowerPC and Intel processors. (Contributed by " "Ronald Oussoren; :issue:`2573`.)" msgstr "" +"MacOS X: an :option:`!--enable-universalsdk` switch was added to the :" +"program:`configure` script that compiles the interpreter as a universal " +"binary able to run on both PowerPC and Intel processors. (Contributed by " +"Ronald Oussoren; :issue:`2573`.)" #: ../../whatsnew/2.5.rst:2218 msgid "" @@ -2698,16 +3768,21 @@ msgid "" "extension modules. :file:`.pyd` is now the only filename extension that " "will be searched for." msgstr "" +"Windows: :file:`.dll` is no longer supported as a filename extension for " +"extension modules. :file:`.pyd` is now the only filename extension that " +"will be searched for." #: ../../whatsnew/2.5.rst:2228 msgid "Porting to Python 2.5" -msgstr "" +msgstr "Porting to Python 2.5" #: ../../whatsnew/2.5.rst:2230 msgid "" "This section lists previously described changes that may require changes to " "your code:" msgstr "" +"This section lists previously described changes that may require changes to " +"your code:" #: ../../whatsnew/2.5.rst:2233 msgid "" @@ -2716,6 +3791,10 @@ msgid "" "encoding declaration. In Python 2.4 this triggered a warning, not a syntax " "error." msgstr "" +"ASCII is now the default encoding for modules. It's now a syntax error if " +"a module contains string literals with 8-bit characters but doesn't have an " +"encoding declaration. In Python 2.4 this triggered a warning, not a syntax " +"error." #: ../../whatsnew/2.5.rst:2238 msgid "" @@ -2723,6 +3802,9 @@ msgid "" "object. Because of the :pep:`342` changes described in section :ref:" "`pep-342`, it's now possible for :attr:`gi_frame` to be ``None``." msgstr "" +"Previously, the :attr:`gi_frame` attribute of a generator was always a frame " +"object. Because of the :pep:`342` changes described in section :ref:" +"`pep-342`, it's now possible for :attr:`gi_frame` to be ``None``." #: ../../whatsnew/2.5.rst:2242 msgid "" @@ -2731,6 +3813,10 @@ msgid "" "Unicode using the default ASCII encoding. Previously such comparisons would " "raise a :class:`UnicodeDecodeError` exception." msgstr "" +"A new warning, :class:`UnicodeWarning`, is triggered when you attempt to " +"compare a Unicode string and an 8-bit string that can't be converted to " +"Unicode using the default ASCII encoding. Previously such comparisons would " +"raise a :class:`UnicodeDecodeError` exception." #: ../../whatsnew/2.5.rst:2247 msgid "" @@ -2739,6 +3825,10 @@ msgid "" "should be split into lines in a manner which preserves the newline " "characters." msgstr "" +"Library: the :mod:`csv` module is now stricter about multi-line quoted " +"fields. If your files contain newlines embedded within fields, the input " +"should be split into lines in a manner which preserves the newline " +"characters." #: ../../whatsnew/2.5.rst:2251 msgid "" @@ -2747,6 +3837,10 @@ msgid "" "appeared. In Python 2.5, the argument must be exactly one %char specifier " "with no surrounding text." msgstr "" +"Library: the :mod:`locale` module's :func:`format` function's would " +"previously accept any string as long as no more than one %char specifier " +"appeared. In Python 2.5, the argument must be exactly one %char specifier " +"with no surrounding text." #: ../../whatsnew/2.5.rst:2256 msgid "" @@ -2755,6 +3849,10 @@ msgid "" "method must return a tuple of arguments instead. The modules also no longer " "accept the deprecated *bin* keyword parameter." msgstr "" +"Library: The :mod:`pickle` and :mod:`!cPickle` modules no longer accept a " +"return value of ``None`` from the :meth:`~object.__reduce__` method; the " +"method must return a tuple of arguments instead. The modules also no longer " +"accept the deprecated *bin* keyword parameter." #: ../../whatsnew/2.5.rst:2261 msgid "" @@ -2764,6 +3862,11 @@ msgid "" "the default is to allow only ``'/'`` and ``'/RPC2'``. Setting :attr:" "`rpc_paths` to ``None`` or an empty tuple disables this path checking." msgstr "" +"Library: The :mod:`SimpleXMLRPCServer ` and :mod:" +"`DocXMLRPCServer ` classes now have a :attr:`rpc_paths` " +"attribute that constrains XML-RPC operations to a limited set of URL paths; " +"the default is to allow only ``'/'`` and ``'/RPC2'``. Setting :attr:" +"`rpc_paths` to ``None`` or an empty tuple disables this path checking." #: ../../whatsnew/2.5.rst:2267 msgid "" @@ -2772,6 +3875,10 @@ msgid "" "to make the same change to avoid warnings and to support 64-bit machines. " "See the earlier section :ref:`pep-353` for a discussion of this change." msgstr "" +"C API: Many functions now use :c:type:`Py_ssize_t` instead of :c:expr:`int` " +"to allow processing more data on 64-bit machines. Extension code may need " +"to make the same change to avoid warnings and to support 64-bit machines. " +"See the earlier section :ref:`pep-353` for a discussion of this change." #: ../../whatsnew/2.5.rst:2272 msgid "" @@ -2780,6 +3887,10 @@ msgid "" "allocated with one family's ``*_Malloc`` must be freed with the " "corresponding family's ``*_Free`` function." msgstr "" +"C API: The obmalloc changes mean that you must be careful to not mix usage " +"of the ``PyMem_*`` and ``PyObject_*`` families of functions. Memory " +"allocated with one family's ``*_Malloc`` must be freed with the " +"corresponding family's ``*_Free`` function." #: ../../whatsnew/2.5.rst:2281 msgid "Acknowledgements" @@ -2795,6 +3906,13 @@ msgid "" "Paul Prescod, James Pryor, Mike Rovner, Scott Weikart, Barry Warsaw, Thomas " "Wouters." msgstr "" +"The author would like to thank the following people for offering " +"suggestions, corrections and assistance with various drafts of this article: " +"Georg Brandl, Nick Coghlan, Phillip J. Eby, Lars Gustäbel, Raymond " +"Hettinger, Ralf W. Grosse-Kunstleve, Kent Johnson, Iain Lowe, Martin von " +"Löwis, Fredrik Lundh, Andrew McNamara, Skip Montanaro, Gustavo Niemeyer, " +"Paul Prescod, James Pryor, Mike Rovner, Scott Weikart, Barry Warsaw, Thomas " +"Wouters." #: ../../whatsnew/2.5.rst:1342 msgid "universal newlines" @@ -2802,4 +3920,4 @@ msgstr "novas linhas universais" #: ../../whatsnew/2.5.rst:1342 msgid "What's new" -msgstr "" +msgstr "What's new" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 5f3c770f4..104b221dc 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -23,10 +23,10 @@ msgstr "" "2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -47,6 +47,8 @@ msgid "" "This article explains the new features in Python 2.6, released on October 1, " "2008. The release schedule is described in :pep:`361`." msgstr "" +"This article explains the new features in Python 2.6, released on October 1, " +"2008. The release schedule is described in :pep:`361`." #: ../../whatsnew/2.6.rst:53 msgid "" @@ -190,6 +192,10 @@ msgid "" "`3100` that describes the general goals for Python 3.0, and then explore the " "higher-numbered PEPs that propose specific features." msgstr "" +"The 3\\ *xxx* series of PEPs, which contains proposals for Python 3.0. :pep:" +"`3000` describes the development process for Python 3.0. Start with :pep:" +"`3100` that describes the general goals for Python 3.0, and then explore the " +"higher-numbered PEPs that propose specific features." #: ../../whatsnew/2.6.rst:134 msgid "Changes to the Development Process" @@ -236,6 +242,16 @@ msgid "" "software projects; Roundup is an open-source project that requires " "volunteers to administer it and a server to host it." msgstr "" +"The infrastructure committee of the Python Software Foundation therefore " +"posted a call for issue trackers, asking volunteers to set up different " +"products and import some of the bugs and patches from SourceForge. Four " +"different trackers were examined: `Jira `__, `Launchpad `__, `Roundup `__, and `Trac `__. The " +"committee eventually settled on Jira and Roundup as the two candidates. " +"Jira is a commercial product that offers no-cost hosted instances to free-" +"software projects; Roundup is an open-source project that requires " +"volunteers to administer it and a server to host it." #: ../../whatsnew/2.6.rst:164 msgid "" @@ -262,6 +278,12 @@ msgid "" "python.org/view/tracker/importer/`` and may be useful to other projects " "wishing to move from SourceForge to Roundup." msgstr "" +"Hosting of the Python bug tracker is kindly provided by `Upfront Systems " +"`__ of Stellenbosch, South Africa. Martin " +"von Löwis put a lot of effort into importing existing bugs and patches from " +"SourceForge; his scripts for this import operation are at ``https://svn." +"python.org/view/tracker/importer/`` and may be useful to other projects " +"wishing to move from SourceForge to Roundup." #: ../../whatsnew/2.6.rst:182 msgid "https://bugs.python.org" @@ -273,7 +295,7 @@ msgstr "The Python bug tracker." #: ../../whatsnew/2.6.rst:185 msgid "https://bugs.jython.org:" -msgstr "" +msgstr "https://bugs.jython.org:" #: ../../whatsnew/2.6.rst:186 msgid "The Jython bug tracker." @@ -281,7 +303,7 @@ msgstr "The Jython bug tracker." #: ../../whatsnew/2.6.rst:188 msgid "https://roundup.sourceforge.io/" -msgstr "" +msgstr "https://roundup.sourceforge.io/" #: ../../whatsnew/2.6.rst:189 msgid "Roundup downloads and documentation." @@ -289,7 +311,7 @@ msgstr "Roundup downloads and documentation." #: ../../whatsnew/2.6.rst:191 msgid "https://svn.python.org/view/tracker/importer/" -msgstr "" +msgstr "https://svn.python.org/view/tracker/importer/" #: ../../whatsnew/2.6.rst:192 msgid "Martin von Löwis's conversion scripts." @@ -341,6 +363,9 @@ msgid "" "building a new toolchain for processing the documentation. The resulting " "package is called Sphinx, and is available from https://www.sphinx-doc.org/." msgstr "" +"During the 2.6 development cycle, Georg Brandl put a lot of effort into " +"building a new toolchain for processing the documentation. The resulting " +"package is called Sphinx, and is available from https://www.sphinx-doc.org/." #: ../../whatsnew/2.6.rst:220 msgid "" @@ -361,10 +386,14 @@ msgid "" "org/en/master/examples.html>`__) have adopted Sphinx as their documentation " "tool." msgstr "" +"Sphinx is a standalone package that can be used for writing, and almost two " +"dozen other projects (`listed on the Sphinx web site `__) have adopted Sphinx as their documentation " +"tool." #: ../../whatsnew/2.6.rst:233 msgid "`Documenting Python `__" -msgstr "" +msgstr "`Documenting Python `__" #: ../../whatsnew/2.6.rst:234 msgid "Describes how to write for Python's documentation." @@ -372,7 +401,7 @@ msgstr "Describes how to write for Python's documentation." #: ../../whatsnew/2.6.rst:236 msgid "`Sphinx `__" -msgstr "" +msgstr "`Sphinx `__" #: ../../whatsnew/2.6.rst:237 msgid "Documentation and code for the Sphinx toolchain." @@ -380,7 +409,7 @@ msgstr "Documentation and code for the Sphinx toolchain." #: ../../whatsnew/2.6.rst:239 msgid "`Docutils `__" -msgstr "" +msgstr "`Docutils `__" #: ../../whatsnew/2.6.rst:240 msgid "The underlying reStructuredText parser and toolset." @@ -400,6 +429,13 @@ msgid "" "from the \"What's New in Python 2.5\" document; if you're familiar with the " "':keyword:`!with`' statement from Python 2.5, you can skip this section." msgstr "" +"The previous version, Python 2.5, added the ':keyword:`with`' statement as " +"an optional feature, to be enabled by a ``from __future__ import " +"with_statement`` directive. In 2.6 the statement no longer needs to be " +"specially enabled; this means that :keyword:`!with` is now always a " +"keyword. The rest of this section is a copy of the corresponding section " +"from the \"What's New in Python 2.5\" document; if you're familiar with the " +"':keyword:`!with`' statement from Python 2.5, you can skip this section." #: ../../whatsnew/2.6.rst:257 msgid "" @@ -429,6 +465,9 @@ msgid "" "the context management protocol (that is, has :meth:`~object.__enter__` and :" "meth:`~object.__exit__` methods)." msgstr "" +"The expression is evaluated, and it should result in an object that supports " +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods)." #: ../../whatsnew/2.6.rst:273 msgid "" @@ -437,6 +476,10 @@ msgid "" "is bound to the name *variable*, if given. (Note carefully that *variable* " "is *not* assigned the result of *expression*.)" msgstr "" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" #: ../../whatsnew/2.6.rst:278 msgid "" @@ -444,6 +487,9 @@ msgid "" "__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " +"therefore run clean-up code." #: ../../whatsnew/2.6.rst:282 msgid "" @@ -470,6 +516,8 @@ msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" "`~object.__enter__` returns *self*." msgstr "" +"In this case, *f* is the same object created by :func:`open`, because :meth:" +"`~object.__enter__` returns *self*." #: ../../whatsnew/2.6.rst:299 msgid "" @@ -509,6 +557,11 @@ msgid "" "if you like. Authors of new objects will need to understand the details of " "the underlying implementation and should keep reading." msgstr "" +"Under the hood, the ':keyword:`with`' statement is fairly complicated. Most " +"people will only use ':keyword:`!with`' in company with existing objects and " +"don't need to know these details, so you can skip the rest of this section " +"if you like. Authors of new objects will need to understand the details of " +"the underlying implementation and should keep reading." #: ../../whatsnew/2.6.rst:337 msgid "A high-level explanation of the context management protocol is:" @@ -520,6 +573,9 @@ msgid "" "\"context manager\". The context manager must have :meth:`~object." "__enter__` and :meth:`~object.__exit__` methods." msgstr "" +"The expression is evaluated and should result in an object called a " +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." #: ../../whatsnew/2.6.rst:343 msgid "" @@ -527,6 +583,9 @@ msgid "" "returned is assigned to *VAR*. If no ``as VAR`` clause is present, the " "value is simply discarded." msgstr "" +"The context manager's :meth:`~object.__enter__` method is called. The value " +"returned is assigned to *VAR*. If no ``as VAR`` clause is present, the " +"value is simply discarded." #: ../../whatsnew/2.6.rst:347 msgid "The code in *BLOCK* is executed." @@ -544,12 +603,23 @@ msgid "" "author of the code containing the ':keyword:`with`' statement will never " "realize anything went wrong." msgstr "" +"If *BLOCK* raises an exception, the context manager's :meth:`~object." +"__exit__` method is called with three arguments, the exception details " +"(``type, value, traceback``, the same values returned by :func:`sys." +"exc_info`, which can also be ``None`` if no exception occurred). The " +"method's return value controls whether an exception is re-raised: any false " +"value re-raises the exception, and ``True`` will result in suppressing it. " +"You'll only rarely want to suppress the exception, because if you do the " +"author of the code containing the ':keyword:`with`' statement will never " +"realize anything went wrong." #: ../../whatsnew/2.6.rst:358 msgid "" "If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " "is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." #: ../../whatsnew/2.6.rst:361 msgid "" @@ -578,8 +648,8 @@ msgid "" "Let's assume there's an object representing a database connection. Our goal " "will be to let the user write code like this::" msgstr "" -"Let's assume there's an object representing a database connection. Our goal " -"will be to let the user write code like this::" +"Vamos supor que exista um objeto representando uma conexão com o banco de " +"dados. Nosso objetivo será permitir que o usuário escreva código como este:" #: ../../whatsnew/2.6.rst:379 msgid "" @@ -587,9 +657,9 @@ msgid "" "or rolled back if there's an exception. Here's the basic interface for :" "class:`DatabaseConnection` that I'll assume::" msgstr "" -"The transaction should be committed if the code in the block runs flawlessly " -"or rolled back if there's an exception. Here's the basic interface for :" -"class:`DatabaseConnection` that I'll assume::" +"A transação deverá ser confirmada se o código no bloco funcionar " +"perfeitamente ou revertida se houver uma exceção. Aqui está a interface " +"básica para :class:`DatabaseConnection` que presumirei::" #: ../../whatsnew/2.6.rst:392 msgid "" @@ -599,6 +669,11 @@ msgid "" "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " +"cursor`` to their ':keyword:`with`' statement to bind the cursor to a " +"variable name. ::" #: ../../whatsnew/2.6.rst:404 msgid "" @@ -607,6 +682,10 @@ msgid "" "exception occurred. If there was no exception, the transaction is " "committed. The transaction is rolled back if there was an exception." msgstr "" +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." #: ../../whatsnew/2.6.rst:409 msgid "" @@ -644,6 +723,15 @@ msgid "" "method. Any exception raised in the block will be raised by the :keyword:`!" "yield` statement." msgstr "" +"The decorator is called :func:`contextmanager`, and lets you write a single " +"generator function instead of defining a new class. The generator should " +"yield exactly one value. The code up to the :keyword:`yield` will be " +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`!yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." #: ../../whatsnew/2.6.rst:443 msgid "" @@ -661,6 +749,11 @@ msgid "" "with`' statement both starts a database transaction and acquires a thread " "lock::" msgstr "" +"The :mod:`contextlib` module also has a ``nested(mgr1, mgr2, ...)`` function " +"that combines a number of context managers so you don't need to write nested " +"':keyword:`with`' statements. In this example, the single ':keyword:`!" +"with`' statement both starts a database transaction and acquires a thread " +"lock::" #: ../../whatsnew/2.6.rst:472 msgid "" @@ -739,6 +832,10 @@ msgid "" "intended to hold locally installed packages available to all users using a " "machine or a particular site installation." msgstr "" +"When you run Python, the module search path ``sys.path`` usually includes a " +"directory whose path ends in ``\"site-packages\"``. This directory is " +"intended to hold locally installed packages available to all users using a " +"machine or a particular site installation." #: ../../whatsnew/2.6.rst:527 msgid "" @@ -935,6 +1032,9 @@ msgid "" "formatting method, :meth:`format`. Support for the :meth:`str.format` " "method has been backported to Python 2.6." msgstr "" +"In Python 3.0, the ``%`` operator is supplemented by a more powerful string " +"formatting method, :meth:`format`. Support for the :meth:`str.format` " +"method has been backported to Python 2.6." #: ../../whatsnew/2.6.rst:722 msgid "" @@ -943,6 +1043,10 @@ msgid "" "formatting template uses curly brackets (``{``, ``}``) as special " "characters::" msgstr "" +"In 2.6, both 8-bit and Unicode strings have a ``.format()`` method that " +"treats the string as a template and takes the arguments to be formatted. The " +"formatting template uses curly brackets (``{``, ``}``) as special " +"characters::" #: ../../whatsnew/2.6.rst:735 msgid "Curly brackets can be escaped by doubling them::" @@ -1371,6 +1475,12 @@ msgid "" "`PyBytes_FromStringAndSize`, and all the other functions and macros used " "with strings." msgstr "" +"At the C level, Python 3.0 will rename the existing 8-bit string type, " +"called :c:type:`!PyStringObject` in Python 2.x, to :c:type:`PyBytesObject`. " +"Python 2.6 uses ``#define`` to support using the names :c:func:" +"`PyBytesObject`, :c:func:`PyBytes_Check`, :c:func:" +"`PyBytes_FromStringAndSize`, and all the other functions and macros used " +"with strings." #: ../../whatsnew/2.6.rst:984 msgid "" @@ -1524,6 +1634,11 @@ msgid "" "module will be rewritten into C for speed, and perhaps the C implementation " "will be backported to the 2.x releases.)" msgstr "" +"(In Python 2.6, :class:`io.StringIO` is implemented in pure Python, so it's " +"pretty slow. You should therefore stick with the existing :mod:`!StringIO` " +"module or :mod:`!cStringIO` for now. At some point Python 3.0's :mod:`io` " +"module will be rewritten into C for speed, and perhaps the C implementation " +"will be backported to the 2.x releases.)" #: ../../whatsnew/2.6.rst:1089 msgid "" @@ -1615,12 +1730,13 @@ msgstr "" #: ../../whatsnew/2.6.rst:1135 msgid ":c:macro:`PyBUF_WRITABLE` indicates that the memory must be writable." -msgstr "" +msgstr ":c:macro:`PyBUF_WRITABLE` indicates that the memory must be writable." #: ../../whatsnew/2.6.rst:1137 msgid "" ":c:macro:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." msgstr "" +":c:macro:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." #: ../../whatsnew/2.6.rst:1139 msgid "" @@ -1628,6 +1744,9 @@ msgid "" "contiguous (last dimension varies the fastest) or Fortran-contiguous (first " "dimension varies the fastest) array layout." msgstr "" +":c:macro:`PyBUF_C_CONTIGUOUS` and :c:macro:`PyBUF_F_CONTIGUOUS` requests a C-" +"contiguous (last dimension varies the fastest) or Fortran-contiguous (first " +"dimension varies the fastest) array layout." #: ../../whatsnew/2.6.rst:1143 msgid "" @@ -1883,7 +2002,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1348 msgid ":pep:`3127` - Integer Literal Support and Syntax" -msgstr "" +msgstr ":pep:`3127` - Integer Literal Support and Syntax" #: ../../whatsnew/2.6.rst:1349 msgid "PEP written by Patrick Maupin; backported to 2.6 by Eric Smith." @@ -2023,6 +2142,9 @@ msgid "" "Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.2>`__ from the R5RS " "Scheme specification." msgstr "" +"`Scheme's number datatypes `__ from the R5RS " +"Scheme specification." #: ../../whatsnew/2.6.rst:1434 msgid "The :mod:`fractions` Module" @@ -2110,13 +2232,13 @@ msgid "" "when :func:`hasattr` encounters them. (Fixed by Benjamin Peterson; :issue:" "`2196`.)" msgstr "" -"The :func:`hasattr` function was catching and ignoring all errors, under the " -"assumption that they meant a :meth:`__getattr__` method was failing somehow " -"and the return value of :func:`hasattr` would therefore be ``False``. This " -"logic shouldn't be applied to :exc:`KeyboardInterrupt` and :exc:" -"`SystemExit`, however; Python 2.6 will no longer discard such exceptions " -"when :func:`hasattr` encounters them. (Fixed by Benjamin Peterson; :issue:" -"`2196`.)" +"A função :func:`hasattr` estava capturando e ignorando todos os erros, sob a " +"suposição de que eles significavam que um método :meth:`__getattr__` estava " +"falhando de alguma forma e o valor de retorno de :func:`hasattr` seria, " +"portanto, ``False``. Esta lógica não deve ser aplicada a :exc:" +"`KeyboardInterrupt` e :exc:`SystemExit`, entretanto; O Python 2.6 não " +"descartará mais tais exceções quando :func:`hasattr` as encontrar. (Correção " +"de Benjamin Peterson; :issue:`2196`.)" #: ../../whatsnew/2.6.rst:1498 msgid "" @@ -2373,6 +2495,11 @@ msgid "" "__func__`. The old names are still supported in Python 2.6, but are gone in " "3.0." msgstr "" +"Instance method objects have new attributes for the object and function " +"comprising the method; the new synonym for :attr:`!im_self` is :attr:" +"`~method.__self__`, and :attr:`!im_func` is also available as :attr:`~method." +"__func__`. The old names are still supported in Python 2.6, but are gone in " +"3.0." #: ../../whatsnew/2.6.rst:1679 msgid "" @@ -2381,6 +2508,10 @@ msgid "" "variables. (Free variables, in this case, are variables referenced in the :" "keyword:`!class` statement that aren't attributes of the class.)" msgstr "" +"An obscure change: when you use the :func:`locals` function inside a :" +"keyword:`class` statement, the resulting dictionary no longer returns free " +"variables. (Free variables, in this case, are variables referenced in the :" +"keyword:`!class` statement that aren't attributes of the class.)" #: ../../whatsnew/2.6.rst:1688 msgid "Optimizations" @@ -2485,6 +2616,8 @@ msgid "" "The ``with`` statement now stores the :meth:`~object.__exit__` method on the " "stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" msgstr "" +"The ``with`` statement now stores the :meth:`~object.__exit__` method on the " +"stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" #: ../../whatsnew/2.6.rst:1738 msgid "" @@ -2498,7 +2631,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:1747 msgid "Interpreter Changes" -msgstr "Alterações do interpretador" +msgstr "Alterações no interpretador" #: ../../whatsnew/2.6.rst:1749 msgid "" @@ -2568,11 +2701,12 @@ msgid "" "file in the source tree for a more complete list of changes, or look through " "the Subversion logs for all the details." msgstr "" -"As in every release, Python's standard library received a number of " -"enhancements and bug fixes. Here's a partial list of the most notable " -"changes, sorted alphabetically by module name. Consult the :file:`Misc/NEWS` " -"file in the source tree for a more complete list of changes, or look through " -"the Subversion logs for all the details." +"Como em todas os lançamentos, a biblioteca padrão do Python recebeu diversas " +"melhorias e correções de bugs. Aqui está uma lista parcial das mudanças mais " +"notáveis, classificadas em ordem alfabética por nome do módulo. Consulte o " +"arquivo :file:`Misc/NEWS` na árvore de código-fonte para uma lista mais " +"completa de alterações, ou procure nos logs do Subversion para todos os " +"detalhes." #: ../../whatsnew/2.6.rst:1786 msgid "" @@ -2580,6 +2714,9 @@ msgid "" "maintained again, and a number of patches and bugfixes were applied. " "(Maintained by Josiah Carlson; see :issue:`1736190` for one patch.)" msgstr "" +"The :mod:`!asyncore` and :mod:`!asynchat` modules are being actively " +"maintained again, and a number of patches and bugfixes were applied. " +"(Maintained by Josiah Carlson; see :issue:`1736190` for one patch.)" #: ../../whatsnew/2.6.rst:1791 msgid "" @@ -2713,6 +2850,9 @@ msgid "" "fieldnames)`` is a factory function that creates subclasses of the standard " "tuple whose fields are accessible by name as well as index. For example::" msgstr "" +"A new data type in the :mod:`collections` module: ``namedtuple(typename, " +"fieldnames)`` is a factory function that creates subclasses of the standard " +"tuple whose fields are accessible by name as well as index. For example::" #: ../../whatsnew/2.6.rst:1870 msgid "" @@ -2721,6 +2861,10 @@ msgid "" "`Decimal.as_tuple` method now returns a named tuple with :attr:`sign`, :attr:" "`digits`, and :attr:`exponent` fields." msgstr "" +"Several places in the standard library that returned tuples have been " +"modified to return :func:`namedtuple` instances. For example, the :meth:" +"`Decimal.as_tuple` method now returns a named tuple with :attr:`sign`, :attr:" +"`digits`, and :attr:`exponent` fields." #: ../../whatsnew/2.6.rst:1877 msgid "" @@ -2742,6 +2886,11 @@ msgid "" "manipulated by JavaScript code. (Contributed by Arvin Schnell; :issue:" "`1638033`.)" msgstr "" +"The :mod:`Cookie ` module's :class:`~http.cookies.Morsel` " +"objects now support an :attr:`~http.cookies.Morsel.httponly` attribute. In " +"some browsers. cookies with this attribute set cannot be accessed or " +"manipulated by JavaScript code. (Contributed by Arvin Schnell; :issue:" +"`1638033`.)" #: ../../whatsnew/2.6.rst:1903 msgid "" @@ -2784,6 +2933,10 @@ msgid "" "New features include some methods for some basic mathematical functions such " "as :meth:`exp` and :meth:`log10`::" msgstr "" +"The :mod:`decimal` module was updated to version 1.66 of `the General " +"Decimal Specification `__. " +"New features include some methods for some basic mathematical functions such " +"as :meth:`exp` and :meth:`log10`::" #: ../../whatsnew/2.6.rst:1935 msgid "" @@ -2905,6 +3058,10 @@ msgid "" "HTTPConnection>` and :class:`HTTPSConnection ` " "class constructors. (Added by Facundo Batista.)" msgstr "" +"An optional ``timeout`` parameter, specifying a timeout measured in seconds, " +"was added to the :class:`httplib.HTTPConnection ` and :class:`HTTPSConnection ` " +"class constructors. (Added by Facundo Batista.)" #: ../../whatsnew/2.6.rst:1994 msgid "" @@ -3414,6 +3571,12 @@ msgid "" "modifying the recorded event mask for that file. (Contributed by Christian " "Heimes; :issue:`1657`.)" msgstr "" +"The :mod:`select` module now has wrapper functions for the Linux :c:func:`!" +"epoll` and BSD :c:func:`!kqueue` system calls. :meth:`modify` method was " +"added to the existing :class:`poll` objects; ``pollobj.modify(fd, " +"eventmask)`` takes a file descriptor or file object and an event mask, " +"modifying the recorded event mask for that file. (Contributed by Christian " +"Heimes; :issue:`1657`.)" #: ../../whatsnew/2.6.rst:2294 msgid "" @@ -3476,6 +3639,12 @@ msgid "" "`!poll`. On receiving a signal, a byte will be written and the main event " "loop will be woken up, avoiding the need to poll." msgstr "" +"Event loops will use this by opening a pipe to create two descriptors, one " +"for reading and one for writing. The writable descriptor will be passed to :" +"func:`set_wakeup_fd`, and the readable descriptor will be added to the list " +"of descriptors monitored by the event loop via :c:func:`!select` or :c:func:" +"`!poll`. On receiving a signal, a byte will be written and the main event " +"loop will be woken up, avoiding the need to poll." #: ../../whatsnew/2.6.rst:2330 msgid "(Contributed by Adam Olsen; :issue:`1583`.)" @@ -3550,6 +3719,10 @@ msgid "" "environments. TIPC addresses are 4- or 5-tuples. (Contributed by Alberto " "Bertogli; :issue:`1646`.)" msgstr "" +"The :mod:`socket` module now supports TIPC (https://tipc.sourceforge.net/), " +"a high-performance non-IP-based protocol designed for use in clustered " +"environments. TIPC addresses are 4- or 5-tuples. (Contributed by Alberto " +"Bertogli; :issue:`1646`.)" #: ../../whatsnew/2.6.rst:2366 msgid "" @@ -3578,6 +3751,14 @@ msgid "" "check for a shutdown request. (Contributed by Pedro Werneck and Jeffrey " "Yasskin; :issue:`742598`, :issue:`1193577`.)" msgstr "" +"The base classes in the :mod:`SocketServer ` module now " +"support calling a :meth:`~socketserver.BaseServer.handle_timeout` method " +"after a span of inactivity specified by the server's :attr:`~socketserver." +"BaseServer.timeout` attribute. (Contributed by Michael Pomraning.) The :" +"meth:`~socketserver.BaseServer.serve_forever` method now takes an optional " +"poll interval measured in seconds, controlling how often the server will " +"check for a shutdown request. (Contributed by Pedro Werneck and Jeffrey " +"Yasskin; :issue:`742598`, :issue:`1193577`.)" #: ../../whatsnew/2.6.rst:2383 msgid "" @@ -3592,6 +3773,8 @@ msgid "" "The :mod:`struct` module now supports the C99 :c:expr:`_Bool` type, using " "the format character ``'?'``. (Contributed by David Remahl.)" msgstr "" +"The :mod:`struct` module now supports the C99 :c:expr:`_Bool` type, using " +"the format character ``'?'``. (Contributed by David Remahl.)" #: ../../whatsnew/2.6.rst:2391 msgid "" @@ -3602,6 +3785,12 @@ msgid "" "and all these methods are aliases for the Win32 API function :c:func:`!" "TerminateProcess`. (Contributed by Christian Heimes.)" msgstr "" +"The :class:`~subprocess.Popen` objects provided by the :mod:`subprocess` " +"module now have :meth:`~subprocess.Popen.terminate`, :meth:`~subprocess." +"Popen.kill`, and :meth:`~subprocess.Popen.send_signal` methods. On Windows, :" +"meth:`!send_signal` only supports the :py:const:`~signal.SIGTERM` signal, " +"and all these methods are aliases for the Win32 API function :c:func:`!" +"TerminateProcess`. (Contributed by Christian Heimes.)" #: ../../whatsnew/2.6.rst:2398 msgid "" @@ -3714,6 +3903,12 @@ msgid "" "initially passed to :meth:`add` and to the names of files in recursively " "added directories." msgstr "" +"The :meth:`TarFile.add` method now accepts an ``exclude`` argument that's a " +"function that can be used to exclude certain filenames from an archive. The " +"function must take a filename and return true if the file should be excluded " +"or false if it should be archived. The function is applied to both the name " +"initially passed to :meth:`add` and to the names of files in recursively " +"added directories." #: ../../whatsnew/2.6.rst:2460 msgid "(All changes contributed by Lars Gustäbel)." @@ -3772,6 +3967,10 @@ msgid "" "EnvironmentVarGuard` is a context manager that temporarily changes " "environment variables and automatically restores them to their old values." msgstr "" +"The :mod:`test.test_support ` module gained a number of " +"context managers useful for writing tests. :func:`~test.support.os_helper." +"EnvironmentVarGuard` is a context manager that temporarily changes " +"environment variables and automatically restores them to their old values." #: ../../whatsnew/2.6.rst:2487 msgid "" @@ -3805,6 +4004,9 @@ msgid "" "beginnings and ends of the newly created lines by specifying " "``drop_whitespace=False`` as an argument::" msgstr "" +"The :mod:`textwrap` module can now preserve existing whitespace at the " +"beginnings and ends of the newly created lines by specifying " +"``drop_whitespace=False`` as an argument::" #: ../../whatsnew/2.6.rst:2529 msgid "(Contributed by Dwayne Bailey; :issue:`1581073`.)" @@ -3936,6 +4138,11 @@ msgid "" "function. The parameter specifies a timeout measured in seconds. For " "example::" msgstr "" +"An optional ``timeout`` parameter was added to the :func:`urllib.urlopen " +"` function and the :class:`urllib.ftpwrapper` class " +"constructor, as well as the :func:`urllib2.urlopen ` " +"function. The parameter specifies a timeout measured in seconds. For " +"example::" #: ../../whatsnew/2.6.rst:2592 msgid "(Added by Facundo Batista.)" @@ -3982,6 +4189,14 @@ msgid "" "begin listening for connections. (Contributed by Peter Parente; :issue:" "`1599845`.)" msgstr "" +"The XML-RPC :class:`SimpleXMLRPCServer ` and :class:" +"`DocXMLRPCServer ` classes can now be prevented from " +"immediately opening and binding to their socket by passing ``False`` as the " +"*bind_and_activate* constructor parameter. This can be used to modify the " +"instance's :attr:`allow_reuse_address` attribute before calling the :meth:" +"`server_bind` and :meth:`server_activate` methods to open the socket and " +"begin listening for connections. (Contributed by Peter Parente; :issue:" +"`1599845`.)" #: ../../whatsnew/2.6.rst:2616 msgid "" @@ -4013,6 +4228,15 @@ msgid "" "by using ```` in XML-RPC responses (contributed by Riku Lindblad; :issue:" "`2985`)." msgstr "" +"The :mod:`xmlrpclib ` module no longer automatically " +"converts :class:`datetime.date` and :class:`datetime.time` to the :class:" +"`xmlrpclib.DateTime ` type; the conversion semantics " +"were not necessarily correct for all applications. Code using :mod:`!" +"xmlrpclib` should convert :class:`date` and :class:`~datetime.time` " +"instances. (:issue:`1330538`) The code can also handle dates before 1900 " +"(contributed by Ralf Schmitt; :issue:`2014`) and 64-bit integers represented " +"by using ```` in XML-RPC responses (contributed by Riku Lindblad; :issue:" +"`2985`)." #: ../../whatsnew/2.6.rst:2634 msgid "" @@ -4363,6 +4587,9 @@ msgid "" "continue to be made. For 2.6, the :attr:`!message` attribute is being " "deprecated in favor of the :attr:`~BaseException.args` attribute." msgstr "" +"Changes to the :class:`Exception` interface as dictated by :pep:`352` " +"continue to be made. For 2.6, the :attr:`!message` attribute is being " +"deprecated in favor of the :attr:`~BaseException.args` attribute." #: ../../whatsnew/2.6.rst:2916 msgid "" @@ -4384,54 +4611,73 @@ msgid "" "mod:`!statvfs`, :mod:`!sunaudiodev`, :mod:`!test.testall`, and :mod:`!" "toaiff`." msgstr "" +"The list of deprecated modules is: :mod:`!audiodev`, :mod:`!bgenlocations`, :" +"mod:`!buildtools`, :mod:`!bundlebuilder`, :mod:`!Canvas`, :mod:`!compiler`, :" +"mod:`!dircache`, :mod:`!dl`, :mod:`!fpformat`, :mod:`!gensuitemodule`, :mod:" +"`!ihooks`, :mod:`!imageop`, :mod:`!imgfile`, :mod:`!linuxaudiodev`, :mod:`!" +"mhlib`, :mod:`!mimetools`, :mod:`!multifile`, :mod:`!new`, :mod:`!pure`, :" +"mod:`!statvfs`, :mod:`!sunaudiodev`, :mod:`!test.testall`, and :mod:`!" +"toaiff`." #: ../../whatsnew/2.6.rst:2946 msgid "The :mod:`!gopherlib` module has been removed." -msgstr "" +msgstr "The :mod:`!gopherlib` module has been removed." #: ../../whatsnew/2.6.rst:2948 msgid "" "The :mod:`!MimeWriter` module and :mod:`!mimify` module have been " "deprecated; use the :mod:`email` package instead." msgstr "" +"The :mod:`!MimeWriter` module and :mod:`!mimify` module have been " +"deprecated; use the :mod:`email` package instead." #: ../../whatsnew/2.6.rst:2952 msgid "" "The :mod:`!md5` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" +"The :mod:`!md5` module has been deprecated; use the :mod:`hashlib` module " +"instead." #: ../../whatsnew/2.6.rst:2955 msgid "" "The :mod:`!posixfile` module has been deprecated; :func:`fcntl.lockf` " "provides better locking." msgstr "" +"The :mod:`!posixfile` module has been deprecated; :func:`fcntl.lockf` " +"provides better locking." #: ../../whatsnew/2.6.rst:2958 msgid "" "The :mod:`!popen2` module has been deprecated; use the :mod:`subprocess` " "module." msgstr "" +"The :mod:`!popen2` module has been deprecated; use the :mod:`subprocess` " +"module." #: ../../whatsnew/2.6.rst:2961 msgid "The :mod:`!rgbimg` module has been removed." -msgstr "" +msgstr "The :mod:`!rgbimg` module has been removed." #: ../../whatsnew/2.6.rst:2963 msgid "" "The :mod:`!sets` module has been deprecated; it's better to use the built-" "in :class:`set` and :class:`frozenset` types." msgstr "" +"The :mod:`!sets` module has been deprecated; it's better to use the built-" +"in :class:`set` and :class:`frozenset` types." #: ../../whatsnew/2.6.rst:2966 msgid "" "The :mod:`!sha` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" +"The :mod:`!sha` module has been deprecated; use the :mod:`hashlib` module " +"instead." #: ../../whatsnew/2.6.rst:2974 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/2.6.rst:2976 msgid "Changes to Python's build process and to the C API include:" @@ -4444,6 +4690,10 @@ msgid "" "func:`!memmove` and :c:func:`!strerror`, which are in the C89 standard " "library." msgstr "" +"Python now must be compiled with C89 compilers (after 19 years!). This " +"means that the Python source tree has dropped its own implementations of :c:" +"func:`!memmove` and :c:func:`!strerror`, which are in the C89 standard " +"library." #: ../../whatsnew/2.6.rst:2983 msgid "" @@ -4476,6 +4726,10 @@ msgid "" "directory containing the script named by ``sys.argv[0]`` depending on the " "value of an *updatepath* parameter." msgstr "" +"A new function added in Python 2.6.6, :c:func:`!PySys_SetArgvEx`, sets the " +"value of ``sys.argv`` and can optionally update ``sys.path`` to include the " +"directory containing the script named by ``sys.argv[0]`` depending on the " +"value of an *updatepath* parameter." #: ../../whatsnew/2.6.rst:3000 msgid "" @@ -4487,6 +4741,13 @@ msgid "" "(say, a file named :file:`os.py`) that your application would then import " "and run." msgstr "" +"Esta função foi adicionada para fechar uma falha de segurança em aplicativos " +"que incorporam Python. A função antiga, :c:func:`!PySys_SetArgv`, sempre " +"atualizava ``sys.path``, e às vezes adicionava o diretório atual. Isso " +"significava que, se você executasse uma aplicação incorporando Python em um " +"diretório controlado por outra pessoa, os invasores poderiam colocar um " +"módulo cavalo de Troia no diretório (digamos, um arquivo chamado :file:`os." +"py`) que sua aplicação então usaria. importar e executar." #: ../../whatsnew/2.6.rst:3008 msgid "" @@ -4499,12 +4760,22 @@ msgid "" "and call ``PyRun_SimpleString(\"sys.path.pop(0)\\n\")`` afterwards to " "discard the first ``sys.path`` component." msgstr "" +"If you maintain a C/C++ application that embeds Python, check whether you're " +"calling :c:func:`!PySys_SetArgv` and carefully consider whether the " +"application should be using :c:func:`!PySys_SetArgvEx` with *updatepath* set " +"to false. Note that using this function will break compatibility with " +"Python versions 2.6.5 and earlier; if you have to continue working with " +"earlier versions, you can leave the call to :c:func:`!PySys_SetArgv` alone " +"and call ``PyRun_SimpleString(\"sys.path.pop(0)\\n\")`` afterwards to " +"discard the first ``sys.path`` component." #: ../../whatsnew/2.6.rst:3018 msgid "" "Security issue reported as :cve:`2008-5983`; discussed in :gh:`50003`, and " "fixed by Antoine Pitrou." msgstr "" +"Security issue reported as :cve:`2008-5983`; discussed in :gh:`50003`, and " +"fixed by Antoine Pitrou." #: ../../whatsnew/2.6.rst:3021 msgid "" @@ -4540,6 +4811,17 @@ msgid "" "immediately after the GIL is re-acquired. (Contributed by Antoine Pitrou and " "Gregory P. Smith.)" msgstr "" +"Python's use of the C stdio library is now thread-safe, or at least as " +"thread-safe as the underlying library is. A long-standing potential bug " +"occurred if one thread closed a file object while another thread was reading " +"from or writing to the object. In 2.6 file objects have a reference count, " +"manipulated by the :c:func:`!PyFile_IncUseCount` and :c:func:`!" +"PyFile_DecUseCount` functions. File objects can't be closed unless the " +"reference count is zero. :c:func:`!PyFile_IncUseCount` should be called " +"while the GIL is still held, before carrying out an I/O operation using the " +"``FILE *`` pointer, and :c:func:`!PyFile_DecUseCount` should be called " +"immediately after the GIL is re-acquired. (Contributed by Antoine Pitrou and " +"Gregory P. Smith.)" #: ../../whatsnew/2.6.rst:3044 msgid "" @@ -4623,6 +4905,11 @@ msgid "" "`!Py_Refcnt()` became :c:macro:`Py_REFCNT()`. The mixed-case macros are " "still available in Python 2.6 for backward compatibility. (:issue:`1629`)" msgstr "" +"Some macros were renamed in both 3.0 and 2.6 to make it clearer that they " +"are macros, not functions. :c:macro:`!Py_Size()` became :c:macro:" +"`Py_SIZE()`, :c:macro:`!Py_Type()` became :c:macro:`Py_TYPE()`, and :c:macro:" +"`!Py_Refcnt()` became :c:macro:`Py_REFCNT()`. The mixed-case macros are " +"still available in Python 2.6 for backward compatibility. (:issue:`1629`)" #: ../../whatsnew/2.6.rst:3091 msgid "" @@ -4678,7 +4965,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:3118 msgid "Port-Specific Changes: Windows" -msgstr "Port-Specific Changes: Windows" +msgstr "Alterações específicas da porta: Windows" #: ../../whatsnew/2.6.rst:3120 msgid "" @@ -4714,6 +5001,11 @@ msgid "" "function. The :func:`~msvcrt.putwch` function takes a Unicode character and " "writes it to the console. (Contributed by Christian Heimes.)" msgstr "" +"The :mod:`msvcrt` module now supports both the normal and wide char variants " +"of the console I/O API. The :func:`~msvcrt.getwch` function reads a " +"keypress and returns a Unicode value, as does the :func:`~msvcrt.getwche` " +"function. The :func:`~msvcrt.putwch` function takes a Unicode character and " +"writes it to the console. (Contributed by Christian Heimes.)" #: ../../whatsnew/2.6.rst:3138 msgid "" @@ -4731,6 +5023,9 @@ msgid "" "ioctl` method that provides a limited interface to the :c:func:`WSAIoctl` " "system interface." msgstr "" +"The :mod:`socket` module's socket objects now have an :meth:`~socket.socket." +"ioctl` method that provides a limited interface to the :c:func:`WSAIoctl` " +"system interface." #: ../../whatsnew/2.6.rst:3146 msgid "" @@ -4740,6 +5035,11 @@ msgid "" "module now support the context protocol, so they can be used in :keyword:" "`with` statements. (Contributed by Christian Heimes.)" msgstr "" +"The :mod:`_winreg ` module now has a function, :func:`~winreg." +"ExpandEnvironmentStrings`, that expands environment variable references such " +"as ``%NAME%`` in an input string. The handle objects provided by this " +"module now support the context protocol, so they can be used in :keyword:" +"`with` statements. (Contributed by Christian Heimes.)" #: ../../whatsnew/2.6.rst:3153 msgid "" @@ -4749,6 +5049,11 @@ msgid "" "which enable and disable registry reflection for 32-bit processes running on " "64-bit systems. (:issue:`1753245`)" msgstr "" +":mod:`_winreg ` also has better support for x64 systems, exposing " +"the :func:`~winreg.DisableReflectionKey`, :func:`~winreg." +"EnableReflectionKey`, and :func:`~winreg.QueryReflectionKey` functions, " +"which enable and disable registry reflection for 32-bit processes running on " +"64-bit systems. (:issue:`1753245`)" #: ../../whatsnew/2.6.rst:3159 msgid "" @@ -4760,7 +5065,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:3167 msgid "Port-Specific Changes: Mac OS X" -msgstr "Port-Specific Changes: Mac OS X" +msgstr "Alterações específicas da porta: Mac OS X" #: ../../whatsnew/2.6.rst:3169 msgid "" @@ -4778,6 +5083,9 @@ msgid "" "`!macostools.touched` function to be removed because it depended on the :mod:" "`!macfs` module. (:issue:`1490190`)" msgstr "" +"The :mod:`!macfs` module has been removed. This in turn required the :func:" +"`!macostools.touched` function to be removed because it depended on the :mod:" +"`!macfs` module. (:issue:`1490190`)" #: ../../whatsnew/2.6.rst:3178 msgid "" @@ -4793,6 +5101,17 @@ msgid "" "OSATerminology`, :mod:`!pimp`, :mod:`!PixMapWrapper`, :mod:`!StdSuites`, :" "mod:`!SystemEvents`, :mod:`!Terminal`, and :mod:`!terminalcommand`." msgstr "" +"Many other Mac OS modules have been deprecated and will be removed in Python " +"3.0: :mod:`!_builtinSuites`, :mod:`!aepack`, :mod:`!aetools`, :mod:`!" +"aetypes`, :mod:`!applesingle`, :mod:`!appletrawmain`, :mod:`!appletrunner`, :" +"mod:`!argvemulator`, :mod:`!Audio_mac`, :mod:`!autoGIL`, :mod:`!Carbon`, :" +"mod:`!cfmfile`, :mod:`!CodeWarrior`, :mod:`!ColorPicker`, :mod:`!" +"EasyDialogs`, :mod:`!Explorer`, :mod:`!Finder`, :mod:`!FrameWork`, :mod:`!" +"findertools`, :mod:`!ic`, :mod:`!icglue`, :mod:`!icopen`, :mod:`!" +"macerrors`, :mod:`!MacOS`, :mod:`!macfs`, :mod:`!macostools`, :mod:`!" +"macresource`, :mod:`!MiniAEFrame`, :mod:`!Nav`, :mod:`!Netscape`, :mod:`!" +"OSATerminology`, :mod:`!pimp`, :mod:`!PixMapWrapper`, :mod:`!StdSuites`, :" +"mod:`!SystemEvents`, :mod:`!Terminal`, and :mod:`!terminalcommand`." #: ../../whatsnew/2.6.rst:3221 msgid "Port-Specific Changes: IRIX" @@ -4808,6 +5127,13 @@ msgid "" "jpeg`, :mod:`!panelparser`, :mod:`!readcd`, :mod:`!SV` and :mod:`!sv`, :mod:" "`!torgb`, :mod:`!videoreader`, and :mod:`!WAIT`." msgstr "" +"A number of old IRIX-specific modules were deprecated and will be removed in " +"Python 3.0: :mod:`!al` and :mod:`!AL`, :mod:`!cd`, :mod:`!cddb`, :mod:`!" +"cdplayer`, :mod:`!CL` and :mod:`!cl`, :mod:`!DEVICE`, :mod:`!ERRNO`, :mod:`!" +"FILE`, :mod:`!FL` and :mod:`!fl`, :mod:`!flp`, :mod:`!fm`, :mod:`!GET`, :mod:" +"`!GLWS`, :mod:`!GL` and :mod:`!gl`, :mod:`!IN`, :mod:`!IOCTL`, :mod:`!" +"jpeg`, :mod:`!panelparser`, :mod:`!readcd`, :mod:`!SV` and :mod:`!sv`, :mod:" +"`!torgb`, :mod:`!videoreader`, and :mod:`!WAIT`." #: ../../whatsnew/2.6.rst:3253 msgid "Porting to Python 2.6" @@ -4918,6 +5244,12 @@ msgid "" "xmlrpclib` should convert :class:`date` and :class:`~datetime.time` " "instances. (:issue:`1330538`)" msgstr "" +"The :mod:`xmlrpclib ` module no longer automatically " +"converts :class:`datetime.date` and :class:`datetime.time` to the :class:" +"`xmlrpclib.DateTime ` type; the conversion semantics " +"were not necessarily correct for all applications. Code using :mod:`!" +"xmlrpclib` should convert :class:`date` and :class:`~datetime.time` " +"instances. (:issue:`1330538`)" #: ../../whatsnew/2.6.rst:3310 msgid "" @@ -4951,7 +5283,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:3323 msgid "For applications that embed Python:" -msgstr "For applications that embed Python:" +msgstr "Para aplicações que incorporam Python:" #: ../../whatsnew/2.6.rst:3325 msgid "" @@ -4961,6 +5293,11 @@ msgid "" "PySys_SetArgv` and carefully consider whether the application should be " "using :c:func:`!PySys_SetArgvEx` with *updatepath* set to false." msgstr "" +"The :c:func:`!PySys_SetArgvEx` function was added in Python 2.6.6, letting " +"applications close a security hole when the existing :c:func:`!" +"PySys_SetArgv` function was used. Check whether you're calling :c:func:`!" +"PySys_SetArgv` and carefully consider whether the application should be " +"using :c:func:`!PySys_SetArgvEx` with *updatepath* set to false." #: ../../whatsnew/2.6.rst:3338 msgid "Acknowledgements" @@ -4984,4 +5321,4 @@ msgstr "novas linhas universais" #: ../../whatsnew/2.6.rst:1068 msgid "What's new" -msgstr "" +msgstr "What's new" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 2b92354d5..f4f864c91 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -23,10 +23,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -1460,7 +1460,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:978 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" -msgstr "(Contribuição de Mark Dickinson; :issue:`4258`.)" +msgstr "(Contributed by Mark Dickinson; :issue:`4258`.)" #: ../../whatsnew/2.7.rst:980 msgid "" @@ -2327,7 +2327,7 @@ msgid "" "process; this fixes problems on Solaris when :func:`~os.fork` is called from " "a thread. (Fixed by Zsolt Cserna; :issue:`7242`.)" msgstr "" -"A função :func:`os.fork` agora reinicializa o bloqueio de importação no " +"A função :func:`os.fork` agora reinicializa a trava de importação no " "processo filho; isso corrige problemas no Solaris quando :func:`~os.fork` é " "chamado de um thread. (Correção de Zsolt Cserna; :issue:`7242`.)" @@ -2921,7 +2921,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:1756 msgid "Here are some examples::" -msgstr "Aqui estão alguns exemplos::" +msgstr "Veja alguns exemplos::" #: ../../whatsnew/2.7.rst:1767 msgid "" @@ -3630,11 +3630,11 @@ msgstr "" #: ../../whatsnew/2.7.rst:2105 msgid "Build and C API Changes" -msgstr "Alterações à construção e à API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/2.7.rst:2107 msgid "Changes to Python's build process and to the C API include:" -msgstr "As alterações no processo de construção do Python e na API C incluem:" +msgstr "Changes to Python's build process and to the C API include:" #: ../../whatsnew/2.7.rst:2109 msgid "" @@ -3669,7 +3669,7 @@ msgid "" msgstr "" "Se você usar o arquivo :file:`.gdbinit` fornecido com Python, a macro " "\"pyo\" na versão 2.7 agora funciona corretamente quando o thread que está " -"sendo depurado não contém o GIL; a macro agora o adquire antes de imprimir. " +"sendo depurado não contém a GIL; a macro agora a adquire antes de imprimir. " "(Contribuição de Victor Stinner; :issue:`3632`.)" #: ../../whatsnew/2.7.rst:2126 @@ -3859,12 +3859,11 @@ msgstr "" "A complicada interação entre threads e forks de processos foi alterada. " "Anteriormente, o processo filho criado por :func:`os.fork` pode falhar " "porque o filho é criado com apenas um único thread em execução, a thread " -"executando :func:`os.fork`. Se outros threads estivessem mantendo um " -"bloqueio, como o bloqueio de importação do Python, quando o fork fosse " -"executado, o bloqueio ainda seria marcado como \"retido\" no novo processo. " -"Mas no processo filho nada liberaria o bloqueio, pois os outros threads não " -"foram replicados e o processo filho não seria mais capaz de realizar " -"importações." +"executando :func:`os.fork`. Se outros threads estivessem mantendo uma trava, " +"como a trava de importação do Python, quando o fork fosse executado, a trava " +"ainda seria marcada como \"retida\" no novo processo. Mas no processo filho " +"nada liberaria a trava, pois os outros threads não foram replicados e o " +"processo filho não seria mais capaz de realizar importações." #: ../../whatsnew/2.7.rst:2222 msgid "" @@ -3873,9 +3872,9 @@ msgid "" "C extension modules that have internal locks, or that call :c:func:`fork()` " "themselves, will not benefit from this clean-up." msgstr "" -"Python 2.7 adquire o bloqueio de importação antes de executar um :func:`os." -"fork`, e também limpará quaisquer bloqueios criados usando o módulo :mod:" -"`threading`. Módulos de extensão C que possuem bloqueios internos, ou que " +"Python 2.7 adquire a trava de importação antes de executar um :func:`os." +"fork`, e também limpará quaisquer travas criadas usando o módulo :mod:" +"`threading`. Módulos de extensão C que possuem travas internas, ou que " "chamam :c:func:`fork()` eles próprios, não se beneficiarão desta limpeza." #: ../../whatsnew/2.7.rst:2228 @@ -4288,8 +4287,8 @@ msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -"Esta seção lista as alterações descritas anteriormente e outras correções de " -"bugs que podem exigir alterações em seu código:" +"Esta seção lista as alterações descritas anteriormente e outras correções " +"que podem exigir alterações no seu código." #: ../../whatsnew/2.7.rst:2444 msgid "" @@ -4640,7 +4639,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2658 msgid "Bootstrapping pip By Default" -msgstr "Inicializando pip por padrão" +msgstr "Bootstrapping pip By Default" #: ../../whatsnew/2.7.rst:2660 msgid "" @@ -4690,12 +4689,12 @@ msgid "" "default, otherwise it can still be accessed through the Python launcher for " "Windows as ``py -m pip``." msgstr "" -"No Windows e Mac OS X, os instaladores do CPython agora instalam o ``pip`` " -"junto com o próprio CPython (os usuários podem optar por não instalá-lo " -"durante o processo de instalação). Os usuários do Windows precisarão optar " -"pelas modificações automáticas do ``PATH`` para ter o ``pip`` disponível na " -"linha de comando por padrão, caso contrário ele ainda poderá ser acessado " -"através do iniciador Python para Windows como ``py -m pip``." +"On Windows and Mac OS X, the CPython installers now default to installing " +"``pip`` along with CPython itself (users may opt out of installing it during " +"the installation process). Window users will need to opt in to the automatic " +"``PATH`` modifications to have ``pip`` available from the command line by " +"default, otherwise it can still be accessed through the Python launcher for " +"Windows as ``py -m pip``." #: ../../whatsnew/2.7.rst:2683 msgid "" @@ -4704,10 +4703,10 @@ msgid "" "simple directions on how to install them on that platform (usually using the " "system package manager)." msgstr "" -"Como `discutido na PEP`__, os empacotadores de plataforma podem optar por " -"não instalar estes comandos por padrão, desde que, quando invocados, " -"forneçam instruções claras e simples sobre como instalá-los naquela " -"plataforma (geralmente usando o gerenciador de pacotes do sistema). ." +"As `discussed in the PEP`__, platform packagers may choose not to install " +"these commands by default, as long as, when invoked, they provide clear and " +"simple directions on how to install them on that platform (usually using the " +"system package manager)." #: ../../whatsnew/2.7.rst:2692 msgid "Documentation Changes" @@ -4722,12 +4721,12 @@ msgid "" "Packaging User Guide `__ and the documentation " "of the individual projects." msgstr "" -"Como parte desta mudança, as seções :ref:`installing-index` e :ref:" -"`distributing-index` da documentação foram completamente redesenhadas como " -"breves documentos de introdução e FAQ. A maior parte da documentação de " -"empacotamento agora foi transferida para o Python Packaging Authority, " -"mantido no `Guia de Usuário para Empacotamento de Python `__ e na documentação dos projetos individuais." +"As part of this change, the :ref:`installing-index` and :ref:`distributing-" +"index` sections of the documentation have been completely redesigned as " +"short getting started and FAQ documents. Most packaging documentation has " +"now been moved out to the Python Packaging Authority maintained `Python " +"Packaging User Guide `__ and the documentation " +"of the individual projects." #: ../../whatsnew/2.7.rst:2702 msgid "" @@ -4741,15 +4740,15 @@ msgstr "" #: ../../whatsnew/2.7.rst:2708 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" -msgstr ":pep:`453` -- Inicialização explícita do pip em instalações Python" +msgstr ":pep:`453` -- Explicit bootstrapping of pip in Python installations" #: ../../whatsnew/2.7.rst:2709 msgid "" "PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " "Nick Coghlan, Martin von Löwis and Ned Deily." msgstr "" -"PEP escrita por Donald Stufft e Nick Coghlan, implementada por Donald " -"Stufft, Nick Coghlan, Martin von Löwis e Ned Deily." +"PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " +"Nick Coghlan, Martin von Löwis and Ned Deily." #: ../../whatsnew/2.7.rst:2713 msgid "" @@ -4780,7 +4779,7 @@ msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -"Para aplicações que exigem o antigo comportamento anterior, eles podem " +"Para aplicações que exigem o antigo comportamento anterior, elas podem " "passar um contexto alternativo::" #: ../../whatsnew/2.7.rst:2740 diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index a26fc1e61..ca6f1df0f 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -16,24 +16,24 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../whatsnew/3.0.rst:3 msgid "What's New In Python 3.0" -msgstr "" +msgstr "O que há de novo no Python 3.0" #: ../../whatsnew/3.0.rst:0 msgid "Author" -msgstr "" +msgstr "Autor" #: ../../whatsnew/3.0.rst:7 msgid "Guido van Rossum" -msgstr "" +msgstr "Guido van Rossum" #: ../../whatsnew/3.0.rst:54 msgid "" @@ -46,6 +46,15 @@ msgid "" "all that much -- by and large, we're mostly fixing well-known annoyances and " "warts, and removing a lot of old cruft." msgstr "" +"Este artigo explica os novos recursos do Python 3.0, em comparação com o " +"2.6. O Python 3.0, também conhecido como \"Python 3000\" ou \"Py3K\", é o " +"primeiro lançamento do Python *intencionalmente incompatível com versões " +"anteriores*. O Python 3.0 foi lançado em 3 de dezembro de 2008. Há mais " +"mudanças do que em um lançamento típico, e mais que são importantes para " +"todos os usuários do Python. No entanto, depois de digerir as mudanças, você " +"verá que o Python realmente não mudou tanto assim -- em geral, estamos " +"principalmente corrigindo aborrecimentos bem conhecidos, e removendo muita " +"sujeira antiga." #: ../../whatsnew/3.0.rst:63 msgid "" @@ -57,6 +66,14 @@ msgid "" "have more details than the regular documentation; but note that PEPs usually " "are not kept up-to-date once a feature has been fully implemented." msgstr "" +"Este artigo não tenta fornecer uma especificação completa de todos os novos " +"recursos, mas tenta dar uma visão geral conveniente. Para detalhes " +"completos, você deve consultar a documentação do Python 3.0 e/ou as muitas " +"PEPs referenciadas no texto. Se você quiser entender a implementação " +"completa e a lógica de design para um recurso específico, as PEPs geralmente " +"têm mais detalhes do que a documentação regular; mas observe que as PEPs " +"geralmente não são mantidas atualizadas depois que um recurso foi totalmente " +"implementado." #: ../../whatsnew/3.0.rst:72 msgid "" @@ -65,20 +82,26 @@ msgid "" "distribution contains a wealth of detailed information about every small " "thing that was changed." msgstr "" +"Devido a restrições de tempo, este documento não está tão completo quanto " +"deveria ser. Como sempre para um novo lançamento, o arquivo ``Misc/NEWS`` na " +"distribuição fonte contém uma riqueza de informações detalhadas sobre cada " +"pequena coisa que foi alterada." #: ../../whatsnew/3.0.rst:89 msgid "Common Stumbling Blocks" -msgstr "" +msgstr "Obstáculos comuns" #: ../../whatsnew/3.0.rst:91 msgid "" "This section lists those few changes that are most likely to trip you up if " "you're used to Python 2.5." msgstr "" +"Esta seção lista as poucas mudanças que provavelmente irão lhe atrapalhar se " +"você estiver acostumado com o Python 2.5." #: ../../whatsnew/3.0.rst:95 msgid "Print Is A Function" -msgstr "" +msgstr "print é uma função" #: ../../whatsnew/3.0.rst:97 msgid "" @@ -86,18 +109,21 @@ msgid "" "with keyword arguments to replace most of the special syntax of the old " "``print`` statement (:pep:`3105`). Examples::" msgstr "" +"A instrução ``print`` foi substituída por uma função :func:`print`, com " +"argumentos nomeados para substituir a maior parte da sintaxe especial da " +"antiga instrução ``print`` (:pep:`3105`). Exemplos::" #: ../../whatsnew/3.0.rst:116 msgid "You can also customize the separator between items, e.g.::" -msgstr "" +msgstr "Você também pode personalizar o separador entre itens, por exemplo::" #: ../../whatsnew/3.0.rst:120 msgid "which produces:" -msgstr "" +msgstr "que produz:" #: ../../whatsnew/3.0.rst:126 msgid "Note:" -msgstr "" +msgstr "Nota:" #: ../../whatsnew/3.0.rst:128 msgid "" @@ -106,12 +132,19 @@ msgid "" "\"B\"`` would write ``\"A\\nB\\n\"``; but in Python 3.0, ``print(\"A\\n\", " "\"B\")`` writes ``\"A\\n B\\n\"``." msgstr "" +"A função :func:`print` não tem suporte ao recurso \"softspace\" da antiga " +"instrução ``print``. Por exemplo, no Python 2.x, ``print \"A\\n\", \"B\"`` " +"escreveria ``\"A\\nB\\n\"``; mas no Python 3.0, ``print(\"A\\n\", \"B\")`` " +"escreve ``\"A\\n B\\n\"``." #: ../../whatsnew/3.0.rst:133 msgid "" "Initially, you'll be finding yourself typing the old ``print x`` a lot in " "interactive mode. Time to retrain your fingers to type ``print(x)`` instead!" msgstr "" +"Inicialmente, você vai se pegar digitando o antigo ``print x`` bastante no " +"modo interativo. É hora de treinar seus dedos para digitar ``print(x)`` em " +"vez disso!" #: ../../whatsnew/3.0.rst:137 msgid "" @@ -119,14 +152,17 @@ msgid "" "statements are automatically converted to :func:`print` function calls, so " "this is mostly a non-issue for larger projects." msgstr "" +"Ao usar a ferramenta de conversão de fonte para fonte ``2to3``, todas as " +"instruções ``print`` são automaticamente convertidas em chamadas de função :" +"func:`print`, então isso geralmente não é um problema para projetos maiores." #: ../../whatsnew/3.0.rst:143 msgid "Views And Iterators Instead Of Lists" -msgstr "" +msgstr "Visualizações e iteradores em vez de listas" #: ../../whatsnew/3.0.rst:145 msgid "Some well-known APIs no longer return lists:" -msgstr "" +msgstr "Algumas APIs conhecidas não retornam mais listas:" #: ../../whatsnew/3.0.rst:147 msgid "" @@ -135,12 +171,19 @@ msgid "" "works: ``k = d.keys(); k.sort()``. Use ``k = sorted(d)`` instead (this " "works in Python 2.5 too and is just as efficient)." msgstr "" +"Os métodos :meth:`dict.keys`, :meth:`dict.items` e :meth:`dict.values` de :" +"class:`dict` retornam visualizações, ou \"views\", em vez de listas. Por " +"exemplo, isso não funciona mais: ``k = d.keys(); k.sort()``. Use ``k = " +"sorted(d)`` em vez disso (isso funciona no Python 2.5 também e é igualmente " +"eficiente)." #: ../../whatsnew/3.0.rst:153 msgid "" "Also, the :meth:`dict.iterkeys`, :meth:`dict.iteritems` and :meth:`dict." "itervalues` methods are no longer supported." msgstr "" +"Além disso, os métodos :meth:`dict.iterkeys`, :meth:`dict.iteritems` e :meth:" +"`dict.itervalues` não são mais suportados." #: ../../whatsnew/3.0.rst:156 msgid "" @@ -153,6 +196,15 @@ msgid "" "function; the correct transformation is to use a regular :keyword:`for` loop " "(since creating a list would just be wasteful)." msgstr "" +":func:`map` e :func:`filter` retornam iteradores. Se você realmente precisa " +"de uma lista e as sequências de entrada são todas de comprimento igual, uma " +"solução rápida é envolver :func:`map` em :func:`list`, por exemplo, " +"``list(map(...))``, mas uma solução melhor é frequentemente usar uma " +"compreensão de lista (especialmente quando o código original usa :keyword:" +"`lambda`), ou reescrever o código para que ele não precise de uma lista. " +"Particularmente complicado é :func:`map` invocado para os efeitos colaterais " +"da função; a transformação correta é usar um laço :keyword:`for` regular (já " +"que criar uma lista seria apenas desperdício)." #: ../../whatsnew/3.0.rst:167 msgid "" @@ -162,24 +214,32 @@ msgid "" "zip_longest`, e.g. ``map(func, *sequences)`` becomes ``list(map(func, " "itertools.zip_longest(*sequences)))``." msgstr "" +"Se as sequências de entrada não tiverem o mesmo comprimento, :func:`map` irá " +"parar no término da mais curta das sequências. Para compatibilidade total " +"com :func:`map` do Python 2.x, também envolva as sequências em :func:" +"`itertools.zip_longest`, por exemplo, ``map(func, *sequences)`` se torna " +"``list(map(func, itertools.zip_longest(*sequences)))``." #: ../../whatsnew/3.0.rst:173 msgid "" ":func:`range` now behaves like :func:`xrange` used to behave, except it " "works with values of arbitrary size. The latter no longer exists." msgstr "" +":func:`range` agora se comporta como :func:`xrange` costumava se comportar, " +"exceto que funciona com valores de tamanho arbitrário. Este último não " +"existe mais." #: ../../whatsnew/3.0.rst:177 msgid ":func:`zip` now returns an iterator." -msgstr "" +msgstr ":func:`zip` agora retorna um iterador." #: ../../whatsnew/3.0.rst:180 msgid "Ordering Comparisons" -msgstr "" +msgstr "Comparações de ordenação" #: ../../whatsnew/3.0.rst:182 msgid "Python 3.0 has simplified the rules for ordering comparisons:" -msgstr "" +msgstr "O Python 3.0 simplificou as regras para ordenar comparações:" #: ../../whatsnew/3.0.rst:184 msgid "" @@ -192,6 +252,15 @@ msgid "" "other. Note that this does not apply to the ``==`` and ``!=`` operators: " "objects of different incomparable types always compare unequal to each other." msgstr "" +"Os operadores de comparação de ordenação (``<``, ``<=``, ``>=``, ``>``) " +"levantam uma exceção TypeError quando os operandos não têm uma ordenação " +"natural significativa. Assim, expressões como ``1 < ''``, ``0 > None`` ou " +"``len <= len`` não são mais válidas e, por exemplo, ``None < None`` levanta :" +"exc:`TypeError` em vez de retornar ``False``. Um corolário é que classificar " +"uma lista heterogênea não faz mais sentido -- todos os elementos devem ser " +"comparáveis ​​entre si. Observe que isso não se aplica aos operadores ``==`` e " +"``!=``: objetos de diferentes tipos incomparáveis ​​sempre são comparados de " +"forma diferente entre si." #: ../../whatsnew/3.0.rst:195 msgid "" @@ -199,6 +268,9 @@ msgid "" "argument providing a comparison function. Use the *key* argument instead. N." "B. the *key* and *reverse* arguments are now \"keyword-only\"." msgstr "" +":meth:`builtin.sorted` e :meth:`list.sort` não aceitam mais o argumento " +"*cmp* fornecendo uma função de comparação. Use o argumento *key* em vez " +"disso. N.B. os argumentos *key* e *reverse* agora são \"somente-nomeados\"." #: ../../whatsnew/3.0.rst:200 msgid "" @@ -208,10 +280,16 @@ msgid "" "(If you really need the :func:`cmp` functionality, you could use the " "expression ``(a > b) - (a < b)`` as the equivalent for ``cmp(a, b)``.)" msgstr "" +"A função :func:`cmp` deve ser tratada como extinta, e o método especial :" +"meth:`__cmp__` não é mais suportado. Use :meth:`__lt__` para classificação, :" +"meth:`__eq__` com :meth:`__hash__` e outras comparações avançadas conforme " +"necessário. (Se você realmente precisa da funcionalidade :func:`cmp`, pode " +"usar a expressão ``(a > b) - (a < b)`` como o equivalente para ``cmp(a, " +"b)``.)" #: ../../whatsnew/3.0.rst:207 msgid "Integers" -msgstr "" +msgstr "Inteiros" #: ../../whatsnew/3.0.rst:209 msgid "" @@ -219,6 +297,9 @@ msgid "" "there is only one built-in integral type, named :class:`int`; but it behaves " "mostly like the old :class:`long` type." msgstr "" +":pep:`237`: Essencialmente, :class:`long` foi renomeado para :class:`int`. " +"Ou seja, há apenas um tipo integral embutido, chamado :class:`int`; mas ele " +"se comporta principalmente como o antigo tipo :class:`long`." #: ../../whatsnew/3.0.rst:213 msgid "" @@ -226,6 +307,9 @@ msgid "" "the truncating behavior. (The latter syntax has existed for years, at least " "since Python 2.2.)" msgstr "" +":pep:`238`: Uma expressão como ``1/2`` retorna um float. Use ``1//2`` para " +"obter o comportamento de truncamento. (A última sintaxe existe há anos, pelo " +"menos desde o Python 2.2.)" #: ../../whatsnew/3.0.rst:217 msgid "" @@ -236,6 +320,12 @@ msgid "" "data:`sys.maxint` in previous releases on the same platform (assuming the " "same build options)." msgstr "" +"A constante :data:`sys.maxint` foi removida, pois não há mais um limite para " +"o valor de inteiros. No entanto, :data:`sys.maxsize` pode ser usado como um " +"inteiro maior do que qualquer lista prática ou índice de string. Ele está em " +"conformidade com o tamanho inteiro \"natural\" da implementação e é " +"tipicamente o mesmo que :data:`sys.maxint` em versões anteriores na mesma " +"plataforma (assumindo as mesmas opções de construção)." #: ../../whatsnew/3.0.rst:224 msgid "" @@ -243,20 +333,25 @@ msgid "" "anymore, so code that unconditionally strips that character will chop off " "the last digit instead. (Use :func:`str` instead.)" msgstr "" +"O :func:`repr` de um inteiro longo não inclui mais o ``L`` final, então o " +"código que remove esse caractere incondicionalmente cortará o último dígito. " +"(Use :func:`str` em vez disso.)" #: ../../whatsnew/3.0.rst:228 msgid "" "Octal literals are no longer of the form ``0720``; use ``0o720`` instead." msgstr "" +"Literais octais não estão mais no formato ``0720``; em vez disso, use " +"``0o720``." #: ../../whatsnew/3.0.rst:232 msgid "Text Vs. Data Instead Of Unicode Vs. 8-bit" -msgstr "" +msgstr "Texto vs. Dados em vez de Unicode vs. 8 bits" #: ../../whatsnew/3.0.rst:234 msgid "" "Everything you thought you knew about binary data and Unicode has changed." -msgstr "" +msgstr "Tudo o que você achava que sabia sobre dados binários e Unicode mudou." #: ../../whatsnew/3.0.rst:237 msgid "" @@ -271,6 +366,17 @@ msgid "" "contained non-ASCII values. This value-specific behavior has caused " "numerous sad faces over the years." msgstr "" +"O Python 3.0 usa os conceitos de *texto* e *dados* (binários) em vez de " +"strings Unicode e strings de 8 bits. Todo texto é Unicode; no entanto, o " +"Unicode *codificado* é representado como dados binários. O tipo usado para " +"armazenar texto é :class:`str`, o tipo usado para armazenar dados é :class:" +"`bytes`. A maior diferença com a situação 2.x é que qualquer tentativa de " +"misturar texto e dados no Python 3.0 levanta :exc:`TypeError`, enquanto que " +"se você misturasse strings Unicode e de 8 bits no Python 2.x, funcionaria se " +"a string de 8 bits contivesse apenas bytes de 7 bits (ASCII), mas você " +"obteria :exc:`UnicodeDecodeError` se contivesse valores não ASCII. Esse " +"comportamento específico de valor causou inúmeras caras tristes ao longo dos " +"anos." #: ../../whatsnew/3.0.rst:250 msgid "" @@ -282,12 +388,21 @@ msgid "" "`str` for binary or encoded data only. Then the ``2to3`` tool will do most " "of the work for you." msgstr "" +"Como consequência dessa mudança na filosofia, praticamente todo código que " +"usa Unicode, codificações ou dados binários provavelmente terá que mudar. A " +"mudança é para melhor, pois no mundo 2.x havia vários bugs relacionados à " +"mistura de texto codificado e não codificado. Para estar preparado no Python " +"2.x, comece a usar :class:`unicode` para todo texto não codificado e :class:" +"`str` apenas para dados binários ou codificados. Então a ferramenta ``2to3`` " +"fará a maior parte do trabalho para você." #: ../../whatsnew/3.0.rst:258 msgid "" "You can no longer use ``u\"...\"`` literals for Unicode text. However, you " "must use ``b\"...\"`` literals for binary data." msgstr "" +"Você não pode mais usar literais ``u\"...\"`` para texto Unicode. No " +"entanto, você deve usar literais ``b\"...\"`` para dados binários." #: ../../whatsnew/3.0.rst:261 msgid "" @@ -297,6 +412,11 @@ msgid "" "`bytes` to :class:`str`. You can also use ``bytes(s, encoding=...)`` and " "``str(b, encoding=...)``, respectively." msgstr "" +"Como os tipos :class:`str` e :class:`bytes` não podem ser misturados, você " +"deve sempre converter explicitamente entre eles. Use :meth:`str.encode` para " +"ir de :class:`str` para :class:`bytes`, e :meth:`bytes.decode` para ir de :" +"class:`bytes` para :class:`str`. Você também pode usar ``bytes(s, " +"encoding=...)`` e ``str(b, encoding=...)``, respectivamente." #: ../../whatsnew/3.0.rst:268 msgid "" @@ -305,6 +425,11 @@ msgid "" "Nearly all APIs that accept :class:`bytes` also accept :class:`bytearray`. " "The mutable API is based on :class:`collections.MutableSequence`." msgstr "" +"Assim como :class:`str`, o tipo :class:`bytes` é imutável. Há um tipo " +"*mutável* separado para armazenar dados binários em buffer, :class:" +"`bytearray`. Quase todas as APIs que aceitam :class:`bytes` também aceitam :" +"class:`bytearray`. A API mutável é baseada em :class:`collections." +"MutableSequence`." #: ../../whatsnew/3.0.rst:274 msgid "" @@ -315,6 +440,12 @@ msgid "" "character. (Of course, this change only affects raw string literals; the " "euro character is ``'\\u20ac'`` in Python 3.0.)" msgstr "" +"Todas as contrabarras em literais de strings brutas são interpretadas " +"literalmente. Isso significa que os escapes ``'\\U'`` e ``'\\u'`` em strings " +"brutas não são tratados de forma especial. Por exemplo, ``r'\\u20ac'`` é uma " +"string de 6 caracteres no Python 3.0, enquanto no 2.6, ``ur'\\u20ac'`` era o " +"único caractere \"euro\". (É claro que essa mudança afeta apenas literais de " +"strings brutas; o caractere euro é ``'\\u20ac'`` no Python 3.0.)" #: ../../whatsnew/3.0.rst:281 msgid "" @@ -324,6 +455,11 @@ msgid "" "tool (see below) replaces every occurrence of :class:`basestring` with :" "class:`str`." msgstr "" +"O tipo abstrato embutido :class:`basestring` foi removido. Use :class:`str` " +"em vez disso. Os tipos :class:`str` e :class:`bytes` não têm funcionalidade " +"suficiente em comum para garantir uma classe base compartilhada. A " +"ferramenta ``2to3`` (veja abaixo) substitui cada ocorrência de :class:" +"`basestring` por :class:`str`." #: ../../whatsnew/3.0.rst:287 msgid "" @@ -342,6 +478,22 @@ msgid "" "have a way to override the encoding. There is no longer any need for using " "the encoding-aware streams in the :mod:`codecs` module." msgstr "" +"Arquivos abertos como arquivos texto (ainda o modo padrão para :func:`open`) " +"sempre usam uma codificação para mapear entre strings (na memória) e bytes " +"(no disco). Arquivos binários (abertos com um ``b`` no argumento mode) " +"sempre usam bytes na memória. Isso significa que se um arquivo for aberto " +"usando um modo ou codificação incorretos, a E/S provavelmente falhará " +"ruidosamente, em vez de produzir dados incorretos silenciosamente. Isso " +"também significa que até mesmo usuários Unix terão que especificar o modo " +"correto (texto ou binário) ao abrir um arquivo. Há uma codificação padrão " +"dependente da plataforma, que em plataformas Unixy pode ser definida com a " +"variável de ambiente ``LANG`` (e às vezes também com algumas outras " +"variáveis ​​de ambiente relacionadas à localidade específicas da plataforma). " +"Em muitos casos, mas não em todos, o padrão do sistema é UTF-8; você nunca " +"deve contar com esse padrão. Qualquer aplicação que leia ou escreva mais do " +"que texto ASCII puro provavelmente deve ter uma maneira de substituir a " +"codificação. Não há mais necessidade de usar os fluxos com reconhecimento de " +"codificação no módulo :mod:`codecs`." #: ../../whatsnew/3.0.rst:304 msgid "" @@ -350,6 +502,10 @@ msgid "" "`io.TextIOBase`). To read and write bytes data with these streams, you need " "to use their :data:`io.TextIOBase.buffer` attribute." msgstr "" +"Os valores iniciais de :data:`sys.stdin`, :data:`sys.stdout` e :data:`sys." +"stderr` agora são arquivos texto somente unicode (ou seja, são instâncias " +"de :class:`io.TextIOBase`). Para ler e gravar dados de bytes com esses " +"fluxos, você precisa usar o atributo :data:`io.TextIOBase.buffer` deles." #: ../../whatsnew/3.0.rst:310 msgid "" @@ -366,6 +522,20 @@ msgid "" "strings, filenames that cannot be decoded properly are omitted rather than " "raising :exc:`UnicodeError`." msgstr "" +"Nomes de arquivo são passados ​​e retornados de APIs como strings (Unicode). " +"Isso pode apresentar problemas específicos de plataforma porque em algumas " +"plataformas nomes de arquivo são strings de bytes arbitrárias. (Por outro " +"lado, no Windows nomes de arquivo são armazenados nativamente como Unicode.) " +"Como solução alternativa, a maioria das APIs (por exemplo, :func:`open` e " +"muitas funções no módulo :mod:`os`) que aceitam nomes de arquivo aceitam " +"objetos :class:`bytes` assim como strings, e algumas APIs têm uma maneira de " +"pedir um valor de retorno :class:`bytes`. Assim, :func:`os.listdir` retorna " +"uma lista de instâncias :class:`bytes` se o argumento for uma instância :" +"class:`bytes`, e :func:`os.getcwdb` retorna o diretório de trabalho atual " +"como uma instância :class:`bytes`. Observe que quando :func:`os.listdir` " +"retorna uma lista de strings, os nomes de arquivos que não podem ser " +"decodificados corretamente são omitidos em vez de levantar :exc:" +"`UnicodeError`." #: ../../whatsnew/3.0.rst:325 msgid "" @@ -374,6 +544,10 @@ msgid "" "interpretable using the default encoding. Setting the ``LANG`` variable and " "rerunning the program is probably the best approach." msgstr "" +"Algumas APIs de sistema como :data:`os.environ` e :data:`sys.argv` também " +"podem apresentar problemas quando os bytes disponibilizados pelo sistema não " +"são interpretáveis ​​usando a codificação padrão. Definir a variável ``LANG`` " +"e executar o programa novamente é provavelmente a melhor abordagem." #: ../../whatsnew/3.0.rst:330 msgid "" @@ -381,10 +555,13 @@ msgid "" "characters. It still escapes control characters and code points with non-" "printable status in the Unicode standard, however." msgstr "" +":pep:`3138`: A :func:`repr` de uma string não escapa mais caracteres não-" +"ASCII. No entanto, ele ainda escapa caracteres de controle e pontos de " +"código com status não imprimível no padrão Unicode." #: ../../whatsnew/3.0.rst:334 msgid ":pep:`3120`: The default source encoding is now UTF-8." -msgstr "" +msgstr ":pep:`3120`: A codificação de fontes padrão agora é UTF-8." #: ../../whatsnew/3.0.rst:336 msgid "" @@ -392,6 +569,9 @@ msgid "" "standard library remains ASCII-only with the exception of contributor names " "in comments.)" msgstr "" +":pep:`3131`: Letras não ASCII agora são permitidas em identificadores. (No " +"entanto, a biblioteca padrão permanece somente ASCII, com exceção dos nomes " +"dos colaboradores nos comentários.)" #: ../../whatsnew/3.0.rst:340 msgid "" @@ -399,24 +579,31 @@ msgid "" "import the :mod:`io` module and use :class:`io.StringIO` or :class:`io." "BytesIO` for text and data respectively." msgstr "" +"Os módulos :mod:`!StringIO` e :mod:`!cStringIO` se foram. Em vez disso, " +"importe o módulo :mod:`io` e use :class:`io.StringIO` ou :class:`io.BytesIO` " +"para texto e dados, respectivamente." #: ../../whatsnew/3.0.rst:344 msgid "See also the :ref:`unicode-howto`, which was updated for Python 3.0." msgstr "" +"Veja também o guia :ref:`unicode-howto`, que foi atualizado para o Python " +"3.0." #: ../../whatsnew/3.0.rst:348 msgid "Overview Of Syntax Changes" -msgstr "" +msgstr "Visão geral das alterações da sintaxe" #: ../../whatsnew/3.0.rst:350 msgid "" "This section gives a brief overview of every *syntactic* change in Python " "3.0." msgstr "" +"Esta seção fornece uma breve visão geral de cada mudança *sintática* no " +"Python 3.0." #: ../../whatsnew/3.0.rst:354 msgid "New Syntax" -msgstr "" +msgstr "Nova sintaxe" #: ../../whatsnew/3.0.rst:356 msgid "" @@ -427,6 +614,12 @@ msgid "" "intent is to encourage experimentation through metaclasses, decorators or " "frameworks." msgstr "" +":pep:`3107`: Anotações de argumento de função e valor de retorno. Isso " +"fornece uma maneira padronizada de anotar os parâmetros e o valor de retorno " +"de uma função. Não há semântica anexada a essas anotações, exceto que elas " +"podem ser introspectadas em tempo de execução usando o atributo :attr:" +"`__annotations__`. A intenção é encorajar a experimentação por meio de " +"metaclasses, decoradores ou frameworks." #: ../../whatsnew/3.0.rst:363 msgid "" @@ -436,6 +629,11 @@ msgid "" "that you don't accept a variable-length argument list, but you do have " "keyword-only arguments." msgstr "" +":pep:`3102`: Argumentos somente-nomeados. Parâmetros nomeados que ocorrem " +"após ``*args`` na lista de parâmetros *devem* ser especificados usando a " +"sintaxe dos nomes na chamada. Você também pode usar um ``*`` simples na " +"lista de parâmetros para indicar que não aceita uma lista de argumentos de " +"comprimento variável, mas tem argumentos somente-nomeados." #: ../../whatsnew/3.0.rst:369 msgid "" @@ -444,6 +642,10 @@ msgid "" "(see next section), but can be used for other purposes as well, as long as " "the metaclass supports it." msgstr "" +"Argumentos nomeados são permitidos após a lista de classes base em uma " +"definição de classe. Isso é usado pela nova convenção para especificar uma " +"metaclasse (veja a próxima seção), mas pode ser usado para outros propósitos " +"também, desde que a metaclasse dê suporte." #: ../../whatsnew/3.0.rst:374 msgid "" @@ -451,6 +653,9 @@ msgid "" "now assign directly to a variable in an outer (but non-global) scope. :" "keyword:`!nonlocal` is a new reserved word." msgstr "" +":pep:`3104`: instrução :keyword:`nonlocal`. Usando ``nonlocal x``, agora " +"você pode atribuir diretamente a uma variável em um escopo externo (mas não " +"global). :keyword:`!nonlocal` é uma nova palavra reservada." #: ../../whatsnew/3.0.rst:378 msgid "" @@ -459,16 +664,24 @@ msgid "" "``rest`` object is always a (possibly empty) list; the right-hand side may " "be any iterable. Example::" msgstr "" +":pep:`3132`: Desempacotamento iterável estendido. Agora você pode escrever " +"coisas como ``a, b, *rest = some_sequence``. E até mesmo ``*rest, a = " +"stuff``. O objeto ``rest`` é sempre uma lista (possivelmente vazia); o lado " +"direito pode ser qualquer iterável. Exemplo::" #: ../../whatsnew/3.0.rst:385 msgid "This sets *a* to ``0``, *b* to ``4``, and *rest* to ``[1, 2, 3]``." msgstr "" +"Isso define *a* como ``0``, *b* como ``4`` e *rest* como ``[1, 2, 3]``." #: ../../whatsnew/3.0.rst:387 msgid "" "Dictionary comprehensions: ``{k: v for k, v in stuff}`` means the same thing " "as ``dict(stuff)`` but is more flexible. (This is :pep:`274` vindicated. :-)" msgstr "" +"Compreensões de dicionário: ``{k: v for k, v in stuff}`` significa a mesma " +"coisa que ``dict(stuff)``, mas é mais flexível. (Isto é :pep:`274` " +"justificada. :-)" #: ../../whatsnew/3.0.rst:391 msgid "" @@ -477,60 +690,78 @@ msgid "" "``{x for x in stuff}`` means the same thing as ``set(stuff)`` but is more " "flexible." msgstr "" +"Definir literais, por exemplo, ``{1, 2}``. Note que ``{}`` é um dicionário " +"vazio; use ``set()`` para um conjunto vazio. Compreensões de conjuntos " +"também são suportadas; por exemplo, ``{x for x in stuff}`` significa a mesma " +"coisa que ``set(stuff)``, mas é mais flexível." #: ../../whatsnew/3.0.rst:396 msgid "" "New octal literals, e.g. ``0o720`` (already in 2.6). The old octal literals " "(``0720``) are gone." msgstr "" +"Novos literais octais, por exemplo, ``0o720`` (já em 2.6). Os antigos " +"literais octais (``0720``) se foram." #: ../../whatsnew/3.0.rst:399 msgid "" "New binary literals, e.g. ``0b1010`` (already in 2.6), and there is a new " "corresponding built-in function, :func:`bin`." msgstr "" +"Novos literais binários, por exemplo, ``0b1010`` (já em 2.6), e há uma nova " +"função embutida correspondente, :func:`bin`." #: ../../whatsnew/3.0.rst:402 msgid "" "Bytes literals are introduced with a leading ``b`` or ``B``, and there is a " "new corresponding built-in function, :func:`bytes`." msgstr "" +"Literais de bytes são introduzidos com um ``b`` ou ``B`` no início, e há uma " +"nova função embutida correspondente, :func:`bytes`." #: ../../whatsnew/3.0.rst:406 msgid "Changed Syntax" -msgstr "" +msgstr "Sintaxe alterada" #: ../../whatsnew/3.0.rst:408 msgid "" ":pep:`3109` and :pep:`3134`: new :keyword:`raise` statement syntax: :samp:" "`raise [{expr} [from {expr}]]`. See below." msgstr "" +":pep:`3109` e :pep:`3134`: nova sintaxe da instrução :keyword:`raise`: :samp:" +"`raise [{expr} [from {expr}]]`. Veja abaixo." #: ../../whatsnew/3.0.rst:411 msgid "" ":keyword:`!as` and :keyword:`with` are now reserved words. (Since 2.6, " "actually.)" msgstr "" +":keyword:`!as` e :keyword:`with` agora são palavras reservadas. (Desde a " +"versão 2.6, na verdade.)" #: ../../whatsnew/3.0.rst:414 msgid "" "``True``, ``False``, and ``None`` are reserved words. (2.6 partially " "enforced the restrictions on ``None`` already.)" msgstr "" +"``True``, ``False`` e ``None`` são palavras reservadas. (A versão 2.6 já " +"aplicava parcialmente as restrições em ``None``.)" #: ../../whatsnew/3.0.rst:417 msgid "" "Change from :keyword:`except` *exc*, *var* to :keyword:`!except` *exc* :" "keyword:`!as` *var*. See :pep:`3110`." msgstr "" +"Alteração de :keyword:`except` *exc*, *var* para :keyword:`!except` *exc* :" +"keyword:`!as` *var*. Veja a :pep:`3110`." #: ../../whatsnew/3.0.rst:420 msgid ":pep:`3115`: New Metaclass Syntax. Instead of::" -msgstr "" +msgstr ":pep:`3115`: Nova sintaxe de metaclasse. Em vez de::" #: ../../whatsnew/3.0.rst:426 msgid "you must now use::" -msgstr "" +msgstr "agora você deve usar::" #: ../../whatsnew/3.0.rst:431 msgid "" @@ -538,6 +769,9 @@ msgid "" "(It was a crutch to make it easier to default to new-style classes without " "deriving every class from :class:`object`.)" msgstr "" +"A variável global do módulo :data:`__metaclass__` não é mais suportada. (Era " +"uma ajuda para facilitar a mudança do padrão para classes de novo estilo sem " +"derivar cada classe de :class:`object`.)" #: ../../whatsnew/3.0.rst:436 msgid "" @@ -548,6 +782,13 @@ msgid "" "inside a :func:`list` constructor, and in particular the loop control " "variables are no longer leaked into the surrounding scope." msgstr "" +"As compreensões de lista não têm mais suporte a mais a forma sintática :samp:" +"`[... for {var} in {item1}, {item2}, ...]`. Use :samp:`[... for {var} in " +"({item1}, {item2}, ...)]` em vez disso. Observe também que as compreensões " +"de lista têm semântica diferente: elas estão mais próximas do açúcar " +"sintático para uma expressão geradora dentro de um construtor :func:`list` " +"e, em particular, as variáveis ​​de controle de laço não são mais vazadas para " +"o escopo circundante." #: ../../whatsnew/3.0.rst:444 msgid "" @@ -556,24 +797,31 @@ msgid "" "as ``...``. (Previously it could also be spelled as ``. . .``, by a mere " "accident of the grammar.)" msgstr "" +"As *reticências* (``...``) podem ser usadas como uma expressão atômica em " +"qualquer lugar. (Anteriormente, eram permitidas apenas em fatias.) Além " +"disso, agora *devem* ser escritas como ``...``. (Anteriormente, também " +"poderiam ser escritas como ``. . .``, por um mero acidente da gramática.)" #: ../../whatsnew/3.0.rst:450 msgid "Removed Syntax" -msgstr "" +msgstr "Sintaxe removida" #: ../../whatsnew/3.0.rst:452 msgid "" ":pep:`3113`: Tuple parameter unpacking removed. You can no longer write " "``def foo(a, (b, c)): ...``. Use ``def foo(a, b_c): b, c = b_c`` instead." msgstr "" +":pep:`3113`: Desempacotamento de parâmetro de tupla removido. Você não pode " +"mais escrever ``def foo(a, (b, c)): ...``. Em vez disso, use ``def foo(a, " +"b_c): b, c = b_c``." #: ../../whatsnew/3.0.rst:456 msgid "Removed backticks (use :func:`repr` instead)." -msgstr "" +msgstr "Removidos backticks (use :func:`repr`)." #: ../../whatsnew/3.0.rst:458 msgid "Removed ``<>`` (use ``!=`` instead)." -msgstr "" +msgstr "Removido ``<>`` (use ``!=``)." #: ../../whatsnew/3.0.rst:460 msgid "" @@ -582,20 +830,26 @@ msgid "" "note that :func:`exec` no longer takes a stream argument; instead of " "``exec(f)`` you can use ``exec(f.read())``." msgstr "" +"Removida palavra reservada: :func:`exec` não é mais uma palavra reservada; " +"ela permanece como uma função. (Felizmente a sintaxe da função também era " +"aceita nas versões 2.x.) Observe também que :func:`exec` não aceita mais um " +"argumento de fluxo; em vez de ``exec(f)`` você pode usar ``exec(f.read())``." #: ../../whatsnew/3.0.rst:465 msgid "Integer literals no longer support a trailing ``l`` or ``L``." -msgstr "" +msgstr "Literais de inteiro não mais têm suporte a um ``l`` ou ``L`` final." #: ../../whatsnew/3.0.rst:467 msgid "String literals no longer support a leading ``u`` or ``U``." -msgstr "" +msgstr "Literais de string não mais têm suporte a um ``u`` ou ``U`` no início." #: ../../whatsnew/3.0.rst:469 msgid "" "The :keyword:`from` *module* :keyword:`import` ``*`` syntax is only allowed " "at the module level, no longer inside functions." msgstr "" +"A sintaxe :keyword:`from` *módulo* :keyword:`import` ``*`` é permitida " +"somente no nível do módulo, não mais dentro de funções." #: ../../whatsnew/3.0.rst:472 msgid "" @@ -603,14 +857,17 @@ msgid "" "import {name}`. All :keyword:`import` forms not starting with ``.`` are " "interpreted as absolute imports. (:pep:`328`)" msgstr "" +"A única sintaxe aceitável para importações relativas é :samp:`from ." +"[{module}] import {name}`. Todos as formas de :keyword:`import` que não " +"começam com ``.`` são interpretadas como importações absolutas. (:pep:`328`)" #: ../../whatsnew/3.0.rst:476 msgid "Classic classes are gone." -msgstr "" +msgstr "As classes clássicas se foram." #: ../../whatsnew/3.0.rst:480 msgid "Changes Already Present In Python 2.6" -msgstr "" +msgstr "Mudanças já presentes no Python 2.6" #: ../../whatsnew/3.0.rst:482 msgid "" @@ -620,6 +877,11 @@ msgid "" "corresponding sections in :ref:`whats-new-in-2.6` should be consulted for " "longer descriptions." msgstr "" +"Como muitos usuários provavelmente fazem o salto direto do Python 2.5 para o " +"Python 3.0, esta seção lembra o leitor dos novos recursos que foram " +"originalmente projetados para o Python 3.0, mas que foram portados de volta " +"para o Python 2.6. As seções correspondentes em :ref:`whats-new-in-2.6` " +"devem ser consultadas para descrições mais longas." #: ../../whatsnew/3.0.rst:488 msgid "" @@ -627,20 +889,25 @@ msgid "" "and no longer needs to be imported from the :mod:`__future__`. Also check " "out :ref:`new-26-context-managers` and :ref:`new-module-contextlib`." msgstr "" +":ref:`pep-0343`. A instrução :keyword:`with` agora é um recurso padrão e não " +"precisa mais ser importada de :mod:`__future__`. Confira também :ref:`new-26-" +"context-managers` e :ref:`new-module-contextlib`." #: ../../whatsnew/3.0.rst:493 msgid "" ":ref:`pep-0366`. This enhances the usefulness of the :option:`-m` option " "when the referenced module lives in a package." msgstr "" +":ref:`pep-0366`. Isso aumenta a utilidade da opção :option:`-m` quando o " +"módulo referenciado reside em um pacote." #: ../../whatsnew/3.0.rst:496 msgid ":ref:`pep-0370`." -msgstr "" +msgstr ":ref:`pep-0370`." #: ../../whatsnew/3.0.rst:498 msgid ":ref:`pep-0371`." -msgstr "" +msgstr ":ref:`pep-0371`." #: ../../whatsnew/3.0.rst:500 msgid "" @@ -650,12 +917,20 @@ msgid "" "`bytes` type does not. The plan is to eventually make this the only API for " "string formatting, and to start deprecating the ``%`` operator in Python 3.1." msgstr "" +":ref:`pep-3101`. Nota: a descrição da versão 2.6 menciona o método :meth:" +"`format` para strings de 8 bits e Unicode. No 3.0, apenas o tipo :class:" +"`str` (strings de texto com suporte a Unicode) tem suporte a esse método; o " +"tipo :class:`bytes` não. O plano é eventualmente tornar esta a única API " +"para formatação de strings e começar a descontinuar o operador ``%`` no " +"Python 3.1." #: ../../whatsnew/3.0.rst:507 msgid "" ":ref:`pep-3105`. This is now a standard feature and no longer needs to be " "imported from :mod:`__future__`. More details were given above." msgstr "" +":ref:`pep-3105`. Este é agora um recurso padrão e não precisa mais ser " +"importado de :mod:`__future__`. Mais detalhes foram fornecidos acima." #: ../../whatsnew/3.0.rst:510 msgid "" @@ -663,6 +938,9 @@ msgid "" "now standard and :keyword:`!except` *exc*, *var* is no longer supported. " "(Of course, the :keyword:`!as` *var* part is still optional.)" msgstr "" +":ref:`pep-3110`. A sintaxe :keyword:`except` *exc* :keyword:`!as` *var* " +"agora é padrão e :keyword:`!except` *exc*, *var* não é mais suportado. " +"(Claro, a parte :keyword:`!as` *var* ainda é opcional.)" #: ../../whatsnew/3.0.rst:515 msgid "" @@ -670,6 +948,9 @@ msgid "" "like ``b'...'``, ``b\"\"\"...\"\"\"``, and ``br\"...\"``) now produces a " "literal of type :class:`bytes`." msgstr "" +":ref:`pep-3112`. A notação de literal de string ``b\"...\"`` (e suas " +"variantes como ``b'...'``, ``b\"\"\"...\"\"\"`` e ``br\"...\"``) agora " +"produz um literal do tipo :class:`bytes`." #: ../../whatsnew/3.0.rst:519 msgid "" @@ -682,12 +963,23 @@ msgid "" "object maintains a buffer of itself in order to speed up the encoding and " "decoding operations)." msgstr "" +":ref:`pep-3116`. O módulo :mod:`io` agora é a maneira padrão de fazer E/S de " +"arquivo. A função embutida :func:`open` agora é um apelido para :func:`io." +"open` e tem argumentos nomeados adicionais *encoding*, *errors*, *newline* e " +"*closefd*. Observe também que um argumento *mode* inválido agora levanta :" +"exc:`ValueError`, não :exc:`IOError`. O objeto arquivo binário subjacente a " +"um objeto arquivo texto pode ser acessado como :attr:`f.buffer` (mas tome " +"cuidado, pois o objeto texto mantém um buffer de si mesmo para acelerar as " +"operações de codificação e decodificação)." #: ../../whatsnew/3.0.rst:529 msgid "" ":ref:`pep-3118`. The old builtin :func:`buffer` is now really gone; the new " "builtin :func:`memoryview` provides (mostly) similar functionality." msgstr "" +":ref:`pep-3118`. A antiga função embutida :func:`buffer` agora realmente se " +"foi; a nova função embutida :func:`memoryview` fornece funcionalidade " +"(principalmente) semelhante." #: ../../whatsnew/3.0.rst:533 msgid "" @@ -697,16 +989,23 @@ msgid "" "conform to the :class:`collections.MutableMapping` and :class:`collections." "MutableSequence` ABCs, respectively." msgstr "" +":ref:`pep-3119`. O módulo :mod:`abc` e as ABCs definidas no módulo :mod:" +"`collections` desempenham um papel um pouco mais proeminente na linguagem " +"agora, e tipos embutidos de coleção como :class:`dict` e :class:`list` estão " +"em conformidade com as ABCs :class:`collections.MutableMapping` e :class:" +"`collections.MutableSequence`, respectivamente." #: ../../whatsnew/3.0.rst:539 msgid "" ":ref:`pep-3127`. As mentioned above, the new octal literal notation is the " "only one supported, and binary literals have been added." msgstr "" +":ref:`pep-3127`. Conforme mencionado acima, a nova notação de literal octal " +"é a única suportada, e literais binários foram adicionados." #: ../../whatsnew/3.0.rst:543 msgid ":ref:`pep-3129`." -msgstr "" +msgstr ":ref:`pep-3129`." #: ../../whatsnew/3.0.rst:545 msgid "" @@ -714,10 +1013,13 @@ msgid "" "defining Python's \"numeric tower\". Also note the new :mod:`fractions` " "module which implements :class:`numbers.Rational`." msgstr "" +":ref:`pep-3141`. O módulo :mod:`numbers` é outro novo uso de ABCs, definindo " +"a \"torre numérica\" do Python. Observe também o novo módulo :mod:" +"`fractions` que implementa :class:`numbers.Rational`." #: ../../whatsnew/3.0.rst:551 msgid "Library Changes" -msgstr "" +msgstr "Mudanças na biblioteca" #: ../../whatsnew/3.0.rst:553 msgid "" @@ -725,6 +1027,9 @@ msgid "" "extensive changes to the standard library. :pep:`3108` is the reference for " "the major changes to the library. Here's a capsule review:" msgstr "" +"Devido a restrições de tempo, este documento não cobre exaustivamente as " +"mudanças muito extensas na biblioteca padrão. :pep:`3108` é a referência " +"para as principais mudanças na biblioteca. Aqui está uma revisão resumida:" #: ../../whatsnew/3.0.rst:558 msgid "" @@ -735,6 +1040,13 @@ msgid "" "modules were also selected for removal in Python 3.0 due to lack of use or " "because a better replacement exists. See :pep:`3108` for an exhaustive list." msgstr "" +"Muitos módulos antigos foram removidos. Alguns, como :mod:`!gopherlib` (não " +"mais usado) e :mod:`!md5` (substituído por :mod:`hashlib`), já tinham sido " +"descontinuados pela :pep:`4`. Outros foram removidos como resultado da " +"remoção do suporte para várias plataformas, como Irix, BeOS e Mac OS 9 " +"(veja :pep:`11`). Alguns módulos também foram selecionados para remoção no " +"Python 3.0 devido à falta de uso ou porque existe uma substituição melhor. " +"Veja :pep:`3108` para uma lista exaustiva." #: ../../whatsnew/3.0.rst:566 msgid "" @@ -744,84 +1056,91 @@ msgid "" "However, the package is alive and well, externally maintained at https://www." "jcea.es/programacion/pybsddb.htm." msgstr "" +"O pacote :mod:`!bsddb3` foi removido porque sua presença na biblioteca " +"padrão principal provou ao longo do tempo ser um fardo particular para os " +"desenvolvedores principais devido à instabilidade dos testes e ao cronograma " +"de lançamento do Berkeley DB. No entanto, o pacote está vivo e bem, mantido " +"externamente em https://www.jcea.es/programacion/pybsddb.htm." #: ../../whatsnew/3.0.rst:572 msgid "" "Some modules were renamed because their old name disobeyed :pep:`8`, or for " "various other reasons. Here's the list:" msgstr "" +"Alguns módulos foram renomeados porque seu nome antigo desobedecia a :pep:" +"`8`, ou por vários outros motivos. Aqui está a lista:" #: ../../whatsnew/3.0.rst:576 msgid "Old Name" -msgstr "" +msgstr "Old Name" #: ../../whatsnew/3.0.rst:576 msgid "New Name" -msgstr "" +msgstr "Novo nome" #: ../../whatsnew/3.0.rst:578 msgid "_winreg" -msgstr "" +msgstr "_winreg" #: ../../whatsnew/3.0.rst:578 msgid "winreg" -msgstr "" +msgstr "winreg" #: ../../whatsnew/3.0.rst:579 msgid "ConfigParser" -msgstr "" +msgstr "ConfigParser" #: ../../whatsnew/3.0.rst:579 msgid "configparser" -msgstr "" +msgstr "configparser" #: ../../whatsnew/3.0.rst:580 msgid "copy_reg" -msgstr "" +msgstr "copy_reg" #: ../../whatsnew/3.0.rst:580 msgid "copyreg" -msgstr "" +msgstr "copyreg" #: ../../whatsnew/3.0.rst:581 msgid "Queue" -msgstr "" +msgstr "Queue" #: ../../whatsnew/3.0.rst:581 msgid "queue" -msgstr "" +msgstr "queue" #: ../../whatsnew/3.0.rst:582 msgid "SocketServer" -msgstr "" +msgstr "SocketServer" #: ../../whatsnew/3.0.rst:582 msgid "socketserver" -msgstr "" +msgstr "socketserver" #: ../../whatsnew/3.0.rst:583 msgid "markupbase" -msgstr "" +msgstr "markupbase" #: ../../whatsnew/3.0.rst:583 msgid "_markupbase" -msgstr "" +msgstr "_markupbase" #: ../../whatsnew/3.0.rst:584 msgid "repr" -msgstr "" +msgstr "repr" #: ../../whatsnew/3.0.rst:584 msgid "reprlib" -msgstr "" +msgstr "reprlib" #: ../../whatsnew/3.0.rst:585 msgid "test.test_support" -msgstr "" +msgstr "test.test_support" #: ../../whatsnew/3.0.rst:585 msgid "test.support" -msgstr "" +msgstr "test.support" #: ../../whatsnew/3.0.rst:588 msgid "" @@ -837,28 +1156,44 @@ msgid "" "The :mod:`profile` module is on the list for 3.1. The :mod:`!StringIO` " "module has been turned into a class in the :mod:`io` module." msgstr "" +"Um padrão comum no Python 2.x é ter uma versão de um módulo implementada em " +"Python puro, com uma versão acelerada opcional implementada como uma " +"extensão C; por exemplo, :mod:`pickle` e :mod:`!cPickle`. Isso coloca o " +"fardo de importar a versão acelerada e recorrer à versão Python pura em cada " +"usuário desses módulos. No Python 3.0, as versões aceleradas são " +"consideradas detalhes de implementação das versões Python puras. Os usuários " +"devem sempre importar a versão padrão, que tenta importar a versão acelerada " +"e recorrer à versão Python pura. O par :mod:`pickle` / :mod:`!cPickle` " +"recebeu esse tratamento. O módulo :mod:`profile` está na lista para 3.1. O " +"módulo :mod:`!StringIO` foi transformado em uma classe no módulo :mod:`io`." #: ../../whatsnew/3.0.rst:602 msgid "" "Some related modules have been grouped into packages, and usually the " "submodule names have been simplified. The resulting new packages are:" msgstr "" +"Alguns módulos relacionados foram agrupados em pacotes e, geralmente, os " +"nomes dos submódulos foram simplificados. Os novos pacotes resultantes são:" #: ../../whatsnew/3.0.rst:606 msgid "" ":mod:`dbm` (:mod:`!anydbm`, :mod:`!dbhash`, :mod:`!dbm`, :mod:`!dumbdbm`, :" "mod:`!gdbm`, :mod:`!whichdb`)." msgstr "" +":mod:`dbm` (:mod:`!anydbm`, :mod:`!dbhash`, :mod:`!dbm`, :mod:`!dumbdbm`, :" +"mod:`!gdbm`, :mod:`!whichdb`)." #: ../../whatsnew/3.0.rst:609 msgid ":mod:`html` (:mod:`!HTMLParser`, :mod:`!htmlentitydefs`)." -msgstr "" +msgstr ":mod:`html` (:mod:`!HTMLParser`, :mod:`!htmlentitydefs`)." #: ../../whatsnew/3.0.rst:611 msgid "" ":mod:`http` (:mod:`!httplib`, :mod:`!BaseHTTPServer`, :mod:`!" "CGIHTTPServer`, :mod:`!SimpleHTTPServer`, :mod:`!Cookie`, :mod:`!cookielib`)." msgstr "" +":mod:`http` (:mod:`!httplib`, :mod:`!BaseHTTPServer`, :mod:`!" +"CGIHTTPServer`, :mod:`!SimpleHTTPServer`, :mod:`!Cookie`, :mod:`!cookielib`)." #: ../../whatsnew/3.0.rst:615 msgid "" @@ -867,27 +1202,37 @@ msgid "" "`tkinter`. Also note that as of Python 2.6, the functionality of :mod:" "`turtle` has been greatly enhanced." msgstr "" +":mod:`tkinter` (todos os módulos relacionados a :mod:`Tkinter`, exceto :mod:" +"`turtle`). O público-alvo de :mod:`turtle` não se importa muito com :mod:" +"`tkinter`. Observe também que, a partir do Python 2.6, a funcionalidade de :" +"mod:`turtle` foi bastante aprimorada." #: ../../whatsnew/3.0.rst:620 msgid "" ":mod:`urllib` (:mod:`!urllib`, :mod:`!urllib2`, :mod:`!urlparse`, :mod:`!" "robotparse`)." msgstr "" +":mod:`urllib` (:mod:`!urllib`, :mod:`!urllib2`, :mod:`!urlparse`, :mod:`!" +"robotparse`)." #: ../../whatsnew/3.0.rst:623 msgid "" ":mod:`xmlrpc` (:mod:`!xmlrpclib`, :mod:`!DocXMLRPCServer`, :mod:`!" "SimpleXMLRPCServer`)." msgstr "" +":mod:`xmlrpc` (:mod:`!xmlrpclib`, :mod:`!DocXMLRPCServer`, :mod:`!" +"SimpleXMLRPCServer`)." #: ../../whatsnew/3.0.rst:626 msgid "" "Some other changes to standard library modules, not covered by :pep:`3108`:" msgstr "" +"Algumas outras mudanças nos módulos da biblioteca padrão, não cobertas pela :" +"pep:`3108`:" #: ../../whatsnew/3.0.rst:629 msgid "Killed :mod:`!sets`. Use the built-in :func:`set` class." -msgstr "" +msgstr ":mod:`!sets` eliminado. Use a classe embutida :func:`set`." #: ../../whatsnew/3.0.rst:631 msgid "" @@ -895,6 +1240,9 @@ msgid "" "exc_clear`, :data:`sys.exc_type`, :data:`sys.exc_value`, :data:`sys." "exc_traceback`. (Note that :data:`sys.last_type` etc. remain.)" msgstr "" +"Limpeza do módulo :mod:`sys`: removidos :func:`sys.exitfunc`, :func:`sys." +"exc_clear`, :data:`sys.exc_type`, :data:`sys.exc_value`, :data:`sys." +"exc_traceback`. (Observe que :data:`sys.last_type` etc. permanecem.)" #: ../../whatsnew/3.0.rst:636 msgid "" @@ -903,12 +1251,18 @@ msgid "" "the ``'c'`` typecode for array is gone -- use either ``'b'`` for bytes or " "``'u'`` for Unicode characters." msgstr "" +"Limpeza do tipo :class:`array.array`: os métodos :meth:`read` e :meth:" +"`write` foram removidos; use :meth:`fromfile` e :meth:`tofile` em vez disso. " +"Além disso, o typecode ``'c'`` para vetor foi removido -- use ``'b'`` para " +"bytes ou ``'u'`` para caracteres Unicode." #: ../../whatsnew/3.0.rst:642 msgid "" "Cleanup of the :mod:`operator` module: removed :func:`sequenceIncludes` and :" "func:`isCallable`." msgstr "" +"Limpeza do módulo :mod:`operator`: removidos :func:`sequenceIncludes` e :" +"func:`isCallable`." #: ../../whatsnew/3.0.rst:645 msgid "" @@ -916,26 +1270,34 @@ msgid "" "release_lock` are gone; use :meth:`~threading.Lock.acquire` and :meth:" "`~threading.Lock.release` instead." msgstr "" +"Limpeza do módulo :mod:`!thread`: :func:`!acquire_lock` e :func:`!" +"release_lock` foram removidos; use :meth:`~threading.Lock.acquire` e :meth:" +"`~threading.Lock.release` em vez disso." #: ../../whatsnew/3.0.rst:649 msgid "Cleanup of the :mod:`random` module: removed the :func:`jumpahead` API." -msgstr "" +msgstr "Limpeza do módulo :mod:`random`: removida a API :func:`jumpahead`." #: ../../whatsnew/3.0.rst:651 msgid "The :mod:`!new` module is gone." -msgstr "" +msgstr "O módulo :mod:`!new` foi removido." #: ../../whatsnew/3.0.rst:653 msgid "" "The functions :func:`os.tmpnam`, :func:`os.tempnam` and :func:`os.tmpfile` " "have been removed in favor of the :mod:`tempfile` module." msgstr "" +"As funções :func:`os.tmpnam`, :func:`os.tempnam` e :func:`os.tmpfile` foram " +"removidas em favor do módulo :mod:`tempfile`." #: ../../whatsnew/3.0.rst:657 msgid "" "The :mod:`tokenize` module has been changed to work with bytes. The main " "entry point is now :func:`tokenize.tokenize`, instead of generate_tokens." msgstr "" +"O módulo :mod:`tokenize` foi alterado para funcionar com bytes. O ponto de " +"entrada principal agora é :func:`tokenize.tokenize`, em vez de " +"generate_tokens." #: ../../whatsnew/3.0.rst:661 msgid "" @@ -945,6 +1307,11 @@ msgid "" "friends had locale-specific behavior, which is a bad idea for such " "attractively named global \"constants\".)" msgstr "" +":data:`string.letters` e seus amigos (:data:`string.lowercase` e :data:" +"`string.uppercase`) se foram. Use :data:`string.ascii_letters` etc. em vez " +"disso. (O motivo da remoção é que :data:`string.letters` e amigos tinham " +"comportamento específico de localidade, o que é uma má ideia para " +"\"constantes\" globais com nomes tão atraentes.)" #: ../../whatsnew/3.0.rst:668 msgid "" @@ -953,10 +1320,14 @@ msgid "" "most global namespaces is unchanged. To modify a builtin, you should use :" "mod:`builtins`, not :data:`__builtins__`!" msgstr "" +"Renomeado o módulo :mod:`__builtin__` para :mod:`builtins` (removendo os " +"sublinhados, adicionando um 's'). A variável :data:`__builtins__` encontrada " +"na maioria dos espaços de nomes globais não foi alterada. Para modificar um " +"builtin, você deve usar :mod:`builtins`, não :data:`__builtins__`!" #: ../../whatsnew/3.0.rst:675 msgid ":pep:`3101`: A New Approach To String Formatting" -msgstr "" +msgstr ":pep:`3101`: Uma nova abordagem para formatação de strings" #: ../../whatsnew/3.0.rst:677 msgid "" @@ -965,16 +1336,23 @@ msgid "" "supported; it will be deprecated in Python 3.1 and removed from the " "language at some later time.) Read :pep:`3101` for the full scoop." msgstr "" +"Um novo sistema para operações de formatação de strings embutidas substitui " +"o operador de formatação de strings ``%``. (No entanto, o operador ``%`` " +"ainda é suportado; ele será descontinuado no Python 3.1 e removido da " +"linguagem em algum momento posterior.) Leia a :pep:`3101` para obter " +"informações completas." #: ../../whatsnew/3.0.rst:685 msgid "Changes To Exceptions" -msgstr "" +msgstr "Mudanças para exceções" #: ../../whatsnew/3.0.rst:687 msgid "" "The APIs for raising and catching exception have been cleaned up and new " "powerful features added:" msgstr "" +"As APIs para levantar e capturar exceções foram limpas e novos recursos " +"poderosos foram adicionados:" #: ../../whatsnew/3.0.rst:690 msgid "" @@ -985,6 +1363,13 @@ msgid "" "raised, and placed no restriction on what you can catch.) As a consequence, " "string exceptions are finally truly and utterly dead." msgstr "" +":pep:`352`: Todas as exceções devem ser derivadas (direta ou indiretamente) " +"de :exc:`BaseException`. Esta é a raiz da hierarquia de exceções. Isso não é " +"novo como recomendação, mas o *requisito* para herdar de :exc:" +"`BaseException` é novo. (O Python 2.6 ainda permitia que classes clássicas " +"fossem levantadas e não colocava nenhuma restrição sobre o que você pode " +"capturar.) Como consequência, exceções de string estão finalmente verdadeira " +"e completamente mortas." #: ../../whatsnew/3.0.rst:698 msgid "" @@ -994,16 +1379,24 @@ msgid "" "`KeyboardInterrupt`. The recommended idiom for handling all exceptions " "except for this latter category is to use :keyword:`except` :exc:`Exception`." msgstr "" +"Quase todas as exceções devem derivar de :exc:`Exception`; :exc:" +"`BaseException` deve ser usado apenas como uma classe base para exceções que " +"devem ser manipuladas apenas no nível superior, como :exc:`SystemExit` ou :" +"exc:`KeyboardInterrupt`. O idioma recomendado para manipular todas as " +"exceções, exceto para esta última categoria, é usar :keyword:`except` :exc:" +"`Exception`." #: ../../whatsnew/3.0.rst:705 msgid ":exc:`StandardError` was removed." -msgstr "" +msgstr ":exc:`StandardError` foi removida." #: ../../whatsnew/3.0.rst:707 msgid "" "Exceptions no longer behave as sequences. Use the :attr:`args` attribute " "instead." msgstr "" +"As exceções não se comportam mais como sequências. Use o atributo :attr:" +"`args` em vez disso." #: ../../whatsnew/3.0.rst:710 msgid "" @@ -1013,6 +1406,12 @@ msgid "" "this, you can assign directly to the :attr:`~BaseException.__traceback__` " "attribute (see below)." msgstr "" +":pep:`3109`: levantando exceções. Agora você deve usar :samp:`raise " +"{Exception}({args})` em vez de :samp:`raise {Exception}, {args}`. Além " +"disso, você não pode mais especificar explicitamente um traceback (situação " +"da pilha de execução); em vez disso, se você *precisar* fazer isso, você " +"pode atribuir diretamente ao atributo :attr:`~BaseException.__traceback__` " +"(veja abaixo)." #: ../../whatsnew/3.0.rst:716 msgid "" @@ -1021,6 +1420,10 @@ msgid "" "{variable}`. Moreover, the *variable* is explicitly deleted when the :" "keyword:`except` block is left." msgstr "" +":pep:`3110`: Capturando exceções. Agora você deve usar :samp:`except " +"{SomeException} as {variable}` em vez de :samp:`except {SomeException}, " +"{variable}`. Além disso, a variável *variable* é explicitamente excluída " +"quando o bloco :keyword:`except` é deixado." #: ../../whatsnew/3.0.rst:722 msgid "" @@ -1032,6 +1435,14 @@ msgid "" "saved as the :attr:`~BaseException.__context__` attribute of the secondary " "exception. Explicit chaining is invoked with this syntax::" msgstr "" +":pep:`3134`: Encadeamento de exceções. Existem dois casos: encadeamento " +"implícito e encadeamento explícito. O encadeamento implícito acontece quando " +"uma exceção é levantada em um bloco manipulador :keyword:`except` ou :" +"keyword:`finally`. Isso geralmente acontece devido a um bug no bloco do " +"manipulador; chamamos isso de exceção *secundária*. Nesse caso, a exceção " +"original (que estava sendo manipulada) é salva como o atributo :attr:" +"`~BaseException.__context__` da exceção secundária. O encadeamento explícito " +"é invocado com esta sintaxe::" #: ../../whatsnew/3.0.rst:733 msgid "" @@ -1044,6 +1455,14 @@ msgid "" "each component of the chain, with the primary exception at the top. (Java " "users may recognize this behavior.)" msgstr "" +"(onde *primary_exception* é qualquer expressão que produz um objeto de " +"exceção, provavelmente uma exceção que foi capturada anteriormente). Neste " +"caso, a exceção primária é armazenada no atributo :attr:`~BaseException." +"__cause__` da exceção secundária. O traceback impresso quando uma exceção " +"não tratada ocorre percorre a cadeia de atributos :attr:`!__cause__` e :attr:" +"`~BaseException.__context__` e imprime um traceback separado para cada " +"componente da cadeia, com a exceção primária no topo. (Usuários Java podem " +"reconhecer este comportamento.)" #: ../../whatsnew/3.0.rst:743 msgid "" @@ -1053,6 +1472,10 @@ msgid "" "there are fewer reasons to use :func:`sys.exc_info` (though the latter is " "not removed)." msgstr "" +":pep:`3134`: Objetos exceção agora armazenam seu traceback como o atributo :" +"attr:`~BaseException.__traceback__`. Isso significa que um objeto de exceção " +"agora contém todas as informações pertencentes a uma exceção, e há menos " +"motivos para usar :func:`sys.exc_info` (embora o último não seja removido)." #: ../../whatsnew/3.0.rst:749 msgid "" @@ -1060,20 +1483,26 @@ msgid "" "extension module. For example, ``error code 193`` is now ``%1 is not a " "valid Win32 application``. Strings now deal with non-English locales." msgstr "" +"Algumas mensagens de exceção estão melhores quando o Windows falha ao " +"carregar um módulo de extensão. Por exemplo, ``error code 193`` agora é ``%1 " +"is not a valid Win32 application``. As strings agora lidam com localidades " +"que não sejam em inglês." #: ../../whatsnew/3.0.rst:756 msgid "Miscellaneous Other Changes" -msgstr "" +msgstr "Outras mudanças diversas" #: ../../whatsnew/3.0.rst:759 msgid "Operators And Special Methods" -msgstr "" +msgstr "Operadores e métodos especiais" #: ../../whatsnew/3.0.rst:761 msgid "" "``!=`` now returns the opposite of ``==``, unless ``==`` returns :data:" "`NotImplemented`." msgstr "" +"``!=`` agora retorna o oposto de ``==``, a menos que ``==`` retorne :data:" +"`NotImplemented`." #: ../../whatsnew/3.0.rst:764 msgid "" @@ -1081,6 +1510,9 @@ msgid "" "referencing a method as a class attribute, you now get a plain function " "object." msgstr "" +"O conceito de \"métodos não vinculados\" foi removido da linguagem. Ao " +"referenciar um método como um atributo de classe, agora você obtém um objeto " +"função simples." #: ../../whatsnew/3.0.rst:768 msgid "" @@ -1089,12 +1521,18 @@ msgid "" "j))`` (or :meth:`__setitem__` or :meth:`__delitem__`, when used as an " "assignment or deletion target, respectively)." msgstr "" +":meth:`__getslice__`, :meth:`__setslice__` e :meth:`__delslice__` foram " +"eliminados. A sintaxe ``a[i:j]`` agora é traduzida para ``a." +"__getitem__(slice(i, j))`` (ou :meth:`__setitem__` ou :meth:`__delitem__`, " +"quando usado como um alvo de atribuição ou exclusão, respectivamente)." #: ../../whatsnew/3.0.rst:774 msgid "" ":pep:`3114`: the standard :meth:`next` method has been renamed to :meth:" "`~iterator.__next__`." msgstr "" +":pep:`3114`: o método padrão :meth:`next` foi renomeado para :meth:" +"`~iterator.__next__`." #: ../../whatsnew/3.0.rst:777 msgid "" @@ -1102,10 +1540,13 @@ msgid "" "`oct` and :func:`hex` use :meth:`__index__` now to convert the argument to " "an integer." msgstr "" +"Os métodos especiais :meth:`__oct__` e :meth:`__hex__` foram removidos -- :" +"func:`oct` e :func:`hex` usam :meth:`__index__` agora para converter o " +"argumento em um inteiro." #: ../../whatsnew/3.0.rst:781 msgid "Removed support for :attr:`__members__` and :attr:`__methods__`." -msgstr "" +msgstr "Removido o suporte para :attr:`__members__` e :attr:`__methods__`." #: ../../whatsnew/3.0.rst:783 msgid "" @@ -1118,14 +1559,23 @@ msgid "" "__defaults__`, :attr:`~function.__dict__`, :attr:`~function.__doc__`, :attr:" "`~function.__globals__`, :attr:`~function.__name__`, respectively." msgstr "" +"Os atributos de função chamados :attr:`!func_X` foram renomeados para usar o " +"formato :attr:`!__X__`, liberando esses nomes no espaço de nomes de " +"atributos de função para atributos definidos pelo usuário. A saber, :attr:`!" +"func_closure`, :attr:`!func_code`, :attr:`!func_defaults`, :attr:`!" +"func_dict`, :attr:`!func_doc`, :attr:`!func_globals`, :attr:`!func_name` " +"foram renomeados para :attr:`~function.__closure__`, :attr:`~function." +"__code__`, :attr:`~function.__defaults__`, :attr:`~function.__dict__`, :attr:" +"`~function.__doc__`, :attr:`~function.__globals__`, :attr:`~function." +"__name__`, respectivamente." #: ../../whatsnew/3.0.rst:794 msgid ":meth:`!__nonzero__` is now :meth:`~object.__bool__`." -msgstr "" +msgstr ":meth:`!__nonzero__` agora é :meth:`~object.__bool__`." #: ../../whatsnew/3.0.rst:797 msgid "Builtins" -msgstr "" +msgstr "Funções embutidas" #: ../../whatsnew/3.0.rst:799 msgid "" @@ -1135,6 +1585,11 @@ msgid "" "automatically be chosen. With arguments, the behavior of :func:`super` is " "unchanged." msgstr "" +":pep:`3135`: Nova função :func:`super`. Agora você pode invocar :func:" +"`super` sem argumentos e (presumindo que isso esteja em um método de " +"instância regular definido dentro de uma instrução :keyword:`class`) a " +"classe e instância corretas serão automaticamente escolhidas. Com " +"argumentos, o comportamento de :func:`super` não é alterado." #: ../../whatsnew/3.0.rst:805 msgid "" @@ -1144,12 +1599,19 @@ msgid "" "input is terminated prematurely. To get the old behavior of :func:`input`, " "use ``eval(input())``." msgstr "" +":pep:`3111`: :func:`raw_input` foi renomeada para :func:`input`. Ou seja, a " +"nova função :func:`input` lê uma linha de :data:`sys.stdin` e a retorna com " +"a nova linha final removida. Ela levanta :exc:`EOFError` se a entrada for " +"encerrada prematuramente. Para obter o comportamento antigo de :func:" +"`input`, use ``eval(input())``." #: ../../whatsnew/3.0.rst:811 msgid "" "A new built-in function :func:`next` was added to call the :meth:`~iterator." "__next__` method on an object." msgstr "" +"Uma nova função embutido :func:`next` foi adicionada para chamar o método :" +"meth:`~iterator.__next__` em um objeto." #: ../../whatsnew/3.0.rst:814 msgid "" @@ -1161,15 +1623,23 @@ msgid "" "a single argument and a value of the same type as ``x`` when called with two " "arguments." msgstr "" +"A estratégia de arredondamento da função :func:`round` e o tipo de retorno " +"foram alterados. Casos exatos de meio caminho agora são arredondados para o " +"resultado par mais próximo em vez de para longe de zero. (Por exemplo, " +"``round(2.5)`` agora retorna ``2`` em vez de ``3``.) ``round(x[, n])`` agora " +"delega para ``x.__round__([n])`` em vez de sempre retornar um float. " +"Geralmente retorna um inteiro quando chamado com um único argumento e um " +"valor do mesmo tipo que ``x`` quando chamado com dois argumentos." #: ../../whatsnew/3.0.rst:823 msgid "Moved :func:`intern` to :func:`sys.intern`." -msgstr "" +msgstr "Movida :func:`intern` para :func:`sys.intern`." #: ../../whatsnew/3.0.rst:825 msgid "" "Removed: :func:`apply`. Instead of ``apply(f, args)`` use ``f(*args)``." msgstr "" +"Removida: :func:`apply`. Em vez de ``apply(f, args)`` use ``f(*args)``." #: ../../whatsnew/3.0.rst:828 msgid "" @@ -1177,24 +1647,33 @@ msgid "" "``isinstance(f, collections.Callable)``. The :func:`operator.isCallable` " "function is also gone." msgstr "" +"Removida :func:`callable`. Em vez de ``callable(f)`` você pode usar " +"``isinstance(f, collections.Callable)``. A função :func:`operator." +"isCallable` também foi removida." #: ../../whatsnew/3.0.rst:832 msgid "" "Removed :func:`coerce`. This function no longer serves a purpose now that " "classic classes are gone." msgstr "" +"Removida :func:`coerce`. Esta função não tem mais propósito agora que as " +"classes clássicas desapareceram." #: ../../whatsnew/3.0.rst:835 msgid "" "Removed :func:`execfile`. Instead of ``execfile(fn)`` use ``exec(open(fn)." "read())``." msgstr "" +"Removida :func:`execfile`. Em vez de ``execfile(fn)`` use ``exec(open(fn)." +"read())``." #: ../../whatsnew/3.0.rst:838 msgid "" "Removed the :class:`file` type. Use :func:`open`. There are now several " "different kinds of streams that open can return in the :mod:`io` module." msgstr "" +"Removido o tipo :class:`file`. Use :func:`open`. Agora há vários tipos " +"diferentes de fluxos que open pode retornar no módulo :mod:`io`." #: ../../whatsnew/3.0.rst:841 msgid "" @@ -1202,53 +1681,63 @@ msgid "" "however, 99 percent of the time an explicit :keyword:`for` loop is more " "readable." msgstr "" +"Removida :func:`reduce`. Use :func:`functools.reduce` se realmente precisar; " +"no entanto, 99 por cento das vezes um laço explícito :keyword:`for` é mais " +"legível." #: ../../whatsnew/3.0.rst:845 msgid "Removed :func:`reload`. Use :func:`!imp.reload`." -msgstr "" +msgstr "Removida :func:`reload`. Use :func:`!imp.reload`." #: ../../whatsnew/3.0.rst:847 msgid "" "Removed. :meth:`dict.has_key` -- use the :keyword:`in` operator instead." msgstr "" +"Removida. :meth:`dict.has_key` -- use o operador :keyword:`in` em vez disso." #: ../../whatsnew/3.0.rst:854 msgid "Build and C API Changes" -msgstr "Alterações a construções e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/3.0.rst:856 msgid "" "Due to time constraints, here is a *very* incomplete list of changes to the " "C API." msgstr "" +"Devido a restrições de tempo, aqui está uma lista *muito* incompleta de " +"alterações na API C." #: ../../whatsnew/3.0.rst:859 msgid "" "Support for several platforms was dropped, including but not limited to Mac " "OS 9, BeOS, RISCOS, Irix, and Tru64." msgstr "" +"O suporte para várias plataformas foi descartado, incluindo, mas não se " +"limitando a Mac OS 9, BeOS, RISCOS, Irix e Tru64." #: ../../whatsnew/3.0.rst:862 msgid ":pep:`3118`: New Buffer API." -msgstr "" +msgstr ":pep:`3118`: Nova API de Buffer." #: ../../whatsnew/3.0.rst:864 msgid ":pep:`3121`: Extension Module Initialization & Finalization." -msgstr "" +msgstr ":pep:`3121`: Inicialização e finalização do módulo de extensão." #: ../../whatsnew/3.0.rst:866 msgid ":pep:`3123`: Making :c:macro:`PyObject_HEAD` conform to standard C." -msgstr "" +msgstr ":pep:`3123`: Tornando :c:macro:`PyObject_HEAD` conforme o padrão C." #: ../../whatsnew/3.0.rst:868 msgid "No more C API support for restricted execution." -msgstr "" +msgstr "Não há mais suporte à API C para execução restrita." #: ../../whatsnew/3.0.rst:870 msgid "" ":c:func:`!PyNumber_Coerce`, :c:func:`!PyNumber_CoerceEx`, :c:func:`!" "PyMember_Get`, and :c:func:`!PyMember_Set` C APIs are removed." msgstr "" +"As APIs C :c:func:`!PyNumber_Coerce`, :c:func:`!PyNumber_CoerceEx`, :c:func:" +"`!PyMember_Get` e :c:func:`!PyMember_Set` foram removidas." #: ../../whatsnew/3.0.rst:873 msgid "" @@ -1256,22 +1745,28 @@ msgid "" "`PyImport_ImportModule` but won't block on the import lock (returning an " "error instead)." msgstr "" +"Nova API C :c:func:`PyImport_ImportModuleNoBlock`, funciona como :c:func:" +"`PyImport_ImportModule`, mas não bloqueia na trava de importação (retornando " +"um erro)." #: ../../whatsnew/3.0.rst:877 msgid "" "Renamed the boolean conversion C-level slot and method: ``nb_nonzero`` is " "now ``nb_bool``." msgstr "" +"Renomeado o slot e o método de nível C de conversão booleana: ``nb_nonzero`` " +"agora é ``nb_bool``." #: ../../whatsnew/3.0.rst:880 msgid "" "Removed :c:macro:`!METH_OLDARGS` and :c:macro:`!WITH_CYCLE_GC` from the C " "API." msgstr "" +"Removidas :c:macro:`!METH_OLDARGS` e :c:macro:`!WITH_CYCLE_GC` da API C." #: ../../whatsnew/3.0.rst:886 msgid "Performance" -msgstr "" +msgstr "Desempenho" #: ../../whatsnew/3.0.rst:888 msgid "" @@ -1280,26 +1775,36 @@ msgid "" "biggest cause is the removal of special-casing for small integers. There's " "room for improvement, but it will happen after 3.0 is released!" msgstr "" +"O resultado líquido das generalizações do 3.0 é que o Python 3.0 executa o " +"benchmark pystone cerca de 10% mais lento que o Python 2.5. Provavelmente a " +"maior causa é a remoção do uso de maiúsculas e minúsculas especiais para " +"números inteiros pequenos. Há espaço para melhorias, mas isso acontecerá " +"após o lançamento do 3.0!" #: ../../whatsnew/3.0.rst:898 msgid "Porting To Python 3.0" -msgstr "" +msgstr "Portando para o Python 3.0" #: ../../whatsnew/3.0.rst:900 msgid "" "For porting existing Python 2.5 or 2.6 source code to Python 3.0, the best " "strategy is the following:" msgstr "" +"Para portar o código-fonte existente do Python 2.5 ou 2.6 para o Python 3.0, " +"a melhor estratégia é a seguinte:" #: ../../whatsnew/3.0.rst:903 msgid "(Prerequisite:) Start with excellent test coverage." -msgstr "" +msgstr "(Pré-requisito:) Comece com uma excelente cobertura de teste." #: ../../whatsnew/3.0.rst:905 msgid "" "Port to Python 2.6. This should be no more work than the average port from " "Python 2.x to Python 2.(x+1). Make sure all your tests pass." msgstr "" +"Portar para o Python 2.6. Isso não deve dar mais trabalho do que o port " +"médio do Python 2.x para o Python 2.(x+1). Certifique-se de que todos os " +"seus testes passem." #: ../../whatsnew/3.0.rst:909 msgid "" @@ -1308,6 +1813,11 @@ msgid "" "Run your test suite again, and fix code that you get warnings about until " "there are no warnings left, and all your tests still pass." msgstr "" +"(Ainda usando 2.6:) Ative a opção de linha de comando :option:`!-3`. Isso " +"habilita avisos sobre recursos que serão removidos (ou alterados) no 3.0. " +"Execute seu conjunto de testes novamente e corrija o código sobre o qual " +"você recebe avisos até que não haja mais avisos e todos os seus testes ainda " +"passem." #: ../../whatsnew/3.0.rst:915 msgid "" @@ -1327,8 +1837,16 @@ msgid "" "the source code and running the ``2to3`` translator again, rather than " "editing the 3.0 version of the source code." msgstr "" +"Não é recomendado tentar escrever código-fonte que seja executado inalterado " +"no Python 2.6 e 3.0; você teria que usar um estilo de codificação muito " +"distorcido, por exemplo, evitando instruções ``print``, metaclasses e muito " +"mais. Se você estiver mantendo uma biblioteca que precisa ter suporte ao " +"Python 2.6 e Python 3.0, a melhor abordagem é modificar a etapa 3 acima " +"editando a versão 2.6 do código-fonte e executando o tradutor ``2to3`` " +"novamente, em vez de editar a versão 3.0 do código-fonte." #: ../../whatsnew/3.0.rst:929 msgid "" "For porting C extensions to Python 3.0, please see :ref:`cporting-howto`." msgstr "" +"Para portar extensões C para Python 3.0, consulte :ref:`cporting-howto`." diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 7c3b9431c..7e7c099fc 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -91,15 +91,15 @@ msgid "" "the decoder. Support was also added for third-party tools like `PyYAML " "`_." msgstr "" -"A biblioteca padrão agora suporta o uso de dicionários ordenados em vários " -"módulos. O módulo :mod:`configparser` usa-os por padrão. Isso permite que os " -"arquivos de configuração sejam lidos, modificados e depois gravados de volta " -"na ordem original. O método *_asdict()* para :func:`collections.namedtuple` " -"agora retorna um dicionário ordenado com os valores aparecendo na mesma " -"ordem que os índices de tupla subjacentes. O módulo :mod:`json` está sendo " -"construído com um *object_pairs_hook* para permitir que OrderedDicts sejam " -"construídos pelo decodificador. Também foi adicionado suporte para " -"ferramentas de terceiros como `PyYAML `_." +"A biblioteca padrão agora possui suporte para dicionários ordenados em " +"vários módulos. O módulo :mod:`configparser` usa-os por padrão. Isso permite " +"que os arquivos de configuração sejam lidos, modificados e depois gravados " +"de volta na ordem original. O método *_asdict()* para :func:`collections." +"namedtuple` agora retorna um dicionário ordenado com os valores aparecendo " +"na mesma ordem que os índices de tupla subjacentes. O módulo :mod:`json` " +"está sendo construído com um *object_pairs_hook* para permitir que " +"OrderedDicts sejam construídos pelo decodificador. Também foi adicionado " +"suporte para ferramentas de terceiros como `PyYAML `_." #: ../../whatsnew/3.1.rst:79 msgid ":pep:`372` - Ordered Dictionaries" @@ -245,6 +245,12 @@ msgid "" "`bytearray` each have their own **maketrans** and **translate** methods with " "intermediate translation tables of the appropriate type." msgstr "" +"The :func:`!string.maketrans` function is deprecated and is replaced by new " +"static methods, :meth:`bytes.maketrans` and :meth:`bytearray.maketrans`. " +"This change solves the confusion around which types were supported by the :" +"mod:`string` module. Now, :class:`str`, :class:`bytes`, and :class:" +"`bytearray` each have their own **maketrans** and **translate** methods with " +"intermediate translation tables of the appropriate type." #: ../../whatsnew/3.1.rst:184 msgid "(Contributed by Georg Brandl; :issue:`5675`.)" @@ -263,6 +269,8 @@ msgid "" "With the new syntax, the :func:`!contextlib.nested` function is no longer " "needed and is now deprecated." msgstr "" +"With the new syntax, the :func:`!contextlib.nested` function is no longer " +"needed and is now deprecated." #: ../../whatsnew/3.1.rst:197 msgid "" @@ -584,6 +592,13 @@ msgid "" "`, :meth:`~unittest.TestCase." "assertIsNone`, and :meth:`~unittest.TestCase.assertIsNotNone`." msgstr "" +"In addition, several new assertion methods were added including :meth:" +"`~unittest.TestCase.assertSetEqual`, :meth:`~unittest.TestCase." +"assertDictEqual`, :meth:`!assertDictContainsSubset`, :meth:`~unittest." +"TestCase.assertListEqual`, :meth:`~unittest.TestCase.assertTupleEqual`, :" +"meth:`~unittest.TestCase.assertSequenceEqual`, :meth:`assertRaisesRegexp() " +"`, :meth:`~unittest.TestCase." +"assertIsNone`, and :meth:`~unittest.TestCase.assertIsNotNone`." #: ../../whatsnew/3.1.rst:394 msgid "(Contributed by Benjamin Peterson and Antoine Pitrou.)" @@ -594,10 +609,12 @@ msgid "" "The :mod:`io` module has three new constants for the :meth:`~io.IOBase.seek` " "method: :data:`~os.SEEK_SET`, :data:`~os.SEEK_CUR`, and :data:`~os.SEEK_END`." msgstr "" +"The :mod:`io` module has three new constants for the :meth:`~io.IOBase.seek` " +"method: :data:`~os.SEEK_SET`, :data:`~os.SEEK_CUR`, and :data:`~os.SEEK_END`." #: ../../whatsnew/3.1.rst:399 msgid "The :data:`sys.version_info` tuple is now a named tuple::" -msgstr "" +msgstr "The :data:`sys.version_info` tuple is now a named tuple::" #: ../../whatsnew/3.1.rst:404 msgid "(Contributed by Ross Light; :issue:`4285`.)" @@ -753,6 +770,11 @@ msgid "" "closely match the `JSON specification `_ which is defined " "in terms of Unicode." msgstr "" +"The :mod:`json` module now has a C extension to substantially improve its " +"performance. In addition, the API was modified so that json works only " +"with :class:`str`, not with :class:`bytes`. That change makes the module " +"closely match the `JSON specification `_ which is defined " +"in terms of Unicode." #: ../../whatsnew/3.1.rst:483 msgid "" @@ -792,7 +814,7 @@ msgstr "(Contributed by Roger D. Serwy; :issue:`5150`.)" #: ../../whatsnew/3.1.rst:500 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/3.1.rst:502 msgid "Changes to Python's build process and to the C API include:" @@ -852,6 +874,7 @@ msgstr "(Contributed by Mark Dickinson and Lisandro Dalcrin; :issue:`5175`.)" msgid "" "Deprecated :c:func:`!PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." msgstr "" +"Deprecated :c:func:`!PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." #: ../../whatsnew/3.1.rst:532 msgid "(Contributed by Mark Dickinson; :issue:`4910`.)" @@ -863,6 +886,9 @@ msgid "" "deprecated functions :c:func:`!PyOS_ascii_strtod` and :c:func:`!" "PyOS_ascii_atof`." msgstr "" +"Added a new :c:func:`PyOS_string_to_double` function to replace the " +"deprecated functions :c:func:`!PyOS_ascii_strtod` and :c:func:`!" +"PyOS_ascii_atof`." #: ../../whatsnew/3.1.rst:537 msgid "(Contributed by Mark Dickinson; :issue:`5914`.)" @@ -876,6 +902,11 @@ msgid "" "calling a destructor. The old type had a problematic API and is now " "deprecated." msgstr "" +"Added :c:type:`PyCapsule` as a replacement for the :c:type:`!PyCObject` API. " +"The principal difference is that the new type has a well defined interface " +"for passing typing safety information and a less complicated signature for " +"calling a destructor. The old type had a problematic API and is now " +"deprecated." #: ../../whatsnew/3.1.rst:545 msgid "(Contributed by Larry Hastings; :issue:`5630`.)" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 8d94b24c5..e29e7882d 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -24,10 +24,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -100,7 +100,7 @@ msgstr "" #: ../../whatsnew/3.10.rst:75 msgid "New typing features:" -msgstr " Novos recursos de digitação:" +msgstr "Novos recursos de tipagem:" #: ../../whatsnew/3.10.rst:77 msgid ":pep:`604`, Allow writing union types as X | Y" @@ -642,7 +642,7 @@ msgid "" msgstr "" "Os padrões podem parecer atribuições de desempacotamento e um padrão pode " "ser usado para vincular variáveis. Neste exemplo, um ponto de dados pode ser " -"descompactado em sua coordenada x e coordenada y::" +"desempacotado em sua coordenada x e coordenada y::" #: ../../whatsnew/3.10.rst:543 msgid "" @@ -3838,7 +3838,7 @@ msgid "" "for historical reason. It is no longer allowed. (Contributed by Victor " "Stinner in :issue:`40839`.)" msgstr "" -"A chamada de :c:func:`PyDict_GetItem` sem :term:`GIL` retido era permitido " +"A chamada de :c:func:`PyDict_GetItem` sem a :term:`GIL` retida era permitido " "por razões históricas. Isso não é mais permitido. (Contribuição de Victor " "Stinner em :issue:`40839`.)" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index ebaf4b4ef..98b313dc1 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -26,10 +26,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -118,7 +118,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:86 msgid "New typing features:" -msgstr " Novos recursos de tipagem:" +msgstr "Novos recursos de tipagem:" #: ../../whatsnew/3.11.rst:88 msgid ":ref:`whatsnew311-pep646`" @@ -615,7 +615,7 @@ msgid "" "Starred unpacking expressions can now be used in :keyword:`for` statements. " "(See :issue:`46725` for more details.)" msgstr "" -"Expressões de descompactação com asterisco agora podem ser usadas em " +"Expressões de desempacotamento com asterisco agora podem ser usadas em " "instruções :keyword:`for`. (Veja :issue:`46725` para mais detalhes.)" #: ../../whatsnew/3.11.rst:442 @@ -1406,7 +1406,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:885 msgid "operator" -msgstr "operator" +msgstr "operador" #: ../../whatsnew/3.11.rst:887 msgid "" @@ -2021,7 +2021,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:1232 msgid "warnings" -msgstr "warnings" +msgstr "avisos" #: ../../whatsnew/3.11.rst:1234 msgid "" @@ -4497,7 +4497,7 @@ msgid "" "func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` and :c:func:" "`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" -"Adiciona novas funções para compactar e descompactar double C (serializar e " +"Adiciona novas funções para compactar e desempacotar double C (serializar e " "desserializar): :c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:" "`PyFloat_Pack8`, :c:func:`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` e :c:" "func:`PyFloat_Unpack8`. (Contribuição de Victor Stinner em :issue:`46906`.)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index d560e4036..cb12f34c1 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -26,10 +26,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -148,8 +148,8 @@ msgid "" ":ref:`PEP 684 `, a unique per-interpreter :term:`GIL " "`" msgstr "" -":ref:`PEP 684 `, um único :term:`GIL ` por interpretador" +":ref:`PEP 684 `, uma única :term:`GIL ` por interpretador" #: ../../whatsnew/3.12.rst:102 msgid ":ref:`PEP 669 `, low impact monitoring" @@ -232,7 +232,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:126 msgid "Security improvements:" -msgstr "Melhorias de segurança:" +msgstr "Melhorias de Segurança:" #: ../../whatsnew/3.12.rst:128 msgid "" @@ -278,7 +278,7 @@ msgstr "Implementa proteção contra estouro de pilha em plataformas suportadas" #: ../../whatsnew/3.12.rst:145 msgid "New typing features:" -msgstr " Novos recursos de tipagem:" +msgstr "Novos recursos de tipagem:" #: ../../whatsnew/3.12.rst:147 msgid "" @@ -575,7 +575,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:337 msgid "PEP 684: A Per-Interpreter GIL" -msgstr "PEP 684: Um GIL por interpretador" +msgstr "PEP 684: Uma GIL por interpretador" #: ../../whatsnew/3.12.rst:339 msgid "" @@ -585,8 +585,8 @@ msgid "" "CPU cores. This is currently only available through the C-API, though a " "Python API is :pep:`anticipated for 3.13 <554>`." msgstr "" -"A :pep:`684` introduz um :term:`GIL ` por " -"interpretador, para que subinterpretadores possam agora ser criados com um " +"A :pep:`684` introduz uma :term:`GIL ` por " +"interpretador, para que subinterpretadores possam agora ser criados com uma " "GIL único por interpretador. Isso permite que programas Python aproveitem ao " "máximo vários núcleos de CPU. Isso está atualmente disponível apenas por " "meio da API C, embora uma API Python seja :pep:`esperada para 3.13 <554>`." @@ -597,15 +597,16 @@ msgid "" "interpreter with its own GIL:" msgstr "" "Use a nova função :c:func:`Py_NewInterpreterFromConfig` para criar um " -"interpretador com seu próprio GIL:" +"interpretador com sua própria GIL:" #: ../../whatsnew/3.12.rst:361 msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" "interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -"Para obter mais exemplos de como usar a API C para subinterpretadores com um " -"GIL por interpretador, consulte :source:`Modules/_xxsubinterpretersmodule.c`." +"Para obter mais exemplos de como usar a API C para subinterpretadores com " +"uma GIL por interpretador, consulte :source:`Modules/" +"_xxsubinterpretersmodule.c`." #: ../../whatsnew/3.12.rst:364 msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" @@ -2748,7 +2749,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:1401 ../../whatsnew/3.12.rst:2362 msgid "Pending Removal in Python 3.14" -msgstr "Remoção pendente em Python 3.14" +msgstr "Remoção pendente no Python 3.14" #: ../../whatsnew/3.12.rst:1403 msgid "" @@ -2868,7 +2869,7 @@ msgstr "O atributo :attr:`~codeobject.co_lnotab` de objetos código." #: ../../whatsnew/3.12.rst:1461 ../../whatsnew/3.12.rst:2399 msgid "Pending Removal in Python 3.15" -msgstr "Remoção pendente em Python 3.15" +msgstr "Remoção pendente no Python 3.15" #: ../../whatsnew/3.12.rst:1463 msgid "" @@ -3287,7 +3288,7 @@ msgid "" "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: o " -"esquema de bloqueio foi alterado no Python 3.3 para bloqueios por módulo." +"esquema de trava foi alterado no Python 3.3 para travas por módulo." #: ../../whatsnew/3.12.rst:1647 msgid "" @@ -3833,16 +3834,15 @@ msgid "" "fine. If synchronization is needed, implement locking within the cached " "property getter function or around multi-threaded access points." msgstr "" -"O comportamento não documentado de bloqueio de :func:`~functools." -"cached_property` foi removido, porque bloqueava todas as instâncias da " -"classe, levando a uma alta contenção de bloqueio. Isso significa que uma " -"função getter de propriedade em cache agora pode ser executada mais de uma " -"vez para uma única instância, se duas threads competirem. Para a maioria das " -"propriedades simples em cache (por exemplo, aquelas que são idempotentes e " -"simplesmente calculam um valor com base em outros atributos da instância), " -"isso será suficiente. Se a sincronização for necessária, implemente o " -"bloqueio na função getter de propriedade em cache ou em torno de pontos de " -"acesso multithread." +"O comportamento não documentado de trava de :func:`~functools." +"cached_property` foi removido, porque travava todas as instâncias da classe, " +"levando a uma alta contenção de trava. Isso significa que uma função getter " +"de propriedade em cache agora pode ser executada mais de uma vez para uma " +"única instância, se duas threads competirem. Para a maioria das propriedades " +"simples em cache (por exemplo, aquelas que são idempotentes e simplesmente " +"calculam um valor com base em outros atributos da instância), isso será " +"suficiente. Se a sincronização for necessária, implemente a trava na função " +"getter de propriedade em cache ou em torno de pontos de acesso multithread." #: ../../whatsnew/3.12.rst:1876 msgid "" @@ -3941,7 +3941,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:1929 msgid "Build Changes" -msgstr "Alterações de construção" +msgstr "Alterações de compilação" #: ../../whatsnew/3.12.rst:1931 msgid "" @@ -4431,9 +4431,9 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" ":pep:`684`: Adiciona a nova função :c:func:`Py_NewInterpreterFromConfig` e :" -"c:type:`PyInterpreterConfig`, que podem ser usadas para criar sub-" -"interpretadores com seus próprios GILs. (Veja :ref:`whatsnew312-pep684` para " -"mais informações.) (Contribuição de Eric Snow em :gh:`104110`.)" +"c:type:`PyInterpreterConfig`, que podem ser usadas para criar " +"subinterpretadores com suas próprias GILs. (Veja :ref:`whatsnew312-pep684` " +"para mais informações.) (Contribuição de Eric Snow em :gh:`104110`.)" #: ../../whatsnew/3.12.rst:2129 msgid "" @@ -4661,7 +4661,7 @@ msgstr "" "Como ``tp_new`` substitui quase tudo que as funções ``PyType_From*`` fazem, " "os dois são incompatíveis entre si. O comportamento existente -- ignorar a " "metaclasse em vários passos de criação do tipo -- é inseguro em geral, uma " -"vez que as (meta)classes assumem que ``tp_new`` foi chamado. Não existe uma " +"vez que as (meta)classes presumem que ``tp_new`` foi chamado. Não existe uma " "solução geral simples. Um dos seguintes pode funcionar para você:" #: ../../whatsnew/3.12.rst:2231 diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index acdee2627..603838411 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2022\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -2894,7 +2894,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2528 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/3.2.rst:2530 msgid "Changes to Python's build process and to the C API include:" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index a0bd1057f..f28cf09e9 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -80,7 +80,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:69 msgid ":mod:`lzma` (compress data using the XZ / LZMA algorithm)" -msgstr "" +msgstr ":mod:`lzma` (compressão de dados usando o algoritmo XZ / LZMA)" #: ../../whatsnew/3.3.rst:70 msgid "" @@ -754,7 +754,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:608 msgid "PEP written and implemented by Antoine Pitrou." -msgstr "PEP escrito e implementado por Antoine Pitrou." +msgstr "PEP escrita e implementada por Antoine Pitrou." #: ../../whatsnew/3.3.rst:614 msgid "PEP 412: Key-Sharing Dictionary" @@ -3198,7 +3198,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2170 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/3.3.rst:2172 msgid "Changes to Python's build process and to the C API include:" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index d929a2db7..c9f2e9240 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -20,10 +20,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -229,7 +229,7 @@ msgstr "The :mod:`ipaddress` module API has been declared stable" #: ../../whatsnew/3.4.rst:132 msgid "Security improvements:" -msgstr "Melhorias de segurança:" +msgstr "Melhorias de Segurança:" #: ../../whatsnew/3.4.rst:134 msgid "" @@ -704,7 +704,7 @@ msgstr "Outras mudanças na linguagem" #: ../../whatsnew/3.4.rst:403 msgid "Some smaller changes made to the core Python language are:" -msgstr "Algumas das mudanças menores feitas no núcleo da linguagem Python são:" +msgstr "Alguma das mudanças menores feitas no núcleo da linguagem Python são:" #: ../../whatsnew/3.4.rst:405 msgid "Unicode database updated to UCD version 6.3." @@ -892,6 +892,14 @@ msgid "" "upgraded version of ``pip`` is considered to be a separately installed " "package and will not be removed if Python is uninstalled.)" msgstr "" +":mod:`ensurepip` includes a bundled copy of ``pip``, up-to-date as of the " +"first release candidate of the release of CPython with which it ships (this " +"applies to both maintenance releases and feature releases). ``ensurepip`` " +"does not access the internet. If the installation has Internet access, after " +"``ensurepip`` is run the bundled ``pip`` can be used to upgrade ``pip`` to a " +"more recent release than the bundled one. (Note that such an upgraded " +"version of ``pip`` is considered to be a separately installed package and " +"will not be removed if Python is uninstalled.)" #: ../../whatsnew/3.4.rst:499 msgid "" @@ -1037,7 +1045,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:584 msgid "PEP written and implemented by Victor Stinner" -msgstr "PEP escrita e implementada por Victor Stinner" +msgstr "PEP escrito e implementado por Victor Stinner" #: ../../whatsnew/3.4.rst:589 msgid "Improved Modules" @@ -1383,6 +1391,9 @@ msgid "" "halts test running as soon as the first failure is detected. (Contributed " "by R. David Murray and Daniel Urban in :issue:`16522`.)" msgstr "" +"A new :ref:`option flag `, :const:`~doctest.FAIL_FAST`, " +"halts test running as soon as the first failure is detected. (Contributed " +"by R. David Murray and Daniel Urban in :issue:`16522`.)" #: ../../whatsnew/3.4.rst:782 msgid "" @@ -1517,6 +1528,10 @@ msgid "" "the :func:`~filecmp.dircmp` function. (Contributed by Eli Bendersky in :" "issue:`15442`.)" msgstr "" +"New module attribute :const:`~filecmp.DEFAULT_IGNORES` provides the list of " +"directories that are used as the default value for the *ignore* parameter of " +"the :func:`~filecmp.dircmp` function. (Contributed by Eli Bendersky in :" +"issue:`15442`.)" #: ../../whatsnew/3.4.rst:851 msgid "functools" @@ -1568,6 +1583,9 @@ msgid "" "`NotImplemented` from the underlying comparison function. (Contributed by " "Katie Miller in :issue:`10042`.)" msgstr "" +":func:`~functools.total_ordering` now supports a return value of :data:" +"`NotImplemented` from the underlying comparison function. (Contributed by " +"Katie Miller in :issue:`10042`.)" #: ../../whatsnew/3.4.rst:878 msgid "" @@ -1755,7 +1773,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:971 msgid "idlelib and IDLE" -msgstr "idlelib e IDLE" +msgstr "idlelib and IDLE" #: ../../whatsnew/3.4.rst:973 msgid "" @@ -1807,6 +1825,9 @@ msgid "" "mod:`importlib` as part of the :mod:`!imp` module deprecation. (Contributed " "by Berker Peksag in :issue:`18193`.)" msgstr "" +"The :func:`~importlib.reload` function has been moved from :mod:`!imp` to :" +"mod:`importlib` as part of the :mod:`!imp` module deprecation. (Contributed " +"by Berker Peksag in :issue:`18193`.)" #: ../../whatsnew/3.4.rst:998 msgid "" @@ -1815,6 +1836,10 @@ msgid "" "the :func:`!get_magic` function in the deprecated :mod:`!imp` module. " "(Contributed by Brett Cannon in :issue:`18192`.)" msgstr "" +":mod:`importlib.util` now has a :data:`~importlib.util.MAGIC_NUMBER` " +"attribute providing access to the bytecode version number. This replaces " +"the :func:`!get_magic` function in the deprecated :mod:`!imp` module. " +"(Contributed by Brett Cannon in :issue:`18192`.)" #: ../../whatsnew/3.4.rst:1003 msgid "" @@ -1823,6 +1848,10 @@ msgid "" "same-named functions in the deprecated :mod:`!imp` module. (Contributed by " "Brett Cannon in :issue:`18194`.)" msgstr "" +"New :mod:`importlib.util` functions :func:`~importlib.util." +"cache_from_source` and :func:`~importlib.util.source_from_cache` replace the " +"same-named functions in the deprecated :mod:`!imp` module. (Contributed by " +"Brett Cannon in :issue:`18194`.)" #: ../../whatsnew/3.4.rst:1008 msgid "" @@ -2045,6 +2074,8 @@ msgid "" "mmap objects are now :ref:`weakly referenceable `. (Contributed " "by Valerie Lambert in :issue:`4885`.)" msgstr "" +"mmap objects are now :ref:`weakly referenceable `. (Contributed " +"by Valerie Lambert in :issue:`4885`.)" #: ../../whatsnew/3.4.rst:1121 msgid "multiprocessing" @@ -2204,6 +2235,12 @@ msgid "" "(Contributed by Christian Heimes in :issue:`18673` and Benjamin Peterson, " "respectively.)" msgstr "" +":func:`os.open` supports two new flags on platforms that provide them, :" +"const:`~os.O_PATH` (un-opened file descriptor), and :const:`~os.O_TMPFILE` " +"(unnamed temporary file; as of 3.4.0 release available only on Linux systems " +"with a kernel version of 3.11 or newer that have uapi headers). " +"(Contributed by Christian Heimes in :issue:`18673` and Benjamin Peterson, " +"respectively.)" #: ../../whatsnew/3.4.rst:1199 msgid "pdb" @@ -2285,6 +2322,13 @@ msgid "" "supports the binary plist format (:const:`~plistlib.FMT_BINARY`). " "(Contributed by Ronald Oussoren and others in :issue:`14455`.)" msgstr "" +":mod:`plistlib` now has an API that is similar to the standard pattern for " +"stdlib serialization protocols, with new :func:`~plistlib.load`, :func:" +"`~plistlib.dump`, :func:`~plistlib.loads`, and :func:`~plistlib.dumps` " +"functions. (The older API is now deprecated.) In addition to the already " +"supported XML plist format (:const:`~plistlib.FMT_XML`), it also now " +"supports the binary plist format (:const:`~plistlib.FMT_BINARY`). " +"(Contributed by Ronald Oussoren and others in :issue:`14455`.)" #: ../../whatsnew/3.4.rst:1247 msgid "poplib" @@ -2450,6 +2494,11 @@ msgid "" "RLIMIT_RTTIME`, and :const:`~resource.RLIMIT_SIGPENDING`. (Contributed by " "Christian Heimes in :issue:`19324`.)" msgstr "" +"On Linux kernel version 2.6.36 or later, there are also some new Linux " +"specific constants: :const:`~resource.RLIMIT_MSGQUEUE`, :const:`~resource." +"RLIMIT_NICE`, :const:`~resource.RLIMIT_RTPRIO`, :const:`~resource." +"RLIMIT_RTTIME`, and :const:`~resource.RLIMIT_SIGPENDING`. (Contributed by " +"Christian Heimes in :issue:`19324`.)" #: ../../whatsnew/3.4.rst:1331 msgid "" @@ -2457,6 +2506,9 @@ msgid "" "const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, and :const:" "`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in :issue:`19343`.)" msgstr "" +"On FreeBSD version 9 and later, there some new FreeBSD specific constants: :" +"const:`~resource.RLIMIT_SBSIZE`, :const:`~resource.RLIMIT_SWAP`, and :const:" +"`~resource.RLIMIT_NPTS`. (Contributed by Claudiu Popa in :issue:`19343`.)" #: ../../whatsnew/3.4.rst:1338 msgid "select" @@ -2494,6 +2546,9 @@ msgid "" "statements, and will be automatically closed at the end of the :keyword:`!" "with` block. (Contributed by Filip Gruszczyński in :issue:`13896`.)" msgstr "" +":class:`~shelve.Shelf` instances may now be used in :keyword:`with` " +"statements, and will be automatically closed at the end of the :keyword:`!" +"with` block. (Contributed by Filip Gruszczyński in :issue:`13896`.)" #: ../../whatsnew/3.4.rst:1360 msgid "shutil" @@ -2525,6 +2580,11 @@ msgid "" "avoid affecting the global socket map. (Contributed by Vinay Sajip in :" "issue:`11959`.)" msgstr "" +"The :class:`!SMTPServer` and :class:`!SMTPChannel` classes now accept a " +"*map* keyword argument which, if specified, is passed in to :class:`!" +"asynchat.async_chat` as its *map* argument. This allows an application to " +"avoid affecting the global socket map. (Contributed by Vinay Sajip in :" +"issue:`11959`.)" #: ../../whatsnew/3.4.rst:1380 msgid "smtplib" @@ -2551,6 +2611,8 @@ msgid "" "The socket module now supports the :const:`~socket.CAN_BCM` protocol on " "platforms that support it. (Contributed by Brian Thorne in :issue:`15359`.)" msgstr "" +"The socket module now supports the :const:`~socket.CAN_BCM` protocol on " +"platforms that support it. (Contributed by Brian Thorne in :issue:`15359`.)" #: ../../whatsnew/3.4.rst:1394 msgid "" @@ -2574,7 +2636,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:1402 msgid "The :const:`~socket.AF_LINK` constant is now available on BSD and OSX." -msgstr "" +msgstr "The :const:`~socket.AF_LINK` constant is now available on BSD and OSX." #: ../../whatsnew/3.4.rst:1404 msgid "" @@ -2692,6 +2754,13 @@ msgid "" "`~ssl.VERIFY_X509_STRICT`. OpenSSL does not do any CRL verification by " "default. (Contributed by Christien Heimes in :issue:`8813`.)" msgstr "" +"If OpenSSL 0.9.8 or later is available, :class:`~ssl.SSLContext` has a new " +"attribute :attr:`~ssl.SSLContext.verify_flags` that can be used to control " +"the certificate verification process by setting it to some combination of " +"the new constants :const:`~ssl.VERIFY_DEFAULT`, :const:`~ssl." +"VERIFY_CRL_CHECK_LEAF`, :const:`~ssl.VERIFY_CRL_CHECK_CHAIN`, or :const:" +"`~ssl.VERIFY_X509_STRICT`. OpenSSL does not do any CRL verification by " +"default. (Contributed by Christien Heimes in :issue:`8813`.)" #: ../../whatsnew/3.4.rst:1468 msgid "" @@ -2767,6 +2836,9 @@ msgid "" "const:`~stat.S_IFPORT`, and :const:`~stat.S_IFWHT`. (Contributed by " "Christian Hiemes in :issue:`11016`.)" msgstr "" +"The module supports new :mod:`~stat.ST_MODE` flags, :mod:`~stat.S_IFDOOR`, :" +"const:`~stat.S_IFPORT`, and :const:`~stat.S_IFWHT`. (Contributed by " +"Christian Hiemes in :issue:`11016`.)" #: ../../whatsnew/3.4.rst:1508 msgid "struct" @@ -3074,6 +3146,13 @@ msgid "" "indefinite number of separately identified and separately counted tests, all " "of which will run even if one or more of them fail. For example::" msgstr "" +"The :class:`~unittest.TestCase` class has a new method, :meth:`~unittest." +"TestCase.subTest`, that produces a context manager whose :keyword:`with` " +"block becomes a \"sub-test\". This context manager allows a test method to " +"dynamically generate subtests by, say, calling the ``subTest`` context " +"manager inside a loop. A single test method can thereby produce an " +"indefinite number of separately identified and separately counted tests, all " +"of which will run even if one or more of them fail. For example::" #: ../../whatsnew/3.4.rst:1671 msgid "" @@ -3431,6 +3510,9 @@ msgid "" "describe the hash algorithm in use by the currently executing binary. " "Otherwise, the PEP does not alter any existing CPython APIs." msgstr "" +"The PEP adds additional fields to the :data:`sys.hash_info` named tuple to " +"describe the hash algorithm in use by the currently executing binary. " +"Otherwise, the PEP does not alter any existing CPython APIs." #: ../../whatsnew/3.4.rst:1860 msgid "PEP 436: Argument Clinic" @@ -3601,6 +3683,16 @@ msgid "" "most POSIX systems it can and should be used in the ``#!`` line of system " "scripts. (Contributed by Christian Heimes in :issue:`16499`.)" msgstr "" +"The :ref:`python ` command has a new :ref:`option `, ``-I``, which causes it to run in \"isolated mode\", " +"which means that :data:`sys.path` contains neither the script's directory " +"nor the user's ``site-packages`` directory, and all :envvar:`!PYTHON*` " +"environment variables are ignored (it implies both ``-s`` and ``-E``). " +"Other restrictions may also be applied in the future, with the goal being to " +"isolate the execution of a script from the user's environment. This is " +"appropriate, for example, when Python is used to run a system script. On " +"most POSIX systems it can and should be used in the ``#!`` line of system " +"scripts. (Contributed by Christian Heimes in :issue:`16499`.)" #: ../../whatsnew/3.4.rst:1947 msgid "" @@ -3645,6 +3737,10 @@ msgid "" "the test suite, and generate an HTML coverage report for the C codebase " "using ``gcov`` and `lcov `_." msgstr "" +"A new ``make`` target `coverage-report `_ will build python, run " +"the test suite, and generate an HTML coverage report for the C codebase " +"using ``gcov`` and `lcov `_." #: ../../whatsnew/3.4.rst:1968 msgid "" @@ -3862,6 +3958,9 @@ msgid "" "to avoid using many file descriptors when run in parallel from multiple " "threads. (Contributed by Antoine Pitrou in :issue:`18756`.)" msgstr "" +":func:`os.urandom` now uses a lazily opened persistent file descriptor so as " +"to avoid using many file descriptors when run in parallel from multiple " +"threads. (Contributed by Antoine Pitrou in :issue:`18756`.)" #: ../../whatsnew/3.4.rst:2067 msgid "Deprecated" @@ -3907,12 +4006,33 @@ msgid "" "importlib.util.set_package` are no longer needed because their functions are " "now handled automatically by the import system." msgstr "" +"As mentioned in :ref:`whatsnew-pep-451`, a number of :mod:`importlib` " +"methods and functions are deprecated: :meth:`!importlib.find_loader` is " +"replaced by :func:`importlib.util.find_spec`; :meth:`!importlib.machinery." +"PathFinder.find_module` is replaced by :meth:`importlib.machinery.PathFinder." +"find_spec`; :meth:`!importlib.abc.MetaPathFinder.find_module` is replaced " +"by :meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`!importlib.abc." +"PathEntryFinder.find_loader` and :meth:`!find_module` are replaced by :meth:" +"`importlib.abc.PathEntryFinder.find_spec`; all of the :samp:`{xxx}Loader` " +"ABC ``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :" +"meth:`!importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc." +"FileLoader.load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) " +"should no longer be implemented, instead loaders should implement an " +"``exec_module`` method (:meth:`importlib.abc.Loader.exec_module`, :meth:" +"`importlib.abc.InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader." +"exec_module`) and let the import system take care of the rest; and :meth:`!" +"importlib.abc.Loader.module_repr`, :meth:`!importlib.util." +"module_for_loader`, :meth:`!importlib.util.set_loader`, and :meth:`!" +"importlib.util.set_package` are no longer needed because their functions are " +"now handled automatically by the import system." #: ../../whatsnew/3.4.rst:2104 msgid "" "The :mod:`!imp` module is pending deprecation. To keep compatibility with " "Python 2/3 code bases, the module's removal is currently not scheduled." msgstr "" +"The :mod:`!imp` module is pending deprecation. To keep compatibility with " +"Python 2/3 code bases, the module's removal is currently not scheduled." #: ../../whatsnew/3.4.rst:2107 msgid "" @@ -4078,6 +4198,9 @@ msgid "" "removed (see the `devguide `_ for suggestions " "on what to use instead)." msgstr "" +"The unmaintained ``Misc/TextMate`` and ``Misc/vim`` directories have been " +"removed (see the `devguide `_ for suggestions " +"on what to use instead)." #: ../../whatsnew/3.4.rst:2182 msgid "" @@ -4298,6 +4421,10 @@ msgid "" "not desired then you will need to set these attributes manually. You can " "use :func:`importlib.util.module_to_load` for module management." msgstr "" +":meth:`!importlib.util.module_for_loader` now sets ``__loader__`` and " +"``__package__`` unconditionally to properly support reloading. If this is " +"not desired then you will need to set these attributes manually. You can " +"use :func:`importlib.util.module_to_load` for module management." #: ../../whatsnew/3.4.rst:2285 msgid "" @@ -4337,6 +4464,13 @@ msgid "" "machinery.FrozenImporter`, or if Python 2 compatibility is necessary you can " "use :func:`!imp.is_frozen`." msgstr "" +"Frozen modules no longer define a ``__file__`` attribute. It's semantically " +"incorrect for frozen modules to set the attribute as they are not loaded " +"from any explicit location. If you must know that a module comes from frozen " +"code then you can see if the module's ``__spec__.location`` is set to " +"``'frozen'``, check if the loader is a subclass of :class:`importlib." +"machinery.FrozenImporter`, or if Python 2 compatibility is necessary you can " +"use :func:`!imp.is_frozen`." #: ../../whatsnew/3.4.rst:2305 msgid "" @@ -4381,14 +4515,15 @@ msgid "" "behaviour was intentional can use :func:`inspect.unwrap` to access the first " "function in the chain that has no ``__wrapped__`` attribute." msgstr "" -":func:`functools.update_wrapper` and :func:`functools.wraps` now correctly " -"set the ``__wrapped__`` attribute to the function being wrapped, even if " -"that function also had its ``__wrapped__`` attribute set. This means " -"``__wrapped__`` attributes now correctly link a stack of decorated functions " -"rather than every ``__wrapped__`` attribute in the chain referring to the " -"innermost function. Introspection libraries that assumed the previous " -"behaviour was intentional can use :func:`inspect.unwrap` to access the first " -"function in the chain that has no ``__wrapped__`` attribute." +":func:`functools.update_wrapper` e :func:`functools.wraps` agora definem " +"corretamente o atributo ``__wrapped__`` para a função que está sendo " +"empacotada, mesmo que essa função também tenha seu atributo ``__wrapped__`` " +"definido. Isso significa que os atributos ``__wrapped__`` agora vinculam " +"corretamente uma pilha de funções decoradas em vez de cada atributo " +"``__wrapped__`` na cadeia referente à função mais interna. Bibliotecas de " +"introspecção que presumiam que o comportamento anterior foi intencional " +"podem usar :func:`inspect.unwrap` para acessar a primeira função na cadeia " +"que não possui nenhum atributo ``__wrapped__``." #: ../../whatsnew/3.4.rst:2329 msgid "" @@ -4399,12 +4534,12 @@ msgid "" "the Python 3.4 series. Code that assumes that :func:`inspect.getfullargspec` " "will fail on non-Python callables may need to be adjusted accordingly." msgstr "" -":func:`inspect.getfullargspec` has been reimplemented on top of :func:" -"`inspect.signature` and hence handles a much wider variety of callable " -"objects than it did in the past. It is expected that additional builtin and " -"extension module callables will gain signature metadata over the course of " -"the Python 3.4 series. Code that assumes that :func:`inspect.getfullargspec` " -"will fail on non-Python callables may need to be adjusted accordingly." +":func:`inspect.getfullargspec` foi reimplementada em cima de :func:`inspect." +"signature` e, portanto, lida com uma variedade muito maior de objetos que " +"podem ser chamados do que no passado. Espera-se que chamáveis adicionais de " +"módulos embutidos e de extensão ganhem metadados de assinatura ao longo da " +"série Python 3.4. O código que presume que :func:`inspect.getfullargspec` " +"falhará em chamáveis não-Python pode precisar ser ajustado de acordo." #: ../../whatsnew/3.4.rst:2337 msgid "" @@ -4576,6 +4711,9 @@ msgid "" "similarly to :attr:`~function.__kwdefaults__`. (Contributed by Yury " "Selivanov in :issue:`20625`.)" msgstr "" +"Parameter names in ``__annotations__`` dicts are now mangled properly, " +"similarly to :attr:`~function.__kwdefaults__`. (Contributed by Yury " +"Selivanov in :issue:`20625`.)" #: ../../whatsnew/3.4.rst:2411 msgid "" @@ -4794,6 +4932,11 @@ msgid "" "allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc` (:issue:" "`16742`)" msgstr "" +"The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must now " +"be a string allocated by :c:func:`PyMem_RawMalloc` or :c:func:" +"`PyMem_RawRealloc`, or ``NULL`` if an error occurred, instead of a string " +"allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc` (:issue:" +"`16742`)" #: ../../whatsnew/3.4.rst:2510 msgid "" @@ -4801,6 +4944,9 @@ msgid "" "the function did nothing if the key already exists (if the current value is " "a non-``NULL`` pointer)." msgstr "" +":c:func:`PyThread_set_key_value` now always set the value. In Python 3.3, " +"the function did nothing if the key already exists (if the current value is " +"a non-``NULL`` pointer)." #: ../../whatsnew/3.4.rst:2514 msgid "" @@ -4820,8 +4966,8 @@ msgstr "Alterado em 3.4.3" msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -"PEP 476: Ativando a verificação de certificados por padrão para clientes " -"stdlib http" +"PEP 476: Habilitando verificação de certificado por padrão para clientes " +"http stdlib" #: ../../whatsnew/3.4.rst:2526 msgid "" @@ -4842,5 +4988,5 @@ msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -"Para aplicativos que exigem o antigo comportamento anterior, eles podem " -"passar um contexto alternativo ::" +"Para aplicações que exigem o antigo comportamento anterior, elas podem " +"passar um contexto alternativo::" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index b3a19ecca..5192646da 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -21,10 +21,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2023\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -1987,7 +1987,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:1631 msgid "selectors" -msgstr "Seletores" +msgstr "selectors" #: ../../whatsnew/3.5.rst:1633 msgid "" @@ -2754,7 +2754,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2174 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/3.5.rst:2176 msgid "New ``calloc`` functions were added:" @@ -2762,19 +2762,19 @@ msgstr "" #: ../../whatsnew/3.5.rst:2178 msgid ":c:func:`PyMem_RawCalloc`," -msgstr "" +msgstr ":c:func:`PyMem_RawCalloc`," #: ../../whatsnew/3.5.rst:2179 msgid ":c:func:`PyMem_Calloc`," -msgstr "" +msgstr ":c:func:`PyMem_Calloc`," #: ../../whatsnew/3.5.rst:2180 msgid ":c:func:`PyObject_Calloc`." -msgstr "" +msgstr ":c:func:`PyObject_Calloc`." #: ../../whatsnew/3.5.rst:2182 msgid "(Contributed by Victor Stinner in :issue:`21233`.)" -msgstr "" +msgstr "(Contribuição de Victor Stinner em :issue:`21233`.)" #: ../../whatsnew/3.5.rst:2184 msgid "New encoding/decoding helper functions:" @@ -2790,7 +2790,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2189 msgid "(Contributed by Victor Stinner in :issue:`18395`.)" -msgstr "" +msgstr "(Contribuição de Victor Stinner em :issue:`18395`.)" #: ../../whatsnew/3.5.rst:2191 msgid "" @@ -3339,7 +3339,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2545 msgid "New ``make regen-all`` build target" -msgstr "" +msgstr "Novo alvo de construção ``make regen-all``" #: ../../whatsnew/3.5.rst:2547 msgid "" @@ -3348,6 +3348,11 @@ msgid "" "available, the autotools-based build system no longer attempts to implicitly " "recompile generated files based on file modification times." msgstr "" +"Para simplificar a compilação cruzada e garantir que o CPython possa ser " +"compilado de forma confiável sem exigir que uma versão existente do Python " +"já esteja disponível, o sistema de construção baseado em autotools não tenta " +"mais recompilar implicitamente os arquivos gerados com base nos tempos de " +"modificação dos arquivos." #: ../../whatsnew/3.5.rst:2552 msgid "" @@ -3355,12 +3360,17 @@ msgid "" "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" +"Em vez disso, um novo comando ``make regen-all`` foi adicionado para forçar " +"a regeneração desses arquivos quando desejado (por exemplo, após uma versão " +"inicial do Python já ter sido construída com base nas versões pré-geradas)." #: ../../whatsnew/3.5.rst:2556 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" +"Alvos de regeneração mais seletivos também são definidos -- veja :source:" +"`Makefile.pre.in` para detalhes." #: ../../whatsnew/3.5.rst:2559 ../../whatsnew/3.5.rst:2572 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" @@ -3368,7 +3378,7 @@ msgstr "(Contribuição de Victor Stinner em :issue:`23404`.)" #: ../../whatsnew/3.5.rst:2565 msgid "Removal of ``make touch`` build target" -msgstr "" +msgstr "Remoção do alvo de construção ``make touch``" #: ../../whatsnew/3.5.rst:2567 msgid "" @@ -3376,7 +3386,10 @@ msgid "" "regeneration of generated files by updating their modification times has " "been removed." msgstr "" +"O alvo de construção ``make touch`` usado anteriormente para solicitar " +"regeneração implícita de arquivos gerados atualizando seus tempos de " +"modificação foi removido." #: ../../whatsnew/3.5.rst:2570 msgid "It has been replaced by the new ``make regen-all`` target." -msgstr "" +msgstr "Ele foi substituído pelo novo alvo ``make regen-all``." diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 96e623be8..e2676d02b 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -22,10 +22,10 @@ msgstr "" "Last-Translator: Adorilson Bezerra , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -2699,7 +2699,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:1864 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/3.6.rst:1866 msgid "" @@ -3234,9 +3234,8 @@ msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -"Sub-classes de :class:`type` que não fazem sobrecarga de ``type.__new__`` " -"não podem mais usar a forma com apenas um argumento para obter o tipo de um " -"objeto." +"Subclasses de :class:`type` que não substituem ``type.__new__`` não podem " +"mais usar a forma com apenas um argumento para obter o tipo de um objeto." #: ../../whatsnew/3.6.rst:2253 msgid "" @@ -3434,7 +3433,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:2398 msgid "New ``make regen-all`` build target" -msgstr "" +msgstr "Novo alvo de construção ``make regen-all``" #: ../../whatsnew/3.6.rst:2400 msgid "" @@ -3443,6 +3442,11 @@ msgid "" "available, the autotools-based build system no longer attempts to implicitly " "recompile generated files based on file modification times." msgstr "" +"Para simplificar a compilação cruzada e garantir que o CPython possa ser " +"compilado de forma confiável sem exigir que uma versão existente do Python " +"já esteja disponível, o sistema de construção baseado em autotools não tenta " +"mais recompilar implicitamente os arquivos gerados com base nos tempos de " +"modificação dos arquivos." #: ../../whatsnew/3.6.rst:2405 msgid "" @@ -3450,12 +3454,17 @@ msgid "" "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" +"Em vez disso, um novo comando ``make regen-all`` foi adicionado para forçar " +"a regeneração desses arquivos quando desejado (por exemplo, após uma versão " +"inicial do Python já ter sido construída com base nas versões pré-geradas)." #: ../../whatsnew/3.6.rst:2409 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" +"Alvos de regeneração mais seletivos também são definidos -- veja :source:" +"`Makefile.pre.in` para detalhes." #: ../../whatsnew/3.6.rst:2412 ../../whatsnew/3.6.rst:2425 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" @@ -3463,7 +3472,7 @@ msgstr "(Contribuição de Victor Stinner em :issue:`23404`.)" #: ../../whatsnew/3.6.rst:2418 msgid "Removal of ``make touch`` build target" -msgstr "" +msgstr "Remoção do alvo de construção ``make touch``" #: ../../whatsnew/3.6.rst:2420 msgid "" @@ -3471,10 +3480,13 @@ msgid "" "regeneration of generated files by updating their modification times has " "been removed." msgstr "" +"O alvo de construção ``make touch`` usado anteriormente para solicitar " +"regeneração implícita de arquivos gerados atualizando seus tempos de " +"modificação foi removido." #: ../../whatsnew/3.6.rst:2423 msgid "It has been replaced by the new ``make regen-all`` target." -msgstr "" +msgstr "Ele foi substituído pelo novo alvo ``make regen-all``." #: ../../whatsnew/3.6.rst:2431 msgid "Notable changes in Python 3.6.4" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 1bfb1f404..a92ac8007 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -105,7 +105,7 @@ msgstr "Novos recursos embutidos:" #: ../../whatsnew/3.7.rst:74 msgid "" ":ref:`PEP 553 `, the new :func:`breakpoint` function." -msgstr ":ref:`PEP 553 `, a nova função :func:`breakpoint` ." +msgstr ":ref:`PEP 553 `, a nova função :func:`breakpoint`.;" #: ../../whatsnew/3.7.rst:76 msgid "Python data model improvements:" @@ -616,8 +616,8 @@ msgid "" "A typical example of where this may be useful is module attribute " "deprecation and lazy loading." msgstr "" -"Um exemplo típico de onde isso pode ser útil é a depreciação do atributo do " -"módulo e o carregamento lento." +"Um exemplo típico de onde isso pode ser útil é a descontinuação do atributo " +"do módulo e o carregamento preguiçoso ou *lazy*." #: ../../whatsnew/3.7.rst:332 msgid ":pep:`562` -- Module ``__getattr__`` and ``__dir__``" @@ -1367,6 +1367,11 @@ msgid "" "which returns an absolute scheduled callback timestamp. (Contributed by " "Andrew Svetlov in :issue:`32741`.)" msgstr "" +"Objetos de retorno de chamada retornados por :func:`loop.call_later() " +"` ganharam o novo método :meth:`when() ` que retorna um registro de data e hora de retorno de " +"chamada agendado absoluto. (Contribuição de Andrew Svetlov em :issue:" +"`32741`.)" #: ../../whatsnew/3.7.rst:731 msgid "" @@ -1374,6 +1379,9 @@ msgid "" "create_datagram_endpoint>` method gained support for Unix sockets. " "(Contributed by Quentin Dawans in :issue:`31245`.)" msgstr "" +"O método :meth:`loop.create_datagram_endpoint() \\ ` ganhou suporte para soquetes Unix. (Contribuição " +"de Quentin Dawans em :issue:`31245`.)" #: ../../whatsnew/3.7.rst:736 msgid "" @@ -1385,6 +1393,12 @@ msgid "" "variants now accept the *ssl_handshake_timeout* keyword argument. " "(Contributed by Neil Aspinall in :issue:`29970`.)" msgstr "" +"As funções :func:`asyncio.open_connection`, :func:`asyncio.start_server`, os " +"métodos :meth:`loop.create_connection() `, :" +"meth:`loop.create_server() `, :meth:`loop." +"create_accepted_socket() ` e suas " +"variantes de soquete UNIX correspondentes agora aceitam o argumento nomeado " +"*ssl_handshake_timeout*. (Contribuição de Neil Aspinall em :issue:`29970`.)" #: ../../whatsnew/3.7.rst:744 msgid "" @@ -1392,12 +1406,17 @@ msgid "" "``True`` if the callback was cancelled. (Contributed by Marat Sharafutdinov " "in :issue:`31943`.)" msgstr "" +"O novo método :meth:`Handle.cancelled() ` retorna " +"``True`` se o retorno de chamada foi cancelado. (Contribuição de Marat " +"Sharafutdinov em :issue:`31943`.)" #: ../../whatsnew/3.7.rst:748 msgid "" "The asyncio source has been converted to use the :keyword:`async`/:keyword:" "`await` syntax. (Contributed by Andrew Svetlov in :issue:`32193`.)" msgstr "" +"A fonte de asyncio foi convertida para usar a sintaxe :keyword:`async`/:" +"keyword:`await`. (Contribuição de Andrew Svetlov em :issue:`32193`.)" #: ../../whatsnew/3.7.rst:752 msgid "" @@ -1945,7 +1964,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:1126 msgid "mimetypes" -msgstr "" +msgstr "mimetypes" #: ../../whatsnew/3.7.rst:1128 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 9ab7250ed..7470e839a 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -24,10 +24,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -130,11 +130,11 @@ msgstr "Consulte :pep:`572` para uma descrição completa." #: ../../whatsnew/3.8.rst:116 msgid "(Contributed by Emily Morehouse in :issue:`35224`.)" -msgstr "(Contribuído por Emily Morehouse em :issue:`35224`.)" +msgstr "(Contribuição de Emily Morehouse em :issue:`35224`.)" #: ../../whatsnew/3.8.rst:120 msgid "Positional-only parameters" -msgstr "Parâmetros apenas posicionais" +msgstr "Parâmetros somente-posicionais" #: ../../whatsnew/3.8.rst:122 msgid "" @@ -746,9 +746,9 @@ msgid "" "statements no longer requires enclosing parentheses. This brings the *yield* " "and *return* syntax into better agreement with normal assignment syntax::" msgstr "" -"A descompactação iterável generalizada das instruções :keyword:`yield` e :" -"keyword:`return` não requer mais parênteses. Isso traz a sintaxe *yield* e " -"*return* uma melhor concordância com a sintaxe de atribuição normal::" +"O desempacotamento de iterável generalizado das instruções :keyword:`yield` " +"e :keyword:`return` não requer mais parênteses. Isso traz a sintaxe *yield* " +"e *return* uma melhor concordância com a sintaxe de atribuição normal::" #: ../../whatsnew/3.8.rst:437 msgid "(Contributed by David Cuthbert and Jordan Chapman in :issue:`32117`.)" @@ -2561,7 +2561,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1537 msgid "Build and C API Changes" -msgstr "Alterações a compilações e API C" +msgstr "Mudanças a construções e API C" #: ../../whatsnew/3.8.rst:1539 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 098497bb5..b231e2673 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -25,10 +25,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -1821,8 +1821,8 @@ msgid "" msgstr "" "As funções :c:func:`!PyEval_InitThreads` e :c:func:`!" "PyEval_ThreadsInitialized` agora estão descontinuadas e serão removidas no " -"Python 3.11. Chamar :c:func:`!PyEval_InitThreads` agora não faz nada. O :" -"term:`GIL` é inicializado por :c:func:`Py_Initialize` desde o Python 3.7. " +"Python 3.11. Chamar :c:func:`!PyEval_InitThreads` agora não faz nada. A :" +"term:`GIL` é inicializada por :c:func:`Py_Initialize` desde o Python 3.7. " "(Contribuição de Victor Stinner em :issue:`39877`.)" #: ../../whatsnew/3.9.rst:928 diff --git a/whatsnew/changelog.po b/whatsnew/changelog.po index cabc4719a..7285c1d93 100644 --- a/whatsnew/changelog.po +++ b/whatsnew/changelog.po @@ -17,10 +17,10 @@ msgstr "" "2021\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/whatsnew/index.po b/whatsnew/index.po index acad8ba3a..85943e165 100644 --- a/whatsnew/index.po +++ b/whatsnew/index.po @@ -17,10 +17,10 @@ msgstr "" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" From 55920af0ad5e5d3bce945e0cc72ae8dadbc816d5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sat, 31 Aug 2024 23:14:02 +0000 Subject: [PATCH 002/186] Merge 3.13 into 3.12 --- c-api/structures.po | 23 ++++++++++------- howto/descriptor.po | 32 +++++++++++++----------- library/ctypes.po | 26 +++++++++++--------- library/logging.po | 2 +- library/os.po | 2 +- library/sqlite3.po | 2 +- library/struct.po | 2 +- library/symtable.po | 2 +- library/xmlrpc.client.po | 8 +++--- tutorial/floatingpoint.po | 52 +++++++++++++++++++-------------------- whatsnew/2.6.po | 6 ++--- 11 files changed, 83 insertions(+), 74 deletions(-) diff --git a/c-api/structures.po b/c-api/structures.po index c658da938..52c2284da 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -79,6 +79,11 @@ msgid "" "Access to the members must be done by using the macros :c:macro:" "`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`." msgstr "" +"Esta é uma extensão de :c:type:`PyObject` que adiciona o campo :c:member:" +"`~PyVarObject.ob_size`. Isso é usado apenas para objetos que têm alguma " +"noção de *comprimento*. Esse tipo não costuma aparecer na API Python/C. O " +"acesso aos membros deve ser feito através das macros :c:macro:`Py_REFCNT`, :" +"c:macro:`Py_TYPE`, e :c:macro:`Py_SIZE`." #: ../../c-api/structures.rst:47 msgid "" @@ -239,7 +244,7 @@ msgstr "" #: ../../c-api/structures.rst:233 msgid "Name of the method." -msgstr "" +msgstr "Nome do método." #: ../../c-api/structures.rst:237 msgid "Pointer to the C implementation." @@ -295,7 +300,7 @@ msgstr "" #: ../../c-api/structures.rst:282 msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_VARARGS | METH_KEYWORDS`" #: ../../c-api/structures.rst:283 msgid "" @@ -321,7 +326,7 @@ msgstr "" #: ../../c-api/structures.rst:307 msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" #: ../../c-api/structures.rst:308 msgid "" @@ -343,7 +348,7 @@ msgstr "" #: ../../c-api/structures.rst:329 msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" #: ../../c-api/structures.rst:330 msgid "" @@ -448,7 +453,7 @@ msgstr "" #: ../../c-api/structures.rst:418 msgid ":attr:`function.__module__`" -msgstr "" +msgstr ":attr:`function.__module__`" #: ../../c-api/structures.rst:420 msgid "" @@ -458,11 +463,11 @@ msgstr "" #: ../../c-api/structures.rst:429 msgid "Equivalent to ``PyCMethod_New(ml, self, module, NULL)``." -msgstr "" +msgstr "Equivalente a ``PyCMethod_New(ml, self, module, NULL)``." #: ../../c-api/structures.rst:434 msgid "Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``." -msgstr "" +msgstr "Equivalente a ``PyCMethod_New(ml, self, NULL, NULL)``." #: ../../c-api/structures.rst:438 msgid "Accessing attributes of extension types" @@ -654,11 +659,11 @@ msgstr "" #: ../../c-api/structures.rst:604 msgid "C type" -msgstr "Tipo C" +msgstr "Tipo em C" #: ../../c-api/structures.rst:604 msgid "Python type" -msgstr "Python type" +msgstr "Tipo em Python" #: ../../c-api/structures.rst:606 msgid ":c:expr:`char`" diff --git a/howto/descriptor.po b/howto/descriptor.po index dfb918002..eb0138825 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -28,7 +28,7 @@ msgstr "" #: ../../howto/descriptor.rst:5 msgid "Descriptor Guide" -msgstr "" +msgstr "Guia de descritores" #: ../../howto/descriptor.rst:0 msgid "Author" @@ -296,7 +296,7 @@ msgstr "A nova classe agora registra acesso a *name* e *age*:" #: ../../howto/descriptor.rst:284 msgid "The two *Person* instances contain only the private names:" -msgstr "" +msgstr "As duas instâncias *Person* contêm apenas os nomes privados:" #: ../../howto/descriptor.rst:295 msgid "Closing thoughts" @@ -354,7 +354,7 @@ msgstr "" #: ../../howto/descriptor.rst:326 msgid "Complete Practical Example" -msgstr "" +msgstr "Exemplo prático completo" #: ../../howto/descriptor.rst:328 msgid "" @@ -416,7 +416,7 @@ msgstr "" #: ../../howto/descriptor.rst:437 msgid "Practical application" -msgstr "" +msgstr "Aplicação prática" #: ../../howto/descriptor.rst:439 msgid "Here's how the data validators can be used in a real class:" @@ -454,7 +454,7 @@ msgstr "" #: ../../howto/descriptor.rst:498 msgid "Definition and introduction" -msgstr "" +msgstr "Definição e introdução" #: ../../howto/descriptor.rst:500 msgid "" @@ -487,19 +487,19 @@ msgstr "" #: ../../howto/descriptor.rst:522 msgid "Descriptor protocol" -msgstr "" +msgstr "Protocolo Descriptor" #: ../../howto/descriptor.rst:524 msgid "``descr.__get__(self, obj, type=None)``" -msgstr "" +msgstr "``descr.__get__(self, obj, type=None)``" #: ../../howto/descriptor.rst:526 msgid "``descr.__set__(self, obj, value)``" -msgstr "" +msgstr "``descr.__set__(self, obj, value)``" #: ../../howto/descriptor.rst:528 msgid "``descr.__delete__(self, obj)``" -msgstr "" +msgstr "``descr.__delete__(self, obj)``" #: ../../howto/descriptor.rst:530 msgid "" @@ -715,6 +715,8 @@ msgid "" "The implementation details are in :c:func:`!type_new` and :c:func:`!" "set_names` in :source:`Objects/typeobject.c`." msgstr "" +"Os detalhes de implementações estão em :c:func:`!type_new` e :c:func:`!" +"set_names` em :source:`Objects/typeobject.c`." #: ../../howto/descriptor.rst:842 msgid "" @@ -725,7 +727,7 @@ msgstr "" #: ../../howto/descriptor.rst:848 msgid "ORM example" -msgstr "" +msgstr "Exemplo de ORM" #: ../../howto/descriptor.rst:850 msgid "" @@ -817,7 +819,7 @@ msgstr "" #: ../../howto/descriptor.rst:1158 msgid "Functions and methods" -msgstr "" +msgstr "Funções e métodos" #: ../../howto/descriptor.rst:1160 msgid "" @@ -890,7 +892,7 @@ msgstr "" #: ../../howto/descriptor.rst:1250 msgid "Kinds of methods" -msgstr "" +msgstr "Tipos de métodos" #: ../../howto/descriptor.rst:1252 msgid "" @@ -948,11 +950,11 @@ msgstr "f(type(obj), \\*args)" #: ../../howto/descriptor.rst:1270 msgid "f(cls, \\*args)" -msgstr "" +msgstr "f(cls, \\*args)" #: ../../howto/descriptor.rst:1275 msgid "Static methods" -msgstr "" +msgstr "Métodos estáticos" #: ../../howto/descriptor.rst:1277 msgid "" @@ -1004,7 +1006,7 @@ msgstr "" #: ../../howto/descriptor.rst:1401 msgid "Class methods" -msgstr "" +msgstr "Métodos de classe" #: ../../howto/descriptor.rst:1403 msgid "" diff --git a/library/ctypes.po b/library/ctypes.po index 468616d0b..bbc1874d6 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -28,11 +28,11 @@ msgstr "" #: ../../library/ctypes.rst:2 msgid ":mod:`!ctypes` --- A foreign function library for Python" -msgstr "" +msgstr ":mod:`!ctypes` --- Uma biblioteca de funções externas para Python" #: ../../library/ctypes.rst:9 msgid "**Source code:** :source:`Lib/ctypes`" -msgstr "" +msgstr "**Código-fonte:** :source:`Lib/ctypes`" #: ../../library/ctypes.rst:13 msgid "" @@ -55,6 +55,10 @@ msgid "" "they actually work. Since some code samples behave differently under Linux, " "Windows, or macOS, they contain doctest directives in comments." msgstr "" +"Nota: Os exemplos de código neste tutorial usam :mod:`doctest` para garantir " +"que eles realmente funcionem. Como algumas amostras de código se comportam " +"de maneira diferente no Linux, Windows ou macOS, elas contêm diretrizes de " +"doctest nos comentários." #: ../../library/ctypes.rst:27 msgid "" @@ -223,7 +227,7 @@ msgstr "" #: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2198 msgid "Fundamental data types" -msgstr "" +msgstr "Tipos de dados fundamentais" #: ../../library/ctypes.rst:214 msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" @@ -235,11 +239,11 @@ msgstr "Tipo ctypes" #: ../../library/ctypes.rst:217 msgid "C type" -msgstr "Tipo C" +msgstr "Tipo em C" #: ../../library/ctypes.rst:217 msgid "Python type" -msgstr "Python type" +msgstr "Tipo em Python" #: ../../library/ctypes.rst:219 msgid ":class:`c_bool`" @@ -353,7 +357,7 @@ msgstr ":class:`c_longlong`" #: ../../library/ctypes.rst:241 msgid ":c:expr:`__int64` or :c:expr:`long long`" -msgstr "" +msgstr ":c:expr:`__int64` ou :c:expr:`long long`" #: ../../library/ctypes.rst:243 msgid ":class:`c_ulonglong`" @@ -361,7 +365,7 @@ msgstr ":class:`c_ulonglong`" #: ../../library/ctypes.rst:243 msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" -msgstr "" +msgstr ":c:expr:`unsigned __int64` ou :c:expr:`unsigned long long`" #: ../../library/ctypes.rst:246 msgid ":class:`c_size_t`" @@ -377,7 +381,7 @@ msgstr ":class:`c_ssize_t`" #: ../../library/ctypes.rst:248 msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" -msgstr "" +msgstr ":c:type:`ssize_t` ou :c:expr:`Py_ssize_t`" #: ../../library/ctypes.rst:251 msgid ":class:`c_time_t`" @@ -422,11 +426,11 @@ msgstr ":class:`c_char_p`" #: ../../library/ctypes.rst:259 msgid ":c:expr:`char *` (NUL terminated)" -msgstr "" +msgstr ":c:expr:`char *` (finalizado com NUL)" #: ../../library/ctypes.rst:259 msgid "bytes object or ``None``" -msgstr "bytes object ou ``None``" +msgstr "objeto bytes ou ``None``" #: ../../library/ctypes.rst:261 msgid ":class:`c_wchar_p`" @@ -434,7 +438,7 @@ msgstr ":class:`c_wchar_p`" #: ../../library/ctypes.rst:261 msgid ":c:expr:`wchar_t *` (NUL terminated)" -msgstr "" +msgstr ":c:expr:`wchar_t *` (finalizado com NUL)" #: ../../library/ctypes.rst:261 msgid "string or ``None``" diff --git a/library/logging.po b/library/logging.po index 179433af2..bcb8ea177 100644 --- a/library/logging.po +++ b/library/logging.po @@ -552,7 +552,7 @@ msgstr "" #: ../../library/logging.rst:346 msgid "The *stack_info* parameter was added." -msgstr "" +msgstr "O parâmetro *stack_info* foi adicionado." #: ../../library/logging.rst:349 msgid "The *exc_info* parameter can now accept exception instances." diff --git a/library/os.po b/library/os.po index 2e719c297..217b5e6ca 100644 --- a/library/os.po +++ b/library/os.po @@ -8198,7 +8198,7 @@ msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." msgstr "" -"Se este bit é definido os bytes aleatórios são pegos a partir de ``/dev/" +"Se este bit é definido os bytes aleatórios são sorteados a partir de ``/dev/" "random`` ao invés de ``/dev/urandom``." #: ../../library/os.rst:363 ../../library/os.rst:529 ../../library/os.rst:731 diff --git a/library/sqlite3.po b/library/sqlite3.po index f0f7fb3f5..3149de640 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -1940,7 +1940,7 @@ msgstr "" #: ../../library/sqlite3.rst:1908 ../../library/sqlite3.rst:1925 msgid "Python type" -msgstr "Python type" +msgstr "Tipo em Python" #: ../../library/sqlite3.rst:1908 ../../library/sqlite3.rst:1925 msgid "SQLite type" diff --git a/library/struct.po b/library/struct.po index 3cbc2dd55..557a1b520 100644 --- a/library/struct.po +++ b/library/struct.po @@ -368,7 +368,7 @@ msgstr "Tipo em C" #: ../../library/struct.rst:220 msgid "Python type" -msgstr "Python type" +msgstr "Tipo em Python" #: ../../library/struct.rst:220 msgid "Standard size" diff --git a/library/symtable.po b/library/symtable.po index da4c26d7f..916205581 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -27,7 +27,7 @@ msgstr "" #: ../../library/symtable.rst:2 msgid ":mod:`!symtable` --- Access to the compiler's symbol tables" -msgstr "" +msgstr ":mod:`!symtable` --- Acesso a tabela de símbolos do compilador" #: ../../library/symtable.rst:7 msgid "**Source code:** :source:`Lib/symtable.py`" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 10587c5f6..0ad3b23d1 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -29,7 +29,7 @@ msgstr "" #: ../../library/xmlrpc.client.rst:2 msgid ":mod:`!xmlrpc.client` --- XML-RPC client access" -msgstr "" +msgstr ":mod:`!xmlrpc.client` --- Cliente XML-RPC" #: ../../library/xmlrpc.client.rst:10 msgid "**Source code:** :source:`Lib/xmlrpc/client.py`" @@ -197,7 +197,7 @@ msgstr "Tipo XML-RPC" #: ../../library/xmlrpc.client.rst:95 msgid "Python type" -msgstr "Python type" +msgstr "Tipo em Python" #: ../../library/xmlrpc.client.rst:97 msgid "``boolean``" @@ -592,7 +592,7 @@ msgstr "" #: ../../library/xmlrpc.client.rst:418 msgid "ProtocolError Objects" -msgstr "Objeto ProtocolError" +msgstr "Objetos ProtocolError" #: ../../library/xmlrpc.client.rst:422 msgid "" @@ -699,7 +699,7 @@ msgstr "" #: ../../library/xmlrpc.client.rst:600 msgid "See :ref:`simplexmlrpcserver-example`." -msgstr "" +msgstr "Veja :ref:`simplexmlrpcserver-example`." #: ../../library/xmlrpc.client.rst:604 msgid "Footnotes" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index 013612082..7fb3669f5 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -52,17 +52,16 @@ msgid "" "numbers actually stored in the machine." msgstr "" "Infelizmente, muitas frações decimais não podem ser representadas " -"precisamente\n" -"como frações binárias. O resultado é que, em geral, os números decimais de\n" -"ponto flutuante que você digita acabam sendo armazenados de forma apenas\n" -"aproximada, na forma de números binários de ponto flutuante." +"precisamente como frações binárias. O resultado é que, em geral, os números " +"decimais de ponto flutuante que você digita acabam sendo armazenados de " +"forma apenas aproximada, na forma de números binários de ponto flutuante." #: ../../tutorial/floatingpoint.rst:28 msgid "" "The problem is easier to understand at first in base 10. Consider the " "fraction 1/3. You can approximate that as a base 10 fraction::" msgstr "" -"O problema é mais fácil de entender primeiro em base 10. Considere a fração\n" +"O problema é mais fácil de entender primeiro em base 10. Considere a fração " "1/3. Podemos representá-la aproximadamente como uma fração base 10::" #: ../../tutorial/floatingpoint.rst:33 ../../tutorial/floatingpoint.rst:37 @@ -76,9 +75,8 @@ msgid "" "approximation of 1/3." msgstr "" "e assim por diante. Não importa quantos dígitos você está disposto a " -"escrever,\n" -"o resultado nunca será exatamente 1/3, mas será uma aproximação de cada vez\n" -"melhor de 1/3." +"escrever, o resultado nunca será exatamente 1/3, mas será uma aproximação de " +"cada vez melhor de 1/3." #: ../../tutorial/floatingpoint.rst:45 msgid "" @@ -117,18 +115,18 @@ msgid "" "stored for 0.1, it would have to display::" msgstr "" "É fácil esquecer que o valor armazenado é uma aproximação da fração decimal " -"original, devido à forma como os floats são exibidos no interpretador " -"interativo. O Python exibe apenas uma aproximação decimal do verdadeiro " -"valor decimal da aproximação binária armazenada pela máquina. Se o Python " -"exibisse o verdadeiro valor decimal da aproximação binária que representa o " -"decimal 0.1, seria necessário mostrar::" +"original, devido à forma como os pontos flutuantes são exibidos no " +"interpretador interativo. O Python exibe apenas uma aproximação decimal do " +"verdadeiro valor decimal da aproximação binária armazenada pela máquina. Se " +"o Python exibisse o verdadeiro valor decimal da aproximação binária que " +"representa o decimal 0.1, seria necessário mostrar::" #: ../../tutorial/floatingpoint.rst:67 msgid "" "That is more digits than most people find useful, so Python keeps the number " "of digits manageable by displaying a rounded value instead:" msgstr "" -"Contém muito mais dígitos do que é o esperado e utilizado pela grande " +"Isto contém muito mais dígitos do que é o esperado e utilizado pela grande " "maioria dos desenvolvedores, portanto, o Python limita o número de dígitos " "exibidos, apresentando um valor arredondado, ao invés de mostrar todas as " "casas decimais::" @@ -193,7 +191,7 @@ msgid "" "limited number of significant digits:" msgstr "" "Para obter um valor mais agradável, poderás utilizar a formatação de " -"sequência de caracteres sendo capaz de gerar um número limitado de dígitos " +"sequência de caracteres para produzir um número limitado de dígitos " "significativos:" #: ../../tutorial/floatingpoint.rst:111 @@ -209,9 +207,9 @@ msgid "" "One illusion may beget another. For example, since 0.1 is not exactly 1/10, " "summing three values of 0.1 may not yield exactly 0.3, either:" msgstr "" -"Uma ilusão pode gerar outra. Por exemplo, uma vez que 0,1 não é exatamente " +"Uma ilusão pode gerar outra. Por exemplo, uma vez que 0.1 não é exatamente " "1/10, somar três vezes o valor 0.1, não garantirá que o resultado seja " -"exatamente 0,3, isso porque:" +"exatamente 0.3, isso porque:" #: ../../tutorial/floatingpoint.rst:122 msgid "" @@ -219,8 +217,8 @@ msgid "" "cannot get any closer to the exact value of 3/10, then pre-rounding with :" "func:`round` function cannot help:" msgstr "" -"Inclusive, uma vez que o 0,1 não consegue aproximar-se do valor exato de " -"1/10 e 0,3 não pode se aproximar mais do valor exato de 3/10, temos então " +"Inclusive, uma vez que o 0.1 não consegue aproximar-se do valor exato de " +"1/10 e 0.3 não pode se aproximar mais do valor exato de 3/10, temos então " "que o pré-arredondamento com a função :func:`round` não servirá como ajuda:" #: ../../tutorial/floatingpoint.rst:131 @@ -337,9 +335,9 @@ msgid "" "as_integer_ratio` method expresses the value of a float as a fraction:" msgstr "" "O Python fornece ferramentas que podem ajudar nessas raras ocasiões em que " -"realmente *faz* necessitas conhecer o valor exato de um float. O método :" -"meth:`float.as_integer_ratio` expressa o valor do tipo float em sua forma " -"fracionária:" +"realmente *faz* necessário conhecer o valor exato de um ponto flutuante. O " +"método :meth:`float.as_integer_ratio` expressa o valor de um número do tipo " +"float em sua forma fracionária:" #: ../../tutorial/floatingpoint.rst:192 msgid "" @@ -347,15 +345,15 @@ msgid "" "value:" msgstr "" "Uma vez que a relação seja exata, será possível utiliza-la para obter, sem " -"que haja quaisquer perda o valor original:" +"que haja quaisquer perda do valor original:" #: ../../tutorial/floatingpoint.rst:200 msgid "" "The :meth:`float.hex` method expresses a float in hexadecimal (base 16), " "again giving the exact value stored by your computer:" msgstr "" -"O método :meth:`float.hex` expressa um tipo float em hexadecimal (base 16), " -"o mesmo também conferirá o valor exato pelo computador:" +"O método :meth:`float.hex` expressa um ponto flutuante em hexadecimal (base " +"16), o mesmo também retornará o valor exato pelo computador:" #: ../../tutorial/floatingpoint.rst:208 msgid "" @@ -363,7 +361,7 @@ msgid "" "value exactly:" msgstr "" "Sua precisa representação hexadecimal poderá ser utilizada para reconstruir " -"o valor exato do float:" +"o valor exato do ponto flutuante:" #: ../../tutorial/floatingpoint.rst:216 msgid "" @@ -519,7 +517,7 @@ msgid "" "If we multiply that fraction by 10\\*\\*55, we can see the value out to 55 " "decimal digits:" msgstr "" -"Se multiplicarmos essa fração por 10\\*\\*30, podemos ver o valor contendo " +"Se multiplicarmos essa fração por 10\\*\\*55, podemos ver o valor contendo " "os 55 dígitos mais significativos:" #: ../../tutorial/floatingpoint.rst:342 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 104b221dc..7ae7157d9 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -2714,9 +2714,9 @@ msgid "" "maintained again, and a number of patches and bugfixes were applied. " "(Maintained by Josiah Carlson; see :issue:`1736190` for one patch.)" msgstr "" -"The :mod:`!asyncore` and :mod:`!asynchat` modules are being actively " -"maintained again, and a number of patches and bugfixes were applied. " -"(Maintained by Josiah Carlson; see :issue:`1736190` for one patch.)" +"Os módulos :mod:`!asyncore` e :mod:`!asynchat` estão sendo mantidos " +"ativamente novamente e várias correções e correções foram aplicadas. " +"(Mantido por Josiah Carlson; veja :issue:`1736190` para um patch.)" #: ../../whatsnew/2.6.rst:1791 msgid "" From bc4ecf73bd1135db89a9cfa8362c681cab6e2335 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 4 Sep 2024 23:14:41 +0000 Subject: [PATCH 003/186] Merge 3.13 into 3.12 --- whatsnew/3.9.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index b231e2673..604af22db 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -355,13 +355,13 @@ msgid "" "when it comes to designing new language features. We'll start using this " "flexibility in Python 3.10 and later." msgstr "" -"O Python 3.9 usa um novo analisador, baseado em `GASE `_ " -"em vez de `LL(1) `_. O desempenho do novo analisador é " -"aproximadamente comparável ao do analisador antigo, mas o formalismo do GASE " -"é mais flexível que do LL(1) quando se trata de projetar novos recursos de " -"linguagem. Começaremos a usar essa flexibilidade no Python 3.10 e posterior." +"O Python 3.9 usa um novo analisador sintático, baseado em `GASE `_ em vez de " +"`LL(1) `_. O " +"desempenho do novo analisador sintático é aproximadamente comparável ao do " +"analisador sintático antigo, mas o formalismo do GASE é mais flexível que do " +"LL(1) quando se trata de projetar novos recursos de linguagem. Começaremos a " +"usar essa flexibilidade no Python 3.10 e posterior." #: ../../whatsnew/3.9.rst:202 msgid "" From 065e4ff7a779274b376b17f32660d6bc0ac9b4d6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 5 Sep 2024 23:15:03 +0000 Subject: [PATCH 004/186] Merge 3.13 into 3.12 --- library/pyclbr.po | 2 +- library/re.po | 26 ++++++++++++++------------ library/tkinter.ttk.po | 36 ++++++++++++++++++++++++++++-------- tutorial/classes.po | 41 +++++++++++++++++++++-------------------- 4 files changed, 64 insertions(+), 41 deletions(-) diff --git a/library/pyclbr.po b/library/pyclbr.po index fb567b9bf..8a7445ba9 100644 --- a/library/pyclbr.po +++ b/library/pyclbr.po @@ -163,7 +163,7 @@ msgstr "" #: ../../library/pyclbr.rst:114 msgid "Class Objects" -msgstr "Objetos de Class" +msgstr "Objetos classe" #: ../../library/pyclbr.rst:118 msgid "" diff --git a/library/re.po b/library/re.po index 0cff61978..1aab6848a 100644 --- a/library/re.po +++ b/library/re.po @@ -2226,7 +2226,7 @@ msgstr "" #: ../../library/re.rst:1328 msgid "Match object returned by successful ``match``\\ es and ``search``\\ es." msgstr "" -"Objeto de correspondência retornado por ``match``\\ s e ``search``\\ s bem " +"Objeto correspondência retornado por ``match``\\ s e ``search``\\ s bem " "sucedidos." #: ../../library/re.rst:1330 @@ -2288,7 +2288,7 @@ msgid "" "string argument is not used as a group name in the pattern, an :exc:" "`IndexError` exception is raised." msgstr "" -"Se a expressão regular usa a sintaxe ``(?P...)``, os argumentos " +"Se a expressão regular usa a sintaxe ``(?P...)``, os argumentos " "*groupN* também podem ser strings que identificam grupos por seus nomes de " "grupo. Se um argumento string não for usado como um nome de grupo no padrão, " "uma exceção :exc:`IndexError` é levantada." @@ -2317,7 +2317,7 @@ msgstr "" #: ../../library/re.rst:1411 msgid "Named groups are supported as well::" -msgstr "Grupos nomeados também são suportados::" +msgstr "Também há suporte para grupos nomeados::" #: ../../library/re.rst:1424 msgid "" @@ -2383,7 +2383,7 @@ msgstr "" #: ../../library/re.rst:1472 msgid "An example that will remove *remove_this* from email addresses::" -msgstr "Um exemplo que removerá *remove_this* dos endereços de e-mail::" +msgstr "Um exemplo que removerá *remova_isto* dos endereços de e-mail::" #: ../../library/re.rst:1482 msgid "" @@ -2391,9 +2391,10 @@ msgid "" "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -"Para uma correspondência *m*, retorna a tupla de dois ``(m.start(group), m." -"end(group))``. Observe que se *group* não contribuiu para a correspondência, " -"isso é ``(-1, -1)``. *group* tem como padrão zero, a correspondência inteira." +"Para uma correspondência *m*, retorna a tupla com dois elementos ``(m." +"start(group), m.end(group))``. Observe que se *group* não contribuiu para a " +"correspondência, isso é ``(-1, -1)``. *group* tem como padrão zero, a " +"correspondência inteira." #: ../../library/re.rst:1489 msgid "" @@ -2402,8 +2403,8 @@ msgid "" "index into the string at which the RE engine started looking for a match." msgstr "" "O valor de *pos* que foi passado para o método :meth:`~Pattern.search` ou :" -"meth:`~Pattern.match` de um :ref:`objeto de regex `. Este é o " -"índice da string na qual o mecanismo de ER começou a procurar uma " +"meth:`~Pattern.match` de um :ref:`objeto expressão regular `. " +"Este é o índice da string na qual o mecanismo de ER começou a procurar uma " "correspondência." #: ../../library/re.rst:1496 @@ -2413,8 +2414,9 @@ msgid "" "the index into the string beyond which the RE engine will not go." msgstr "" "O valor de *endpos* que foi passado para o método :meth:`~Pattern.search` " -"ou :meth:`~Pattern.match` de um :ref:`objeto de regex `. Este é " -"o índice da string após o qual o mecanismo de ER não vai chegar." +"ou :meth:`~Pattern.match` de um :ref:`objeto expressão regular `. Este é o índice da string após o qual o mecanismo de ER não vai " +"chegar." #: ../../library/re.rst:1503 msgid "" @@ -2456,7 +2458,7 @@ msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -"Adicionado suporte de :func:`copy.copy` e :func:`copy.deepcopy`. Objetos " +"Adicionado suporte para :func:`copy.copy` e :func:`copy.deepcopy`. Objetos " "correspondência são considerados atômicos." #: ../../library/re.rst:1535 diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 17c4c5d03..094c2111f 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -601,6 +601,8 @@ msgid "" "The :class:`ttk.Combobox` widget combines a text field with a pop-down list " "of values. This widget is a subclass of :class:`Entry`." msgstr "" +"O widget :class:`ttk.Combobox` combina um campo de texto com uma lista " +"suspensa de valores. Esse widget é uma subclasse de :class:`Entry`." #: ../../library/tkinter.ttk.rst:300 msgid "" @@ -622,11 +624,11 @@ msgstr "Opções" #: ../../library/tkinter.ttk.rst:474 ../../library/tkinter.ttk.rst:664 #: ../../library/tkinter.ttk.rst:803 msgid "This widget accepts the following specific options:" -msgstr "" +msgstr "Este widget aceita as seguintes opções específicas:" #: ../../library/tkinter.ttk.rst:319 msgid "exportselection" -msgstr "" +msgstr "exportselection" #: ../../library/tkinter.ttk.rst:319 msgid "" @@ -634,6 +636,9 @@ msgid "" "selection (which can be returned by invoking Misc.selection_get, for " "example)." msgstr "" +"Valor booleano. Caso definido, a seleção do widget é vinculada à seleção do " +"Gerenciador de Janelas (que pode ser retornada ao chamar Misc.selection_get, " +"por exemplo)." #: ../../library/tkinter.ttk.rst:323 msgid "justify" @@ -644,6 +649,8 @@ msgid "" "Specifies how the text is aligned within the widget. One of \"left\", " "\"center\", or \"right\"." msgstr "" +"Especifica como o texto é alinhado dentro do widget. Pode ser \"left\", " +"\"center\", ou \"right\"." #: ../../library/tkinter.ttk.rst:326 ../../library/tkinter.ttk.rst:481 #: ../../library/tkinter.ttk.rst:818 @@ -652,17 +659,20 @@ msgstr "height" #: ../../library/tkinter.ttk.rst:326 msgid "Specifies the height of the pop-down listbox, in rows." -msgstr "" +msgstr "Especifica a altura, em linhas, da lista suspensa." #: ../../library/tkinter.ttk.rst:328 msgid "postcommand" -msgstr "" +msgstr "postcommand" #: ../../library/tkinter.ttk.rst:328 msgid "" "A script (possibly registered with Misc.register) that is called immediately " "before displaying the values. It may specify which values to display." msgstr "" +"Um script (possivelmente registrado com Misc.register) que é chamado " +"imediatamente antes da exibição dos valores. Ele pode especificar quais " +"valores exibir." #: ../../library/tkinter.ttk.rst:332 msgid "" @@ -671,6 +681,11 @@ msgid "" "values from the dropdown list. In the \"normal\" state, the text field is " "directly editable. In the \"disabled\" state, no interaction is possible." msgstr "" +"Um dos estados: \"normal\", \"readonly\", ou \"disabled\". No estado " +"\"readonly\", o valor não pode ser editado diretamente, e o usuário só pode " +"selecionar valores contidos na lista suspensa. No estado \"normal\", o campo " +"de texto é diretamente editável. No estado \"disabled\", nenhuma interação é " +"possível." #: ../../library/tkinter.ttk.rst:339 msgid "" @@ -678,6 +693,9 @@ msgid "" "value associated with that name changes, the widget value is updated, and " "vice versa. See :class:`tkinter.StringVar`." msgstr "" +"Especifica um nome que terá seu valor vinculado ao valor do widget. Sempre " +"que o valor associado a esse nome mudar, o valor do widget será atualizado, " +"e vice versa. Veja :class:`tkinter.StringVar`." #: ../../library/tkinter.ttk.rst:344 ../../library/tkinter.ttk.rst:417 #: ../../library/tkinter.ttk.rst:865 @@ -686,7 +704,7 @@ msgstr "valores" #: ../../library/tkinter.ttk.rst:344 msgid "Specifies the list of values to display in the drop-down listbox." -msgstr "" +msgstr "Especifica a lista de valores para exibição na lista suspensa." #: ../../library/tkinter.ttk.rst:347 msgid "" @@ -696,17 +714,19 @@ msgstr "" #: ../../library/tkinter.ttk.rst:354 ../../library/tkinter.ttk.rst:442 msgid "Virtual events" -msgstr "" +msgstr "Eventos virtuais" #: ../../library/tkinter.ttk.rst:356 msgid "" "The combobox widgets generates a **<>** virtual event when " "the user selects an element from the list of values." msgstr "" +"Os widgets combobox geram um evento virtual **<>** quando " +"o usuário seleciona um elemento da lista de valores." #: ../../library/tkinter.ttk.rst:361 msgid "ttk.Combobox" -msgstr "" +msgstr "ttk.Combobox" #: ../../library/tkinter.ttk.rst:367 msgid "" @@ -717,7 +737,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:374 msgid "Returns the current value of the combobox." -msgstr "" +msgstr "Retorna o valor atual do combobox." #: ../../library/tkinter.ttk.rst:379 msgid "Sets the value of the combobox to *value*." diff --git a/tutorial/classes.po b/tutorial/classes.po index 90009b3c5..bf55e2df2 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -416,9 +416,9 @@ msgid "" "assignment changed the module-level binding." msgstr "" "Observe como uma atribuição *local* (que é o padrão) não altera o vínculo de " -"*scope_test* a *spam*. A instrução :keyword:`nonlocal` mudou o vínculo de " -"*scope_test* de *spam* e a atribuição :keyword:`global` alterou a ligação " -"para o nível do módulo." +"*teste_de_escopo* a *spam*. A instrução :keyword:`nonlocal` mudou o vínculo " +"de *teste_de_escopo* de *spam* e a atribuição :keyword:`global` alterou a " +"ligação para o nível do módulo." #: ../../tutorial/classes.rst:205 msgid "" @@ -502,11 +502,11 @@ msgstr "" "nomes criado pela definição da classe; aprenderemos mais sobre objetos " "classe na próxima seção. O escopo local (que estava vigente antes da " "definição da classe) é reativado, e o objeto classe é vinculado ao " -"identificador da classe nesse escopo (:class:`!ClassName` no exemplo)." +"identificador da classe nesse escopo (:class:`!NomeClasse` no exemplo)." #: ../../tutorial/classes.rst:259 msgid "Class Objects" -msgstr "Objetos de Class" +msgstr "Objetos classe" #: ../../tutorial/classes.rst:261 msgid "" @@ -537,11 +537,12 @@ msgid "" "assignment. :attr:`!__doc__` is also a valid attribute, returning the " "docstring belonging to the class: ``\"A simple example class\"``." msgstr "" -"então ``MyClass.i`` e ``MyClass.f`` são referências a atributo válidas, " -"retornando, respectivamente, um inteiro e um objeto função. Atributos de " -"classe podem receber valores, pode-se modificar o valor de ``MyClass.i`` num " -"atribuição. :attr:`!__doc__` também é um atributo válido da classe, " -"retornando a docstring associada à classe: ``\"A simple example class\"``." +"então ``MinhaClasse.i`` e ``MinhaClasse.f`` são referências a atributo " +"válidas, retornando, respectivamente, um inteiro e um objeto função. " +"Atributos de classe podem receber valores, pode-se modificar o valor de " +"``MinhaClasse.i`` num atribuição. :attr:`!__doc__` também é um atributo " +"válido da classe, retornando a docstring associada à classe: ``\"Um exemplo " +"de classe simples\"``." #: ../../tutorial/classes.rst:282 msgid "" @@ -624,8 +625,8 @@ msgstr "" "a \"membros de dados\" em C++. Atributos de dados não precisam ser " "declarados. Assim como variáveis locais, eles passam a existir na primeira " "vez em que é feita uma atribuição. Por exemplo, se ``x`` é uma instância da :" -"class:`!MyClass` criada acima, o próximo trecho de código irá exibir o valor " -"``16``, sem deixar nenhum rastro::" +"class:`!MinhaClasse` criada acima, o próximo trecho de código irá exibir o " +"valor ``16``, sem deixar nenhum rastro::" #: ../../tutorial/classes.rst:340 msgid "" @@ -658,10 +659,10 @@ msgstr "" "Nomes de métodos válidos de uma instância dependem de sua classe. Por " "definição, cada atributo de uma classe que é uma função corresponde a um " "método das instâncias. Em nosso exemplo, ``x.f`` é uma referência de método " -"válida já que ``MyClass.f`` é uma função, enquanto ``x.i`` não é, já que " -"``MyClass.i`` não é uma função. Entretanto, ``x.f`` não é o mesmo que " -"``MyClass.f``. A referência ``x.f`` acessa um objeto método e a ``MyClass." -"f`` acessa um objeto função." +"válida já que ``MinhaClasse.f`` é uma função, enquanto ``x.i`` não é, já que " +"``MinhaClasse.i`` não é uma função. Entretanto, ``x.f`` não é o mesmo que " +"``MinhaClasse.f``. A referência ``x.f`` acessa um objeto método e a " +"``MinhaClasse.f`` acessa um objeto função." #: ../../tutorial/classes.rst:360 msgid "Method Objects" @@ -678,14 +679,14 @@ msgid "" "is a method object, and can be stored away and called at a later time. For " "example::" msgstr "" -"No exemplo :class:`!MyClass`, o resultado da expressão acima será a string " -"``'hello world'``. No entanto, não é obrigatório invocar o método " +"No exemplo :class:`!MinhaClasse`, o resultado da expressão acima será a " +"string ``\"olá mundo\"``. No entanto, não é obrigatório invocar o método " "imediatamente: como ``x.f`` é também um objeto ele pode ser atribuído a uma " "variável e invocado depois. Por exemplo::" #: ../../tutorial/classes.rst:374 msgid "will continue to print ``hello world`` until the end of time." -msgstr "exibirá o texto ``hello world`` até o mundo acabar." +msgstr "exibirá o texto ``olá mundo`` até o mundo acabar." #: ../../tutorial/classes.rst:376 msgid "" @@ -715,7 +716,7 @@ msgid "" msgstr "" "Na verdade, pode-se supor a resposta: a particularidade sobre os métodos é " "que o objeto da instância é passado como o primeiro argumento da função. Em " -"nosso exemplo, a chamada ``x.f()`` é exatamente equivalente a ``MyClass." +"nosso exemplo, a chamada ``x.f()`` é exatamente equivalente a ``MinhaClasse." "f(x)``. Em geral, chamar um método com uma lista de *n* argumentos é " "equivalente a chamar a função correspondente com uma lista de argumentos que " "é criada inserindo o objeto de instância do método antes do primeiro " From 37f01f54ea92da05120128dbdc750578aae2796a Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Fri, 6 Sep 2024 00:16:16 -0300 Subject: [PATCH 005/186] Cleanup 3.12 after #228 --- .env | 60 ---- .github/dependabot.yml | 19 -- .github/problem-matchers/sphinx.json | 40 --- .github/scripts/list-obsolete.py | 44 --- .github/scripts/prepmsg.sh | 38 --- .github/workflows/check.yml | 235 --------------- .github/workflows/update.yml | 231 --------------- Makefile | 260 ---------------- README.md | 73 +---- dict | 427 --------------------------- requirements.txt | 31 -- requirements.txt.in | 5 - 12 files changed, 12 insertions(+), 1451 deletions(-) delete mode 100644 .env delete mode 100644 .github/dependabot.yml delete mode 100644 .github/problem-matchers/sphinx.json delete mode 100755 .github/scripts/list-obsolete.py delete mode 100755 .github/scripts/prepmsg.sh delete mode 100644 .github/workflows/check.yml delete mode 100644 .github/workflows/update.yml delete mode 100644 Makefile delete mode 100644 dict delete mode 100644 requirements.txt delete mode 100644 requirements.txt.in diff --git a/.env b/.env deleted file mode 100644 index 3c85edcc9..000000000 --- a/.env +++ /dev/null @@ -1,60 +0,0 @@ -# Language code as supported by Sphinx: -# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language -LANGUAGE ?= pt_BR - -# Branch used in the project and in CPython -BRANCH := 3.12 - -############################ -# Environment variables for 'merge' target -############################ -# -# Version(s) that still receive(s) bug fixes, not only security-related fixes. -# Versions in this variable will have their translation replaced with changes -# in currently active version being translated. These will have pomerge's -# --overwrite flag set. -BUGFIXBRANCH ?= 3.11 - -# Version(s) that are considered security fixes or EOL. Let's make them more -# stable, with more predictable state. These versions will not have translated -# strings replaced with translations update. These will have pomerge's -# --no-overwrite flag set. -OLDERBRANCHES ?= 3.10 3.9 3.8 3.7 3.6 2.7 -# -############################ - - -############################ -# Environment variables for 'build' target -############################ -# -# If set to -W, warnings will be considered as errors. -# Set to "" keep warnings as is. -SPHINXERRORHANDLING := "-W" -# -############################ - -########################### -# Environment variables for 'tx-install' target -########################### -# -# Specific Transifex CLI Client version to install. -# If unset, latest version will be used. -TX_CLI_VERSION ?= '1.6.7' - -# Install directory of TX_CLI_DIR. Consider using a directory already -# in the PATH environment variable because install script will add this -# directory to PATH in your ~/.bashrc. -TX_CLI_DIR ?= $(shell realpath ~/.local/bin) - -############################ -# Paths and URLs -############################ -# -PYTHON ?= $(shell which python3) -CPYTHON_DIR := cpython -LOCALE_DIR := Doc/locales -LOGS_DIR := logs -VENV_DIR := .venv -# -####### diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 8bcf9ba87..000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - assignees: - - "rffontenelle" - commit-message: - prefix: "gha" - - - package-ecosystem: "pip" - directory: "/" - schedule: - interval: "weekly" - assignees: - - "rffontenelle" - commit-message: - prefix: "pip" diff --git a/.github/problem-matchers/sphinx.json b/.github/problem-matchers/sphinx.json deleted file mode 100644 index a0299d893..000000000 --- a/.github/problem-matchers/sphinx.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "sphinx-problem-matcher", - "pattern": [ - { - "regexp": "^(.*):(\\d+):\\s+(\\w*):\\s+(.*)$", - "file": 1, - "line": 2, - "severity": 3, - "message": 4 - } - ] - }, - { - "owner": "sphinx-problem-matcher-loose", - "pattern": [ - { - "_comment": "A bit of a looser pattern, doesn't look for line numbers, just looks for file names relying on them to start with / and end with .rst", - "regexp": "(\/.*\\.rst):\\s+(\\w*):\\s+(.*)$", - "file": 1, - "severity": 2, - "message": 3 - } - ] - }, - { - "owner": "sphinx-problem-matcher-loose-no-severity", - "pattern": [ - { - "_comment": "Looks for file names ending with .rst and line numbers but without severity", - "regexp": "^(.*\\.rst):(\\d+):(.*)$", - "file": 1, - "line": 2, - "message": 3 - } - ] - } - ] -} diff --git a/.github/scripts/list-obsolete.py b/.github/scripts/list-obsolete.py deleted file mode 100755 index 2c5434913..000000000 --- a/.github/scripts/list-obsolete.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python3 -# List PO files that no longer have a corresponding page in Python docs - -import os -import os.path -import sys -import subprocess - -def run(cmd): - return subprocess.check_output(cmd, shell=True, text=True) - -# Set POT root directory from command-line argument or hardcoded, then test it -pot_root = 'cpython/Doc/locales/pot/' - -if len(sys.argv) > 1: - pot_root = sys.argv[0] - -if not os.path.isdir(pot_root): - print(f'Unable to find the POT directory {pot_root}') - exit(1) - -# List PO files tracked by git -po_files = run('git ls-files | grep .po | tr "\n" " "').split() - -# Compare po vs pot, store po without corresponding pot -to_remove = [] -for file in sorted(po_files): - pot = os.path.join(pot_root, file + 't') - if not os.path.isfile(pot): - to_remove.append(file) - -# Exit if no obsolete, or print obsoletes files. -# If running in GitHub Actions, add a problem matcher to bring up the attention -if len(to_remove) == 0: - exit -else: - matcher = "" - if 'CI' in os.environ: - matcher = '::error::' - print(f'{matcher}The following files are absent in the documentation, hence they should be removed:\n') - for file in to_remove: - print(f'{matcher} ' + file) - print("") - exit(1) diff --git a/.github/scripts/prepmsg.sh b/.github/scripts/prepmsg.sh deleted file mode 100755 index 2111ab29a..000000000 --- a/.github/scripts/prepmsg.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# Prepare message for Telegram notification -set -ex - -die() { echo "$0: error: $*" >&2; exit 1; } - -[ $# -ne 2 ] && die "Expected 1 input and 1 output files, got $#" -[ ! -f "$1" ] && die "Input file $1 not found, skipping." -[ -z "${GITHUB_REPOSITORY}" ] && die "GITHUB_REPOSITORY is empty." -[ -z "${GITHUB_RUN_ID}" ] && die "GITHUB_RUN_ID is empty." -[ -z "${GITHUB_JOB}" ] && die "GITHUB_JOB is empty." - -URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - -input="$1" -output="$2" - -touch aux -if [[ "${GITHUB_JOB}" == "build" ]]; then - grep 'cpython/Doc/.*WARNING:' "$input" | \ - sed 's|.*/cpython/Doc/||' | \ - uniq | \ - sed 's|^|```\n|;s|$|\n```\n|' \ - > aux -elif [[ "${GITHUB_JOB}" == "lint" ]]; then - grep -P '^.*\.po:\d+:\s+.*\(.*\)$' "$input" | \ - sort -u | \ - sed 's|^|```\n|;s|$|\n```\n|' \ - > aux -else - die "Unexpected job name ${GITHUB_JOB}" -fi - -[[ $(cat aux) == "" ]] && die "Unexpected empty output message." - -echo "❌ *${GITHUB_JOB}* (ID [${GITHUB_RUN_ID}]($URL)):" > "$output"; -{ echo ""; cat aux; echo ""; } >> "$output" -rm aux diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 0a671ebe4..000000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,235 +0,0 @@ -# Run some tests in the Python Doc translations - -name: Check - -on: - workflow_dispatch: - workflow_call: - pull_request: - branches: - - '3.12' - paths: - - '.github/workflows/check.yml' - - '.github/scripts/prepmsg.sh' - - '.github/scripts/list-obsolete.py' - - 'Makefile' - - 'requirements.txt' - - '*.po' - - '**/*.po' - push: - branches: - - '3.12' - paths: - - '.github/workflows/check.yml' - - '.github/scripts/prepmsg.sh' - - '.github/scripts/list-obsolete.py' - - 'Makefile' - - 'requirements.txt' - - '*.po' - - '**/*.po' - -permissions: - contents: read - -jobs: - # Build documentation handling warnings as errors. Always store logs. - # If success, make built docs artifact. If failure, notify telegram. - build: - name: Build translated docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.2 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.0 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Add problem matcher - uses: sphinx-doc/github-problem-matcher@v1.0 - - - name: Build docs - continue-on-error: true - id: build - run: | - make build - - - name: Upload artifact - docs - if: steps.build.outcome == 'success' - uses: actions/upload-artifact@v4.3.1 - with: - name: docs - path: cpython/Doc/build/html - - - name: Upload artifact - log files - if: always() - uses: actions/upload-artifact@v4.3.1 - with: - name: build-logs - path: logs/* - - - name: Prepare notification (only on error) - if: steps.build.outcome == 'failure' - id: prepare - run: .github/scripts/prepmsg.sh logs/build/err*.txt logs/notify.txt - env: - GITHUB_JOB: ${{ github.job }} - GITHUB_RUN_ID: ${{ github.run_id }} - GITHUB_REPOSITORY: ${{ github.repository }} - - - name: Notify via Telegram - if: steps.prepare.outcome == 'success' - uses: appleboy/telegram-action@v0.1.1 - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - format: markdown - disable_web_page_preview: true - message_file: logs/notify.txt - - - # Run sphinx-lint to find wrong reST syntax in PO files. Always store logs. - lint: - name: Lint translations - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.2 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.0 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Add problem matcher - uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0 - - - name: Run sphinx-lint - continue-on-error: true - id: lint - run: | - make lint - - - name: Upload artifact - log files - uses: actions/upload-artifact@v4.3.1 - with: - name: lint-logs - path: logs/* - - #- name: Prepare notification (only on error) - # if: step.lint.outcome == 'failure' - # id: prepare - # run: scripts/prepmsg.sh logs/build/err*.txt logs/notify.txt - # env: - # GITHUB_JOB: ${{ github.job }} - # GITHUB_RUN_ID: ${{ github.run_id }} - # GITHUB_REPOSITORY: ${{ github.repository }} - # - #- name: Notify via Telegram - # if: step.prepare.outcome == 'success' - # uses: appleboy/telegram-action@v0.1.1 - # with: - # to: ${{ secrets.TELEGRAM_TO }} - # token: ${{ secrets.TELEGRAM_TOKEN }} - # format: markdown - # disable_web_page_preview: true - # message_file: logs/notify.txt - - - # Spell check the PO files, and store them in logs/ directory - pospell: - name: Spell check translations - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.2 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.0 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Install Hunspell - run: sudo apt install hunspell hunspell-pt-br -y - - - name: Run pospell - continue-on-error: true - id: pospell - run: make spell - - - name: Upload artifact - log files - uses: actions/upload-artifact@v4.3.1 - with: - name: pospell-logs - path: logs/* - - - # Gather all strings in a single PO file, useful for Translation Memory - # Also run powrap, useful only for pull_request testing for dependabot - compendium: - runs-on: ubuntu-latest - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.2 - with: - fetch-depth: 5 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.0 - with: - python-version: '3' - - - name: Make sure the repository is up to date - if: github.event_name != 'pull_request' - run: git pull --rebase - - - name: Install dependencies - run: | - sudo apt update -y && sudo apt install gettext -y - pip3 install --upgrade pip - pip3 install -r requirements.txt - - - name: Generate compendium from PO files - run: | - pocompendium --correct compendium.po *.po **/*.po - powrap compendium.po - - - name: Upload artifact - uses: actions/upload-artifact@v4.3.1 - with: - name: compendium - path: compendium.po - - # List PO files that no longer have a corresponding page in Python docs - list-obsolete: - runs-on: ubuntu-latest - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.2 - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.0 - with: - python-version: '3' - - - name: Generate POT files - run: make pot - - - name: List obsolete PO files, if any - run: python3 .github/scripts/list-obsolete.py diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index bcc7f9083..000000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,231 +0,0 @@ -name: Update - -on: - workflow_dispatch: - inputs: - BRANCH: - description: CPython branch to use - required: false - type: string - default: '3.12' - pull_request: - paths: - - '.github/workflows/update.yml' - - 'Makefile' - - 'requirements.txt' - branches: - - '3.12' - push: - paths: - - '.github/workflows/update.yml' - - 'Makefile' - - 'requirements.txt' - branches: - - '3.12' - - '3.11' - - '3.10' - - '3.9' - - '3.8' - - '3.7' - schedule: - - cron: '0 23 * * *' - -permissions: - contents: read - -jobs: - # Download translations from Transifex, keep PO and Logs artifacts - pull: - name: Pull from Transifex - runs-on: ubuntu-latest - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.2 - - - name: Get branch name on push or schedule - if: | - github.event_name == 'push' || - github.event_name == 'schedule' - run: echo "BRANCH=${GITHUB_REF_NAME}" >>$GITHUB_ENV - - - name: Get branch name on pull - if: github.event_name == 'pull_request' - run: echo "BRANCH=${GITHUB_BASE_REF}" >>$GITHUB_ENV - - - name: Get branch name on manual run - if: github.event_name == 'workflow_dispatch' - run: echo "BRANCH=${{ github.event.inputs.BRANCH }}" >> $GITHUB_ENV - - - name: Check out CPython - uses: actions/checkout@v4.1.2 - with: - repository: python/cpython - ref: ${{ env.BRANCH }} - path: cpython - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.0 - with: - python-version: '3' - cache: 'pip' - cache-dependency-path: | - 'requirements.txt' - 'cpython/requirements.txt' - - - name: Install dependencies - run: sudo apt update -y && sudo apt install gettext tree -y - - - name: Pull translations - run: | - make tx-config TX_CLI_DIR=/usr/local/bin - if [ "${{ github.event_name }}" != 'pull_request' ]; then - make pull -o tx-config TX_CLI_DIR=/usr/local/bin - fi - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - - - name: Upload artifact - po files - uses: actions/upload-artifact@v4.3.1 - with: - name: translations - path: | - *.po - **/*.po - .tx/ - - - name: Upload artifact - log files - if: always() - uses: actions/upload-artifact@v4.3.1 - with: - name: pull-logs - path: | - logs/* - /tmp/*.log - - - # Job for getting po files downloaded and storing this repository - push: - name: Push to repo - needs: [pull] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4.1.2 - - - name: Download PO files - uses: actions/download-artifact@v4.1.4 - with: - name: translations - - # Exclude file with only changes in POT-Creation-Date - - name: Changed files - shell: bash - run: | - git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 - git ls-files -o --exclude-standard *.po **/*.po - - - name: Commit and push changes - if: | - github.repository == 'python/python-docs-pt-br' && - github.event_name != 'pull_request' - run: | - git config user.name github-actions - git config user.email github-actions@github.com - make push - - - # Merge translations previously updated into older branches to make sure - # older versions of Python Docs gets translated as well. - # 'overwrite=true' means strings previously translated will get overwritten; - # other branches will preserve translated strings, only filling in new - # translations. - merge: - name: Merge into ${{ matrix.branch }} - needs: [push] - runs-on: ubuntu-latest - permissions: - contents: write - strategy: - fail-fast: false - max-parallel: 3 - matrix: - branch: ['3.11', '3.10', '3.9', '3.8', '3.7', '3.6', '2.7'] - include: - - branch: 3.11 - overwrite: true - steps: - - name: Get branch name on push or schedule - if: | - github.event_name == 'push' || - github.event_name == 'schedule' - run: echo "CURRENT_BRANCH=${GITHUB_REF_NAME}" >>$GITHUB_ENV - - - name: Get branch name on pull - if: github.event_name == 'pull_request' - run: echo "CURRENT_BRANCH=${GITHUB_BASE_REF}" >>$GITHUB_ENV - - - name: Get branch name on manual run - if: github.event_name == 'workflow_dispatch' - run: echo "CURRENT_BRANCH=${{ github.event.inputs.BRANCH }}" >> $GITHUB_ENV - - - name: Check out source branch (${{ env.CURRENT_BRANCH }}) - uses: actions/checkout@v4.1.2 - with: - path: ${{ env.CURRENT_BRANCH }} - persist-credentials: false - - - name: Check out target branch (${{ matrix.branch }}) - uses: actions/checkout@v4.1.2 - with: - ref: ${{ matrix.branch }} - path: ${{ matrix.branch }} - - - name: Set up Python 3 - uses: actions/setup-python@v5.1.0 - with: - python-version: '3' - cache: 'pip' - cache-dependency-path: "${{ env.CURRENT_BRANCH }}/requirements.txt" - - - name: Install dependencies - run: | - sudo apt update -y && sudo apt install gettext -y - pip3 install pomerge powrap - - - name: Merge overwriting on stable release branch - if: ${{ matrix.overwrite == true }} - run: | - pomerge --from ${{ env.CURRENT_BRANCH }}/**/*.po --to ${{ matrix.branch }}/**/*.po - - - name: Merge without overwriting on EOL or security-fix release branch - if: ${{ matrix.overwrite != true }} - run: | - pomerge --no-overwrite --from ${{ env.CURRENT_BRANCH }}/**/*.po --to ${{ matrix.branch }}/**/*.po - - - name: Wrap catalog message files - run: | - powrap --modified -C ${{ matrix.branch }} - - #TODO: Solve make push to work with merge scenario - - name: Commit and push changes - if: | - github.repository == 'python/python-docs-pt-br' && - github.event_name != 'pull_request' - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 | xargs -r git add - git add $(git ls-files -o --exclude-standard *.po **/*.po) .tx/config - git diff-index --cached --quiet HEAD || git commit -m "Merge ${{ env.CURRENT_BRANCH }} into ${{ matrix.branch }}" - working-directory: ${{ matrix.branch }} - - - # Call the check.yml workflow after updating to run some tests - call-build: - name: call - needs: push - if: github.event_name != 'pull_request' - uses: ./.github/workflows/check.yml - secrets: inherit diff --git a/Makefile b/Makefile deleted file mode 100644 index e548b8974..000000000 --- a/Makefile +++ /dev/null @@ -1,260 +0,0 @@ -# -# Makefile for Brazilian Portuguese Python Documentation -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# based on: https://github.com/python/python-docs-fr/blob/3.8/Makefile -# - -################# -# Configuration - -# Read environment variables from file to keep this clean move version -# changes elsewhere -include .env - -# Force the use of Bash -SHELL=/bin/bash - -# Time of starting this run -NOW := $(shell date +'%Y%m%-d-%H%M%Z') - -# Force realpath, not relative one -override CPYTHON_DIR := $(shell realpath $(CPYTHON_DIR)) - -override LOGS_DIR := $(shell realpath $(LOGS_DIR)) - -override VENV_DIR := $(shell realpath $(VENV_DIR)) -# -################# - -.PHONY: build clean help htmlview lint merge pot pull push setup spell tx-config tx-install venv - -help: - @echo "Please use 'make ' where is one of:" - @echo " build Build an local version in html; deps: 'setup'" - @echo " push Commit and push translations; no deps" - @echo " pull Download translations from Transifex; deps: 'tx-config'" - @echo " tx-config Regenerate Transifex config; deps: 'pot' and 'tx-install'" - @echo " tx-install Install Transifex CLI client; deps: no deps" - @echo " pot Regenerate POT files from sources; deps: 'setup'" - @echo " htmlview View docs in a web browser; deps: build" - @echo " spell Check spelling, storing output in $(POSPELL_TMP_DIR)" - @echo " lint Do some linting in PO file's Sphinx syntax. deps: 'venv'" - @echo " merge Merge $(BRANCH) branch's .po files into older branches" - @echo " Defaults overwrite in: $(BUGFIXBRANCH)" - @echo " and NOT overwrite in: $(OLDERBRANCHES)" - @echo " clean Do some house cleaning" - @echo "" - - -# build: build the documentation using the translation files currently available -# at the moment. For most up-to-date docs, run "tx-config" and "pull" -# before this. If passing SPHINXERRORHANDLING='', warnings will not be -# treated as errors, which is good to skip simple Sphinx syntax mistakes. -build: setup - @mkdir -p "$(CPYTHON_DIR)/$(LOCALE_DIR)/$(LANGUAGE)/LC_MESSAGES/" - @cp --parents *.po **/*.po "$(CPYTHON_DIR)/$(LOCALE_DIR)/$(LANGUAGE)/LC_MESSAGES/" - @echo "Building Python $(BRANCH) Documentation in $(LANGUAGE) ..." - @mkdir -p "$(LOGS_DIR)/build" - @$(MAKE) -C $(CPYTHON_DIR)/Doc/ \ - PYTHON=$(PYTHON) \ - SPHINXERRORHANDLING=$(SPHINXERRORHANDLING) \ - SPHINXOPTS="--keep-going \ - -D gettext_compact=0 \ - -D language=$(LANGUAGE) \ - -D latex_engine=xelatex \ - -D latex_elements.inputenc= \ - -D latex_elements.fontenc=" \ - html \ - 2> >(tee -a $(LOGS_DIR)/build/err-$(NOW).txt >&2) - - -# push: Commit and push translation files and Transifex config file to repo. -# First it git-adds tracked file that doesn't exclusively match changes -# in POT-Creation-Date header field. Then it git-adds untracked PO files -# that might have been created in the update process, and the Transifex -# configuration. Finally, only commit and push only if any file was -# git-added (staged); otherwise, it does nothing. -# The MSG variable has a default commit message, but one can override it -# e.g. make push MSG='my message' -push: - @git diff -I'^"POT-Creation-Date: ' --numstat *.po **/*.po | cut -f3 | xargs -r git add - @git add $(shell git ls-files -o *.po **/*.po) .tx/config - @git diff-index --cached --quiet HEAD || \ - { git commit -m "Update translations from Transifex" && git push; } - - -# pull: Download translations files from Transifex, and apply line wrapping. -# For downloading new translation files, first run "tx-config" target -# to update the translation file mapping. -pull: tx-config - @"$(TX_CLI_DIR)/tx" pull -l $(LANGUAGE) -t -f --use-git-timestamps - @"$(VENV_DIR)/bin/powrap" --quiet *.po **/*.po - - -# tx-config: Generate a new Transifex configuration file by reading -# the pot files generated by 'pot' target. The file is -# created in $(LOCALE_DIR)/.tx/config, and then is tweaked -# to fit the language's needs and then placed in .tx/config -# at the project's root directory. -tx-config: TRANSIFEX_PROJECT := python-newest -tx-config: pot tx-install - @cd $(CPYTHON_DIR)/$(LOCALE_DIR); \ - rm -rf .tx; \ - "$(VENV_DIR)/bin/sphinx-intl" create-txconfig; \ - "$(VENV_DIR)/bin/sphinx-intl" update-txconfig-resources \ - --transifex-organization-name python-doc \ - --transifex-project-name=$(TRANSIFEX_PROJECT) \ - --locale-dir . \ - --pot-dir pot - @mkdir -p .tx - @sed $(CPYTHON_DIR)/$(LOCALE_DIR)/.tx/config \ - -e "s|^file_filter = .*|&\nx&|;" \ - -e "s|^source_file = pot/|source_file = $(LOCALE_RELATIVE)/pot/|" \ - > .tx/config - @sed -i .tx/config \ - -e "s|^xfile_filter = .//LC_MESSAGES/|trans.$(LANGUAGE) = |;" - - -# tx-install: Install Transifex CLI client if not installed yet. Installs -# the TX_CLI_VERSION version into TX_CLI_DIR directory. If -# TX_CLI_VERSION not provided, uses the latest one. -tx-install: URL := https://raw.githubusercontent.com/transifex/cli/master/install.sh -tx-install: - @if [ ! -x "$(TX_CLI_DIR)/tx" ]; then \ - echo "Transifex TX Client not found, installing ..."; \ - cd "$(TX_CLI_DIR)"; \ - if [ -n "v$(TX_CLI_VERSION)" ]; then \ - curl -s -o- $(URL) | bash -s -- v$(TX_CLI_VERSION); \ - else \ - curl -s -o- $(URL) | bash; \ - fi; \ - fi - - -# pot: After running "setup" target, run sphinx-build's gettext target -# to generate .pot files under $(CPYTHON_DIR)/Doc/locales/pot. -pot: setup - @$(MAKE) -C $(CPYTHON_DIR)/Doc/ \ - VENVDIR=./venv \ - PYTHON=$(PYTHON) \ - ALLSPHINXOPTS='-E \ - -b gettext \ - -D gettext_compact=0 \ - -d build/.doctrees \ - . $(CPYTHON_DIR)/$(LOCALE_DIR)/pot' \ - build - - -# setup: After running "venv" target, prepare that virtual environment with -# a local clone of cpython repository and the translation files. -# If the directories exists, only update the cpython repository and -# the translation files copy which could have new/updated files. -setup: CPYTHON_URL := https://github.com/python/cpython -setup: venv - @if [ -z "$(BRANCH)" ]; then \ - echo "BRANCH is empty, should have git-branch. Unable to continue."; \ - exit 1; \ - fi - - @if ! [ -d "$(CPYTHON_DIR)" ]; then \ - echo "CPython repo not found; cloning ..."; \ - git clone --depth 1 --no-single-branch $(CPYTHON_URL) $(CPYTHON_DIR); \ - git -C "$(CPYTHON_DIR)" checkout $(BRANCH); \ - else \ - echo "CPython repo found; updating ..."; \ - git -C "$(CPYTHON_DIR)" checkout $(BRANCH); \ - git -C "$(CPYTHON_DIR)" pull --rebase; \ - fi - - @echo "Creating CPython's documentation virtual environment ..." - @if [ ! -d "$(CPYTHON_DIR)/Doc/venv" ]; then \ - $(MAKE) -C "$(CPYTHON_DIR)/Doc" PYTHON=$(PYTHON) venv; \ - fi - - -# venv: create a virtual environment which will be used by almost every -# other target of this script. CPython specific packages are installed -# in there specific venv (see 'setup' target). -venv: - @if [ ! -d "$(VENV_DIR)" ]; then \ - echo "Setting up language team's virtual environment ..."; \ - "$(PYTHON)" -m venv "$(VENV_DIR)"; \ - "$(VENV_DIR)/bin/python" -m pip install --upgrade pip; \ - mkdir -p "$(LOGS_DIR)"; \ - "$(VENV_DIR)/bin/pip" install --requirement requirements.txt \ - --log "$(LOGS_DIR)/venv-$(NOW).txt"; \ - fi - - -# htmlview: View the documentation locally, using Makefile's "htmlview" target. -# Run "build" before using this target. -htmlview: build - @INDEX="$(CPYTHON_DIR)/Doc/build/html/index.html"; \ - "$(PYTHON)" -c "import os, webbrowser; \ - webbrowser.open('file://' + os.path.realpath('$$INDEX'))" - - -# spell: run spell checking tool in all po files listed in SRCS variable, -# storing the output in text files DESTS for proofreading. The -# DESTS target run the spellchecking, while the typos.txt target -# gather all reported issues in one file, sorted without redundancy. -SRCS := $(wildcard *.po **/*.po) -DESTS := $(addprefix $(LOGS_DIR)/pospell-$(NOW)/out/,$(patsubst %.po,%.txt,$(SRCS))) -spell: venv $(DESTS) $(LOGS_DIR)/pospell-$(NOW)/all.txt - -$(LOGS_DIR)/pospell-$(NOW)/out/%.txt: %.po dict - @echo "Checking $< ..." - @mkdir -p $(@D) - @$(VENV_DIR)/bin/pospell -l "$(LANGUAGE)" -p dict $< > $@ || true - -$(LOGS_DIR)/pospell-$(NOW)/all.txt: - @echo "Gathering all typos in $(LOGS_DIR)/pospell-$(NOW)/all.txt ..." - @cut -d: -f3- $(DESTS) | sort -u > $@ - - -# merge: Merge translations from BRANCH (Python version currently aim of -# translation) into each branch listed by BUGFIXBRANCH and -# OLDERBRANCHES (branches of older Python versions) so that older -# versions of the Python Docs try make at least some use of the latest -# translations. OLDERBRANCHES has '--no-overwrite' flag so it does not -# overwrite translated strings, preserving history. -# After merging, only commit and push only if any file was git-added -# (staged) to the target branch; otherwise, it does nothing. -merge: venv $(BUGFIXBRANCH) $(OLDERBRANCHES) - -$(OLDERBRANCHES): OVERWRITEFLAG = --no-overwrite -$(BUGFIXBRANCH) $(OLDERBRANCHES): - @if [[ $@ == $(BRANCH) ]]; then \ - echo "Ignoring attempt to pomerge '$(BRANCH)' into itself."; \ - else \ - echo "Merging translations from $(BRANCH) branch into $@ ..."; \ - $(VENV_DIR)/bin/pomerge --from-files *.po **/*.po; \ - git checkout $@; \ - $(VENV_DIR)/bin/pomerge $(OVERWRITEFLAG) --to-files *.po **/*.po; \ - $(VENV_DIR)/bin/powrap --modified *.po **/*.po; \ - git add -u; \ - if [ -n "$(git diff --name-only --cached)" ]; then \ - git commit -m $(MSG); \ - git push; \ - else \ - echo 'Nothing to commit'; \ - fi; \ - git checkout $(BRANCH); \ - fi - - -# lint: Report reStructuredText syntax errors in the translation files -lint: venv - @mkdir -p "$(LOGS_DIR)" - @$(VENV_DIR)/bin/sphinx-lint *.po **/*.po |& \ - tee -a $(LOGS_DIR)/lint-$(NOW).txt || true - @echo "Lint output stored in $(LOGS_DIR)/lint-$(NOW).txt" - - -# clean: remove all .mo files and the venv directory that may exist and could -# have been created by the actions in other targets of this script. -clean: - rm -rf "$(VENV_DIR)" - rm -rf "$(CPYTHON_DIR)/$(LOCALE_DIR)" - [ -d "$(CPYTHON_DIR)" ] && $(MAKE) -C "$(CPYTHON_DIR)/Doc" clean-venv diff --git a/README.md b/README.md index 42d958ca3..d78a3bdd9 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,19 @@ # Brazilian Portuguese Translation of the Python Documentation -[![Update](https://github.com/python/python-docs-pt-br/actions/workflows/update.yml/badge.svg)](https://github.com/python/python-docs-pt-br/actions/workflows/update.yml) -[![Check](https://github.com/python/python-docs-pt-br/actions/workflows/check.yml/badge.svg)](https://github.com/python/python-docs-pt-br/actions/workflows/check.yml) +[![Workflow status badge][workflow_badge]][workflow_url] +[![Translation statistics badge][stats_badge]][transifex_url] -Check our [wiki](https://github.com/python/python-docs-pt-br/wiki) for more guidance on translating +Translation files for [Python 3.12 docs][docs_url]. -## Translation priorities +See list of incomplete translations in the [potodo.md][potodo] file. -The following modules we consider as priority targets, hence should -receive more attention than other modules/pages (0 has higher priority -than 2). Please helps assure they are a 100% translated. +See [main][main] branch for scripts, docs, license and more info. -### Priority 0 (probably they are completed) - - bugs - - glossary - - library/functions - - library/index - - library/intro - - library/constants - - library/stdtypes - - library/exceptions - - sphinx - - tutorial/ (all!) +[main]: https://github.com/python/python-docs-pt-br/tree/3.12 +[potodo]: potodo.md?plain=1 +[docs_url]: https://docs.python.org/pt-br/3.12/ +[workflow_badge]: https://github.com/python/python-docs-pt-br/workflows/python-312/badge.svg +[workflow_url]: https://github.com/python/python-docs-pt-br/actions?workflow=python-312 +[stats_badge]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgithub.com%2Fpython%2Fpython-docs-pt-br%2Fraw%2F3.12%2Fstats.json&query=translation&label=pt_BR +[transifex_url]: https://app.transifex.com/python-doc/python-newest/ -### Priority 1 - - reference/ (all) - - faq/ (all) - -### Priority 2 - - library/turtle - - library/sys - - library/argparse - - library/random - - library/statistics - - library/urllib.request - - library/smtplib - - library/datetime - - library/zlib - - library/gzip - - library/lzma - - library/tarfile - - library/timeit - - library/profile - - library/doctest - - library/unittest - - library/ (except the ones mentioned above) - -## Documentation Contribution Agreement - -NOTE REGARDING THE LICENSE FOR TRANSLATIONS: Python's documentation is -maintained using a global network of volunteers. By posting this -project on Transifex, GitHub, and other public places, and inviting -you to participate, we are proposing an agreement that you will -provide your improvements to Python's documentation or the translation -of Python's documentation for the PSF's use under the CC0 license -(available at -https://creativecommons.org/publicdomain/zero/1.0/legalcode). In -return, you may publicly claim credit for the portion of the -translation you contributed and if your translation is accepted by the -PSF, you may (but are not required to) submit a patch including an -appropriate annotation in the Misc/ACKS or TRANSLATORS file. Although -nothing in this Documentation Contribution Agreement obligates the PSF -to incorporate your textual contribution, your participation in the -Python community is welcomed and appreciated. - -You signify acceptance of this agreement by submitting your work to -the PSF for inclusion in the documentation. diff --git a/dict b/dict deleted file mode 100644 index 13d5b70be..000000000 --- a/dict +++ /dev/null @@ -1,427 +0,0 @@ -Aahz -Abelson -ActivePython -Andrew -Android -Apple -Argparse -args -ArgumentParser -array -arrays -ascii -Ascii -async -asyncio -autoinicialização -aux -await -backend -backends -backport -bash -Bash -Beck -BeOpen -Bernstein -Bicking -bignum -binutils -bitbucket -Black -Blackbox -Blake Winton -Boddie -Boer -booleana -booleanas -Booleanas -booleano -booleanos -Borland -Bourne -breadth -buffer -buffers -bug -bugs -bytearray -bytearrays -bytecode -bytecodes -bzip -carregável -Cédric -Centrum -cfuhash -chamável -Changelog -Chapman -char -Christian -Circus -class -codec -Codecs -Coghlan -Collin -Compaq -const -contrabarra -Cookbook -cookies -Corporation -corrotina -corrotinas -ctypes -curl -currying -Cynthia -Cython -Dalke -Dan -D'Aprano -datetime -DateTime -deadlock -def -Delphi -desserialização -desserializar -dict -dicts -distutils -Distutils -dll -doc -docstring -docstrings -doctest -doctests -Docutils -Drake -dtoa -dunder -Efford -egid -ElementTree -elif -else -Emacs -email -Emily -emoji -emojis -Eric -Éric -errno -euid -Excel -except -exe -exec -execv -exp -false -float -Flying -foo -fork -Foundation -framework -frameworks -François -Fred -Fredrik -freeware -genexp -genexps -Gerald -gettext -Giampolo -GiB -git -Git -github -GitHub -glob -Gnumeric -Golden -Gordin -Gordon -Gregory -Grönholm -gzip -Hammond -Harold -hash -Haskell -Heimes -Heller -Henstridge -Hettinger -Hewlett -Hilbert -host -Hylton -HyperText -Ian -ids -if -import -index -Index -initgroups -Initiatives -int -Irix -IronPython -Jay -Jelke -Jeremy -Jewett -Jr -Julie -Jython -Kent -kernel -Kernel -kernels -KiB -kqueue -Krell -Kuchling -Language -len -libffi -libmpdec -libtclsam -libtksam -Lisp -listcomp -listcomps -localtime -log -logger -Logger -loggers -Loggers -logging -Logging -logs -loop -loops -Ltd -Ltda -Lucasfilm -Lundh -lzma -Mac -MacAfee -Macintosh -mail -mailheader -Majkowski -Marek -Mark -Markup -marshal -Mathematisch -McAfee -McMillan -memoizar -memoryview -MemoryView -Mertz -metacaractere -Metacaractere -metacaracteres -Metacaracteres -metaclasse -metaclasses -Microsoft -Minus -Mitch -mixin -mmap -Monty -Moshe -multithread -NaN -NaNs -National -ncurses -netrc -Neumann -Nick -numpy -NumPy -NxN -Object -OpenSolaris -OpenSuse -OverflowError -Packaging -Packard -patches -Patterns -pdb -PEP -Perl -Pillow -Pinard -pip -plugin -plugins -popen -PowerShell -printf -prompt -proxy -pty -PureProxy -py -Py -pyc -PyChecker -Pydb -Pylint -PyObject -PyPy -PyQt -PySide -python -Python -Pythônico -PythonLabs -Pythonwin -PythonWin -PyUnit -pyvenv -PyWin -PyZipFile -qNaN -Qt -Queens -Randal -Raymond -read -referenciável -regex -repr -Research -Reston -reStructuredText -rfc -rgid -root -Rossum -Roundup -Ruby -ruid -runner -Salmela -Sauvage -scanf -Scheme -Scintilla -scipy -script -scripts -Sébastien -self -serialização -setgroups -setup -setuptools -sgid -shareware -shebang -Shebang -shell -shells -Singleton -SipHash -Slice -slot -slots -smalltalk -sNaN -Snow -so -Solaris -SourceForge -spec -Sphinx -sscanf -Standard -stderr -stdin -stdout -Stichting -str -streams -Streams -stride -string -strtod -Studio -subcontexto -subcontextos -subpacote -subpacotes -subst -substring -subteste -suid -Sussman -switch -sys -tar -Tcl -Telnet -termcap -thread -threading -threads -Tix -Tk -Tkinter -token -tokens -traceback -true -try -tty -Tuininga -typedef -unicode -Unicode -unittest -upload -urllib -Usenet -User -ValueError -voltage -VxWorks -Water -wchar -while -widgets -Win -Windows -Winter -Winton -www -wxPython -wxwidgets -wxWidgets -WxWidgets -Xt -Yellow -Zadka -zipfile -ZipFile -zlib -Zope diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3508d6145..000000000 --- a/requirements.txt +++ /dev/null @@ -1,31 +0,0 @@ -alabaster==0.7.16 -Babel==2.14.0 -certifi==2024.2.2 -charset-normalizer==3.3.2 -click==8.1.7 -docutils==0.19 -idna==3.7 -imagesize==1.4.1 -Jinja2==3.1.3 -MarkupSafe==2.1.5 -packaging==24.0 -polib==1.2.0 -pomerge==0.1.4 -pospell==1.3 -powrap==1.0.1 -Pygments==2.17.2 -regex==2023.12.25 -requests==2.31.0 -snowballstemmer==2.2.0 -Sphinx==6.0.1 -sphinx-intl==2.1.0 -sphinx-lint==0.9.1 -sphinxcontrib-applehelp==1.0.8 -sphinxcontrib-devhelp==1.0.6 -sphinxcontrib-htmlhelp==2.0.5 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.7 -sphinxcontrib-serializinghtml==1.1.10 -tqdm==4.66.2 -translate-toolkit==3.12.2 -urllib3==1.26.18 diff --git a/requirements.txt.in b/requirements.txt.in deleted file mode 100644 index 0640e6881..000000000 --- a/requirements.txt.in +++ /dev/null @@ -1,5 +0,0 @@ -pomerge -powrap -pospell -sphinx-intl>=2.1.0 -sphinx-lint From 2f72a250763764b43f7129e459e8b6909edf6194 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Sep 2024 03:29:44 +0000 Subject: [PATCH 006/186] Update translations --- .tx/config | 8350 ++++++++++------- about.po | 12 +- bugs.po | 7 +- c-api/abstract.po | 11 +- c-api/allocation.po | 12 +- c-api/apiabiversion.po | 13 +- c-api/arg.po | 47 +- c-api/bool.po | 7 +- c-api/buffer.po | 77 +- c-api/bytearray.po | 42 +- c-api/bytes.po | 17 +- c-api/call.po | 22 +- c-api/capsule.po | 15 +- c-api/cell.po | 38 +- c-api/code.po | 9 +- c-api/codec.po | 12 +- c-api/complex.po | 100 +- c-api/concrete.po | 12 +- c-api/contextvars.po | 23 +- c-api/conversion.po | 10 +- c-api/coro.po | 10 +- c-api/datetime.po | 12 +- c-api/descriptor.po | 11 +- c-api/dict.po | 53 +- c-api/exceptions.po | 53 +- c-api/file.po | 6 +- c-api/float.po | 22 +- c-api/frame.po | 12 +- c-api/function.po | 11 +- c-api/gcsupport.po | 23 +- c-api/gen.po | 10 +- c-api/hash.po | 9 +- c-api/import.po | 23 +- c-api/index.po | 11 +- c-api/init.po | 761 +- c-api/init_config.po | 219 +- c-api/intro.po | 219 +- c-api/iter.po | 38 +- c-api/iterator.po | 11 +- c-api/list.po | 13 +- c-api/long.po | 28 +- c-api/mapping.po | 10 +- c-api/marshal.po | 14 +- c-api/memory.po | 66 +- c-api/memoryview.po | 7 +- c-api/method.po | 13 +- c-api/module.po | 316 +- c-api/none.po | 11 +- c-api/number.po | 19 +- c-api/objbuffer.po | 12 +- c-api/object.po | 12 +- c-api/objimpl.po | 12 +- c-api/perfmaps.po | 12 +- c-api/refcounting.po | 32 +- c-api/reflection.po | 11 +- c-api/sequence.po | 11 +- c-api/set.po | 12 +- c-api/slice.po | 85 +- c-api/stable.po | 11 +- c-api/structures.po | 78 +- c-api/sys.po | 21 +- c-api/tuple.po | 124 +- c-api/type.po | 10 +- c-api/typehints.po | 23 +- c-api/typeobj.po | 487 +- c-api/unicode.po | 22 +- c-api/utilities.po | 11 +- c-api/veryhigh.po | 11 +- c-api/weakref.po | 24 +- contents.po | 8 +- copyright.po | 10 +- deprecations/c-api-pending-removal-in-3.14.po | 210 + deprecations/c-api-pending-removal-in-3.15.po | 96 + .../c-api-pending-removal-in-future.po | 153 + deprecations/index.po | 1437 +++ deprecations/pending-removal-in-3.13.po | 195 + deprecations/pending-removal-in-3.14.po | 296 + deprecations/pending-removal-in-3.15.po | 148 + deprecations/pending-removal-in-3.16.po | 48 + deprecations/pending-removal-in-future.po | 460 + distributing/index.po | 10 +- extending/building.po | 20 +- extending/embedding.po | 219 +- extending/extending.po | 606 +- extending/index.po | 10 +- extending/newtypes.po | 379 +- extending/newtypes_tutorial.po | 1142 ++- extending/windows.po | 19 +- faq/design.po | 230 +- faq/extending.po | 84 +- faq/general.po | 75 +- faq/gui.po | 13 +- faq/index.po | 10 +- faq/installed.po | 13 +- faq/library.po | 256 +- faq/programming.po | 1215 ++- faq/windows.po | 75 +- glossary.po | 183 +- howto/annotations.po | 40 +- howto/argparse.po | 585 +- howto/clinic.po | 11 +- howto/cporting.po | 10 +- howto/curses.po | 151 +- howto/descriptor.po | 872 +- howto/enum.po | 1117 ++- howto/functional.po | 462 +- howto/gdb_helpers.po | 393 +- howto/index.po | 12 +- howto/instrumentation.po | 283 +- howto/ipaddress.po | 184 +- howto/isolating-extensions.po | 187 +- howto/logging-cookbook.po | 3100 +++++- howto/logging.po | 558 +- howto/mro.po | 310 +- howto/perf_profiling.po | 181 +- howto/pyporting.po | 15 +- howto/regex.po | 407 +- howto/sockets.po | 89 +- howto/sorting.po | 179 +- howto/unicode.po | 281 +- howto/urllib2.po | 285 +- installing/index.po | 46 +- library/2to3.po | 74 +- library/__future__.po | 28 +- library/__main__.po | 207 +- library/_thread.po | 28 +- library/abc.po | 163 +- library/aifc.po | 14 +- library/allos.po | 11 +- library/archiving.po | 12 +- library/argparse.po | 1278 ++- library/array.po | 32 +- library/ast.po | 1893 +++- library/asyncio-api-index.po | 19 +- library/asyncio-dev.po | 127 +- library/asyncio-eventloop.po | 565 +- library/asyncio-exceptions.po | 11 +- library/asyncio-extending.po | 11 +- library/asyncio-future.po | 61 +- library/asyncio-llapi-index.po | 12 +- library/asyncio-platforms.po | 22 +- library/asyncio-policy.po | 30 +- library/asyncio-protocol.po | 325 +- library/asyncio-queue.po | 72 +- library/asyncio-runner.po | 32 +- library/asyncio-stream.po | 169 +- library/asyncio-subprocess.po | 79 +- library/asyncio-sync.po | 139 +- library/asyncio-task.po | 455 +- library/asyncio.po | 65 +- library/atexit.po | 53 +- library/audioop.po | 47 +- library/audit_events.po | 12 +- library/base64.po | 17 +- library/bdb.po | 8 +- library/binary.po | 13 +- library/binascii.po | 23 +- library/bisect.po | 107 +- library/builtins.po | 30 +- library/bz2.po | 11 +- library/calendar.po | 91 +- library/cgi.po | 141 +- library/cgitb.po | 17 +- library/chunk.po | 16 +- library/cmath.po | 140 +- library/cmd.po | 153 +- library/cmdline.po | 10 +- library/code.po | 25 +- library/codecs.po | 17 +- library/codeop.po | 11 +- library/collections.abc.po | 98 +- library/collections.po | 459 +- library/colorsys.po | 22 +- library/compileall.po | 30 +- library/concurrency.po | 11 +- library/concurrent.futures.po | 131 +- library/concurrent.po | 10 +- library/configparser.po | 850 +- library/constants.po | 8 +- library/contextlib.po | 762 +- library/contextvars.po | 119 +- library/copy.po | 25 +- library/copyreg.po | 13 +- library/crypt.po | 47 +- library/crypto.po | 11 +- library/csv.po | 139 +- library/ctypes.po | 990 +- library/curses.ascii.po | 14 +- library/curses.panel.po | 12 +- library/curses.po | 20 +- library/custominterp.po | 12 +- library/dataclasses.po | 505 +- library/datatypes.po | 11 +- library/datetime.po | 903 +- library/dbm.po | 46 +- library/debug.po | 11 +- library/decimal.po | 1104 ++- library/development.po | 11 +- library/devmode.po | 106 +- library/dialog.po | 11 +- library/difflib.po | 234 +- library/dis.po | 558 +- library/distribution.po | 10 +- library/doctest.po | 497 +- library/email.charset.po | 10 +- library/email.compat32-message.po | 314 +- library/email.contentmanager.po | 11 +- library/email.encoders.po | 10 +- library/email.errors.po | 50 +- library/email.examples.po | 408 +- library/email.generator.po | 10 +- library/email.header.po | 31 +- library/email.headerregistry.po | 47 +- library/email.iterators.po | 31 +- library/email.message.po | 73 +- library/email.mime.po | 10 +- library/email.parser.po | 17 +- library/email.po | 12 +- library/email.policy.po | 214 +- library/email.utils.po | 39 +- library/ensurepip.po | 21 +- library/enum.po | 515 +- library/errno.po | 12 +- library/exceptions.po | 174 +- library/faulthandler.po | 29 +- library/fcntl.po | 36 +- library/filecmp.po | 25 +- library/fileformats.po | 11 +- library/fileinput.po | 41 +- library/filesys.po | 12 +- library/fnmatch.po | 21 +- library/fractions.po | 86 +- library/frameworks.po | 12 +- library/ftplib.po | 64 +- library/functional.po | 11 +- library/functions.po | 1359 +-- library/functools.po | 386 +- library/gc.po | 42 +- library/getopt.po | 56 +- library/getpass.po | 15 +- library/gettext.po | 140 +- library/glob.po | 33 +- library/graphlib.po | 82 +- library/grp.po | 17 +- library/gzip.po | 86 +- library/hashlib.po | 134 +- library/heapq.po | 85 +- library/hmac.po | 11 +- library/html.entities.po | 10 +- library/html.parser.po | 161 +- library/html.po | 9 +- library/http.client.po | 121 +- library/http.cookiejar.po | 60 +- library/http.cookies.po | 68 +- library/http.po | 65 +- library/http.server.po | 63 +- library/i18n.po | 11 +- library/idle.po | 37 +- library/imaplib.po | 61 +- library/imghdr.po | 24 +- library/importlib.metadata.po | 185 +- library/importlib.po | 181 +- library/importlib.resources.abc.po | 24 +- library/importlib.resources.po | 41 +- library/index.po | 11 +- library/inspect.po | 764 +- library/internet.po | 14 +- library/intro.po | 16 +- library/io.po | 104 +- library/ipaddress.po | 120 +- library/ipc.po | 10 +- library/itertools.po | 1130 ++- library/json.po | 183 +- library/keyword.po | 11 +- library/language.po | 12 +- library/linecache.po | 20 +- library/locale.po | 42 +- library/logging.config.po | 340 +- library/logging.handlers.po | 23 +- library/logging.po | 330 +- library/lzma.po | 71 +- library/mailbox.po | 84 +- library/mailcap.po | 21 +- library/markup.po | 11 +- library/marshal.po | 59 +- library/math.po | 39 +- library/mimetypes.po | 40 +- library/mm.po | 11 +- library/mmap.po | 63 +- library/modulefinder.po | 63 +- library/modules.po | 12 +- library/msilib.po | 16 +- library/msvcrt.po | 8 +- library/multiprocessing.po | 2168 +++-- library/multiprocessing.shared_memory.po | 130 +- library/netdata.po | 11 +- library/netrc.po | 6 +- library/nis.po | 12 +- library/nntplib.po | 85 +- library/numbers.po | 105 +- library/numeric.po | 11 +- library/operator.po | 55 +- library/optparse.po | 723 +- library/os.path.po | 91 +- library/os.po | 212 +- library/ossaudiodev.po | 39 +- library/pathlib.po | 2152 +++-- library/pdb.po | 298 +- library/persistence.po | 11 +- library/pickle.po | 366 +- library/pickletools.po | 27 +- library/pipes.po | 27 +- library/pkgutil.po | 40 +- library/platform.po | 27 +- library/plistlib.po | 53 +- library/poplib.po | 36 +- library/posix.po | 25 +- library/pprint.po | 452 +- library/profile.po | 167 +- library/pty.po | 45 +- library/pwd.po | 34 +- library/py_compile.po | 7 +- library/pyclbr.po | 12 +- library/pydoc.po | 11 +- library/pyexpat.po | 75 +- library/python.po | 11 +- library/queue.po | 48 +- library/quopri.po | 11 +- library/random.po | 214 +- library/re.po | 846 +- library/readline.po | 189 +- library/reprlib.po | 106 +- library/resource.po | 30 +- library/rlcompleter.po | 21 +- library/runpy.po | 39 +- library/sched.po | 43 +- library/secrets.po | 67 +- library/security_warnings.po | 10 +- library/select.po | 14 +- library/selectors.po | 63 +- library/shelve.po | 54 +- library/shlex.po | 43 +- library/shutil.po | 115 +- library/signal.po | 116 +- library/site.po | 38 +- library/smtplib.po | 69 +- library/sndhdr.po | 26 +- library/socket.po | 782 +- library/socketserver.po | 225 +- library/spwd.po | 18 +- library/sqlite3.po | 680 +- library/ssl.po | 872 +- library/stat.po | 41 +- library/statistics.po | 657 +- library/stdtypes.po | 3111 ++++-- library/string.po | 205 +- library/stringprep.po | 10 +- library/struct.po | 122 +- library/subprocess.po | 284 +- library/sunau.po | 16 +- library/superseded.po | 11 +- library/symtable.po | 82 +- library/sys.monitoring.po | 56 +- library/sys.po | 137 +- library/sys_path_init.po | 7 +- library/sysconfig.po | 59 +- library/syslog.po | 47 +- library/tabnanny.po | 13 +- library/tarfile.po | 171 +- library/telnetlib.po | 50 +- library/tempfile.po | 69 +- library/termios.po | 29 +- library/test.po | 246 +- library/text.po | 11 +- library/textwrap.po | 78 +- library/threading.po | 435 +- library/time.po | 99 +- library/timeit.po | 158 +- library/tk.po | 11 +- library/tkinter.colorchooser.po | 10 +- library/tkinter.dnd.po | 10 +- library/tkinter.font.po | 10 +- library/tkinter.messagebox.po | 11 +- library/tkinter.po | 195 +- library/tkinter.scrolledtext.po | 10 +- library/tkinter.tix.po | 33 +- library/tkinter.ttk.po | 190 +- library/token.po | 16 +- library/tokenize.po | 152 +- library/tomllib.po | 34 +- library/trace.po | 36 +- library/traceback.po | 319 +- library/tracemalloc.po | 257 +- library/tty.po | 6 +- library/turtle.po | 975 +- library/types.po | 72 +- library/typing.po | 2876 ++++-- library/unicodedata.po | 9 +- library/unittest.mock-examples.po | 295 +- library/unittest.mock.po | 1183 ++- library/unittest.po | 506 +- library/unix.po | 12 +- library/urllib.error.po | 10 +- library/urllib.parse.po | 91 +- library/urllib.po | 11 +- library/urllib.request.po | 185 +- library/urllib.robotparser.po | 31 +- library/uu.po | 13 +- library/uuid.po | 79 +- library/venv.po | 294 +- library/warnings.po | 120 +- library/wave.po | 12 +- library/weakref.po | 177 +- library/webbrowser.po | 57 +- library/windows.po | 11 +- library/winreg.po | 29 +- library/winsound.po | 24 +- library/wsgiref.po | 170 +- library/xdrlib.po | 27 +- library/xml.dom.minidom.po | 116 +- library/xml.dom.po | 22 +- library/xml.dom.pulldom.po | 53 +- library/xml.etree.elementtree.po | 619 +- library/xml.po | 9 +- library/xml.sax.handler.po | 11 +- library/xml.sax.po | 11 +- library/xml.sax.reader.po | 11 +- library/xml.sax.utils.po | 16 +- library/xmlrpc.client.po | 218 +- library/xmlrpc.po | 10 +- library/xmlrpc.server.po | 160 +- library/zipapp.po | 71 +- library/zipfile.po | 68 +- library/zipimport.po | 31 +- library/zlib.po | 12 +- library/zoneinfo.po | 96 +- license.po | 1008 +- potodo.md | 409 + reference/compound_stmts.po | 1348 ++- reference/datamodel.po | 2026 ++-- reference/executionmodel.po | 68 +- reference/expressions.po | 1413 +-- reference/grammar.po | 1743 +++- reference/import.po | 103 +- reference/index.po | 11 +- reference/introduction.po | 12 +- reference/lexical_analysis.po | 578 +- reference/simple_stmts.po | 597 +- reference/toplevel_components.po | 14 +- sphinx.po | 250 +- stats.json | 1 + tutorial/appendix.po | 33 +- tutorial/appetite.po | 12 +- tutorial/classes.po | 587 +- tutorial/controlflow.po | 659 +- tutorial/datastructures.po | 421 +- tutorial/errors.po | 418 +- tutorial/floatingpoint.po | 217 +- tutorial/index.po | 13 +- tutorial/inputoutput.po | 455 +- tutorial/interactive.po | 13 +- tutorial/interpreter.po | 69 +- tutorial/introduction.po | 413 +- tutorial/modules.po | 288 +- tutorial/stdlib.po | 226 +- tutorial/stdlib2.po | 311 +- tutorial/venv.po | 137 +- tutorial/whatnow.po | 9 +- using/cmdline.po | 330 +- using/configure.po | 63 +- using/editors.po | 12 +- using/index.po | 10 +- using/mac.po | 7 +- using/unix.po | 76 +- using/windows.po | 173 +- whatsnew/2.0.po | 243 +- whatsnew/2.1.po | 182 +- whatsnew/2.2.po | 336 +- whatsnew/2.3.po | 716 +- whatsnew/2.4.po | 568 +- whatsnew/2.5.po | 673 +- whatsnew/2.6.po | 931 +- whatsnew/2.7.po | 535 +- whatsnew/3.0.po | 58 +- whatsnew/3.1.po | 236 +- whatsnew/3.10.po | 493 +- whatsnew/3.11.po | 1496 +-- whatsnew/3.12.po | 2211 +++-- whatsnew/3.2.po | 821 +- whatsnew/3.3.po | 299 +- whatsnew/3.4.po | 147 +- whatsnew/3.5.po | 424 +- whatsnew/3.6.po | 278 +- whatsnew/3.7.po | 77 +- whatsnew/3.8.po | 555 +- whatsnew/3.9.po | 191 +- whatsnew/changelog.po | 11 +- whatsnew/index.po | 7 +- 498 files changed, 87811 insertions(+), 20244 deletions(-) create mode 100644 deprecations/c-api-pending-removal-in-3.14.po create mode 100644 deprecations/c-api-pending-removal-in-3.15.po create mode 100644 deprecations/c-api-pending-removal-in-future.po create mode 100644 deprecations/index.po create mode 100644 deprecations/pending-removal-in-3.13.po create mode 100644 deprecations/pending-removal-in-3.14.po create mode 100644 deprecations/pending-removal-in-3.15.po create mode 100644 deprecations/pending-removal-in-3.16.po create mode 100644 deprecations/pending-removal-in-future.po create mode 100644 potodo.md create mode 100644 stats.json diff --git a/.tx/config b/.tx/config index 7719a8d1b..6a90418d0 100644 --- a/.tx/config +++ b/.tx/config @@ -1,3405 +1,4953 @@ [main] host = https://www.transifex.com -[o:python-doc:p:python-newest:r:about] -file_filter = .//LC_MESSAGES/about.po -trans.pt_BR = about.po -source_file = /pot/about.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:bugs] -file_filter = .//LC_MESSAGES/bugs.po -trans.pt_BR = bugs.po -source_file = /pot/bugs.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--abstract] -file_filter = .//LC_MESSAGES/c-api/abstract.po -trans.pt_BR = c-api/abstract.po -source_file = /pot/c-api/abstract.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--allocation] -file_filter = .//LC_MESSAGES/c-api/allocation.po -trans.pt_BR = c-api/allocation.po -source_file = /pot/c-api/allocation.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--apiabiversion] -file_filter = .//LC_MESSAGES/c-api/apiabiversion.po -trans.pt_BR = c-api/apiabiversion.po -source_file = /pot/c-api/apiabiversion.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--arg] -file_filter = .//LC_MESSAGES/c-api/arg.po -trans.pt_BR = c-api/arg.po -source_file = /pot/c-api/arg.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--bool] -file_filter = .//LC_MESSAGES/c-api/bool.po -trans.pt_BR = c-api/bool.po -source_file = /pot/c-api/bool.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--buffer] -file_filter = .//LC_MESSAGES/c-api/buffer.po -trans.pt_BR = c-api/buffer.po -source_file = /pot/c-api/buffer.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--bytearray] -file_filter = .//LC_MESSAGES/c-api/bytearray.po -trans.pt_BR = c-api/bytearray.po -source_file = /pot/c-api/bytearray.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--bytes] -file_filter = .//LC_MESSAGES/c-api/bytes.po -trans.pt_BR = c-api/bytes.po -source_file = /pot/c-api/bytes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--call] -file_filter = .//LC_MESSAGES/c-api/call.po -trans.pt_BR = c-api/call.po -source_file = /pot/c-api/call.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--capsule] -file_filter = .//LC_MESSAGES/c-api/capsule.po -trans.pt_BR = c-api/capsule.po -source_file = /pot/c-api/capsule.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--cell] -file_filter = .//LC_MESSAGES/c-api/cell.po -trans.pt_BR = c-api/cell.po -source_file = /pot/c-api/cell.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--code] -file_filter = .//LC_MESSAGES/c-api/code.po -trans.pt_BR = c-api/code.po -source_file = /pot/c-api/code.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--codec] -file_filter = .//LC_MESSAGES/c-api/codec.po -trans.pt_BR = c-api/codec.po -source_file = /pot/c-api/codec.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--complex] -file_filter = .//LC_MESSAGES/c-api/complex.po -trans.pt_BR = c-api/complex.po -source_file = /pot/c-api/complex.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--concrete] -file_filter = .//LC_MESSAGES/c-api/concrete.po -trans.pt_BR = c-api/concrete.po -source_file = /pot/c-api/concrete.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--contextvars] -file_filter = .//LC_MESSAGES/c-api/contextvars.po -trans.pt_BR = c-api/contextvars.po -source_file = /pot/c-api/contextvars.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--conversion] -file_filter = .//LC_MESSAGES/c-api/conversion.po -trans.pt_BR = c-api/conversion.po -source_file = /pot/c-api/conversion.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--coro] -file_filter = .//LC_MESSAGES/c-api/coro.po -trans.pt_BR = c-api/coro.po -source_file = /pot/c-api/coro.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--datetime] -file_filter = .//LC_MESSAGES/c-api/datetime.po -trans.pt_BR = c-api/datetime.po -source_file = /pot/c-api/datetime.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--descriptor] -file_filter = .//LC_MESSAGES/c-api/descriptor.po -trans.pt_BR = c-api/descriptor.po -source_file = /pot/c-api/descriptor.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--dict] -file_filter = .//LC_MESSAGES/c-api/dict.po -trans.pt_BR = c-api/dict.po -source_file = /pot/c-api/dict.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--exceptions] -file_filter = .//LC_MESSAGES/c-api/exceptions.po -trans.pt_BR = c-api/exceptions.po -source_file = /pot/c-api/exceptions.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--file] -file_filter = .//LC_MESSAGES/c-api/file.po -trans.pt_BR = c-api/file.po -source_file = /pot/c-api/file.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--float] -file_filter = .//LC_MESSAGES/c-api/float.po -trans.pt_BR = c-api/float.po -source_file = /pot/c-api/float.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--frame] -file_filter = .//LC_MESSAGES/c-api/frame.po -trans.pt_BR = c-api/frame.po -source_file = /pot/c-api/frame.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--function] -file_filter = .//LC_MESSAGES/c-api/function.po -trans.pt_BR = c-api/function.po -source_file = /pot/c-api/function.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--gcsupport] -file_filter = .//LC_MESSAGES/c-api/gcsupport.po -trans.pt_BR = c-api/gcsupport.po -source_file = /pot/c-api/gcsupport.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--gen] -file_filter = .//LC_MESSAGES/c-api/gen.po -trans.pt_BR = c-api/gen.po -source_file = /pot/c-api/gen.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--hash] -file_filter = .//LC_MESSAGES/c-api/hash.po -trans.pt_BR = c-api/hash.po -source_file = /pot/c-api/hash.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--import] -file_filter = .//LC_MESSAGES/c-api/import.po -trans.pt_BR = c-api/import.po -source_file = /pot/c-api/import.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--index] -file_filter = .//LC_MESSAGES/c-api/index.po -trans.pt_BR = c-api/index.po -source_file = /pot/c-api/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--init] -file_filter = .//LC_MESSAGES/c-api/init.po -trans.pt_BR = c-api/init.po -source_file = /pot/c-api/init.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--init_config] -file_filter = .//LC_MESSAGES/c-api/init_config.po -trans.pt_BR = c-api/init_config.po -source_file = /pot/c-api/init_config.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--intro] -file_filter = .//LC_MESSAGES/c-api/intro.po -trans.pt_BR = c-api/intro.po -source_file = /pot/c-api/intro.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--iter] -file_filter = .//LC_MESSAGES/c-api/iter.po -trans.pt_BR = c-api/iter.po -source_file = /pot/c-api/iter.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--iterator] -file_filter = .//LC_MESSAGES/c-api/iterator.po -trans.pt_BR = c-api/iterator.po -source_file = /pot/c-api/iterator.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--list] -file_filter = .//LC_MESSAGES/c-api/list.po -trans.pt_BR = c-api/list.po -source_file = /pot/c-api/list.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--long] -file_filter = .//LC_MESSAGES/c-api/long.po -trans.pt_BR = c-api/long.po -source_file = /pot/c-api/long.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--mapping] -file_filter = .//LC_MESSAGES/c-api/mapping.po -trans.pt_BR = c-api/mapping.po -source_file = /pot/c-api/mapping.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--marshal] -file_filter = .//LC_MESSAGES/c-api/marshal.po -trans.pt_BR = c-api/marshal.po -source_file = /pot/c-api/marshal.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--memory] -file_filter = .//LC_MESSAGES/c-api/memory.po -trans.pt_BR = c-api/memory.po -source_file = /pot/c-api/memory.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--memoryview] -file_filter = .//LC_MESSAGES/c-api/memoryview.po -trans.pt_BR = c-api/memoryview.po -source_file = /pot/c-api/memoryview.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--method] -file_filter = .//LC_MESSAGES/c-api/method.po -trans.pt_BR = c-api/method.po -source_file = /pot/c-api/method.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--module] -file_filter = .//LC_MESSAGES/c-api/module.po -trans.pt_BR = c-api/module.po -source_file = /pot/c-api/module.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--none] -file_filter = .//LC_MESSAGES/c-api/none.po -trans.pt_BR = c-api/none.po -source_file = /pot/c-api/none.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--number] -file_filter = .//LC_MESSAGES/c-api/number.po -trans.pt_BR = c-api/number.po -source_file = /pot/c-api/number.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--objbuffer] -file_filter = .//LC_MESSAGES/c-api/objbuffer.po -trans.pt_BR = c-api/objbuffer.po -source_file = /pot/c-api/objbuffer.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--object] -file_filter = .//LC_MESSAGES/c-api/object.po -trans.pt_BR = c-api/object.po -source_file = /pot/c-api/object.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--objimpl] -file_filter = .//LC_MESSAGES/c-api/objimpl.po -trans.pt_BR = c-api/objimpl.po -source_file = /pot/c-api/objimpl.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--perfmaps] -file_filter = .//LC_MESSAGES/c-api/perfmaps.po -trans.pt_BR = c-api/perfmaps.po -source_file = /pot/c-api/perfmaps.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--refcounting] -file_filter = .//LC_MESSAGES/c-api/refcounting.po -trans.pt_BR = c-api/refcounting.po -source_file = /pot/c-api/refcounting.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--reflection] -file_filter = .//LC_MESSAGES/c-api/reflection.po -trans.pt_BR = c-api/reflection.po -source_file = /pot/c-api/reflection.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--sequence] -file_filter = .//LC_MESSAGES/c-api/sequence.po -trans.pt_BR = c-api/sequence.po -source_file = /pot/c-api/sequence.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--set] -file_filter = .//LC_MESSAGES/c-api/set.po -trans.pt_BR = c-api/set.po -source_file = /pot/c-api/set.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--slice] -file_filter = .//LC_MESSAGES/c-api/slice.po -trans.pt_BR = c-api/slice.po -source_file = /pot/c-api/slice.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--stable] -file_filter = .//LC_MESSAGES/c-api/stable.po -trans.pt_BR = c-api/stable.po -source_file = /pot/c-api/stable.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--structures] -file_filter = .//LC_MESSAGES/c-api/structures.po -trans.pt_BR = c-api/structures.po -source_file = /pot/c-api/structures.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--sys] -file_filter = .//LC_MESSAGES/c-api/sys.po -trans.pt_BR = c-api/sys.po -source_file = /pot/c-api/sys.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--tuple] -file_filter = .//LC_MESSAGES/c-api/tuple.po -trans.pt_BR = c-api/tuple.po -source_file = /pot/c-api/tuple.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--type] -file_filter = .//LC_MESSAGES/c-api/type.po -trans.pt_BR = c-api/type.po -source_file = /pot/c-api/type.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--typehints] -file_filter = .//LC_MESSAGES/c-api/typehints.po -trans.pt_BR = c-api/typehints.po -source_file = /pot/c-api/typehints.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--typeobj] -file_filter = .//LC_MESSAGES/c-api/typeobj.po -trans.pt_BR = c-api/typeobj.po -source_file = /pot/c-api/typeobj.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--unicode] -file_filter = .//LC_MESSAGES/c-api/unicode.po -trans.pt_BR = c-api/unicode.po -source_file = /pot/c-api/unicode.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--utilities] -file_filter = .//LC_MESSAGES/c-api/utilities.po -trans.pt_BR = c-api/utilities.po -source_file = /pot/c-api/utilities.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--veryhigh] -file_filter = .//LC_MESSAGES/c-api/veryhigh.po -trans.pt_BR = c-api/veryhigh.po -source_file = /pot/c-api/veryhigh.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:c-api--weakref] -file_filter = .//LC_MESSAGES/c-api/weakref.po -trans.pt_BR = c-api/weakref.po -source_file = /pot/c-api/weakref.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:contents] -file_filter = .//LC_MESSAGES/contents.po -trans.pt_BR = contents.po -source_file = /pot/contents.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:copyright] -file_filter = .//LC_MESSAGES/copyright.po -trans.pt_BR = copyright.po -source_file = /pot/copyright.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:distributing--index] -file_filter = .//LC_MESSAGES/distributing/index.po -trans.pt_BR = distributing/index.po -source_file = /pot/distributing/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:extending--building] -file_filter = .//LC_MESSAGES/extending/building.po -trans.pt_BR = extending/building.po -source_file = /pot/extending/building.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:extending--embedding] -file_filter = .//LC_MESSAGES/extending/embedding.po -trans.pt_BR = extending/embedding.po -source_file = /pot/extending/embedding.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:extending--extending] -file_filter = .//LC_MESSAGES/extending/extending.po -trans.pt_BR = extending/extending.po -source_file = /pot/extending/extending.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:extending--index] -file_filter = .//LC_MESSAGES/extending/index.po -trans.pt_BR = extending/index.po -source_file = /pot/extending/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:extending--newtypes] -file_filter = .//LC_MESSAGES/extending/newtypes.po -trans.pt_BR = extending/newtypes.po -source_file = /pot/extending/newtypes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:extending--newtypes_tutorial] -file_filter = .//LC_MESSAGES/extending/newtypes_tutorial.po -trans.pt_BR = extending/newtypes_tutorial.po -source_file = /pot/extending/newtypes_tutorial.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:extending--windows] -file_filter = .//LC_MESSAGES/extending/windows.po -trans.pt_BR = extending/windows.po -source_file = /pot/extending/windows.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--design] -file_filter = .//LC_MESSAGES/faq/design.po -trans.pt_BR = faq/design.po -source_file = /pot/faq/design.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--extending] -file_filter = .//LC_MESSAGES/faq/extending.po -trans.pt_BR = faq/extending.po -source_file = /pot/faq/extending.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--general] -file_filter = .//LC_MESSAGES/faq/general.po -trans.pt_BR = faq/general.po -source_file = /pot/faq/general.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--gui] -file_filter = .//LC_MESSAGES/faq/gui.po -trans.pt_BR = faq/gui.po -source_file = /pot/faq/gui.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--index] -file_filter = .//LC_MESSAGES/faq/index.po -trans.pt_BR = faq/index.po -source_file = /pot/faq/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--installed] -file_filter = .//LC_MESSAGES/faq/installed.po -trans.pt_BR = faq/installed.po -source_file = /pot/faq/installed.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--library] -file_filter = .//LC_MESSAGES/faq/library.po -trans.pt_BR = faq/library.po -source_file = /pot/faq/library.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--programming] -file_filter = .//LC_MESSAGES/faq/programming.po -trans.pt_BR = faq/programming.po -source_file = /pot/faq/programming.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:faq--windows] -file_filter = .//LC_MESSAGES/faq/windows.po -trans.pt_BR = faq/windows.po -source_file = /pot/faq/windows.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:glossary_] -file_filter = .//LC_MESSAGES/glossary.po -trans.pt_BR = glossary.po -source_file = /pot/glossary.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--annotations] -file_filter = .//LC_MESSAGES/howto/annotations.po -trans.pt_BR = howto/annotations.po -source_file = /pot/howto/annotations.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--argparse] -file_filter = .//LC_MESSAGES/howto/argparse.po -trans.pt_BR = howto/argparse.po -source_file = /pot/howto/argparse.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--clinic] -file_filter = .//LC_MESSAGES/howto/clinic.po -trans.pt_BR = howto/clinic.po -source_file = /pot/howto/clinic.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--cporting] -file_filter = .//LC_MESSAGES/howto/cporting.po -trans.pt_BR = howto/cporting.po -source_file = /pot/howto/cporting.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--curses] -file_filter = .//LC_MESSAGES/howto/curses.po -trans.pt_BR = howto/curses.po -source_file = /pot/howto/curses.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--descriptor] -file_filter = .//LC_MESSAGES/howto/descriptor.po -trans.pt_BR = howto/descriptor.po -source_file = /pot/howto/descriptor.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--enum] -file_filter = .//LC_MESSAGES/howto/enum.po -trans.pt_BR = howto/enum.po -source_file = /pot/howto/enum.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--functional] -file_filter = .//LC_MESSAGES/howto/functional.po -trans.pt_BR = howto/functional.po -source_file = /pot/howto/functional.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--gdb_helpers] -file_filter = .//LC_MESSAGES/howto/gdb_helpers.po -trans.pt_BR = howto/gdb_helpers.po -source_file = /pot/howto/gdb_helpers.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--index] -file_filter = .//LC_MESSAGES/howto/index.po -trans.pt_BR = howto/index.po -source_file = /pot/howto/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--instrumentation] -file_filter = .//LC_MESSAGES/howto/instrumentation.po -trans.pt_BR = howto/instrumentation.po -source_file = /pot/howto/instrumentation.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--ipaddress] -file_filter = .//LC_MESSAGES/howto/ipaddress.po -trans.pt_BR = howto/ipaddress.po -source_file = /pot/howto/ipaddress.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--isolating-extensions] -file_filter = .//LC_MESSAGES/howto/isolating-extensions.po -trans.pt_BR = howto/isolating-extensions.po -source_file = /pot/howto/isolating-extensions.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--logging] -file_filter = .//LC_MESSAGES/howto/logging.po -trans.pt_BR = howto/logging.po -source_file = /pot/howto/logging.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--logging-cookbook] -file_filter = .//LC_MESSAGES/howto/logging-cookbook.po -trans.pt_BR = howto/logging-cookbook.po -source_file = /pot/howto/logging-cookbook.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--mro] -file_filter = .//LC_MESSAGES/howto/mro.po -trans.pt_BR = howto/mro.po -source_file = /pot/howto/mro.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--perf_profiling] -file_filter = .//LC_MESSAGES/howto/perf_profiling.po -trans.pt_BR = howto/perf_profiling.po -source_file = /pot/howto/perf_profiling.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--pyporting] -file_filter = .//LC_MESSAGES/howto/pyporting.po -trans.pt_BR = howto/pyporting.po -source_file = /pot/howto/pyporting.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--regex] -file_filter = .//LC_MESSAGES/howto/regex.po -trans.pt_BR = howto/regex.po -source_file = /pot/howto/regex.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--sockets] -file_filter = .//LC_MESSAGES/howto/sockets.po -trans.pt_BR = howto/sockets.po -source_file = /pot/howto/sockets.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--sorting] -file_filter = .//LC_MESSAGES/howto/sorting.po -trans.pt_BR = howto/sorting.po -source_file = /pot/howto/sorting.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--unicode] -file_filter = .//LC_MESSAGES/howto/unicode.po -trans.pt_BR = howto/unicode.po -source_file = /pot/howto/unicode.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:howto--urllib2] -file_filter = .//LC_MESSAGES/howto/urllib2.po -trans.pt_BR = howto/urllib2.po -source_file = /pot/howto/urllib2.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:installing--index] -file_filter = .//LC_MESSAGES/installing/index.po -trans.pt_BR = installing/index.po -source_file = /pot/installing/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--2to3] -file_filter = .//LC_MESSAGES/library/2to3.po -trans.pt_BR = library/2to3.po -source_file = /pot/library/2to3.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--__future__] -file_filter = .//LC_MESSAGES/library/__future__.po -trans.pt_BR = library/__future__.po -source_file = /pot/library/__future__.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--__main__] -file_filter = .//LC_MESSAGES/library/__main__.po -trans.pt_BR = library/__main__.po -source_file = /pot/library/__main__.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--_thread] -file_filter = .//LC_MESSAGES/library/_thread.po -trans.pt_BR = library/_thread.po -source_file = /pot/library/_thread.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--abc] -file_filter = .//LC_MESSAGES/library/abc.po -trans.pt_BR = library/abc.po -source_file = /pot/library/abc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--aifc] -file_filter = .//LC_MESSAGES/library/aifc.po -trans.pt_BR = library/aifc.po -source_file = /pot/library/aifc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--allos] -file_filter = .//LC_MESSAGES/library/allos.po -trans.pt_BR = library/allos.po -source_file = /pot/library/allos.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--archiving] -file_filter = .//LC_MESSAGES/library/archiving.po -trans.pt_BR = library/archiving.po -source_file = /pot/library/archiving.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--argparse] -file_filter = .//LC_MESSAGES/library/argparse.po -trans.pt_BR = library/argparse.po -source_file = /pot/library/argparse.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--array] -file_filter = .//LC_MESSAGES/library/array.po -trans.pt_BR = library/array.po -source_file = /pot/library/array.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ast] -file_filter = .//LC_MESSAGES/library/ast.po -trans.pt_BR = library/ast.po -source_file = /pot/library/ast.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio] -file_filter = .//LC_MESSAGES/library/asyncio.po -trans.pt_BR = library/asyncio.po -source_file = /pot/library/asyncio.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-api-index] -file_filter = .//LC_MESSAGES/library/asyncio-api-index.po -trans.pt_BR = library/asyncio-api-index.po -source_file = /pot/library/asyncio-api-index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-dev] -file_filter = .//LC_MESSAGES/library/asyncio-dev.po -trans.pt_BR = library/asyncio-dev.po -source_file = /pot/library/asyncio-dev.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-eventloop] -file_filter = .//LC_MESSAGES/library/asyncio-eventloop.po -trans.pt_BR = library/asyncio-eventloop.po -source_file = /pot/library/asyncio-eventloop.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-exceptions] -file_filter = .//LC_MESSAGES/library/asyncio-exceptions.po -trans.pt_BR = library/asyncio-exceptions.po -source_file = /pot/library/asyncio-exceptions.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-extending] -file_filter = .//LC_MESSAGES/library/asyncio-extending.po -trans.pt_BR = library/asyncio-extending.po -source_file = /pot/library/asyncio-extending.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-future] -file_filter = .//LC_MESSAGES/library/asyncio-future.po -trans.pt_BR = library/asyncio-future.po -source_file = /pot/library/asyncio-future.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-llapi-index] -file_filter = .//LC_MESSAGES/library/asyncio-llapi-index.po -trans.pt_BR = library/asyncio-llapi-index.po -source_file = /pot/library/asyncio-llapi-index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-platforms] -file_filter = .//LC_MESSAGES/library/asyncio-platforms.po -trans.pt_BR = library/asyncio-platforms.po -source_file = /pot/library/asyncio-platforms.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-policy] -file_filter = .//LC_MESSAGES/library/asyncio-policy.po -trans.pt_BR = library/asyncio-policy.po -source_file = /pot/library/asyncio-policy.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-protocol] -file_filter = .//LC_MESSAGES/library/asyncio-protocol.po -trans.pt_BR = library/asyncio-protocol.po -source_file = /pot/library/asyncio-protocol.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-queue] -file_filter = .//LC_MESSAGES/library/asyncio-queue.po -trans.pt_BR = library/asyncio-queue.po -source_file = /pot/library/asyncio-queue.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-runner] -file_filter = .//LC_MESSAGES/library/asyncio-runner.po -trans.pt_BR = library/asyncio-runner.po -source_file = /pot/library/asyncio-runner.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-stream] -file_filter = .//LC_MESSAGES/library/asyncio-stream.po -trans.pt_BR = library/asyncio-stream.po -source_file = /pot/library/asyncio-stream.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-subprocess] -file_filter = .//LC_MESSAGES/library/asyncio-subprocess.po -trans.pt_BR = library/asyncio-subprocess.po -source_file = /pot/library/asyncio-subprocess.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-sync] -file_filter = .//LC_MESSAGES/library/asyncio-sync.po -trans.pt_BR = library/asyncio-sync.po -source_file = /pot/library/asyncio-sync.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--asyncio-task] -file_filter = .//LC_MESSAGES/library/asyncio-task.po -trans.pt_BR = library/asyncio-task.po -source_file = /pot/library/asyncio-task.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--atexit] -file_filter = .//LC_MESSAGES/library/atexit.po -trans.pt_BR = library/atexit.po -source_file = /pot/library/atexit.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--audioop] -file_filter = .//LC_MESSAGES/library/audioop.po -trans.pt_BR = library/audioop.po -source_file = /pot/library/audioop.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--audit_events] -file_filter = .//LC_MESSAGES/library/audit_events.po -trans.pt_BR = library/audit_events.po -source_file = /pot/library/audit_events.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--base64] -file_filter = .//LC_MESSAGES/library/base64.po -trans.pt_BR = library/base64.po -source_file = /pot/library/base64.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--bdb] -file_filter = .//LC_MESSAGES/library/bdb.po -trans.pt_BR = library/bdb.po -source_file = /pot/library/bdb.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--binary] -file_filter = .//LC_MESSAGES/library/binary.po -trans.pt_BR = library/binary.po -source_file = /pot/library/binary.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--binascii] -file_filter = .//LC_MESSAGES/library/binascii.po -trans.pt_BR = library/binascii.po -source_file = /pot/library/binascii.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--bisect] -file_filter = .//LC_MESSAGES/library/bisect.po -trans.pt_BR = library/bisect.po -source_file = /pot/library/bisect.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--builtins] -file_filter = .//LC_MESSAGES/library/builtins.po -trans.pt_BR = library/builtins.po -source_file = /pot/library/builtins.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--bz2] -file_filter = .//LC_MESSAGES/library/bz2.po -trans.pt_BR = library/bz2.po -source_file = /pot/library/bz2.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--calendar] -file_filter = .//LC_MESSAGES/library/calendar.po -trans.pt_BR = library/calendar.po -source_file = /pot/library/calendar.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--cgi] -file_filter = .//LC_MESSAGES/library/cgi.po -trans.pt_BR = library/cgi.po -source_file = /pot/library/cgi.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--cgitb] -file_filter = .//LC_MESSAGES/library/cgitb.po -trans.pt_BR = library/cgitb.po -source_file = /pot/library/cgitb.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--chunk] -file_filter = .//LC_MESSAGES/library/chunk.po -trans.pt_BR = library/chunk.po -source_file = /pot/library/chunk.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--cmath] -file_filter = .//LC_MESSAGES/library/cmath.po -trans.pt_BR = library/cmath.po -source_file = /pot/library/cmath.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--cmd] -file_filter = .//LC_MESSAGES/library/cmd.po -trans.pt_BR = library/cmd.po -source_file = /pot/library/cmd.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--cmdline] -file_filter = .//LC_MESSAGES/library/cmdline.po -trans.pt_BR = library/cmdline.po -source_file = /pot/library/cmdline.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--code] -file_filter = .//LC_MESSAGES/library/code.po -trans.pt_BR = library/code.po -source_file = /pot/library/code.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--codecs] -file_filter = .//LC_MESSAGES/library/codecs.po -trans.pt_BR = library/codecs.po -source_file = /pot/library/codecs.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--codeop] -file_filter = .//LC_MESSAGES/library/codeop.po -trans.pt_BR = library/codeop.po -source_file = /pot/library/codeop.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--collections] -file_filter = .//LC_MESSAGES/library/collections.po -trans.pt_BR = library/collections.po -source_file = /pot/library/collections.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--collections_abc] -file_filter = .//LC_MESSAGES/library/collections.abc.po -trans.pt_BR = library/collections.abc.po -source_file = /pot/library/collections.abc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--colorsys] -file_filter = .//LC_MESSAGES/library/colorsys.po -trans.pt_BR = library/colorsys.po -source_file = /pot/library/colorsys.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--compileall] -file_filter = .//LC_MESSAGES/library/compileall.po -trans.pt_BR = library/compileall.po -source_file = /pot/library/compileall.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--concurrency] -file_filter = .//LC_MESSAGES/library/concurrency.po -trans.pt_BR = library/concurrency.po -source_file = /pot/library/concurrency.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--concurrent] -file_filter = .//LC_MESSAGES/library/concurrent.po -trans.pt_BR = library/concurrent.po -source_file = /pot/library/concurrent.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--concurrent_futures] -file_filter = .//LC_MESSAGES/library/concurrent.futures.po -trans.pt_BR = library/concurrent.futures.po -source_file = /pot/library/concurrent.futures.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--configparser] -file_filter = .//LC_MESSAGES/library/configparser.po -trans.pt_BR = library/configparser.po -source_file = /pot/library/configparser.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--constants] -file_filter = .//LC_MESSAGES/library/constants.po -trans.pt_BR = library/constants.po -source_file = /pot/library/constants.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--contextlib] -file_filter = .//LC_MESSAGES/library/contextlib.po -trans.pt_BR = library/contextlib.po -source_file = /pot/library/contextlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--contextvars] -file_filter = .//LC_MESSAGES/library/contextvars.po -trans.pt_BR = library/contextvars.po -source_file = /pot/library/contextvars.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--copy] -file_filter = .//LC_MESSAGES/library/copy.po -trans.pt_BR = library/copy.po -source_file = /pot/library/copy.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--copyreg] -file_filter = .//LC_MESSAGES/library/copyreg.po -trans.pt_BR = library/copyreg.po -source_file = /pot/library/copyreg.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--crypt] -file_filter = .//LC_MESSAGES/library/crypt.po -trans.pt_BR = library/crypt.po -source_file = /pot/library/crypt.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--crypto] -file_filter = .//LC_MESSAGES/library/crypto.po -trans.pt_BR = library/crypto.po -source_file = /pot/library/crypto.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--csv] -file_filter = .//LC_MESSAGES/library/csv.po -trans.pt_BR = library/csv.po -source_file = /pot/library/csv.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ctypes] -file_filter = .//LC_MESSAGES/library/ctypes.po -trans.pt_BR = library/ctypes.po -source_file = /pot/library/ctypes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--curses] -file_filter = .//LC_MESSAGES/library/curses.po -trans.pt_BR = library/curses.po -source_file = /pot/library/curses.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--curses_ascii] -file_filter = .//LC_MESSAGES/library/curses.ascii.po -trans.pt_BR = library/curses.ascii.po -source_file = /pot/library/curses.ascii.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--curses_panel] -file_filter = .//LC_MESSAGES/library/curses.panel.po -trans.pt_BR = library/curses.panel.po -source_file = /pot/library/curses.panel.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--custominterp] -file_filter = .//LC_MESSAGES/library/custominterp.po -trans.pt_BR = library/custominterp.po -source_file = /pot/library/custominterp.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--dataclasses] -file_filter = .//LC_MESSAGES/library/dataclasses.po -trans.pt_BR = library/dataclasses.po -source_file = /pot/library/dataclasses.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--datatypes] -file_filter = .//LC_MESSAGES/library/datatypes.po -trans.pt_BR = library/datatypes.po -source_file = /pot/library/datatypes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--datetime] -file_filter = .//LC_MESSAGES/library/datetime.po -trans.pt_BR = library/datetime.po -source_file = /pot/library/datetime.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--dbm] -file_filter = .//LC_MESSAGES/library/dbm.po -trans.pt_BR = library/dbm.po -source_file = /pot/library/dbm.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--debug] -file_filter = .//LC_MESSAGES/library/debug.po -trans.pt_BR = library/debug.po -source_file = /pot/library/debug.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--decimal] -file_filter = .//LC_MESSAGES/library/decimal.po -trans.pt_BR = library/decimal.po -source_file = /pot/library/decimal.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--development] -file_filter = .//LC_MESSAGES/library/development.po -trans.pt_BR = library/development.po -source_file = /pot/library/development.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--devmode] -file_filter = .//LC_MESSAGES/library/devmode.po -trans.pt_BR = library/devmode.po -source_file = /pot/library/devmode.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--dialog] -file_filter = .//LC_MESSAGES/library/dialog.po -trans.pt_BR = library/dialog.po -source_file = /pot/library/dialog.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--difflib] -file_filter = .//LC_MESSAGES/library/difflib.po -trans.pt_BR = library/difflib.po -source_file = /pot/library/difflib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--dis] -file_filter = .//LC_MESSAGES/library/dis.po -trans.pt_BR = library/dis.po -source_file = /pot/library/dis.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--distribution] -file_filter = .//LC_MESSAGES/library/distribution.po -trans.pt_BR = library/distribution.po -source_file = /pot/library/distribution.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--doctest] -file_filter = .//LC_MESSAGES/library/doctest.po -trans.pt_BR = library/doctest.po -source_file = /pot/library/doctest.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email] -file_filter = .//LC_MESSAGES/library/email.po -trans.pt_BR = library/email.po -source_file = /pot/library/email.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_charset] -file_filter = .//LC_MESSAGES/library/email.charset.po -trans.pt_BR = library/email.charset.po -source_file = /pot/library/email.charset.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_compat32-message] -file_filter = .//LC_MESSAGES/library/email.compat32-message.po -trans.pt_BR = library/email.compat32-message.po -source_file = /pot/library/email.compat32-message.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_contentmanager] -file_filter = .//LC_MESSAGES/library/email.contentmanager.po -trans.pt_BR = library/email.contentmanager.po -source_file = /pot/library/email.contentmanager.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_encoders] -file_filter = .//LC_MESSAGES/library/email.encoders.po -trans.pt_BR = library/email.encoders.po -source_file = /pot/library/email.encoders.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_errors] -file_filter = .//LC_MESSAGES/library/email.errors.po -trans.pt_BR = library/email.errors.po -source_file = /pot/library/email.errors.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_examples] -file_filter = .//LC_MESSAGES/library/email.examples.po -trans.pt_BR = library/email.examples.po -source_file = /pot/library/email.examples.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_generator] -file_filter = .//LC_MESSAGES/library/email.generator.po -trans.pt_BR = library/email.generator.po -source_file = /pot/library/email.generator.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_header] -file_filter = .//LC_MESSAGES/library/email.header.po -trans.pt_BR = library/email.header.po -source_file = /pot/library/email.header.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_headerregistry] -file_filter = .//LC_MESSAGES/library/email.headerregistry.po -trans.pt_BR = library/email.headerregistry.po -source_file = /pot/library/email.headerregistry.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_iterators] -file_filter = .//LC_MESSAGES/library/email.iterators.po -trans.pt_BR = library/email.iterators.po -source_file = /pot/library/email.iterators.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_message] -file_filter = .//LC_MESSAGES/library/email.message.po -trans.pt_BR = library/email.message.po -source_file = /pot/library/email.message.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_mime] -file_filter = .//LC_MESSAGES/library/email.mime.po -trans.pt_BR = library/email.mime.po -source_file = /pot/library/email.mime.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_parser] -file_filter = .//LC_MESSAGES/library/email.parser.po -trans.pt_BR = library/email.parser.po -source_file = /pot/library/email.parser.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_policy] -file_filter = .//LC_MESSAGES/library/email.policy.po -trans.pt_BR = library/email.policy.po -source_file = /pot/library/email.policy.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--email_utils] -file_filter = .//LC_MESSAGES/library/email.utils.po -trans.pt_BR = library/email.utils.po -source_file = /pot/library/email.utils.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ensurepip] -file_filter = .//LC_MESSAGES/library/ensurepip.po -trans.pt_BR = library/ensurepip.po -source_file = /pot/library/ensurepip.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--enum] -file_filter = .//LC_MESSAGES/library/enum.po -trans.pt_BR = library/enum.po -source_file = /pot/library/enum.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--errno] -file_filter = .//LC_MESSAGES/library/errno.po -trans.pt_BR = library/errno.po -source_file = /pot/library/errno.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--exceptions] -file_filter = .//LC_MESSAGES/library/exceptions.po -trans.pt_BR = library/exceptions.po -source_file = /pot/library/exceptions.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--faulthandler] -file_filter = .//LC_MESSAGES/library/faulthandler.po -trans.pt_BR = library/faulthandler.po -source_file = /pot/library/faulthandler.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--fcntl] -file_filter = .//LC_MESSAGES/library/fcntl.po -trans.pt_BR = library/fcntl.po -source_file = /pot/library/fcntl.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--filecmp] -file_filter = .//LC_MESSAGES/library/filecmp.po -trans.pt_BR = library/filecmp.po -source_file = /pot/library/filecmp.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--fileformats] -file_filter = .//LC_MESSAGES/library/fileformats.po -trans.pt_BR = library/fileformats.po -source_file = /pot/library/fileformats.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--fileinput] -file_filter = .//LC_MESSAGES/library/fileinput.po -trans.pt_BR = library/fileinput.po -source_file = /pot/library/fileinput.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--filesys] -file_filter = .//LC_MESSAGES/library/filesys.po -trans.pt_BR = library/filesys.po -source_file = /pot/library/filesys.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--fnmatch] -file_filter = .//LC_MESSAGES/library/fnmatch.po -trans.pt_BR = library/fnmatch.po -source_file = /pot/library/fnmatch.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--fractions] -file_filter = .//LC_MESSAGES/library/fractions.po -trans.pt_BR = library/fractions.po -source_file = /pot/library/fractions.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--frameworks] -file_filter = .//LC_MESSAGES/library/frameworks.po -trans.pt_BR = library/frameworks.po -source_file = /pot/library/frameworks.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ftplib] -file_filter = .//LC_MESSAGES/library/ftplib.po -trans.pt_BR = library/ftplib.po -source_file = /pot/library/ftplib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--functional] -file_filter = .//LC_MESSAGES/library/functional.po -trans.pt_BR = library/functional.po -source_file = /pot/library/functional.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--functions] -file_filter = .//LC_MESSAGES/library/functions.po -trans.pt_BR = library/functions.po -source_file = /pot/library/functions.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--functools] -file_filter = .//LC_MESSAGES/library/functools.po -trans.pt_BR = library/functools.po -source_file = /pot/library/functools.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--gc] -file_filter = .//LC_MESSAGES/library/gc.po -trans.pt_BR = library/gc.po -source_file = /pot/library/gc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--getopt] -file_filter = .//LC_MESSAGES/library/getopt.po -trans.pt_BR = library/getopt.po -source_file = /pot/library/getopt.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--getpass] -file_filter = .//LC_MESSAGES/library/getpass.po -trans.pt_BR = library/getpass.po -source_file = /pot/library/getpass.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--gettext] -file_filter = .//LC_MESSAGES/library/gettext.po -trans.pt_BR = library/gettext.po -source_file = /pot/library/gettext.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--glob] -file_filter = .//LC_MESSAGES/library/glob.po -trans.pt_BR = library/glob.po -source_file = /pot/library/glob.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--graphlib] -file_filter = .//LC_MESSAGES/library/graphlib.po -trans.pt_BR = library/graphlib.po -source_file = /pot/library/graphlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--grp] -file_filter = .//LC_MESSAGES/library/grp.po -trans.pt_BR = library/grp.po -source_file = /pot/library/grp.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--gzip] -file_filter = .//LC_MESSAGES/library/gzip.po -trans.pt_BR = library/gzip.po -source_file = /pot/library/gzip.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--hashlib] -file_filter = .//LC_MESSAGES/library/hashlib.po -trans.pt_BR = library/hashlib.po -source_file = /pot/library/hashlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--heapq] -file_filter = .//LC_MESSAGES/library/heapq.po -trans.pt_BR = library/heapq.po -source_file = /pot/library/heapq.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--hmac] -file_filter = .//LC_MESSAGES/library/hmac.po -trans.pt_BR = library/hmac.po -source_file = /pot/library/hmac.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--html] -file_filter = .//LC_MESSAGES/library/html.po -trans.pt_BR = library/html.po -source_file = /pot/library/html.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--html_entities] -file_filter = .//LC_MESSAGES/library/html.entities.po -trans.pt_BR = library/html.entities.po -source_file = /pot/library/html.entities.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--html_parser] -file_filter = .//LC_MESSAGES/library/html.parser.po -trans.pt_BR = library/html.parser.po -source_file = /pot/library/html.parser.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--http] -file_filter = .//LC_MESSAGES/library/http.po -trans.pt_BR = library/http.po -source_file = /pot/library/http.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--http_client] -file_filter = .//LC_MESSAGES/library/http.client.po -trans.pt_BR = library/http.client.po -source_file = /pot/library/http.client.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--http_cookiejar] -file_filter = .//LC_MESSAGES/library/http.cookiejar.po -trans.pt_BR = library/http.cookiejar.po -source_file = /pot/library/http.cookiejar.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--http_cookies] -file_filter = .//LC_MESSAGES/library/http.cookies.po -trans.pt_BR = library/http.cookies.po -source_file = /pot/library/http.cookies.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--http_server] -file_filter = .//LC_MESSAGES/library/http.server.po -trans.pt_BR = library/http.server.po -source_file = /pot/library/http.server.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--i18n] -file_filter = .//LC_MESSAGES/library/i18n.po -trans.pt_BR = library/i18n.po -source_file = /pot/library/i18n.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--idle] -file_filter = .//LC_MESSAGES/library/idle.po -trans.pt_BR = library/idle.po -source_file = /pot/library/idle.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--imaplib] -file_filter = .//LC_MESSAGES/library/imaplib.po -trans.pt_BR = library/imaplib.po -source_file = /pot/library/imaplib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--imghdr] -file_filter = .//LC_MESSAGES/library/imghdr.po -trans.pt_BR = library/imghdr.po -source_file = /pot/library/imghdr.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--importlib] -file_filter = .//LC_MESSAGES/library/importlib.po -trans.pt_BR = library/importlib.po -source_file = /pot/library/importlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--importlib_metadata] -file_filter = .//LC_MESSAGES/library/importlib.metadata.po -trans.pt_BR = library/importlib.metadata.po -source_file = /pot/library/importlib.metadata.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--importlib_resources] -file_filter = .//LC_MESSAGES/library/importlib.resources.po -trans.pt_BR = library/importlib.resources.po -source_file = /pot/library/importlib.resources.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--importlib_resources_abc] -file_filter = .//LC_MESSAGES/library/importlib.resources.abc.po -trans.pt_BR = library/importlib.resources.abc.po -source_file = /pot/library/importlib.resources.abc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--index] -file_filter = .//LC_MESSAGES/library/index.po -trans.pt_BR = library/index.po -source_file = /pot/library/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--inspect] -file_filter = .//LC_MESSAGES/library/inspect.po -trans.pt_BR = library/inspect.po -source_file = /pot/library/inspect.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--internet] -file_filter = .//LC_MESSAGES/library/internet.po -trans.pt_BR = library/internet.po -source_file = /pot/library/internet.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--intro] -file_filter = .//LC_MESSAGES/library/intro.po -trans.pt_BR = library/intro.po -source_file = /pot/library/intro.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--io] -file_filter = .//LC_MESSAGES/library/io.po -trans.pt_BR = library/io.po -source_file = /pot/library/io.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ipaddress] -file_filter = .//LC_MESSAGES/library/ipaddress.po -trans.pt_BR = library/ipaddress.po -source_file = /pot/library/ipaddress.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ipc] -file_filter = .//LC_MESSAGES/library/ipc.po -trans.pt_BR = library/ipc.po -source_file = /pot/library/ipc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--itertools] -file_filter = .//LC_MESSAGES/library/itertools.po -trans.pt_BR = library/itertools.po -source_file = /pot/library/itertools.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--json] -file_filter = .//LC_MESSAGES/library/json.po -trans.pt_BR = library/json.po -source_file = /pot/library/json.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--keyword] -file_filter = .//LC_MESSAGES/library/keyword.po -trans.pt_BR = library/keyword.po -source_file = /pot/library/keyword.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--language] -file_filter = .//LC_MESSAGES/library/language.po -trans.pt_BR = library/language.po -source_file = /pot/library/language.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--linecache] -file_filter = .//LC_MESSAGES/library/linecache.po -trans.pt_BR = library/linecache.po -source_file = /pot/library/linecache.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--locale] -file_filter = .//LC_MESSAGES/library/locale.po -trans.pt_BR = library/locale.po -source_file = /pot/library/locale.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--logging] -file_filter = .//LC_MESSAGES/library/logging.po -trans.pt_BR = library/logging.po -source_file = /pot/library/logging.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--logging_config] -file_filter = .//LC_MESSAGES/library/logging.config.po -trans.pt_BR = library/logging.config.po -source_file = /pot/library/logging.config.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--logging_handlers] -file_filter = .//LC_MESSAGES/library/logging.handlers.po -trans.pt_BR = library/logging.handlers.po -source_file = /pot/library/logging.handlers.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--lzma] -file_filter = .//LC_MESSAGES/library/lzma.po -trans.pt_BR = library/lzma.po -source_file = /pot/library/lzma.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--mailbox] -file_filter = .//LC_MESSAGES/library/mailbox.po -trans.pt_BR = library/mailbox.po -source_file = /pot/library/mailbox.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--mailcap] -file_filter = .//LC_MESSAGES/library/mailcap.po -trans.pt_BR = library/mailcap.po -source_file = /pot/library/mailcap.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--markup] -file_filter = .//LC_MESSAGES/library/markup.po -trans.pt_BR = library/markup.po -source_file = /pot/library/markup.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--marshal] -file_filter = .//LC_MESSAGES/library/marshal.po -trans.pt_BR = library/marshal.po -source_file = /pot/library/marshal.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--math] -file_filter = .//LC_MESSAGES/library/math.po -trans.pt_BR = library/math.po -source_file = /pot/library/math.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--mimetypes] -file_filter = .//LC_MESSAGES/library/mimetypes.po -trans.pt_BR = library/mimetypes.po -source_file = /pot/library/mimetypes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--mm] -file_filter = .//LC_MESSAGES/library/mm.po -trans.pt_BR = library/mm.po -source_file = /pot/library/mm.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--mmap] -file_filter = .//LC_MESSAGES/library/mmap.po -trans.pt_BR = library/mmap.po -source_file = /pot/library/mmap.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--modulefinder] -file_filter = .//LC_MESSAGES/library/modulefinder.po -trans.pt_BR = library/modulefinder.po -source_file = /pot/library/modulefinder.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--modules] -file_filter = .//LC_MESSAGES/library/modules.po -trans.pt_BR = library/modules.po -source_file = /pot/library/modules.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--msilib] -file_filter = .//LC_MESSAGES/library/msilib.po -trans.pt_BR = library/msilib.po -source_file = /pot/library/msilib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--msvcrt] -file_filter = .//LC_MESSAGES/library/msvcrt.po -trans.pt_BR = library/msvcrt.po -source_file = /pot/library/msvcrt.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--multiprocessing] -file_filter = .//LC_MESSAGES/library/multiprocessing.po -trans.pt_BR = library/multiprocessing.po -source_file = /pot/library/multiprocessing.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--multiprocessing_shared_memory] -file_filter = .//LC_MESSAGES/library/multiprocessing.shared_memory.po -trans.pt_BR = library/multiprocessing.shared_memory.po -source_file = /pot/library/multiprocessing.shared_memory.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--netdata] -file_filter = .//LC_MESSAGES/library/netdata.po -trans.pt_BR = library/netdata.po -source_file = /pot/library/netdata.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--netrc] -file_filter = .//LC_MESSAGES/library/netrc.po -trans.pt_BR = library/netrc.po -source_file = /pot/library/netrc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--nis] -file_filter = .//LC_MESSAGES/library/nis.po -trans.pt_BR = library/nis.po -source_file = /pot/library/nis.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--nntplib] -file_filter = .//LC_MESSAGES/library/nntplib.po -trans.pt_BR = library/nntplib.po -source_file = /pot/library/nntplib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--numbers] -file_filter = .//LC_MESSAGES/library/numbers.po -trans.pt_BR = library/numbers.po -source_file = /pot/library/numbers.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--numeric] -file_filter = .//LC_MESSAGES/library/numeric.po -trans.pt_BR = library/numeric.po -source_file = /pot/library/numeric.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--operator] -file_filter = .//LC_MESSAGES/library/operator.po -trans.pt_BR = library/operator.po -source_file = /pot/library/operator.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--optparse] -file_filter = .//LC_MESSAGES/library/optparse.po -trans.pt_BR = library/optparse.po -source_file = /pot/library/optparse.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--os] -file_filter = .//LC_MESSAGES/library/os.po -trans.pt_BR = library/os.po -source_file = /pot/library/os.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--os_path] -file_filter = .//LC_MESSAGES/library/os.path.po -trans.pt_BR = library/os.path.po -source_file = /pot/library/os.path.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ossaudiodev] -file_filter = .//LC_MESSAGES/library/ossaudiodev.po -trans.pt_BR = library/ossaudiodev.po -source_file = /pot/library/ossaudiodev.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pathlib] -file_filter = .//LC_MESSAGES/library/pathlib.po -trans.pt_BR = library/pathlib.po -source_file = /pot/library/pathlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pdb] -file_filter = .//LC_MESSAGES/library/pdb.po -trans.pt_BR = library/pdb.po -source_file = /pot/library/pdb.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--persistence] -file_filter = .//LC_MESSAGES/library/persistence.po -trans.pt_BR = library/persistence.po -source_file = /pot/library/persistence.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pickle] -file_filter = .//LC_MESSAGES/library/pickle.po -trans.pt_BR = library/pickle.po -source_file = /pot/library/pickle.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pickletools] -file_filter = .//LC_MESSAGES/library/pickletools.po -trans.pt_BR = library/pickletools.po -source_file = /pot/library/pickletools.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pipes] -file_filter = .//LC_MESSAGES/library/pipes.po -trans.pt_BR = library/pipes.po -source_file = /pot/library/pipes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pkgutil] -file_filter = .//LC_MESSAGES/library/pkgutil.po -trans.pt_BR = library/pkgutil.po -source_file = /pot/library/pkgutil.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--platform] -file_filter = .//LC_MESSAGES/library/platform.po -trans.pt_BR = library/platform.po -source_file = /pot/library/platform.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--plistlib] -file_filter = .//LC_MESSAGES/library/plistlib.po -trans.pt_BR = library/plistlib.po -source_file = /pot/library/plistlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--poplib] -file_filter = .//LC_MESSAGES/library/poplib.po -trans.pt_BR = library/poplib.po -source_file = /pot/library/poplib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--posix] -file_filter = .//LC_MESSAGES/library/posix.po -trans.pt_BR = library/posix.po -source_file = /pot/library/posix.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pprint] -file_filter = .//LC_MESSAGES/library/pprint.po -trans.pt_BR = library/pprint.po -source_file = /pot/library/pprint.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--profile] -file_filter = .//LC_MESSAGES/library/profile.po -trans.pt_BR = library/profile.po -source_file = /pot/library/profile.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pty] -file_filter = .//LC_MESSAGES/library/pty.po -trans.pt_BR = library/pty.po -source_file = /pot/library/pty.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pwd] -file_filter = .//LC_MESSAGES/library/pwd.po -trans.pt_BR = library/pwd.po -source_file = /pot/library/pwd.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--py_compile] -file_filter = .//LC_MESSAGES/library/py_compile.po -trans.pt_BR = library/py_compile.po -source_file = /pot/library/py_compile.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pyclbr] -file_filter = .//LC_MESSAGES/library/pyclbr.po -trans.pt_BR = library/pyclbr.po -source_file = /pot/library/pyclbr.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pydoc] -file_filter = .//LC_MESSAGES/library/pydoc.po -trans.pt_BR = library/pydoc.po -source_file = /pot/library/pydoc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--pyexpat] -file_filter = .//LC_MESSAGES/library/pyexpat.po -trans.pt_BR = library/pyexpat.po -source_file = /pot/library/pyexpat.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--python] -file_filter = .//LC_MESSAGES/library/python.po -trans.pt_BR = library/python.po -source_file = /pot/library/python.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--queue] -file_filter = .//LC_MESSAGES/library/queue.po -trans.pt_BR = library/queue.po -source_file = /pot/library/queue.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--quopri] -file_filter = .//LC_MESSAGES/library/quopri.po -trans.pt_BR = library/quopri.po -source_file = /pot/library/quopri.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--random] -file_filter = .//LC_MESSAGES/library/random.po -trans.pt_BR = library/random.po -source_file = /pot/library/random.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--re] -file_filter = .//LC_MESSAGES/library/re.po -trans.pt_BR = library/re.po -source_file = /pot/library/re.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--readline] -file_filter = .//LC_MESSAGES/library/readline.po -trans.pt_BR = library/readline.po -source_file = /pot/library/readline.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--reprlib] -file_filter = .//LC_MESSAGES/library/reprlib.po -trans.pt_BR = library/reprlib.po -source_file = /pot/library/reprlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--resource] -file_filter = .//LC_MESSAGES/library/resource.po -trans.pt_BR = library/resource.po -source_file = /pot/library/resource.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--rlcompleter] -file_filter = .//LC_MESSAGES/library/rlcompleter.po -trans.pt_BR = library/rlcompleter.po -source_file = /pot/library/rlcompleter.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--runpy] -file_filter = .//LC_MESSAGES/library/runpy.po -trans.pt_BR = library/runpy.po -source_file = /pot/library/runpy.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sched] -file_filter = .//LC_MESSAGES/library/sched.po -trans.pt_BR = library/sched.po -source_file = /pot/library/sched.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--secrets] -file_filter = .//LC_MESSAGES/library/secrets.po -trans.pt_BR = library/secrets.po -source_file = /pot/library/secrets.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--security_warnings] -file_filter = .//LC_MESSAGES/library/security_warnings.po -trans.pt_BR = library/security_warnings.po -source_file = /pot/library/security_warnings.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--select] -file_filter = .//LC_MESSAGES/library/select.po -trans.pt_BR = library/select.po -source_file = /pot/library/select.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--selectors] -file_filter = .//LC_MESSAGES/library/selectors.po -trans.pt_BR = library/selectors.po -source_file = /pot/library/selectors.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--shelve] -file_filter = .//LC_MESSAGES/library/shelve.po -trans.pt_BR = library/shelve.po -source_file = /pot/library/shelve.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--shlex] -file_filter = .//LC_MESSAGES/library/shlex.po -trans.pt_BR = library/shlex.po -source_file = /pot/library/shlex.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--shutil] -file_filter = .//LC_MESSAGES/library/shutil.po -trans.pt_BR = library/shutil.po -source_file = /pot/library/shutil.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--signal] -file_filter = .//LC_MESSAGES/library/signal.po -trans.pt_BR = library/signal.po -source_file = /pot/library/signal.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--site] -file_filter = .//LC_MESSAGES/library/site.po -trans.pt_BR = library/site.po -source_file = /pot/library/site.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--smtplib] -file_filter = .//LC_MESSAGES/library/smtplib.po -trans.pt_BR = library/smtplib.po -source_file = /pot/library/smtplib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sndhdr] -file_filter = .//LC_MESSAGES/library/sndhdr.po -trans.pt_BR = library/sndhdr.po -source_file = /pot/library/sndhdr.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--socket] -file_filter = .//LC_MESSAGES/library/socket.po -trans.pt_BR = library/socket.po -source_file = /pot/library/socket.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--socketserver] -file_filter = .//LC_MESSAGES/library/socketserver.po -trans.pt_BR = library/socketserver.po -source_file = /pot/library/socketserver.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--spwd] -file_filter = .//LC_MESSAGES/library/spwd.po -trans.pt_BR = library/spwd.po -source_file = /pot/library/spwd.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sqlite3] -file_filter = .//LC_MESSAGES/library/sqlite3.po -trans.pt_BR = library/sqlite3.po -source_file = /pot/library/sqlite3.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--ssl] -file_filter = .//LC_MESSAGES/library/ssl.po -trans.pt_BR = library/ssl.po -source_file = /pot/library/ssl.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--stat] -file_filter = .//LC_MESSAGES/library/stat.po -trans.pt_BR = library/stat.po -source_file = /pot/library/stat.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--statistics] -file_filter = .//LC_MESSAGES/library/statistics.po -trans.pt_BR = library/statistics.po -source_file = /pot/library/statistics.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--stdtypes] -file_filter = .//LC_MESSAGES/library/stdtypes.po -trans.pt_BR = library/stdtypes.po -source_file = /pot/library/stdtypes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--string] -file_filter = .//LC_MESSAGES/library/string.po -trans.pt_BR = library/string.po -source_file = /pot/library/string.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--stringprep] -file_filter = .//LC_MESSAGES/library/stringprep.po -trans.pt_BR = library/stringprep.po -source_file = /pot/library/stringprep.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--struct] -file_filter = .//LC_MESSAGES/library/struct.po -trans.pt_BR = library/struct.po -source_file = /pot/library/struct.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--subprocess] -file_filter = .//LC_MESSAGES/library/subprocess.po -trans.pt_BR = library/subprocess.po -source_file = /pot/library/subprocess.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sunau] -file_filter = .//LC_MESSAGES/library/sunau.po -trans.pt_BR = library/sunau.po -source_file = /pot/library/sunau.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--superseded] -file_filter = .//LC_MESSAGES/library/superseded.po -trans.pt_BR = library/superseded.po -source_file = /pot/library/superseded.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--symtable] -file_filter = .//LC_MESSAGES/library/symtable.po -trans.pt_BR = library/symtable.po -source_file = /pot/library/symtable.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sys] -file_filter = .//LC_MESSAGES/library/sys.po -trans.pt_BR = library/sys.po -source_file = /pot/library/sys.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sys_monitoring] -file_filter = .//LC_MESSAGES/library/sys.monitoring.po -trans.pt_BR = library/sys.monitoring.po -source_file = /pot/library/sys.monitoring.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sys_path_init] -file_filter = .//LC_MESSAGES/library/sys_path_init.po -trans.pt_BR = library/sys_path_init.po -source_file = /pot/library/sys_path_init.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--sysconfig] -file_filter = .//LC_MESSAGES/library/sysconfig.po -trans.pt_BR = library/sysconfig.po -source_file = /pot/library/sysconfig.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--syslog] -file_filter = .//LC_MESSAGES/library/syslog.po -trans.pt_BR = library/syslog.po -source_file = /pot/library/syslog.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tabnanny] -file_filter = .//LC_MESSAGES/library/tabnanny.po -trans.pt_BR = library/tabnanny.po -source_file = /pot/library/tabnanny.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tarfile] -file_filter = .//LC_MESSAGES/library/tarfile.po -trans.pt_BR = library/tarfile.po -source_file = /pot/library/tarfile.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--telnetlib] -file_filter = .//LC_MESSAGES/library/telnetlib.po -trans.pt_BR = library/telnetlib.po -source_file = /pot/library/telnetlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tempfile] -file_filter = .//LC_MESSAGES/library/tempfile.po -trans.pt_BR = library/tempfile.po -source_file = /pot/library/tempfile.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--termios] -file_filter = .//LC_MESSAGES/library/termios.po -trans.pt_BR = library/termios.po -source_file = /pot/library/termios.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--test] -file_filter = .//LC_MESSAGES/library/test.po -trans.pt_BR = library/test.po -source_file = /pot/library/test.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--text] -file_filter = .//LC_MESSAGES/library/text.po -trans.pt_BR = library/text.po -source_file = /pot/library/text.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--textwrap] -file_filter = .//LC_MESSAGES/library/textwrap.po -trans.pt_BR = library/textwrap.po -source_file = /pot/library/textwrap.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--threading] -file_filter = .//LC_MESSAGES/library/threading.po -trans.pt_BR = library/threading.po -source_file = /pot/library/threading.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--time] -file_filter = .//LC_MESSAGES/library/time.po -trans.pt_BR = library/time.po -source_file = /pot/library/time.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--timeit] -file_filter = .//LC_MESSAGES/library/timeit.po -trans.pt_BR = library/timeit.po -source_file = /pot/library/timeit.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tk] -file_filter = .//LC_MESSAGES/library/tk.po -trans.pt_BR = library/tk.po -source_file = /pot/library/tk.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter] -file_filter = .//LC_MESSAGES/library/tkinter.po -trans.pt_BR = library/tkinter.po -source_file = /pot/library/tkinter.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter_colorchooser] -file_filter = .//LC_MESSAGES/library/tkinter.colorchooser.po -trans.pt_BR = library/tkinter.colorchooser.po -source_file = /pot/library/tkinter.colorchooser.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter_dnd] -file_filter = .//LC_MESSAGES/library/tkinter.dnd.po -trans.pt_BR = library/tkinter.dnd.po -source_file = /pot/library/tkinter.dnd.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter_font] -file_filter = .//LC_MESSAGES/library/tkinter.font.po -trans.pt_BR = library/tkinter.font.po -source_file = /pot/library/tkinter.font.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter_messagebox] -file_filter = .//LC_MESSAGES/library/tkinter.messagebox.po -trans.pt_BR = library/tkinter.messagebox.po -source_file = /pot/library/tkinter.messagebox.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter_scrolledtext] -file_filter = .//LC_MESSAGES/library/tkinter.scrolledtext.po -trans.pt_BR = library/tkinter.scrolledtext.po -source_file = /pot/library/tkinter.scrolledtext.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter_tix] -file_filter = .//LC_MESSAGES/library/tkinter.tix.po -trans.pt_BR = library/tkinter.tix.po -source_file = /pot/library/tkinter.tix.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tkinter_ttk] -file_filter = .//LC_MESSAGES/library/tkinter.ttk.po -trans.pt_BR = library/tkinter.ttk.po -source_file = /pot/library/tkinter.ttk.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--token] -file_filter = .//LC_MESSAGES/library/token.po -trans.pt_BR = library/token.po -source_file = /pot/library/token.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tokenize] -file_filter = .//LC_MESSAGES/library/tokenize.po -trans.pt_BR = library/tokenize.po -source_file = /pot/library/tokenize.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tomllib] -file_filter = .//LC_MESSAGES/library/tomllib.po -trans.pt_BR = library/tomllib.po -source_file = /pot/library/tomllib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--trace] -file_filter = .//LC_MESSAGES/library/trace.po -trans.pt_BR = library/trace.po -source_file = /pot/library/trace.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--traceback] -file_filter = .//LC_MESSAGES/library/traceback.po -trans.pt_BR = library/traceback.po -source_file = /pot/library/traceback.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tracemalloc] -file_filter = .//LC_MESSAGES/library/tracemalloc.po -trans.pt_BR = library/tracemalloc.po -source_file = /pot/library/tracemalloc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--tty] -file_filter = .//LC_MESSAGES/library/tty.po -trans.pt_BR = library/tty.po -source_file = /pot/library/tty.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--turtle] -file_filter = .//LC_MESSAGES/library/turtle.po -trans.pt_BR = library/turtle.po -source_file = /pot/library/turtle.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--types] -file_filter = .//LC_MESSAGES/library/types.po -trans.pt_BR = library/types.po -source_file = /pot/library/types.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--typing] -file_filter = .//LC_MESSAGES/library/typing.po -trans.pt_BR = library/typing.po -source_file = /pot/library/typing.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--unicodedata] -file_filter = .//LC_MESSAGES/library/unicodedata.po -trans.pt_BR = library/unicodedata.po -source_file = /pot/library/unicodedata.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--unittest] -file_filter = .//LC_MESSAGES/library/unittest.po -trans.pt_BR = library/unittest.po -source_file = /pot/library/unittest.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--unittest_mock] -file_filter = .//LC_MESSAGES/library/unittest.mock.po -trans.pt_BR = library/unittest.mock.po -source_file = /pot/library/unittest.mock.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--unittest_mock-examples] -file_filter = .//LC_MESSAGES/library/unittest.mock-examples.po -trans.pt_BR = library/unittest.mock-examples.po -source_file = /pot/library/unittest.mock-examples.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--unix] -file_filter = .//LC_MESSAGES/library/unix.po -trans.pt_BR = library/unix.po -source_file = /pot/library/unix.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--urllib] -file_filter = .//LC_MESSAGES/library/urllib.po -trans.pt_BR = library/urllib.po -source_file = /pot/library/urllib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--urllib_error] -file_filter = .//LC_MESSAGES/library/urllib.error.po -trans.pt_BR = library/urllib.error.po -source_file = /pot/library/urllib.error.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--urllib_parse] -file_filter = .//LC_MESSAGES/library/urllib.parse.po -trans.pt_BR = library/urllib.parse.po -source_file = /pot/library/urllib.parse.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--urllib_request] -file_filter = .//LC_MESSAGES/library/urllib.request.po -trans.pt_BR = library/urllib.request.po -source_file = /pot/library/urllib.request.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--urllib_robotparser] -file_filter = .//LC_MESSAGES/library/urllib.robotparser.po -trans.pt_BR = library/urllib.robotparser.po -source_file = /pot/library/urllib.robotparser.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--uu] -file_filter = .//LC_MESSAGES/library/uu.po -trans.pt_BR = library/uu.po -source_file = /pot/library/uu.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--uuid] -file_filter = .//LC_MESSAGES/library/uuid.po -trans.pt_BR = library/uuid.po -source_file = /pot/library/uuid.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--venv] -file_filter = .//LC_MESSAGES/library/venv.po -trans.pt_BR = library/venv.po -source_file = /pot/library/venv.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--warnings] -file_filter = .//LC_MESSAGES/library/warnings.po -trans.pt_BR = library/warnings.po -source_file = /pot/library/warnings.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--wave] -file_filter = .//LC_MESSAGES/library/wave.po -trans.pt_BR = library/wave.po -source_file = /pot/library/wave.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--weakref] -file_filter = .//LC_MESSAGES/library/weakref.po -trans.pt_BR = library/weakref.po -source_file = /pot/library/weakref.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--webbrowser] -file_filter = .//LC_MESSAGES/library/webbrowser.po -trans.pt_BR = library/webbrowser.po -source_file = /pot/library/webbrowser.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--windows] -file_filter = .//LC_MESSAGES/library/windows.po -trans.pt_BR = library/windows.po -source_file = /pot/library/windows.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--winreg] -file_filter = .//LC_MESSAGES/library/winreg.po -trans.pt_BR = library/winreg.po -source_file = /pot/library/winreg.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--winsound] -file_filter = .//LC_MESSAGES/library/winsound.po -trans.pt_BR = library/winsound.po -source_file = /pot/library/winsound.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--wsgiref] -file_filter = .//LC_MESSAGES/library/wsgiref.po -trans.pt_BR = library/wsgiref.po -source_file = /pot/library/wsgiref.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xdrlib] -file_filter = .//LC_MESSAGES/library/xdrlib.po -trans.pt_BR = library/xdrlib.po -source_file = /pot/library/xdrlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml] -file_filter = .//LC_MESSAGES/library/xml.po -trans.pt_BR = library/xml.po -source_file = /pot/library/xml.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_dom] -file_filter = .//LC_MESSAGES/library/xml.dom.po -trans.pt_BR = library/xml.dom.po -source_file = /pot/library/xml.dom.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_dom_minidom] -file_filter = .//LC_MESSAGES/library/xml.dom.minidom.po -trans.pt_BR = library/xml.dom.minidom.po -source_file = /pot/library/xml.dom.minidom.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_dom_pulldom] -file_filter = .//LC_MESSAGES/library/xml.dom.pulldom.po -trans.pt_BR = library/xml.dom.pulldom.po -source_file = /pot/library/xml.dom.pulldom.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_etree_elementtree] -file_filter = .//LC_MESSAGES/library/xml.etree.elementtree.po -trans.pt_BR = library/xml.etree.elementtree.po -source_file = /pot/library/xml.etree.elementtree.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_sax] -file_filter = .//LC_MESSAGES/library/xml.sax.po -trans.pt_BR = library/xml.sax.po -source_file = /pot/library/xml.sax.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_sax_handler] -file_filter = .//LC_MESSAGES/library/xml.sax.handler.po -trans.pt_BR = library/xml.sax.handler.po -source_file = /pot/library/xml.sax.handler.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_sax_reader] -file_filter = .//LC_MESSAGES/library/xml.sax.reader.po -trans.pt_BR = library/xml.sax.reader.po -source_file = /pot/library/xml.sax.reader.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xml_sax_utils] -file_filter = .//LC_MESSAGES/library/xml.sax.utils.po -trans.pt_BR = library/xml.sax.utils.po -source_file = /pot/library/xml.sax.utils.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xmlrpc] -file_filter = .//LC_MESSAGES/library/xmlrpc.po -trans.pt_BR = library/xmlrpc.po -source_file = /pot/library/xmlrpc.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xmlrpc_client] -file_filter = .//LC_MESSAGES/library/xmlrpc.client.po -trans.pt_BR = library/xmlrpc.client.po -source_file = /pot/library/xmlrpc.client.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--xmlrpc_server] -file_filter = .//LC_MESSAGES/library/xmlrpc.server.po -trans.pt_BR = library/xmlrpc.server.po -source_file = /pot/library/xmlrpc.server.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--zipapp] -file_filter = .//LC_MESSAGES/library/zipapp.po -trans.pt_BR = library/zipapp.po -source_file = /pot/library/zipapp.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--zipfile] -file_filter = .//LC_MESSAGES/library/zipfile.po -trans.pt_BR = library/zipfile.po -source_file = /pot/library/zipfile.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--zipimport] -file_filter = .//LC_MESSAGES/library/zipimport.po -trans.pt_BR = library/zipimport.po -source_file = /pot/library/zipimport.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--zlib] -file_filter = .//LC_MESSAGES/library/zlib.po -trans.pt_BR = library/zlib.po -source_file = /pot/library/zlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:library--zoneinfo] -file_filter = .//LC_MESSAGES/library/zoneinfo.po -trans.pt_BR = library/zoneinfo.po -source_file = /pot/library/zoneinfo.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:license] -file_filter = .//LC_MESSAGES/license.po -trans.pt_BR = license.po -source_file = /pot/license.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--compound_stmts] -file_filter = .//LC_MESSAGES/reference/compound_stmts.po -trans.pt_BR = reference/compound_stmts.po -source_file = /pot/reference/compound_stmts.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--datamodel] -file_filter = .//LC_MESSAGES/reference/datamodel.po -trans.pt_BR = reference/datamodel.po -source_file = /pot/reference/datamodel.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--executionmodel] -file_filter = .//LC_MESSAGES/reference/executionmodel.po -trans.pt_BR = reference/executionmodel.po -source_file = /pot/reference/executionmodel.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--expressions] -file_filter = .//LC_MESSAGES/reference/expressions.po -trans.pt_BR = reference/expressions.po -source_file = /pot/reference/expressions.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--grammar] -file_filter = .//LC_MESSAGES/reference/grammar.po -trans.pt_BR = reference/grammar.po -source_file = /pot/reference/grammar.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--import] -file_filter = .//LC_MESSAGES/reference/import.po -trans.pt_BR = reference/import.po -source_file = /pot/reference/import.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--index] -file_filter = .//LC_MESSAGES/reference/index.po -trans.pt_BR = reference/index.po -source_file = /pot/reference/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--introduction] -file_filter = .//LC_MESSAGES/reference/introduction.po -trans.pt_BR = reference/introduction.po -source_file = /pot/reference/introduction.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--lexical_analysis] -file_filter = .//LC_MESSAGES/reference/lexical_analysis.po -trans.pt_BR = reference/lexical_analysis.po -source_file = /pot/reference/lexical_analysis.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--simple_stmts] -file_filter = .//LC_MESSAGES/reference/simple_stmts.po -trans.pt_BR = reference/simple_stmts.po -source_file = /pot/reference/simple_stmts.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:reference--toplevel_components] -file_filter = .//LC_MESSAGES/reference/toplevel_components.po -trans.pt_BR = reference/toplevel_components.po -source_file = /pot/reference/toplevel_components.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:sphinx] -file_filter = .//LC_MESSAGES/sphinx.po -trans.pt_BR = sphinx.po -source_file = /pot/sphinx.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--appendix] -file_filter = .//LC_MESSAGES/tutorial/appendix.po -trans.pt_BR = tutorial/appendix.po -source_file = /pot/tutorial/appendix.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--appetite] -file_filter = .//LC_MESSAGES/tutorial/appetite.po -trans.pt_BR = tutorial/appetite.po -source_file = /pot/tutorial/appetite.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--classes] -file_filter = .//LC_MESSAGES/tutorial/classes.po -trans.pt_BR = tutorial/classes.po -source_file = /pot/tutorial/classes.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--controlflow] -file_filter = .//LC_MESSAGES/tutorial/controlflow.po -trans.pt_BR = tutorial/controlflow.po -source_file = /pot/tutorial/controlflow.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--datastructures] -file_filter = .//LC_MESSAGES/tutorial/datastructures.po -trans.pt_BR = tutorial/datastructures.po -source_file = /pot/tutorial/datastructures.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--errors] -file_filter = .//LC_MESSAGES/tutorial/errors.po -trans.pt_BR = tutorial/errors.po -source_file = /pot/tutorial/errors.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--floatingpoint] -file_filter = .//LC_MESSAGES/tutorial/floatingpoint.po -trans.pt_BR = tutorial/floatingpoint.po -source_file = /pot/tutorial/floatingpoint.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--index] -file_filter = .//LC_MESSAGES/tutorial/index.po -trans.pt_BR = tutorial/index.po -source_file = /pot/tutorial/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--inputoutput] -file_filter = .//LC_MESSAGES/tutorial/inputoutput.po -trans.pt_BR = tutorial/inputoutput.po -source_file = /pot/tutorial/inputoutput.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--interactive] -file_filter = .//LC_MESSAGES/tutorial/interactive.po -trans.pt_BR = tutorial/interactive.po -source_file = /pot/tutorial/interactive.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--interpreter] -file_filter = .//LC_MESSAGES/tutorial/interpreter.po -trans.pt_BR = tutorial/interpreter.po -source_file = /pot/tutorial/interpreter.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--introduction] -file_filter = .//LC_MESSAGES/tutorial/introduction.po -trans.pt_BR = tutorial/introduction.po -source_file = /pot/tutorial/introduction.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--modules] -file_filter = .//LC_MESSAGES/tutorial/modules.po -trans.pt_BR = tutorial/modules.po -source_file = /pot/tutorial/modules.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--stdlib] -file_filter = .//LC_MESSAGES/tutorial/stdlib.po -trans.pt_BR = tutorial/stdlib.po -source_file = /pot/tutorial/stdlib.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--stdlib2] -file_filter = .//LC_MESSAGES/tutorial/stdlib2.po -trans.pt_BR = tutorial/stdlib2.po -source_file = /pot/tutorial/stdlib2.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--venv] -file_filter = .//LC_MESSAGES/tutorial/venv.po -trans.pt_BR = tutorial/venv.po -source_file = /pot/tutorial/venv.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:tutorial--whatnow] -file_filter = .//LC_MESSAGES/tutorial/whatnow.po -trans.pt_BR = tutorial/whatnow.po -source_file = /pot/tutorial/whatnow.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:using--cmdline] -file_filter = .//LC_MESSAGES/using/cmdline.po -trans.pt_BR = using/cmdline.po -source_file = /pot/using/cmdline.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:using--configure] -file_filter = .//LC_MESSAGES/using/configure.po -trans.pt_BR = using/configure.po -source_file = /pot/using/configure.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:using--editors] -file_filter = .//LC_MESSAGES/using/editors.po -trans.pt_BR = using/editors.po -source_file = /pot/using/editors.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:using--index] -file_filter = .//LC_MESSAGES/using/index.po -trans.pt_BR = using/index.po -source_file = /pot/using/index.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:using--mac] -file_filter = .//LC_MESSAGES/using/mac.po -trans.pt_BR = using/mac.po -source_file = /pot/using/mac.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:using--unix] -file_filter = .//LC_MESSAGES/using/unix.po -trans.pt_BR = using/unix.po -source_file = /pot/using/unix.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:using--windows] -file_filter = .//LC_MESSAGES/using/windows.po -trans.pt_BR = using/windows.po -source_file = /pot/using/windows.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_0] -file_filter = .//LC_MESSAGES/whatsnew/2.0.po -trans.pt_BR = whatsnew/2.0.po -source_file = /pot/whatsnew/2.0.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_1] -file_filter = .//LC_MESSAGES/whatsnew/2.1.po -trans.pt_BR = whatsnew/2.1.po -source_file = /pot/whatsnew/2.1.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_2] -file_filter = .//LC_MESSAGES/whatsnew/2.2.po -trans.pt_BR = whatsnew/2.2.po -source_file = /pot/whatsnew/2.2.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_3] -file_filter = .//LC_MESSAGES/whatsnew/2.3.po -trans.pt_BR = whatsnew/2.3.po -source_file = /pot/whatsnew/2.3.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_4] -file_filter = .//LC_MESSAGES/whatsnew/2.4.po -trans.pt_BR = whatsnew/2.4.po -source_file = /pot/whatsnew/2.4.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_5] -file_filter = .//LC_MESSAGES/whatsnew/2.5.po -trans.pt_BR = whatsnew/2.5.po -source_file = /pot/whatsnew/2.5.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_6] -file_filter = .//LC_MESSAGES/whatsnew/2.6.po -trans.pt_BR = whatsnew/2.6.po -source_file = /pot/whatsnew/2.6.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--2_7] -file_filter = .//LC_MESSAGES/whatsnew/2.7.po -trans.pt_BR = whatsnew/2.7.po -source_file = /pot/whatsnew/2.7.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_0] -file_filter = .//LC_MESSAGES/whatsnew/3.0.po -trans.pt_BR = whatsnew/3.0.po -source_file = /pot/whatsnew/3.0.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_1] -file_filter = .//LC_MESSAGES/whatsnew/3.1.po -trans.pt_BR = whatsnew/3.1.po -source_file = /pot/whatsnew/3.1.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_10] -file_filter = .//LC_MESSAGES/whatsnew/3.10.po -trans.pt_BR = whatsnew/3.10.po -source_file = /pot/whatsnew/3.10.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_11] -file_filter = .//LC_MESSAGES/whatsnew/3.11.po -trans.pt_BR = whatsnew/3.11.po -source_file = /pot/whatsnew/3.11.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_12] -file_filter = .//LC_MESSAGES/whatsnew/3.12.po -trans.pt_BR = whatsnew/3.12.po -source_file = /pot/whatsnew/3.12.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_2] -file_filter = .//LC_MESSAGES/whatsnew/3.2.po -trans.pt_BR = whatsnew/3.2.po -source_file = /pot/whatsnew/3.2.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_3] -file_filter = .//LC_MESSAGES/whatsnew/3.3.po -trans.pt_BR = whatsnew/3.3.po -source_file = /pot/whatsnew/3.3.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_4] -file_filter = .//LC_MESSAGES/whatsnew/3.4.po -trans.pt_BR = whatsnew/3.4.po -source_file = /pot/whatsnew/3.4.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_5] -file_filter = .//LC_MESSAGES/whatsnew/3.5.po -trans.pt_BR = whatsnew/3.5.po -source_file = /pot/whatsnew/3.5.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_6] -file_filter = .//LC_MESSAGES/whatsnew/3.6.po -trans.pt_BR = whatsnew/3.6.po -source_file = /pot/whatsnew/3.6.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_7] -file_filter = .//LC_MESSAGES/whatsnew/3.7.po -trans.pt_BR = whatsnew/3.7.po -source_file = /pot/whatsnew/3.7.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_8] -file_filter = .//LC_MESSAGES/whatsnew/3.8.po -trans.pt_BR = whatsnew/3.8.po -source_file = /pot/whatsnew/3.8.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--3_9] -file_filter = .//LC_MESSAGES/whatsnew/3.9.po -trans.pt_BR = whatsnew/3.9.po -source_file = /pot/whatsnew/3.9.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--changelog] -file_filter = .//LC_MESSAGES/whatsnew/changelog.po -trans.pt_BR = whatsnew/changelog.po -source_file = /pot/whatsnew/changelog.pot -type = PO -minimum_perc = 0 - -[o:python-doc:p:python-newest:r:whatsnew--index] -file_filter = .//LC_MESSAGES/whatsnew/index.po -trans.pt_BR = whatsnew/index.po -source_file = /pot/whatsnew/index.pot -type = PO -minimum_perc = 0 +[o:python-doc:p:python-312:r:about] +file_filter = about.po +trans.pt_BR = about.po +source_file = ../build/gettext/about.pot +type = PO +minimum_perc = 0 +resource_name = about +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:bugs] +file_filter = bugs.po +trans.pt_BR = bugs.po +source_file = ../build/gettext/bugs.pot +type = PO +minimum_perc = 0 +resource_name = bugs +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--abstract] +file_filter = c-api/abstract.po +trans.pt_BR = c-api/abstract.po +source_file = ../build/gettext/c-api/abstract.pot +type = PO +minimum_perc = 0 +resource_name = c-api--abstract +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--allocation] +file_filter = c-api/allocation.po +trans.pt_BR = c-api/allocation.po +source_file = ../build/gettext/c-api/allocation.pot +type = PO +minimum_perc = 0 +resource_name = c-api--allocation +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--apiabiversion] +file_filter = c-api/apiabiversion.po +trans.pt_BR = c-api/apiabiversion.po +source_file = ../build/gettext/c-api/apiabiversion.pot +type = PO +minimum_perc = 0 +resource_name = c-api--apiabiversion +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--arg] +file_filter = c-api/arg.po +trans.pt_BR = c-api/arg.po +source_file = ../build/gettext/c-api/arg.pot +type = PO +minimum_perc = 0 +resource_name = c-api--arg +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--bool] +file_filter = c-api/bool.po +trans.pt_BR = c-api/bool.po +source_file = ../build/gettext/c-api/bool.pot +type = PO +minimum_perc = 0 +resource_name = c-api--bool +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--buffer] +file_filter = c-api/buffer.po +trans.pt_BR = c-api/buffer.po +source_file = ../build/gettext/c-api/buffer.pot +type = PO +minimum_perc = 0 +resource_name = c-api--buffer +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--bytearray] +file_filter = c-api/bytearray.po +trans.pt_BR = c-api/bytearray.po +source_file = ../build/gettext/c-api/bytearray.pot +type = PO +minimum_perc = 0 +resource_name = c-api--bytearray +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--bytes] +file_filter = c-api/bytes.po +trans.pt_BR = c-api/bytes.po +source_file = ../build/gettext/c-api/bytes.pot +type = PO +minimum_perc = 0 +resource_name = c-api--bytes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--call] +file_filter = c-api/call.po +trans.pt_BR = c-api/call.po +source_file = ../build/gettext/c-api/call.pot +type = PO +minimum_perc = 0 +resource_name = c-api--call +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--capsule] +file_filter = c-api/capsule.po +trans.pt_BR = c-api/capsule.po +source_file = ../build/gettext/c-api/capsule.pot +type = PO +minimum_perc = 0 +resource_name = c-api--capsule +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--cell] +file_filter = c-api/cell.po +trans.pt_BR = c-api/cell.po +source_file = ../build/gettext/c-api/cell.pot +type = PO +minimum_perc = 0 +resource_name = c-api--cell +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--code] +file_filter = c-api/code.po +trans.pt_BR = c-api/code.po +source_file = ../build/gettext/c-api/code.pot +type = PO +minimum_perc = 0 +resource_name = c-api--code +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--codec] +file_filter = c-api/codec.po +trans.pt_BR = c-api/codec.po +source_file = ../build/gettext/c-api/codec.pot +type = PO +minimum_perc = 0 +resource_name = c-api--codec +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--complex] +file_filter = c-api/complex.po +trans.pt_BR = c-api/complex.po +source_file = ../build/gettext/c-api/complex.pot +type = PO +minimum_perc = 0 +resource_name = c-api--complex +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--concrete] +file_filter = c-api/concrete.po +trans.pt_BR = c-api/concrete.po +source_file = ../build/gettext/c-api/concrete.pot +type = PO +minimum_perc = 0 +resource_name = c-api--concrete +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--contextvars] +file_filter = c-api/contextvars.po +trans.pt_BR = c-api/contextvars.po +source_file = ../build/gettext/c-api/contextvars.pot +type = PO +minimum_perc = 0 +resource_name = c-api--contextvars +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--conversion] +file_filter = c-api/conversion.po +trans.pt_BR = c-api/conversion.po +source_file = ../build/gettext/c-api/conversion.pot +type = PO +minimum_perc = 0 +resource_name = c-api--conversion +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--coro] +file_filter = c-api/coro.po +trans.pt_BR = c-api/coro.po +source_file = ../build/gettext/c-api/coro.pot +type = PO +minimum_perc = 0 +resource_name = c-api--coro +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--datetime] +file_filter = c-api/datetime.po +trans.pt_BR = c-api/datetime.po +source_file = ../build/gettext/c-api/datetime.pot +type = PO +minimum_perc = 0 +resource_name = c-api--datetime +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--descriptor] +file_filter = c-api/descriptor.po +trans.pt_BR = c-api/descriptor.po +source_file = ../build/gettext/c-api/descriptor.pot +type = PO +minimum_perc = 0 +resource_name = c-api--descriptor +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--dict] +file_filter = c-api/dict.po +trans.pt_BR = c-api/dict.po +source_file = ../build/gettext/c-api/dict.pot +type = PO +minimum_perc = 0 +resource_name = c-api--dict +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--exceptions] +file_filter = c-api/exceptions.po +trans.pt_BR = c-api/exceptions.po +source_file = ../build/gettext/c-api/exceptions.pot +type = PO +minimum_perc = 0 +resource_name = c-api--exceptions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--file] +file_filter = c-api/file.po +trans.pt_BR = c-api/file.po +source_file = ../build/gettext/c-api/file.pot +type = PO +minimum_perc = 0 +resource_name = c-api--file +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--float] +file_filter = c-api/float.po +trans.pt_BR = c-api/float.po +source_file = ../build/gettext/c-api/float.pot +type = PO +minimum_perc = 0 +resource_name = c-api--float +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--frame] +file_filter = c-api/frame.po +trans.pt_BR = c-api/frame.po +source_file = ../build/gettext/c-api/frame.pot +type = PO +minimum_perc = 0 +resource_name = c-api--frame +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--function] +file_filter = c-api/function.po +trans.pt_BR = c-api/function.po +source_file = ../build/gettext/c-api/function.pot +type = PO +minimum_perc = 0 +resource_name = c-api--function +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--gcsupport] +file_filter = c-api/gcsupport.po +trans.pt_BR = c-api/gcsupport.po +source_file = ../build/gettext/c-api/gcsupport.pot +type = PO +minimum_perc = 0 +resource_name = c-api--gcsupport +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--gen] +file_filter = c-api/gen.po +trans.pt_BR = c-api/gen.po +source_file = ../build/gettext/c-api/gen.pot +type = PO +minimum_perc = 0 +resource_name = c-api--gen +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--hash] +file_filter = c-api/hash.po +trans.pt_BR = c-api/hash.po +source_file = ../build/gettext/c-api/hash.pot +type = PO +minimum_perc = 0 +resource_name = c-api--hash +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--import] +file_filter = c-api/import.po +trans.pt_BR = c-api/import.po +source_file = ../build/gettext/c-api/import.pot +type = PO +minimum_perc = 0 +resource_name = c-api--import +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--index] +file_filter = c-api/index.po +trans.pt_BR = c-api/index.po +source_file = ../build/gettext/c-api/index.pot +type = PO +minimum_perc = 0 +resource_name = c-api--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--init] +file_filter = c-api/init.po +trans.pt_BR = c-api/init.po +source_file = ../build/gettext/c-api/init.pot +type = PO +minimum_perc = 0 +resource_name = c-api--init +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--init_config] +file_filter = c-api/init_config.po +trans.pt_BR = c-api/init_config.po +source_file = ../build/gettext/c-api/init_config.pot +type = PO +minimum_perc = 0 +resource_name = c-api--init_config +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--intro] +file_filter = c-api/intro.po +trans.pt_BR = c-api/intro.po +source_file = ../build/gettext/c-api/intro.pot +type = PO +minimum_perc = 0 +resource_name = c-api--intro +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--iter] +file_filter = c-api/iter.po +trans.pt_BR = c-api/iter.po +source_file = ../build/gettext/c-api/iter.pot +type = PO +minimum_perc = 0 +resource_name = c-api--iter +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--iterator] +file_filter = c-api/iterator.po +trans.pt_BR = c-api/iterator.po +source_file = ../build/gettext/c-api/iterator.pot +type = PO +minimum_perc = 0 +resource_name = c-api--iterator +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--list] +file_filter = c-api/list.po +trans.pt_BR = c-api/list.po +source_file = ../build/gettext/c-api/list.pot +type = PO +minimum_perc = 0 +resource_name = c-api--list +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--long] +file_filter = c-api/long.po +trans.pt_BR = c-api/long.po +source_file = ../build/gettext/c-api/long.pot +type = PO +minimum_perc = 0 +resource_name = c-api--long +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--mapping] +file_filter = c-api/mapping.po +trans.pt_BR = c-api/mapping.po +source_file = ../build/gettext/c-api/mapping.pot +type = PO +minimum_perc = 0 +resource_name = c-api--mapping +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--marshal] +file_filter = c-api/marshal.po +trans.pt_BR = c-api/marshal.po +source_file = ../build/gettext/c-api/marshal.pot +type = PO +minimum_perc = 0 +resource_name = c-api--marshal +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--memory] +file_filter = c-api/memory.po +trans.pt_BR = c-api/memory.po +source_file = ../build/gettext/c-api/memory.pot +type = PO +minimum_perc = 0 +resource_name = c-api--memory +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--memoryview] +file_filter = c-api/memoryview.po +trans.pt_BR = c-api/memoryview.po +source_file = ../build/gettext/c-api/memoryview.pot +type = PO +minimum_perc = 0 +resource_name = c-api--memoryview +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--method] +file_filter = c-api/method.po +trans.pt_BR = c-api/method.po +source_file = ../build/gettext/c-api/method.pot +type = PO +minimum_perc = 0 +resource_name = c-api--method +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--module] +file_filter = c-api/module.po +trans.pt_BR = c-api/module.po +source_file = ../build/gettext/c-api/module.pot +type = PO +minimum_perc = 0 +resource_name = c-api--module +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--none] +file_filter = c-api/none.po +trans.pt_BR = c-api/none.po +source_file = ../build/gettext/c-api/none.pot +type = PO +minimum_perc = 0 +resource_name = c-api--none +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--number] +file_filter = c-api/number.po +trans.pt_BR = c-api/number.po +source_file = ../build/gettext/c-api/number.pot +type = PO +minimum_perc = 0 +resource_name = c-api--number +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--objbuffer] +file_filter = c-api/objbuffer.po +trans.pt_BR = c-api/objbuffer.po +source_file = ../build/gettext/c-api/objbuffer.pot +type = PO +minimum_perc = 0 +resource_name = c-api--objbuffer +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--object] +file_filter = c-api/object.po +trans.pt_BR = c-api/object.po +source_file = ../build/gettext/c-api/object.pot +type = PO +minimum_perc = 0 +resource_name = c-api--object +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--objimpl] +file_filter = c-api/objimpl.po +trans.pt_BR = c-api/objimpl.po +source_file = ../build/gettext/c-api/objimpl.pot +type = PO +minimum_perc = 0 +resource_name = c-api--objimpl +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--perfmaps] +file_filter = c-api/perfmaps.po +trans.pt_BR = c-api/perfmaps.po +source_file = ../build/gettext/c-api/perfmaps.pot +type = PO +minimum_perc = 0 +resource_name = c-api--perfmaps +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--refcounting] +file_filter = c-api/refcounting.po +trans.pt_BR = c-api/refcounting.po +source_file = ../build/gettext/c-api/refcounting.pot +type = PO +minimum_perc = 0 +resource_name = c-api--refcounting +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--reflection] +file_filter = c-api/reflection.po +trans.pt_BR = c-api/reflection.po +source_file = ../build/gettext/c-api/reflection.pot +type = PO +minimum_perc = 0 +resource_name = c-api--reflection +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--sequence] +file_filter = c-api/sequence.po +trans.pt_BR = c-api/sequence.po +source_file = ../build/gettext/c-api/sequence.pot +type = PO +minimum_perc = 0 +resource_name = c-api--sequence +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--set] +file_filter = c-api/set.po +trans.pt_BR = c-api/set.po +source_file = ../build/gettext/c-api/set.pot +type = PO +minimum_perc = 0 +resource_name = c-api--set +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--slice] +file_filter = c-api/slice.po +trans.pt_BR = c-api/slice.po +source_file = ../build/gettext/c-api/slice.pot +type = PO +minimum_perc = 0 +resource_name = c-api--slice +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--stable] +file_filter = c-api/stable.po +trans.pt_BR = c-api/stable.po +source_file = ../build/gettext/c-api/stable.pot +type = PO +minimum_perc = 0 +resource_name = c-api--stable +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--structures] +file_filter = c-api/structures.po +trans.pt_BR = c-api/structures.po +source_file = ../build/gettext/c-api/structures.pot +type = PO +minimum_perc = 0 +resource_name = c-api--structures +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--sys] +file_filter = c-api/sys.po +trans.pt_BR = c-api/sys.po +source_file = ../build/gettext/c-api/sys.pot +type = PO +minimum_perc = 0 +resource_name = c-api--sys +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--tuple] +file_filter = c-api/tuple.po +trans.pt_BR = c-api/tuple.po +source_file = ../build/gettext/c-api/tuple.pot +type = PO +minimum_perc = 0 +resource_name = c-api--tuple +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--type] +file_filter = c-api/type.po +trans.pt_BR = c-api/type.po +source_file = ../build/gettext/c-api/type.pot +type = PO +minimum_perc = 0 +resource_name = c-api--type +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--typehints] +file_filter = c-api/typehints.po +trans.pt_BR = c-api/typehints.po +source_file = ../build/gettext/c-api/typehints.pot +type = PO +minimum_perc = 0 +resource_name = c-api--typehints +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--typeobj] +file_filter = c-api/typeobj.po +trans.pt_BR = c-api/typeobj.po +source_file = ../build/gettext/c-api/typeobj.pot +type = PO +minimum_perc = 0 +resource_name = c-api--typeobj +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--unicode] +file_filter = c-api/unicode.po +trans.pt_BR = c-api/unicode.po +source_file = ../build/gettext/c-api/unicode.pot +type = PO +minimum_perc = 0 +resource_name = c-api--unicode +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--utilities] +file_filter = c-api/utilities.po +trans.pt_BR = c-api/utilities.po +source_file = ../build/gettext/c-api/utilities.pot +type = PO +minimum_perc = 0 +resource_name = c-api--utilities +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--veryhigh] +file_filter = c-api/veryhigh.po +trans.pt_BR = c-api/veryhigh.po +source_file = ../build/gettext/c-api/veryhigh.pot +type = PO +minimum_perc = 0 +resource_name = c-api--veryhigh +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:c-api--weakref] +file_filter = c-api/weakref.po +trans.pt_BR = c-api/weakref.po +source_file = ../build/gettext/c-api/weakref.pot +type = PO +minimum_perc = 0 +resource_name = c-api--weakref +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:contents] +file_filter = contents.po +trans.pt_BR = contents.po +source_file = ../build/gettext/contents.pot +type = PO +minimum_perc = 0 +resource_name = contents +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:copyright] +file_filter = copyright.po +trans.pt_BR = copyright.po +source_file = ../build/gettext/copyright.pot +type = PO +minimum_perc = 0 +resource_name = copyright +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--c-api-pending-removal-in-3_14] +file_filter = deprecations/c-api-pending-removal-in-3.14.po +trans.pt_BR = deprecations/c-api-pending-removal-in-3.14.po +source_file = ../build/gettext/deprecations/c-api-pending-removal-in-3.14.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--c-api-pending-removal-in-3_14 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--c-api-pending-removal-in-3_15] +file_filter = deprecations/c-api-pending-removal-in-3.15.po +trans.pt_BR = deprecations/c-api-pending-removal-in-3.15.po +source_file = ../build/gettext/deprecations/c-api-pending-removal-in-3.15.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--c-api-pending-removal-in-3_15 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--c-api-pending-removal-in-future] +file_filter = deprecations/c-api-pending-removal-in-future.po +trans.pt_BR = deprecations/c-api-pending-removal-in-future.po +source_file = ../build/gettext/deprecations/c-api-pending-removal-in-future.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--c-api-pending-removal-in-future +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--index] +file_filter = deprecations/index.po +trans.pt_BR = deprecations/index.po +source_file = ../build/gettext/deprecations/index.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--pending-removal-in-3_13] +file_filter = deprecations/pending-removal-in-3.13.po +trans.pt_BR = deprecations/pending-removal-in-3.13.po +source_file = ../build/gettext/deprecations/pending-removal-in-3.13.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--pending-removal-in-3_13 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--pending-removal-in-3_14] +file_filter = deprecations/pending-removal-in-3.14.po +trans.pt_BR = deprecations/pending-removal-in-3.14.po +source_file = ../build/gettext/deprecations/pending-removal-in-3.14.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--pending-removal-in-3_14 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--pending-removal-in-3_15] +file_filter = deprecations/pending-removal-in-3.15.po +trans.pt_BR = deprecations/pending-removal-in-3.15.po +source_file = ../build/gettext/deprecations/pending-removal-in-3.15.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--pending-removal-in-3_15 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--pending-removal-in-3_16] +file_filter = deprecations/pending-removal-in-3.16.po +trans.pt_BR = deprecations/pending-removal-in-3.16.po +source_file = ../build/gettext/deprecations/pending-removal-in-3.16.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--pending-removal-in-3_16 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:deprecations--pending-removal-in-future] +file_filter = deprecations/pending-removal-in-future.po +trans.pt_BR = deprecations/pending-removal-in-future.po +source_file = ../build/gettext/deprecations/pending-removal-in-future.pot +type = PO +minimum_perc = 0 +resource_name = deprecations--pending-removal-in-future +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:distributing--index] +file_filter = distributing/index.po +trans.pt_BR = distributing/index.po +source_file = ../build/gettext/distributing/index.pot +type = PO +minimum_perc = 0 +resource_name = distributing--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:extending--building] +file_filter = extending/building.po +trans.pt_BR = extending/building.po +source_file = ../build/gettext/extending/building.pot +type = PO +minimum_perc = 0 +resource_name = extending--building +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:extending--embedding] +file_filter = extending/embedding.po +trans.pt_BR = extending/embedding.po +source_file = ../build/gettext/extending/embedding.pot +type = PO +minimum_perc = 0 +resource_name = extending--embedding +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:extending--extending] +file_filter = extending/extending.po +trans.pt_BR = extending/extending.po +source_file = ../build/gettext/extending/extending.pot +type = PO +minimum_perc = 0 +resource_name = extending--extending +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:extending--index] +file_filter = extending/index.po +trans.pt_BR = extending/index.po +source_file = ../build/gettext/extending/index.pot +type = PO +minimum_perc = 0 +resource_name = extending--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:extending--newtypes] +file_filter = extending/newtypes.po +trans.pt_BR = extending/newtypes.po +source_file = ../build/gettext/extending/newtypes.pot +type = PO +minimum_perc = 0 +resource_name = extending--newtypes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:extending--newtypes_tutorial] +file_filter = extending/newtypes_tutorial.po +trans.pt_BR = extending/newtypes_tutorial.po +source_file = ../build/gettext/extending/newtypes_tutorial.pot +type = PO +minimum_perc = 0 +resource_name = extending--newtypes_tutorial +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:extending--windows] +file_filter = extending/windows.po +trans.pt_BR = extending/windows.po +source_file = ../build/gettext/extending/windows.pot +type = PO +minimum_perc = 0 +resource_name = extending--windows +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--design] +file_filter = faq/design.po +trans.pt_BR = faq/design.po +source_file = ../build/gettext/faq/design.pot +type = PO +minimum_perc = 0 +resource_name = faq--design +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--extending] +file_filter = faq/extending.po +trans.pt_BR = faq/extending.po +source_file = ../build/gettext/faq/extending.pot +type = PO +minimum_perc = 0 +resource_name = faq--extending +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--general] +file_filter = faq/general.po +trans.pt_BR = faq/general.po +source_file = ../build/gettext/faq/general.pot +type = PO +minimum_perc = 0 +resource_name = faq--general +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--gui] +file_filter = faq/gui.po +trans.pt_BR = faq/gui.po +source_file = ../build/gettext/faq/gui.pot +type = PO +minimum_perc = 0 +resource_name = faq--gui +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--index] +file_filter = faq/index.po +trans.pt_BR = faq/index.po +source_file = ../build/gettext/faq/index.pot +type = PO +minimum_perc = 0 +resource_name = faq--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--installed] +file_filter = faq/installed.po +trans.pt_BR = faq/installed.po +source_file = ../build/gettext/faq/installed.pot +type = PO +minimum_perc = 0 +resource_name = faq--installed +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--library] +file_filter = faq/library.po +trans.pt_BR = faq/library.po +source_file = ../build/gettext/faq/library.pot +type = PO +minimum_perc = 0 +resource_name = faq--library +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--programming] +file_filter = faq/programming.po +trans.pt_BR = faq/programming.po +source_file = ../build/gettext/faq/programming.pot +type = PO +minimum_perc = 0 +resource_name = faq--programming +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:faq--windows] +file_filter = faq/windows.po +trans.pt_BR = faq/windows.po +source_file = ../build/gettext/faq/windows.pot +type = PO +minimum_perc = 0 +resource_name = faq--windows +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:glossary_] +file_filter = glossary.po +trans.pt_BR = glossary.po +source_file = ../build/gettext/glossary.pot +type = PO +minimum_perc = 0 +resource_name = glossary_ +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--annotations] +file_filter = howto/annotations.po +trans.pt_BR = howto/annotations.po +source_file = ../build/gettext/howto/annotations.pot +type = PO +minimum_perc = 0 +resource_name = howto--annotations +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--argparse] +file_filter = howto/argparse.po +trans.pt_BR = howto/argparse.po +source_file = ../build/gettext/howto/argparse.pot +type = PO +minimum_perc = 0 +resource_name = howto--argparse +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--clinic] +file_filter = howto/clinic.po +trans.pt_BR = howto/clinic.po +source_file = ../build/gettext/howto/clinic.pot +type = PO +minimum_perc = 0 +resource_name = howto--clinic +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--cporting] +file_filter = howto/cporting.po +trans.pt_BR = howto/cporting.po +source_file = ../build/gettext/howto/cporting.pot +type = PO +minimum_perc = 0 +resource_name = howto--cporting +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--curses] +file_filter = howto/curses.po +trans.pt_BR = howto/curses.po +source_file = ../build/gettext/howto/curses.pot +type = PO +minimum_perc = 0 +resource_name = howto--curses +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--descriptor] +file_filter = howto/descriptor.po +trans.pt_BR = howto/descriptor.po +source_file = ../build/gettext/howto/descriptor.pot +type = PO +minimum_perc = 0 +resource_name = howto--descriptor +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--enum] +file_filter = howto/enum.po +trans.pt_BR = howto/enum.po +source_file = ../build/gettext/howto/enum.pot +type = PO +minimum_perc = 0 +resource_name = howto--enum +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--functional] +file_filter = howto/functional.po +trans.pt_BR = howto/functional.po +source_file = ../build/gettext/howto/functional.pot +type = PO +minimum_perc = 0 +resource_name = howto--functional +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--gdb_helpers] +file_filter = howto/gdb_helpers.po +trans.pt_BR = howto/gdb_helpers.po +source_file = ../build/gettext/howto/gdb_helpers.pot +type = PO +minimum_perc = 0 +resource_name = howto--gdb_helpers +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--index] +file_filter = howto/index.po +trans.pt_BR = howto/index.po +source_file = ../build/gettext/howto/index.pot +type = PO +minimum_perc = 0 +resource_name = howto--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--instrumentation] +file_filter = howto/instrumentation.po +trans.pt_BR = howto/instrumentation.po +source_file = ../build/gettext/howto/instrumentation.pot +type = PO +minimum_perc = 0 +resource_name = howto--instrumentation +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--ipaddress] +file_filter = howto/ipaddress.po +trans.pt_BR = howto/ipaddress.po +source_file = ../build/gettext/howto/ipaddress.pot +type = PO +minimum_perc = 0 +resource_name = howto--ipaddress +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--isolating-extensions] +file_filter = howto/isolating-extensions.po +trans.pt_BR = howto/isolating-extensions.po +source_file = ../build/gettext/howto/isolating-extensions.pot +type = PO +minimum_perc = 0 +resource_name = howto--isolating-extensions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--logging] +file_filter = howto/logging.po +trans.pt_BR = howto/logging.po +source_file = ../build/gettext/howto/logging.pot +type = PO +minimum_perc = 0 +resource_name = howto--logging +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--logging-cookbook] +file_filter = howto/logging-cookbook.po +trans.pt_BR = howto/logging-cookbook.po +source_file = ../build/gettext/howto/logging-cookbook.pot +type = PO +minimum_perc = 0 +resource_name = howto--logging-cookbook +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--mro] +file_filter = howto/mro.po +trans.pt_BR = howto/mro.po +source_file = ../build/gettext/howto/mro.pot +type = PO +minimum_perc = 0 +resource_name = howto--mro +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--perf_profiling] +file_filter = howto/perf_profiling.po +trans.pt_BR = howto/perf_profiling.po +source_file = ../build/gettext/howto/perf_profiling.pot +type = PO +minimum_perc = 0 +resource_name = howto--perf_profiling +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--pyporting] +file_filter = howto/pyporting.po +trans.pt_BR = howto/pyporting.po +source_file = ../build/gettext/howto/pyporting.pot +type = PO +minimum_perc = 0 +resource_name = howto--pyporting +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--regex] +file_filter = howto/regex.po +trans.pt_BR = howto/regex.po +source_file = ../build/gettext/howto/regex.pot +type = PO +minimum_perc = 0 +resource_name = howto--regex +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--sockets] +file_filter = howto/sockets.po +trans.pt_BR = howto/sockets.po +source_file = ../build/gettext/howto/sockets.pot +type = PO +minimum_perc = 0 +resource_name = howto--sockets +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--sorting] +file_filter = howto/sorting.po +trans.pt_BR = howto/sorting.po +source_file = ../build/gettext/howto/sorting.pot +type = PO +minimum_perc = 0 +resource_name = howto--sorting +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--unicode] +file_filter = howto/unicode.po +trans.pt_BR = howto/unicode.po +source_file = ../build/gettext/howto/unicode.pot +type = PO +minimum_perc = 0 +resource_name = howto--unicode +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:howto--urllib2] +file_filter = howto/urllib2.po +trans.pt_BR = howto/urllib2.po +source_file = ../build/gettext/howto/urllib2.pot +type = PO +minimum_perc = 0 +resource_name = howto--urllib2 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:installing--index] +file_filter = installing/index.po +trans.pt_BR = installing/index.po +source_file = ../build/gettext/installing/index.pot +type = PO +minimum_perc = 0 +resource_name = installing--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--2to3] +file_filter = library/2to3.po +trans.pt_BR = library/2to3.po +source_file = ../build/gettext/library/2to3.pot +type = PO +minimum_perc = 0 +resource_name = library--2to3 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--__future__] +file_filter = library/__future__.po +trans.pt_BR = library/__future__.po +source_file = ../build/gettext/library/__future__.pot +type = PO +minimum_perc = 0 +resource_name = library--__future__ +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--__main__] +file_filter = library/__main__.po +trans.pt_BR = library/__main__.po +source_file = ../build/gettext/library/__main__.pot +type = PO +minimum_perc = 0 +resource_name = library--__main__ +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--_thread] +file_filter = library/_thread.po +trans.pt_BR = library/_thread.po +source_file = ../build/gettext/library/_thread.pot +type = PO +minimum_perc = 0 +resource_name = library--_thread +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--abc] +file_filter = library/abc.po +trans.pt_BR = library/abc.po +source_file = ../build/gettext/library/abc.pot +type = PO +minimum_perc = 0 +resource_name = library--abc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--aifc] +file_filter = library/aifc.po +trans.pt_BR = library/aifc.po +source_file = ../build/gettext/library/aifc.pot +type = PO +minimum_perc = 0 +resource_name = library--aifc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--allos] +file_filter = library/allos.po +trans.pt_BR = library/allos.po +source_file = ../build/gettext/library/allos.pot +type = PO +minimum_perc = 0 +resource_name = library--allos +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--archiving] +file_filter = library/archiving.po +trans.pt_BR = library/archiving.po +source_file = ../build/gettext/library/archiving.pot +type = PO +minimum_perc = 0 +resource_name = library--archiving +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--argparse] +file_filter = library/argparse.po +trans.pt_BR = library/argparse.po +source_file = ../build/gettext/library/argparse.pot +type = PO +minimum_perc = 0 +resource_name = library--argparse +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--array] +file_filter = library/array.po +trans.pt_BR = library/array.po +source_file = ../build/gettext/library/array.pot +type = PO +minimum_perc = 0 +resource_name = library--array +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ast] +file_filter = library/ast.po +trans.pt_BR = library/ast.po +source_file = ../build/gettext/library/ast.pot +type = PO +minimum_perc = 0 +resource_name = library--ast +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio] +file_filter = library/asyncio.po +trans.pt_BR = library/asyncio.po +source_file = ../build/gettext/library/asyncio.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-api-index] +file_filter = library/asyncio-api-index.po +trans.pt_BR = library/asyncio-api-index.po +source_file = ../build/gettext/library/asyncio-api-index.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-api-index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-dev] +file_filter = library/asyncio-dev.po +trans.pt_BR = library/asyncio-dev.po +source_file = ../build/gettext/library/asyncio-dev.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-dev +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-eventloop] +file_filter = library/asyncio-eventloop.po +trans.pt_BR = library/asyncio-eventloop.po +source_file = ../build/gettext/library/asyncio-eventloop.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-eventloop +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-exceptions] +file_filter = library/asyncio-exceptions.po +trans.pt_BR = library/asyncio-exceptions.po +source_file = ../build/gettext/library/asyncio-exceptions.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-exceptions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-extending] +file_filter = library/asyncio-extending.po +trans.pt_BR = library/asyncio-extending.po +source_file = ../build/gettext/library/asyncio-extending.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-extending +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-future] +file_filter = library/asyncio-future.po +trans.pt_BR = library/asyncio-future.po +source_file = ../build/gettext/library/asyncio-future.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-future +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-llapi-index] +file_filter = library/asyncio-llapi-index.po +trans.pt_BR = library/asyncio-llapi-index.po +source_file = ../build/gettext/library/asyncio-llapi-index.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-llapi-index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-platforms] +file_filter = library/asyncio-platforms.po +trans.pt_BR = library/asyncio-platforms.po +source_file = ../build/gettext/library/asyncio-platforms.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-platforms +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-policy] +file_filter = library/asyncio-policy.po +trans.pt_BR = library/asyncio-policy.po +source_file = ../build/gettext/library/asyncio-policy.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-policy +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-protocol] +file_filter = library/asyncio-protocol.po +trans.pt_BR = library/asyncio-protocol.po +source_file = ../build/gettext/library/asyncio-protocol.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-protocol +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-queue] +file_filter = library/asyncio-queue.po +trans.pt_BR = library/asyncio-queue.po +source_file = ../build/gettext/library/asyncio-queue.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-queue +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-runner] +file_filter = library/asyncio-runner.po +trans.pt_BR = library/asyncio-runner.po +source_file = ../build/gettext/library/asyncio-runner.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-runner +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-stream] +file_filter = library/asyncio-stream.po +trans.pt_BR = library/asyncio-stream.po +source_file = ../build/gettext/library/asyncio-stream.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-stream +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-subprocess] +file_filter = library/asyncio-subprocess.po +trans.pt_BR = library/asyncio-subprocess.po +source_file = ../build/gettext/library/asyncio-subprocess.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-subprocess +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-sync] +file_filter = library/asyncio-sync.po +trans.pt_BR = library/asyncio-sync.po +source_file = ../build/gettext/library/asyncio-sync.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-sync +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--asyncio-task] +file_filter = library/asyncio-task.po +trans.pt_BR = library/asyncio-task.po +source_file = ../build/gettext/library/asyncio-task.pot +type = PO +minimum_perc = 0 +resource_name = library--asyncio-task +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--atexit] +file_filter = library/atexit.po +trans.pt_BR = library/atexit.po +source_file = ../build/gettext/library/atexit.pot +type = PO +minimum_perc = 0 +resource_name = library--atexit +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--audioop] +file_filter = library/audioop.po +trans.pt_BR = library/audioop.po +source_file = ../build/gettext/library/audioop.pot +type = PO +minimum_perc = 0 +resource_name = library--audioop +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--audit_events] +file_filter = library/audit_events.po +trans.pt_BR = library/audit_events.po +source_file = ../build/gettext/library/audit_events.pot +type = PO +minimum_perc = 0 +resource_name = library--audit_events +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--base64] +file_filter = library/base64.po +trans.pt_BR = library/base64.po +source_file = ../build/gettext/library/base64.pot +type = PO +minimum_perc = 0 +resource_name = library--base64 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--bdb] +file_filter = library/bdb.po +trans.pt_BR = library/bdb.po +source_file = ../build/gettext/library/bdb.pot +type = PO +minimum_perc = 0 +resource_name = library--bdb +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--binary] +file_filter = library/binary.po +trans.pt_BR = library/binary.po +source_file = ../build/gettext/library/binary.pot +type = PO +minimum_perc = 0 +resource_name = library--binary +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--binascii] +file_filter = library/binascii.po +trans.pt_BR = library/binascii.po +source_file = ../build/gettext/library/binascii.pot +type = PO +minimum_perc = 0 +resource_name = library--binascii +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--bisect] +file_filter = library/bisect.po +trans.pt_BR = library/bisect.po +source_file = ../build/gettext/library/bisect.pot +type = PO +minimum_perc = 0 +resource_name = library--bisect +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--builtins] +file_filter = library/builtins.po +trans.pt_BR = library/builtins.po +source_file = ../build/gettext/library/builtins.pot +type = PO +minimum_perc = 0 +resource_name = library--builtins +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--bz2] +file_filter = library/bz2.po +trans.pt_BR = library/bz2.po +source_file = ../build/gettext/library/bz2.pot +type = PO +minimum_perc = 0 +resource_name = library--bz2 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--calendar] +file_filter = library/calendar.po +trans.pt_BR = library/calendar.po +source_file = ../build/gettext/library/calendar.pot +type = PO +minimum_perc = 0 +resource_name = library--calendar +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--cgi] +file_filter = library/cgi.po +trans.pt_BR = library/cgi.po +source_file = ../build/gettext/library/cgi.pot +type = PO +minimum_perc = 0 +resource_name = library--cgi +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--cgitb] +file_filter = library/cgitb.po +trans.pt_BR = library/cgitb.po +source_file = ../build/gettext/library/cgitb.pot +type = PO +minimum_perc = 0 +resource_name = library--cgitb +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--chunk] +file_filter = library/chunk.po +trans.pt_BR = library/chunk.po +source_file = ../build/gettext/library/chunk.pot +type = PO +minimum_perc = 0 +resource_name = library--chunk +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--cmath] +file_filter = library/cmath.po +trans.pt_BR = library/cmath.po +source_file = ../build/gettext/library/cmath.pot +type = PO +minimum_perc = 0 +resource_name = library--cmath +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--cmd] +file_filter = library/cmd.po +trans.pt_BR = library/cmd.po +source_file = ../build/gettext/library/cmd.pot +type = PO +minimum_perc = 0 +resource_name = library--cmd +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--cmdline] +file_filter = library/cmdline.po +trans.pt_BR = library/cmdline.po +source_file = ../build/gettext/library/cmdline.pot +type = PO +minimum_perc = 0 +resource_name = library--cmdline +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--code] +file_filter = library/code.po +trans.pt_BR = library/code.po +source_file = ../build/gettext/library/code.pot +type = PO +minimum_perc = 0 +resource_name = library--code +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--codecs] +file_filter = library/codecs.po +trans.pt_BR = library/codecs.po +source_file = ../build/gettext/library/codecs.pot +type = PO +minimum_perc = 0 +resource_name = library--codecs +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--codeop] +file_filter = library/codeop.po +trans.pt_BR = library/codeop.po +source_file = ../build/gettext/library/codeop.pot +type = PO +minimum_perc = 0 +resource_name = library--codeop +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--collections] +file_filter = library/collections.po +trans.pt_BR = library/collections.po +source_file = ../build/gettext/library/collections.pot +type = PO +minimum_perc = 0 +resource_name = library--collections +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--collections_abc] +file_filter = library/collections.abc.po +trans.pt_BR = library/collections.abc.po +source_file = ../build/gettext/library/collections.abc.pot +type = PO +minimum_perc = 0 +resource_name = library--collections_abc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--colorsys] +file_filter = library/colorsys.po +trans.pt_BR = library/colorsys.po +source_file = ../build/gettext/library/colorsys.pot +type = PO +minimum_perc = 0 +resource_name = library--colorsys +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--compileall] +file_filter = library/compileall.po +trans.pt_BR = library/compileall.po +source_file = ../build/gettext/library/compileall.pot +type = PO +minimum_perc = 0 +resource_name = library--compileall +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--concurrency] +file_filter = library/concurrency.po +trans.pt_BR = library/concurrency.po +source_file = ../build/gettext/library/concurrency.pot +type = PO +minimum_perc = 0 +resource_name = library--concurrency +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--concurrent] +file_filter = library/concurrent.po +trans.pt_BR = library/concurrent.po +source_file = ../build/gettext/library/concurrent.pot +type = PO +minimum_perc = 0 +resource_name = library--concurrent +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--concurrent_futures] +file_filter = library/concurrent.futures.po +trans.pt_BR = library/concurrent.futures.po +source_file = ../build/gettext/library/concurrent.futures.pot +type = PO +minimum_perc = 0 +resource_name = library--concurrent_futures +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--configparser] +file_filter = library/configparser.po +trans.pt_BR = library/configparser.po +source_file = ../build/gettext/library/configparser.pot +type = PO +minimum_perc = 0 +resource_name = library--configparser +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--constants] +file_filter = library/constants.po +trans.pt_BR = library/constants.po +source_file = ../build/gettext/library/constants.pot +type = PO +minimum_perc = 0 +resource_name = library--constants +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--contextlib] +file_filter = library/contextlib.po +trans.pt_BR = library/contextlib.po +source_file = ../build/gettext/library/contextlib.pot +type = PO +minimum_perc = 0 +resource_name = library--contextlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--contextvars] +file_filter = library/contextvars.po +trans.pt_BR = library/contextvars.po +source_file = ../build/gettext/library/contextvars.pot +type = PO +minimum_perc = 0 +resource_name = library--contextvars +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--copy] +file_filter = library/copy.po +trans.pt_BR = library/copy.po +source_file = ../build/gettext/library/copy.pot +type = PO +minimum_perc = 0 +resource_name = library--copy +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--copyreg] +file_filter = library/copyreg.po +trans.pt_BR = library/copyreg.po +source_file = ../build/gettext/library/copyreg.pot +type = PO +minimum_perc = 0 +resource_name = library--copyreg +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--crypt] +file_filter = library/crypt.po +trans.pt_BR = library/crypt.po +source_file = ../build/gettext/library/crypt.pot +type = PO +minimum_perc = 0 +resource_name = library--crypt +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--crypto] +file_filter = library/crypto.po +trans.pt_BR = library/crypto.po +source_file = ../build/gettext/library/crypto.pot +type = PO +minimum_perc = 0 +resource_name = library--crypto +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--csv] +file_filter = library/csv.po +trans.pt_BR = library/csv.po +source_file = ../build/gettext/library/csv.pot +type = PO +minimum_perc = 0 +resource_name = library--csv +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ctypes] +file_filter = library/ctypes.po +trans.pt_BR = library/ctypes.po +source_file = ../build/gettext/library/ctypes.pot +type = PO +minimum_perc = 0 +resource_name = library--ctypes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--curses] +file_filter = library/curses.po +trans.pt_BR = library/curses.po +source_file = ../build/gettext/library/curses.pot +type = PO +minimum_perc = 0 +resource_name = library--curses +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--curses_ascii] +file_filter = library/curses.ascii.po +trans.pt_BR = library/curses.ascii.po +source_file = ../build/gettext/library/curses.ascii.pot +type = PO +minimum_perc = 0 +resource_name = library--curses_ascii +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--curses_panel] +file_filter = library/curses.panel.po +trans.pt_BR = library/curses.panel.po +source_file = ../build/gettext/library/curses.panel.pot +type = PO +minimum_perc = 0 +resource_name = library--curses_panel +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--custominterp] +file_filter = library/custominterp.po +trans.pt_BR = library/custominterp.po +source_file = ../build/gettext/library/custominterp.pot +type = PO +minimum_perc = 0 +resource_name = library--custominterp +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--dataclasses] +file_filter = library/dataclasses.po +trans.pt_BR = library/dataclasses.po +source_file = ../build/gettext/library/dataclasses.pot +type = PO +minimum_perc = 0 +resource_name = library--dataclasses +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--datatypes] +file_filter = library/datatypes.po +trans.pt_BR = library/datatypes.po +source_file = ../build/gettext/library/datatypes.pot +type = PO +minimum_perc = 0 +resource_name = library--datatypes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--datetime] +file_filter = library/datetime.po +trans.pt_BR = library/datetime.po +source_file = ../build/gettext/library/datetime.pot +type = PO +minimum_perc = 0 +resource_name = library--datetime +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--dbm] +file_filter = library/dbm.po +trans.pt_BR = library/dbm.po +source_file = ../build/gettext/library/dbm.pot +type = PO +minimum_perc = 0 +resource_name = library--dbm +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--debug] +file_filter = library/debug.po +trans.pt_BR = library/debug.po +source_file = ../build/gettext/library/debug.pot +type = PO +minimum_perc = 0 +resource_name = library--debug +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--decimal] +file_filter = library/decimal.po +trans.pt_BR = library/decimal.po +source_file = ../build/gettext/library/decimal.pot +type = PO +minimum_perc = 0 +resource_name = library--decimal +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--development] +file_filter = library/development.po +trans.pt_BR = library/development.po +source_file = ../build/gettext/library/development.pot +type = PO +minimum_perc = 0 +resource_name = library--development +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--devmode] +file_filter = library/devmode.po +trans.pt_BR = library/devmode.po +source_file = ../build/gettext/library/devmode.pot +type = PO +minimum_perc = 0 +resource_name = library--devmode +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--dialog] +file_filter = library/dialog.po +trans.pt_BR = library/dialog.po +source_file = ../build/gettext/library/dialog.pot +type = PO +minimum_perc = 0 +resource_name = library--dialog +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--difflib] +file_filter = library/difflib.po +trans.pt_BR = library/difflib.po +source_file = ../build/gettext/library/difflib.pot +type = PO +minimum_perc = 0 +resource_name = library--difflib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--dis] +file_filter = library/dis.po +trans.pt_BR = library/dis.po +source_file = ../build/gettext/library/dis.pot +type = PO +minimum_perc = 0 +resource_name = library--dis +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--distribution] +file_filter = library/distribution.po +trans.pt_BR = library/distribution.po +source_file = ../build/gettext/library/distribution.pot +type = PO +minimum_perc = 0 +resource_name = library--distribution +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--doctest] +file_filter = library/doctest.po +trans.pt_BR = library/doctest.po +source_file = ../build/gettext/library/doctest.pot +type = PO +minimum_perc = 0 +resource_name = library--doctest +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email] +file_filter = library/email.po +trans.pt_BR = library/email.po +source_file = ../build/gettext/library/email.pot +type = PO +minimum_perc = 0 +resource_name = library--email +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_charset] +file_filter = library/email.charset.po +trans.pt_BR = library/email.charset.po +source_file = ../build/gettext/library/email.charset.pot +type = PO +minimum_perc = 0 +resource_name = library--email_charset +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_compat32-message] +file_filter = library/email.compat32-message.po +trans.pt_BR = library/email.compat32-message.po +source_file = ../build/gettext/library/email.compat32-message.pot +type = PO +minimum_perc = 0 +resource_name = library--email_compat32-message +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_contentmanager] +file_filter = library/email.contentmanager.po +trans.pt_BR = library/email.contentmanager.po +source_file = ../build/gettext/library/email.contentmanager.pot +type = PO +minimum_perc = 0 +resource_name = library--email_contentmanager +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_encoders] +file_filter = library/email.encoders.po +trans.pt_BR = library/email.encoders.po +source_file = ../build/gettext/library/email.encoders.pot +type = PO +minimum_perc = 0 +resource_name = library--email_encoders +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_errors] +file_filter = library/email.errors.po +trans.pt_BR = library/email.errors.po +source_file = ../build/gettext/library/email.errors.pot +type = PO +minimum_perc = 0 +resource_name = library--email_errors +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_examples] +file_filter = library/email.examples.po +trans.pt_BR = library/email.examples.po +source_file = ../build/gettext/library/email.examples.pot +type = PO +minimum_perc = 0 +resource_name = library--email_examples +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_generator] +file_filter = library/email.generator.po +trans.pt_BR = library/email.generator.po +source_file = ../build/gettext/library/email.generator.pot +type = PO +minimum_perc = 0 +resource_name = library--email_generator +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_header] +file_filter = library/email.header.po +trans.pt_BR = library/email.header.po +source_file = ../build/gettext/library/email.header.pot +type = PO +minimum_perc = 0 +resource_name = library--email_header +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_headerregistry] +file_filter = library/email.headerregistry.po +trans.pt_BR = library/email.headerregistry.po +source_file = ../build/gettext/library/email.headerregistry.pot +type = PO +minimum_perc = 0 +resource_name = library--email_headerregistry +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_iterators] +file_filter = library/email.iterators.po +trans.pt_BR = library/email.iterators.po +source_file = ../build/gettext/library/email.iterators.pot +type = PO +minimum_perc = 0 +resource_name = library--email_iterators +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_message] +file_filter = library/email.message.po +trans.pt_BR = library/email.message.po +source_file = ../build/gettext/library/email.message.pot +type = PO +minimum_perc = 0 +resource_name = library--email_message +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_mime] +file_filter = library/email.mime.po +trans.pt_BR = library/email.mime.po +source_file = ../build/gettext/library/email.mime.pot +type = PO +minimum_perc = 0 +resource_name = library--email_mime +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_parser] +file_filter = library/email.parser.po +trans.pt_BR = library/email.parser.po +source_file = ../build/gettext/library/email.parser.pot +type = PO +minimum_perc = 0 +resource_name = library--email_parser +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_policy] +file_filter = library/email.policy.po +trans.pt_BR = library/email.policy.po +source_file = ../build/gettext/library/email.policy.pot +type = PO +minimum_perc = 0 +resource_name = library--email_policy +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--email_utils] +file_filter = library/email.utils.po +trans.pt_BR = library/email.utils.po +source_file = ../build/gettext/library/email.utils.pot +type = PO +minimum_perc = 0 +resource_name = library--email_utils +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ensurepip] +file_filter = library/ensurepip.po +trans.pt_BR = library/ensurepip.po +source_file = ../build/gettext/library/ensurepip.pot +type = PO +minimum_perc = 0 +resource_name = library--ensurepip +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--enum] +file_filter = library/enum.po +trans.pt_BR = library/enum.po +source_file = ../build/gettext/library/enum.pot +type = PO +minimum_perc = 0 +resource_name = library--enum +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--errno] +file_filter = library/errno.po +trans.pt_BR = library/errno.po +source_file = ../build/gettext/library/errno.pot +type = PO +minimum_perc = 0 +resource_name = library--errno +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--exceptions] +file_filter = library/exceptions.po +trans.pt_BR = library/exceptions.po +source_file = ../build/gettext/library/exceptions.pot +type = PO +minimum_perc = 0 +resource_name = library--exceptions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--faulthandler] +file_filter = library/faulthandler.po +trans.pt_BR = library/faulthandler.po +source_file = ../build/gettext/library/faulthandler.pot +type = PO +minimum_perc = 0 +resource_name = library--faulthandler +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--fcntl] +file_filter = library/fcntl.po +trans.pt_BR = library/fcntl.po +source_file = ../build/gettext/library/fcntl.pot +type = PO +minimum_perc = 0 +resource_name = library--fcntl +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--filecmp] +file_filter = library/filecmp.po +trans.pt_BR = library/filecmp.po +source_file = ../build/gettext/library/filecmp.pot +type = PO +minimum_perc = 0 +resource_name = library--filecmp +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--fileformats] +file_filter = library/fileformats.po +trans.pt_BR = library/fileformats.po +source_file = ../build/gettext/library/fileformats.pot +type = PO +minimum_perc = 0 +resource_name = library--fileformats +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--fileinput] +file_filter = library/fileinput.po +trans.pt_BR = library/fileinput.po +source_file = ../build/gettext/library/fileinput.pot +type = PO +minimum_perc = 0 +resource_name = library--fileinput +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--filesys] +file_filter = library/filesys.po +trans.pt_BR = library/filesys.po +source_file = ../build/gettext/library/filesys.pot +type = PO +minimum_perc = 0 +resource_name = library--filesys +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--fnmatch] +file_filter = library/fnmatch.po +trans.pt_BR = library/fnmatch.po +source_file = ../build/gettext/library/fnmatch.pot +type = PO +minimum_perc = 0 +resource_name = library--fnmatch +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--fractions] +file_filter = library/fractions.po +trans.pt_BR = library/fractions.po +source_file = ../build/gettext/library/fractions.pot +type = PO +minimum_perc = 0 +resource_name = library--fractions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--frameworks] +file_filter = library/frameworks.po +trans.pt_BR = library/frameworks.po +source_file = ../build/gettext/library/frameworks.pot +type = PO +minimum_perc = 0 +resource_name = library--frameworks +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ftplib] +file_filter = library/ftplib.po +trans.pt_BR = library/ftplib.po +source_file = ../build/gettext/library/ftplib.pot +type = PO +minimum_perc = 0 +resource_name = library--ftplib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--functional] +file_filter = library/functional.po +trans.pt_BR = library/functional.po +source_file = ../build/gettext/library/functional.pot +type = PO +minimum_perc = 0 +resource_name = library--functional +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--functions] +file_filter = library/functions.po +trans.pt_BR = library/functions.po +source_file = ../build/gettext/library/functions.pot +type = PO +minimum_perc = 0 +resource_name = library--functions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--functools] +file_filter = library/functools.po +trans.pt_BR = library/functools.po +source_file = ../build/gettext/library/functools.pot +type = PO +minimum_perc = 0 +resource_name = library--functools +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--gc] +file_filter = library/gc.po +trans.pt_BR = library/gc.po +source_file = ../build/gettext/library/gc.pot +type = PO +minimum_perc = 0 +resource_name = library--gc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--getopt] +file_filter = library/getopt.po +trans.pt_BR = library/getopt.po +source_file = ../build/gettext/library/getopt.pot +type = PO +minimum_perc = 0 +resource_name = library--getopt +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--getpass] +file_filter = library/getpass.po +trans.pt_BR = library/getpass.po +source_file = ../build/gettext/library/getpass.pot +type = PO +minimum_perc = 0 +resource_name = library--getpass +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--gettext] +file_filter = library/gettext.po +trans.pt_BR = library/gettext.po +source_file = ../build/gettext/library/gettext.pot +type = PO +minimum_perc = 0 +resource_name = library--gettext +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--glob] +file_filter = library/glob.po +trans.pt_BR = library/glob.po +source_file = ../build/gettext/library/glob.pot +type = PO +minimum_perc = 0 +resource_name = library--glob +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--graphlib] +file_filter = library/graphlib.po +trans.pt_BR = library/graphlib.po +source_file = ../build/gettext/library/graphlib.pot +type = PO +minimum_perc = 0 +resource_name = library--graphlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--grp] +file_filter = library/grp.po +trans.pt_BR = library/grp.po +source_file = ../build/gettext/library/grp.pot +type = PO +minimum_perc = 0 +resource_name = library--grp +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--gzip] +file_filter = library/gzip.po +trans.pt_BR = library/gzip.po +source_file = ../build/gettext/library/gzip.pot +type = PO +minimum_perc = 0 +resource_name = library--gzip +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--hashlib] +file_filter = library/hashlib.po +trans.pt_BR = library/hashlib.po +source_file = ../build/gettext/library/hashlib.pot +type = PO +minimum_perc = 0 +resource_name = library--hashlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--heapq] +file_filter = library/heapq.po +trans.pt_BR = library/heapq.po +source_file = ../build/gettext/library/heapq.pot +type = PO +minimum_perc = 0 +resource_name = library--heapq +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--hmac] +file_filter = library/hmac.po +trans.pt_BR = library/hmac.po +source_file = ../build/gettext/library/hmac.pot +type = PO +minimum_perc = 0 +resource_name = library--hmac +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--html] +file_filter = library/html.po +trans.pt_BR = library/html.po +source_file = ../build/gettext/library/html.pot +type = PO +minimum_perc = 0 +resource_name = library--html +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--html_entities] +file_filter = library/html.entities.po +trans.pt_BR = library/html.entities.po +source_file = ../build/gettext/library/html.entities.pot +type = PO +minimum_perc = 0 +resource_name = library--html_entities +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--html_parser] +file_filter = library/html.parser.po +trans.pt_BR = library/html.parser.po +source_file = ../build/gettext/library/html.parser.pot +type = PO +minimum_perc = 0 +resource_name = library--html_parser +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--http] +file_filter = library/http.po +trans.pt_BR = library/http.po +source_file = ../build/gettext/library/http.pot +type = PO +minimum_perc = 0 +resource_name = library--http +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--http_client] +file_filter = library/http.client.po +trans.pt_BR = library/http.client.po +source_file = ../build/gettext/library/http.client.pot +type = PO +minimum_perc = 0 +resource_name = library--http_client +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--http_cookiejar] +file_filter = library/http.cookiejar.po +trans.pt_BR = library/http.cookiejar.po +source_file = ../build/gettext/library/http.cookiejar.pot +type = PO +minimum_perc = 0 +resource_name = library--http_cookiejar +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--http_cookies] +file_filter = library/http.cookies.po +trans.pt_BR = library/http.cookies.po +source_file = ../build/gettext/library/http.cookies.pot +type = PO +minimum_perc = 0 +resource_name = library--http_cookies +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--http_server] +file_filter = library/http.server.po +trans.pt_BR = library/http.server.po +source_file = ../build/gettext/library/http.server.pot +type = PO +minimum_perc = 0 +resource_name = library--http_server +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--i18n] +file_filter = library/i18n.po +trans.pt_BR = library/i18n.po +source_file = ../build/gettext/library/i18n.pot +type = PO +minimum_perc = 0 +resource_name = library--i18n +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--idle] +file_filter = library/idle.po +trans.pt_BR = library/idle.po +source_file = ../build/gettext/library/idle.pot +type = PO +minimum_perc = 0 +resource_name = library--idle +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--imaplib] +file_filter = library/imaplib.po +trans.pt_BR = library/imaplib.po +source_file = ../build/gettext/library/imaplib.pot +type = PO +minimum_perc = 0 +resource_name = library--imaplib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--imghdr] +file_filter = library/imghdr.po +trans.pt_BR = library/imghdr.po +source_file = ../build/gettext/library/imghdr.pot +type = PO +minimum_perc = 0 +resource_name = library--imghdr +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--importlib] +file_filter = library/importlib.po +trans.pt_BR = library/importlib.po +source_file = ../build/gettext/library/importlib.pot +type = PO +minimum_perc = 0 +resource_name = library--importlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--importlib_metadata] +file_filter = library/importlib.metadata.po +trans.pt_BR = library/importlib.metadata.po +source_file = ../build/gettext/library/importlib.metadata.pot +type = PO +minimum_perc = 0 +resource_name = library--importlib_metadata +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--importlib_resources] +file_filter = library/importlib.resources.po +trans.pt_BR = library/importlib.resources.po +source_file = ../build/gettext/library/importlib.resources.pot +type = PO +minimum_perc = 0 +resource_name = library--importlib_resources +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--importlib_resources_abc] +file_filter = library/importlib.resources.abc.po +trans.pt_BR = library/importlib.resources.abc.po +source_file = ../build/gettext/library/importlib.resources.abc.pot +type = PO +minimum_perc = 0 +resource_name = library--importlib_resources_abc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--index] +file_filter = library/index.po +trans.pt_BR = library/index.po +source_file = ../build/gettext/library/index.pot +type = PO +minimum_perc = 0 +resource_name = library--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--inspect] +file_filter = library/inspect.po +trans.pt_BR = library/inspect.po +source_file = ../build/gettext/library/inspect.pot +type = PO +minimum_perc = 0 +resource_name = library--inspect +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--internet] +file_filter = library/internet.po +trans.pt_BR = library/internet.po +source_file = ../build/gettext/library/internet.pot +type = PO +minimum_perc = 0 +resource_name = library--internet +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--intro] +file_filter = library/intro.po +trans.pt_BR = library/intro.po +source_file = ../build/gettext/library/intro.pot +type = PO +minimum_perc = 0 +resource_name = library--intro +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--io] +file_filter = library/io.po +trans.pt_BR = library/io.po +source_file = ../build/gettext/library/io.pot +type = PO +minimum_perc = 0 +resource_name = library--io +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ipaddress] +file_filter = library/ipaddress.po +trans.pt_BR = library/ipaddress.po +source_file = ../build/gettext/library/ipaddress.pot +type = PO +minimum_perc = 0 +resource_name = library--ipaddress +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ipc] +file_filter = library/ipc.po +trans.pt_BR = library/ipc.po +source_file = ../build/gettext/library/ipc.pot +type = PO +minimum_perc = 0 +resource_name = library--ipc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--itertools] +file_filter = library/itertools.po +trans.pt_BR = library/itertools.po +source_file = ../build/gettext/library/itertools.pot +type = PO +minimum_perc = 0 +resource_name = library--itertools +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--json] +file_filter = library/json.po +trans.pt_BR = library/json.po +source_file = ../build/gettext/library/json.pot +type = PO +minimum_perc = 0 +resource_name = library--json +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--keyword] +file_filter = library/keyword.po +trans.pt_BR = library/keyword.po +source_file = ../build/gettext/library/keyword.pot +type = PO +minimum_perc = 0 +resource_name = library--keyword +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--language] +file_filter = library/language.po +trans.pt_BR = library/language.po +source_file = ../build/gettext/library/language.pot +type = PO +minimum_perc = 0 +resource_name = library--language +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--linecache] +file_filter = library/linecache.po +trans.pt_BR = library/linecache.po +source_file = ../build/gettext/library/linecache.pot +type = PO +minimum_perc = 0 +resource_name = library--linecache +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--locale] +file_filter = library/locale.po +trans.pt_BR = library/locale.po +source_file = ../build/gettext/library/locale.pot +type = PO +minimum_perc = 0 +resource_name = library--locale +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--logging] +file_filter = library/logging.po +trans.pt_BR = library/logging.po +source_file = ../build/gettext/library/logging.pot +type = PO +minimum_perc = 0 +resource_name = library--logging +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--logging_config] +file_filter = library/logging.config.po +trans.pt_BR = library/logging.config.po +source_file = ../build/gettext/library/logging.config.pot +type = PO +minimum_perc = 0 +resource_name = library--logging_config +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--logging_handlers] +file_filter = library/logging.handlers.po +trans.pt_BR = library/logging.handlers.po +source_file = ../build/gettext/library/logging.handlers.pot +type = PO +minimum_perc = 0 +resource_name = library--logging_handlers +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--lzma] +file_filter = library/lzma.po +trans.pt_BR = library/lzma.po +source_file = ../build/gettext/library/lzma.pot +type = PO +minimum_perc = 0 +resource_name = library--lzma +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--mailbox] +file_filter = library/mailbox.po +trans.pt_BR = library/mailbox.po +source_file = ../build/gettext/library/mailbox.pot +type = PO +minimum_perc = 0 +resource_name = library--mailbox +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--mailcap] +file_filter = library/mailcap.po +trans.pt_BR = library/mailcap.po +source_file = ../build/gettext/library/mailcap.pot +type = PO +minimum_perc = 0 +resource_name = library--mailcap +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--markup] +file_filter = library/markup.po +trans.pt_BR = library/markup.po +source_file = ../build/gettext/library/markup.pot +type = PO +minimum_perc = 0 +resource_name = library--markup +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--marshal] +file_filter = library/marshal.po +trans.pt_BR = library/marshal.po +source_file = ../build/gettext/library/marshal.pot +type = PO +minimum_perc = 0 +resource_name = library--marshal +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--math] +file_filter = library/math.po +trans.pt_BR = library/math.po +source_file = ../build/gettext/library/math.pot +type = PO +minimum_perc = 0 +resource_name = library--math +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--mimetypes] +file_filter = library/mimetypes.po +trans.pt_BR = library/mimetypes.po +source_file = ../build/gettext/library/mimetypes.pot +type = PO +minimum_perc = 0 +resource_name = library--mimetypes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--mm] +file_filter = library/mm.po +trans.pt_BR = library/mm.po +source_file = ../build/gettext/library/mm.pot +type = PO +minimum_perc = 0 +resource_name = library--mm +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--mmap] +file_filter = library/mmap.po +trans.pt_BR = library/mmap.po +source_file = ../build/gettext/library/mmap.pot +type = PO +minimum_perc = 0 +resource_name = library--mmap +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--modulefinder] +file_filter = library/modulefinder.po +trans.pt_BR = library/modulefinder.po +source_file = ../build/gettext/library/modulefinder.pot +type = PO +minimum_perc = 0 +resource_name = library--modulefinder +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--modules] +file_filter = library/modules.po +trans.pt_BR = library/modules.po +source_file = ../build/gettext/library/modules.pot +type = PO +minimum_perc = 0 +resource_name = library--modules +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--msilib] +file_filter = library/msilib.po +trans.pt_BR = library/msilib.po +source_file = ../build/gettext/library/msilib.pot +type = PO +minimum_perc = 0 +resource_name = library--msilib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--msvcrt] +file_filter = library/msvcrt.po +trans.pt_BR = library/msvcrt.po +source_file = ../build/gettext/library/msvcrt.pot +type = PO +minimum_perc = 0 +resource_name = library--msvcrt +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--multiprocessing] +file_filter = library/multiprocessing.po +trans.pt_BR = library/multiprocessing.po +source_file = ../build/gettext/library/multiprocessing.pot +type = PO +minimum_perc = 0 +resource_name = library--multiprocessing +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--multiprocessing_shared_memory] +file_filter = library/multiprocessing.shared_memory.po +trans.pt_BR = library/multiprocessing.shared_memory.po +source_file = ../build/gettext/library/multiprocessing.shared_memory.pot +type = PO +minimum_perc = 0 +resource_name = library--multiprocessing_shared_memory +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--netdata] +file_filter = library/netdata.po +trans.pt_BR = library/netdata.po +source_file = ../build/gettext/library/netdata.pot +type = PO +minimum_perc = 0 +resource_name = library--netdata +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--netrc] +file_filter = library/netrc.po +trans.pt_BR = library/netrc.po +source_file = ../build/gettext/library/netrc.pot +type = PO +minimum_perc = 0 +resource_name = library--netrc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--nis] +file_filter = library/nis.po +trans.pt_BR = library/nis.po +source_file = ../build/gettext/library/nis.pot +type = PO +minimum_perc = 0 +resource_name = library--nis +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--nntplib] +file_filter = library/nntplib.po +trans.pt_BR = library/nntplib.po +source_file = ../build/gettext/library/nntplib.pot +type = PO +minimum_perc = 0 +resource_name = library--nntplib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--numbers] +file_filter = library/numbers.po +trans.pt_BR = library/numbers.po +source_file = ../build/gettext/library/numbers.pot +type = PO +minimum_perc = 0 +resource_name = library--numbers +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--numeric] +file_filter = library/numeric.po +trans.pt_BR = library/numeric.po +source_file = ../build/gettext/library/numeric.pot +type = PO +minimum_perc = 0 +resource_name = library--numeric +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--operator] +file_filter = library/operator.po +trans.pt_BR = library/operator.po +source_file = ../build/gettext/library/operator.pot +type = PO +minimum_perc = 0 +resource_name = library--operator +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--optparse] +file_filter = library/optparse.po +trans.pt_BR = library/optparse.po +source_file = ../build/gettext/library/optparse.pot +type = PO +minimum_perc = 0 +resource_name = library--optparse +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--os] +file_filter = library/os.po +trans.pt_BR = library/os.po +source_file = ../build/gettext/library/os.pot +type = PO +minimum_perc = 0 +resource_name = library--os +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--os_path] +file_filter = library/os.path.po +trans.pt_BR = library/os.path.po +source_file = ../build/gettext/library/os.path.pot +type = PO +minimum_perc = 0 +resource_name = library--os_path +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ossaudiodev] +file_filter = library/ossaudiodev.po +trans.pt_BR = library/ossaudiodev.po +source_file = ../build/gettext/library/ossaudiodev.pot +type = PO +minimum_perc = 0 +resource_name = library--ossaudiodev +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pathlib] +file_filter = library/pathlib.po +trans.pt_BR = library/pathlib.po +source_file = ../build/gettext/library/pathlib.pot +type = PO +minimum_perc = 0 +resource_name = library--pathlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pdb] +file_filter = library/pdb.po +trans.pt_BR = library/pdb.po +source_file = ../build/gettext/library/pdb.pot +type = PO +minimum_perc = 0 +resource_name = library--pdb +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--persistence] +file_filter = library/persistence.po +trans.pt_BR = library/persistence.po +source_file = ../build/gettext/library/persistence.pot +type = PO +minimum_perc = 0 +resource_name = library--persistence +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pickle] +file_filter = library/pickle.po +trans.pt_BR = library/pickle.po +source_file = ../build/gettext/library/pickle.pot +type = PO +minimum_perc = 0 +resource_name = library--pickle +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pickletools] +file_filter = library/pickletools.po +trans.pt_BR = library/pickletools.po +source_file = ../build/gettext/library/pickletools.pot +type = PO +minimum_perc = 0 +resource_name = library--pickletools +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pipes] +file_filter = library/pipes.po +trans.pt_BR = library/pipes.po +source_file = ../build/gettext/library/pipes.pot +type = PO +minimum_perc = 0 +resource_name = library--pipes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pkgutil] +file_filter = library/pkgutil.po +trans.pt_BR = library/pkgutil.po +source_file = ../build/gettext/library/pkgutil.pot +type = PO +minimum_perc = 0 +resource_name = library--pkgutil +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--platform] +file_filter = library/platform.po +trans.pt_BR = library/platform.po +source_file = ../build/gettext/library/platform.pot +type = PO +minimum_perc = 0 +resource_name = library--platform +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--plistlib] +file_filter = library/plistlib.po +trans.pt_BR = library/plistlib.po +source_file = ../build/gettext/library/plistlib.pot +type = PO +minimum_perc = 0 +resource_name = library--plistlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--poplib] +file_filter = library/poplib.po +trans.pt_BR = library/poplib.po +source_file = ../build/gettext/library/poplib.pot +type = PO +minimum_perc = 0 +resource_name = library--poplib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--posix] +file_filter = library/posix.po +trans.pt_BR = library/posix.po +source_file = ../build/gettext/library/posix.pot +type = PO +minimum_perc = 0 +resource_name = library--posix +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pprint] +file_filter = library/pprint.po +trans.pt_BR = library/pprint.po +source_file = ../build/gettext/library/pprint.pot +type = PO +minimum_perc = 0 +resource_name = library--pprint +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--profile] +file_filter = library/profile.po +trans.pt_BR = library/profile.po +source_file = ../build/gettext/library/profile.pot +type = PO +minimum_perc = 0 +resource_name = library--profile +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pty] +file_filter = library/pty.po +trans.pt_BR = library/pty.po +source_file = ../build/gettext/library/pty.pot +type = PO +minimum_perc = 0 +resource_name = library--pty +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pwd] +file_filter = library/pwd.po +trans.pt_BR = library/pwd.po +source_file = ../build/gettext/library/pwd.pot +type = PO +minimum_perc = 0 +resource_name = library--pwd +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--py_compile] +file_filter = library/py_compile.po +trans.pt_BR = library/py_compile.po +source_file = ../build/gettext/library/py_compile.pot +type = PO +minimum_perc = 0 +resource_name = library--py_compile +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pyclbr] +file_filter = library/pyclbr.po +trans.pt_BR = library/pyclbr.po +source_file = ../build/gettext/library/pyclbr.pot +type = PO +minimum_perc = 0 +resource_name = library--pyclbr +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pydoc] +file_filter = library/pydoc.po +trans.pt_BR = library/pydoc.po +source_file = ../build/gettext/library/pydoc.pot +type = PO +minimum_perc = 0 +resource_name = library--pydoc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--pyexpat] +file_filter = library/pyexpat.po +trans.pt_BR = library/pyexpat.po +source_file = ../build/gettext/library/pyexpat.pot +type = PO +minimum_perc = 0 +resource_name = library--pyexpat +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--python] +file_filter = library/python.po +trans.pt_BR = library/python.po +source_file = ../build/gettext/library/python.pot +type = PO +minimum_perc = 0 +resource_name = library--python +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--queue] +file_filter = library/queue.po +trans.pt_BR = library/queue.po +source_file = ../build/gettext/library/queue.pot +type = PO +minimum_perc = 0 +resource_name = library--queue +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--quopri] +file_filter = library/quopri.po +trans.pt_BR = library/quopri.po +source_file = ../build/gettext/library/quopri.pot +type = PO +minimum_perc = 0 +resource_name = library--quopri +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--random] +file_filter = library/random.po +trans.pt_BR = library/random.po +source_file = ../build/gettext/library/random.pot +type = PO +minimum_perc = 0 +resource_name = library--random +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--re] +file_filter = library/re.po +trans.pt_BR = library/re.po +source_file = ../build/gettext/library/re.pot +type = PO +minimum_perc = 0 +resource_name = library--re +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--readline] +file_filter = library/readline.po +trans.pt_BR = library/readline.po +source_file = ../build/gettext/library/readline.pot +type = PO +minimum_perc = 0 +resource_name = library--readline +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--reprlib] +file_filter = library/reprlib.po +trans.pt_BR = library/reprlib.po +source_file = ../build/gettext/library/reprlib.pot +type = PO +minimum_perc = 0 +resource_name = library--reprlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--resource] +file_filter = library/resource.po +trans.pt_BR = library/resource.po +source_file = ../build/gettext/library/resource.pot +type = PO +minimum_perc = 0 +resource_name = library--resource +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--rlcompleter] +file_filter = library/rlcompleter.po +trans.pt_BR = library/rlcompleter.po +source_file = ../build/gettext/library/rlcompleter.pot +type = PO +minimum_perc = 0 +resource_name = library--rlcompleter +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--runpy] +file_filter = library/runpy.po +trans.pt_BR = library/runpy.po +source_file = ../build/gettext/library/runpy.pot +type = PO +minimum_perc = 0 +resource_name = library--runpy +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sched] +file_filter = library/sched.po +trans.pt_BR = library/sched.po +source_file = ../build/gettext/library/sched.pot +type = PO +minimum_perc = 0 +resource_name = library--sched +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--secrets] +file_filter = library/secrets.po +trans.pt_BR = library/secrets.po +source_file = ../build/gettext/library/secrets.pot +type = PO +minimum_perc = 0 +resource_name = library--secrets +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--security_warnings] +file_filter = library/security_warnings.po +trans.pt_BR = library/security_warnings.po +source_file = ../build/gettext/library/security_warnings.pot +type = PO +minimum_perc = 0 +resource_name = library--security_warnings +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--select] +file_filter = library/select.po +trans.pt_BR = library/select.po +source_file = ../build/gettext/library/select.pot +type = PO +minimum_perc = 0 +resource_name = library--select +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--selectors] +file_filter = library/selectors.po +trans.pt_BR = library/selectors.po +source_file = ../build/gettext/library/selectors.pot +type = PO +minimum_perc = 0 +resource_name = library--selectors +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--shelve] +file_filter = library/shelve.po +trans.pt_BR = library/shelve.po +source_file = ../build/gettext/library/shelve.pot +type = PO +minimum_perc = 0 +resource_name = library--shelve +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--shlex] +file_filter = library/shlex.po +trans.pt_BR = library/shlex.po +source_file = ../build/gettext/library/shlex.pot +type = PO +minimum_perc = 0 +resource_name = library--shlex +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--shutil] +file_filter = library/shutil.po +trans.pt_BR = library/shutil.po +source_file = ../build/gettext/library/shutil.pot +type = PO +minimum_perc = 0 +resource_name = library--shutil +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--signal] +file_filter = library/signal.po +trans.pt_BR = library/signal.po +source_file = ../build/gettext/library/signal.pot +type = PO +minimum_perc = 0 +resource_name = library--signal +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--site] +file_filter = library/site.po +trans.pt_BR = library/site.po +source_file = ../build/gettext/library/site.pot +type = PO +minimum_perc = 0 +resource_name = library--site +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--smtplib] +file_filter = library/smtplib.po +trans.pt_BR = library/smtplib.po +source_file = ../build/gettext/library/smtplib.pot +type = PO +minimum_perc = 0 +resource_name = library--smtplib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sndhdr] +file_filter = library/sndhdr.po +trans.pt_BR = library/sndhdr.po +source_file = ../build/gettext/library/sndhdr.pot +type = PO +minimum_perc = 0 +resource_name = library--sndhdr +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--socket] +file_filter = library/socket.po +trans.pt_BR = library/socket.po +source_file = ../build/gettext/library/socket.pot +type = PO +minimum_perc = 0 +resource_name = library--socket +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--socketserver] +file_filter = library/socketserver.po +trans.pt_BR = library/socketserver.po +source_file = ../build/gettext/library/socketserver.pot +type = PO +minimum_perc = 0 +resource_name = library--socketserver +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--spwd] +file_filter = library/spwd.po +trans.pt_BR = library/spwd.po +source_file = ../build/gettext/library/spwd.pot +type = PO +minimum_perc = 0 +resource_name = library--spwd +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sqlite3] +file_filter = library/sqlite3.po +trans.pt_BR = library/sqlite3.po +source_file = ../build/gettext/library/sqlite3.pot +type = PO +minimum_perc = 0 +resource_name = library--sqlite3 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--ssl] +file_filter = library/ssl.po +trans.pt_BR = library/ssl.po +source_file = ../build/gettext/library/ssl.pot +type = PO +minimum_perc = 0 +resource_name = library--ssl +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--stat] +file_filter = library/stat.po +trans.pt_BR = library/stat.po +source_file = ../build/gettext/library/stat.pot +type = PO +minimum_perc = 0 +resource_name = library--stat +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--statistics] +file_filter = library/statistics.po +trans.pt_BR = library/statistics.po +source_file = ../build/gettext/library/statistics.pot +type = PO +minimum_perc = 0 +resource_name = library--statistics +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--stdtypes] +file_filter = library/stdtypes.po +trans.pt_BR = library/stdtypes.po +source_file = ../build/gettext/library/stdtypes.pot +type = PO +minimum_perc = 0 +resource_name = library--stdtypes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--string] +file_filter = library/string.po +trans.pt_BR = library/string.po +source_file = ../build/gettext/library/string.pot +type = PO +minimum_perc = 0 +resource_name = library--string +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--stringprep] +file_filter = library/stringprep.po +trans.pt_BR = library/stringprep.po +source_file = ../build/gettext/library/stringprep.pot +type = PO +minimum_perc = 0 +resource_name = library--stringprep +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--struct] +file_filter = library/struct.po +trans.pt_BR = library/struct.po +source_file = ../build/gettext/library/struct.pot +type = PO +minimum_perc = 0 +resource_name = library--struct +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--subprocess] +file_filter = library/subprocess.po +trans.pt_BR = library/subprocess.po +source_file = ../build/gettext/library/subprocess.pot +type = PO +minimum_perc = 0 +resource_name = library--subprocess +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sunau] +file_filter = library/sunau.po +trans.pt_BR = library/sunau.po +source_file = ../build/gettext/library/sunau.pot +type = PO +minimum_perc = 0 +resource_name = library--sunau +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--superseded] +file_filter = library/superseded.po +trans.pt_BR = library/superseded.po +source_file = ../build/gettext/library/superseded.pot +type = PO +minimum_perc = 0 +resource_name = library--superseded +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--symtable] +file_filter = library/symtable.po +trans.pt_BR = library/symtable.po +source_file = ../build/gettext/library/symtable.pot +type = PO +minimum_perc = 0 +resource_name = library--symtable +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sys] +file_filter = library/sys.po +trans.pt_BR = library/sys.po +source_file = ../build/gettext/library/sys.pot +type = PO +minimum_perc = 0 +resource_name = library--sys +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sys_monitoring] +file_filter = library/sys.monitoring.po +trans.pt_BR = library/sys.monitoring.po +source_file = ../build/gettext/library/sys.monitoring.pot +type = PO +minimum_perc = 0 +resource_name = library--sys_monitoring +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sys_path_init] +file_filter = library/sys_path_init.po +trans.pt_BR = library/sys_path_init.po +source_file = ../build/gettext/library/sys_path_init.pot +type = PO +minimum_perc = 0 +resource_name = library--sys_path_init +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--sysconfig] +file_filter = library/sysconfig.po +trans.pt_BR = library/sysconfig.po +source_file = ../build/gettext/library/sysconfig.pot +type = PO +minimum_perc = 0 +resource_name = library--sysconfig +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--syslog] +file_filter = library/syslog.po +trans.pt_BR = library/syslog.po +source_file = ../build/gettext/library/syslog.pot +type = PO +minimum_perc = 0 +resource_name = library--syslog +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tabnanny] +file_filter = library/tabnanny.po +trans.pt_BR = library/tabnanny.po +source_file = ../build/gettext/library/tabnanny.pot +type = PO +minimum_perc = 0 +resource_name = library--tabnanny +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tarfile] +file_filter = library/tarfile.po +trans.pt_BR = library/tarfile.po +source_file = ../build/gettext/library/tarfile.pot +type = PO +minimum_perc = 0 +resource_name = library--tarfile +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--telnetlib] +file_filter = library/telnetlib.po +trans.pt_BR = library/telnetlib.po +source_file = ../build/gettext/library/telnetlib.pot +type = PO +minimum_perc = 0 +resource_name = library--telnetlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tempfile] +file_filter = library/tempfile.po +trans.pt_BR = library/tempfile.po +source_file = ../build/gettext/library/tempfile.pot +type = PO +minimum_perc = 0 +resource_name = library--tempfile +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--termios] +file_filter = library/termios.po +trans.pt_BR = library/termios.po +source_file = ../build/gettext/library/termios.pot +type = PO +minimum_perc = 0 +resource_name = library--termios +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--test] +file_filter = library/test.po +trans.pt_BR = library/test.po +source_file = ../build/gettext/library/test.pot +type = PO +minimum_perc = 0 +resource_name = library--test +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--text] +file_filter = library/text.po +trans.pt_BR = library/text.po +source_file = ../build/gettext/library/text.pot +type = PO +minimum_perc = 0 +resource_name = library--text +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--textwrap] +file_filter = library/textwrap.po +trans.pt_BR = library/textwrap.po +source_file = ../build/gettext/library/textwrap.pot +type = PO +minimum_perc = 0 +resource_name = library--textwrap +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--threading] +file_filter = library/threading.po +trans.pt_BR = library/threading.po +source_file = ../build/gettext/library/threading.pot +type = PO +minimum_perc = 0 +resource_name = library--threading +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--time] +file_filter = library/time.po +trans.pt_BR = library/time.po +source_file = ../build/gettext/library/time.pot +type = PO +minimum_perc = 0 +resource_name = library--time +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--timeit] +file_filter = library/timeit.po +trans.pt_BR = library/timeit.po +source_file = ../build/gettext/library/timeit.pot +type = PO +minimum_perc = 0 +resource_name = library--timeit +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tk] +file_filter = library/tk.po +trans.pt_BR = library/tk.po +source_file = ../build/gettext/library/tk.pot +type = PO +minimum_perc = 0 +resource_name = library--tk +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter] +file_filter = library/tkinter.po +trans.pt_BR = library/tkinter.po +source_file = ../build/gettext/library/tkinter.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter_colorchooser] +file_filter = library/tkinter.colorchooser.po +trans.pt_BR = library/tkinter.colorchooser.po +source_file = ../build/gettext/library/tkinter.colorchooser.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter_colorchooser +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter_dnd] +file_filter = library/tkinter.dnd.po +trans.pt_BR = library/tkinter.dnd.po +source_file = ../build/gettext/library/tkinter.dnd.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter_dnd +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter_font] +file_filter = library/tkinter.font.po +trans.pt_BR = library/tkinter.font.po +source_file = ../build/gettext/library/tkinter.font.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter_font +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter_messagebox] +file_filter = library/tkinter.messagebox.po +trans.pt_BR = library/tkinter.messagebox.po +source_file = ../build/gettext/library/tkinter.messagebox.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter_messagebox +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter_scrolledtext] +file_filter = library/tkinter.scrolledtext.po +trans.pt_BR = library/tkinter.scrolledtext.po +source_file = ../build/gettext/library/tkinter.scrolledtext.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter_scrolledtext +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter_tix] +file_filter = library/tkinter.tix.po +trans.pt_BR = library/tkinter.tix.po +source_file = ../build/gettext/library/tkinter.tix.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter_tix +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tkinter_ttk] +file_filter = library/tkinter.ttk.po +trans.pt_BR = library/tkinter.ttk.po +source_file = ../build/gettext/library/tkinter.ttk.pot +type = PO +minimum_perc = 0 +resource_name = library--tkinter_ttk +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--token] +file_filter = library/token.po +trans.pt_BR = library/token.po +source_file = ../build/gettext/library/token.pot +type = PO +minimum_perc = 0 +resource_name = library--token +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tokenize] +file_filter = library/tokenize.po +trans.pt_BR = library/tokenize.po +source_file = ../build/gettext/library/tokenize.pot +type = PO +minimum_perc = 0 +resource_name = library--tokenize +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tomllib] +file_filter = library/tomllib.po +trans.pt_BR = library/tomllib.po +source_file = ../build/gettext/library/tomllib.pot +type = PO +minimum_perc = 0 +resource_name = library--tomllib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--trace] +file_filter = library/trace.po +trans.pt_BR = library/trace.po +source_file = ../build/gettext/library/trace.pot +type = PO +minimum_perc = 0 +resource_name = library--trace +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--traceback] +file_filter = library/traceback.po +trans.pt_BR = library/traceback.po +source_file = ../build/gettext/library/traceback.pot +type = PO +minimum_perc = 0 +resource_name = library--traceback +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tracemalloc] +file_filter = library/tracemalloc.po +trans.pt_BR = library/tracemalloc.po +source_file = ../build/gettext/library/tracemalloc.pot +type = PO +minimum_perc = 0 +resource_name = library--tracemalloc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--tty] +file_filter = library/tty.po +trans.pt_BR = library/tty.po +source_file = ../build/gettext/library/tty.pot +type = PO +minimum_perc = 0 +resource_name = library--tty +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--turtle] +file_filter = library/turtle.po +trans.pt_BR = library/turtle.po +source_file = ../build/gettext/library/turtle.pot +type = PO +minimum_perc = 0 +resource_name = library--turtle +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--types] +file_filter = library/types.po +trans.pt_BR = library/types.po +source_file = ../build/gettext/library/types.pot +type = PO +minimum_perc = 0 +resource_name = library--types +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--typing] +file_filter = library/typing.po +trans.pt_BR = library/typing.po +source_file = ../build/gettext/library/typing.pot +type = PO +minimum_perc = 0 +resource_name = library--typing +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--unicodedata] +file_filter = library/unicodedata.po +trans.pt_BR = library/unicodedata.po +source_file = ../build/gettext/library/unicodedata.pot +type = PO +minimum_perc = 0 +resource_name = library--unicodedata +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--unittest] +file_filter = library/unittest.po +trans.pt_BR = library/unittest.po +source_file = ../build/gettext/library/unittest.pot +type = PO +minimum_perc = 0 +resource_name = library--unittest +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--unittest_mock] +file_filter = library/unittest.mock.po +trans.pt_BR = library/unittest.mock.po +source_file = ../build/gettext/library/unittest.mock.pot +type = PO +minimum_perc = 0 +resource_name = library--unittest_mock +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--unittest_mock-examples] +file_filter = library/unittest.mock-examples.po +trans.pt_BR = library/unittest.mock-examples.po +source_file = ../build/gettext/library/unittest.mock-examples.pot +type = PO +minimum_perc = 0 +resource_name = library--unittest_mock-examples +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--unix] +file_filter = library/unix.po +trans.pt_BR = library/unix.po +source_file = ../build/gettext/library/unix.pot +type = PO +minimum_perc = 0 +resource_name = library--unix +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--urllib] +file_filter = library/urllib.po +trans.pt_BR = library/urllib.po +source_file = ../build/gettext/library/urllib.pot +type = PO +minimum_perc = 0 +resource_name = library--urllib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--urllib_error] +file_filter = library/urllib.error.po +trans.pt_BR = library/urllib.error.po +source_file = ../build/gettext/library/urllib.error.pot +type = PO +minimum_perc = 0 +resource_name = library--urllib_error +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--urllib_parse] +file_filter = library/urllib.parse.po +trans.pt_BR = library/urllib.parse.po +source_file = ../build/gettext/library/urllib.parse.pot +type = PO +minimum_perc = 0 +resource_name = library--urllib_parse +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--urllib_request] +file_filter = library/urllib.request.po +trans.pt_BR = library/urllib.request.po +source_file = ../build/gettext/library/urllib.request.pot +type = PO +minimum_perc = 0 +resource_name = library--urllib_request +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--urllib_robotparser] +file_filter = library/urllib.robotparser.po +trans.pt_BR = library/urllib.robotparser.po +source_file = ../build/gettext/library/urllib.robotparser.pot +type = PO +minimum_perc = 0 +resource_name = library--urllib_robotparser +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--uu] +file_filter = library/uu.po +trans.pt_BR = library/uu.po +source_file = ../build/gettext/library/uu.pot +type = PO +minimum_perc = 0 +resource_name = library--uu +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--uuid] +file_filter = library/uuid.po +trans.pt_BR = library/uuid.po +source_file = ../build/gettext/library/uuid.pot +type = PO +minimum_perc = 0 +resource_name = library--uuid +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--venv] +file_filter = library/venv.po +trans.pt_BR = library/venv.po +source_file = ../build/gettext/library/venv.pot +type = PO +minimum_perc = 0 +resource_name = library--venv +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--warnings] +file_filter = library/warnings.po +trans.pt_BR = library/warnings.po +source_file = ../build/gettext/library/warnings.pot +type = PO +minimum_perc = 0 +resource_name = library--warnings +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--wave] +file_filter = library/wave.po +trans.pt_BR = library/wave.po +source_file = ../build/gettext/library/wave.pot +type = PO +minimum_perc = 0 +resource_name = library--wave +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--weakref] +file_filter = library/weakref.po +trans.pt_BR = library/weakref.po +source_file = ../build/gettext/library/weakref.pot +type = PO +minimum_perc = 0 +resource_name = library--weakref +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--webbrowser] +file_filter = library/webbrowser.po +trans.pt_BR = library/webbrowser.po +source_file = ../build/gettext/library/webbrowser.pot +type = PO +minimum_perc = 0 +resource_name = library--webbrowser +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--windows] +file_filter = library/windows.po +trans.pt_BR = library/windows.po +source_file = ../build/gettext/library/windows.pot +type = PO +minimum_perc = 0 +resource_name = library--windows +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--winreg] +file_filter = library/winreg.po +trans.pt_BR = library/winreg.po +source_file = ../build/gettext/library/winreg.pot +type = PO +minimum_perc = 0 +resource_name = library--winreg +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--winsound] +file_filter = library/winsound.po +trans.pt_BR = library/winsound.po +source_file = ../build/gettext/library/winsound.pot +type = PO +minimum_perc = 0 +resource_name = library--winsound +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--wsgiref] +file_filter = library/wsgiref.po +trans.pt_BR = library/wsgiref.po +source_file = ../build/gettext/library/wsgiref.pot +type = PO +minimum_perc = 0 +resource_name = library--wsgiref +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xdrlib] +file_filter = library/xdrlib.po +trans.pt_BR = library/xdrlib.po +source_file = ../build/gettext/library/xdrlib.pot +type = PO +minimum_perc = 0 +resource_name = library--xdrlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml] +file_filter = library/xml.po +trans.pt_BR = library/xml.po +source_file = ../build/gettext/library/xml.pot +type = PO +minimum_perc = 0 +resource_name = library--xml +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_dom] +file_filter = library/xml.dom.po +trans.pt_BR = library/xml.dom.po +source_file = ../build/gettext/library/xml.dom.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_dom +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_dom_minidom] +file_filter = library/xml.dom.minidom.po +trans.pt_BR = library/xml.dom.minidom.po +source_file = ../build/gettext/library/xml.dom.minidom.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_dom_minidom +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_dom_pulldom] +file_filter = library/xml.dom.pulldom.po +trans.pt_BR = library/xml.dom.pulldom.po +source_file = ../build/gettext/library/xml.dom.pulldom.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_dom_pulldom +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_etree_elementtree] +file_filter = library/xml.etree.elementtree.po +trans.pt_BR = library/xml.etree.elementtree.po +source_file = ../build/gettext/library/xml.etree.elementtree.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_etree_elementtree +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_sax] +file_filter = library/xml.sax.po +trans.pt_BR = library/xml.sax.po +source_file = ../build/gettext/library/xml.sax.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_sax +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_sax_handler] +file_filter = library/xml.sax.handler.po +trans.pt_BR = library/xml.sax.handler.po +source_file = ../build/gettext/library/xml.sax.handler.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_sax_handler +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_sax_reader] +file_filter = library/xml.sax.reader.po +trans.pt_BR = library/xml.sax.reader.po +source_file = ../build/gettext/library/xml.sax.reader.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_sax_reader +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xml_sax_utils] +file_filter = library/xml.sax.utils.po +trans.pt_BR = library/xml.sax.utils.po +source_file = ../build/gettext/library/xml.sax.utils.pot +type = PO +minimum_perc = 0 +resource_name = library--xml_sax_utils +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xmlrpc] +file_filter = library/xmlrpc.po +trans.pt_BR = library/xmlrpc.po +source_file = ../build/gettext/library/xmlrpc.pot +type = PO +minimum_perc = 0 +resource_name = library--xmlrpc +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xmlrpc_client] +file_filter = library/xmlrpc.client.po +trans.pt_BR = library/xmlrpc.client.po +source_file = ../build/gettext/library/xmlrpc.client.pot +type = PO +minimum_perc = 0 +resource_name = library--xmlrpc_client +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--xmlrpc_server] +file_filter = library/xmlrpc.server.po +trans.pt_BR = library/xmlrpc.server.po +source_file = ../build/gettext/library/xmlrpc.server.pot +type = PO +minimum_perc = 0 +resource_name = library--xmlrpc_server +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--zipapp] +file_filter = library/zipapp.po +trans.pt_BR = library/zipapp.po +source_file = ../build/gettext/library/zipapp.pot +type = PO +minimum_perc = 0 +resource_name = library--zipapp +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--zipfile] +file_filter = library/zipfile.po +trans.pt_BR = library/zipfile.po +source_file = ../build/gettext/library/zipfile.pot +type = PO +minimum_perc = 0 +resource_name = library--zipfile +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--zipimport] +file_filter = library/zipimport.po +trans.pt_BR = library/zipimport.po +source_file = ../build/gettext/library/zipimport.pot +type = PO +minimum_perc = 0 +resource_name = library--zipimport +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--zlib] +file_filter = library/zlib.po +trans.pt_BR = library/zlib.po +source_file = ../build/gettext/library/zlib.pot +type = PO +minimum_perc = 0 +resource_name = library--zlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:library--zoneinfo] +file_filter = library/zoneinfo.po +trans.pt_BR = library/zoneinfo.po +source_file = ../build/gettext/library/zoneinfo.pot +type = PO +minimum_perc = 0 +resource_name = library--zoneinfo +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:license] +file_filter = license.po +trans.pt_BR = license.po +source_file = ../build/gettext/license.pot +type = PO +minimum_perc = 0 +resource_name = license +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--compound_stmts] +file_filter = reference/compound_stmts.po +trans.pt_BR = reference/compound_stmts.po +source_file = ../build/gettext/reference/compound_stmts.pot +type = PO +minimum_perc = 0 +resource_name = reference--compound_stmts +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--datamodel] +file_filter = reference/datamodel.po +trans.pt_BR = reference/datamodel.po +source_file = ../build/gettext/reference/datamodel.pot +type = PO +minimum_perc = 0 +resource_name = reference--datamodel +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--executionmodel] +file_filter = reference/executionmodel.po +trans.pt_BR = reference/executionmodel.po +source_file = ../build/gettext/reference/executionmodel.pot +type = PO +minimum_perc = 0 +resource_name = reference--executionmodel +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--expressions] +file_filter = reference/expressions.po +trans.pt_BR = reference/expressions.po +source_file = ../build/gettext/reference/expressions.pot +type = PO +minimum_perc = 0 +resource_name = reference--expressions +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--grammar] +file_filter = reference/grammar.po +trans.pt_BR = reference/grammar.po +source_file = ../build/gettext/reference/grammar.pot +type = PO +minimum_perc = 0 +resource_name = reference--grammar +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--import] +file_filter = reference/import.po +trans.pt_BR = reference/import.po +source_file = ../build/gettext/reference/import.pot +type = PO +minimum_perc = 0 +resource_name = reference--import +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--index] +file_filter = reference/index.po +trans.pt_BR = reference/index.po +source_file = ../build/gettext/reference/index.pot +type = PO +minimum_perc = 0 +resource_name = reference--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--introduction] +file_filter = reference/introduction.po +trans.pt_BR = reference/introduction.po +source_file = ../build/gettext/reference/introduction.pot +type = PO +minimum_perc = 0 +resource_name = reference--introduction +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--lexical_analysis] +file_filter = reference/lexical_analysis.po +trans.pt_BR = reference/lexical_analysis.po +source_file = ../build/gettext/reference/lexical_analysis.pot +type = PO +minimum_perc = 0 +resource_name = reference--lexical_analysis +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--simple_stmts] +file_filter = reference/simple_stmts.po +trans.pt_BR = reference/simple_stmts.po +source_file = ../build/gettext/reference/simple_stmts.pot +type = PO +minimum_perc = 0 +resource_name = reference--simple_stmts +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:reference--toplevel_components] +file_filter = reference/toplevel_components.po +trans.pt_BR = reference/toplevel_components.po +source_file = ../build/gettext/reference/toplevel_components.pot +type = PO +minimum_perc = 0 +resource_name = reference--toplevel_components +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:sphinx] +file_filter = sphinx.po +trans.pt_BR = sphinx.po +source_file = ../build/gettext/sphinx.pot +type = PO +minimum_perc = 0 +resource_name = sphinx +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--appendix] +file_filter = tutorial/appendix.po +trans.pt_BR = tutorial/appendix.po +source_file = ../build/gettext/tutorial/appendix.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--appendix +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--appetite] +file_filter = tutorial/appetite.po +trans.pt_BR = tutorial/appetite.po +source_file = ../build/gettext/tutorial/appetite.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--appetite +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--classes] +file_filter = tutorial/classes.po +trans.pt_BR = tutorial/classes.po +source_file = ../build/gettext/tutorial/classes.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--classes +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--controlflow] +file_filter = tutorial/controlflow.po +trans.pt_BR = tutorial/controlflow.po +source_file = ../build/gettext/tutorial/controlflow.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--controlflow +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--datastructures] +file_filter = tutorial/datastructures.po +trans.pt_BR = tutorial/datastructures.po +source_file = ../build/gettext/tutorial/datastructures.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--datastructures +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--errors] +file_filter = tutorial/errors.po +trans.pt_BR = tutorial/errors.po +source_file = ../build/gettext/tutorial/errors.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--errors +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--floatingpoint] +file_filter = tutorial/floatingpoint.po +trans.pt_BR = tutorial/floatingpoint.po +source_file = ../build/gettext/tutorial/floatingpoint.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--floatingpoint +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--index] +file_filter = tutorial/index.po +trans.pt_BR = tutorial/index.po +source_file = ../build/gettext/tutorial/index.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--inputoutput] +file_filter = tutorial/inputoutput.po +trans.pt_BR = tutorial/inputoutput.po +source_file = ../build/gettext/tutorial/inputoutput.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--inputoutput +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--interactive] +file_filter = tutorial/interactive.po +trans.pt_BR = tutorial/interactive.po +source_file = ../build/gettext/tutorial/interactive.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--interactive +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--interpreter] +file_filter = tutorial/interpreter.po +trans.pt_BR = tutorial/interpreter.po +source_file = ../build/gettext/tutorial/interpreter.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--interpreter +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--introduction] +file_filter = tutorial/introduction.po +trans.pt_BR = tutorial/introduction.po +source_file = ../build/gettext/tutorial/introduction.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--introduction +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--modules] +file_filter = tutorial/modules.po +trans.pt_BR = tutorial/modules.po +source_file = ../build/gettext/tutorial/modules.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--modules +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--stdlib] +file_filter = tutorial/stdlib.po +trans.pt_BR = tutorial/stdlib.po +source_file = ../build/gettext/tutorial/stdlib.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--stdlib +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--stdlib2] +file_filter = tutorial/stdlib2.po +trans.pt_BR = tutorial/stdlib2.po +source_file = ../build/gettext/tutorial/stdlib2.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--stdlib2 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--venv] +file_filter = tutorial/venv.po +trans.pt_BR = tutorial/venv.po +source_file = ../build/gettext/tutorial/venv.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--venv +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:tutorial--whatnow] +file_filter = tutorial/whatnow.po +trans.pt_BR = tutorial/whatnow.po +source_file = ../build/gettext/tutorial/whatnow.pot +type = PO +minimum_perc = 0 +resource_name = tutorial--whatnow +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:using--cmdline] +file_filter = using/cmdline.po +trans.pt_BR = using/cmdline.po +source_file = ../build/gettext/using/cmdline.pot +type = PO +minimum_perc = 0 +resource_name = using--cmdline +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:using--configure] +file_filter = using/configure.po +trans.pt_BR = using/configure.po +source_file = ../build/gettext/using/configure.pot +type = PO +minimum_perc = 0 +resource_name = using--configure +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:using--editors] +file_filter = using/editors.po +trans.pt_BR = using/editors.po +source_file = ../build/gettext/using/editors.pot +type = PO +minimum_perc = 0 +resource_name = using--editors +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:using--index] +file_filter = using/index.po +trans.pt_BR = using/index.po +source_file = ../build/gettext/using/index.pot +type = PO +minimum_perc = 0 +resource_name = using--index +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:using--mac] +file_filter = using/mac.po +trans.pt_BR = using/mac.po +source_file = ../build/gettext/using/mac.pot +type = PO +minimum_perc = 0 +resource_name = using--mac +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:using--unix] +file_filter = using/unix.po +trans.pt_BR = using/unix.po +source_file = ../build/gettext/using/unix.pot +type = PO +minimum_perc = 0 +resource_name = using--unix +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:using--windows] +file_filter = using/windows.po +trans.pt_BR = using/windows.po +source_file = ../build/gettext/using/windows.pot +type = PO +minimum_perc = 0 +resource_name = using--windows +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_0] +file_filter = whatsnew/2.0.po +trans.pt_BR = whatsnew/2.0.po +source_file = ../build/gettext/whatsnew/2.0.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_0 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_1] +file_filter = whatsnew/2.1.po +trans.pt_BR = whatsnew/2.1.po +source_file = ../build/gettext/whatsnew/2.1.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_1 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_2] +file_filter = whatsnew/2.2.po +trans.pt_BR = whatsnew/2.2.po +source_file = ../build/gettext/whatsnew/2.2.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_2 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_3] +file_filter = whatsnew/2.3.po +trans.pt_BR = whatsnew/2.3.po +source_file = ../build/gettext/whatsnew/2.3.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_3 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_4] +file_filter = whatsnew/2.4.po +trans.pt_BR = whatsnew/2.4.po +source_file = ../build/gettext/whatsnew/2.4.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_4 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_5] +file_filter = whatsnew/2.5.po +trans.pt_BR = whatsnew/2.5.po +source_file = ../build/gettext/whatsnew/2.5.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_5 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_6] +file_filter = whatsnew/2.6.po +trans.pt_BR = whatsnew/2.6.po +source_file = ../build/gettext/whatsnew/2.6.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_6 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--2_7] +file_filter = whatsnew/2.7.po +trans.pt_BR = whatsnew/2.7.po +source_file = ../build/gettext/whatsnew/2.7.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--2_7 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_0] +file_filter = whatsnew/3.0.po +trans.pt_BR = whatsnew/3.0.po +source_file = ../build/gettext/whatsnew/3.0.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_0 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_1] +file_filter = whatsnew/3.1.po +trans.pt_BR = whatsnew/3.1.po +source_file = ../build/gettext/whatsnew/3.1.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_1 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_10] +file_filter = whatsnew/3.10.po +trans.pt_BR = whatsnew/3.10.po +source_file = ../build/gettext/whatsnew/3.10.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_10 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_11] +file_filter = whatsnew/3.11.po +trans.pt_BR = whatsnew/3.11.po +source_file = ../build/gettext/whatsnew/3.11.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_11 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_12] +file_filter = whatsnew/3.12.po +trans.pt_BR = whatsnew/3.12.po +source_file = ../build/gettext/whatsnew/3.12.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_12 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_2] +file_filter = whatsnew/3.2.po +trans.pt_BR = whatsnew/3.2.po +source_file = ../build/gettext/whatsnew/3.2.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_2 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_3] +file_filter = whatsnew/3.3.po +trans.pt_BR = whatsnew/3.3.po +source_file = ../build/gettext/whatsnew/3.3.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_3 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_4] +file_filter = whatsnew/3.4.po +trans.pt_BR = whatsnew/3.4.po +source_file = ../build/gettext/whatsnew/3.4.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_4 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_5] +file_filter = whatsnew/3.5.po +trans.pt_BR = whatsnew/3.5.po +source_file = ../build/gettext/whatsnew/3.5.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_5 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_6] +file_filter = whatsnew/3.6.po +trans.pt_BR = whatsnew/3.6.po +source_file = ../build/gettext/whatsnew/3.6.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_6 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_7] +file_filter = whatsnew/3.7.po +trans.pt_BR = whatsnew/3.7.po +source_file = ../build/gettext/whatsnew/3.7.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_7 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_8] +file_filter = whatsnew/3.8.po +trans.pt_BR = whatsnew/3.8.po +source_file = ../build/gettext/whatsnew/3.8.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_8 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--3_9] +file_filter = whatsnew/3.9.po +trans.pt_BR = whatsnew/3.9.po +source_file = ../build/gettext/whatsnew/3.9.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--3_9 +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--changelog] +file_filter = whatsnew/changelog.po +trans.pt_BR = whatsnew/changelog.po +source_file = ../build/gettext/whatsnew/changelog.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--changelog +replace_edited_strings = false +keep_translations = false + +[o:python-doc:p:python-312:r:whatsnew--index] +file_filter = whatsnew/index.po +trans.pt_BR = whatsnew/index.po +source_file = ../build/gettext/whatsnew/index.pot +type = PO +minimum_perc = 0 +resource_name = whatsnew--index +replace_edited_strings = false +keep_translations = false diff --git a/about.po b/about.po index 443f96bc8..960432a9c 100644 --- a/about.po +++ b/about.po @@ -4,20 +4,16 @@ # FIRST AUTHOR , YEAR. # # Translators: -# André Girol , 2021 -# Amanda Savluchinske , 2021 -# Adorilson Bezerra , 2021 -# Clara Matos, 2022 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" "MIME-Version: 1.0\n" diff --git a/bugs.po b/bugs.po index 248b69381..e111ce41b 100644 --- a/bugs.po +++ b/bugs.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Felipefpl, 2021 -# Ana Carolina Gomes, 2023 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" diff --git a/c-api/abstract.po b/c-api/abstract.po index 96935d24e..7eec14c43 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Felipefpl, 2021 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/allocation.po b/c-api/allocation.po index c18a72328..058e9d8ad 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Welington Carlos , 2021 -# Felipefpl, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index f894f4d0a..e1966969f 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Felipefpl, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/arg.po b/c-api/arg.po index b7f1f928e..1c4c8d6e6 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -4,15 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Adson Rodrigues , 2021 -# Rafael Marques , 2021 -# Caio Carvalho , 2021 -# Adorilson Bezerra , 2022 -# Welliton Malta , 2023 -# Julia Rizza , 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -20,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -745,7 +736,7 @@ msgid "``f`` (:class:`float`) [float]" msgstr "``f``` (:class:`float`) [float]" #: ../../c-api/arg.rst:283 -msgid "Convert a Python floating point number to a C :c:expr:`float`." +msgid "Convert a Python floating-point number to a C :c:expr:`float`." msgstr "" "Converte um número de ponto flutuante Python para um :c:expr:`float` do C." @@ -754,7 +745,7 @@ msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" #: ../../c-api/arg.rst:286 -msgid "Convert a Python floating point number to a C :c:expr:`double`." +msgid "Convert a Python floating-point number to a C :c:expr:`double`." msgstr "" "Converte um número de ponto flutuante Python para um :c:expr:`double` do C." @@ -821,6 +812,10 @@ msgstr "" "endereço da variável C (de tipo arbitrário), convertendo para :c:expr:" "`void*`. A função *converter* por sua vez, é chamada da seguinte maneira::" +#: ../../c-api/arg.rst:316 +msgid "status = converter(object, address);" +msgstr "" + #: ../../c-api/arg.rst:318 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" @@ -1138,6 +1133,22 @@ msgstr "" "Este é um exemplo do uso dessa função, tirado das fontes do módulo auxiliar " "para referências fracas :mod:`!_weakref`::" +#: ../../c-api/arg.rst:477 +msgid "" +"static PyObject *\n" +"weakref_ref(PyObject *self, PyObject *args)\n" +"{\n" +" PyObject *object;\n" +" PyObject *callback = NULL;\n" +" PyObject *result = NULL;\n" +"\n" +" if (PyArg_UnpackTuple(args, \"ref\", 1, 2, &object, &callback)) {\n" +" result = PyWeakref_NewRef(object, callback);\n" +" }\n" +" return result;\n" +"}" +msgstr "" + #: ../../c-api/arg.rst:490 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " @@ -1146,6 +1157,10 @@ msgstr "" "A chamada à :c:func:`PyArg_UnpackTuple` neste exemplo é inteiramente " "equivalente à chamada para :c:func:`PyArg_ParseTuple`::" +#: ../../c-api/arg.rst:493 +msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" +msgstr "" + #: ../../c-api/arg.rst:498 msgid "Building values" msgstr "Construindo valores" @@ -1401,12 +1416,12 @@ msgstr "" "class:`str` de comprimento 1 do Python." #: ../../c-api/arg.rst:610 -msgid "Convert a C :c:expr:`double` to a Python floating point number." +msgid "Convert a C :c:expr:`double` to a Python floating-point number." msgstr "" "Converte um :c:expr:`double` do C em um número ponto flutuante do Python." #: ../../c-api/arg.rst:613 -msgid "Convert a C :c:expr:`float` to a Python floating point number." +msgid "Convert a C :c:expr:`float` to a Python floating-point number." msgstr "" "Converte um :c:expr:`float` do C em um número ponto flutuante do Python." diff --git a/c-api/bool.po b/c-api/bool.po index 93d016fa7..162ed953c 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -4,7 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Julio Biason, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -12,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-04 01:27+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/buffer.po b/c-api/buffer.po index 43eadfbc9..ee4670551 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -4,19 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# (Douglas da Silva) , 2021 -# Julio Gadioli Soares , 2021 -# felipe caridade fernandes , 2021 -# Danielle Farias , 2021 -# Julia Rizza , 2021 -# Nícolas Prado , 2021 -# Leandro Braga , 2021 -# Ana Carolina Dias, 2022 -# Marco Rougeth , 2023 -# Julio Biason, 2023 -# Victor D. G., 2023 -# Adorilson Bezerra , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -24,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -322,13 +309,13 @@ msgstr "" #: ../../c-api/buffer.rst:152 msgid "" -"A *NUL* terminated string in :mod:`struct` module style syntax describing " +"A *NULL* terminated string in :mod:`struct` module style syntax describing " "the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned " "bytes) is assumed." msgstr "" -"Uma string terminada por *NUL* no estilo de sintaxe de módulo :mod:`struct` " +"Uma string terminada por *NULL* no estilo de sintaxe de módulo :mod:`struct` " "descrevendo os conteúdos de um único item. Se isso é ``NULL``, ``\"B\"`` " -"(unsigned bytes) é assumido." +"(unsigned bytes) é presumido." #: ../../c-api/buffer.rst:156 msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." @@ -729,6 +716,13 @@ msgstr "" "vetor C n-dimensional padrão. Caso contrário, o consumidor deve acessar um " "vetor n-dimensional como a seguir:" +#: ../../c-api/buffer.rst:368 +msgid "" +"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " +"strides[n-1];\n" +"item = *((typeof(item) *)ptr);" +msgstr "" + #: ../../c-api/buffer.rst:374 msgid "" "As noted above, :c:member:`~Py_buffer.buf` can point to any location within " @@ -739,6 +733,35 @@ msgstr "" "localização dentro do bloco de memória em si. Um exportador pode verificar a " "validade de um buffer com essa função:" +#: ../../c-api/buffer.rst:378 +msgid "" +"def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n" +" \"\"\"Verify that the parameters represent a valid array within\n" +" the bounds of the allocated memory:\n" +" char *mem: start of the physical memory block\n" +" memlen: length of the physical memory block\n" +" offset: (char *)buf - mem\n" +" \"\"\"\n" +" if offset % itemsize:\n" +" return False\n" +" if offset < 0 or offset+itemsize > memlen:\n" +" return False\n" +" if any(v % itemsize for v in strides):\n" +" return False\n" +"\n" +" if ndim <= 0:\n" +" return ndim == 0 and not shape and not strides\n" +" if 0 in shape:\n" +" return True\n" +"\n" +" imin = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n" +" if strides[j] <= 0)\n" +" imax = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n" +" if strides[j] > 0)\n" +"\n" +" return 0 <= offset+imin and offset+imax+itemsize <= memlen" +msgstr "" + #: ../../c-api/buffer.rst:408 msgid "PIL-style: shape, strides and suboffsets" msgstr "Estilo-PIL: forma, avanços e suboffsets" @@ -772,6 +795,22 @@ msgstr "" "apontada por um índice N-dimensional onde existem ambos passos e " "subconjuntos não-``NULL``::" +#: ../../c-api/buffer.rst:423 +msgid "" +"void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n" +" Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n" +" char *pointer = (char*)buf;\n" +" int i;\n" +" for (i = 0; i < ndim; i++) {\n" +" pointer += strides[i] * indices[i];\n" +" if (suboffsets[i] >=0 ) {\n" +" pointer = *((char**)pointer) + suboffsets[i];\n" +" }\n" +" }\n" +" return (void*)pointer;\n" +"}" +msgstr "" + #: ../../c-api/buffer.rst:438 msgid "Buffer-related functions" msgstr "Funções relacionadas ao Buffer" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index 891954e7c..1601bc63f 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# msilvavieira, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -75,27 +73,29 @@ msgstr "" "Retorna um novo objeto bytearray, *o*, que implementa o :ref:`protocolo de " "buffer`." -#: ../../c-api/bytearray.rst:48 -msgid "" -"Create a new bytearray object from *string* and its length, *len*. On " -"failure, ``NULL`` is returned." +#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:52 +#: ../../c-api/bytearray.rst:59 +msgid "On failure, return ``NULL`` with an exception set." +msgstr "Em caso de falha, retorna ``NULL`` com uma exceção definida." + +#: ../../c-api/bytearray.rst:50 +msgid "Create a new bytearray object from *string* and its length, *len*." msgstr "" -"Cria um novo objeto bytearray a partir de *string* e seu comprimento, *len*. " -"Em caso de falha, ``NULL`` é retornado." +"Cria um novo objeto bytearray a partir de *string* e seu comprimento, *len*." -#: ../../c-api/bytearray.rst:54 +#: ../../c-api/bytearray.rst:57 msgid "" "Concat bytearrays *a* and *b* and return a new bytearray with the result." msgstr "" "Concatena os bytearrays *a* e *b* e retorna um novo bytearray com o " "resultado." -#: ../../c-api/bytearray.rst:59 +#: ../../c-api/bytearray.rst:64 msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer." msgstr "" "Retorna o tamanho de *bytearray* após verificar se há um ponteiro ``NULL``." -#: ../../c-api/bytearray.rst:64 +#: ../../c-api/bytearray.rst:69 msgid "" "Return the contents of *bytearray* as a char array after checking for a " "``NULL`` pointer. The returned array always has an extra null byte appended." @@ -104,24 +104,24 @@ msgstr "" "verificar um ponteiro ``NULL``. O array retornado sempre tem um byte nulo " "extra acrescentado." -#: ../../c-api/bytearray.rst:71 +#: ../../c-api/bytearray.rst:76 msgid "Resize the internal buffer of *bytearray* to *len*." msgstr "Redimensiona o buffer interno de *bytearray* para o tamanho *len*." -#: ../../c-api/bytearray.rst:74 +#: ../../c-api/bytearray.rst:79 msgid "Macros" msgstr "Macros" -#: ../../c-api/bytearray.rst:76 +#: ../../c-api/bytearray.rst:81 msgid "These macros trade safety for speed and they don't check pointers." msgstr "" "Estas macros trocam segurança por velocidade e não verificam os ponteiros." -#: ../../c-api/bytearray.rst:80 +#: ../../c-api/bytearray.rst:85 msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking." msgstr "Similar a :c:func:`PyByteArray_AsString`, mas sem verificação de erro." -#: ../../c-api/bytearray.rst:85 +#: ../../c-api/bytearray.rst:90 msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking." msgstr "Similar a :c:func:`PyByteArray_Size`, mas sem verificação de erro." diff --git a/c-api/bytes.po b/c-api/bytes.po index e7397fba1..8c1233f8d 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -4,29 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Tiago Henrique , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Julio Gadioli Soares , 2021 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2023 -# Victor D. G., 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-15 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/call.po b/c-api/call.po index 3fdd1cf0d..8b355d460 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -4,13 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Alexandre B A Villares, 2021 -# Renan Lopes , 2021 -# Flávio Neves, 2022 -# Ana Carolina Dias, 2022 -# Mozart Dias Martins, 2023 -# Adorilson Bezerra , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -18,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -51,6 +44,11 @@ msgstr "" "Instâncias de classe que definem :c:member:`~PyTypeObject.tp_call` são " "chamáveis. A assinatura do slot é::" +#: ../../c-api/call.rst:17 +msgid "" +"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" +msgstr "" + #: ../../c-api/call.rst:19 msgid "" "A call is made using a tuple for the positional arguments and a dict for the " @@ -306,6 +304,10 @@ msgstr "" "Dado um argumento de chamada de vetor *nargsf*, retorna o número real de " "argumentos. Atualmente equivalente a::" +#: ../../c-api/call.rst:153 +msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" +msgstr "" + #: ../../c-api/call.rst:155 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " diff --git a/c-api/capsule.po b/c-api/capsule.po index 804b26669..89b38aa70 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -57,6 +56,10 @@ msgid "The type of a destructor callback for a capsule. Defined as::" msgstr "" "O tipo de um retorno de chamada destruidor para uma cápsula. Definido como::" +#: ../../c-api/capsule.rst:29 +msgid "typedef void (*PyCapsule_Destructor)(PyObject *);" +msgstr "" + #: ../../c-api/capsule.rst:31 msgid "" "See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor " diff --git a/c-api/cell.po b/c-api/cell.po index bb9748aee..171785df2 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -73,10 +73,14 @@ msgstr "" "ser ``NULL``." #: ../../c-api/cell.rst:42 -msgid "Return the contents of the cell *cell*." -msgstr "Retorna o conteúdo da célula *cell*." +msgid "" +"Return the contents of the cell *cell*, which can be ``NULL``. If *cell* is " +"not a cell object, returns ``NULL`` with an exception set." +msgstr "" +"Retorna o conteúdo da célula *cell*, que pode ser ``NULL``. Se *cell* não " +"for um objeto célula, retorna ``NULL`` com um conjunto de exceções." -#: ../../c-api/cell.rst:47 +#: ../../c-api/cell.rst:48 msgid "" "Return the contents of the cell *cell*, but without checking that *cell* is " "non-``NULL`` and a cell object." @@ -84,19 +88,25 @@ msgstr "" "Retorna o conteúdo da célula *cell*, mas sem verificar se *cell* não é " "``NULL`` e um objeto célula." -#: ../../c-api/cell.rst:53 +#: ../../c-api/cell.rst:54 msgid "" "Set the contents of the cell object *cell* to *value*. This releases the " "reference to any current content of the cell. *value* may be ``NULL``. " -"*cell* must be non-``NULL``; if it is not a cell object, ``-1`` will be " -"returned. On success, ``0`` will be returned." +"*cell* must be non-``NULL``." msgstr "" "Define o conteúdo do objeto da célula *cell* como *value*. Isso libera a " "referência a qualquer conteúdo atual da célula. *value* pode ser ``NULL``. " -"*cell* não pode ser ``NULL``; se não for um objeto célula, ``-1`` será " -"retornado. Em caso de sucesso, ``0`` será retornado." +"*cell* não pode ser ``NULL``." + +#: ../../c-api/cell.rst:58 +msgid "" +"On success, return ``0``. If *cell* is not a cell object, set an exception " +"and return ``-1``." +msgstr "" +"Em caso de sucesso, retorna ``0``. Se *cell* não for um objeto célula, " +"define uma exceção e retorna ``-1``." -#: ../../c-api/cell.rst:61 +#: ../../c-api/cell.rst:64 msgid "" "Sets the value of the cell object *cell* to *value*. No reference counts " "are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` " diff --git a/c-api/code.po b/c-api/code.po index cc506382a..8d5ba7633 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -4,8 +4,7 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Welliton Malta , 2023 -# PAULO NASCIMENTO, 2024 +# Elvis da Silva de Menezes , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -13,15 +12,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-22 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/codec.po b/c-api/codec.po index 9a4472503..a028264dd 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Tiago Henrique , 2021 -# Hildeberto Abreu Magalhães , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/complex.po b/c-api/complex.po index 12bdb7ae9..2a66e4f8c 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -4,8 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Renan Lopes , 2021 -# Marco Rougeth , 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -13,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -60,14 +58,26 @@ msgid "" "The C structure which corresponds to the value portion of a Python complex " "number object. Most of the functions for dealing with complex number " "objects use structures of this type as input or output values, as " -"appropriate. It is defined as::" +"appropriate." msgstr "" "A estrutura C que corresponde à parte do valor de um objeto de número " "complexo Python. A maioria das funções para lidar com objetos de números " "complexos usa estruturas desse tipo como valores de entrada ou saída, " -"conforme apropriado. É definido como::" +"conforme apropriado." + +#: ../../c-api/complex.rst:33 +msgid "The structure is defined as::" +msgstr "A estrutura é definida como::" -#: ../../c-api/complex.rst:39 +#: ../../c-api/complex.rst:35 +msgid "" +"typedef struct {\n" +" double real;\n" +" double imag;\n" +"} Py_complex;" +msgstr "" + +#: ../../c-api/complex.rst:43 msgid "" "Return the sum of two complex numbers, using the C :c:type:`Py_complex` " "representation." @@ -75,7 +85,7 @@ msgstr "" "Retorna a soma de dois números complexos, utilizando a representação C :c:" "type:`Py_complex`." -#: ../../c-api/complex.rst:45 +#: ../../c-api/complex.rst:49 msgid "" "Return the difference between two complex numbers, using the C :c:type:" "`Py_complex` representation." @@ -83,7 +93,7 @@ msgstr "" "Retorna a diferença entre dois números complexos, utilizando a representação " "C :c:type:`Py_complex`." -#: ../../c-api/complex.rst:51 +#: ../../c-api/complex.rst:55 msgid "" "Return the negation of the complex number *num*, using the C :c:type:" "`Py_complex` representation." @@ -91,7 +101,7 @@ msgstr "" "Retorna a negação do número complexo *num*, utilizando a representação C :c:" "type:`Py_complex`." -#: ../../c-api/complex.rst:57 +#: ../../c-api/complex.rst:61 msgid "" "Return the product of two complex numbers, using the C :c:type:`Py_complex` " "representation." @@ -99,7 +109,7 @@ msgstr "" "Retorna o produto de dois números complexos, utilizando a representação C :c:" "type:`Py_complex`." -#: ../../c-api/complex.rst:63 +#: ../../c-api/complex.rst:67 msgid "" "Return the quotient of two complex numbers, using the C :c:type:`Py_complex` " "representation." @@ -107,7 +117,7 @@ msgstr "" "Retorna o quociente de dois números complexos, utilizando a representação C :" "c:type:`Py_complex`." -#: ../../c-api/complex.rst:66 +#: ../../c-api/complex.rst:70 msgid "" "If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" "c:macro:`!EDOM`." @@ -115,7 +125,7 @@ msgstr "" "Se *divisor* é nulo, este método retorna zero e define :c:data:`errno` para :" "c:macro:`!EDOM`." -#: ../../c-api/complex.rst:72 +#: ../../c-api/complex.rst:76 msgid "" "Return the exponentiation of *num* by *exp*, using the C :c:type:" "`Py_complex` representation." @@ -123,7 +133,7 @@ msgstr "" "Retorna a exponenciação de *num* por *exp*, utilizando a representação C :c:" "type:`Py_complex`" -#: ../../c-api/complex.rst:75 +#: ../../c-api/complex.rst:79 msgid "" "If *num* is null and *exp* is not a positive real number, this method " "returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." @@ -131,18 +141,18 @@ msgstr "" "Se *num* for nulo e *exp* não for um número real positivo, este método " "retorna zero e define :c:data:`errno` para :c:macro:`!EDOM`." -#: ../../c-api/complex.rst:80 +#: ../../c-api/complex.rst:84 msgid "Complex Numbers as Python Objects" msgstr "Números complexos como objetos Python" -#: ../../c-api/complex.rst:85 +#: ../../c-api/complex.rst:89 msgid "" "This subtype of :c:type:`PyObject` represents a Python complex number object." msgstr "" "Este subtipo de :c:type:`PyObject` representa um objeto Python de número " "complexo." -#: ../../c-api/complex.rst:90 +#: ../../c-api/complex.rst:94 msgid "" "This instance of :c:type:`PyTypeObject` represents the Python complex number " "type. It is the same object as :class:`complex` in the Python layer." @@ -150,7 +160,7 @@ msgstr "" "Esta instância de :c:type:`PyTypeObject` representa o tipo de número " "complexo Python. É o mesmo objeto que :class:`complex` na camada Python." -#: ../../c-api/complex.rst:96 +#: ../../c-api/complex.rst:100 msgid "" "Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :" "c:type:`PyComplexObject`. This function always succeeds." @@ -158,7 +168,7 @@ msgstr "" "Retorna true se seu argumento é um :c:type:`PyComplexObject` ou um subtipo " "de :c:type:`PyComplexObject`. Esta função sempre tem sucesso." -#: ../../c-api/complex.rst:102 +#: ../../c-api/complex.rst:106 msgid "" "Return true if its argument is a :c:type:`PyComplexObject`, but not a " "subtype of :c:type:`PyComplexObject`. This function always succeeds." @@ -166,48 +176,68 @@ msgstr "" "Retorna true se seu argumento é um :c:type:`PyComplexObject`, mas não um " "subtipo de :c:type:`PyComplexObject`. Esta função sempre tem sucesso." -#: ../../c-api/complex.rst:108 +#: ../../c-api/complex.rst:112 msgid "" "Create a new Python complex number object from a C :c:type:`Py_complex` " -"value." +"value. Return ``NULL`` with an exception set on error." msgstr "" "Cria um novo objeto de número complexo Python a partir de um valor C :c:type:" -"`Py_complex`." - -#: ../../c-api/complex.rst:113 -msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*." -msgstr "Retorna um novo objeto :c:type:`PyComplexObject` de *real* e *imag*." +"`Py_complex`. Retorna ``NULL`` com uma exceção definida ao ocorrer um erro." #: ../../c-api/complex.rst:118 +msgid "" +"Return a new :c:type:`PyComplexObject` object from *real* and *imag*. Return " +"``NULL`` with an exception set on error." +msgstr "" +"Retorna um novo objeto :c:type:`PyComplexObject` de *real* e *imag*. Retorna " +"``NULL`` com uma exceção definida ao ocorrer um erro." + +#: ../../c-api/complex.rst:124 msgid "Return the real part of *op* as a C :c:expr:`double`." msgstr "Retorna a parte real de *op* como um :c:expr:`double` C." -#: ../../c-api/complex.rst:123 +#: ../../c-api/complex.rst:126 +msgid "" +"Upon failure, this method returns ``-1.0`` with an exception set, so one " +"should call :c:func:`PyErr_Occurred` to check for errors." +msgstr "" +"Em caso de falha, este método retorna ``-1.0`` com uma exceção definida, " +"então deve-se chamar :c:func:`PyErr_Occurred` para verificar se há erros." + +#: ../../c-api/complex.rst:132 msgid "Return the imaginary part of *op* as a C :c:expr:`double`." msgstr "Retorna a parte imaginária de *op* como um :c:expr:`double` C." -#: ../../c-api/complex.rst:128 +#: ../../c-api/complex.rst:137 msgid "Return the :c:type:`Py_complex` value of the complex number *op*." msgstr "Retorna o valor :c:type:`Py_complex` do número complexo *op*." -#: ../../c-api/complex.rst:130 +#: ../../c-api/complex.rst:139 msgid "" "If *op* is not a Python complex number object but has a :meth:`~object." "__complex__` method, this method will first be called to convert *op* to a " "Python complex number object. If :meth:`!__complex__` is not defined then " "it falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not " -"defined then it falls back to :meth:`~object.__index__`. Upon failure, this " -"method returns ``-1.0`` as a real value." +"defined then it falls back to :meth:`~object.__index__`." msgstr "" "Se *op* não é um objeto de número complexo Python, mas tem um método :meth:" "`~object.__complex__`, este método será primeiro chamado para converter *op* " "em um objeto de número complexo Python. Se :meth:`!__complex__` não for " "definido, então ele recorre a :meth:`~object.__float__`. Se :meth:`!" "__float__` não estiver definido, então ele volta para :meth:`~object." -"__index__`. Em caso de falha, este método retorna ``-1.0`` como um valor " -"real." +"__index__`." -#: ../../c-api/complex.rst:137 +#: ../../c-api/complex.rst:145 +msgid "" +"Upon failure, this method returns :c:type:`Py_complex` with :c:member:" +"`~Py_complex.real` set to ``-1.0`` and with an exception set, so one should " +"call :c:func:`PyErr_Occurred` to check for errors." +msgstr "" +"Em caso de falha, este método retorna :c:type:`Py_complex` com :c:member:" +"`~Py_complex.real` definido para ``-1.0`` e com uma exceção definida, então " +"deve-se chamar :c:func:`PyErr_Occurred` para verificar se há erros." + +#: ../../c-api/complex.rst:149 msgid "Use :meth:`~object.__index__` if available." msgstr "Usa :meth:`~object.__index__`, se disponível." diff --git a/c-api/concrete.po b/c-api/concrete.po index 87e4eab84..0855b270d 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Vinicius Gubiani Ferreira , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/contextvars.po b/c-api/contextvars.po index f887eea5c..61a16ad57 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Alexsandro Matias de Almeida , 2021 -# Leandro Braga , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-08 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Leandro Braga , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -41,6 +37,15 @@ msgstr "" "foram **alteradas** para usar ponteiros :c:type:`PyObject` em vez de :c:type:" "`PyContext`, :c:type:`PyContextVar` e :c:type:`PyContextToken`. Por exemplo::" +#: ../../c-api/contextvars.rst:20 +msgid "" +"// in 3.7.0:\n" +"PyContext *PyContext_New(void);\n" +"\n" +"// in 3.7.1+:\n" +"PyObject *PyContext_New(void);" +msgstr "" + #: ../../c-api/contextvars.rst:26 msgid "See :issue:`34762` for more details." msgstr "Veja :issue:`34762` para mais detalhes." diff --git a/c-api/conversion.po b/c-api/conversion.po index c7525e923..f46801a2c 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-02 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/coro.po b/c-api/coro.po index cd122b2ed..65e273589 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/datetime.po b/c-api/datetime.po index a33f0331d..4fe9adffe 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Adjamilton Júnior , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/descriptor.po b/c-api/descriptor.po index db4e6b152..ab47e42f0 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/dict.po b/c-api/dict.po index 24ed33047..6782492d0 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Aline Balogh , 2021 -# felipe caridade fernandes , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -268,6 +265,17 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../c-api/dict.rst:181 +msgid "" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" /* do something interesting with the values... */\n" +" ...\n" +"}" +msgstr "" + #: ../../c-api/dict.rst:189 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " @@ -278,6 +286,27 @@ msgstr "" "modificar os valores das chaves à medida que você itera no dicionário, mas " "apenas enquanto o conjunto de chaves não mudar. Por exemplo::" +#: ../../c-api/dict.rst:193 +msgid "" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" long i = PyLong_AsLong(value);\n" +" if (i == -1 && PyErr_Occurred()) {\n" +" return -1;\n" +" }\n" +" PyObject *o = PyLong_FromLong(i + 1);\n" +" if (o == NULL)\n" +" return -1;\n" +" if (PyDict_SetItem(self->dict, key, o) < 0) {\n" +" Py_DECREF(o);\n" +" return -1;\n" +" }\n" +" Py_DECREF(o);\n" +"}" +msgstr "" + #: ../../c-api/dict.rst:214 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " @@ -324,6 +353,14 @@ msgstr "" "vence. Retorne ``0`` em caso de sucesso ou ``-1`` se uma exceção foi " "levantada. Python equivalente (exceto para o valor de retorno)::" +#: ../../c-api/dict.rst:240 +msgid "" +"def PyDict_MergeFromSeq2(a, seq2, override):\n" +" for key, value in seq2:\n" +" if override or key not in a:\n" +" a[key] = value" +msgstr "" + #: ../../c-api/dict.rst:247 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 7de72d47c..ce2d3a895 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -4,17 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Alexsandro Matias de Almeida , 2021 -# Misael borges , 2021 -# Richard Nixon , 2021 -# Renan Lopes , 2021 -# a76d6fb6142d7607ab0526dcbddb02d7_7bf0da0 <3b5fb0f281c8dfb4c0170f2ee2a6cfcf_843623>, 2021 -# i17obot , 2022 -# Marco Rougeth , 2023 -# Flávio Neves, 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# Leonardo Rodrigues da Costa, 2023 -# Guilherme Alves da Silva, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -22,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-04 01:27+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -99,15 +88,11 @@ msgstr "" #: ../../c-api/exceptions.rst:37 msgid "" -"The error indicator is **not** the result of :func:`sys.exc_info()`. The " +"The error indicator is **not** the result of :func:`sys.exc_info`. The " "former corresponds to an exception that is not yet caught (and is therefore " "still propagating), while the latter returns an exception after it is caught " "(and has therefore stopped propagating)." msgstr "" -"O indicador de erro **not** é resultado de :func:`sys.exc_info()`. O " -"primeiro corresponde a uma exceção que ainda não foi capturada (e, portanto, " -"ainda está se propagando), enquanto o segundo retorna uma exceção após ser " -"capturada (e, portanto, parou de se propagar)." #: ../../c-api/exceptions.rst:44 msgid "Printing and clearing" @@ -535,6 +520,17 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../c-api/exceptions.rst:438 +msgid "" +"{\n" +" PyObject *exc = PyErr_GetRaisedException();\n" +"\n" +" /* ... code that might produce other errors ... */\n" +"\n" +" PyErr_SetRaisedException(exc);\n" +"}" +msgstr "" + #: ../../c-api/exceptions.rst:446 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " @@ -570,6 +566,18 @@ msgid "" "exceptions or save and restore the error indicator temporarily." msgstr "" +#: ../../c-api/exceptions.rst:482 +msgid "" +"{\n" +" PyObject *type, *value, *traceback;\n" +" PyErr_Fetch(&type, &value, &traceback);\n" +"\n" +" /* ... code that might produce other errors ... */\n" +"\n" +" PyErr_Restore(type, value, traceback);\n" +"}" +msgstr "" + #: ../../c-api/exceptions.rst:496 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" @@ -617,6 +625,13 @@ msgid "" "appropriately is desired, the following additional snippet is needed::" msgstr "" +#: ../../c-api/exceptions.rst:537 +msgid "" +"if (tb != NULL) {\n" +" PyException_SetTraceback(val, tb);\n" +"}" +msgstr "" + #: ../../c-api/exceptions.rst:544 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." diff --git a/c-api/file.po b/c-api/file.po index 072078260..16c14dc0d 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -11,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/float.po b/c-api/float.po index 1c60e185b..b19c7332b 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -11,32 +11,32 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/float.rst:6 -msgid "Floating Point Objects" +msgid "Floating-Point Objects" msgstr "Objetos de ponto flutuante" #: ../../c-api/float.rst:13 msgid "" -"This subtype of :c:type:`PyObject` represents a Python floating point object." +"This subtype of :c:type:`PyObject` represents a Python floating-point object." msgstr "" "Este subtipo de :c:type:`PyObject` representa um objeto de ponto flutuante " "do Python." #: ../../c-api/float.rst:18 msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python floating point " +"This instance of :c:type:`PyTypeObject` represents the Python floating-point " "type. This is the same object as :class:`float` in the Python layer." msgstr "" "Esta instância do :c:type:`PyTypeObject` representa o tipo de ponto " @@ -75,12 +75,18 @@ msgstr "Cria um objeto :c:type:`PyFloatObject` de *v* ou ``NULL`` em falha." #: ../../c-api/float.rst:47 msgid "" "Return a C :c:expr:`double` representation of the contents of *pyfloat*. If " -"*pyfloat* is not a Python floating point object but has a :meth:`~object." +"*pyfloat* is not a Python floating-point object but has a :meth:`~object." "__float__` method, this method will first be called to convert *pyfloat* " "into a float. If :meth:`!__float__` is not defined then it falls back to :" "meth:`~object.__index__`. This method returns ``-1.0`` upon failure, so one " "should call :c:func:`PyErr_Occurred` to check for errors." msgstr "" +"Retorna uma representação C :c:expr:`double` do conteúdo de *pyfloat*. Se " +"*pyfloat* não é um objeto de ponto flutuante do Python, mas possui o método :" +"meth:`~object.__float__`, esse método será chamado primeiro para converter " +"*pyfloat* em um ponto flutuante. Se :meth:`!__float__` não estiver definido, " +"será usado :meth:`__index__`. Este método retorna ``-1.0`` em caso de falha, " +"portanto, deve-se chamar :c:func:`PyErr_Occurred` para verificar se há erros." #: ../../c-api/float.rst:54 msgid "Use :meth:`~object.__index__` if available." @@ -240,5 +246,5 @@ msgid "object" msgstr "objeto" #: ../../c-api/float.rst:8 -msgid "floating point" +msgid "floating-point" msgstr "ponto flutuante" diff --git a/c-api/frame.po b/c-api/frame.po index 183e3abed..5e6be233b 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Ruan Aragão , 2022 -# Flávio Neves, 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/function.po b/c-api/function.po index 4be82e67b..6c0a187c0 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 7da47bd8c..fc61ba08d 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rodrigo Cândido, 2022 -# Andressa Lima Ferreira, 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -284,6 +282,17 @@ msgid "" "macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" msgstr "" +#: ../../c-api/gcsupport.rst:190 +msgid "" +"static int\n" +"my_traverse(Noddy *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->foo);\n" +" Py_VISIT(self->bar);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../c-api/gcsupport.rst:198 msgid "" "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" diff --git a/c-api/gen.po b/c-api/gen.po index 66f1ce023..64c61e28e 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/hash.po b/c-api/hash.po index 4931efc7d..c5ea5ccd8 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -5,22 +5,21 @@ # # Translators: # Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-25 01:09+0000\n" -"PO-Revision-Date: 2024-02-23 14:15+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/import.po b/c-api/import.po index 72d7f8a7d..877865fda 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Ozeas Santos , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-08 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -265,7 +264,7 @@ msgstr "" #: ../../c-api/import.rst:176 msgid "" -"Uses :func:`!imp.source_from_cache()` in calculating the source path if only " +"Uses :func:`!imp.source_from_cache` in calculating the source path if only " "the bytecode path is provided." msgstr "" @@ -365,6 +364,16 @@ msgstr "" "`Tools/freeze/` na distribuição fonte do Python). Sua definição, encontrada " "em :file:`Include/import.h`, é::" +#: ../../c-api/import.rst:254 +msgid "" +"struct _frozen {\n" +" const char *name;\n" +" const unsigned char *code;\n" +" int size;\n" +" bool is_package;\n" +"};" +msgstr "" + #: ../../c-api/import.rst:261 msgid "" "The new ``is_package`` field indicates whether the module is a package or " diff --git a/c-api/index.po b/c-api/index.po index 15a309be6..dc472c07f 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Marco Rougeth , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Marco Rougeth , 2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/init.po b/c-api/init.po index 7a49c6095..9e7c65ade 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -4,29 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Rafael Marques , 2021 -# a76d6fb6142d7607ab0526dcbddb02d7_7bf0da0 <3b5fb0f281c8dfb4c0170f2ee2a6cfcf_843623>, 2021 -# Andre Weber, 2021 -# Rodrigo Cândido, 2022 -# Claudio Rogerio Carvalho Filho , 2023 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -648,12 +641,24 @@ msgid "" "`Py_NewInterpreter` below) that were created and not yet destroyed since the " "last call to :c:func:`Py_Initialize`. Ideally, this frees all memory " "allocated by the Python interpreter. This is a no-op when called for a " -"second time (without calling :c:func:`Py_Initialize` again first). Normally " -"the return value is ``0``. If there were errors during finalization " +"second time (without calling :c:func:`Py_Initialize` again first)." +msgstr "" + +#: ../../c-api/init.rst:393 +msgid "" +"Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " +"the same thread with the same interpreter active. That means the main " +"thread and the main interpreter. This should never be called while :c:func:" +"`Py_RunMain` is running." +msgstr "" + +#: ../../c-api/init.rst:398 +msgid "" +"Normally the return value is ``0``. If there were errors during finalization " "(flushing buffered data), ``-1`` is returned." msgstr "" -#: ../../c-api/init.rst:395 +#: ../../c-api/init.rst:402 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " @@ -664,7 +669,7 @@ msgid "" "Python before exiting from the application." msgstr "" -#: ../../c-api/init.rst:403 +#: ../../c-api/init.rst:410 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " "done in random order; this may cause destructors (:meth:`~object.__del__` " @@ -679,7 +684,7 @@ msgid "" "more than once." msgstr "" -#: ../../c-api/init.rst:414 +#: ../../c-api/init.rst:421 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -687,68 +692,68 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython." "_PySys_ClearAuditHooks`` sem argumentos." -#: ../../c-api/init.rst:420 +#: ../../c-api/init.rst:427 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." msgstr "" -#: ../../c-api/init.rst:425 +#: ../../c-api/init.rst:432 msgid "Process-wide parameters" msgstr "" -#: ../../c-api/init.rst:435 +#: ../../c-api/init.rst:442 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors` should be used " "instead, see :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:440 +#: ../../c-api/init.rst:447 msgid "" "This function should be called before :c:func:`Py_Initialize`, if it is " "called at all. It specifies which encoding and error handling to use with " "standard IO, with the same meanings as in :func:`str.encode`." msgstr "" -#: ../../c-api/init.rst:444 +#: ../../c-api/init.rst:451 msgid "" "It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code to " "control IO encoding when the environment variable does not work." msgstr "" -#: ../../c-api/init.rst:447 +#: ../../c-api/init.rst:454 msgid "" "*encoding* and/or *errors* may be ``NULL`` to use :envvar:`PYTHONIOENCODING` " "and/or default values (depending on other settings)." msgstr "" -#: ../../c-api/init.rst:451 +#: ../../c-api/init.rst:458 msgid "" "Note that :data:`sys.stderr` always uses the \"backslashreplace\" error " "handler, regardless of this (or any other) setting." msgstr "" -#: ../../c-api/init.rst:454 +#: ../../c-api/init.rst:461 msgid "" "If :c:func:`Py_FinalizeEx` is called, this function will need to be called " "again in order to affect subsequent calls to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:457 +#: ../../c-api/init.rst:464 msgid "" "Returns ``0`` if successful, a nonzero value on error (e.g. calling after " "the interpreter has already been initialized)." msgstr "" -#: ../../c-api/init.rst:472 +#: ../../c-api/init.rst:479 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "program_name` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:476 +#: ../../c-api/init.rst:483 msgid "" "This function should be called before :c:func:`Py_Initialize` is called for " "the first time, if it is called at all. It tells the interpreter the value " @@ -772,32 +777,32 @@ msgstr "" "programa. Nenhum código no interpretador Python mudará o conteúdo deste " "armazenamento." -#: ../../c-api/init.rst:487 +#: ../../c-api/init.rst:494 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_t *` string." msgstr "" -#: ../../c-api/init.rst:497 +#: ../../c-api/init.rst:504 msgid "" "Return the program name set with :c:func:`Py_SetProgramName`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" -#: ../../c-api/init.rst:501 ../../c-api/init.rst:520 ../../c-api/init.rst:561 -#: ../../c-api/init.rst:580 ../../c-api/init.rst:604 ../../c-api/init.rst:827 +#: ../../c-api/init.rst:508 ../../c-api/init.rst:527 ../../c-api/init.rst:568 +#: ../../c-api/init.rst:587 ../../c-api/init.rst:611 ../../c-api/init.rst:834 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "" -#: ../../c-api/init.rst:504 ../../c-api/init.rst:523 ../../c-api/init.rst:564 -#: ../../c-api/init.rst:583 ../../c-api/init.rst:609 ../../c-api/init.rst:830 +#: ../../c-api/init.rst:511 ../../c-api/init.rst:530 ../../c-api/init.rst:571 +#: ../../c-api/init.rst:590 ../../c-api/init.rst:616 ../../c-api/init.rst:837 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:510 +#: ../../c-api/init.rst:517 msgid "" "Return the *prefix* for installed platform-independent files. This is " "derived through a number of complicated rules from the program name set " @@ -811,7 +816,7 @@ msgid "" "also the next function." msgstr "" -#: ../../c-api/init.rst:529 +#: ../../c-api/init.rst:536 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " @@ -825,7 +830,7 @@ msgid "" "on Unix." msgstr "" -#: ../../c-api/init.rst:539 +#: ../../c-api/init.rst:546 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -834,7 +839,7 @@ msgid "" "independent may be installed in :file:`/usr/local`." msgstr "" -#: ../../c-api/init.rst:545 +#: ../../c-api/init.rst:552 msgid "" "Generally speaking, a platform is a combination of hardware and software " "families, e.g. Sparc machines running the Solaris 2.x operating system are " @@ -848,7 +853,7 @@ msgid "" "independent from the Python version by which they were compiled!)." msgstr "" -#: ../../c-api/init.rst:556 +#: ../../c-api/init.rst:563 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -856,7 +861,7 @@ msgid "" "platform." msgstr "" -#: ../../c-api/init.rst:574 +#: ../../c-api/init.rst:581 msgid "" "Return the full program name of the Python executable; this is computed as " "a side-effect of deriving the default module search path from the program " @@ -865,7 +870,7 @@ msgid "" "available to Python code as ``sys.executable``." msgstr "" -#: ../../c-api/init.rst:594 +#: ../../c-api/init.rst:601 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:func:`Py_SetProgramName` above) and some environment " @@ -878,7 +883,7 @@ msgid "" "for loading modules." msgstr "" -#: ../../c-api/init.rst:620 +#: ../../c-api/init.rst:627 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " @@ -886,7 +891,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:625 +#: ../../c-api/init.rst:632 msgid "" "Set the default module search path. If this function is called before :c:" "func:`Py_Initialize`, then :c:func:`Py_GetPath` won't attempt to compute a " @@ -897,7 +902,7 @@ msgid "" "on Windows." msgstr "" -#: ../../c-api/init.rst:633 +#: ../../c-api/init.rst:640 msgid "" "This also causes :data:`sys.executable` to be set to the program full path " "(see :c:func:`Py_GetProgramFullPath`) and for :data:`sys.prefix` and :data:" @@ -905,14 +910,14 @@ msgid "" "required after calling :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:638 ../../c-api/init.rst:753 ../../c-api/init.rst:789 -#: ../../c-api/init.rst:815 +#: ../../c-api/init.rst:645 ../../c-api/init.rst:760 ../../c-api/init.rst:796 +#: ../../c-api/init.rst:822 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." msgstr "" -#: ../../c-api/init.rst:641 +#: ../../c-api/init.rst:648 msgid "" "The path argument is copied internally, so the caller may free it after the " "call completes." @@ -920,7 +925,7 @@ msgstr "" "O argumento caminho é copiado internamente, então o chamador pode liberá-lo " "depois da finalização da chamada." -#: ../../c-api/init.rst:644 +#: ../../c-api/init.rst:651 msgid "" "The program full path is now used for :data:`sys.executable`, instead of the " "program name." @@ -928,7 +933,7 @@ msgstr "" "O caminho completo do programa agora é utilizado para :data:`sys." "executable`, em vez do nome do programa." -#: ../../c-api/init.rst:653 +#: ../../c-api/init.rst:660 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" @@ -936,7 +941,11 @@ msgstr "" "Retorna a verão deste interpretador Python. Esta é uma string que se parece " "com ::" -#: ../../c-api/init.rst:660 +#: ../../c-api/init.rst:663 +msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" +msgstr "" + +#: ../../c-api/init.rst:667 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " @@ -945,11 +954,11 @@ msgid "" "version`." msgstr "" -#: ../../c-api/init.rst:665 +#: ../../c-api/init.rst:672 msgid "See also the :c:var:`Py_Version` constant." msgstr "" -#: ../../c-api/init.rst:672 +#: ../../c-api/init.rst:679 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -960,7 +969,7 @@ msgid "" "available to Python code as ``sys.platform``." msgstr "" -#: ../../c-api/init.rst:683 +#: ../../c-api/init.rst:690 msgid "" "Return the official copyright string for the current Python version, for " "example" @@ -968,17 +977,17 @@ msgstr "" "Retorna a string oficial de direitos autoriais para a versão atual do " "Python, por exemplo" -#: ../../c-api/init.rst:685 +#: ../../c-api/init.rst:692 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "" -#: ../../c-api/init.rst:689 +#: ../../c-api/init.rst:696 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" -#: ../../c-api/init.rst:695 +#: ../../c-api/init.rst:702 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" @@ -986,14 +995,18 @@ msgstr "" "Retorna uma indicação do compilador usado para construir a atual versão do " "Python, em colchetes, por exemplo::" -#: ../../c-api/init.rst:702 ../../c-api/init.rst:716 +#: ../../c-api/init.rst:705 +msgid "\"[GCC 2.7.2.2]\"" +msgstr "" + +#: ../../c-api/init.rst:709 ../../c-api/init.rst:723 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" -#: ../../c-api/init.rst:709 +#: ../../c-api/init.rst:716 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" @@ -1001,7 +1014,11 @@ msgstr "" "Retorna informação sobre o número de sequência e a data e hora da construção " "da instância atual do interpretador Python, por exemplo ::" -#: ../../c-api/init.rst:728 +#: ../../c-api/init.rst:719 +msgid "\"#67, Aug 1 1997, 22:34:28\"" +msgstr "" + +#: ../../c-api/init.rst:735 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " @@ -1009,7 +1026,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:733 +#: ../../c-api/init.rst:740 msgid "" "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " "similar to those passed to the program's :c:func:`main` function with the " @@ -1020,7 +1037,7 @@ msgid "" "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" -#: ../../c-api/init.rst:741 +#: ../../c-api/init.rst:748 msgid "" "If *updatepath* is zero, this is all the function does. If *updatepath* is " "non-zero, the function also modifies :data:`sys.path` according to the " @@ -1030,73 +1047,77 @@ msgstr "" "é zero, a função também modifica :data:`sys.path` de acordo com o seguinte " "algoritmo:" -#: ../../c-api/init.rst:745 +#: ../../c-api/init.rst:752 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " "path of the directory where the script is located is prepended to :data:`sys." "path`." msgstr "" -#: ../../c-api/init.rst:748 +#: ../../c-api/init.rst:755 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" -#: ../../c-api/init.rst:756 ../../c-api/init.rst:792 +#: ../../c-api/init.rst:763 ../../c-api/init.rst:799 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:760 +#: ../../c-api/init.rst:767 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " "and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" -#: ../../c-api/init.rst:765 +#: ../../c-api/init.rst:772 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " "popping the first :data:`sys.path` element after having called :c:func:" "`PySys_SetArgv`, for example using::" msgstr "" -#: ../../c-api/init.rst:781 +#: ../../c-api/init.rst:776 +msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" +msgstr "" + +#: ../../c-api/init.rst:788 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" "`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:785 +#: ../../c-api/init.rst:792 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" "`-I`." msgstr "" -#: ../../c-api/init.rst:795 +#: ../../c-api/init.rst:802 msgid "The *updatepath* value depends on :option:`-I`." msgstr "" -#: ../../c-api/init.rst:802 +#: ../../c-api/init.rst:809 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: ../../c-api/init.rst:806 +#: ../../c-api/init.rst:813 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" -#: ../../c-api/init.rst:810 +#: ../../c-api/init.rst:817 msgid "" "The argument should point to a zero-terminated character string in static " "storage whose contents will not change for the duration of the program's " @@ -1104,18 +1125,18 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:823 +#: ../../c-api/init.rst:830 msgid "" "Return the default \"home\", that is, the value set by a previous call to :c:" "func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` " "environment variable if it is set." msgstr "" -#: ../../c-api/init.rst:837 +#: ../../c-api/init.rst:844 msgid "Thread State and the Global Interpreter Lock" msgstr "" -#: ../../c-api/init.rst:844 +#: ../../c-api/init.rst:851 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -1127,7 +1148,7 @@ msgid "" "once instead of twice." msgstr "" -#: ../../c-api/init.rst:854 +#: ../../c-api/init.rst:861 msgid "" "Therefore, the rule exists that only the thread that has acquired the :term:" "`GIL` may operate on Python objects or call Python/C API functions. In order " @@ -1137,7 +1158,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: ../../c-api/init.rst:864 +#: ../../c-api/init.rst:871 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1145,11 +1166,11 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:870 +#: ../../c-api/init.rst:877 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:872 +#: ../../c-api/init.rst:879 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" @@ -1157,11 +1178,27 @@ msgstr "" "A maioria dos códigos de extensão que manipulam a :term:`GIL` tem a seguinte " "estrutura::" -#: ../../c-api/init.rst:881 +#: ../../c-api/init.rst:882 +msgid "" +"Save the thread state in a local variable.\n" +"Release the global interpreter lock.\n" +"... Do some blocking I/O operation ...\n" +"Reacquire the global interpreter lock.\n" +"Restore the thread state from the local variable." +msgstr "" + +#: ../../c-api/init.rst:888 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: ../../c-api/init.rst:891 +#: ../../c-api/init.rst:890 +msgid "" +"Py_BEGIN_ALLOW_THREADS\n" +"... Do some blocking I/O operation ...\n" +"Py_END_ALLOW_THREADS" +msgstr "" + +#: ../../c-api/init.rst:898 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " @@ -1170,11 +1207,20 @@ msgstr "" "A macro :c:macro:`Py_BEGIN_ALLOW_THREADS` abre um novo bloco e declara uma " "variável local oculta; a macro :c:macro:`Py_END_ALLOW_THREADS` fecha o bloco." -#: ../../c-api/init.rst:895 +#: ../../c-api/init.rst:902 msgid "The block above expands to the following code::" msgstr "" -#: ../../c-api/init.rst:907 +#: ../../c-api/init.rst:904 +msgid "" +"PyThreadState *_save;\n" +"\n" +"_save = PyEval_SaveThread();\n" +"... Do some blocking I/O operation ...\n" +"PyEval_RestoreThread(_save);" +msgstr "" + +#: ../../c-api/init.rst:914 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -1185,7 +1231,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:916 +#: ../../c-api/init.rst:923 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -1195,11 +1241,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:927 +#: ../../c-api/init.rst:934 msgid "Non-Python created threads" msgstr "" -#: ../../c-api/init.rst:929 +#: ../../c-api/init.rst:936 msgid "" "When threads are created using the dedicated Python APIs (such as the :mod:" "`threading` module), a thread state is automatically associated to them and " @@ -1209,7 +1255,7 @@ msgid "" "for them." msgstr "" -#: ../../c-api/init.rst:936 +#: ../../c-api/init.rst:943 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -1220,14 +1266,27 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:944 +#: ../../c-api/init.rst:951 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: ../../c-api/init.rst:958 +#: ../../c-api/init.rst:955 +msgid "" +"PyGILState_STATE gstate;\n" +"gstate = PyGILState_Ensure();\n" +"\n" +"/* Perform Python actions here. */\n" +"result = CallSomeFunction();\n" +"/* evaluate result or handle exception */\n" +"\n" +"/* Release the thread. No Python API allowed beyond this point. */\n" +"PyGILState_Release(gstate);" +msgstr "" + +#: ../../c-api/init.rst:965 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -1236,11 +1295,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:968 +#: ../../c-api/init.rst:975 msgid "Cautions about fork()" msgstr "Cuidados com o uso de fork()" -#: ../../c-api/init.rst:970 +#: ../../c-api/init.rst:977 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1249,7 +1308,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:976 +#: ../../c-api/init.rst:983 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1266,7 +1325,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:991 +#: ../../c-api/init.rst:998 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1279,11 +1338,11 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:1004 +#: ../../c-api/init.rst:1011 msgid "High-level API" msgstr "" -#: ../../c-api/init.rst:1006 +#: ../../c-api/init.rst:1013 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" @@ -1291,7 +1350,7 @@ msgstr "" "Estes são os tipos e as funções mais comumente usados na escrita de um " "código de extensão em C, ou ao incorporar o interpretador Python:" -#: ../../c-api/init.rst:1011 +#: ../../c-api/init.rst:1018 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1299,7 +1358,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:1016 +#: ../../c-api/init.rst:1023 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1307,30 +1366,30 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:1024 +#: ../../c-api/init.rst:1031 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:1029 +#: ../../c-api/init.rst:1036 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:1040 +#: ../../c-api/init.rst:1047 msgid "Deprecated function which does nothing." msgstr "Função descontinuada que não faz nada." -#: ../../c-api/init.rst:1042 +#: ../../c-api/init.rst:1049 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:1044 +#: ../../c-api/init.rst:1051 msgid "The function now does nothing." msgstr "" -#: ../../c-api/init.rst:1047 +#: ../../c-api/init.rst:1054 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." @@ -1338,24 +1397,24 @@ msgstr "" "Esta função agora é chamada por :c:func:`Py_Initialize()`, então não há mais " "necessidade de você chamá-la." -#: ../../c-api/init.rst:1051 +#: ../../c-api/init.rst:1058 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" "Esta função não pode mais ser chamada antes de :c:func:`Py_Initialize()`." -#: ../../c-api/init.rst:1061 +#: ../../c-api/init.rst:1068 msgid "" "Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. " "This function can be called without holding the GIL, and therefore can be " "used to avoid calls to the locking API when running single-threaded." msgstr "" -#: ../../c-api/init.rst:1065 +#: ../../c-api/init.rst:1072 msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`." msgstr "" -#: ../../c-api/init.rst:1073 +#: ../../c-api/init.rst:1080 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1363,7 +1422,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1081 +#: ../../c-api/init.rst:1088 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1371,8 +1430,8 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1087 ../../c-api/init.rst:1133 -#: ../../c-api/init.rst:1415 +#: ../../c-api/init.rst:1094 ../../c-api/init.rst:1140 +#: ../../c-api/init.rst:1422 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1381,27 +1440,27 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1095 +#: ../../c-api/init.rst:1102 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1102 +#: ../../c-api/init.rst:1109 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:1107 +#: ../../c-api/init.rst:1114 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1112 +#: ../../c-api/init.rst:1119 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1423,7 +1482,7 @@ msgstr "" "estado anterior antes de Release(). Por exemplo, o uso normal das macros :c:" "macro:`Py_BEGIN_ALLOW_THREADS` e :c:macro:`Py_END_ALLOW_THREADS` é aceitável." -#: ../../c-api/init.rst:1122 +#: ../../c-api/init.rst:1129 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1433,13 +1492,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1129 +#: ../../c-api/init.rst:1136 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1141 +#: ../../c-api/init.rst:1148 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1447,13 +1506,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1146 +#: ../../c-api/init.rst:1153 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1152 +#: ../../c-api/init.rst:1159 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1461,7 +1520,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1160 +#: ../../c-api/init.rst:1167 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1472,13 +1531,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1172 +#: ../../c-api/init.rst:1179 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1178 +#: ../../c-api/init.rst:1185 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1490,7 +1549,7 @@ msgstr "" "deve ser combinado com a seguinte macro :c:macro:`Py_END_ALLOW_THREADS`. " "Veja acima para uma discussão mais aprofundada desta macro." -#: ../../c-api/init.rst:1186 +#: ../../c-api/init.rst:1193 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1502,7 +1561,7 @@ msgstr "" "macro:`Py_BEGIN_ALLOW_THREADS` anterior. Veja acima para uma discussão mais " "aprofundada desta macro." -#: ../../c-api/init.rst:1194 +#: ../../c-api/init.rst:1201 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." @@ -1510,7 +1569,7 @@ msgstr "" "Esta macro se expande para ``PyEval_RestoreThread(_save);``: é equivalente " "a :c:macro:`Py_END_ALLOW_THREADS` sem a chave de fechamento." -#: ../../c-api/init.rst:1200 +#: ../../c-api/init.rst:1207 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " @@ -1520,27 +1579,27 @@ msgstr "" "a :c:macro:`Py_BEGIN_ALLOW_THREADS` sem a chave de abertura e declaração de " "variável." -#: ../../c-api/init.rst:1206 +#: ../../c-api/init.rst:1213 msgid "Low-level API" msgstr "" -#: ../../c-api/init.rst:1208 +#: ../../c-api/init.rst:1215 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1210 +#: ../../c-api/init.rst:1217 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1216 +#: ../../c-api/init.rst:1223 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1220 +#: ../../c-api/init.rst:1227 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1548,13 +1607,13 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython." "PyInterpreterState_New`` sem argumentos." -#: ../../c-api/init.rst:1225 +#: ../../c-api/init.rst:1232 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1228 +#: ../../c-api/init.rst:1235 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1562,40 +1621,40 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``cpython." "PyInterpreterState_Clear`` sem argumentos." -#: ../../c-api/init.rst:1233 +#: ../../c-api/init.rst:1240 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1240 +#: ../../c-api/init.rst:1247 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1247 +#: ../../c-api/init.rst:1254 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1250 +#: ../../c-api/init.rst:1257 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1257 +#: ../../c-api/init.rst:1264 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1264 +#: ../../c-api/init.rst:1271 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock need not be " @@ -1603,119 +1662,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1279 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1274 +#: ../../c-api/init.rst:1281 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1277 +#: ../../c-api/init.rst:1284 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "" -#: ../../c-api/init.rst:1279 ../../c-api/init.rst:1288 -#: ../../c-api/init.rst:1297 +#: ../../c-api/init.rst:1286 ../../c-api/init.rst:1295 +#: ../../c-api/init.rst:1304 msgid "*tstate* must not be ``NULL``." msgstr "" -#: ../../c-api/init.rst:1286 +#: ../../c-api/init.rst:1293 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1295 +#: ../../c-api/init.rst:1302 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1304 +#: ../../c-api/init.rst:1311 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1306 +#: ../../c-api/init.rst:1313 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1313 +#: ../../c-api/init.rst:1320 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1316 +#: ../../c-api/init.rst:1323 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1324 +#: ../../c-api/init.rst:1331 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1326 +#: ../../c-api/init.rst:1333 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1329 ../../c-api/init.rst:1339 +#: ../../c-api/init.rst:1336 ../../c-api/init.rst:1346 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:1343 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1346 +#: ../../c-api/init.rst:1353 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1350 +#: ../../c-api/init.rst:1357 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1357 +#: ../../c-api/init.rst:1364 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1359 +#: ../../c-api/init.rst:1366 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1362 +#: ../../c-api/init.rst:1369 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1365 +#: ../../c-api/init.rst:1372 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1370 +#: ../../c-api/init.rst:1377 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1372 ../../c-api/init.rst:1380 +#: ../../c-api/init.rst:1379 ../../c-api/init.rst:1387 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1378 +#: ../../c-api/init.rst:1385 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1387 +#: ../../c-api/init.rst:1394 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1724,7 +1783,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1396 +#: ../../c-api/init.rst:1403 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1736,33 +1795,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1404 +#: ../../c-api/init.rst:1411 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1410 +#: ../../c-api/init.rst:1417 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1421 ../../c-api/init.rst:1459 +#: ../../c-api/init.rst:1428 ../../c-api/init.rst:1466 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1426 +#: ../../c-api/init.rst:1433 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1432 +#: ../../c-api/init.rst:1439 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1771,25 +1830,25 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1438 +#: ../../c-api/init.rst:1445 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1444 +#: ../../c-api/init.rst:1451 msgid "" "Acquire the global interpreter lock. The lock must have been created " "earlier. If this thread already has the lock, a deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1447 +#: ../../c-api/init.rst:1454 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead." msgstr "" -#: ../../c-api/init.rst:1453 +#: ../../c-api/init.rst:1460 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1798,23 +1857,23 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1467 +#: ../../c-api/init.rst:1474 msgid "" "Release the global interpreter lock. The lock must have been created " "earlier." msgstr "" -#: ../../c-api/init.rst:1469 +#: ../../c-api/init.rst:1476 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead." msgstr "" -#: ../../c-api/init.rst:1478 +#: ../../c-api/init.rst:1485 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1480 +#: ../../c-api/init.rst:1487 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1822,7 +1881,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1485 +#: ../../c-api/init.rst:1492 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1833,31 +1892,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1492 +#: ../../c-api/init.rst:1499 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1498 +#: ../../c-api/init.rst:1505 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1504 +#: ../../c-api/init.rst:1511 msgid "Structure fields:" msgstr "Campos de estrutura:" -#: ../../c-api/init.rst:1508 +#: ../../c-api/init.rst:1515 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1512 +#: ../../c-api/init.rst:1519 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1865,44 +1924,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1520 +#: ../../c-api/init.rst:1527 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1524 +#: ../../c-api/init.rst:1531 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1529 +#: ../../c-api/init.rst:1536 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1534 +#: ../../c-api/init.rst:1541 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1539 +#: ../../c-api/init.rst:1546 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1545 +#: ../../c-api/init.rst:1552 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1552 +#: ../../c-api/init.rst:1559 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1911,37 +1970,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1559 +#: ../../c-api/init.rst:1566 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1564 +#: ../../c-api/init.rst:1571 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1571 +#: ../../c-api/init.rst:1578 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1575 +#: ../../c-api/init.rst:1582 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1586 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1581 +#: ../../c-api/init.rst:1588 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1595 +#: ../../c-api/init.rst:1602 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1954,13 +2013,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1612 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1608 +#: ../../c-api/init.rst:1615 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -1971,7 +2030,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1617 +#: ../../c-api/init.rst:1624 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -1983,13 +2042,27 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1628 +#: ../../c-api/init.rst:1635 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1642 +#: ../../c-api/init.rst:1638 +msgid "" +"PyInterpreterConfig config = {\n" +" .use_main_obmalloc = 0,\n" +" .allow_fork = 0,\n" +" .allow_exec = 0,\n" +" .allow_threads = 1,\n" +" .allow_daemon_threads = 0,\n" +" .check_multi_interp_extensions = 1,\n" +" .gil = PyInterpreterConfig_OWN_GIL,\n" +"};\n" +"PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" +msgstr "" + +#: ../../c-api/init.rst:1649 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -1997,11 +2070,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1651 +#: ../../c-api/init.rst:1658 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1653 +#: ../../c-api/init.rst:1660 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2009,7 +2082,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1659 +#: ../../c-api/init.rst:1666 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2021,7 +2094,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1670 +#: ../../c-api/init.rst:1677 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -2031,7 +2104,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1690 +#: ../../c-api/init.rst:1697 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -2040,7 +2113,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1702 +#: ../../c-api/init.rst:1709 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -2050,17 +2123,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1710 +#: ../../c-api/init.rst:1717 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1722 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1717 +#: ../../c-api/init.rst:1724 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2072,7 +2145,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1734 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2086,7 +2159,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1738 +#: ../../c-api/init.rst:1745 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2098,7 +2171,7 @@ msgstr "" "falha em preservar o isolamento traz a exposição a todas as consequências de " "threads livres, incluindo corridas e travamentos difíceis de depurar." -#: ../../c-api/init.rst:1743 +#: ../../c-api/init.rst:1750 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2108,11 +2181,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1754 +#: ../../c-api/init.rst:1761 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1756 +#: ../../c-api/init.rst:1763 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2125,7 +2198,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1766 +#: ../../c-api/init.rst:1773 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2134,7 +2207,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1772 +#: ../../c-api/init.rst:1779 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2146,25 +2219,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1783 +#: ../../c-api/init.rst:1790 msgid "Asynchronous Notifications" msgstr "Notificações assíncronas" -#: ../../c-api/init.rst:1785 +#: ../../c-api/init.rst:1792 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1792 +#: ../../c-api/init.rst:1799 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:1803 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2172,17 +2245,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1801 +#: ../../c-api/init.rst:1808 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1802 +#: ../../c-api/init.rst:1809 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1812 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2190,20 +2263,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1810 +#: ../../c-api/init.rst:1817 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1813 +#: ../../c-api/init.rst:1820 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1818 +#: ../../c-api/init.rst:1825 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2213,7 +2286,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1827 +#: ../../c-api/init.rst:1834 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2221,18 +2294,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1836 +#: ../../c-api/init.rst:1843 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1841 +#: ../../c-api/init.rst:1848 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1845 +#: ../../c-api/init.rst:1852 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2242,7 +2315,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1855 +#: ../../c-api/init.rst:1862 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -2254,66 +2327,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1864 +#: ../../c-api/init.rst:1871 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1864 +#: ../../c-api/init.rst:1871 msgid "Meaning of *arg*" msgstr "" -#: ../../c-api/init.rst:1866 +#: ../../c-api/init.rst:1873 msgid ":c:data:`PyTrace_CALL`" msgstr "" -#: ../../c-api/init.rst:1866 ../../c-api/init.rst:1871 -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1873 ../../c-api/init.rst:1878 +#: ../../c-api/init.rst:1889 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1868 +#: ../../c-api/init.rst:1875 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr "" -#: ../../c-api/init.rst:1868 +#: ../../c-api/init.rst:1875 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1871 +#: ../../c-api/init.rst:1878 msgid ":c:data:`PyTrace_LINE`" msgstr "" -#: ../../c-api/init.rst:1873 +#: ../../c-api/init.rst:1880 msgid ":c:data:`PyTrace_RETURN`" msgstr "" -#: ../../c-api/init.rst:1873 +#: ../../c-api/init.rst:1880 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1876 +#: ../../c-api/init.rst:1883 msgid ":c:data:`PyTrace_C_CALL`" msgstr "" -#: ../../c-api/init.rst:1876 ../../c-api/init.rst:1878 -#: ../../c-api/init.rst:1880 +#: ../../c-api/init.rst:1883 ../../c-api/init.rst:1885 +#: ../../c-api/init.rst:1887 msgid "Function object being called." msgstr "" -#: ../../c-api/init.rst:1878 +#: ../../c-api/init.rst:1885 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr "" -#: ../../c-api/init.rst:1880 +#: ../../c-api/init.rst:1887 msgid ":c:data:`PyTrace_C_RETURN`" msgstr "" -#: ../../c-api/init.rst:1882 +#: ../../c-api/init.rst:1889 msgid ":c:data:`PyTrace_OPCODE`" msgstr "" -#: ../../c-api/init.rst:1887 +#: ../../c-api/init.rst:1894 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2322,7 +2395,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1896 +#: ../../c-api/init.rst:1903 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2334,7 +2407,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1907 +#: ../../c-api/init.rst:1914 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2342,31 +2415,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1915 +#: ../../c-api/init.rst:1922 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1921 +#: ../../c-api/init.rst:1928 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1927 +#: ../../c-api/init.rst:1934 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1933 +#: ../../c-api/init.rst:1940 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1939 +#: ../../c-api/init.rst:1946 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2374,7 +2447,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1947 +#: ../../c-api/init.rst:1954 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2384,29 +2457,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1954 +#: ../../c-api/init.rst:1961 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1956 ../../c-api/init.rst:1963 -#: ../../c-api/init.rst:1982 ../../c-api/init.rst:1989 +#: ../../c-api/init.rst:1963 ../../c-api/init.rst:1970 +#: ../../c-api/init.rst:1989 ../../c-api/init.rst:1996 msgid "The caller must hold the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1960 +#: ../../c-api/init.rst:1967 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:1965 +#: ../../c-api/init.rst:1972 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:1973 +#: ../../c-api/init.rst:1980 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2417,65 +2490,65 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1980 +#: ../../c-api/init.rst:1987 msgid "See also the :func:`sys.settrace` function." msgstr "" -#: ../../c-api/init.rst:1986 +#: ../../c-api/init.rst:1993 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:1991 +#: ../../c-api/init.rst:1998 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2000 +#: ../../c-api/init.rst:2007 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2005 +#: ../../c-api/init.rst:2012 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2010 +#: ../../c-api/init.rst:2017 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2015 +#: ../../c-api/init.rst:2022 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2020 +#: ../../c-api/init.rst:2027 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2026 +#: ../../c-api/init.rst:2033 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2032 +#: ../../c-api/init.rst:2039 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2039 +#: ../../c-api/init.rst:2046 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2043 +#: ../../c-api/init.rst:2050 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2485,19 +2558,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2050 +#: ../../c-api/init.rst:2057 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2060 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2057 +#: ../../c-api/init.rst:2064 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2505,22 +2578,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2065 +#: ../../c-api/init.rst:2072 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2067 +#: ../../c-api/init.rst:2074 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2073 +#: ../../c-api/init.rst:2080 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2078 +#: ../../c-api/init.rst:2085 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2528,7 +2601,7 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2083 +#: ../../c-api/init.rst:2090 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." @@ -2536,24 +2609,24 @@ msgstr "" "Quando :ref:`Py_LIMITED_API ` não é definido, a alocação estática " "deste tipo por :c:macro:`Py_tss_NEEDS_INIT` é permitida." -#: ../../c-api/init.rst:2089 +#: ../../c-api/init.rst:2096 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2094 +#: ../../c-api/init.rst:2101 msgid "Dynamic Allocation" msgstr "Alocação dinâmica" -#: ../../c-api/init.rst:2096 +#: ../../c-api/init.rst:2103 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2103 +#: ../../c-api/init.rst:2110 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." @@ -2561,23 +2634,23 @@ msgstr "" "Retorna um valor que é o mesmo estado de um valor inicializado com :c:macro:" "`Py_tss_NEEDS_INIT`, ou ``NULL`` no caso de falha de alocação dinâmica." -#: ../../c-api/init.rst:2110 +#: ../../c-api/init.rst:2117 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2116 +#: ../../c-api/init.rst:2123 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2121 +#: ../../c-api/init.rst:2128 msgid "Methods" msgstr "Métodos" -#: ../../c-api/init.rst:2123 +#: ../../c-api/init.rst:2130 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2585,13 +2658,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2131 +#: ../../c-api/init.rst:2138 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2137 +#: ../../c-api/init.rst:2144 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2605,7 +2678,7 @@ msgstr "" "repetidamente na mesma tecla -- chamá-la em uma tecla já inicializada não " "funciona e retorna imediatamente com sucesso." -#: ../../c-api/init.rst:2146 +#: ../../c-api/init.rst:2153 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2614,31 +2687,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2155 +#: ../../c-api/init.rst:2162 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2162 +#: ../../c-api/init.rst:2169 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2170 +#: ../../c-api/init.rst:2177 msgid "Thread Local Storage (TLS) API" msgstr "" -#: ../../c-api/init.rst:2172 +#: ../../c-api/init.rst:2179 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2177 +#: ../../c-api/init.rst:2184 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2647,13 +2720,13 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2182 +#: ../../c-api/init.rst:2189 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:495 ../../c-api/init.rst:570 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:502 ../../c-api/init.rst:577 msgid "Py_SetProgramName()" msgstr "" @@ -2665,33 +2738,33 @@ msgstr "" msgid "modules (in module sys)" msgstr "" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622 msgid "path (in module sys)" msgstr "" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 -#: ../../c-api/init.rst:1056 ../../c-api/init.rst:1587 -#: ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622 +#: ../../c-api/init.rst:1063 ../../c-api/init.rst:1594 +#: ../../c-api/init.rst:1689 msgid "module" msgstr "módulo" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1594 ../../c-api/init.rst:1689 msgid "builtins" msgstr "builtins" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1594 ../../c-api/init.rst:1689 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1594 ../../c-api/init.rst:1689 msgid "sys" msgstr "sys" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622 msgid "search" msgstr "pesquisa" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:589 ../../c-api/init.rst:615 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:596 ../../c-api/init.rst:622 msgid "path" msgstr "caminho" @@ -2703,134 +2776,134 @@ msgstr "" msgid "PySys_SetArgvEx (C function)" msgstr "" -#: ../../c-api/init.rst:334 ../../c-api/init.rst:1647 ../../c-api/init.rst:1700 +#: ../../c-api/init.rst:334 ../../c-api/init.rst:1654 ../../c-api/init.rst:1707 msgid "Py_FinalizeEx (C function)" msgstr "" -#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 +#: ../../c-api/init.rst:437 ../../c-api/init.rst:474 msgid "Py_Initialize()" msgstr "" -#: ../../c-api/init.rst:430 ../../c-api/init.rst:467 ../../c-api/init.rst:723 +#: ../../c-api/init.rst:437 ../../c-api/init.rst:474 ../../c-api/init.rst:730 msgid "main()" msgstr "" -#: ../../c-api/init.rst:430 +#: ../../c-api/init.rst:437 msgid "stdin" msgstr "" -#: ../../c-api/init.rst:430 +#: ../../c-api/init.rst:437 msgid "stdout" msgstr "" -#: ../../c-api/init.rst:430 +#: ../../c-api/init.rst:437 msgid "sdterr" msgstr "" -#: ../../c-api/init.rst:467 ../../c-api/init.rst:615 +#: ../../c-api/init.rst:474 ../../c-api/init.rst:622 msgid "Py_GetPath()" msgstr "" -#: ../../c-api/init.rst:570 +#: ../../c-api/init.rst:577 msgid "executable (in module sys)" msgstr "" -#: ../../c-api/init.rst:589 +#: ../../c-api/init.rst:596 msgid "Py_SetPath()" msgstr "" -#: ../../c-api/init.rst:658 ../../c-api/init.rst:700 ../../c-api/init.rst:714 +#: ../../c-api/init.rst:665 ../../c-api/init.rst:707 ../../c-api/init.rst:721 msgid "version (in module sys)" msgstr "" -#: ../../c-api/init.rst:670 +#: ../../c-api/init.rst:677 msgid "platform (in module sys)" msgstr "" -#: ../../c-api/init.rst:687 +#: ../../c-api/init.rst:694 msgid "copyright (in module sys)" msgstr "" -#: ../../c-api/init.rst:723 +#: ../../c-api/init.rst:730 msgid "Py_FatalError()" msgstr "" -#: ../../c-api/init.rst:723 +#: ../../c-api/init.rst:730 msgid "argv (in module sys)" msgstr "" -#: ../../c-api/init.rst:839 +#: ../../c-api/init.rst:846 msgid "global interpreter lock" msgstr "trava global do interpretador" -#: ../../c-api/init.rst:839 +#: ../../c-api/init.rst:846 msgid "interpreter lock" msgstr "" -#: ../../c-api/init.rst:839 +#: ../../c-api/init.rst:846 msgid "lock, interpreter" msgstr "" -#: ../../c-api/init.rst:852 +#: ../../c-api/init.rst:859 msgid "setswitchinterval (in module sys)" msgstr "" -#: ../../c-api/init.rst:861 +#: ../../c-api/init.rst:868 msgid "PyThreadState (C type)" msgstr "" -#: ../../c-api/init.rst:887 +#: ../../c-api/init.rst:894 msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "" -#: ../../c-api/init.rst:887 +#: ../../c-api/init.rst:894 msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "" -#: ../../c-api/init.rst:903 +#: ../../c-api/init.rst:910 msgid "PyEval_RestoreThread (C function)" msgstr "" -#: ../../c-api/init.rst:903 +#: ../../c-api/init.rst:910 msgid "PyEval_SaveThread (C function)" msgstr "" -#: ../../c-api/init.rst:1034 +#: ../../c-api/init.rst:1041 msgid "PyEval_AcquireThread()" msgstr "" -#: ../../c-api/init.rst:1034 +#: ../../c-api/init.rst:1041 msgid "PyEval_ReleaseThread()" msgstr "" -#: ../../c-api/init.rst:1034 +#: ../../c-api/init.rst:1041 msgid "PyEval_SaveThread()" msgstr "" -#: ../../c-api/init.rst:1034 +#: ../../c-api/init.rst:1041 msgid "PyEval_RestoreThread()" msgstr "" -#: ../../c-api/init.rst:1056 +#: ../../c-api/init.rst:1063 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1594 ../../c-api/init.rst:1689 msgid "stdout (in module sys)" msgstr "" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1594 ../../c-api/init.rst:1689 msgid "stderr (in module sys)" msgstr "" -#: ../../c-api/init.rst:1587 ../../c-api/init.rst:1682 +#: ../../c-api/init.rst:1594 ../../c-api/init.rst:1689 msgid "stdin (in module sys)" msgstr "" -#: ../../c-api/init.rst:1647 +#: ../../c-api/init.rst:1654 msgid "Py_Initialize (C function)" msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1684 msgid "close (in module os)" msgstr "" diff --git a/c-api/init_config.po b/c-api/init_config.po index 22334a5da..7e14b8231 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -4,29 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Italo Penaforte , 2021 -# And Past , 2021 -# Hélio Júnior , 2021 -# Rodrigo Cândido, 2022 -# Lívia Pavini Zeviani, 2022 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -99,6 +92,42 @@ msgid "Example of customized Python always running in isolated mode::" msgstr "" "Exemplo de Python personalizado sendo executado sempre em um modo isolado:" +#: ../../c-api/init_config.rst:41 +msgid "" +"int main(int argc, char **argv)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +" config.isolated = 1;\n" +"\n" +" /* Decode command line arguments.\n" +" Implicitly preinitialize Python (in isolated mode). */\n" +" status = PyConfig_SetBytesArgv(&config, argc, argv);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +"\n" +" return Py_RunMain();\n" +"\n" +"exception:\n" +" PyConfig_Clear(&config);\n" +" if (PyStatus_IsExit(status)) {\n" +" return status.exitcode;\n" +" }\n" +" /* Display the error message and exit the process with\n" +" non-zero exit code */\n" +" Py_ExitStatusException(status);\n" +"}" +msgstr "" + #: ../../c-api/init_config.rst:76 msgid "PyWideStringList" msgstr "PyWideStringList" @@ -249,6 +278,29 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../c-api/init_config.rst:191 +msgid "" +"PyStatus alloc(void **ptr, size_t size)\n" +"{\n" +" *ptr = PyMem_RawMalloc(size);\n" +" if (*ptr == NULL) {\n" +" return PyStatus_NoMemory();\n" +" }\n" +" return PyStatus_Ok();\n" +"}\n" +"\n" +"int main(int argc, char **argv)\n" +"{\n" +" void *ptr;\n" +" PyStatus status = alloc(&ptr, 16);\n" +" if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +" }\n" +" PyMem_Free(ptr);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../c-api/init_config.rst:213 msgid "PyPreConfig" msgstr "PyPreConfig" @@ -626,6 +678,26 @@ msgstr "" "Exemplo usando a pré-inicialização para habilitar o :ref:`modo UTF-8 do " "Python `." +#: ../../c-api/init_config.rst:414 +msgid "" +"PyStatus status;\n" +"PyPreConfig preconfig;\n" +"PyPreConfig_InitPythonConfig(&preconfig);\n" +"\n" +"preconfig.utf8_mode = 1;\n" +"\n" +"status = Py_PreInitialize(&preconfig);\n" +"if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +"}\n" +"\n" +"/* at this point, Python speaks UTF-8 */\n" +"\n" +"Py_Initialize();\n" +"/* ... use Python API here ... */\n" +"Py_Finalize();" +msgstr "" + #: ../../c-api/init_config.rst:433 msgid "PyConfig" msgstr "PyConfig" @@ -709,7 +781,7 @@ msgstr "" msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " -"arguments are parsed. Since Python arguments are strippped from :c:member:" +"arguments are parsed. Since Python arguments are stripped from :c:member:" "`PyConfig.argv`, parsing arguments twice would parse the application options " "as Python options." msgstr "" @@ -1815,6 +1887,35 @@ msgstr "" msgid "Example setting the program name::" msgstr "" +#: ../../c-api/init_config.rst:1316 +msgid "" +"void init_python(void)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* Set the program name. Implicitly preinitialize Python. */\n" +" status = PyConfig_SetString(&config, &config.program_name,\n" +" L\"/path/to/my_program\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +" return;\n" +"\n" +"exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" +"}" +msgstr "" + #: ../../c-api/init_config.rst:1342 msgid "" "More complete example modifying the default configuration, read the " @@ -1824,6 +1925,61 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" +#: ../../c-api/init_config.rst:1349 +msgid "" +"PyStatus init_python(const char *program_name)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* Set the program name before reading the configuration\n" +" (decode byte string from the locale encoding).\n" +"\n" +" Implicitly preinitialize Python. */\n" +" status = PyConfig_SetBytesString(&config, &config.program_name,\n" +" program_name);\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" /* Read all configuration at once */\n" +" status = PyConfig_Read(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" /* Specify sys.path explicitly */\n" +" /* If you want to modify the default set of paths, finish\n" +" initialization first and then use PySys_GetObject(\"path\") */\n" +" config.module_search_paths_set = 1;\n" +" status = PyWideStringList_Append(&config.module_search_paths,\n" +" L\"/path/to/stdlib\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +" status = PyWideStringList_Append(&config.module_search_paths,\n" +" L\"/path/to/more/modules\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" /* Override executable computed by PyConfig_Read() */\n" +" status = PyConfig_SetString(&config, &config.executable,\n" +" L\"/path/to/my_executable\");\n" +" if (PyStatus_Exception(status)) {\n" +" goto done;\n" +" }\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +"\n" +"done:\n" +" PyConfig_Clear(&config);\n" +" return status;\n" +"}" +msgstr "" + #: ../../c-api/init_config.rst:1405 msgid "Isolated Configuration" msgstr "" @@ -2228,3 +2384,40 @@ msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" + +#: ../../c-api/init_config.rst:1611 +msgid "" +"void init_python(void)\n" +"{\n" +" PyStatus status;\n" +"\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +" config._init_main = 0;\n" +"\n" +" /* ... customize 'config' configuration ... */\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" PyConfig_Clear(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +" }\n" +"\n" +" /* Use sys.stderr because sys.stdout is only created\n" +" by _Py_InitializeMain() */\n" +" int res = PyRun_SimpleString(\n" +" \"import sys; \"\n" +" \"print('Run Python code before _Py_InitializeMain', \"\n" +" \"file=sys.stderr)\");\n" +" if (res < 0) {\n" +" exit(1);\n" +" }\n" +"\n" +" /* ... put more configuration code here ... */\n" +"\n" +" status = _Py_InitializeMain();\n" +" if (PyStatus_Exception(status)) {\n" +" Py_ExitStatusException(status);\n" +" }\n" +"}" +msgstr "" diff --git a/c-api/intro.po b/c-api/intro.po index 10f41398a..f9d1c236e 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Ruan Aragão , 2021 -# Leticia Portella , 2021 -# Italo Penaforte , 2021 -# felipe caridade fernandes , 2021 -# Marco Rougeth , 2023 -# Claudio Rogerio Carvalho Filho , 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-25 01:09+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -115,6 +109,12 @@ msgstr "" "Todas as definições de função, tipo e macro necessárias para usar a API " "Python/C estão incluídas em seu código pela seguinte linha::" +#: ../../c-api/intro.rst:51 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " +msgstr "" + #: ../../c-api/intro.rst:54 msgid "" "This implies inclusion of the following standard headers: ````, " @@ -255,6 +255,21 @@ msgstr "" "*name* é o nome do módulo, e deve ser o único item não-\\ ``static`` " "definido no arquivo do módulo. Exemplo::" +#: ../../c-api/intro.rst:119 +msgid "" +"static struct PyModuleDef spam_module = {\n" +" PyModuleDef_HEAD_INIT,\n" +" .m_name = \"spam\",\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModule_Create(&spam_module);\n" +"}" +msgstr "" + #: ../../c-api/intro.rst:134 msgid "Return the absolute value of ``x``." msgstr "Retorna o valor absoluto de ``x``." @@ -303,6 +318,10 @@ msgstr "" msgid "It must be specified before the function return type. Usage::" msgstr "Deve ser especificado antes do tipo de retorno da função. Uso::" +#: ../../c-api/intro.rst:156 +msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" +msgstr "" + #: ../../c-api/intro.rst:162 msgid "" "Argument must be a character or an integer in the range [-128, 127] or [0, " @@ -325,6 +344,10 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../c-api/intro.rst:172 +msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" +msgstr "" + #: ../../c-api/intro.rst:174 msgid "MSVC support was added." msgstr "Suporte a MSVC foi adicionado." @@ -363,6 +386,10 @@ msgstr "" msgid "Usage::" msgstr "Uso::" +#: ../../c-api/intro.rst:208 +msgid "Py_NO_INLINE static int random(void) { return 4; }" +msgstr "" + #: ../../c-api/intro.rst:214 msgid "" "Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." @@ -441,6 +468,17 @@ msgstr "" "Use :c:macro:`PyDoc_STRVAR` para docstrings para ter suporte à compilação do " "Python sem docstrings, conforme especificado em :pep:`7`." +#: ../../c-api/intro.rst:258 +msgid "" +"PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" +"\n" +"static PyMethodDef deque_methods[] = {\n" +" // ...\n" +" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" +" // ...\n" +"}" +msgstr "" + #: ../../c-api/intro.rst:268 msgid "" "Creates a docstring for the given input string or an empty string if " @@ -457,6 +495,15 @@ msgstr "" "Use :c:macro:`PyDoc_STR` ao especificar docstrings para ter suporte à " "compilação do Python sem docstrings, conforme especificado em :pep:`7`." +#: ../../c-api/intro.rst:276 +msgid "" +"static PyMethodDef pysqlite_row_methods[] = {\n" +" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" +" PyDoc_STR(\"Returns the keys of the row.\")},\n" +" {NULL, NULL}\n" +"};" +msgstr "" + #: ../../c-api/intro.rst:286 msgid "Objects, Types and Reference Counts" msgstr "Objetos, tipos e contagens de referências" @@ -638,6 +685,16 @@ msgstr "" "(esquecendo o tratamento de erros por enquanto; uma maneira melhor de " "codificar isso é mostrada abaixo)::" +#: ../../c-api/intro.rst:415 +msgid "" +"PyObject *t;\n" +"\n" +"t = PyTuple_New(3);\n" +"PyTuple_SetItem(t, 0, PyLong_FromLong(1L));\n" +"PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" +"PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" +msgstr "" + #: ../../c-api/intro.rst:422 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " @@ -686,6 +743,14 @@ msgstr "" "código acima podem ser substituídos pelos seguintes (que também cuidam da " "verificação de erros)::" +#: ../../c-api/intro.rst:441 +msgid "" +"PyObject *tuple, *list;\n" +"\n" +"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" +"list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" +msgstr "" + #: ../../c-api/intro.rst:446 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " @@ -697,6 +762,30 @@ msgid "" "sequence) to a given item::" msgstr "" +#: ../../c-api/intro.rst:453 +msgid "" +"int\n" +"set_all(PyObject *target, PyObject *item)\n" +"{\n" +" Py_ssize_t i, n;\n" +"\n" +" n = PyObject_Length(target);\n" +" if (n < 0)\n" +" return -1;\n" +" for (i = 0; i < n; i++) {\n" +" PyObject *index = PyLong_FromSsize_t(i);\n" +" if (!index)\n" +" return -1;\n" +" if (PyObject_SetItem(target, index, item) < 0) {\n" +" Py_DECREF(index);\n" +" return -1;\n" +" }\n" +" Py_DECREF(index);\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + #: ../../c-api/intro.rst:476 msgid "" "The situation is slightly different for function return values. While " @@ -747,6 +836,62 @@ msgstr "" "soma dos itens em uma lista de inteiros; uma vez usando :c:func:" "`PyList_GetItem`, e uma vez usando :c:func:`PySequence_GetItem`. ::" +#: ../../c-api/intro.rst:501 +msgid "" +"long\n" +"sum_list(PyObject *list)\n" +"{\n" +" Py_ssize_t i, n;\n" +" long total = 0, value;\n" +" PyObject *item;\n" +"\n" +" n = PyList_Size(list);\n" +" if (n < 0)\n" +" return -1; /* Not a list */\n" +" for (i = 0; i < n; i++) {\n" +" item = PyList_GetItem(list, i); /* Can't fail */\n" +" if (!PyLong_Check(item)) continue; /* Skip non-integers */\n" +" value = PyLong_AsLong(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* Integer too big to fit in a C long, bail out */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" return total;\n" +"}" +msgstr "" + +#: ../../c-api/intro.rst:527 +msgid "" +"long\n" +"sum_sequence(PyObject *sequence)\n" +"{\n" +" Py_ssize_t i, n;\n" +" long total = 0, value;\n" +" PyObject *item;\n" +" n = PySequence_Length(sequence);\n" +" if (n < 0)\n" +" return -1; /* Has no length */\n" +" for (i = 0; i < n; i++) {\n" +" item = PySequence_GetItem(sequence, i);\n" +" if (item == NULL)\n" +" return -1; /* Not a sequence, or other failure */\n" +" if (PyLong_Check(item)) {\n" +" value = PyLong_AsLong(item);\n" +" Py_DECREF(item);\n" +" if (value == -1 && PyErr_Occurred())\n" +" /* Integer too big to fit in a C long, bail out */\n" +" return -1;\n" +" total += value;\n" +" }\n" +" else {\n" +" Py_DECREF(item); /* Discard reference ownership */\n" +" }\n" +" }\n" +" return total;\n" +"}" +msgstr "" + #: ../../c-api/intro.rst:561 msgid "Types" msgstr "Tipos" @@ -922,10 +1067,66 @@ msgid "" "why you like Python, we show the equivalent Python code::" msgstr "" +#: ../../c-api/intro.rst:655 +msgid "" +"def incr_item(dict, key):\n" +" try:\n" +" item = dict[key]\n" +" except KeyError:\n" +" item = 0\n" +" dict[key] = item + 1" +msgstr "" + #: ../../c-api/intro.rst:664 msgid "Here is the corresponding C code, in all its glory::" msgstr "Aqui está o código C correspondente, em toda sua glória::" +#: ../../c-api/intro.rst:666 +msgid "" +"int\n" +"incr_item(PyObject *dict, PyObject *key)\n" +"{\n" +" /* Objects all initialized to NULL for Py_XDECREF */\n" +" PyObject *item = NULL, *const_one = NULL, *incremented_item = NULL;\n" +" int rv = -1; /* Return value initialized to -1 (failure) */\n" +"\n" +" item = PyObject_GetItem(dict, key);\n" +" if (item == NULL) {\n" +" /* Handle KeyError only: */\n" +" if (!PyErr_ExceptionMatches(PyExc_KeyError))\n" +" goto error;\n" +"\n" +" /* Clear the error and use zero: */\n" +" PyErr_Clear();\n" +" item = PyLong_FromLong(0L);\n" +" if (item == NULL)\n" +" goto error;\n" +" }\n" +" const_one = PyLong_FromLong(1L);\n" +" if (const_one == NULL)\n" +" goto error;\n" +"\n" +" incremented_item = PyNumber_Add(item, const_one);\n" +" if (incremented_item == NULL)\n" +" goto error;\n" +"\n" +" if (PyObject_SetItem(dict, key, incremented_item) < 0)\n" +" goto error;\n" +" rv = 0; /* Success */\n" +" /* Continue with cleanup code */\n" +"\n" +" error:\n" +" /* Cleanup code, shared by success and failure path */\n" +"\n" +" /* Use Py_XDECREF() to ignore NULL references */\n" +" Py_XDECREF(item);\n" +" Py_XDECREF(const_one);\n" +" Py_XDECREF(incremented_item);\n" +"\n" +" return rv; /* -1 for error, 0 for success */\n" +"}" +msgstr "" + #: ../../c-api/intro.rst:716 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " diff --git a/c-api/iter.po b/c-api/iter.po index eae95c73c..8ca3f25e0 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -71,6 +69,32 @@ msgstr "" "Para escrever um laço que itere sobre um iterador, o código C deve ser algo " "como isto::" +#: ../../c-api/iter.rst:33 +msgid "" +"PyObject *iterator = PyObject_GetIter(obj);\n" +"PyObject *item;\n" +"\n" +"if (iterator == NULL) {\n" +" /* propagate error */\n" +"}\n" +"\n" +"while ((item = PyIter_Next(iterator))) {\n" +" /* do something with item */\n" +" ...\n" +" /* release reference when done */\n" +" Py_DECREF(item);\n" +"}\n" +"\n" +"Py_DECREF(iterator);\n" +"\n" +"if (PyErr_Occurred()) {\n" +" /* propagate error */\n" +"}\n" +"else {\n" +" /* continue doing useful work */\n" +"}" +msgstr "" + #: ../../c-api/iter.rst:59 msgid "" "The enum value used to represent different results of :c:func:`PyIter_Send`." diff --git a/c-api/iterator.po b/c-api/iterator.po index 58a77716f..43a22340c 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Felipefpl, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/list.po b/c-api/list.po index 162975d0e..1b62f07d0 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Livia Cavalcanti , 2021 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/long.po b/c-api/long.po index 6ea51da93..8e626efd7 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -4,7 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -12,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -391,10 +390,21 @@ msgstr "" "desambiguar." #: ../../c-api/long.rst:329 +msgid "" +"On success, return a read only :term:`named tuple`, that holds information " +"about Python's internal representation of integers. See :data:`sys.int_info` " +"for description of individual fields." +msgstr "" + +#: ../../c-api/long.rst:333 +msgid "On failure, return ``NULL`` with an exception set." +msgstr "Em caso de falha, retorna ``NULL`` com uma exceção definida." + +#: ../../c-api/long.rst:340 msgid "Return 1 if *op* is compact, 0 otherwise." msgstr "" -#: ../../c-api/long.rst:331 +#: ../../c-api/long.rst:342 msgid "" "This function makes it possible for performance-critical code to implement a " "“fast path” for small integers. For compact values use :c:func:" @@ -403,23 +413,23 @@ msgid "" "` :meth:`int.to_bytes`." msgstr "" -#: ../../c-api/long.rst:337 +#: ../../c-api/long.rst:348 msgid "The speedup is expected to be negligible for most users." msgstr "" -#: ../../c-api/long.rst:339 +#: ../../c-api/long.rst:350 msgid "" "Exactly what values are considered compact is an implementation detail and " "is subject to change." msgstr "" -#: ../../c-api/long.rst:344 +#: ../../c-api/long.rst:355 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:347 +#: ../../c-api/long.rst:358 msgid "Otherwise, the return value is undefined." msgstr "" diff --git a/c-api/mapping.po b/c-api/mapping.po index e52eb4b6d..9394cfa4a 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/marshal.po b/c-api/marshal.po index 8a5a1cadf..8f59aef86 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -50,10 +50,10 @@ msgstr "" msgid "" "The module supports two versions of the data format: version 0 is the " "historical version, version 1 shares interned strings in the file, and upon " -"unmarshalling. Version 2 uses a binary format for floating point numbers. " +"unmarshalling. Version 2 uses a binary format for floating-point numbers. " "``Py_MARSHAL_VERSION`` indicates the current file format (currently 2)." msgstr "" -"O módulo possui suporte a duas versões do formato de dados: a versão 0 é a " +"O módulo oferece suporte a duas versões do formato de dados: a versão 0 é a " "versão histórica, a versão 1 compartilha strings internas no arquivo e após " "a desserialização. A versão 2 usa um formato binário para números de ponto " "flutuante. ``Py_MARSHAL_VERSION`` indica o formato do arquivo atual " diff --git a/c-api/memory.po b/c-api/memory.po index ea96dad8c..842fb2ed3 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 -# Marco Rougeth , 2021 -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rodrigo Cândido, 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -82,6 +76,19 @@ msgid "" "in the following example::" msgstr "" +#: ../../c-api/memory.rst:58 +msgid "" +"PyObject *res;\n" +"char *buf = (char *) malloc(BUFSIZ); /* for I/O */\n" +"\n" +"if (buf == NULL)\n" +" return PyErr_NoMemory();\n" +"...Do some I/O operation involving buf...\n" +"res = PyBytes_FromString(buf);\n" +"free(buf); /* malloc'ed */\n" +"return res;" +msgstr "" + #: ../../c-api/memory.rst:68 msgid "" "In this example, the memory request for the I/O buffer is handled by the C " @@ -1056,10 +1063,36 @@ msgid "" "set::" msgstr "" +#: ../../c-api/memory.rst:706 +msgid "" +"PyObject *res;\n" +"char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n" +"\n" +"if (buf == NULL)\n" +" return PyErr_NoMemory();\n" +"/* ...Do some I/O operation involving buf... */\n" +"res = PyBytes_FromString(buf);\n" +"PyMem_Free(buf); /* allocated with PyMem_Malloc */\n" +"return res;" +msgstr "" + #: ../../c-api/memory.rst:716 msgid "The same code using the type-oriented function set::" msgstr "" +#: ../../c-api/memory.rst:718 +msgid "" +"PyObject *res;\n" +"char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n" +"\n" +"if (buf == NULL)\n" +" return PyErr_NoMemory();\n" +"/* ...Do some I/O operation involving buf... */\n" +"res = PyBytes_FromString(buf);\n" +"PyMem_Del(buf); /* allocated with PyMem_New */\n" +"return res;" +msgstr "" + #: ../../c-api/memory.rst:728 msgid "" "Note that in the two examples above, the buffer is always manipulated via " @@ -1070,6 +1103,17 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" +#: ../../c-api/memory.rst:735 +msgid "" +"char *buf1 = PyMem_New(char, BUFSIZ);\n" +"char *buf2 = (char *) malloc(BUFSIZ);\n" +"char *buf3 = (char *) PyMem_Malloc(BUFSIZ);\n" +"...\n" +"PyMem_Del(buf3); /* Wrong -- should be PyMem_Free() */\n" +"free(buf2); /* Right -- allocated via malloc() */\n" +"free(buf1); /* Fatal -- should be PyMem_Del() */" +msgstr "" + #: ../../c-api/memory.rst:743 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " diff --git a/c-api/memoryview.po b/c-api/memoryview.po index e27bc8348..df53f2e1f 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -4,7 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -12,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/method.po b/c-api/method.po index fb4244f6b..3fccc82ec 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Adorilson Bezerra , 2021 -# Cássio Nomura , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/module.po b/c-api/module.po index ac1a98c90..d33f0bd12 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Rodrigo Cândido, 2022 -# Welliton Malta , 2023 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -69,11 +65,16 @@ msgstr "" "`__name__` são definidos como ``None``); O chamador é responsásvel por " "providenciar um atributo :attr:`__file__`." -#: ../../c-api/module.rst:48 +#: ../../c-api/module.rst:46 ../../c-api/module.rst:270 +#: ../../c-api/module.rst:445 +msgid "Return ``NULL`` with an exception set on error." +msgstr "Retorna ``NULL`` com uma exceção definida em caso de erro." + +#: ../../c-api/module.rst:50 msgid ":attr:`__package__` and :attr:`__loader__` are set to ``None``." msgstr ":attr:`__package__` e :attr:`__loader__` são definidos como ``None``." -#: ../../c-api/module.rst:54 +#: ../../c-api/module.rst:56 msgid "" "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " "string instead of a Unicode object." @@ -81,7 +82,7 @@ msgstr "" "Semelhante a :c:func:`PyModule_NewObject`, mas o nome é uma string " "codificada em UTF-8 em vez de um objeto Unicode." -#: ../../c-api/module.rst:62 +#: ../../c-api/module.rst:64 msgid "" "Return the dictionary object that implements *module*'s namespace; this " "object is the same as the :attr:`~object.__dict__` attribute of the module " @@ -93,7 +94,7 @@ msgstr "" "módulo. Se *module* não for um objeto de módulo (ou um subtipo de um objeto " "de módulo), :exc:`SystemError` é levantada e ``NULL`` é retornado." -#: ../../c-api/module.rst:67 +#: ../../c-api/module.rst:69 msgid "" "It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " "functions rather than directly manipulate a module's :attr:`~object." @@ -103,7 +104,7 @@ msgstr "" "``PyObject_*`` em vez de manipular diretamente o :attr:`~object.__dict__` de " "um módulo." -#: ../../c-api/module.rst:78 +#: ../../c-api/module.rst:80 msgid "" "Return *module*'s :attr:`__name__` value. If the module does not provide " "one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is " @@ -113,7 +114,7 @@ msgstr "" "ou se não for uma string, :exc:`SystemError` é levantada e ``NULL`` é " "retornado." -#: ../../c-api/module.rst:86 +#: ../../c-api/module.rst:88 msgid "" "Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " "``'utf-8'``." @@ -121,7 +122,7 @@ msgstr "" "Semelhante a :c:func:`PyModule_GetNameObject` mas retorna o nome codificado " "em ``'utf-8'``" -#: ../../c-api/module.rst:91 +#: ../../c-api/module.rst:93 msgid "" "Return the \"state\" of the module, that is, a pointer to the block of " "memory allocated at module creation time, or ``NULL``. See :c:member:" @@ -131,7 +132,7 @@ msgstr "" "alocado no momento de criação do módulo, ou ``NULL``. Ver :c:member:" "`PyModuleDef.m_size`." -#: ../../c-api/module.rst:98 +#: ../../c-api/module.rst:100 msgid "" "Return a pointer to the :c:type:`PyModuleDef` struct from which the module " "was created, or ``NULL`` if the module wasn't created from a definition." @@ -139,7 +140,7 @@ msgstr "" "Retorna um ponteiro para a estrutura :c:type:`PyModuleDef` da qual o módulo " "foi criado, ou ``NULL`` se o módulo não foi criado de uma definição." -#: ../../c-api/module.rst:108 +#: ../../c-api/module.rst:110 msgid "" "Return the name of the file from which *module* was loaded using *module*'s :" "attr:`__file__` attribute. If this is not defined, or if it is not a " @@ -151,7 +152,7 @@ msgstr "" "for uma string unicode, levanta :exc:`SystemError` e retorna ``NULL``; Caso " "contrário, retorna uma referência a um objeto Unicode." -#: ../../c-api/module.rst:118 +#: ../../c-api/module.rst:120 msgid "" "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " "encoded to 'utf-8'." @@ -159,7 +160,7 @@ msgstr "" "Semelhante a :c:func:`PyModule_GetFilenameObject` mas retorna o nome do " "arquivo codificado em 'utf-8'." -#: ../../c-api/module.rst:121 +#: ../../c-api/module.rst:123 msgid "" ":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." @@ -167,11 +168,11 @@ msgstr "" ":c:func:`PyModule_GetFilename`: levanta :exc:`UnicodeEncodeError` quando há " "nomes de arquivos não codificáveis, use :c:func:`PyModule_GetFilenameObject`." -#: ../../c-api/module.rst:129 +#: ../../c-api/module.rst:131 msgid "Initializing C modules" msgstr "Inicializando módulos C" -#: ../../c-api/module.rst:131 +#: ../../c-api/module.rst:133 msgid "" "Modules objects are usually created from extension modules (shared libraries " "which export an initialization function), or compiled-in modules (where the " @@ -184,7 +185,7 @@ msgstr "" "func:`PyImport_AppendInittab`). Ver :ref:`building` ou :ref:`extending-with-" "embedding` para mais detalhes." -#: ../../c-api/module.rst:136 +#: ../../c-api/module.rst:138 msgid "" "The initialization function can either pass a module definition instance to :" "c:func:`PyModule_Create`, and return the resulting module object, or request " @@ -195,7 +196,7 @@ msgstr "" "solicitar \"inicialização multifásica\" retornando a própria estrutura de " "definição." -#: ../../c-api/module.rst:142 +#: ../../c-api/module.rst:144 msgid "" "The module definition struct, which holds all information needed to create a " "module object. There is usually only one statically initialized variable of " @@ -205,15 +206,15 @@ msgstr "" "necessária para criar um objeto de módulo. Geralmente, há apenas uma " "variável inicializada estaticamente desse tipo para cada módulo." -#: ../../c-api/module.rst:148 +#: ../../c-api/module.rst:150 msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." msgstr "Sempre inicializa este membro para :c:macro:`PyModuleDef_HEAD_INIT`." -#: ../../c-api/module.rst:152 +#: ../../c-api/module.rst:154 msgid "Name for the new module." msgstr "Nome para o novo módulo." -#: ../../c-api/module.rst:156 +#: ../../c-api/module.rst:158 msgid "" "Docstring for the module; usually a docstring variable created with :c:macro:" "`PyDoc_STRVAR` is used." @@ -221,7 +222,7 @@ msgstr "" "Docstring para o módulo; geralmente uma variável docstring criada com :c:" "macro:`PyDoc_STRVAR` é usada." -#: ../../c-api/module.rst:161 +#: ../../c-api/module.rst:163 msgid "" "Module state may be kept in a per-module memory area that can be retrieved " "with :c:func:`PyModule_GetState`, rather than in static globals. This makes " @@ -232,7 +233,7 @@ msgstr "" "estáticos. Isso torna os módulos seguros para uso em vários " "subinterpretadores." -#: ../../c-api/module.rst:165 +#: ../../c-api/module.rst:167 msgid "" "This memory area is allocated based on *m_size* on module creation, and " "freed when the module object is deallocated, after the :c:member:" @@ -242,7 +243,7 @@ msgstr "" "liberada quando o objeto do módulo é desalocado, após a função :c:member:" "`~PyModuleDef.m_free` ter sido chamada, se presente." -#: ../../c-api/module.rst:169 +#: ../../c-api/module.rst:171 msgid "" "Setting ``m_size`` to ``-1`` means that the module does not support sub-" "interpreters, because it has global state." @@ -250,7 +251,7 @@ msgstr "" "Definir ``m_size`` como ``-1`` significa que o módulo não oferece suporte a " "subinterpretadores, porque ele tem estado global." -#: ../../c-api/module.rst:172 +#: ../../c-api/module.rst:174 msgid "" "Setting it to a non-negative value means that the module can be re-" "initialized and specifies the additional amount of memory it requires for " @@ -262,11 +263,11 @@ msgstr "" "para seu estado. ``m_size`` não negativo é necessário para inicialização " "multifásica." -#: ../../c-api/module.rst:177 +#: ../../c-api/module.rst:179 msgid "See :PEP:`3121` for more details." msgstr "Ver :PEP:`3121` para mais detalhes." -#: ../../c-api/module.rst:181 +#: ../../c-api/module.rst:183 msgid "" "A pointer to a table of module-level functions, described by :c:type:" "`PyMethodDef` values. Can be ``NULL`` if no functions are present." @@ -275,7 +276,7 @@ msgstr "" "valores :c:type:`PyMethodDef`. Pode ser ``NULL`` se nenhuma função estiver " "presente." -#: ../../c-api/module.rst:186 +#: ../../c-api/module.rst:188 msgid "" "An array of slot definitions for multi-phase initialization, terminated by a " "``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " @@ -285,7 +286,7 @@ msgstr "" "por uma entrada ``{0, NULL}``. Ao usar inicialização monofásica, *m_slots* " "deve ser ``NULL``." -#: ../../c-api/module.rst:192 +#: ../../c-api/module.rst:194 msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" @@ -293,7 +294,7 @@ msgstr "" "Antes da versão 3.5, esse membro era sempre definido como ``NULL`` e era " "definido como:" -#: ../../c-api/module.rst:199 +#: ../../c-api/module.rst:201 msgid "" "A traversal function to call during GC traversal of the module object, or " "``NULL`` if not needed." @@ -301,8 +302,8 @@ msgstr "" "Uma função de travessia para chamar durante a travessia do GC do objeto do " "módulo, ou ``NULL`` se não for necessário." -#: ../../c-api/module.rst:202 ../../c-api/module.rst:217 -#: ../../c-api/module.rst:238 +#: ../../c-api/module.rst:204 ../../c-api/module.rst:219 +#: ../../c-api/module.rst:240 msgid "" "This function is not called if the module state was requested but is not " "allocated yet. This is the case immediately after the module is created and " @@ -318,12 +319,12 @@ msgstr "" "for maior que 0 e o estado do módulo (como retornado por :c:func:" "`PyModule_GetState`) for ``NULL``." -#: ../../c-api/module.rst:209 ../../c-api/module.rst:230 -#: ../../c-api/module.rst:245 +#: ../../c-api/module.rst:211 ../../c-api/module.rst:232 +#: ../../c-api/module.rst:247 msgid "No longer called before the module state is allocated." msgstr "Não é mais chamado antes que o estado do módulo seja alocado." -#: ../../c-api/module.rst:214 +#: ../../c-api/module.rst:216 msgid "" "A clear function to call during GC clearing of the module object, or " "``NULL`` if not needed." @@ -331,7 +332,7 @@ msgstr "" "Uma função de limpeza para chamar durante a limpeza do GC do objeto do " "módulo, ou ``NULL`` se não for necessário." -#: ../../c-api/module.rst:224 +#: ../../c-api/module.rst:226 msgid "" "Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called " "before a module is deallocated. For example, when reference counting is " @@ -340,7 +341,7 @@ msgid "" "directly." msgstr "" -#: ../../c-api/module.rst:235 +#: ../../c-api/module.rst:237 msgid "" "A function to call during deallocation of the module object, or ``NULL`` if " "not needed." @@ -348,11 +349,11 @@ msgstr "" "Uma função para ser chamada durante a desalocação do objeto do módulo, ou " "``NULL`` se não for necessário." -#: ../../c-api/module.rst:249 +#: ../../c-api/module.rst:251 msgid "Single-phase initialization" msgstr "inicialização de fase única" -#: ../../c-api/module.rst:251 +#: ../../c-api/module.rst:253 msgid "" "The module initialization function may create and return the module object " "directly. This is referred to as \"single-phase initialization\", and uses " @@ -362,21 +363,21 @@ msgstr "" "diretamente. Isso é chamado de \"inicialização de fase única\" e usa uma das " "duas funções de criação de módulo a seguir:" -#: ../../c-api/module.rst:257 +#: ../../c-api/module.rst:259 msgid "" "Create a new module object, given the definition in *def*. This behaves " "like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:" "`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:264 +#: ../../c-api/module.rst:266 msgid "" "Create a new module object, given the definition in *def*, assuming the API " "version *module_api_version*. If that version does not match the version of " "the running interpreter, a :exc:`RuntimeWarning` is emitted." msgstr "" -#: ../../c-api/module.rst:270 +#: ../../c-api/module.rst:274 msgid "" "Most uses of this function should be using :c:func:`PyModule_Create` " "instead; only use this if you are sure you need it." @@ -384,18 +385,18 @@ msgstr "" "A maioria dos usos dessa função deve ser feita com :c:func:" "`PyModule_Create`; use-o apenas se tiver certeza de que precisa." -#: ../../c-api/module.rst:273 +#: ../../c-api/module.rst:277 msgid "" "Before it is returned from in the initialization function, the resulting " "module object is typically populated using functions like :c:func:" "`PyModule_AddObjectRef`." msgstr "" -#: ../../c-api/module.rst:279 +#: ../../c-api/module.rst:283 msgid "Multi-phase initialization" msgstr "Inicialização multifásica" -#: ../../c-api/module.rst:281 +#: ../../c-api/module.rst:285 msgid "" "An alternate way to specify extensions is to request \"multi-phase " "initialization\". Extension modules created this way behave more like Python " @@ -405,7 +406,7 @@ msgid "" "__init__` methods of classes." msgstr "" -#: ../../c-api/module.rst:288 +#: ../../c-api/module.rst:292 msgid "" "Unlike modules created using single-phase initialization, these modules are " "not singletons: if the *sys.modules* entry is removed and the module is re-" @@ -418,14 +419,14 @@ msgid "" "__dict__` or individual classes created with :c:func:`PyType_FromSpec`)." msgstr "" -#: ../../c-api/module.rst:298 +#: ../../c-api/module.rst:302 msgid "" "All modules created using multi-phase initialization are expected to " "support :ref:`sub-interpreters `. Making sure " "multiple modules are independent is typically enough to achieve this." msgstr "" -#: ../../c-api/module.rst:302 +#: ../../c-api/module.rst:306 msgid "" "To request multi-phase initialization, the initialization function " "(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :" @@ -433,7 +434,7 @@ msgid "" "instance must be initialized with the following function:" msgstr "" -#: ../../c-api/module.rst:309 +#: ../../c-api/module.rst:313 msgid "" "Ensures a module definition is a properly initialized Python object that " "correctly reports its type and reference count." @@ -441,54 +442,54 @@ msgstr "" "Garante que uma definição de módulo é um objeto Python devidamente " "inicializado que reporta corretamente seu tipo e contagem de referências." -#: ../../c-api/module.rst:312 +#: ../../c-api/module.rst:316 msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/module.rst:316 +#: ../../c-api/module.rst:320 msgid "" "The *m_slots* member of the module definition must point to an array of " "``PyModuleDef_Slot`` structures:" msgstr "" -#: ../../c-api/module.rst:323 +#: ../../c-api/module.rst:327 msgid "A slot ID, chosen from the available values explained below." msgstr "" "Um ID de lot, escolhido a partir dos valores disponíveis explicados abaixo." -#: ../../c-api/module.rst:327 +#: ../../c-api/module.rst:331 msgid "Value of the slot, whose meaning depends on the slot ID." msgstr "Valor do slot, cujo significado depende do ID do slot." -#: ../../c-api/module.rst:331 +#: ../../c-api/module.rst:335 msgid "The *m_slots* array must be terminated by a slot with id 0." msgstr "" -#: ../../c-api/module.rst:333 +#: ../../c-api/module.rst:337 msgid "The available slot types are:" msgstr "Os tipos de slot disponíveis são:" -#: ../../c-api/module.rst:337 +#: ../../c-api/module.rst:341 msgid "" "Specifies a function that is called to create the module object itself. The " "*value* pointer of this slot must point to a function of the signature:" msgstr "" -#: ../../c-api/module.rst:343 +#: ../../c-api/module.rst:348 msgid "" "The function receives a :py:class:`~importlib.machinery.ModuleSpec` " "instance, as defined in :PEP:`451`, and the module definition. It should " "return a new module object, or set an error and return ``NULL``." msgstr "" -#: ../../c-api/module.rst:348 +#: ../../c-api/module.rst:353 msgid "" "This function should be kept minimal. In particular, it should not call " "arbitrary Python code, as trying to import the same module again may result " "in an infinite loop." msgstr "" -#: ../../c-api/module.rst:352 +#: ../../c-api/module.rst:357 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." @@ -496,7 +497,7 @@ msgstr "" "Múltiplos slots ``Py_mod_create`` podem não estar especificados em uma " "definição de módulo." -#: ../../c-api/module.rst:355 +#: ../../c-api/module.rst:360 msgid "" "If ``Py_mod_create`` is not specified, the import machinery will create a " "normal module object using :c:func:`PyModule_New`. The name is taken from " @@ -505,7 +506,7 @@ msgid "" "through symlinks, all while sharing a single module definition." msgstr "" -#: ../../c-api/module.rst:361 +#: ../../c-api/module.rst:366 msgid "" "There is no requirement for the returned object to be an instance of :c:type:" "`PyModule_Type`. Any type can be used, as long as it supports setting and " @@ -515,7 +516,7 @@ msgid "" "``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:370 +#: ../../c-api/module.rst:375 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -523,7 +524,7 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:378 +#: ../../c-api/module.rst:384 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." @@ -531,54 +532,54 @@ msgstr "" "Se vários slots ``Py_mod_exec`` forem especificados, eles serão processados " "na ordem em que aparecem no vetor *m_slots*." -#: ../../c-api/module.rst:383 +#: ../../c-api/module.rst:389 msgid "Specifies one of the following values:" msgstr "" -#: ../../c-api/module.rst:389 +#: ../../c-api/module.rst:395 msgid "The module does not support being imported in subinterpreters." msgstr "" -#: ../../c-api/module.rst:393 +#: ../../c-api/module.rst:399 msgid "" "The module supports being imported in subinterpreters, but only when they " "share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:405 msgid "" "The module supports being imported in subinterpreters, even when they have " "their own GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:403 +#: ../../c-api/module.rst:409 msgid "" "This slot determines whether or not importing this module in a " "subinterpreter will fail." msgstr "" -#: ../../c-api/module.rst:406 +#: ../../c-api/module.rst:412 msgid "" "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " "module definition." msgstr "" -#: ../../c-api/module.rst:409 +#: ../../c-api/module.rst:415 msgid "" "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " "defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." msgstr "" -#: ../../c-api/module.rst:414 +#: ../../c-api/module.rst:420 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" "Ver :PEP:`489` para obter mais detalhes sobre a inicialização multifásica." -#: ../../c-api/module.rst:417 +#: ../../c-api/module.rst:423 msgid "Low-level module creation functions" msgstr "Funções de criação de módulo de baixo nível" -#: ../../c-api/module.rst:419 +#: ../../c-api/module.rst:425 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -586,14 +587,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:426 +#: ../../c-api/module.rst:432 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " "*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:434 +#: ../../c-api/module.rst:440 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -601,24 +602,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:441 +#: ../../c-api/module.rst:449 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:448 +#: ../../c-api/module.rst:456 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:454 +#: ../../c-api/module.rst:462 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:463 +#: ../../c-api/module.rst:471 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -630,11 +631,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:475 +#: ../../c-api/module.rst:483 msgid "Support functions" msgstr "" -#: ../../c-api/module.rst:477 +#: ../../c-api/module.rst:485 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -642,28 +643,43 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:484 +#: ../../c-api/module.rst:492 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:487 +#: ../../c-api/module.rst:495 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:489 +#: ../../c-api/module.rst:497 msgid "" -"Return ``NULL`` if *value* is ``NULL``. It must be called with an exception " +"Return ``-1`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:492 ../../c-api/module.rst:541 +#: ../../c-api/module.rst:500 ../../c-api/module.rst:549 msgid "Example usage::" msgstr "Exemplo de uso::" -#: ../../c-api/module.rst:506 ../../c-api/module.rst:559 +#: ../../c-api/module.rst:502 +msgid "" +"static int\n" +"add_spam(PyObject *module, int value)\n" +"{\n" +" PyObject *obj = PyLong_FromLong(value);\n" +" if (obj == NULL) {\n" +" return -1;\n" +" }\n" +" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n" +" Py_DECREF(obj);\n" +" return res;\n" +" }" +msgstr "" + +#: ../../c-api/module.rst:514 ../../c-api/module.rst:567 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" @@ -671,90 +687,138 @@ msgstr "" "O exemplo também pode ser escrito sem verificar explicitamente se *obj* é " "``NULL``::" -#: ../../c-api/module.rst:518 ../../c-api/module.rst:575 +#: ../../c-api/module.rst:517 +msgid "" +"static int\n" +"add_spam(PyObject *module, int value)\n" +"{\n" +" PyObject *obj = PyLong_FromLong(value);\n" +" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n" +" Py_XDECREF(obj);\n" +" return res;\n" +" }" +msgstr "" + +#: ../../c-api/module.rst:526 ../../c-api/module.rst:583 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:526 +#: ../../c-api/module.rst:534 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:529 +#: ../../c-api/module.rst:537 msgid "" "The new :c:func:`PyModule_AddObjectRef` function is recommended, since it is " "easy to introduce reference leaks by misusing the :c:func:" "`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:535 +#: ../../c-api/module.rst:543 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:538 +#: ../../c-api/module.rst:546 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_DECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:581 +#: ../../c-api/module.rst:551 +msgid "" +"static int\n" +"add_spam(PyObject *module, int value)\n" +"{\n" +" PyObject *obj = PyLong_FromLong(value);\n" +" if (obj == NULL) {\n" +" return -1;\n" +" }\n" +" if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" +" Py_DECREF(obj);\n" +" return -1;\n" +" }\n" +" // PyModule_AddObject() stole a reference to obj:\n" +" // Py_DECREF(obj) is not needed here\n" +" return 0;\n" +"}" +msgstr "" + +#: ../../c-api/module.rst:570 +msgid "" +"static int\n" +"add_spam(PyObject *module, int value)\n" +"{\n" +" PyObject *obj = PyLong_FromLong(value);\n" +" if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" +" Py_XDECREF(obj);\n" +" return -1;\n" +" }\n" +" // PyModule_AddObject() stole a reference to obj:\n" +" // Py_DECREF(obj) is not needed here\n" +" return 0;\n" +"}" +msgstr "" + +#: ../../c-api/module.rst:589 msgid "" "Add an integer constant to *module* as *name*. This convenience function " -"can be used from the module's initialization function. Return ``-1`` on " -"error, ``0`` on success." +"can be used from the module's initialization function. Return ``-1`` with an " +"exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:588 +#: ../../c-api/module.rst:596 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " -"be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success." +"be ``NULL``-terminated. Return ``-1`` with an exception set on error, ``0`` " +"on success." msgstr "" -#: ../../c-api/module.rst:595 +#: ../../c-api/module.rst:604 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " -"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on " -"error, ``0`` on success." +"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` " +"with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:612 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:607 +#: ../../c-api/module.rst:616 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " "the last component of :c:member:`~PyTypeObject.tp_name` after dot. Return " -"``-1`` on error, ``0`` on success." +"``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:617 +#: ../../c-api/module.rst:626 msgid "Module lookup" msgstr "Pesquisa por módulos" -#: ../../c-api/module.rst:619 +#: ../../c-api/module.rst:628 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:623 +#: ../../c-api/module.rst:632 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:628 +#: ../../c-api/module.rst:637 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -763,18 +827,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:635 +#: ../../c-api/module.rst:644 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:638 +#: ../../c-api/module.rst:647 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:640 +#: ../../c-api/module.rst:649 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -785,18 +849,20 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:648 ../../c-api/module.rst:659 +#: ../../c-api/module.rst:657 ../../c-api/module.rst:668 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:650 -msgid "Return 0 on success or -1 on failure." +#: ../../c-api/module.rst:659 +msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" +"Retorna ``-1`` com uma exceção definida em caso de erro, ``0`` em caso de " +"sucesso." -#: ../../c-api/module.rst:656 +#: ../../c-api/module.rst:665 msgid "" "Removes the module object created from *def* from the interpreter state. " -"Return 0 on success or -1 on failure." +"Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" #: ../../c-api/module.rst:8 @@ -811,7 +877,7 @@ msgstr "módulo" msgid "ModuleType (in module types)" msgstr "" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:74 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:76 msgid "__name__ (module attribute)" msgstr "" @@ -819,7 +885,7 @@ msgstr "" msgid "__doc__ (module attribute)" msgstr "" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:104 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:106 msgid "__file__ (module attribute)" msgstr "" @@ -831,10 +897,10 @@ msgstr "" msgid "__loader__ (module attribute)" msgstr "" -#: ../../c-api/module.rst:60 +#: ../../c-api/module.rst:62 msgid "__dict__ (module attribute)" msgstr "" -#: ../../c-api/module.rst:74 ../../c-api/module.rst:104 +#: ../../c-api/module.rst:76 ../../c-api/module.rst:106 msgid "SystemError (built-in exception)" msgstr "" diff --git a/c-api/none.po b/c-api/none.po index c443fde75..8fd1fe925 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/number.po b/c-api/number.po index 60978d041..34edcc66c 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -82,8 +81,8 @@ msgstr "" msgid "" "Return a reasonable approximation for the mathematical value of *o1* divided " "by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " -"because binary floating point numbers are approximate; it is not possible to " -"represent all real numbers in base two. This function can return a floating " +"because binary floating-point numbers are approximate; it is not possible to " +"represent all real numbers in base two. This function can return a floating-" "point value when passed two integers. This is the equivalent of the Python " "expression ``o1 / o2``." msgstr "" @@ -201,8 +200,8 @@ msgstr "" msgid "" "Return a reasonable approximation for the mathematical value of *o1* divided " "by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " -"because binary floating point numbers are approximate; it is not possible to " -"represent all real numbers in base two. This function can return a floating " +"because binary floating-point numbers are approximate; it is not possible to " +"represent all real numbers in base two. This function can return a floating-" "point value when passed two integers. The operation is done *in-place* when " "*o1* supports it. This is the equivalent of the Python statement ``o1 /= " "o2``." diff --git a/c-api/objbuffer.po b/c-api/objbuffer.po index 3bd300f46..643c0410f 100644 --- a/c-api/objbuffer.po +++ b/c-api/objbuffer.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-07-29 13:25+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/object.po b/c-api/object.po index 84b960eee..b8141e5e2 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/objimpl.po b/c-api/objimpl.po index c056be02b..c84c45ee0 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po index d81071aa6..e6febbbad 100644 --- a/c-api/perfmaps.po +++ b/c-api/perfmaps.po @@ -11,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-14 22:56+0000\n" -"PO-Revision-Date: 2023-05-24 13:07+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -98,6 +98,12 @@ msgstr "" "Escreve uma única entrada no arquivo ``/tmp/perf-$pid.map``. Esta função é " "segura para thread. Aqui está a aparência de um exemplo de entrada::" +#: ../../c-api/perfmaps.rst:38 +msgid "" +"# address size name\n" +"7f3529fcf759 b py::bar:/run/t.py" +msgstr "" + #: ../../c-api/perfmaps.rst:41 msgid "" "Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, " diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 1e42e06a4..f66a6c75b 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-08 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -138,10 +136,20 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../c-api/refcounting.rst:90 +msgid "" +"Py_INCREF(obj);\n" +"self->attr = obj;" +msgstr "" + #: ../../c-api/refcounting.rst:93 msgid "can be written as::" msgstr "" +#: ../../c-api/refcounting.rst:95 +msgid "self->attr = Py_NewRef(obj);" +msgstr "" + #: ../../c-api/refcounting.rst:97 msgid "See also :c:func:`Py_INCREF`." msgstr "" @@ -244,10 +252,20 @@ msgstr "" msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" msgstr "" +#: ../../c-api/refcounting.rst:192 +msgid "" +"Py_DECREF(dst);\n" +"dst = src;" +msgstr "" + #: ../../c-api/refcounting.rst:195 msgid "The safe way is::" msgstr "" +#: ../../c-api/refcounting.rst:197 +msgid "Py_SETREF(dst, src);" +msgstr "" + #: ../../c-api/refcounting.rst:199 msgid "" "That arranges to set *dst* to *src* _before_ releasing the reference to the " diff --git a/c-api/reflection.po b/c-api/reflection.po index 7ceb03e3c..9df3b9d38 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Raphael Mendonça, 2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/sequence.po b/c-api/sequence.po index 0960cbe52..d3ae9f3ad 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Adorilson Bezerra , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/set.po b/c-api/set.po index e3319888b..1eeb6a0b6 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Vitor Buxbaum Orlandi, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/slice.po b/c-api/slice.po index 0a630a2e7..e9745818a 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -49,16 +48,22 @@ msgid "" "Return a new slice object with the given values. The *start*, *stop*, and " "*step* parameters are used as the values of the slice object attributes of " "the same names. Any of the values may be ``NULL``, in which case the " -"``None`` will be used for the corresponding attribute. Return ``NULL`` if " -"the new object could not be allocated." +"``None`` will be used for the corresponding attribute." msgstr "" "Retorna um novo objeto fatia com os valores fornecidos. Os parâmetros " "*start*, *stop* e *step* são usados como os valores dos atributos do objeto " "fatia com os mesmos nomes. Qualquer um dos valores pode ser ``NULL``, caso " -"em que ``None`` será usado para o atributo correspondente. Retorna ``NULL`` " -"se o novo objeto não puder ser alocado." +"em que ``None`` será usado para o atributo correspondente." + +#: ../../c-api/slice.rst:28 +msgid "" +"Return ``NULL`` with an exception set if the new object could not be " +"allocated." +msgstr "" +"Retorna ``NULL`` com uma exceção definida se o novo objeto não puder ser " +"alocado." -#: ../../c-api/slice.rst:32 +#: ../../c-api/slice.rst:34 msgid "" "Retrieve the start, stop and step indices from the slice object *slice*, " "assuming a sequence of length *length*. Treats indices greater than *length* " @@ -68,7 +73,7 @@ msgstr "" "*slice*, presumindo uma sequência de comprimento *length*. Trata índices " "maiores que *length* como erros." -#: ../../c-api/slice.rst:36 +#: ../../c-api/slice.rst:38 msgid "" "Returns ``0`` on success and ``-1`` on error with no exception set (unless " "one of the indices was not ``None`` and failed to be converted to an " @@ -79,17 +84,17 @@ msgstr "" "convertido para um inteiro, neste caso ``-1`` é retornado com uma exceção " "definida)." -#: ../../c-api/slice.rst:40 +#: ../../c-api/slice.rst:42 msgid "You probably do not want to use this function." msgstr "Você provavelmente não deseja usar esta função." -#: ../../c-api/slice.rst:42 ../../c-api/slice.rst:73 +#: ../../c-api/slice.rst:44 ../../c-api/slice.rst:75 msgid "" "The parameter type for the *slice* parameter was ``PySliceObject*`` before." msgstr "" "O tipo de parâmetro para o parâmetro *slice* era antes de ``PySliceObject*``." -#: ../../c-api/slice.rst:49 +#: ../../c-api/slice.rst:51 msgid "" "Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start, " "stop, and step indices from the slice object *slice* assuming a sequence of " @@ -103,13 +108,13 @@ msgstr "" "*slicelength*. Índices fora dos limites são cortados de maneira consistente " "com o tratamento de fatias normais." -#: ../../c-api/slice.rst:55 -msgid "Returns ``0`` on success and ``-1`` on error with exception set." +#: ../../c-api/slice.rst:57 +msgid "Return ``0`` on success and ``-1`` on error with an exception set." msgstr "" -"Retorna ``0`` em caso de sucesso e ``-1`` em caso de erro com exceção " +"Retorna ``0`` em caso de sucesso e ``-1`` em caso de erro com uma exceção " "definida." -#: ../../c-api/slice.rst:58 +#: ../../c-api/slice.rst:60 msgid "" "This function is considered not safe for resizable sequences. Its invocation " "should be replaced by a combination of :c:func:`PySlice_Unpack` and :c:func:" @@ -119,11 +124,27 @@ msgstr "" "invocação deve ser substituída por uma combinação de :c:func:" "`PySlice_Unpack` e :c:func:`PySlice_AdjustIndices` sendo ::" -#: ../../c-api/slice.rst:66 +#: ../../c-api/slice.rst:64 +msgid "" +"if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) " +"< 0) {\n" +" // return error\n" +"}" +msgstr "" + +#: ../../c-api/slice.rst:68 msgid "is replaced by ::" msgstr "substituído por ::" -#: ../../c-api/slice.rst:77 +#: ../../c-api/slice.rst:70 +msgid "" +"if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n" +" // return error\n" +"}\n" +"slicelength = PySlice_AdjustIndices(length, &start, &stop, step);" +msgstr "" + +#: ../../c-api/slice.rst:79 msgid "" "If ``Py_LIMITED_API`` is not set or set to the value between ``0x03050400`` " "and ``0x03060000`` (not including) or ``0x03060100`` or higher :c:func:`!" @@ -137,7 +158,7 @@ msgstr "" "usando :c:func:`!PySlice_Unpack` e :c:func:`!PySlice_AdjustIndices`. Os " "argumentos *start*, *stop* e *step* são avaliados mais de uma vez." -#: ../../c-api/slice.rst:84 +#: ../../c-api/slice.rst:86 msgid "" "If ``Py_LIMITED_API`` is set to the value less than ``0x03050400`` or " "between ``0x03060000`` and ``0x03060100`` (not including) :c:func:`!" @@ -147,7 +168,7 @@ msgstr "" "``0x03050400`` ou entre ``0x03060000`` e ``0x03060100`` (não incluso), :c:" "func:`!PySlice_GetIndicesEx` é uma função descontinuada." -#: ../../c-api/slice.rst:92 +#: ../../c-api/slice.rst:94 msgid "" "Extract the start, stop and step data members from a slice object as C " "integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to " @@ -162,11 +183,13 @@ msgstr "" "``PY_SSIZE_T_MIN``, e silenciosamente aumenta os valores de intermediário " "menores que ``-PY_SSIZE_T_MAX`` para ``-PY_SSIZE_T_MAX``." -#: ../../c-api/slice.rst:98 -msgid "Return ``-1`` on error, ``0`` on success." -msgstr "Retorna ``-1`` em caso de erro, ``0`` em caso de sucesso." +#: ../../c-api/slice.rst:100 +msgid "Return ``-1`` with an exception set on error, ``0`` on success." +msgstr "" +"Retorna ``-1`` com uma exceção definida em caso de erro, ``0`` em caso de " +"sucesso." -#: ../../c-api/slice.rst:105 +#: ../../c-api/slice.rst:107 msgid "" "Adjust start/end slice indices assuming a sequence of the specified length. " "Out of bounds indices are clipped in a manner consistent with the handling " @@ -176,7 +199,7 @@ msgstr "" "comprimento especificado. Índices fora dos limites são cortados de maneira " "consistente com o tratamento de fatias normais." -#: ../../c-api/slice.rst:109 +#: ../../c-api/slice.rst:111 msgid "" "Return the length of the slice. Always successful. Doesn't call Python " "code." @@ -184,11 +207,11 @@ msgstr "" "Retorna o comprimento da fatia. Sempre bem-sucedido. Não chama o código " "Python." -#: ../../c-api/slice.rst:116 +#: ../../c-api/slice.rst:118 msgid "Ellipsis Object" msgstr "Objeto Ellipsis" -#: ../../c-api/slice.rst:121 +#: ../../c-api/slice.rst:123 msgid "" "The Python ``Ellipsis`` object. This object has no methods. Like :c:data:" "`Py_None`, it is an `immortal `_. " @@ -198,6 +221,6 @@ msgstr "" "`Py_None`, é um objeto singleton `imortal `_." -#: ../../c-api/slice.rst:125 +#: ../../c-api/slice.rst:127 msgid ":c:data:`Py_Ellipsis` is immortal." msgstr ":c:data:`Py_Ellipsis` é imortal." diff --git a/c-api/stable.po b/c-api/stable.po index c5b7a6953..c1e5ca374 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-22 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/structures.po b/c-api/structures.po index 52c2284da..d2c5360bb 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2023 -# Rodrigo Cendamore, 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -93,6 +91,10 @@ msgstr "" "Este é um macro usado ao declarar novos tipos que representam objetos sem " "comprimento variável. O macro PyObject_HEAD se expande para::" +#: ../../c-api/structures.rst:50 +msgid "PyObject ob_base;" +msgstr "" + #: ../../c-api/structures.rst:52 msgid "See documentation of :c:type:`PyObject` above." msgstr "Veja documentação de :c:type:`PyObject` acima." @@ -104,6 +106,10 @@ msgid "" "expands to::" msgstr "" +#: ../../c-api/structures.rst:61 +msgid "PyVarObject ob_base;" +msgstr "" + #: ../../c-api/structures.rst:63 msgid "See documentation of :c:type:`PyVarObject` above." msgstr "Veja documentação de :c:type:`PyVarObject` acima." @@ -184,6 +190,12 @@ msgid "" "`PyObject` type. This macro expands to::" msgstr "" +#: ../../c-api/structures.rst:148 +msgid "" +"_PyObject_EXTRA_INIT\n" +"1, type," +msgstr "" + #: ../../c-api/structures.rst:154 msgid "" "This is a macro which expands to initialization values for a new :c:type:" @@ -191,6 +203,12 @@ msgid "" "This macro expands to::" msgstr "" +#: ../../c-api/structures.rst:158 +msgid "" +"_PyObject_EXTRA_INIT\n" +"1, type, size," +msgstr "" + #: ../../c-api/structures.rst:163 msgid "Implementing functions and methods" msgstr "" @@ -209,6 +227,12 @@ msgstr "" msgid "The function signature is::" msgstr "A assinatura da função é::" +#: ../../c-api/structures.rst:176 +msgid "" +"PyObject *PyCFunction(PyObject *self,\n" +" PyObject *args);" +msgstr "" + #: ../../c-api/structures.rst:181 msgid "" "Type of the functions used to implement Python callables in C with " @@ -216,12 +240,26 @@ msgid "" "The function signature is::" msgstr "" +#: ../../c-api/structures.rst:185 +msgid "" +"PyObject *PyCFunctionWithKeywords(PyObject *self,\n" +" PyObject *args,\n" +" PyObject *kwargs);" +msgstr "" + #: ../../c-api/structures.rst:192 msgid "" "Type of the functions used to implement Python callables in C with " "signature :c:macro:`METH_FASTCALL`. The function signature is::" msgstr "" +#: ../../c-api/structures.rst:196 +msgid "" +"PyObject *_PyCFunctionFast(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs);" +msgstr "" + #: ../../c-api/structures.rst:202 msgid "" "Type of the functions used to implement Python callables in C with " @@ -229,6 +267,14 @@ msgid "" "METH_KEYWORDS>`. The function signature is::" msgstr "" +#: ../../c-api/structures.rst:206 +msgid "" +"PyObject *_PyCFunctionFastWithKeywords(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames);" +msgstr "" + #: ../../c-api/structures.rst:213 msgid "" "Type of the functions used to implement Python callables in C with " @@ -236,6 +282,15 @@ msgid "" "METH_FASTCALL-METH_KEYWORDS>`. The function signature is::" msgstr "" +#: ../../c-api/structures.rst:217 +msgid "" +"PyObject *PyCMethod(PyObject *self,\n" +" PyTypeObject *defining_class,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames)" +msgstr "" + #: ../../c-api/structures.rst:228 msgid "" "Structure used to describe a method of an extension type. This structure " @@ -533,6 +588,15 @@ msgid "" "``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" msgstr "" +#: ../../c-api/structures.rst:490 +msgid "" +"static PyMemberDef spam_type_members[] = {\n" +" {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n" +" offsetof(Spam_object, vectorcall), Py_READONLY},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + #: ../../c-api/structures.rst:496 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" diff --git a/c-api/sys.po b/c-api/sys.po index 2c9f6c637..647f59e05 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -547,15 +546,7 @@ msgid "" "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:395 -msgid "" -"Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " -"arguments." -msgstr "" -"Levanta um :ref:`evento de auditoria ` ``sys.addaudithook`` com " -"nenhum argumento." - -#: ../../c-api/sys.rst:397 +#: ../../c-api/sys.rst:395 ../../c-api/sys.rst:397 msgid "" "If the interpreter is initialized, this function raises an auditing event " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " diff --git a/c-api/tuple.po b/c-api/tuple.po index 15e5a48c7..0bcae62c5 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Alexandre B A Villares, 2021 -# Vitor Buxbaum Orlandi, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-30 14:55+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -59,35 +57,30 @@ msgstr "" "subtipo do tipo tupla. Esta função sempre tem sucesso." #: ../../c-api/tuple.rst:36 -msgid "Return a new tuple object of size *len*, or ``NULL`` on failure." +msgid "" +"Return a new tuple object of size *len*, or ``NULL`` with an exception set " +"on failure." msgstr "" -"Retorna um novo objeto tupla de tamanho *len*, ou ``NULL`` em caso de falha." -#: ../../c-api/tuple.rst:41 +#: ../../c-api/tuple.rst:42 msgid "" -"Return a new tuple object of size *n*, or ``NULL`` on failure. The tuple " -"values are initialized to the subsequent *n* C arguments pointing to Python " -"objects. ``PyTuple_Pack(2, a, b)`` is equivalent to " +"Return a new tuple object of size *n*, or ``NULL`` with an exception set on " +"failure. The tuple values are initialized to the subsequent *n* C arguments " +"pointing to Python objects. ``PyTuple_Pack(2, a, b)`` is equivalent to " "``Py_BuildValue(\"(OO)\", a, b)``." msgstr "" -"Retorna um novo objeto tupla de tamanho *n*, ou ``NULL`` em caso de falha. " -"Os valores da tupla são inicializados para os *n* argumentos C subsequentes " -"apontando para objetos Python. ```PyTuple_Pack(2, a, b)`` é equivalente a " -"``Py_BuildValue(\"(OO)\", a, b)``." -#: ../../c-api/tuple.rst:48 -msgid "Take a pointer to a tuple object, and return the size of that tuple." -msgstr "Pega um ponteiro para um objeto tupla e retorna o tamanho dessa tupla." - -#: ../../c-api/tuple.rst:53 +#: ../../c-api/tuple.rst:50 msgid "" -"Return the size of the tuple *p*, which must be non-``NULL`` and point to a " -"tuple; no error checking is performed." +"Take a pointer to a tuple object, and return the size of that tuple. On " +"error, return ``-1`` and with an exception set." +msgstr "" + +#: ../../c-api/tuple.rst:56 +msgid "Like :c:func:`PyTuple_Size`, but without error checking." msgstr "" -"Retorna o tamanho da tupla *p*, que deve ser diferente de ``NULL`` e apontar " -"para uma tupla; nenhuma verificação de erro é executada." -#: ../../c-api/tuple.rst:59 +#: ../../c-api/tuple.rst:61 msgid "" "Return the object at position *pos* in the tuple pointed to by *p*. If " "*pos* is negative or out of bounds, return ``NULL`` and set an :exc:" @@ -97,7 +90,7 @@ msgstr "" "estiver fora dos limites, retorna ``NULL`` e define uma exceção :exc:" "`IndexError`." -#: ../../c-api/tuple.rst:62 +#: ../../c-api/tuple.rst:64 msgid "" "The returned reference is borrowed from the tuple *p* (that is: it is only " "valid as long as you hold a reference to *p*). To get a :term:`strong " @@ -105,20 +98,25 @@ msgid "" "func:`PySequence_GetItem`." msgstr "" -#: ../../c-api/tuple.rst:71 +#: ../../c-api/tuple.rst:73 msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments." msgstr "" "Como :c:func:`PyTuple_GetItem`, mas faz nenhuma verificação de seus " "argumentos." -#: ../../c-api/tuple.rst:76 +#: ../../c-api/tuple.rst:78 msgid "" "Return the slice of the tuple pointed to by *p* between *low* and *high*, or " -"``NULL`` on failure. This is the equivalent of the Python expression " -"``p[low:high]``. Indexing from the end of the tuple is not supported." +"``NULL`` with an exception set on failure." +msgstr "" + +#: ../../c-api/tuple.rst:81 +msgid "" +"This is the equivalent of the Python expression ``p[low:high]``. Indexing " +"from the end of the tuple is not supported." msgstr "" -#: ../../c-api/tuple.rst:83 +#: ../../c-api/tuple.rst:87 msgid "" "Insert a reference to object *o* at position *pos* of the tuple pointed to " "by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` " @@ -128,7 +126,7 @@ msgstr "" "*p*. Retorna ``0`` em caso de sucesso. Se *pos* estiver fora dos limites, " "retorne ``-1`` e define uma exceção :exc:`IndexError`." -#: ../../c-api/tuple.rst:89 +#: ../../c-api/tuple.rst:93 msgid "" "This function \"steals\" a reference to *o* and discards a reference to an " "item already in the tuple at the affected position." @@ -136,7 +134,7 @@ msgstr "" "Esta função \"rouba\" uma referência a *o* e descarta uma referência a um " "item já na tupla na posição afetada." -#: ../../c-api/tuple.rst:95 +#: ../../c-api/tuple.rst:99 msgid "" "Like :c:func:`PyTuple_SetItem`, but does no error checking, and should " "*only* be used to fill in brand new tuples." @@ -144,7 +142,7 @@ msgstr "" "Como :c:func:`PyTuple_SetItem`, mas não verifica erros e deve *apenas* ser " "usado para preencher novas tuplas." -#: ../../c-api/tuple.rst:100 +#: ../../c-api/tuple.rst:104 msgid "" "This function \"steals\" a reference to *o*, and, unlike :c:func:" "`PyTuple_SetItem`, does *not* discard a reference to any item that is being " @@ -155,7 +153,7 @@ msgstr "" "sendo substituído; qualquer referência na tupla na posição *pos* será " "perdida." -#: ../../c-api/tuple.rst:108 +#: ../../c-api/tuple.rst:112 msgid "" "Can be used to resize a tuple. *newsize* will be the new length of the " "tuple. Because tuples are *supposed* to be immutable, this should only be " @@ -181,11 +179,11 @@ msgstr "" "``-1`` e define ``*p`` para ``NULL``, e levanta :exc:`MemoryError` ou :exc:" "`SystemError`." -#: ../../c-api/tuple.rst:123 +#: ../../c-api/tuple.rst:127 msgid "Struct Sequence Objects" msgstr "Objetos sequência de estrutura" -#: ../../c-api/tuple.rst:125 +#: ../../c-api/tuple.rst:129 msgid "" "Struct sequence objects are the C equivalent of :func:`~collections." "namedtuple` objects, i.e. a sequence whose items can also be accessed " @@ -197,7 +195,7 @@ msgstr "" "ser acessados por meio de atributos. Para criar uma sequência de estrutura, " "você primeiro precisa criar um tipo de sequência de estrutura específico." -#: ../../c-api/tuple.rst:132 +#: ../../c-api/tuple.rst:136 msgid "" "Create a new struct sequence type from the data in *desc*, described below. " "Instances of the resulting type can be created with :c:func:" @@ -207,41 +205,43 @@ msgstr "" "descrito abaixo. Instâncias do tipo resultante podem ser criadas com :c:func:" "`PyStructSequence_New`." -#: ../../c-api/tuple.rst:138 +#: ../../c-api/tuple.rst:139 ../../c-api/tuple.rst:207 +msgid "Return ``NULL`` with an exception set on failure." +msgstr "" + +#: ../../c-api/tuple.rst:144 msgid "Initializes a struct sequence type *type* from *desc* in place." msgstr "" "Inicializa um tipo de sequência de estrutura *type* de *desc* no lugar." -#: ../../c-api/tuple.rst:143 +#: ../../c-api/tuple.rst:149 msgid "" -"The same as ``PyStructSequence_InitType``, but returns ``0`` on success and " -"``-1`` on failure." +"Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success and " +"``-1`` with an exception set on failure." msgstr "" -"O mesmo que ``PyStructSequence_InitType``, mas retorna ``0`` em caso de " -"sucesso e ``-1`` em caso de falha." -#: ../../c-api/tuple.rst:151 +#: ../../c-api/tuple.rst:157 msgid "Contains the meta information of a struct sequence type to create." msgstr "" "Contém as metainformações de um tipo de sequência de estrutura a ser criado." -#: ../../c-api/tuple.rst:155 +#: ../../c-api/tuple.rst:161 msgid "Name of the struct sequence type." msgstr "" -#: ../../c-api/tuple.rst:159 +#: ../../c-api/tuple.rst:165 msgid "Pointer to docstring for the type or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:163 +#: ../../c-api/tuple.rst:169 msgid "Pointer to ``NULL``-terminated array with field names of the new type." msgstr "" -#: ../../c-api/tuple.rst:167 +#: ../../c-api/tuple.rst:173 msgid "Number of fields visible to the Python side (if used as tuple)." msgstr "" -#: ../../c-api/tuple.rst:172 +#: ../../c-api/tuple.rst:178 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " "tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" @@ -250,25 +250,25 @@ msgid "" "described." msgstr "" -#: ../../c-api/tuple.rst:180 +#: ../../c-api/tuple.rst:186 msgid "" "Name for the field or ``NULL`` to end the list of named fields, set to :c:" "data:`PyStructSequence_UnnamedField` to leave unnamed." msgstr "" -#: ../../c-api/tuple.rst:185 +#: ../../c-api/tuple.rst:191 msgid "Field docstring or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:190 +#: ../../c-api/tuple.rst:196 msgid "Special value for a field name to leave it unnamed." msgstr "Valor especial para um nome de campo para deixá-lo sem nome." -#: ../../c-api/tuple.rst:192 +#: ../../c-api/tuple.rst:198 msgid "The type was changed from ``char *``." msgstr "O tipo foi alterado de ``char *``." -#: ../../c-api/tuple.rst:198 +#: ../../c-api/tuple.rst:204 msgid "" "Creates an instance of *type*, which must have been created with :c:func:" "`PyStructSequence_NewType`." @@ -276,7 +276,7 @@ msgstr "" "Cria um instância de *type*, que deve ser criada com :c:func:" "`PyStructSequence_NewType`." -#: ../../c-api/tuple.rst:204 +#: ../../c-api/tuple.rst:212 msgid "" "Return the object at position *pos* in the struct sequence pointed to by " "*p*. No bounds checking is performed." @@ -284,11 +284,11 @@ msgstr "" "Retorna o objeto na posição *pos* na sequência de estrutura apontada por " "*p*. Nenhuma verificação de limites é executada." -#: ../../c-api/tuple.rst:210 +#: ../../c-api/tuple.rst:218 msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`." msgstr "Macro equivalente de :c:func:`PyStructSequence_GetItem`." -#: ../../c-api/tuple.rst:215 +#: ../../c-api/tuple.rst:223 msgid "" "Sets the field at index *pos* of the struct sequence *p* to value *o*. " "Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand " @@ -298,11 +298,11 @@ msgstr "" "*o*. Como :c:func:`PyTuple_SET_ITEM`, isto só deve ser usado para preencher " "novas instâncias." -#: ../../c-api/tuple.rst:221 ../../c-api/tuple.rst:231 +#: ../../c-api/tuple.rst:229 ../../c-api/tuple.rst:239 msgid "This function \"steals\" a reference to *o*." msgstr "Esta função \"rouba\" uma referência a *o*." -#: ../../c-api/tuple.rst:226 +#: ../../c-api/tuple.rst:234 msgid "" "Similar to :c:func:`PyStructSequence_SetItem`, but implemented as a static " "inlined function." diff --git a/c-api/type.po b/c-api/type.po index 17b01e2b3..4494b91fa 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/typehints.po b/c-api/typehints.po index 80813df66..a66bb76d0 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Vitor Buxbaum Orlandi, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -68,6 +67,18 @@ msgstr "" msgid "Here's an example of how to make an extension type generic::" msgstr "Aqui está um exemplo de como tornar um tipo de extensão genérico::" +#: ../../c-api/typehints.rst:30 +msgid "" +"...\n" +"static PyMethodDef my_obj_methods[] = {\n" +" // Other methods.\n" +" ...\n" +" {\"__class_getitem__\", Py_GenericAlias, METH_O|METH_CLASS, \"See PEP " +"585\"}\n" +" ...\n" +"}" +msgstr "" + #: ../../c-api/typehints.rst:38 msgid "The data model method :meth:`~object.__class_getitem__`." msgstr "O método de modelo de dados :meth:`~object.__class_getitem__`." diff --git a/c-api/typeobj.po b/c-api/typeobj.po index b062b7db7..11731959a 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Marco Rougeth , 2021 -# (Douglas da Silva) , 2021 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -636,10 +631,29 @@ msgstr "" msgid "**\"D\"**: default (if slot is set to ``NULL``)" msgstr "" +#: ../../c-api/typeobj.rst:172 +msgid "" +"X - PyType_Ready sets this value if it is NULL\n" +"~ - PyType_Ready always sets this value (it should be NULL)\n" +"? - PyType_Ready may set this value depending on other slots\n" +"\n" +"Also see the inheritance column (\"I\")." +msgstr "" + #: ../../c-api/typeobj.rst:180 msgid "**\"I\"**: inheritance" msgstr "" +#: ../../c-api/typeobj.rst:182 +msgid "" +"X - type slot is inherited via *PyType_Ready* if defined with a *NULL* " +"value\n" +"% - the slots of the sub-struct are inherited individually\n" +"G - inherited, but only in combination with other slots; see the slot's " +"description\n" +"? - it's complicated; see the slot's description" +msgstr "" + #: ../../c-api/typeobj.rst:189 msgid "" "Note that some slots are effectively inherited through the normal attribute " @@ -1176,6 +1190,96 @@ msgid "" "definition found there:" msgstr "" +#: ../../c-api/typeobj.rst:481 +msgid "" +"typedef struct _typeobject {\n" +" PyObject_VAR_HEAD\n" +" const char *tp_name; /* For printing, in format \".\" */\n" +" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" +"\n" +" /* Methods to implement standard operations */\n" +"\n" +" destructor tp_dealloc;\n" +" Py_ssize_t tp_vectorcall_offset;\n" +" getattrfunc tp_getattr;\n" +" setattrfunc tp_setattr;\n" +" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" +" or tp_reserved (Python 3) */\n" +" reprfunc tp_repr;\n" +"\n" +" /* Method suites for standard classes */\n" +"\n" +" PyNumberMethods *tp_as_number;\n" +" PySequenceMethods *tp_as_sequence;\n" +" PyMappingMethods *tp_as_mapping;\n" +"\n" +" /* More standard operations (here for binary compatibility) */\n" +"\n" +" hashfunc tp_hash;\n" +" ternaryfunc tp_call;\n" +" reprfunc tp_str;\n" +" getattrofunc tp_getattro;\n" +" setattrofunc tp_setattro;\n" +"\n" +" /* Functions to access object as input/output buffer */\n" +" PyBufferProcs *tp_as_buffer;\n" +"\n" +" /* Flags to define presence of optional/expanded features */\n" +" unsigned long tp_flags;\n" +"\n" +" const char *tp_doc; /* Documentation string */\n" +"\n" +" /* Assigned meaning in release 2.0 */\n" +" /* call function for all accessible objects */\n" +" traverseproc tp_traverse;\n" +"\n" +" /* delete references to contained objects */\n" +" inquiry tp_clear;\n" +"\n" +" /* Assigned meaning in release 2.1 */\n" +" /* rich comparisons */\n" +" richcmpfunc tp_richcompare;\n" +"\n" +" /* weak reference enabler */\n" +" Py_ssize_t tp_weaklistoffset;\n" +"\n" +" /* Iterators */\n" +" getiterfunc tp_iter;\n" +" iternextfunc tp_iternext;\n" +"\n" +" /* Attribute descriptor and subclassing stuff */\n" +" struct PyMethodDef *tp_methods;\n" +" struct PyMemberDef *tp_members;\n" +" struct PyGetSetDef *tp_getset;\n" +" // Strong reference on a heap type, borrowed reference on a static type\n" +" struct _typeobject *tp_base;\n" +" PyObject *tp_dict;\n" +" descrgetfunc tp_descr_get;\n" +" descrsetfunc tp_descr_set;\n" +" Py_ssize_t tp_dictoffset;\n" +" initproc tp_init;\n" +" allocfunc tp_alloc;\n" +" newfunc tp_new;\n" +" freefunc tp_free; /* Low-level free-memory routine */\n" +" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" +" PyObject *tp_bases;\n" +" PyObject *tp_mro; /* method resolution order */\n" +" PyObject *tp_cache;\n" +" PyObject *tp_subclasses;\n" +" PyObject *tp_weaklist;\n" +" destructor tp_del;\n" +"\n" +" /* Type attribute cache version tag. Added in version 2.6 */\n" +" unsigned int tp_version_tag;\n" +"\n" +" destructor tp_finalize;\n" +" vectorcallfunc tp_vectorcall;\n" +"\n" +" /* bitset of which type-watchers care about this type */\n" +" unsigned char tp_watched;\n" +"} PyTypeObject;\n" +msgstr "" + #: ../../c-api/typeobj.rst:485 msgid "PyObject Slots" msgstr "" @@ -1253,6 +1357,10 @@ msgid "" "doing anything else. This is typically done like this::" msgstr "" +#: ../../c-api/typeobj.rst:519 +msgid "Foo_Type.ob_type = &PyType_Type;" +msgstr "" + #: ../../c-api/typeobj.rst:521 msgid "" "This should be done before any instances of the type are created. :c:func:" @@ -1438,6 +1546,10 @@ msgid "" "The function signature is::" msgstr "" +#: ../../c-api/typeobj.rst:663 +msgid "void tp_dealloc(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:665 msgid "" "The destructor function is called by the :c:func:`Py_DECREF` and :c:func:" @@ -1463,6 +1575,15 @@ msgid "" "`PyObject_GC_UnTrack` before clearing any member fields." msgstr "" +#: ../../c-api/typeobj.rst:684 +msgid "" +"static void foo_dealloc(foo_object *self) {\n" +" PyObject_GC_UnTrack(self);\n" +" Py_CLEAR(self->ref);\n" +" Py_TYPE(self)->tp_free((PyObject *)self);\n" +"}" +msgstr "" + #: ../../c-api/typeobj.rst:692 msgid "" "Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " @@ -1471,6 +1592,16 @@ msgid "" "dangling pointers, the recommended way to achieve this is:" msgstr "" +#: ../../c-api/typeobj.rst:698 +msgid "" +"static void foo_dealloc(foo_object *self) {\n" +" PyTypeObject *tp = Py_TYPE(self);\n" +" // free references and buffers here\n" +" tp->tp_free(self);\n" +" Py_DECREF(tp);\n" +"}" +msgstr "" + #: ../../c-api/typeobj.rst:715 msgid "" "An optional offset to a per-instance function that implements calling the " @@ -1606,6 +1737,10 @@ msgstr "" msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" +#: ../../c-api/typeobj.rst:816 +msgid "PyObject *tp_repr(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:818 msgid "" "The function must return a string or a Unicode object. Ideally, this " @@ -1682,6 +1817,10 @@ msgstr "" msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" +#: ../../c-api/typeobj.rst:881 +msgid "Py_hash_t tp_hash(PyObject *);" +msgstr "" + #: ../../c-api/typeobj.rst:883 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " @@ -1730,6 +1869,10 @@ msgid "" "as for :c:func:`PyObject_Call`::" msgstr "" +#: ../../c-api/typeobj.rst:915 +msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" +msgstr "" + #: ../../c-api/typeobj.rst:924 msgid "" "An optional pointer to a function that implements the built-in operation :" @@ -1743,6 +1886,10 @@ msgstr "" msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" +#: ../../c-api/typeobj.rst:931 +msgid "PyObject *tp_str(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:933 msgid "" "The function must return a string or a Unicode object. It should be a " @@ -1765,6 +1912,10 @@ msgstr "" msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" +#: ../../c-api/typeobj.rst:953 +msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);" +msgstr "" + #: ../../c-api/typeobj.rst:955 msgid "" "It is usually convenient to set this field to :c:func:" @@ -1789,6 +1940,10 @@ msgstr "" msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" +#: ../../c-api/typeobj.rst:977 +msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" +msgstr "" + #: ../../c-api/typeobj.rst:979 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " @@ -2188,6 +2343,10 @@ msgid "" "signature is::" msgstr "" +#: ../../c-api/typeobj.rst:1366 +msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);" +msgstr "" + #: ../../c-api/typeobj.rst:1368 ../../c-api/typeobj.rst:1489 msgid "" "More information about Python's garbage collection scheme can be found in " @@ -2204,6 +2363,18 @@ msgid "" "`!_thread` extension module::" msgstr "" +#: ../../c-api/typeobj.rst:1377 +msgid "" +"static int\n" +"local_traverse(localobject *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->args);\n" +" Py_VISIT(self->kw);\n" +" Py_VISIT(self->dict);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../c-api/typeobj.rst:1386 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " @@ -2270,6 +2441,10 @@ msgid "" "signature is::" msgstr "" +#: ../../c-api/typeobj.rst:1439 +msgid "int tp_clear(PyObject *);" +msgstr "" + #: ../../c-api/typeobj.rst:1441 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " @@ -2293,6 +2468,19 @@ msgid "" "example::" msgstr "" +#: ../../c-api/typeobj.rst:1455 +msgid "" +"static int\n" +"local_clear(localobject *self)\n" +"{\n" +" Py_CLEAR(self->key);\n" +" Py_CLEAR(self->args);\n" +" Py_CLEAR(self->kw);\n" +" Py_CLEAR(self->dict);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../c-api/typeobj.rst:1465 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " @@ -2339,6 +2527,10 @@ msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" +#: ../../c-api/typeobj.rst:1506 +msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" +msgstr "" + #: ../../c-api/typeobj.rst:1508 msgid "" "The first parameter is guaranteed to be an instance of the type that is " @@ -2454,7 +2646,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1586 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " -"and :c:member:`~PyTypeObject.tp_weaklist`." +"and :c:member:`~PyTypeObject.tp_weaklistoffset`." msgstr "" #: ../../c-api/typeobj.rst:1591 @@ -2469,7 +2661,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1598 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" -"`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject." +"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject." "tp_weaklistoffset` will be set to a negative value, to indicate that it is " "unsafe to use this field." msgstr "" @@ -2485,12 +2677,20 @@ msgstr "" msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" +#: ../../c-api/typeobj.rst:1612 +msgid "PyObject *tp_iter(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:1621 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" +#: ../../c-api/typeobj.rst:1624 +msgid "PyObject *tp_iternext(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:1626 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" @@ -2662,12 +2862,20 @@ msgstr "" msgid "The function signature is::" msgstr "A assinatura da função é::" +#: ../../c-api/typeobj.rst:1763 +msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" +msgstr "" + #: ../../c-api/typeobj.rst:1774 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" +#: ../../c-api/typeobj.rst:1779 +msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" +msgstr "" + #: ../../c-api/typeobj.rst:1781 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" @@ -2747,6 +2955,10 @@ msgid "" "instance by calling its :meth:`!__init__` method again." msgstr "" +#: ../../c-api/typeobj.rst:1843 +msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" +msgstr "" + #: ../../c-api/typeobj.rst:1845 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " @@ -2779,6 +2991,10 @@ msgstr "" msgid "An optional pointer to an instance allocation function." msgstr "" +#: ../../c-api/typeobj.rst:1873 +msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" +msgstr "" + #: ../../c-api/typeobj.rst:1877 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " @@ -2802,6 +3018,11 @@ msgstr "" msgid "An optional pointer to an instance creation function." msgstr "" +#: ../../c-api/typeobj.rst:1897 +msgid "" +"PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" +msgstr "" + #: ../../c-api/typeobj.rst:1899 msgid "" "The *subtype* argument is the type of the object being created; the *args* " @@ -2849,6 +3070,10 @@ msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" +#: ../../c-api/typeobj.rst:1934 +msgid "void tp_free(void *self);" +msgstr "" + #: ../../c-api/typeobj.rst:1936 msgid "" "An initializer that is compatible with this signature is :c:func:" @@ -2889,6 +3114,10 @@ msgid "" "instance. The signature is::" msgstr "" +#: ../../c-api/typeobj.rst:1964 +msgid "int tp_is_gc(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:1966 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" @@ -2993,6 +3222,10 @@ msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" +#: ../../c-api/typeobj.rst:2078 +msgid "void tp_finalize(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:2080 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " @@ -3010,6 +3243,23 @@ msgid "" "finalizer is::" msgstr "" +#: ../../c-api/typeobj.rst:2090 +msgid "" +"static void\n" +"local_finalize(PyObject *self)\n" +"{\n" +" PyObject *error_type, *error_value, *error_traceback;\n" +"\n" +" /* Save the current exception, if any. */\n" +" PyErr_Fetch(&error_type, &error_value, &error_traceback);\n" +"\n" +" /* ... */\n" +"\n" +" /* Restore the saved exception. */\n" +" PyErr_Restore(error_type, error_value, error_traceback);\n" +"}" +msgstr "" + #: ../../c-api/typeobj.rst:2104 msgid "" "Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." @@ -3130,6 +3380,52 @@ msgstr "" msgid "Here is the structure definition::" msgstr "" +#: ../../c-api/typeobj.rst:2209 +msgid "" +"typedef struct {\n" +" binaryfunc nb_add;\n" +" binaryfunc nb_subtract;\n" +" binaryfunc nb_multiply;\n" +" binaryfunc nb_remainder;\n" +" binaryfunc nb_divmod;\n" +" ternaryfunc nb_power;\n" +" unaryfunc nb_negative;\n" +" unaryfunc nb_positive;\n" +" unaryfunc nb_absolute;\n" +" inquiry nb_bool;\n" +" unaryfunc nb_invert;\n" +" binaryfunc nb_lshift;\n" +" binaryfunc nb_rshift;\n" +" binaryfunc nb_and;\n" +" binaryfunc nb_xor;\n" +" binaryfunc nb_or;\n" +" unaryfunc nb_int;\n" +" void *nb_reserved;\n" +" unaryfunc nb_float;\n" +"\n" +" binaryfunc nb_inplace_add;\n" +" binaryfunc nb_inplace_subtract;\n" +" binaryfunc nb_inplace_multiply;\n" +" binaryfunc nb_inplace_remainder;\n" +" ternaryfunc nb_inplace_power;\n" +" binaryfunc nb_inplace_lshift;\n" +" binaryfunc nb_inplace_rshift;\n" +" binaryfunc nb_inplace_and;\n" +" binaryfunc nb_inplace_xor;\n" +" binaryfunc nb_inplace_or;\n" +"\n" +" binaryfunc nb_floor_divide;\n" +" binaryfunc nb_true_divide;\n" +" binaryfunc nb_inplace_floor_divide;\n" +" binaryfunc nb_inplace_true_divide;\n" +"\n" +" unaryfunc nb_index;\n" +"\n" +" binaryfunc nb_matrix_multiply;\n" +" binaryfunc nb_inplace_matrix_multiply;\n" +"} PyNumberMethods;" +msgstr "" + #: ../../c-api/typeobj.rst:2254 msgid "" "Binary and ternary functions must check the type of all their operands, and " @@ -3285,6 +3581,10 @@ msgstr "" msgid "The signature of this function is::" msgstr "" +#: ../../c-api/typeobj.rst:2441 +msgid "int (PyObject *exporter, Py_buffer *view, int flags);" +msgstr "" + #: ../../c-api/typeobj.rst:2443 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " @@ -3362,6 +3662,10 @@ msgid "" "this function." msgstr "" +#: ../../c-api/typeobj.rst:2490 +msgid "void (PyObject *exporter, Py_buffer *view);" +msgstr "" + #: ../../c-api/typeobj.rst:2492 msgid "" "Handle a request to release the resources of the buffer. If no resources " @@ -3409,6 +3713,20 @@ msgid "" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" +#: ../../c-api/typeobj.rst:2533 +msgid "" +"typedef struct {\n" +" unaryfunc am_await;\n" +" unaryfunc am_aiter;\n" +" unaryfunc am_anext;\n" +" sendfunc am_send;\n" +"} PyAsyncMethods;" +msgstr "" + +#: ../../c-api/typeobj.rst:2544 +msgid "PyObject *am_await(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:2546 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " @@ -3420,6 +3738,10 @@ msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" +#: ../../c-api/typeobj.rst:2555 +msgid "PyObject *am_aiter(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:2557 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`~object." @@ -3432,12 +3754,20 @@ msgid "" "asynchronous iteration protocol." msgstr "" +#: ../../c-api/typeobj.rst:2567 +msgid "PyObject *am_anext(PyObject *self);" +msgstr "" + #: ../../c-api/typeobj.rst:2569 msgid "" "Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " "details. This slot may be set to ``NULL``." msgstr "" +#: ../../c-api/typeobj.rst:2577 +msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" +msgstr "" + #: ../../c-api/typeobj.rst:2579 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." @@ -3546,16 +3876,104 @@ msgstr "" msgid "A basic :ref:`static type `::" msgstr "" +#: ../../c-api/typeobj.rst:2706 +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" const char *data;\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject),\n" +" .tp_doc = PyDoc_STR(\"My objects\"),\n" +" .tp_new = myobj_new,\n" +" .tp_dealloc = (destructor)myobj_dealloc,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +"};" +msgstr "" + #: ../../c-api/typeobj.rst:2721 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" +#: ../../c-api/typeobj.rst:2724 +msgid "" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" \"mymod.MyObject\", /* tp_name */\n" +" sizeof(MyObject), /* tp_basicsize */\n" +" 0, /* tp_itemsize */\n" +" (destructor)myobj_dealloc, /* tp_dealloc */\n" +" 0, /* tp_vectorcall_offset */\n" +" 0, /* tp_getattr */\n" +" 0, /* tp_setattr */\n" +" 0, /* tp_as_async */\n" +" (reprfunc)myobj_repr, /* tp_repr */\n" +" 0, /* tp_as_number */\n" +" 0, /* tp_as_sequence */\n" +" 0, /* tp_as_mapping */\n" +" 0, /* tp_hash */\n" +" 0, /* tp_call */\n" +" 0, /* tp_str */\n" +" 0, /* tp_getattro */\n" +" 0, /* tp_setattro */\n" +" 0, /* tp_as_buffer */\n" +" 0, /* tp_flags */\n" +" PyDoc_STR(\"My objects\"), /* tp_doc */\n" +" 0, /* tp_traverse */\n" +" 0, /* tp_clear */\n" +" 0, /* tp_richcompare */\n" +" 0, /* tp_weaklistoffset */\n" +" 0, /* tp_iter */\n" +" 0, /* tp_iternext */\n" +" 0, /* tp_methods */\n" +" 0, /* tp_members */\n" +" 0, /* tp_getset */\n" +" 0, /* tp_base */\n" +" 0, /* tp_dict */\n" +" 0, /* tp_descr_get */\n" +" 0, /* tp_descr_set */\n" +" 0, /* tp_dictoffset */\n" +" 0, /* tp_init */\n" +" 0, /* tp_alloc */\n" +" myobj_new, /* tp_new */\n" +"};" +msgstr "" + #: ../../c-api/typeobj.rst:2765 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" +#: ../../c-api/typeobj.rst:2767 +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" const char *data;\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject),\n" +" .tp_doc = PyDoc_STR(\"My objects\"),\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |\n" +" Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_MANAGED_DICT |\n" +" Py_TPFLAGS_MANAGED_WEAKREF,\n" +" .tp_new = myobj_new,\n" +" .tp_traverse = (traverseproc)myobj_traverse,\n" +" .tp_clear = (inquiry)myobj_clear,\n" +" .tp_alloc = PyType_GenericNew,\n" +" .tp_dealloc = (destructor)myobj_dealloc,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +" .tp_hash = (hashfunc)myobj_hash,\n" +" .tp_richcompare = PyBaseObject_Type.tp_richcompare,\n" +"};" +msgstr "" + #: ../../c-api/typeobj.rst:2790 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " @@ -3563,17 +3981,62 @@ msgid "" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" +#: ../../c-api/typeobj.rst:2794 +msgid "" +"typedef struct {\n" +" PyUnicodeObject raw;\n" +" char *extra;\n" +"} MyStr;\n" +"\n" +"static PyTypeObject MyStr_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyStr\",\n" +" .tp_basicsize = sizeof(MyStr),\n" +" .tp_base = NULL, // set to &PyUnicode_Type in module init\n" +" .tp_doc = PyDoc_STR(\"my custom str\"),\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,\n" +" .tp_repr = (reprfunc)myobj_repr,\n" +"};" +msgstr "" + #: ../../c-api/typeobj.rst:2809 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" +#: ../../c-api/typeobj.rst:2811 +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +"};" +msgstr "" + #: ../../c-api/typeobj.rst:2820 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" +#: ../../c-api/typeobj.rst:2822 +msgid "" +"typedef struct {\n" +" PyObject_VAR_HEAD\n" +" const char *data[1];\n" +"} MyObject;\n" +"\n" +"static PyTypeObject MyObject_Type = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"mymod.MyObject\",\n" +" .tp_basicsize = sizeof(MyObject) - sizeof(char *),\n" +" .tp_itemsize = sizeof(char *),\n" +"};" +msgstr "" + #: ../../c-api/typeobj.rst:809 ../../c-api/typeobj.rst:874 msgid "built-in function" msgstr "função embutida" diff --git a/c-api/unicode.po b/c-api/unicode.po index 6c0d312c4..c3d1195ff 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Julio Gadioli Soares , 2021 -# Welington Carlos , 2023 -# Marco Rougeth , 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# felipe caridade fernandes , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -1256,6 +1251,13 @@ msgid "" "byte order::" msgstr "" +#: ../../c-api/unicode.rst:1029 ../../c-api/unicode.rst:1079 +msgid "" +"*byteorder == -1: little endian\n" +"*byteorder == 0: native order\n" +"*byteorder == 1: big endian" +msgstr "" + #: ../../c-api/unicode.rst:1033 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " diff --git a/c-api/utilities.po b/c-api/utilities.po index 592756e01..b703eacb6 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 7ce7b42b2..f89ae2392 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/c-api/weakref.po b/c-api/weakref.po index 97db9d105..5b2feb13a 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -69,15 +69,15 @@ msgid "" "a callable object that receives notification when *ob* is garbage collected; " "it should accept a single parameter, which will be the weak reference object " "itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a " -"weakly referencable object, or if *callback* is not callable, ``None``, or " +"weakly referenceable object, or if *callback* is not callable, ``None``, or " "``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" -"Retorna um objeto de referência fraca para o objeto *ob*. Isso sempre " +"Retorna um objeto de referência fraco para o objeto *ob*. Isso sempre " "retornará uma nova referência, mas não é garantido para criar um novo " "objeto; um objeto de referência existente pode ser retornado. O segundo " "parâmetro, *callback*, pode ser um objeto chamável que recebe notificação " "quando *ob* for lixo coletado; ele deve aceitar um único parâmetro, que será " -"o objeto de referência fraca propriamente dito. *callback* também pode ser " +"o objeto de referência fraco propriamente dito. *callback* também pode ser " "``None`` ou ``NULL``. Se *ob* não for um objeto fracamente referenciável, ou " "se *callback* não for um chamável, ``None``, ou ``NULL``, isso retornará " "``NULL`` e levantará a :exc:`TypeError`." @@ -90,7 +90,7 @@ msgid "" "can be a callable object that receives notification when *ob* is garbage " "collected; it should accept a single parameter, which will be the weak " "reference object itself. *callback* may also be ``None`` or ``NULL``. If " -"*ob* is not a weakly referencable object, or if *callback* is not callable, " +"*ob* is not a weakly referenceable object, or if *callback* is not callable, " "``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" "Retorna um objeto de proxy de referência fraca para o objeto *ob*. Isso " @@ -98,9 +98,9 @@ msgstr "" "objeto; um objeto de proxy existente pode ser retornado. O segundo " "parâmetro, *callback*, pode ser um objeto chamável que recebe notificação " "quando *ob* for lixo coletado; ele deve aceitar um único parâmetro, que será " -"o objeto de referência fraca propriamente dito. *callback* também pode ser " -"``None`` ou ``NULL``. Se *ob* não for um objeto fracamente referenciável, ou " -"se *callback* não for um chamável, ``None``, ou ``NULL``, isso retornará " +"o objeto de referência fraco propriamente dito. *callback* também pode ser " +"``None`` ou ``NULL``. Se *ob* não for um objeto referência fraca, ou se " +"*callback* não for um chamável, ``None``, ou ``NULL``, isso retornará " "``NULL`` e levantará a :exc:`TypeError`." #: ../../c-api/weakref.rst:56 diff --git a/contents.po b/contents.po index db6ad41bc..3cf0f8bc2 100644 --- a/contents.po +++ b/contents.po @@ -4,16 +4,16 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Erick Simões , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Erick Simões , 2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" "MIME-Version: 1.0\n" diff --git a/copyright.po b/copyright.po index 6c2ffadcf..806a4bf56 100644 --- a/copyright.po +++ b/copyright.po @@ -4,18 +4,16 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Ademar Nowasky Junior , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" "MIME-Version: 1.0\n" diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po new file mode 100644 index 000000000..b82400fa8 --- /dev/null +++ b/deprecations/c-api-pending-removal-in-3.14.po @@ -0,0 +1,210 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-08-02 14:53+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:2 +msgid "Pending Removal in Python 3.14" +msgstr "Remoção pendente no Python 3.14" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " +"(:pep:`699`; :gh:`101193`)." +msgstr "" +"O campo ``ma_version_tag`` em :c:type:`PyDictObject` para módulos de " +"extensão (:pep:`699`; :gh:`101193`)." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." +msgstr "" +"A criação de :c:data:`tipos imutáveis ` com bases " +"mutáveis (:gh:`95388`)." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:10 +msgid "" +"Functions to configure Python's initialization, deprecated in Python 3.11:" +msgstr "" +"Funções para configurar a inicialização do Python, descontinuadas no Python " +"3.11:" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:12 +msgid "``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead." +msgstr "``PySys_SetArgvEx()``: defina :c:member:`PyConfig.argv`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:13 +msgid "``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead." +msgstr "``PySys_SetArgv()``: defina :c:member:`PyConfig.argv`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 +msgid "``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead." +msgstr "``Py_SetProgramName()``: defina :c:member:`PyConfig.program_name`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:15 +msgid "``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead." +msgstr "``Py_SetPythonHome()``: defina :c:member:`PyConfig.home`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:17 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:45 +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." +msgstr "" +"A API :c:func:`Py_InitializeFromConfig` deve ser usada com :c:type:" +"`PyConfig`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:20 +msgid "Global configuration variables:" +msgstr "Variáveis de configuração globais" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:22 +msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug` instead." +msgstr ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:23 +msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose` instead." +msgstr ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 +msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet` instead." +msgstr ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:25 +msgid "" +":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive` instead." +msgstr ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 +msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect` instead." +msgstr ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:27 +msgid "" +":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level` " +"instead." +msgstr ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 +msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` instead." +msgstr ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` ." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:29 +msgid "" +":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning` instead." +msgstr ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +msgid "" +":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings` instead." +msgstr ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:31 +msgid "" +":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment` " +"instead." +msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +msgid "" +":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode` " +"instead." +msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:33 +msgid "" +":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +"user_site_directory` instead." +msgstr "" +":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +"user_site_directory`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +msgid "" +":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio` " +"instead." +msgstr "" +":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:35 +msgid "" +":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " +"and :c:member:`PyConfig.hash_seed` instead." +msgstr "" +":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` e :" +"c:member:`PyConfig.hash_seed`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:37 +msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated` instead." +msgstr ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +msgid "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` instead." +msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:39 +msgid "" +":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +"legacy_windows_stdio` instead." +msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +"legacy_windows_stdio`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +msgid "" +":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:41 +msgid "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +msgid "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +"filesystem_errors` instead." +msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +"filesystem_errors`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:43 +msgid "" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +"c:func:`Py_PreInitialize`)" +msgstr "" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode`. (veja :c:func:" +"`Py_PreInitialize`)" diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po new file mode 100644 index 000000000..9b2743d44 --- /dev/null +++ b/deprecations/c-api-pending-removal-in-3.15.po @@ -0,0 +1,96 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-08-02 14:53+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:2 +msgid "Pending Removal in Python 3.15" +msgstr "Remoção pendente no Python 3.15" + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 +msgid "The bundled copy of ``libmpdecimal``." +msgstr "A cópia empacotada do ``libmpdecimal``." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 +msgid "" +":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule` " +"instead." +msgstr "" +":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 +msgid "" +":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`!PyWeakref_GetRef` instead." +msgstr ":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`!PyWeakref_GetRef`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 +msgid ":c:func:`PyWeakref_GetObject`: use :c:func:`!PyWeakref_GetRef` instead." +msgstr ":c:func:`PyWeakref_GetObject`: use :c:func:`!PyWeakref_GetRef`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:8 +msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." +msgstr "O tipo :c:type:`!Py_UNICODE_WIDE`: use :c:type:`wchar_t`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 +msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead." +msgstr "O tipo :c:type:`Py_UNICODE`: use :c:type:`wchar_t`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 +msgid "Python initialization functions:" +msgstr "Funções de inicialização do Python" + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 +msgid "" +":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +"warnings.filters` instead." +msgstr "" +":c:func:`PySys_ResetWarnOptions`: apague :data:`sys.warnoptions` e :data:`!" +"warnings.filters`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:14 +msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead." +msgstr ":c:func:`Py_GetExecPrefix`: obtenha :data:`sys.exec_prefix`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 +msgid ":c:func:`Py_GetPath`: get :data:`sys.path` instead." +msgstr ":c:func:`Py_GetPath`: obtenha :data:`sys.path`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:16 +msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead." +msgstr ":c:func:`Py_GetPrefix`: obtenha :data:`sys.prefix`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 +msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead." +msgstr ":c:func:`Py_GetProgramFullPath`: obtenha :data:`sys.executable`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 +msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable` instead." +msgstr ":c:func:`Py_GetProgramName`: obtenha :data:`sys.executable`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +msgid "" +":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable instead." +msgstr "" +":c:func:`Py_GetPythonHome`: obtenha :c:member:`PyConfig.home` ou a variável " +"de ambiente :envvar:`PYTHONHOME`." diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po new file mode 100644 index 000000000..be9c8bb66 --- /dev/null +++ b/deprecations/c-api-pending-removal-in-future.po @@ -0,0 +1,153 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-08-02 14:53+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:2 +msgid "Pending Removal in Future Versions" +msgstr "Remoção pendente em versões futuras" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:4 +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." +msgstr "" +"As APIs a seguir foram descontinuado e serão removidas, embora atualmente " +"não haja uma data agendada para sua remoção." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:7 +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8." +msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: desnecessária desde o Python 3.8." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:8 +msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException` instead." +msgstr ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +msgid "" +":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException` " +"instead." +msgstr "" +":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:10 +msgid "" +":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException` instead." +msgstr ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +msgid "" +":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject` " +"instead." +msgstr "" +":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:12 +msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child` instead." +msgstr ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +msgid "" +":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." +msgstr "" +":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` e :c:func:" +"`PySlice_AdjustIndices`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:14 +msgid "" +":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode` instead." +msgstr ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +msgid "" +":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode` instead." +msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:16 +msgid "" +":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode` instead." +msgstr ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +msgid "" +":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode` instead." +msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:18 +msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +msgstr ":c:func:`PyUnicode_READY`: desnecessário desde o Python 3.12" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:19 +msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException` instead." +msgstr ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:20 +msgid "" +":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1`` instead." +msgstr ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead." +msgstr "" +"O membro :c:member:`!PyBytesObject.ob_shash`: chame :c:func:`PyObject_Hash`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +msgid ":c:member:`!PyDictObject.ma_version_tag` member." +msgstr "O membro :c:member:`!PyDictObject.ma_version_tag`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:24 +msgid "Thread Local Storage (TLS) API:" +msgstr "API do Thread Local Storage (TLS):" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:26 +msgid "" +":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc` instead." +msgstr ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:27 +msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free` instead." +msgstr ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:28 +msgid "" +":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set` instead." +msgstr ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +msgid "" +":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get` instead." +msgstr ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:30 +msgid "" +":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete` " +"instead." +msgstr "" +":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:31 +msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7." +msgstr ":c:func:`PyThread_ReInitTLS`: desnecessário desde o Python 3.7." diff --git a/deprecations/index.po b/deprecations/index.po new file mode 100644 index 000000000..9e76b0f39 --- /dev/null +++ b/deprecations/index.po @@ -0,0 +1,1437 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-07-29 04:37+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/index.rst:2 +msgid "Deprecations" +msgstr "Descontinuações" + +#: ../../deprecations/pending-removal-in-3.13.rst:2 +msgid "Pending Removal in Python 3.13" +msgstr "Remoção pendente no Python 3.13" + +#: ../../deprecations/pending-removal-in-3.13.rst:4 +msgid "Modules (see :pep:`594`):" +msgstr "Módulos (veja :pep:`594`):" + +#: ../../deprecations/pending-removal-in-3.13.rst:6 +msgid ":mod:`aifc`" +msgstr ":mod:`aifc`" + +#: ../../deprecations/pending-removal-in-3.13.rst:7 +msgid ":mod:`audioop`" +msgstr ":mod:`audioop`" + +#: ../../deprecations/pending-removal-in-3.13.rst:8 +msgid ":mod:`cgi`" +msgstr ":mod:`cgi`" + +#: ../../deprecations/pending-removal-in-3.13.rst:9 +msgid ":mod:`cgitb`" +msgstr ":mod:`cgitb`" + +#: ../../deprecations/pending-removal-in-3.13.rst:10 +msgid ":mod:`chunk`" +msgstr ":mod:`chunk`" + +#: ../../deprecations/pending-removal-in-3.13.rst:11 +msgid ":mod:`crypt`" +msgstr ":mod:`crypt`" + +#: ../../deprecations/pending-removal-in-3.13.rst:12 +msgid ":mod:`imghdr`" +msgstr ":mod:`imghdr`" + +#: ../../deprecations/pending-removal-in-3.13.rst:13 +msgid ":mod:`mailcap`" +msgstr ":mod:`mailcap`" + +#: ../../deprecations/pending-removal-in-3.13.rst:14 +msgid ":mod:`msilib`" +msgstr ":mod:`msilib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:15 +msgid ":mod:`nis`" +msgstr ":mod:`nis`" + +#: ../../deprecations/pending-removal-in-3.13.rst:16 +msgid ":mod:`nntplib`" +msgstr ":mod:`nntplib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:17 +msgid ":mod:`ossaudiodev`" +msgstr ":mod:`ossaudiodev`" + +#: ../../deprecations/pending-removal-in-3.13.rst:18 +msgid ":mod:`pipes`" +msgstr ":mod:`pipes`" + +#: ../../deprecations/pending-removal-in-3.13.rst:19 +msgid ":mod:`sndhdr`" +msgstr ":mod:`sndhdr`" + +#: ../../deprecations/pending-removal-in-3.13.rst:20 +msgid ":mod:`spwd`" +msgstr ":mod:`spwd`" + +#: ../../deprecations/pending-removal-in-3.13.rst:21 +msgid ":mod:`sunau`" +msgstr ":mod:`sunau`" + +#: ../../deprecations/pending-removal-in-3.13.rst:22 +msgid ":mod:`telnetlib`" +msgstr ":mod:`telnetlib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:23 +msgid ":mod:`uu`" +msgstr ":mod:`uu`" + +#: ../../deprecations/pending-removal-in-3.13.rst:24 +msgid ":mod:`xdrlib`" +msgstr ":mod:`xdrlib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:26 +msgid "Other modules:" +msgstr "Outros módulos:" + +#: ../../deprecations/pending-removal-in-3.13.rst:28 +msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" +msgstr ":mod:`!lib2to3` e o programa :program:`2to3` (:gh:`84540`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:30 +msgid "APIs:" +msgstr "APIs:" + +#: ../../deprecations/pending-removal-in-3.13.rst:32 +msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" +msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:33 +msgid "``locale.resetlocale()`` (:gh:`90817`)" +msgstr "``locale.resetlocale()`` (:gh:`90817`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:34 +msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" +msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:35 +msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" +msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:36 +msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" +msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:37 +msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" +msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:38 +msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" +msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:39 +msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" +msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:40 +msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" +msgstr "Encadeamento do descritor de :class:`classmethod` (:gh:`89519`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:41 +msgid ":mod:`importlib.resources` deprecated methods:" +msgstr "Métodos descontinuados de :mod:`importlib.resources`:" + +#: ../../deprecations/pending-removal-in-3.13.rst:43 +msgid "``contents()``" +msgstr "``contents()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:44 +msgid "``is_resource()``" +msgstr "``is_resource()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:45 +msgid "``open_binary()``" +msgstr "``open_binary()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:46 +msgid "``open_text()``" +msgstr "``open_text()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:47 +msgid "``path()``" +msgstr "``path()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:48 +msgid "``read_binary()``" +msgstr "``read_binary()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:49 +msgid "``read_text()``" +msgstr "``read_text()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:51 +msgid "" +"Use :func:`importlib.resources.files` instead. Refer to `importlib-" +"resources: Migrating from Legacy `_ (:gh:`106531`)" +msgstr "" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:2 +#: ../../deprecations/pending-removal-in-3.14.rst:2 +msgid "Pending Removal in Python 3.14" +msgstr "Remoção pendente no Python 3.14" + +#: ../../deprecations/pending-removal-in-3.14.rst:4 +msgid "" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" +":mod:`argparse`: Os parâmetros *type*, *choices* e *metavar* de :class:`!" +"argparse.BooleanOptionalAction` foram descontinuados e serão removidos na " +"versão 3.14. (Contribuição de Nikita Sobolev em :gh:`92248`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:9 +msgid "" +":mod:`ast`: The following features have been deprecated in documentation " +"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " +"runtime when they are accessed or used, and will be removed in Python 3.14:" +msgstr "" +":mod:`ast`: Os seguintes recursos foram descontinuados na documentação desde " +"Python 3.8, agora fazem com que um :exc:`DeprecationWarning` seja emitido em " +"tempo de execução quando eles são acessados ou usados, e serão removidos no " +"Python 3.14:" + +#: ../../deprecations/pending-removal-in-3.14.rst:13 +msgid ":class:`!ast.Num`" +msgstr ":class:`!ast.Num`" + +#: ../../deprecations/pending-removal-in-3.14.rst:14 +msgid ":class:`!ast.Str`" +msgstr ":class:`!ast.Str`" + +#: ../../deprecations/pending-removal-in-3.14.rst:15 +msgid ":class:`!ast.Bytes`" +msgstr ":class:`!ast.Bytes`" + +#: ../../deprecations/pending-removal-in-3.14.rst:16 +msgid ":class:`!ast.NameConstant`" +msgstr ":class:`!ast.NameConstant`" + +#: ../../deprecations/pending-removal-in-3.14.rst:17 +msgid ":class:`!ast.Ellipsis`" +msgstr ":class:`!ast.Ellipsis`" + +#: ../../deprecations/pending-removal-in-3.14.rst:19 +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" +"Usa :class:`ast.Constant` em vez disso. (Contribuição de Serhiy Storchaka " +"em :gh:`90953`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:22 +msgid ":mod:`asyncio`:" +msgstr ":mod:`asyncio`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:24 +msgid "" +"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" +"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" +"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" +"As classes filhas do observador :class:`~asyncio.MultiLoopChildWatcher`, :" +"class:`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` e :" +"class:`~asyncio.SafeChildWatcher` foram descontinuadas e serão removidas no " +"Python 3.14. (Contribuição de Kumar Aditya em :gh:`94597`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:30 +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` e :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` foram descontinuados e serão " +"removidos no Python 3.14. (Contribuição de Kumar Aditya em :gh:`94597`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:36 +msgid "" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" +msgstr "" +"O método :meth:`~asyncio.get_event_loop` da política de laço de eventos " +"padrão agora emite um :exc:`DeprecationWarning` se não houver nenhum laço de " +"eventos atual definido e decidir criar um. (Contribuição de Serhiy Storchaka " +"e Guido van Rossum em :gh:`100160`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:41 +msgid "" +":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " +"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +msgstr "" +":mod:`collections.abc`: :class:`~collections.abc.ByteString` foi " +"descontinuado. Prefira :class:`!Sequence` ou :class:`~collections.abc." +"Buffer` Para uso em tipagem, prefira uma união, como ``bytes | bytearray`` " +"ou :class:`collections.abc.Buffer`. (Contribuição de Shantanu Jain em :gh:" +"`91896`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:47 +msgid "" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +msgstr "" +":mod:`email`: Descontinua o parâmetro *isdst* em :func:`email.utils." +"localtime`. (Contribuição de Alan Williams em :gh:`72346`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:50 +msgid "" +":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " +"taken into consideration by the import system (:gh:`97879`)." +msgstr "" +":mod:`importlib`: ``__package__`` e ``__cached__`` deixarão de ser definidos " +"ou levados em consideração pelo sistema de importação (:gh:`97879`)." + +#: ../../deprecations/pending-removal-in-3.14.rst:53 +msgid ":mod:`importlib.abc` deprecated classes:" +msgstr ":mod:`importlib.abc` descontinuou as classes:" + +#: ../../deprecations/pending-removal-in-3.14.rst:55 +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr ":class:`!importlib.abc.ResourceReader`" + +#: ../../deprecations/pending-removal-in-3.14.rst:56 +msgid ":class:`!importlib.abc.Traversable`" +msgstr ":class:`!importlib.abc.Traversable`" + +#: ../../deprecations/pending-removal-in-3.14.rst:57 +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr ":class:`!importlib.abc.TraversableResources`" + +#: ../../deprecations/pending-removal-in-3.14.rst:59 +msgid "Use :mod:`importlib.resources.abc` classes instead:" +msgstr "Em vez disso, use classes :mod:`importlib.resources.abc`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:61 +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr ":class:`importlib.resources.abc.Traversable`" + +#: ../../deprecations/pending-removal-in-3.14.rst:62 +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr ":class:`importlib.resources.abc.TraversableResources`" + +#: ../../deprecations/pending-removal-in-3.14.rst:64 +msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" +msgstr "(Contribuição de Jason R. Coombs e Hugo van Kemenade em :gh:`93963`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:66 +msgid "" +":mod:`itertools` had undocumented, inefficient, historically buggy, and " +"inconsistent support for copy, deepcopy, and pickle operations. This will be " +"removed in 3.14 for a significant reduction in code volume and maintenance " +"burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" +msgstr "" +":mod:`itertools` tinha suporte não documentado, ineficiente, historicamente " +"cheio de bugs e inconsistente para operações de cópia, cópia profunda e " +"serialização com pickle. Isso será removido na versão 3.14 para uma redução " +"significativa no volume de código e na carga de manutenção. (Contribuição de " +"Raymond Hettinger em :gh:`101588`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:72 +msgid "" +":mod:`multiprocessing`: The default start method will change to a safer one " +"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " +"currently the default (:gh:`84559`). Adding a runtime warning about this was " +"deemed too disruptive as the majority of code is not expected to care. Use " +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." +msgstr "" +":mod:`multiprocessing`: O método de inicialização padrão será alterado para " +"um mais seguro no Linux, BSDs e outras plataformas POSIX não-macOS onde " +"``'fork'`` é atualmente o padrão (:gh:`84559`). Adicionar um aviso de tempo " +"de execução sobre isso foi considerado muito perturbador, pois não se espera " +"que a maior parte do código se importe. Use as APIs :func:`~multiprocessing." +"get_context` ou :func:`~multiprocessing.set_start_method` para especificar " +"explicitamente quando seu código *requer* ``'fork'``. Veja :ref:" +"`multiprocessing-start-methods`." + +#: ../../deprecations/pending-removal-in-3.14.rst:80 +msgid "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." +"PurePath.relative_to`: passing additional arguments is deprecated." +msgstr "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` e :meth:`~pathlib." +"PurePath.relative_to`: passar argumentos adicionais foi descontinuado." + +#: ../../deprecations/pending-removal-in-3.14.rst:84 +msgid "" +":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " +"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " +"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +msgstr "" +":mod:`pkgutil`: :func:`~pkgutil.find_loader` e :func:`~pkgutil.get_loader` " +"agora levantam :exc:`DeprecationWarning`; use :func:`importlib.util." +"find_spec` em vez disto. (Contribuição de Nikita Sobolev em :gh:`97850`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:89 +msgid ":mod:`pty`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:91 +msgid "``master_open()``: use :func:`pty.openpty`." +msgstr "``master_open()``: use :func:`pty.openpty`." + +#: ../../deprecations/pending-removal-in-3.14.rst:92 +msgid "``slave_open()``: use :func:`pty.openpty`." +msgstr "``slave_open()``: use :func:`pty.openpty`." + +#: ../../deprecations/pending-removal-in-3.14.rst:94 +msgid ":mod:`sqlite3`:" +msgstr ":mod:`sqlite3`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:96 +msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." +msgstr ":data:`~sqlite3.version` e :data:`~sqlite3.version_info`." + +#: ../../deprecations/pending-removal-in-3.14.rst:98 +msgid "" +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" +"ref:`named placeholders ` are used and *parameters* is " +"a sequence instead of a :class:`dict`." +msgstr "" +":meth:`~sqlite3.Cursor.execute` e :meth:`~sqlite3.Cursor.executemany` se :" +"ref:`espaços reservados nomeados ` forem usados ​​e " +"*parameters* for uma sequência em vez de um :class:`dict` ." + +#: ../../deprecations/pending-removal-in-3.14.rst:102 +msgid "" +"date and datetime adapter, date and timestamp converter: see the :mod:" +"`sqlite3` documentation for suggested replacement recipes." +msgstr "" +"adaptador de data e hora, conversor de registro de data e hora: veja a " +"documentação de :mod:`sqlite3` para receitas de substituição sugeridas." + +#: ../../deprecations/pending-removal-in-3.14.rst:105 +msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" +":class:`types.CodeType`: O acesso a :attr:`~codeobject.co_lnotab` foi " +"descontinuado na :pep:`626` desde 3.10 e foi planejado para ser removido em " +"3.12, mas só recebeu uma :exc:`DeprecationWarning` adequada em 3.12. Pode " +"ser removido em 3.14. (Contribuição de Nikita Sobolev em :gh:`101866`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:112 +msgid "" +":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " +"causes a :exc:`DeprecationWarning` to be emitted when it is used." +msgstr "" +":mod:`typing`: :class:`~typing.ByteString`, descontinuado desde Python 3.9, " +"agora faz com que uma :exc:`DeprecationWarning` seja emitida quando é usado." + +#: ../../deprecations/pending-removal-in-3.14.rst:115 +msgid "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " +"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" +"`88168`.)" +msgstr "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` está obsoleto: não foi " +"planejado para ser uma API pública. (Contribuição de Gregory P. Smith em :gh:" +"`88168`.)" + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:2 +#: ../../deprecations/pending-removal-in-3.15.rst:2 +msgid "Pending Removal in Python 3.15" +msgstr "Remoção pendente no Python 3.15" + +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "" +":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " +"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " +"rarely used. No direct replacement exists. *Anything* is better than CGI " +"to interface a web server with a request handler." +msgstr "" +":class:`http.server.CGIHTTPRequestHandler` será removido junto com seu " +"sinalizador relacionado ``--cgi`` para ``python -m http.server``. Estava " +"descontinuado e raramente usado. Não existe substituição direta. *Qualquer " +"coisa* é melhor que CGI para fazer a interface de um servidor web com um " +"manipulador de solicitações." + +#: ../../deprecations/pending-removal-in-3.15.rst:9 +msgid "" +":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " +"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " +"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" +"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " +"by Hugo van Kemenade in :gh:`111187`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 +msgid "" +":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " +"scheduled for removal in Python 3.15. From Python 3.13 onwards, use ``os." +"path.isreserved`` to detect reserved paths on Windows." +msgstr "" +":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` está descontinuado e " +"programado para remoção no Python 3.15. Do Python 3.13 em diante, use ``os." +"path.isreserved`` para detectar caminhos reservados no Windows." + +#: ../../deprecations/pending-removal-in-3.15.rst:21 +msgid "" +":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " +"removed in 3.15. It was largely untested, had a confusing API, and was only " +"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +msgstr "" +":mod:`platform`: :func:`~platform.java_ver` está descontinuada e será " +"removida na versão 3.15. Ela não foi testada em grande parte, tinha uma API " +"confusa e só era útil para suporte a Jython. (Contribuição de Nikita Sobolev " +"em :gh:`116349`.)" + +#: ../../deprecations/pending-removal-in-3.15.rst:27 +msgid "" +":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " +"deprecated. C version allows any numbers of args and kwargs, but they are " +"just ignored. Python version does not allow any arguments. All arguments " +"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " +"Nikita Sobolev in :gh:`102029`.)" +msgstr "" +":mod:`threading`: Passar qualquer argumento para :func:`threading.RLock` " +"agora está descontinuado. A versão C permite qualquer número de args e " +"kwargs, mas eles são simplesmente ignorados. A versão Python não permite " +"nenhum argumento. Todos os argumentos serão removidos de :func:`threading." +"RLock` no Python 3.15. (Contribuição de Nikita Sobolev em :gh:`102029`.)" + +#: ../../deprecations/pending-removal-in-3.15.rst:34 +msgid ":class:`typing.NamedTuple`:" +msgstr ":class:`typing.NamedTuple`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:36 +msgid "" +"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " +"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " +"disallowed in 3.15. Use the class-based syntax or the functional syntax " +"instead." +msgstr "" +"A sintaxe de argumento nomeado não documentada para criar classes :class:`!" +"NamedTuple` (``NT = NamedTuple(\"NT\", x=int)``) está descontinuada e não " +"será permitida em 3.15. Use a sintaxe baseada em classe ou a sintaxe " +"funcional." + +#: ../../deprecations/pending-removal-in-3.15.rst:40 +msgid "" +"When using the functional syntax to create a :class:`!NamedTuple` class, " +"failing to pass a value to the *fields* parameter (``NT = " +"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " +"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " +"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " +"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " +"[])``." +msgstr "" +"Ao usar a sintaxe funcional para criar uma classe :class:`!NamedTuple`, " +"falhar ao passar um valor para o parâmetro *fields* (``NT = " +"NamedTuple(\"NT\")``) está descontinuada. Passar ``None`` para o parâmetro " +"*fields* (``NT = NamedTuple(\"NT\", None)``) também está descontinuada. " +"Ambos não serão permitidos no Python 3.15. Para criar uma classe :class:`!" +"NamedTuple` com 0 campos, use ``class NT(NamedTuple): pass`` ou ``NT = " +"NamedTuple(\"NT\", [])``." + +#: ../../deprecations/pending-removal-in-3.15.rst:47 +msgid "" +":class:`typing.TypedDict`: When using the functional syntax to create a :" +"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " +"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " +"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " +"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " +"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." +msgstr "" +":class:`typing.TypedDict`: Ao usar a sintaxe funcional para criar uma " +"classe :class:`!TypedDict`, falhar ao passar um valor para o parâmetro " +"*fields* (``TD = TypedDict(\"TD\")``) está descontinuada. Passar ``None`` " +"para o parâmetro *fields* (``TD = TypedDict(\"TD\", None)``) também está " +"descontinuada. Ambos não serão permitidos no Python 3.15. Para criar uma " +"classe :class:`!TypedDict` com 0 campos, use ``class TD(TypedDict): pass`` " +"ou ``TD = TypedDict(\"TD\", {})``." + +#: ../../deprecations/pending-removal-in-3.15.rst:54 +msgid "" +":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " +"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " +"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" +"`105096`.)" +msgstr "" +":mod:`wave`: Descontinua os métodos ``getmark()``, ``setmark()`` e " +"``getmarkers()`` das classes :class:`wave.Wave_read` e :class:`wave." +"Wave_write`. Eles serão removidos no Python 3.15. (Contribuição de Victor " +"Stinner em :gh:`105096`.)" + +#: ../../deprecations/pending-removal-in-3.16.rst:2 +msgid "Pending Removal in Python 3.16" +msgstr "Remoção pendente no Python 3.16" + +#: ../../deprecations/pending-removal-in-3.16.rst:4 +msgid "" +":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " +"``'w'`` type instead (``Py_UCS4``)." +msgstr "" +":mod:`array`: :class:`array.array`: tipo ``'u'`` (:c:type:`wchar_t`): use o " +"tipo ``'w'`` (``Py_UCS4``)." + +#: ../../deprecations/pending-removal-in-3.16.rst:8 +msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +msgstr ":mod:`builtins`: ``~bool``, inversão bit a bit em booleanos." + +#: ../../deprecations/pending-removal-in-3.16.rst:11 +msgid "" +":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " +"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +msgstr "" +":mod:`symtable`: Descontinua :meth:`symtable.Class.get_methods` por falta de " +"interesse. (Contribuição de Bénédikt Tran em :gh:`119698`.)" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:2 +#: ../../deprecations/pending-removal-in-future.rst:2 +msgid "Pending Removal in Future Versions" +msgstr "Remoção pendente em versões futuras" + +#: ../../deprecations/pending-removal-in-future.rst:4 +msgid "" +"The following APIs will be removed in the future, although there is " +"currently no date scheduled for their removal." +msgstr "" +"As APIs a seguir serão removidas no futuro, embora atualmente não haja uma " +"data agendada para sua remoção." + +#: ../../deprecations/pending-removal-in-future.rst:7 +msgid "" +":mod:`argparse`: Nesting argument groups and nesting mutually exclusive " +"groups are deprecated." +msgstr "" +":mod:`argparse`: O aninhamento de grupos de argumentos e o aninhamento de " +"grupos mutuamente exclusivos estão descontinuados." + +#: ../../deprecations/pending-removal-in-future.rst:10 +msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" +msgstr "código de formatação ``'u'`` do :mod:`array` (:gh:`57281`)" + +#: ../../deprecations/pending-removal-in-future.rst:12 +msgid ":mod:`builtins`:" +msgstr ":mod:`builtins`:" + +#: ../../deprecations/pending-removal-in-future.rst:14 +msgid "``bool(NotImplemented)``." +msgstr "``bool(NotImplemented)``." + +#: ../../deprecations/pending-removal-in-future.rst:15 +msgid "" +"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " +"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " +"argument signature." +msgstr "" +"Geradores: A assinatura ``throw(type, exc, tb)`` e ``athrow(type, exc, tb)`` " +"está descontinuada: use ``throw(exc)`` e ``athrow(exc)``, a assinatura do " +"argumento único." + +#: ../../deprecations/pending-removal-in-future.rst:18 +msgid "" +"Currently Python accepts numeric literals immediately followed by keywords, " +"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " +"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " +"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" +msgstr "" +"Atualmente Python aceita literais numéricos imediatamente seguidos por " +"palavras reservadas como, por exemplo, ``0in x``, ``1or x``, ``0if 1else " +"2``. Ele permite expressões confusas e ambíguas como ``[0x1for x in y]`` " +"(que pode ser interpretada como ``[0x1 for x in y]`` ou ``[0x1f or x in " +"y]``). Um aviso de sintaxe é levantado se o literal numérico for " +"imediatamente seguido por uma das palavras reservadas :keyword:`and`, :" +"keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in` , :keyword:`is` " +"e :keyword:`or`. Em uma versão futura, será alterado para um erro de " +"sintaxe. (:gh:`87999`)" + +#: ../../deprecations/pending-removal-in-future.rst:26 +msgid "" +"Support for ``__index__()`` and ``__int__()`` method returning non-int type: " +"these methods will be required to return an instance of a strict subclass " +"of :class:`int`." +msgstr "" +"Suporte para métodos ``__index__()`` e ``__int__()`` retornando tipo não-" +"int: esses métodos serão necessários para retornar uma instância de uma " +"subclasse estrita de :class:`int`." + +#: ../../deprecations/pending-removal-in-future.rst:29 +msgid "" +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." +msgstr "" +"Suporte para o método ``__float__()`` retornando uma subclasse estrita de :" +"class:`float`: esses métodos serão necessários para retornar uma instância " +"de :class:`float`." + +#: ../../deprecations/pending-removal-in-future.rst:32 +msgid "" +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." +msgstr "" +"Suporte para o método ``__complex__()`` retornando uma subclasse estrita de :" +"class:`complex`: esses métodos serão necessários para retornar uma instância " +"de :class:`complex`." + +#: ../../deprecations/pending-removal-in-future.rst:35 +msgid "Delegation of ``int()`` to ``__trunc__()`` method." +msgstr "Delegação do método ``int()`` para o ``__trunc__()``." + +#: ../../deprecations/pending-removal-in-future.rst:36 +msgid "" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" +msgstr "" +"Passar um número complexo como argumento *real* ou *imag* no construtor :" +"func:`complex` agora está descontinuado; deve ser passado apenas como um " +"único argumento posicional. (Contribuição de Serhiy Storchaka em :gh:" +"`109218`.)" + +#: ../../deprecations/pending-removal-in-future.rst:41 +msgid "" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +msgstr "" +":mod:`calendar`: As constantes ``calendar.January`` e ``calendar.February`` " +"foram descontinuadas e substituídas por :data:`calendar.JANUARY` e :data:" +"`calendar.FEBRUARY`. (Contribuição de Prince Roshan em :gh:`103636`.)" + +#: ../../deprecations/pending-removal-in-future.rst:46 +msgid "" +":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " +"instead." +msgstr "" +":attr:`codeobject.co_lnotab`: use o método :meth:`codeobject.co_lines`." + +#: ../../deprecations/pending-removal-in-future.rst:49 +msgid ":mod:`datetime`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-future.rst:51 +msgid "" +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." +msgstr "" +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." + +#: ../../deprecations/pending-removal-in-future.rst:53 +msgid "" +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." +msgstr "" +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." + +#: ../../deprecations/pending-removal-in-future.rst:56 +msgid ":mod:`gettext`: Plural value must be an integer." +msgstr ":mod:`gettext`: O valor de plural deve ser um número inteiro." + +#: ../../deprecations/pending-removal-in-future.rst:58 +msgid ":mod:`importlib`:" +msgstr ":mod:`importlib`:" + +#: ../../deprecations/pending-removal-in-future.rst:60 +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "Método ``load_module()``: use ``exec_module()`` em vez disso." + +#: ../../deprecations/pending-removal-in-future.rst:61 +msgid "" +":func:`~importlib.util.cache_from_source` *debug_override* parameter is " +"deprecated: use the *optimization* parameter instead." +msgstr "" +"O parâmetro *debug_override* de :func:`~importlib.util.cache_from_source` " +"foi descontinuado: em vez disso, use o parâmetro *optimization*." + +#: ../../deprecations/pending-removal-in-future.rst:64 +msgid ":mod:`importlib.metadata`:" +msgstr ":mod:`importlib.metadata`:" + +#: ../../deprecations/pending-removal-in-future.rst:66 +msgid "``EntryPoints`` tuple interface." +msgstr "Interface de tupla ``EntryPoints``." + +#: ../../deprecations/pending-removal-in-future.rst:67 +msgid "Implicit ``None`` on return values." +msgstr "``None`` implícito nos valores de retorno." + +#: ../../deprecations/pending-removal-in-future.rst:69 +msgid "" +":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " +"BytesIO and binary mode instead." +msgstr "" +":mod:`mailbox`: O uso da entrada StringIO e do modo de texto foi " +"descontinuado; em vez disso, use BytesIO e o modo binário." + +#: ../../deprecations/pending-removal-in-future.rst:72 +msgid "" +":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." +msgstr ":mod:`os`: Chamar :func:`os.register_at_fork` em processo multithread." + +#: ../../deprecations/pending-removal-in-future.rst:74 +msgid "" +":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " +"deprecated, use an exception instance." +msgstr "" +":class:`!pydoc.ErrorDuringImport`: Um valor de tupla para o parâmetro " +"*exc_info* foi descontinuado, use uma instância de exceção." + +#: ../../deprecations/pending-removal-in-future.rst:77 +msgid "" +":mod:`re`: More strict rules are now applied for numerical group references " +"and group names in regular expressions. Only sequence of ASCII digits is " +"now accepted as a numerical reference. The group name in bytes patterns and " +"replacement strings can now only contain ASCII letters and digits and " +"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" +msgstr "" +":mod:`re`: Regras mais rigorosas agora são aplicadas para referências " +"numéricas de grupos e nomes de grupos em expressões regulares. Apenas a " +"sequência de dígitos ASCII agora é aceita como referência numérica. O nome " +"do grupo em padrões de bytes e strings de substituição agora pode conter " +"apenas letras e dígitos ASCII e sublinhado. (Contribuição de Serhiy " +"Storchaka em :gh:`91760`.)" + +#: ../../deprecations/pending-removal-in-future.rst:84 +msgid "" +":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." +msgstr "" +"Módulos :mod:`!sre_compile`, :mod:`!sre_constants` e :mod:`!sre_parse`." + +#: ../../deprecations/pending-removal-in-future.rst:86 +msgid "" +":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " +"Python 3.12; use the *onexc* parameter instead." +msgstr "" +":mod:`shutil`: O parâmetro *onerror* de :func:`~shutil.rmtree` foi " +"descontinuado no Python 3.12; use o parâmetro *onexc*." + +#: ../../deprecations/pending-removal-in-future.rst:89 +msgid ":mod:`ssl` options and protocols:" +msgstr "Protocolos e opções de :mod:`ssl`" + +#: ../../deprecations/pending-removal-in-future.rst:91 +msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." +msgstr ":class:`ssl.SSLContext` sem argumento de protocolo foi descontinuado." + +#: ../../deprecations/pending-removal-in-future.rst:92 +msgid "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." +msgstr "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` e :meth:`!" +"selected_npn_protocol` foram descontinuados: use ALPN." + +#: ../../deprecations/pending-removal-in-future.rst:95 +msgid "``ssl.OP_NO_SSL*`` options" +msgstr "Opções de ``ssl.OP_NO_SSL*``" + +#: ../../deprecations/pending-removal-in-future.rst:96 +msgid "``ssl.OP_NO_TLS*`` options" +msgstr "Opções de ``ssl.OP_NO_TLS*``" + +#: ../../deprecations/pending-removal-in-future.rst:97 +msgid "``ssl.PROTOCOL_SSLv3``" +msgstr "``ssl.PROTOCOL_SSLv3``" + +#: ../../deprecations/pending-removal-in-future.rst:98 +msgid "``ssl.PROTOCOL_TLS``" +msgstr "``ssl.PROTOCOL_TLS``" + +#: ../../deprecations/pending-removal-in-future.rst:99 +msgid "``ssl.PROTOCOL_TLSv1``" +msgstr "``ssl.PROTOCOL_TLSv1``" + +#: ../../deprecations/pending-removal-in-future.rst:100 +msgid "``ssl.PROTOCOL_TLSv1_1``" +msgstr "``ssl.PROTOCOL_TLSv1_1``" + +#: ../../deprecations/pending-removal-in-future.rst:101 +msgid "``ssl.PROTOCOL_TLSv1_2``" +msgstr "``ssl.PROTOCOL_TLSv1_2``" + +#: ../../deprecations/pending-removal-in-future.rst:102 +msgid "``ssl.TLSVersion.SSLv3``" +msgstr "``ssl.TLSVersion.SSLv3``" + +#: ../../deprecations/pending-removal-in-future.rst:103 +msgid "``ssl.TLSVersion.TLSv1``" +msgstr "``ssl.TLSVersion.TLSv1``" + +#: ../../deprecations/pending-removal-in-future.rst:104 +msgid "``ssl.TLSVersion.TLSv1_1``" +msgstr "``ssl.TLSVersion.TLSv1_1``" + +#: ../../deprecations/pending-removal-in-future.rst:106 +msgid "" +":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " +"ignored." +msgstr "" +"O parâmetro *check_home* de :func:`sysconfig.is_python_build` foi " +"descontinuado e é ignorado." + +#: ../../deprecations/pending-removal-in-future.rst:109 +msgid ":mod:`threading` methods:" +msgstr "Métodos de :mod:`threading`:" + +#: ../../deprecations/pending-removal-in-future.rst:111 +msgid "" +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." +msgstr "" +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." + +#: ../../deprecations/pending-removal-in-future.rst:112 +msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." +msgstr ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." + +#: ../../deprecations/pending-removal-in-future.rst:113 +msgid "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." +msgstr "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use " +"o atributo :attr:`threading.Thread.daemon`." + +#: ../../deprecations/pending-removal-in-future.rst:115 +msgid "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." +msgstr "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use o " +"atributo :attr:`threading.Thread.name`." + +#: ../../deprecations/pending-removal-in-future.rst:117 +msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." +msgstr "" +":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." + +#: ../../deprecations/pending-removal-in-future.rst:118 +msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." +msgstr ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." + +#: ../../deprecations/pending-removal-in-future.rst:120 +msgid ":class:`typing.Text` (:gh:`92332`)." +msgstr ":class:`typing.Text` (:gh:`92332`)." + +#: ../../deprecations/pending-removal-in-future.rst:122 +msgid "" +":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " +"value that is not ``None`` from a test case." +msgstr "" +":class:`unittest.IsolatedAsyncioTestCase`: foi descontinuado retornar um " +"valor que não seja ``None`` de um caso de teste." + +#: ../../deprecations/pending-removal-in-future.rst:125 +msgid "" +":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " +"instead" +msgstr "" +"Funções descontinuadas de :mod:`urllib.parse`: use :func:`~urllib.parse." +"urlparse`" + +#: ../../deprecations/pending-removal-in-future.rst:127 +msgid "``splitattr()``" +msgstr "``splitattr()``" + +#: ../../deprecations/pending-removal-in-future.rst:128 +msgid "``splithost()``" +msgstr "``splithost()``" + +#: ../../deprecations/pending-removal-in-future.rst:129 +msgid "``splitnport()``" +msgstr "``splitnport()``" + +#: ../../deprecations/pending-removal-in-future.rst:130 +msgid "``splitpasswd()``" +msgstr "``splitpasswd()``" + +#: ../../deprecations/pending-removal-in-future.rst:131 +msgid "``splitport()``" +msgstr "``splitport()``" + +#: ../../deprecations/pending-removal-in-future.rst:132 +msgid "``splitquery()``" +msgstr "``splitquery()``" + +#: ../../deprecations/pending-removal-in-future.rst:133 +msgid "``splittag()``" +msgstr "``splittag()``" + +#: ../../deprecations/pending-removal-in-future.rst:134 +msgid "``splittype()``" +msgstr "``splittype()``" + +#: ../../deprecations/pending-removal-in-future.rst:135 +msgid "``splituser()``" +msgstr "``splituser()``" + +#: ../../deprecations/pending-removal-in-future.rst:136 +msgid "``splitvalue()``" +msgstr "``splitvalue()``" + +#: ../../deprecations/pending-removal-in-future.rst:137 +msgid "``to_bytes()``" +msgstr "``to_bytes()``" + +#: ../../deprecations/pending-removal-in-future.rst:139 +msgid "" +":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" +"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " +"Use newer :func:`~urllib.request.urlopen` functions and methods." +msgstr "" +":mod:`urllib.request`: O estilo de :class:`~urllib.request.URLopener` e :" +"class:`~urllib.request.FancyURLopener` de invocar solicitações foi " +"descontinuado. Use as mais novas funções e métodos :func:`~urllib.request." +"urlopen`." + +#: ../../deprecations/pending-removal-in-future.rst:143 +msgid "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " +"writes." +msgstr "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` não deve fazer gravações " +"parciais." + +#: ../../deprecations/pending-removal-in-future.rst:146 +msgid "" +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." +msgstr "" +":mod:`xml.etree.ElementTree`: testar o valor verdade de um :class:`~xml." +"etree.ElementTree.Element` está descontinuado. Em um lançamento futuro isso " +"sempre retornará ``True``. Em vez disso, prefira os testes explícitos " +"``len(elem)`` ou ``elem is not None``." + +#: ../../deprecations/pending-removal-in-future.rst:151 +msgid "" +":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" +"`~zipimport.zipimporter.exec_module` instead." +msgstr "" +":meth:`zipimport.zipimporter.load_module` foi descontinuado: use :meth:" +"`~zipimport.zipimporter.exec_module`." + +#: ../../deprecations/index.rst:15 +msgid "C API Deprecations" +msgstr "Descontinuações na API C" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " +"(:pep:`699`; :gh:`101193`)." +msgstr "" +"O campo ``ma_version_tag`` em :c:type:`PyDictObject` para módulos de " +"extensão (:pep:`699`; :gh:`101193`)." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." +msgstr "" +"A criação de :c:data:`tipos imutáveis ` com bases " +"mutáveis (:gh:`95388`)." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:10 +msgid "" +"Functions to configure Python's initialization, deprecated in Python 3.11:" +msgstr "" +"Funções para configurar a inicialização do Python, descontinuadas no Python " +"3.11:" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:12 +msgid "``PySys_SetArgvEx()``: set :c:member:`PyConfig.argv` instead." +msgstr "``PySys_SetArgvEx()``: defina :c:member:`PyConfig.argv`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:13 +msgid "``PySys_SetArgv()``: set :c:member:`PyConfig.argv` instead." +msgstr "``PySys_SetArgv()``: defina :c:member:`PyConfig.argv`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:14 +msgid "``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead." +msgstr "``Py_SetProgramName()``: defina :c:member:`PyConfig.program_name`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:15 +msgid "``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead." +msgstr "``Py_SetPythonHome()``: defina :c:member:`PyConfig.home`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:17 +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:45 +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." +msgstr "" +"A API :c:func:`Py_InitializeFromConfig` deve ser usada com :c:type:" +"`PyConfig`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:20 +msgid "Global configuration variables:" +msgstr "Variáveis de configuração globais" + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:22 +msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug` instead." +msgstr ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:23 +msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose` instead." +msgstr ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:24 +msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet` instead." +msgstr ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:25 +msgid "" +":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive` instead." +msgstr ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:26 +msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect` instead." +msgstr ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:27 +msgid "" +":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level` " +"instead." +msgstr ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:28 +msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` instead." +msgstr ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import` ." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:29 +msgid "" +":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning` instead." +msgstr ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:30 +msgid "" +":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings` instead." +msgstr ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:31 +msgid "" +":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment` " +"instead." +msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:32 +msgid "" +":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode` " +"instead." +msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:33 +msgid "" +":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +"user_site_directory` instead." +msgstr "" +":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig." +"user_site_directory`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:34 +msgid "" +":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio` " +"instead." +msgstr "" +":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:35 +msgid "" +":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " +"and :c:member:`PyConfig.hash_seed` instead." +msgstr "" +":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` e :" +"c:member:`PyConfig.hash_seed`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:37 +msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated` instead." +msgstr ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:38 +msgid "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` instead." +msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:39 +msgid "" +":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +"legacy_windows_stdio` instead." +msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +"legacy_windows_stdio`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:40 +msgid "" +":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:41 +msgid "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding` instead." +msgstr "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:42 +msgid "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +"filesystem_errors` instead." +msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +"filesystem_errors`." + +#: ../../deprecations/c-api-pending-removal-in-3.14.rst:43 +msgid "" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` instead. (see :" +"c:func:`Py_PreInitialize`)" +msgstr "" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode`. (veja :c:func:" +"`Py_PreInitialize`)" + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 +msgid "The bundled copy of ``libmpdecimal``." +msgstr "A cópia empacotada do ``libmpdecimal``." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 +msgid "" +":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule` " +"instead." +msgstr "" +":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 +msgid "" +":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`!PyWeakref_GetRef` instead." +msgstr ":c:func:`PyWeakref_GET_OBJECT`: use :c:func:`!PyWeakref_GetRef`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 +msgid ":c:func:`PyWeakref_GetObject`: use :c:func:`!PyWeakref_GetRef` instead." +msgstr ":c:func:`PyWeakref_GetObject`: use :c:func:`!PyWeakref_GetRef`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:8 +msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t` instead." +msgstr "O tipo :c:type:`!Py_UNICODE_WIDE`: use :c:type:`wchar_t`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:9 +msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t` instead." +msgstr "O tipo :c:type:`Py_UNICODE`: use :c:type:`wchar_t`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 +msgid "Python initialization functions:" +msgstr "Funções de inicialização do Python" + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 +msgid "" +":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +"warnings.filters` instead." +msgstr "" +":c:func:`PySys_ResetWarnOptions`: apague :data:`sys.warnoptions` e :data:`!" +"warnings.filters`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:14 +msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix` instead." +msgstr ":c:func:`Py_GetExecPrefix`: obtenha :data:`sys.exec_prefix`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 +msgid ":c:func:`Py_GetPath`: get :data:`sys.path` instead." +msgstr ":c:func:`Py_GetPath`: obtenha :data:`sys.path`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:16 +msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix` instead." +msgstr ":c:func:`Py_GetPrefix`: obtenha :data:`sys.prefix`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 +msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable` instead." +msgstr ":c:func:`Py_GetProgramFullPath`: obtenha :data:`sys.executable`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 +msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable` instead." +msgstr ":c:func:`Py_GetProgramName`: obtenha :data:`sys.executable`." + +#: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 +msgid "" +":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable instead." +msgstr "" +":c:func:`Py_GetPythonHome`: obtenha :c:member:`PyConfig.home` ou a variável " +"de ambiente :envvar:`PYTHONHOME`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:4 +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." +msgstr "" +"As APIs a seguir foram descontinuado e serão removidas, embora atualmente " +"não haja uma data agendada para sua remoção." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:7 +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8." +msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: desnecessária desde o Python 3.8." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:8 +msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException` instead." +msgstr ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:9 +msgid "" +":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException` " +"instead." +msgstr "" +":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:10 +msgid "" +":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException` instead." +msgstr ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:11 +msgid "" +":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject` " +"instead." +msgstr "" +":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:12 +msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child` instead." +msgstr ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:13 +msgid "" +":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." +msgstr "" +":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` e :c:func:" +"`PySlice_AdjustIndices`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:14 +msgid "" +":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode` instead." +msgstr ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:15 +msgid "" +":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode` instead." +msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:16 +msgid "" +":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode` instead." +msgstr ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:17 +msgid "" +":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode` instead." +msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:18 +msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +msgstr ":c:func:`PyUnicode_READY`: desnecessário desde o Python 3.12" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:19 +msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException` instead." +msgstr ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:20 +msgid "" +":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1`` instead." +msgstr ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:21 +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead." +msgstr "" +"O membro :c:member:`!PyBytesObject.ob_shash`: chame :c:func:`PyObject_Hash`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:23 +msgid ":c:member:`!PyDictObject.ma_version_tag` member." +msgstr "O membro :c:member:`!PyDictObject.ma_version_tag`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:24 +msgid "Thread Local Storage (TLS) API:" +msgstr "API do Thread Local Storage (TLS):" + +#: ../../deprecations/c-api-pending-removal-in-future.rst:26 +msgid "" +":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc` instead." +msgstr ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:27 +msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free` instead." +msgstr ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:28 +msgid "" +":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set` instead." +msgstr ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:29 +msgid "" +":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get` instead." +msgstr ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:30 +msgid "" +":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete` " +"instead." +msgstr "" +":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`." + +#: ../../deprecations/c-api-pending-removal-in-future.rst:31 +msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7." +msgstr ":c:func:`PyThread_ReInitTLS`: desnecessário desde o Python 3.7." diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po new file mode 100644 index 000000000..e9bb41f70 --- /dev/null +++ b/deprecations/pending-removal-in-3.13.po @@ -0,0 +1,195 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-07-26 14:50+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/pending-removal-in-3.13.rst:2 +msgid "Pending Removal in Python 3.13" +msgstr "Remoção pendente no Python 3.13" + +#: ../../deprecations/pending-removal-in-3.13.rst:4 +msgid "Modules (see :pep:`594`):" +msgstr "Módulos (veja :pep:`594`):" + +#: ../../deprecations/pending-removal-in-3.13.rst:6 +msgid ":mod:`aifc`" +msgstr ":mod:`aifc`" + +#: ../../deprecations/pending-removal-in-3.13.rst:7 +msgid ":mod:`audioop`" +msgstr ":mod:`audioop`" + +#: ../../deprecations/pending-removal-in-3.13.rst:8 +msgid ":mod:`cgi`" +msgstr ":mod:`cgi`" + +#: ../../deprecations/pending-removal-in-3.13.rst:9 +msgid ":mod:`cgitb`" +msgstr ":mod:`cgitb`" + +#: ../../deprecations/pending-removal-in-3.13.rst:10 +msgid ":mod:`chunk`" +msgstr ":mod:`chunk`" + +#: ../../deprecations/pending-removal-in-3.13.rst:11 +msgid ":mod:`crypt`" +msgstr ":mod:`crypt`" + +#: ../../deprecations/pending-removal-in-3.13.rst:12 +msgid ":mod:`imghdr`" +msgstr ":mod:`imghdr`" + +#: ../../deprecations/pending-removal-in-3.13.rst:13 +msgid ":mod:`mailcap`" +msgstr ":mod:`mailcap`" + +#: ../../deprecations/pending-removal-in-3.13.rst:14 +msgid ":mod:`msilib`" +msgstr ":mod:`msilib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:15 +msgid ":mod:`nis`" +msgstr ":mod:`nis`" + +#: ../../deprecations/pending-removal-in-3.13.rst:16 +msgid ":mod:`nntplib`" +msgstr ":mod:`nntplib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:17 +msgid ":mod:`ossaudiodev`" +msgstr ":mod:`ossaudiodev`" + +#: ../../deprecations/pending-removal-in-3.13.rst:18 +msgid ":mod:`pipes`" +msgstr ":mod:`pipes`" + +#: ../../deprecations/pending-removal-in-3.13.rst:19 +msgid ":mod:`sndhdr`" +msgstr ":mod:`sndhdr`" + +#: ../../deprecations/pending-removal-in-3.13.rst:20 +msgid ":mod:`spwd`" +msgstr ":mod:`spwd`" + +#: ../../deprecations/pending-removal-in-3.13.rst:21 +msgid ":mod:`sunau`" +msgstr ":mod:`sunau`" + +#: ../../deprecations/pending-removal-in-3.13.rst:22 +msgid ":mod:`telnetlib`" +msgstr ":mod:`telnetlib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:23 +msgid ":mod:`uu`" +msgstr ":mod:`uu`" + +#: ../../deprecations/pending-removal-in-3.13.rst:24 +msgid ":mod:`xdrlib`" +msgstr ":mod:`xdrlib`" + +#: ../../deprecations/pending-removal-in-3.13.rst:26 +msgid "Other modules:" +msgstr "Outros módulos:" + +#: ../../deprecations/pending-removal-in-3.13.rst:28 +msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" +msgstr ":mod:`!lib2to3` e o programa :program:`2to3` (:gh:`84540`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:30 +msgid "APIs:" +msgstr "APIs:" + +#: ../../deprecations/pending-removal-in-3.13.rst:32 +msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" +msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:33 +msgid "``locale.resetlocale()`` (:gh:`90817`)" +msgstr "``locale.resetlocale()`` (:gh:`90817`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:34 +msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" +msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:35 +msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" +msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:36 +msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" +msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:37 +msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" +msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:38 +msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" +msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:39 +msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" +msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:40 +msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" +msgstr "Encadeamento do descritor de :class:`classmethod` (:gh:`89519`)" + +#: ../../deprecations/pending-removal-in-3.13.rst:41 +msgid ":mod:`importlib.resources` deprecated methods:" +msgstr "Métodos descontinuados de :mod:`importlib.resources`:" + +#: ../../deprecations/pending-removal-in-3.13.rst:43 +msgid "``contents()``" +msgstr "``contents()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:44 +msgid "``is_resource()``" +msgstr "``is_resource()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:45 +msgid "``open_binary()``" +msgstr "``open_binary()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:46 +msgid "``open_text()``" +msgstr "``open_text()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:47 +msgid "``path()``" +msgstr "``path()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:48 +msgid "``read_binary()``" +msgstr "``read_binary()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:49 +msgid "``read_text()``" +msgstr "``read_text()``" + +#: ../../deprecations/pending-removal-in-3.13.rst:51 +msgid "" +"Use :func:`importlib.resources.files` instead. Refer to `importlib-" +"resources: Migrating from Legacy `_ (:gh:`106531`)" +msgstr "" diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po new file mode 100644 index 000000000..06cff428e --- /dev/null +++ b/deprecations/pending-removal-in-3.14.po @@ -0,0 +1,296 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-07-26 14:50+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/pending-removal-in-3.14.rst:2 +msgid "Pending Removal in Python 3.14" +msgstr "Remoção pendente no Python 3.14" + +#: ../../deprecations/pending-removal-in-3.14.rst:4 +msgid "" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" +":mod:`argparse`: Os parâmetros *type*, *choices* e *metavar* de :class:`!" +"argparse.BooleanOptionalAction` foram descontinuados e serão removidos na " +"versão 3.14. (Contribuição de Nikita Sobolev em :gh:`92248`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:9 +msgid "" +":mod:`ast`: The following features have been deprecated in documentation " +"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " +"runtime when they are accessed or used, and will be removed in Python 3.14:" +msgstr "" +":mod:`ast`: Os seguintes recursos foram descontinuados na documentação desde " +"Python 3.8, agora fazem com que um :exc:`DeprecationWarning` seja emitido em " +"tempo de execução quando eles são acessados ou usados, e serão removidos no " +"Python 3.14:" + +#: ../../deprecations/pending-removal-in-3.14.rst:13 +msgid ":class:`!ast.Num`" +msgstr ":class:`!ast.Num`" + +#: ../../deprecations/pending-removal-in-3.14.rst:14 +msgid ":class:`!ast.Str`" +msgstr ":class:`!ast.Str`" + +#: ../../deprecations/pending-removal-in-3.14.rst:15 +msgid ":class:`!ast.Bytes`" +msgstr ":class:`!ast.Bytes`" + +#: ../../deprecations/pending-removal-in-3.14.rst:16 +msgid ":class:`!ast.NameConstant`" +msgstr ":class:`!ast.NameConstant`" + +#: ../../deprecations/pending-removal-in-3.14.rst:17 +msgid ":class:`!ast.Ellipsis`" +msgstr ":class:`!ast.Ellipsis`" + +#: ../../deprecations/pending-removal-in-3.14.rst:19 +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" +"Usa :class:`ast.Constant` em vez disso. (Contribuição de Serhiy Storchaka " +"em :gh:`90953`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:22 +msgid ":mod:`asyncio`:" +msgstr ":mod:`asyncio`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:24 +msgid "" +"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" +"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" +"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " +"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" +"As classes filhas do observador :class:`~asyncio.MultiLoopChildWatcher`, :" +"class:`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` e :" +"class:`~asyncio.SafeChildWatcher` foram descontinuadas e serão removidas no " +"Python 3.14. (Contribuição de Kumar Aditya em :gh:`94597`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:30 +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +msgstr "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` e :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` foram descontinuados e serão " +"removidos no Python 3.14. (Contribuição de Kumar Aditya em :gh:`94597`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:36 +msgid "" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" +msgstr "" +"O método :meth:`~asyncio.get_event_loop` da política de laço de eventos " +"padrão agora emite um :exc:`DeprecationWarning` se não houver nenhum laço de " +"eventos atual definido e decidir criar um. (Contribuição de Serhiy Storchaka " +"e Guido van Rossum em :gh:`100160`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:41 +msgid "" +":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " +"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +msgstr "" +":mod:`collections.abc`: :class:`~collections.abc.ByteString` foi " +"descontinuado. Prefira :class:`!Sequence` ou :class:`~collections.abc." +"Buffer` Para uso em tipagem, prefira uma união, como ``bytes | bytearray`` " +"ou :class:`collections.abc.Buffer`. (Contribuição de Shantanu Jain em :gh:" +"`91896`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:47 +msgid "" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" +msgstr "" +":mod:`email`: Descontinua o parâmetro *isdst* em :func:`email.utils." +"localtime`. (Contribuição de Alan Williams em :gh:`72346`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:50 +msgid "" +":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " +"taken into consideration by the import system (:gh:`97879`)." +msgstr "" +":mod:`importlib`: ``__package__`` e ``__cached__`` deixarão de ser definidos " +"ou levados em consideração pelo sistema de importação (:gh:`97879`)." + +#: ../../deprecations/pending-removal-in-3.14.rst:53 +msgid ":mod:`importlib.abc` deprecated classes:" +msgstr ":mod:`importlib.abc` descontinuou as classes:" + +#: ../../deprecations/pending-removal-in-3.14.rst:55 +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr ":class:`!importlib.abc.ResourceReader`" + +#: ../../deprecations/pending-removal-in-3.14.rst:56 +msgid ":class:`!importlib.abc.Traversable`" +msgstr ":class:`!importlib.abc.Traversable`" + +#: ../../deprecations/pending-removal-in-3.14.rst:57 +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr ":class:`!importlib.abc.TraversableResources`" + +#: ../../deprecations/pending-removal-in-3.14.rst:59 +msgid "Use :mod:`importlib.resources.abc` classes instead:" +msgstr "Em vez disso, use classes :mod:`importlib.resources.abc`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:61 +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr ":class:`importlib.resources.abc.Traversable`" + +#: ../../deprecations/pending-removal-in-3.14.rst:62 +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr ":class:`importlib.resources.abc.TraversableResources`" + +#: ../../deprecations/pending-removal-in-3.14.rst:64 +msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" +msgstr "(Contribuição de Jason R. Coombs e Hugo van Kemenade em :gh:`93963`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:66 +msgid "" +":mod:`itertools` had undocumented, inefficient, historically buggy, and " +"inconsistent support for copy, deepcopy, and pickle operations. This will be " +"removed in 3.14 for a significant reduction in code volume and maintenance " +"burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" +msgstr "" +":mod:`itertools` tinha suporte não documentado, ineficiente, historicamente " +"cheio de bugs e inconsistente para operações de cópia, cópia profunda e " +"serialização com pickle. Isso será removido na versão 3.14 para uma redução " +"significativa no volume de código e na carga de manutenção. (Contribuição de " +"Raymond Hettinger em :gh:`101588`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:72 +msgid "" +":mod:`multiprocessing`: The default start method will change to a safer one " +"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " +"currently the default (:gh:`84559`). Adding a runtime warning about this was " +"deemed too disruptive as the majority of code is not expected to care. Use " +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." +msgstr "" +":mod:`multiprocessing`: O método de inicialização padrão será alterado para " +"um mais seguro no Linux, BSDs e outras plataformas POSIX não-macOS onde " +"``'fork'`` é atualmente o padrão (:gh:`84559`). Adicionar um aviso de tempo " +"de execução sobre isso foi considerado muito perturbador, pois não se espera " +"que a maior parte do código se importe. Use as APIs :func:`~multiprocessing." +"get_context` ou :func:`~multiprocessing.set_start_method` para especificar " +"explicitamente quando seu código *requer* ``'fork'``. Veja :ref:" +"`multiprocessing-start-methods`." + +#: ../../deprecations/pending-removal-in-3.14.rst:80 +msgid "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." +"PurePath.relative_to`: passing additional arguments is deprecated." +msgstr "" +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` e :meth:`~pathlib." +"PurePath.relative_to`: passar argumentos adicionais foi descontinuado." + +#: ../../deprecations/pending-removal-in-3.14.rst:84 +msgid "" +":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " +"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " +"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +msgstr "" +":mod:`pkgutil`: :func:`~pkgutil.find_loader` e :func:`~pkgutil.get_loader` " +"agora levantam :exc:`DeprecationWarning`; use :func:`importlib.util." +"find_spec` em vez disto. (Contribuição de Nikita Sobolev em :gh:`97850`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:89 +msgid ":mod:`pty`:" +msgstr ":mod:`pty`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:91 +msgid "``master_open()``: use :func:`pty.openpty`." +msgstr "``master_open()``: use :func:`pty.openpty`." + +#: ../../deprecations/pending-removal-in-3.14.rst:92 +msgid "``slave_open()``: use :func:`pty.openpty`." +msgstr "``slave_open()``: use :func:`pty.openpty`." + +#: ../../deprecations/pending-removal-in-3.14.rst:94 +msgid ":mod:`sqlite3`:" +msgstr ":mod:`sqlite3`:" + +#: ../../deprecations/pending-removal-in-3.14.rst:96 +msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." +msgstr ":data:`~sqlite3.version` e :data:`~sqlite3.version_info`." + +#: ../../deprecations/pending-removal-in-3.14.rst:98 +msgid "" +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" +"ref:`named placeholders ` are used and *parameters* is " +"a sequence instead of a :class:`dict`." +msgstr "" +":meth:`~sqlite3.Cursor.execute` e :meth:`~sqlite3.Cursor.executemany` se :" +"ref:`espaços reservados nomeados ` forem usados ​​e " +"*parameters* for uma sequência em vez de um :class:`dict` ." + +#: ../../deprecations/pending-removal-in-3.14.rst:102 +msgid "" +"date and datetime adapter, date and timestamp converter: see the :mod:" +"`sqlite3` documentation for suggested replacement recipes." +msgstr "" +"adaptador de data e hora, conversor de registro de data e hora: veja a " +"documentação de :mod:`sqlite3` para receitas de substituição sugeridas." + +#: ../../deprecations/pending-removal-in-3.14.rst:105 +msgid "" +":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " +"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " +"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " +"in 3.14. (Contributed by Nikita Sobolev in :gh:`101866`.)" +msgstr "" +":class:`types.CodeType`: O acesso a :attr:`~codeobject.co_lnotab` foi " +"descontinuado na :pep:`626` desde 3.10 e foi planejado para ser removido em " +"3.12, mas só recebeu uma :exc:`DeprecationWarning` adequada em 3.12. Pode " +"ser removido em 3.14. (Contribuição de Nikita Sobolev em :gh:`101866`.)" + +#: ../../deprecations/pending-removal-in-3.14.rst:112 +msgid "" +":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " +"causes a :exc:`DeprecationWarning` to be emitted when it is used." +msgstr "" +":mod:`typing`: :class:`~typing.ByteString`, descontinuado desde Python 3.9, " +"agora faz com que uma :exc:`DeprecationWarning` seja emitida quando é usado." + +#: ../../deprecations/pending-removal-in-3.14.rst:115 +msgid "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " +"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" +"`88168`.)" +msgstr "" +":mod:`urllib`: :class:`!urllib.parse.Quoter` está obsoleto: não foi " +"planejado para ser uma API pública. (Contribuição de Gregory P. Smith em :gh:" +"`88168`.)" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po new file mode 100644 index 000000000..121ffc68f --- /dev/null +++ b/deprecations/pending-removal-in-3.15.po @@ -0,0 +1,148 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-07-26 14:50+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/pending-removal-in-3.15.rst:2 +msgid "Pending Removal in Python 3.15" +msgstr "Remoção pendente no Python 3.15" + +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "" +":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " +"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " +"rarely used. No direct replacement exists. *Anything* is better than CGI " +"to interface a web server with a request handler." +msgstr "" +":class:`http.server.CGIHTTPRequestHandler` será removido junto com seu " +"sinalizador relacionado ``--cgi`` para ``python -m http.server``. Estava " +"descontinuado e raramente usado. Não existe substituição direta. *Qualquer " +"coisa* é melhor que CGI para fazer a interface de um servidor web com um " +"manipulador de solicitações." + +#: ../../deprecations/pending-removal-in-3.15.rst:9 +msgid "" +":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " +"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " +"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" +"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " +"by Hugo van Kemenade in :gh:`111187`.)" +msgstr "" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 +msgid "" +":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " +"scheduled for removal in Python 3.15. From Python 3.13 onwards, use ``os." +"path.isreserved`` to detect reserved paths on Windows." +msgstr "" +":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` está descontinuado e " +"programado para remoção no Python 3.15. Do Python 3.13 em diante, use ``os." +"path.isreserved`` para detectar caminhos reservados no Windows." + +#: ../../deprecations/pending-removal-in-3.15.rst:21 +msgid "" +":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " +"removed in 3.15. It was largely untested, had a confusing API, and was only " +"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +msgstr "" +":mod:`platform`: :func:`~platform.java_ver` está descontinuada e será " +"removida na versão 3.15. Ela não foi testada em grande parte, tinha uma API " +"confusa e só era útil para suporte a Jython. (Contribuição de Nikita Sobolev " +"em :gh:`116349`.)" + +#: ../../deprecations/pending-removal-in-3.15.rst:27 +msgid "" +":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " +"deprecated. C version allows any numbers of args and kwargs, but they are " +"just ignored. Python version does not allow any arguments. All arguments " +"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " +"Nikita Sobolev in :gh:`102029`.)" +msgstr "" +":mod:`threading`: Passar qualquer argumento para :func:`threading.RLock` " +"agora está descontinuado. A versão C permite qualquer número de args e " +"kwargs, mas eles são simplesmente ignorados. A versão Python não permite " +"nenhum argumento. Todos os argumentos serão removidos de :func:`threading." +"RLock` no Python 3.15. (Contribuição de Nikita Sobolev em :gh:`102029`.)" + +#: ../../deprecations/pending-removal-in-3.15.rst:34 +msgid ":class:`typing.NamedTuple`:" +msgstr ":class:`typing.NamedTuple`:" + +#: ../../deprecations/pending-removal-in-3.15.rst:36 +msgid "" +"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " +"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " +"disallowed in 3.15. Use the class-based syntax or the functional syntax " +"instead." +msgstr "" +"A sintaxe de argumento nomeado não documentada para criar classes :class:`!" +"NamedTuple` (``NT = NamedTuple(\"NT\", x=int)``) está descontinuada e não " +"será permitida em 3.15. Use a sintaxe baseada em classe ou a sintaxe " +"funcional." + +#: ../../deprecations/pending-removal-in-3.15.rst:40 +msgid "" +"When using the functional syntax to create a :class:`!NamedTuple` class, " +"failing to pass a value to the *fields* parameter (``NT = " +"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " +"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " +"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " +"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " +"[])``." +msgstr "" +"Ao usar a sintaxe funcional para criar uma classe :class:`!NamedTuple`, " +"falhar ao passar um valor para o parâmetro *fields* (``NT = " +"NamedTuple(\"NT\")``) está descontinuada. Passar ``None`` para o parâmetro " +"*fields* (``NT = NamedTuple(\"NT\", None)``) também está descontinuada. " +"Ambos não serão permitidos no Python 3.15. Para criar uma classe :class:`!" +"NamedTuple` com 0 campos, use ``class NT(NamedTuple): pass`` ou ``NT = " +"NamedTuple(\"NT\", [])``." + +#: ../../deprecations/pending-removal-in-3.15.rst:47 +msgid "" +":class:`typing.TypedDict`: When using the functional syntax to create a :" +"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " +"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " +"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " +"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " +"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." +msgstr "" +":class:`typing.TypedDict`: Ao usar a sintaxe funcional para criar uma " +"classe :class:`!TypedDict`, falhar ao passar um valor para o parâmetro " +"*fields* (``TD = TypedDict(\"TD\")``) está descontinuada. Passar ``None`` " +"para o parâmetro *fields* (``TD = TypedDict(\"TD\", None)``) também está " +"descontinuada. Ambos não serão permitidos no Python 3.15. Para criar uma " +"classe :class:`!TypedDict` com 0 campos, use ``class TD(TypedDict): pass`` " +"ou ``TD = TypedDict(\"TD\", {})``." + +#: ../../deprecations/pending-removal-in-3.15.rst:54 +msgid "" +":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " +"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " +"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" +"`105096`.)" +msgstr "" +":mod:`wave`: Descontinua os métodos ``getmark()``, ``setmark()`` e " +"``getmarkers()`` das classes :class:`wave.Wave_read` e :class:`wave." +"Wave_write`. Eles serão removidos no Python 3.15. (Contribuição de Victor " +"Stinner em :gh:`105096`.)" diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po new file mode 100644 index 000000000..2b6477c8f --- /dev/null +++ b/deprecations/pending-removal-in-3.16.po @@ -0,0 +1,48 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-07-26 14:50+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/pending-removal-in-3.16.rst:2 +msgid "Pending Removal in Python 3.16" +msgstr "Remoção pendente no Python 3.16" + +#: ../../deprecations/pending-removal-in-3.16.rst:4 +msgid "" +":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " +"``'w'`` type instead (``Py_UCS4``)." +msgstr "" +":mod:`array`: :class:`array.array`: tipo ``'u'`` (:c:type:`wchar_t`): use o " +"tipo ``'w'`` (``Py_UCS4``)." + +#: ../../deprecations/pending-removal-in-3.16.rst:8 +msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +msgstr ":mod:`builtins`: ``~bool``, inversão bit a bit em booleanos." + +#: ../../deprecations/pending-removal-in-3.16.rst:11 +msgid "" +":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " +"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +msgstr "" +":mod:`symtable`: Descontinua :meth:`symtable.Class.get_methods` por falta de " +"interesse. (Contribuição de Bénédikt Tran em :gh:`119698`.)" diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po new file mode 100644 index 000000000..4cc2d3895 --- /dev/null +++ b/deprecations/pending-removal-in-future.po @@ -0,0 +1,460 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# Rafael Fontenelle , 2024 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-30 14:55+0000\n" +"PO-Revision-Date: 2024-07-26 14:50+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" +"teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " +"1000000 == 0 ? 1 : 2;\n" + +#: ../../deprecations/pending-removal-in-future.rst:2 +msgid "Pending Removal in Future Versions" +msgstr "Remoção pendente em versões futuras" + +#: ../../deprecations/pending-removal-in-future.rst:4 +msgid "" +"The following APIs will be removed in the future, although there is " +"currently no date scheduled for their removal." +msgstr "" +"As APIs a seguir serão removidas no futuro, embora atualmente não haja uma " +"data agendada para sua remoção." + +#: ../../deprecations/pending-removal-in-future.rst:7 +msgid "" +":mod:`argparse`: Nesting argument groups and nesting mutually exclusive " +"groups are deprecated." +msgstr "" +":mod:`argparse`: O aninhamento de grupos de argumentos e o aninhamento de " +"grupos mutuamente exclusivos estão descontinuados." + +#: ../../deprecations/pending-removal-in-future.rst:10 +msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" +msgstr "código de formatação ``'u'`` do :mod:`array` (:gh:`57281`)" + +#: ../../deprecations/pending-removal-in-future.rst:12 +msgid ":mod:`builtins`:" +msgstr ":mod:`builtins`:" + +#: ../../deprecations/pending-removal-in-future.rst:14 +msgid "``bool(NotImplemented)``." +msgstr "``bool(NotImplemented)``." + +#: ../../deprecations/pending-removal-in-future.rst:15 +msgid "" +"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " +"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " +"argument signature." +msgstr "" +"Geradores: A assinatura ``throw(type, exc, tb)`` e ``athrow(type, exc, tb)`` " +"está descontinuada: use ``throw(exc)`` e ``athrow(exc)``, a assinatura do " +"argumento único." + +#: ../../deprecations/pending-removal-in-future.rst:18 +msgid "" +"Currently Python accepts numeric literals immediately followed by keywords, " +"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " +"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " +"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" +msgstr "" +"Atualmente Python aceita literais numéricos imediatamente seguidos por " +"palavras reservadas como, por exemplo, ``0in x``, ``1or x``, ``0if 1else " +"2``. Ele permite expressões confusas e ambíguas como ``[0x1for x in y]`` " +"(que pode ser interpretada como ``[0x1 for x in y]`` ou ``[0x1f or x in " +"y]``). Um aviso de sintaxe é levantado se o literal numérico for " +"imediatamente seguido por uma das palavras reservadas :keyword:`and`, :" +"keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in` , :keyword:`is` " +"e :keyword:`or`. Em uma versão futura, será alterado para um erro de " +"sintaxe. (:gh:`87999`)" + +#: ../../deprecations/pending-removal-in-future.rst:26 +msgid "" +"Support for ``__index__()`` and ``__int__()`` method returning non-int type: " +"these methods will be required to return an instance of a strict subclass " +"of :class:`int`." +msgstr "" +"Suporte para métodos ``__index__()`` e ``__int__()`` retornando tipo não-" +"int: esses métodos serão necessários para retornar uma instância de uma " +"subclasse estrita de :class:`int`." + +#: ../../deprecations/pending-removal-in-future.rst:29 +msgid "" +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." +msgstr "" +"Suporte para o método ``__float__()`` retornando uma subclasse estrita de :" +"class:`float`: esses métodos serão necessários para retornar uma instância " +"de :class:`float`." + +#: ../../deprecations/pending-removal-in-future.rst:32 +msgid "" +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." +msgstr "" +"Suporte para o método ``__complex__()`` retornando uma subclasse estrita de :" +"class:`complex`: esses métodos serão necessários para retornar uma instância " +"de :class:`complex`." + +#: ../../deprecations/pending-removal-in-future.rst:35 +msgid "Delegation of ``int()`` to ``__trunc__()`` method." +msgstr "Delegação do método ``int()`` para o ``__trunc__()``." + +#: ../../deprecations/pending-removal-in-future.rst:36 +msgid "" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" +msgstr "" +"Passar um número complexo como argumento *real* ou *imag* no construtor :" +"func:`complex` agora está descontinuado; deve ser passado apenas como um " +"único argumento posicional. (Contribuição de Serhiy Storchaka em :gh:" +"`109218`.)" + +#: ../../deprecations/pending-removal-in-future.rst:41 +msgid "" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +msgstr "" +":mod:`calendar`: As constantes ``calendar.January`` e ``calendar.February`` " +"foram descontinuadas e substituídas por :data:`calendar.JANUARY` e :data:" +"`calendar.FEBRUARY`. (Contribuição de Prince Roshan em :gh:`103636`.)" + +#: ../../deprecations/pending-removal-in-future.rst:46 +msgid "" +":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " +"instead." +msgstr "" +":attr:`codeobject.co_lnotab`: use o método :meth:`codeobject.co_lines`." + +#: ../../deprecations/pending-removal-in-future.rst:49 +msgid ":mod:`datetime`:" +msgstr ":mod:`datetime`:" + +#: ../../deprecations/pending-removal-in-future.rst:51 +msgid "" +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." +msgstr "" +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." + +#: ../../deprecations/pending-removal-in-future.rst:53 +msgid "" +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." +msgstr "" +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." + +#: ../../deprecations/pending-removal-in-future.rst:56 +msgid ":mod:`gettext`: Plural value must be an integer." +msgstr ":mod:`gettext`: O valor de plural deve ser um número inteiro." + +#: ../../deprecations/pending-removal-in-future.rst:58 +msgid ":mod:`importlib`:" +msgstr ":mod:`importlib`:" + +#: ../../deprecations/pending-removal-in-future.rst:60 +msgid "``load_module()`` method: use ``exec_module()`` instead." +msgstr "Método ``load_module()``: use ``exec_module()`` em vez disso." + +#: ../../deprecations/pending-removal-in-future.rst:61 +msgid "" +":func:`~importlib.util.cache_from_source` *debug_override* parameter is " +"deprecated: use the *optimization* parameter instead." +msgstr "" +"O parâmetro *debug_override* de :func:`~importlib.util.cache_from_source` " +"foi descontinuado: em vez disso, use o parâmetro *optimization*." + +#: ../../deprecations/pending-removal-in-future.rst:64 +msgid ":mod:`importlib.metadata`:" +msgstr ":mod:`importlib.metadata`:" + +#: ../../deprecations/pending-removal-in-future.rst:66 +msgid "``EntryPoints`` tuple interface." +msgstr "Interface de tupla ``EntryPoints``." + +#: ../../deprecations/pending-removal-in-future.rst:67 +msgid "Implicit ``None`` on return values." +msgstr "``None`` implícito nos valores de retorno." + +#: ../../deprecations/pending-removal-in-future.rst:69 +msgid "" +":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " +"BytesIO and binary mode instead." +msgstr "" +":mod:`mailbox`: O uso da entrada StringIO e do modo de texto foi " +"descontinuado; em vez disso, use BytesIO e o modo binário." + +#: ../../deprecations/pending-removal-in-future.rst:72 +msgid "" +":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." +msgstr ":mod:`os`: Chamar :func:`os.register_at_fork` em processo multithread." + +#: ../../deprecations/pending-removal-in-future.rst:74 +msgid "" +":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " +"deprecated, use an exception instance." +msgstr "" +":class:`!pydoc.ErrorDuringImport`: Um valor de tupla para o parâmetro " +"*exc_info* foi descontinuado, use uma instância de exceção." + +#: ../../deprecations/pending-removal-in-future.rst:77 +msgid "" +":mod:`re`: More strict rules are now applied for numerical group references " +"and group names in regular expressions. Only sequence of ASCII digits is " +"now accepted as a numerical reference. The group name in bytes patterns and " +"replacement strings can now only contain ASCII letters and digits and " +"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" +msgstr "" +":mod:`re`: Regras mais rigorosas agora são aplicadas para referências " +"numéricas de grupos e nomes de grupos em expressões regulares. Apenas a " +"sequência de dígitos ASCII agora é aceita como referência numérica. O nome " +"do grupo em padrões de bytes e strings de substituição agora pode conter " +"apenas letras e dígitos ASCII e sublinhado. (Contribuição de Serhiy " +"Storchaka em :gh:`91760`.)" + +#: ../../deprecations/pending-removal-in-future.rst:84 +msgid "" +":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." +msgstr "" +"Módulos :mod:`!sre_compile`, :mod:`!sre_constants` e :mod:`!sre_parse`." + +#: ../../deprecations/pending-removal-in-future.rst:86 +msgid "" +":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " +"Python 3.12; use the *onexc* parameter instead." +msgstr "" +":mod:`shutil`: O parâmetro *onerror* de :func:`~shutil.rmtree` foi " +"descontinuado no Python 3.12; use o parâmetro *onexc*." + +#: ../../deprecations/pending-removal-in-future.rst:89 +msgid ":mod:`ssl` options and protocols:" +msgstr "Protocolos e opções de :mod:`ssl`" + +#: ../../deprecations/pending-removal-in-future.rst:91 +msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." +msgstr ":class:`ssl.SSLContext` sem argumento de protocolo foi descontinuado." + +#: ../../deprecations/pending-removal-in-future.rst:92 +msgid "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." +msgstr "" +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` e :meth:`!" +"selected_npn_protocol` foram descontinuados: use ALPN." + +#: ../../deprecations/pending-removal-in-future.rst:95 +msgid "``ssl.OP_NO_SSL*`` options" +msgstr "Opções de ``ssl.OP_NO_SSL*``" + +#: ../../deprecations/pending-removal-in-future.rst:96 +msgid "``ssl.OP_NO_TLS*`` options" +msgstr "Opções de ``ssl.OP_NO_TLS*``" + +#: ../../deprecations/pending-removal-in-future.rst:97 +msgid "``ssl.PROTOCOL_SSLv3``" +msgstr "``ssl.PROTOCOL_SSLv3``" + +#: ../../deprecations/pending-removal-in-future.rst:98 +msgid "``ssl.PROTOCOL_TLS``" +msgstr "``ssl.PROTOCOL_TLS``" + +#: ../../deprecations/pending-removal-in-future.rst:99 +msgid "``ssl.PROTOCOL_TLSv1``" +msgstr "``ssl.PROTOCOL_TLSv1``" + +#: ../../deprecations/pending-removal-in-future.rst:100 +msgid "``ssl.PROTOCOL_TLSv1_1``" +msgstr "``ssl.PROTOCOL_TLSv1_1``" + +#: ../../deprecations/pending-removal-in-future.rst:101 +msgid "``ssl.PROTOCOL_TLSv1_2``" +msgstr "``ssl.PROTOCOL_TLSv1_2``" + +#: ../../deprecations/pending-removal-in-future.rst:102 +msgid "``ssl.TLSVersion.SSLv3``" +msgstr "``ssl.TLSVersion.SSLv3``" + +#: ../../deprecations/pending-removal-in-future.rst:103 +msgid "``ssl.TLSVersion.TLSv1``" +msgstr "``ssl.TLSVersion.TLSv1``" + +#: ../../deprecations/pending-removal-in-future.rst:104 +msgid "``ssl.TLSVersion.TLSv1_1``" +msgstr "``ssl.TLSVersion.TLSv1_1``" + +#: ../../deprecations/pending-removal-in-future.rst:106 +msgid "" +":func:`sysconfig.is_python_build` *check_home* parameter is deprecated and " +"ignored." +msgstr "" +"O parâmetro *check_home* de :func:`sysconfig.is_python_build` foi " +"descontinuado e é ignorado." + +#: ../../deprecations/pending-removal-in-future.rst:109 +msgid ":mod:`threading` methods:" +msgstr "Métodos de :mod:`threading`:" + +#: ../../deprecations/pending-removal-in-future.rst:111 +msgid "" +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." +msgstr "" +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." + +#: ../../deprecations/pending-removal-in-future.rst:112 +msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." +msgstr ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." + +#: ../../deprecations/pending-removal-in-future.rst:113 +msgid "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." +msgstr "" +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use " +"o atributo :attr:`threading.Thread.daemon`." + +#: ../../deprecations/pending-removal-in-future.rst:115 +msgid "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." +msgstr "" +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use o " +"atributo :attr:`threading.Thread.name`." + +#: ../../deprecations/pending-removal-in-future.rst:117 +msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." +msgstr "" +":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." + +#: ../../deprecations/pending-removal-in-future.rst:118 +msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." +msgstr ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." + +#: ../../deprecations/pending-removal-in-future.rst:120 +msgid ":class:`typing.Text` (:gh:`92332`)." +msgstr ":class:`typing.Text` (:gh:`92332`)." + +#: ../../deprecations/pending-removal-in-future.rst:122 +msgid "" +":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " +"value that is not ``None`` from a test case." +msgstr "" +":class:`unittest.IsolatedAsyncioTestCase`: foi descontinuado retornar um " +"valor que não seja ``None`` de um caso de teste." + +#: ../../deprecations/pending-removal-in-future.rst:125 +msgid "" +":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " +"instead" +msgstr "" +"Funções descontinuadas de :mod:`urllib.parse`: use :func:`~urllib.parse." +"urlparse`" + +#: ../../deprecations/pending-removal-in-future.rst:127 +msgid "``splitattr()``" +msgstr "``splitattr()``" + +#: ../../deprecations/pending-removal-in-future.rst:128 +msgid "``splithost()``" +msgstr "``splithost()``" + +#: ../../deprecations/pending-removal-in-future.rst:129 +msgid "``splitnport()``" +msgstr "``splitnport()``" + +#: ../../deprecations/pending-removal-in-future.rst:130 +msgid "``splitpasswd()``" +msgstr "``splitpasswd()``" + +#: ../../deprecations/pending-removal-in-future.rst:131 +msgid "``splitport()``" +msgstr "``splitport()``" + +#: ../../deprecations/pending-removal-in-future.rst:132 +msgid "``splitquery()``" +msgstr "``splitquery()``" + +#: ../../deprecations/pending-removal-in-future.rst:133 +msgid "``splittag()``" +msgstr "``splittag()``" + +#: ../../deprecations/pending-removal-in-future.rst:134 +msgid "``splittype()``" +msgstr "``splittype()``" + +#: ../../deprecations/pending-removal-in-future.rst:135 +msgid "``splituser()``" +msgstr "``splituser()``" + +#: ../../deprecations/pending-removal-in-future.rst:136 +msgid "``splitvalue()``" +msgstr "``splitvalue()``" + +#: ../../deprecations/pending-removal-in-future.rst:137 +msgid "``to_bytes()``" +msgstr "``to_bytes()``" + +#: ../../deprecations/pending-removal-in-future.rst:139 +msgid "" +":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" +"`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " +"Use newer :func:`~urllib.request.urlopen` functions and methods." +msgstr "" +":mod:`urllib.request`: O estilo de :class:`~urllib.request.URLopener` e :" +"class:`~urllib.request.FancyURLopener` de invocar solicitações foi " +"descontinuado. Use as mais novas funções e métodos :func:`~urllib.request." +"urlopen`." + +#: ../../deprecations/pending-removal-in-future.rst:143 +msgid "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " +"writes." +msgstr "" +":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` não deve fazer gravações " +"parciais." + +#: ../../deprecations/pending-removal-in-future.rst:146 +msgid "" +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." +msgstr "" +":mod:`xml.etree.ElementTree`: testar o valor verdade de um :class:`~xml." +"etree.ElementTree.Element` está descontinuado. Em um lançamento futuro isso " +"sempre retornará ``True``. Em vez disso, prefira os testes explícitos " +"``len(elem)`` ou ``elem is not None``." + +#: ../../deprecations/pending-removal-in-future.rst:151 +msgid "" +":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" +"`~zipimport.zipimporter.exec_module` instead." +msgstr "" +":meth:`zipimport.zipimporter.load_module` foi descontinuado: use :meth:" +"`~zipimport.zipimporter.exec_module`." diff --git a/distributing/index.po b/distributing/index.po index e26351a06..a47898cfb 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/building.po b/extending/building.po index 6c4d5627c..11ea0b3d2 100644 --- a/extending/building.po +++ b/extending/building.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -77,6 +77,16 @@ msgstr "" "codificação *punycode* do Python com hifenes substituídos por sublinhados. " "Em Python::" +#: ../../extending/building.rst:32 +msgid "" +"def initfunc_name(name):\n" +" try:\n" +" suffix = b'_' + name.encode('ascii')\n" +" except UnicodeEncodeError:\n" +" suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n" +" return b'PyInit' + suffix" +msgstr "" + #: ../../extending/building.rst:39 msgid "" "It is possible to export multiple modules from a single shared library by " diff --git a/extending/embedding.po b/extending/embedding.po index 641b06eb9..4e19fd364 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -93,6 +91,31 @@ msgid "" "used to perform some operation on a file. ::" msgstr "" +#: ../../extending/embedding.rst:56 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" wchar_t *program = Py_DecodeLocale(argv[0], NULL);\n" +" if (program == NULL) {\n" +" fprintf(stderr, \"Fatal error: cannot decode argv[0]\\n\");\n" +" exit(1);\n" +" }\n" +" Py_SetProgramName(program); /* optional but recommended */\n" +" Py_Initialize();\n" +" PyRun_SimpleString(\"from time import time,ctime\\n\"\n" +" \"print('Today is', ctime(time()))\\n\");\n" +" if (Py_FinalizeEx() < 0) {\n" +" exit(120);\n" +" }\n" +" PyMem_RawFree(program);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/embedding.rst:78 msgid "" "The :c:func:`Py_SetProgramName` function should be called before :c:func:" @@ -191,6 +214,82 @@ msgstr "" msgid "The code to run a function defined in a Python script is:" msgstr "" +#: ../../extending/embedding.rst:143 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" PyObject *pName, *pModule, *pFunc;\n" +" PyObject *pArgs, *pValue;\n" +" int i;\n" +"\n" +" if (argc < 3) {\n" +" fprintf(stderr,\"Usage: call pythonfile funcname [args]\\n\");\n" +" return 1;\n" +" }\n" +"\n" +" Py_Initialize();\n" +" pName = PyUnicode_DecodeFSDefault(argv[1]);\n" +" /* Error checking of pName left out */\n" +"\n" +" pModule = PyImport_Import(pName);\n" +" Py_DECREF(pName);\n" +"\n" +" if (pModule != NULL) {\n" +" pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" +" /* pFunc is a new reference */\n" +"\n" +" if (pFunc && PyCallable_Check(pFunc)) {\n" +" pArgs = PyTuple_New(argc - 3);\n" +" for (i = 0; i < argc - 3; ++i) {\n" +" pValue = PyLong_FromLong(atoi(argv[i + 3]));\n" +" if (!pValue) {\n" +" Py_DECREF(pArgs);\n" +" Py_DECREF(pModule);\n" +" fprintf(stderr, \"Cannot convert argument\\n\");\n" +" return 1;\n" +" }\n" +" /* pValue reference stolen here: */\n" +" PyTuple_SetItem(pArgs, i, pValue);\n" +" }\n" +" pValue = PyObject_CallObject(pFunc, pArgs);\n" +" Py_DECREF(pArgs);\n" +" if (pValue != NULL) {\n" +" printf(\"Result of call: %ld\\n\", PyLong_AsLong(pValue));\n" +" Py_DECREF(pValue);\n" +" }\n" +" else {\n" +" Py_DECREF(pFunc);\n" +" Py_DECREF(pModule);\n" +" PyErr_Print();\n" +" fprintf(stderr,\"Call failed\\n\");\n" +" return 1;\n" +" }\n" +" }\n" +" else {\n" +" if (PyErr_Occurred())\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Cannot find function \\\"%s\\\"\\n\", " +"argv[2]);\n" +" }\n" +" Py_XDECREF(pFunc);\n" +" Py_DECREF(pModule);\n" +" }\n" +" else {\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Failed to load \\\"%s\\\"\\n\", argv[1]);\n" +" return 1;\n" +" }\n" +" if (Py_FinalizeEx() < 0) {\n" +" return 120;\n" +" }\n" +" return 0;\n" +"}\n" +msgstr "" + #: ../../extending/embedding.rst:146 msgid "" "This code loads a Python script using ``argv[1]``, and calls the function " @@ -200,10 +299,27 @@ msgid "" "a Python script, such as:" msgstr "" +#: ../../extending/embedding.rst:152 +msgid "" +"def multiply(a,b):\n" +" print(\"Will compute\", a, \"times\", b)\n" +" c = 0\n" +" for i in range(0, a):\n" +" c = c + b\n" +" return c" +msgstr "" + #: ../../extending/embedding.rst:161 msgid "then the result should be:" msgstr "" +#: ../../extending/embedding.rst:163 +msgid "" +"$ call multiply multiply 3 2\n" +"Will compute 3 times 2\n" +"Result of call: 6" +msgstr "" + #: ../../extending/embedding.rst:169 msgid "" "Although the program is quite large for its functionality, most of the code " @@ -211,6 +327,14 @@ msgid "" "interesting part with respect to embedding Python starts with ::" msgstr "" +#: ../../extending/embedding.rst:173 +msgid "" +"Py_Initialize();\n" +"pName = PyUnicode_DecodeFSDefault(argv[1]);\n" +"/* Error checking of pName left out */\n" +"pModule = PyImport_Import(pName);" +msgstr "" + #: ../../extending/embedding.rst:178 msgid "" "After initializing the interpreter, the script is loaded using :c:func:" @@ -219,6 +343,17 @@ msgid "" "conversion routine. ::" msgstr "" +#: ../../extending/embedding.rst:183 +msgid "" +"pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" +"/* pFunc is a new reference */\n" +"\n" +"if (pFunc && PyCallable_Check(pFunc)) {\n" +" ...\n" +"}\n" +"Py_XDECREF(pFunc);" +msgstr "" + #: ../../extending/embedding.rst:191 msgid "" "Once the script is loaded, the name we're looking for is retrieved using :c:" @@ -228,6 +363,10 @@ msgid "" "Python function is then made with::" msgstr "" +#: ../../extending/embedding.rst:197 +msgid "pValue = PyObject_CallObject(pFunc, pArgs);" +msgstr "" + #: ../../extending/embedding.rst:199 msgid "" "Upon return of the function, ``pValue`` is either ``NULL`` or it contains a " @@ -251,12 +390,49 @@ msgid "" "like you would write a normal Python extension. For example::" msgstr "" +#: ../../extending/embedding.rst:218 +msgid "" +"static int numargs=0;\n" +"\n" +"/* Return the number of arguments of the application command line */\n" +"static PyObject*\n" +"emb_numargs(PyObject *self, PyObject *args)\n" +"{\n" +" if(!PyArg_ParseTuple(args, \":numargs\"))\n" +" return NULL;\n" +" return PyLong_FromLong(numargs);\n" +"}\n" +"\n" +"static PyMethodDef EmbMethods[] = {\n" +" {\"numargs\", emb_numargs, METH_VARARGS,\n" +" \"Return the number of arguments received by the process.\"},\n" +" {NULL, NULL, 0, NULL}\n" +"};\n" +"\n" +"static PyModuleDef EmbModule = {\n" +" PyModuleDef_HEAD_INIT, \"emb\", NULL, -1, EmbMethods,\n" +" NULL, NULL, NULL, NULL\n" +"};\n" +"\n" +"static PyObject*\n" +"PyInit_emb(void)\n" +"{\n" +" return PyModule_Create(&EmbModule);\n" +"}" +msgstr "" + #: ../../extending/embedding.rst:246 msgid "" "Insert the above code just above the :c:func:`main` function. Also, insert " "the following two statements before the call to :c:func:`Py_Initialize`::" msgstr "" +#: ../../extending/embedding.rst:249 +msgid "" +"numargs = argc;\n" +"PyImport_AppendInittab(\"emb\", &PyInit_emb);" +msgstr "" + #: ../../extending/embedding.rst:252 msgid "" "These two lines initialize the ``numargs`` variable, and make the :func:`!" @@ -264,6 +440,12 @@ msgid "" "these extensions, the Python script can do things like" msgstr "" +#: ../../extending/embedding.rst:256 +msgid "" +"import emb\n" +"print(\"Number of arguments\", emb.numargs())" +msgstr "" + #: ../../extending/embedding.rst:261 msgid "" "In a real application, the methods will expose an API of the application to " @@ -310,12 +492,26 @@ msgid "" "compiling:" msgstr "" +#: ../../extending/embedding.rst:299 +msgid "" +"$ /opt/bin/python3.11-config --cflags\n" +"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG " +"-g -fwrapv -O3 -Wall" +msgstr "" + #: ../../extending/embedding.rst:304 msgid "" "``pythonX.Y-config --ldflags --embed`` will give you the recommended flags " "when linking:" msgstr "" +#: ../../extending/embedding.rst:307 +msgid "" +"$ /opt/bin/python3.11-config --ldflags --embed\n" +"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -" +"lpthread -ldl -lutil -lm" +msgstr "" + #: ../../extending/embedding.rst:313 msgid "" "To avoid confusion between several Python installations (and especially " @@ -335,3 +531,12 @@ msgid "" "extract the configuration values that you will want to combine together. " "For example:" msgstr "" + +#: ../../extending/embedding.rst:327 +msgid "" +">>> import sysconfig\n" +">>> sysconfig.get_config_var('LIBS')\n" +"'-lpthread -ldl -lutil'\n" +">>> sysconfig.get_config_var('LINKFORSHARED')\n" +"'-Xlinker -export-dynamic'" +msgstr "" diff --git a/extending/extending.po b/extending/extending.po index 3bfd16d73..debdaac2c 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Mariana Costa , 2021 -# Julia Rizza , 2021 -# Melissa Weber Mendonça , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -107,6 +103,12 @@ msgstr "" "retorna um número inteiro. Queremos que essa função seja chamável a partir " "do Python como abaixo:" +#: ../../extending/extending.rst:48 +msgid "" +">>> import spam\n" +">>> status = spam.system(\"ls -l\")" +msgstr "" + #: ../../extending/extending.rst:53 msgid "" "Begin by creating a file :file:`spammodule.c`. (Historically, if a module " @@ -123,6 +125,12 @@ msgstr "" msgid "The first two lines of our file can be::" msgstr "As duas primeiras linhas do nosso arquivo podem ser::" +#: ../../extending/extending.rst:60 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include " +msgstr "" + #: ../../extending/extending.rst:63 msgid "" "which pulls in the Python API (you can add a comment describing the purpose " @@ -167,6 +175,21 @@ msgid "" "(we'll see shortly how it ends up being called)::" msgstr "" +#: ../../extending/extending.rst:87 +msgid "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = system(command);\n" +" return PyLong_FromLong(sts);\n" +"}" +msgstr "" + #: ../../extending/extending.rst:99 msgid "" "There is a straightforward translation from the argument list in Python (for " @@ -327,12 +350,40 @@ msgid "" "you usually declare a static object variable at the beginning of your file::" msgstr "" +#: ../../extending/extending.rst:207 +msgid "static PyObject *SpamError;" +msgstr "" + #: ../../extending/extending.rst:209 msgid "" "and initialize it in your module's initialization function (:c:func:`!" "PyInit_spam`) with an exception object::" msgstr "" +#: ../../extending/extending.rst:212 +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" PyObject *m;\n" +"\n" +" m = PyModule_Create(&spammodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n" +" Py_XINCREF(SpamError);\n" +" if (PyModule_AddObject(m, \"error\", SpamError) < 0) {\n" +" Py_XDECREF(SpamError);\n" +" Py_CLEAR(SpamError);\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}" +msgstr "" + #: ../../extending/extending.rst:233 msgid "" "Note that the Python name for the exception object is :exc:`!spam.error`. " @@ -364,6 +415,25 @@ msgid "" "using a call to :c:func:`PyErr_SetString` as shown below::" msgstr "" +#: ../../extending/extending.rst:251 +msgid "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = system(command);\n" +" if (sts < 0) {\n" +" PyErr_SetString(SpamError, \"System command failed\");\n" +" return NULL;\n" +" }\n" +" return PyLong_FromLong(sts);\n" +"}" +msgstr "" + #: ../../extending/extending.rst:271 msgid "Back to the Example" msgstr "" @@ -374,6 +444,12 @@ msgid "" "this statement::" msgstr "" +#: ../../extending/extending.rst:276 +msgid "" +"if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;" +msgstr "" + #: ../../extending/extending.rst:279 msgid "" "It returns ``NULL`` (the error indicator for functions returning object " @@ -391,6 +467,10 @@ msgid "" "it the string we just got from :c:func:`PyArg_ParseTuple`::" msgstr "" +#: ../../extending/extending.rst:290 +msgid "sts = system(command);" +msgstr "" + #: ../../extending/extending.rst:292 msgid "" "Our :func:`!spam.system` function must return the value of :c:data:`!sts` as " @@ -398,6 +478,10 @@ msgid "" "`PyLong_FromLong`. ::" msgstr "" +#: ../../extending/extending.rst:295 +msgid "return PyLong_FromLong(sts);" +msgstr "" + #: ../../extending/extending.rst:297 msgid "" "In this case, it will return an integer object. (Yes, even integers are " @@ -412,6 +496,12 @@ msgid "" "macro:`Py_RETURN_NONE` macro)::" msgstr "" +#: ../../extending/extending.rst:305 +msgid "" +"Py_INCREF(Py_None);\n" +"return Py_None;" +msgstr "" + #: ../../extending/extending.rst:308 msgid "" ":c:data:`Py_None` is the C name for the special Python object ``None``. It " @@ -429,6 +519,17 @@ msgid "" "programs. First, we need to list its name and address in a \"method table\"::" msgstr "" +#: ../../extending/extending.rst:321 +msgid "" +"static PyMethodDef SpamMethods[] = {\n" +" ...\n" +" {\"system\", spam_system, METH_VARARGS,\n" +" \"Execute a shell command.\"},\n" +" ...\n" +" {NULL, NULL, 0, NULL} /* Sentinel */\n" +"};" +msgstr "" + #: ../../extending/extending.rst:329 msgid "" "Note the third entry (``METH_VARARGS``). This is a flag telling the " @@ -459,6 +560,18 @@ msgid "" "The method table must be referenced in the module definition structure::" msgstr "" +#: ../../extending/extending.rst:346 +msgid "" +"static struct PyModuleDef spammodule = {\n" +" PyModuleDef_HEAD_INIT,\n" +" \"spam\", /* name of module */\n" +" spam_doc, /* module documentation, may be NULL */\n" +" -1, /* size of per-interpreter state of the module,\n" +" or -1 if the module keeps state in global variables. */\n" +" SpamMethods\n" +"};" +msgstr "" + #: ../../extending/extending.rst:355 msgid "" "This structure, in turn, must be passed to the interpreter in the module's " @@ -467,6 +580,15 @@ msgid "" "only non-\\ ``static`` item defined in the module file::" msgstr "" +#: ../../extending/extending.rst:360 +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModule_Create(&spammodule);\n" +"}" +msgstr "" + #: ../../extending/extending.rst:366 msgid "" "Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` " @@ -496,6 +618,47 @@ msgid "" "`PyImport_AppendInittab`, optionally followed by an import of the module::" msgstr "" +#: ../../extending/extending.rst:386 +msgid "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" wchar_t *program = Py_DecodeLocale(argv[0], NULL);\n" +" if (program == NULL) {\n" +" fprintf(stderr, \"Fatal error: cannot decode argv[0]\\n\");\n" +" exit(1);\n" +" }\n" +"\n" +" /* Add a built-in module, before Py_Initialize */\n" +" if (PyImport_AppendInittab(\"spam\", PyInit_spam) == -1) {\n" +" fprintf(stderr, \"Error: could not extend in-built modules " +"table\\n\");\n" +" exit(1);\n" +" }\n" +"\n" +" /* Pass argv[0] to the Python interpreter */\n" +" Py_SetProgramName(program);\n" +"\n" +" /* Initialize the Python interpreter. Required.\n" +" If this step fails, it will be a fatal error. */\n" +" Py_Initialize();\n" +"\n" +" /* Optionally import the module; alternatively,\n" +" import can be deferred until the embedded script\n" +" imports it. */\n" +" PyObject *pmodule = PyImport_ImportModule(\"spam\");\n" +" if (!pmodule) {\n" +" PyErr_Print();\n" +" fprintf(stderr, \"Error: could not import module 'spam'\\n\");\n" +" }\n" +"\n" +" ...\n" +"\n" +" PyMem_RawFree(program);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/extending.rst:425 msgid "" "Removing entries from ``sys.modules`` or importing compiled modules into " @@ -544,6 +707,10 @@ msgid "" "line to the file :file:`Modules/Setup.local` describing your file:" msgstr "" +#: ../../extending/extending.rst:462 +msgid "spam spammodule.o" +msgstr "" + #: ../../extending/extending.rst:466 msgid "" "and rebuild the interpreter by running :program:`make` in the toplevel " @@ -559,6 +726,10 @@ msgid "" "listed on the line in the configuration file as well, for instance:" msgstr "" +#: ../../extending/extending.rst:475 +msgid "spam spammodule.o -lX11" +msgstr "" + #: ../../extending/extending.rst:483 msgid "Calling Python Functions from C" msgstr "" @@ -593,6 +764,33 @@ msgid "" "function might be part of a module definition::" msgstr "" +#: ../../extending/extending.rst:506 +msgid "" +"static PyObject *my_callback = NULL;\n" +"\n" +"static PyObject *\n" +"my_set_callback(PyObject *dummy, PyObject *args)\n" +"{\n" +" PyObject *result = NULL;\n" +" PyObject *temp;\n" +"\n" +" if (PyArg_ParseTuple(args, \"O:set_callback\", &temp)) {\n" +" if (!PyCallable_Check(temp)) {\n" +" PyErr_SetString(PyExc_TypeError, \"parameter must be " +"callable\");\n" +" return NULL;\n" +" }\n" +" Py_XINCREF(temp); /* Add a reference to new callback */\n" +" Py_XDECREF(my_callback); /* Dispose of previous callback */\n" +" my_callback = temp; /* Remember new callback */\n" +" /* Boilerplate to return \"None\" */\n" +" Py_INCREF(Py_None);\n" +" result = Py_None;\n" +" }\n" +" return result;\n" +"}" +msgstr "" + #: ../../extending/extending.rst:529 msgid "" "This function must be registered with the interpreter using the :c:macro:" @@ -621,6 +819,20 @@ msgid "" "or more format codes between parentheses. For example::" msgstr "" +#: ../../extending/extending.rst:550 +msgid "" +"int arg;\n" +"PyObject *arglist;\n" +"PyObject *result;\n" +"...\n" +"arg = 123;\n" +"...\n" +"/* Time to call the callback */\n" +"arglist = Py_BuildValue(\"(i)\", arg);\n" +"result = PyObject_CallObject(my_callback, arglist);\n" +"Py_DECREF(arglist);" +msgstr "" + #: ../../extending/extending.rst:561 msgid "" ":c:func:`PyObject_CallObject` returns a Python object pointer: this is the " @@ -650,6 +862,14 @@ msgid "" "should be cleared by calling :c:func:`PyErr_Clear`. For example::" msgstr "" +#: ../../extending/extending.rst:582 +msgid "" +"if (result == NULL)\n" +" return NULL; /* Pass error back */\n" +"...use result...\n" +"Py_DECREF(result);" +msgstr "" + #: ../../extending/extending.rst:587 msgid "" "Depending on the desired interface to the Python callback function, you may " @@ -662,6 +882,19 @@ msgid "" "you want to pass an integral event code, you might use the following code::" msgstr "" +#: ../../extending/extending.rst:596 +msgid "" +"PyObject *arglist;\n" +"...\n" +"arglist = Py_BuildValue(\"(l)\", eventcode);\n" +"result = PyObject_CallObject(my_callback, arglist);\n" +"Py_DECREF(arglist);\n" +"if (result == NULL)\n" +" return NULL; /* Pass error back */\n" +"/* Here maybe use the result */\n" +"Py_DECREF(result);" +msgstr "" + #: ../../extending/extending.rst:606 msgid "" "Note the placement of ``Py_DECREF(arglist)`` immediately after the call, " @@ -677,6 +910,19 @@ msgid "" "above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::" msgstr "" +#: ../../extending/extending.rst:614 +msgid "" +"PyObject *dict;\n" +"...\n" +"dict = Py_BuildValue(\"{s:i}\", \"name\", val);\n" +"result = PyObject_Call(my_callback, NULL, dict);\n" +"Py_DECREF(dict);\n" +"if (result == NULL)\n" +" return NULL; /* Pass error back */\n" +"/* Here maybe use the result */\n" +"Py_DECREF(result);" +msgstr "" + #: ../../extending/extending.rst:628 msgid "Extracting Parameters in Extension Functions" msgstr "" @@ -685,6 +931,10 @@ msgstr "" msgid "The :c:func:`PyArg_ParseTuple` function is declared as follows::" msgstr "" +#: ../../extending/extending.rst:634 +msgid "int PyArg_ParseTuple(PyObject *arg, const char *format, ...);" +msgstr "" + #: ../../extending/extending.rst:636 msgid "" "The *arg* argument must be a tuple object containing an argument list passed " @@ -715,6 +965,81 @@ msgstr "" msgid "Some example calls::" msgstr "" +#: ../../extending/extending.rst:652 +msgid "" +"#define PY_SSIZE_T_CLEAN /* Make \"s#\" use Py_ssize_t rather than int. */\n" +"#include " +msgstr "" + +#: ../../extending/extending.rst:657 +msgid "" +"int ok;\n" +"int i, j;\n" +"long k, l;\n" +"const char *s;\n" +"Py_ssize_t size;\n" +"\n" +"ok = PyArg_ParseTuple(args, \"\"); /* No arguments */\n" +" /* Python call: f() */" +msgstr "" + +#: ../../extending/extending.rst:668 +msgid "" +"ok = PyArg_ParseTuple(args, \"s\", &s); /* A string */\n" +" /* Possible Python call: f('whoops!') */" +msgstr "" + +#: ../../extending/extending.rst:673 +msgid "" +"ok = PyArg_ParseTuple(args, \"lls\", &k, &l, &s); /* Two longs and a string " +"*/\n" +" /* Possible Python call: f(1, 2, 'three') */" +msgstr "" + +#: ../../extending/extending.rst:678 +msgid "" +"ok = PyArg_ParseTuple(args, \"(ii)s#\", &i, &j, &s, &size);\n" +" /* A pair of ints and a string, whose size is also returned */\n" +" /* Possible Python call: f((1, 2), 'three') */" +msgstr "" + +#: ../../extending/extending.rst:684 +msgid "" +"{\n" +" const char *file;\n" +" const char *mode = \"r\";\n" +" int bufsize = 0;\n" +" ok = PyArg_ParseTuple(args, \"s|si\", &file, &mode, &bufsize);\n" +" /* A string, and optionally another string and an integer */\n" +" /* Possible Python calls:\n" +" f('spam')\n" +" f('spam', 'w')\n" +" f('spam', 'wb', 100000) */\n" +"}" +msgstr "" + +#: ../../extending/extending.rst:698 +msgid "" +"{\n" +" int left, top, right, bottom, h, v;\n" +" ok = PyArg_ParseTuple(args, \"((ii)(ii))(ii)\",\n" +" &left, &top, &right, &bottom, &h, &v);\n" +" /* A rectangle and a point */\n" +" /* Possible Python call:\n" +" f(((0, 0), (400, 300)), (10, 10)) */\n" +"}" +msgstr "" + +#: ../../extending/extending.rst:709 +msgid "" +"{\n" +" Py_complex c;\n" +" ok = PyArg_ParseTuple(args, \"D:myfunction\", &c);\n" +" /* a complex, also providing a function name for errors */\n" +" /* Possible Python call: myfunction(1+2j) */\n" +"}" +msgstr "" + #: ../../extending/extending.rst:720 msgid "Keyword Parameters for Extension Functions" msgstr "" @@ -724,6 +1049,12 @@ msgid "" "The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::" msgstr "" +#: ../../extending/extending.rst:726 +msgid "" +"int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,\n" +" const char *format, char *kwlist[], ...);" +msgstr "" + #: ../../extending/extending.rst:729 msgid "" "The *arg* and *format* parameters are identical to those of the :c:func:" @@ -749,6 +1080,60 @@ msgid "" "Philbrick (philbrick@hks.com)::" msgstr "" +#: ../../extending/extending.rst:748 +msgid "" +"#define PY_SSIZE_T_CLEAN /* Make \"s#\" use Py_ssize_t rather than int. */\n" +"#include \n" +"\n" +"static PyObject *\n" +"keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds)\n" +"{\n" +" int voltage;\n" +" const char *state = \"a stiff\";\n" +" const char *action = \"voom\";\n" +" const char *type = \"Norwegian Blue\";\n" +"\n" +" static char *kwlist[] = {\"voltage\", \"state\", \"action\", \"type\", " +"NULL};\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, keywds, \"i|sss\", kwlist,\n" +" &voltage, &state, &action, &type))\n" +" return NULL;\n" +"\n" +" printf(\"-- This parrot wouldn't %s if you put %i Volts through it." +"\\n\",\n" +" action, voltage);\n" +" printf(\"-- Lovely plumage, the %s -- It's %s!\\n\", type, state);\n" +"\n" +" Py_RETURN_NONE;\n" +"}\n" +"\n" +"static PyMethodDef keywdarg_methods[] = {\n" +" /* The cast of the function is necessary since PyCFunction values\n" +" * only take two PyObject* parameters, and keywdarg_parrot() takes\n" +" * three.\n" +" */\n" +" {\"parrot\", (PyCFunction)(void(*)(void))keywdarg_parrot, METH_VARARGS | " +"METH_KEYWORDS,\n" +" \"Print a lovely skit to standard output.\"},\n" +" {NULL, NULL, 0, NULL} /* sentinel */\n" +"};\n" +"\n" +"static struct PyModuleDef keywdargmodule = {\n" +" PyModuleDef_HEAD_INIT,\n" +" \"keywdarg\",\n" +" NULL,\n" +" -1,\n" +" keywdarg_methods\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_keywdarg(void)\n" +"{\n" +" return PyModule_Create(&keywdargmodule);\n" +"}" +msgstr "" + #: ../../extending/extending.rst:800 msgid "Building Arbitrary Values" msgstr "" @@ -759,6 +1144,10 @@ msgid "" "declared as follows::" msgstr "" +#: ../../extending/extending.rst:805 +msgid "PyObject *Py_BuildValue(const char *format, ...);" +msgstr "" + #: ../../extending/extending.rst:807 msgid "" "It recognizes a set of format units similar to the ones recognized by :c:" @@ -784,6 +1173,27 @@ msgid "" "Examples (to the left the call, to the right the resulting Python value):" msgstr "" +#: ../../extending/extending.rst:822 +msgid "" +"Py_BuildValue(\"\") None\n" +"Py_BuildValue(\"i\", 123) 123\n" +"Py_BuildValue(\"iii\", 123, 456, 789) (123, 456, 789)\n" +"Py_BuildValue(\"s\", \"hello\") 'hello'\n" +"Py_BuildValue(\"y\", \"hello\") b'hello'\n" +"Py_BuildValue(\"ss\", \"hello\", \"world\") ('hello', 'world')\n" +"Py_BuildValue(\"s#\", \"hello\", 4) 'hell'\n" +"Py_BuildValue(\"y#\", \"hello\", 4) b'hell'\n" +"Py_BuildValue(\"()\") ()\n" +"Py_BuildValue(\"(i)\", 123) (123,)\n" +"Py_BuildValue(\"(ii)\", 123, 456) (123, 456)\n" +"Py_BuildValue(\"(i,i)\", 123, 456) (123, 456)\n" +"Py_BuildValue(\"[i,i]\", 123, 456) [123, 456]\n" +"Py_BuildValue(\"{s:i,s:i}\",\n" +" \"abc\", 123, \"def\", 456) {'abc': 123, 'def': 456}\n" +"Py_BuildValue(\"((ii)(ii)) (ii)\",\n" +" 1, 2, 3, 4, 5, 6) (((1, 2), (3, 4)), (5, 6))" +msgstr "" + #: ../../extending/extending.rst:846 msgid "Reference Counts" msgstr "Contagens de referências" @@ -806,7 +1216,7 @@ msgid "" "memory it occupies cannot be reused until the program terminates. This is " "called a :dfn:`memory leak`. On the other hand, if a program calls :c:func:" "`free` for a block and then continues to use the block, it creates a " -"conflict with re-use of the block through another :c:func:`malloc` call. " +"conflict with reuse of the block through another :c:func:`malloc` call. " "This is called :dfn:`using freed memory`. It has the same bad consequences " "as referencing uninitialized data --- core dumps, wrong results, mysterious " "crashes." @@ -1021,6 +1431,18 @@ msgid "" "instance::" msgstr "" +#: ../../extending/extending.rst:1016 +msgid "" +"void\n" +"bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +"\n" +" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" +" PyObject_Print(item, stdout, 0); /* BUG! */\n" +"}" +msgstr "" + #: ../../extending/extending.rst:1025 msgid "" "This function first borrows a reference to ``list[0]``, then replaces " @@ -1055,6 +1477,20 @@ msgid "" "increment the reference count. The correct version of the function reads::" msgstr "" +#: ../../extending/extending.rst:1047 +msgid "" +"void\n" +"no_bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +"\n" +" Py_INCREF(item);\n" +" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" +" PyObject_Print(item, stdout, 0);\n" +" Py_DECREF(item);\n" +"}" +msgstr "" + #: ../../extending/extending.rst:1058 msgid "" "This is a true story. An older version of Python contained variants of this " @@ -1075,6 +1511,19 @@ msgid "" "previous one::" msgstr "" +#: ../../extending/extending.rst:1071 +msgid "" +"void\n" +"bug(PyObject *list)\n" +"{\n" +" PyObject *item = PyList_GetItem(list, 0);\n" +" Py_BEGIN_ALLOW_THREADS\n" +" ...some blocking I/O call...\n" +" Py_END_ALLOW_THREADS\n" +" PyObject_Print(item, stdout, 0); /* BUG! */\n" +"}" +msgstr "" + #: ../../extending/extending.rst:1085 msgid "NULL Pointers" msgstr "" @@ -1223,6 +1672,10 @@ msgid "" "following this convention::" msgstr "" +#: ../../extending/extending.rst:1196 +msgid "modulename.attributename" +msgstr "" + #: ../../extending/extending.rst:1198 msgid "" "The convenience function :c:func:`PyCapsule_Import` makes it easy to load a " @@ -1259,18 +1712,52 @@ msgid "" "``static`` like everything else::" msgstr "" +#: ../../extending/extending.rst:1221 +msgid "" +"static int\n" +"PySpam_System(const char *command)\n" +"{\n" +" return system(command);\n" +"}" +msgstr "" + #: ../../extending/extending.rst:1227 msgid "The function :c:func:`!spam_system` is modified in a trivial way::" msgstr "" +#: ../../extending/extending.rst:1229 +msgid "" +"static PyObject *\n" +"spam_system(PyObject *self, PyObject *args)\n" +"{\n" +" const char *command;\n" +" int sts;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"s\", &command))\n" +" return NULL;\n" +" sts = PySpam_System(command);\n" +" return PyLong_FromLong(sts);\n" +"}" +msgstr "" + #: ../../extending/extending.rst:1241 msgid "In the beginning of the module, right after the line ::" msgstr "" +#: ../../extending/extending.rst:1243 +msgid "#include " +msgstr "" + #: ../../extending/extending.rst:1245 msgid "two more lines must be added::" msgstr "" +#: ../../extending/extending.rst:1247 +msgid "" +"#define SPAM_MODULE\n" +"#include \"spammodule.h\"" +msgstr "" + #: ../../extending/extending.rst:1250 msgid "" "The ``#define`` is used to tell the header file that it is being included in " @@ -1279,6 +1766,36 @@ msgid "" "array::" msgstr "" +#: ../../extending/extending.rst:1254 +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" PyObject *m;\n" +" static void *PySpam_API[PySpam_API_pointers];\n" +" PyObject *c_api_object;\n" +"\n" +" m = PyModule_Create(&spammodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" /* Initialize the C API pointer array */\n" +" PySpam_API[PySpam_System_NUM] = (void *)PySpam_System;\n" +"\n" +" /* Create a Capsule containing the API pointer array's address */\n" +" c_api_object = PyCapsule_New((void *)PySpam_API, \"spam._C_API\", " +"NULL);\n" +"\n" +" if (PyModule_AddObject(m, \"_C_API\", c_api_object) < 0) {\n" +" Py_XDECREF(c_api_object);\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}" +msgstr "" + #: ../../extending/extending.rst:1280 msgid "" "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array " @@ -1291,6 +1808,58 @@ msgid "" "like this::" msgstr "" +#: ../../extending/extending.rst:1286 +msgid "" +"#ifndef Py_SPAMMODULE_H\n" +"#define Py_SPAMMODULE_H\n" +"#ifdef __cplusplus\n" +"extern \"C\" {\n" +"#endif\n" +"\n" +"/* Header file for spammodule */\n" +"\n" +"/* C API functions */\n" +"#define PySpam_System_NUM 0\n" +"#define PySpam_System_RETURN int\n" +"#define PySpam_System_PROTO (const char *command)\n" +"\n" +"/* Total number of C API pointers */\n" +"#define PySpam_API_pointers 1\n" +"\n" +"\n" +"#ifdef SPAM_MODULE\n" +"/* This section is used when compiling spammodule.c */\n" +"\n" +"static PySpam_System_RETURN PySpam_System PySpam_System_PROTO;\n" +"\n" +"#else\n" +"/* This section is used in modules that use spammodule's API */\n" +"\n" +"static void **PySpam_API;\n" +"\n" +"#define PySpam_System \\\n" +" (*(PySpam_System_RETURN (*)PySpam_System_PROTO) " +"PySpam_API[PySpam_System_NUM])\n" +"\n" +"/* Return -1 on error, 0 on success.\n" +" * PyCapsule_Import will set an exception if there's an error.\n" +" */\n" +"static int\n" +"import_spam(void)\n" +"{\n" +" PySpam_API = (void **)PyCapsule_Import(\"spam._C_API\", 0);\n" +" return (PySpam_API != NULL) ? 0 : -1;\n" +"}\n" +"\n" +"#endif\n" +"\n" +"#ifdef __cplusplus\n" +"}\n" +"#endif\n" +"\n" +"#endif /* !defined(Py_SPAMMODULE_H) */" +msgstr "" + #: ../../extending/extending.rst:1334 msgid "" "All that a client module must do in order to have access to the function :c:" @@ -1298,6 +1867,23 @@ msgid "" "import_spam` in its initialization function::" msgstr "" +#: ../../extending/extending.rst:1338 +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_client(void)\n" +"{\n" +" PyObject *m;\n" +"\n" +" m = PyModule_Create(&clientmodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +" if (import_spam() < 0)\n" +" return NULL;\n" +" /* additional initialization can happen here */\n" +" return m;\n" +"}" +msgstr "" + #: ../../extending/extending.rst:1352 msgid "" "The main disadvantage of this approach is that the file :file:`spammodule.h` " diff --git a/extending/index.po b/extending/index.po index 562e67691..9bd22d58e 100644 --- a/extending/index.po +++ b/extending/index.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/extending/newtypes.po b/extending/newtypes.po index e751568bd..134799c42 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -41,6 +39,96 @@ msgid "" "in :ref:`debug builds ` omitted:" msgstr "" +#: ../../extending/newtypes.rst:17 +msgid "" +"typedef struct _typeobject {\n" +" PyObject_VAR_HEAD\n" +" const char *tp_name; /* For printing, in format \".\" */\n" +" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" +"\n" +" /* Methods to implement standard operations */\n" +"\n" +" destructor tp_dealloc;\n" +" Py_ssize_t tp_vectorcall_offset;\n" +" getattrfunc tp_getattr;\n" +" setattrfunc tp_setattr;\n" +" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" +" or tp_reserved (Python 3) */\n" +" reprfunc tp_repr;\n" +"\n" +" /* Method suites for standard classes */\n" +"\n" +" PyNumberMethods *tp_as_number;\n" +" PySequenceMethods *tp_as_sequence;\n" +" PyMappingMethods *tp_as_mapping;\n" +"\n" +" /* More standard operations (here for binary compatibility) */\n" +"\n" +" hashfunc tp_hash;\n" +" ternaryfunc tp_call;\n" +" reprfunc tp_str;\n" +" getattrofunc tp_getattro;\n" +" setattrofunc tp_setattro;\n" +"\n" +" /* Functions to access object as input/output buffer */\n" +" PyBufferProcs *tp_as_buffer;\n" +"\n" +" /* Flags to define presence of optional/expanded features */\n" +" unsigned long tp_flags;\n" +"\n" +" const char *tp_doc; /* Documentation string */\n" +"\n" +" /* Assigned meaning in release 2.0 */\n" +" /* call function for all accessible objects */\n" +" traverseproc tp_traverse;\n" +"\n" +" /* delete references to contained objects */\n" +" inquiry tp_clear;\n" +"\n" +" /* Assigned meaning in release 2.1 */\n" +" /* rich comparisons */\n" +" richcmpfunc tp_richcompare;\n" +"\n" +" /* weak reference enabler */\n" +" Py_ssize_t tp_weaklistoffset;\n" +"\n" +" /* Iterators */\n" +" getiterfunc tp_iter;\n" +" iternextfunc tp_iternext;\n" +"\n" +" /* Attribute descriptor and subclassing stuff */\n" +" struct PyMethodDef *tp_methods;\n" +" struct PyMemberDef *tp_members;\n" +" struct PyGetSetDef *tp_getset;\n" +" // Strong reference on a heap type, borrowed reference on a static type\n" +" struct _typeobject *tp_base;\n" +" PyObject *tp_dict;\n" +" descrgetfunc tp_descr_get;\n" +" descrsetfunc tp_descr_set;\n" +" Py_ssize_t tp_dictoffset;\n" +" initproc tp_init;\n" +" allocfunc tp_alloc;\n" +" newfunc tp_new;\n" +" freefunc tp_free; /* Low-level free-memory routine */\n" +" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" +" PyObject *tp_bases;\n" +" PyObject *tp_mro; /* method resolution order */\n" +" PyObject *tp_cache;\n" +" PyObject *tp_subclasses;\n" +" PyObject *tp_weaklist;\n" +" destructor tp_del;\n" +"\n" +" /* Type attribute cache version tag. Added in version 2.6 */\n" +" unsigned int tp_version_tag;\n" +"\n" +" destructor tp_finalize;\n" +" vectorcallfunc tp_vectorcall;\n" +"\n" +" /* bitset of which type-watchers care about this type */\n" +" unsigned char tp_watched;\n" +"} PyTypeObject;\n" +msgstr "" + #: ../../extending/newtypes.rst:20 msgid "" "Now that's a *lot* of methods. Don't worry too much though -- if you have a " @@ -58,6 +146,10 @@ msgid "" "new type. ::" msgstr "" +#: ../../extending/newtypes.rst:31 +msgid "const char *tp_name; /* For printing */" +msgstr "" + #: ../../extending/newtypes.rst:33 msgid "" "The name of the type -- as mentioned in the previous chapter, this will " @@ -65,6 +157,10 @@ msgid "" "choose something that will be helpful in such a situation! ::" msgstr "" +#: ../../extending/newtypes.rst:37 +msgid "Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */" +msgstr "" + #: ../../extending/newtypes.rst:39 msgid "" "These fields tell the runtime how much memory to allocate when new objects " @@ -74,6 +170,10 @@ msgid "" "later. ::" msgstr "" +#: ../../extending/newtypes.rst:44 +msgid "const char *tp_doc;" +msgstr "" + #: ../../extending/newtypes.rst:46 msgid "" "Here you can put a string (or its address) that you want returned when the " @@ -90,6 +190,10 @@ msgstr "" msgid "Finalization and De-allocation" msgstr "" +#: ../../extending/newtypes.rst:64 +msgid "destructor tp_dealloc;" +msgstr "" + #: ../../extending/newtypes.rst:66 msgid "" "This function is called when the reference count of the instance of your " @@ -99,12 +203,34 @@ msgid "" "of this function::" msgstr "" +#: ../../extending/newtypes.rst:72 +msgid "" +"static void\n" +"newdatatype_dealloc(newdatatypeobject *obj)\n" +"{\n" +" free(obj->obj_UnderlyingDatatypePtr);\n" +" Py_TYPE(obj)->tp_free((PyObject *)obj);\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:79 msgid "" "If your type supports garbage collection, the destructor should call :c:func:" "`PyObject_GC_UnTrack` before clearing any member fields::" msgstr "" +#: ../../extending/newtypes.rst:82 +msgid "" +"static void\n" +"newdatatype_dealloc(newdatatypeobject *obj)\n" +"{\n" +" PyObject_GC_UnTrack(obj);\n" +" Py_CLEAR(obj->other_obj);\n" +" ...\n" +" Py_TYPE(obj)->tp_free((PyObject *)obj);\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:95 msgid "" "One important requirement of the deallocator function is that it leaves any " @@ -120,6 +246,35 @@ msgid "" "c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` functions::" msgstr "" +#: ../../extending/newtypes.rst:107 +msgid "" +"static void\n" +"my_dealloc(PyObject *obj)\n" +"{\n" +" MyObject *self = (MyObject *) obj;\n" +" PyObject *cbresult;\n" +"\n" +" if (self->my_callback != NULL) {\n" +" PyObject *err_type, *err_value, *err_traceback;\n" +"\n" +" /* This saves the current exception state */\n" +" PyErr_Fetch(&err_type, &err_value, &err_traceback);\n" +"\n" +" cbresult = PyObject_CallNoArgs(self->my_callback);\n" +" if (cbresult == NULL)\n" +" PyErr_WriteUnraisable(self->my_callback);\n" +" else\n" +" Py_DECREF(cbresult);\n" +"\n" +" /* This restores the saved exception state */\n" +" PyErr_Restore(err_type, err_value, err_traceback);\n" +"\n" +" Py_DECREF(self->my_callback);\n" +" }\n" +" Py_TYPE(obj)->tp_free((PyObject*)self);\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:134 msgid "" "There are limitations to what you can safely do in a deallocator function. " @@ -155,6 +310,12 @@ msgid "" "`print` function just calls :func:`str`.) These handlers are both optional." msgstr "" +#: ../../extending/newtypes.rst:163 +msgid "" +"reprfunc tp_repr;\n" +"reprfunc tp_str;" +msgstr "" + #: ../../extending/newtypes.rst:166 msgid "" "The :c:member:`~PyTypeObject.tp_repr` handler should return a string object " @@ -162,6 +323,16 @@ msgid "" "a simple example::" msgstr "" +#: ../../extending/newtypes.rst:170 +msgid "" +"static PyObject *\n" +"newdatatype_repr(newdatatypeobject *obj)\n" +"{\n" +" return PyUnicode_FromFormat(\"Repr-ified_newdatatype{{size:%d}}\",\n" +" obj->obj_UnderlyingDatatypePtr->size);\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:177 msgid "" "If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the " @@ -184,6 +355,16 @@ msgstr "" msgid "Here is a simple example::" msgstr "" +#: ../../extending/newtypes.rst:190 +msgid "" +"static PyObject *\n" +"newdatatype_str(newdatatypeobject *obj)\n" +"{\n" +" return PyUnicode_FromFormat(\"Stringified_newdatatype{{size:%d}}\",\n" +" obj->obj_UnderlyingDatatypePtr->size);\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:200 msgid "Attribute Management" msgstr "" @@ -207,6 +388,15 @@ msgid "" "whichever pair makes more sense for the implementation's convenience. ::" msgstr "" +#: ../../extending/newtypes.rst:214 +msgid "" +"getattrfunc tp_getattr; /* char * version */\n" +"setattrfunc tp_setattr;\n" +"/* ... */\n" +"getattrofunc tp_getattro; /* PyObject * version */\n" +"setattrofunc tp_setattro;" +msgstr "" + #: ../../extending/newtypes.rst:220 msgid "" "If accessing attributes of an object is always a simple operation (this will " @@ -262,6 +452,13 @@ msgstr "" msgid "The tables are declared as three fields of the type object::" msgstr "" +#: ../../extending/newtypes.rst:255 +msgid "" +"struct PyMethodDef *tp_methods;\n" +"struct PyMemberDef *tp_members;\n" +"struct PyGetSetDef *tp_getset;" +msgstr "" + #: ../../extending/newtypes.rst:259 msgid "" "If :c:member:`~PyTypeObject.tp_methods` is not ``NULL``, it must refer to an " @@ -269,6 +466,16 @@ msgid "" "instance of this structure::" msgstr "" +#: ../../extending/newtypes.rst:263 +msgid "" +"typedef struct PyMethodDef {\n" +" const char *ml_name; /* method name */\n" +" PyCFunction ml_meth; /* implementation function */\n" +" int ml_flags; /* flags */\n" +" const char *ml_doc; /* docstring */\n" +"} PyMethodDef;" +msgstr "" + #: ../../extending/newtypes.rst:270 msgid "" "One entry should be defined for each method provided by the type; no entries " @@ -285,6 +492,17 @@ msgid "" "defined as::" msgstr "" +#: ../../extending/newtypes.rst:279 +msgid "" +"typedef struct PyMemberDef {\n" +" const char *name;\n" +" int type;\n" +" int offset;\n" +" int flags;\n" +" const char *doc;\n" +"} PyMemberDef;" +msgstr "" + #: ../../extending/newtypes.rst:287 msgid "" "For each entry in the table, a :term:`descriptor` will be constructed and " @@ -339,6 +557,23 @@ msgstr "" msgid "Here is an example::" msgstr "Aqui está um exemplo::" +#: ../../extending/newtypes.rst:331 +msgid "" +"static PyObject *\n" +"newdatatype_getattr(newdatatypeobject *obj, char *name)\n" +"{\n" +" if (strcmp(name, \"data\") == 0)\n" +" {\n" +" return PyLong_FromLong(obj->data);\n" +" }\n" +"\n" +" PyErr_Format(PyExc_AttributeError,\n" +" \"'%.100s' object has no attribute '%.400s'\",\n" +" Py_TYPE(obj)->tp_name, name);\n" +" return NULL;\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:345 msgid "" "The :c:member:`~PyTypeObject.tp_setattr` handler is called when the :meth:" @@ -349,10 +584,24 @@ msgid "" "tp_setattr` handler should be set to ``NULL``. ::" msgstr "" +#: ../../extending/newtypes.rst:351 +msgid "" +"static int\n" +"newdatatype_setattr(newdatatypeobject *obj, char *name, PyObject *v)\n" +"{\n" +" PyErr_Format(PyExc_RuntimeError, \"Read-only attribute: %s\", name);\n" +" return -1;\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:359 msgid "Object Comparison" msgstr "" +#: ../../extending/newtypes.rst:363 +msgid "richcmpfunc tp_richcompare;" +msgstr "" + #: ../../extending/newtypes.rst:365 msgid "" "The :c:member:`~PyTypeObject.tp_richcompare` handler is called when " @@ -378,6 +627,35 @@ msgid "" "the size of an internal pointer is equal::" msgstr "" +#: ../../extending/newtypes.rst:381 +msgid "" +"static PyObject *\n" +"newdatatype_richcmp(newdatatypeobject *obj1, newdatatypeobject *obj2, int " +"op)\n" +"{\n" +" PyObject *result;\n" +" int c, size1, size2;\n" +"\n" +" /* code to make sure that both arguments are of type\n" +" newdatatype omitted */\n" +"\n" +" size1 = obj1->obj_UnderlyingDatatypePtr->size;\n" +" size2 = obj2->obj_UnderlyingDatatypePtr->size;\n" +"\n" +" switch (op) {\n" +" case Py_LT: c = size1 < size2; break;\n" +" case Py_LE: c = size1 <= size2; break;\n" +" case Py_EQ: c = size1 == size2; break;\n" +" case Py_NE: c = size1 != size2; break;\n" +" case Py_GT: c = size1 > size2; break;\n" +" case Py_GE: c = size1 >= size2; break;\n" +" }\n" +" result = c ? Py_True : Py_False;\n" +" Py_INCREF(result);\n" +" return result;\n" +" }" +msgstr "" + #: ../../extending/newtypes.rst:408 msgid "Abstract Protocol Support" msgstr "" @@ -403,6 +681,13 @@ msgid "" "slot, but a slot may still be unfilled.) ::" msgstr "" +#: ../../extending/newtypes.rst:425 +msgid "" +"PyNumberMethods *tp_as_number;\n" +"PySequenceMethods *tp_as_sequence;\n" +"PyMappingMethods *tp_as_mapping;" +msgstr "" + #: ../../extending/newtypes.rst:429 msgid "" "If you wish your object to be able to act like a number, a sequence, or a " @@ -414,12 +699,29 @@ msgid "" "distribution. ::" msgstr "" +#: ../../extending/newtypes.rst:436 +msgid "hashfunc tp_hash;" +msgstr "" + #: ../../extending/newtypes.rst:438 msgid "" "This function, if you choose to provide it, should return a hash number for " "an instance of your data type. Here is a simple example::" msgstr "" +#: ../../extending/newtypes.rst:441 +msgid "" +"static Py_hash_t\n" +"newdatatype_hash(newdatatypeobject *obj)\n" +"{\n" +" Py_hash_t result;\n" +" result = obj->some_size + 32767 * obj->some_number;\n" +" if (result == -1)\n" +" result = -2;\n" +" return result;\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:451 msgid "" ":c:type:`!Py_hash_t` is a signed integer type with a platform-varying width. " @@ -428,6 +730,10 @@ msgid "" "computation is successful, as seen above." msgstr "" +#: ../../extending/newtypes.rst:458 +msgid "ternaryfunc tp_call;" +msgstr "" + #: ../../extending/newtypes.rst:460 msgid "" "This function is called when an instance of your data type is \"called\", " @@ -465,6 +771,34 @@ msgstr "" msgid "Here is a toy ``tp_call`` implementation::" msgstr "" +#: ../../extending/newtypes.rst:480 +msgid "" +"static PyObject *\n" +"newdatatype_call(newdatatypeobject *obj, PyObject *args, PyObject *kwds)\n" +"{\n" +" PyObject *result;\n" +" const char *arg1;\n" +" const char *arg2;\n" +" const char *arg3;\n" +"\n" +" if (!PyArg_ParseTuple(args, \"sss:call\", &arg1, &arg2, &arg3)) {\n" +" return NULL;\n" +" }\n" +" result = PyUnicode_FromFormat(\n" +" \"Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\\n\",\n" +" obj->obj_UnderlyingDatatypePtr->size,\n" +" arg1, arg2, arg3);\n" +" return result;\n" +"}" +msgstr "" + +#: ../../extending/newtypes.rst:500 +msgid "" +"/* Iterators */\n" +"getiterfunc tp_iter;\n" +"iternextfunc tp_iternext;" +msgstr "" + #: ../../extending/newtypes.rst:504 msgid "" "These functions provide support for the iterator protocol. Both handlers " @@ -530,7 +864,7 @@ msgstr "Documentação do módulo :mod:`weakref`." #: ../../extending/newtypes.rst:548 msgid "" -"For an object to be weakly referencable, the extension type must set the " +"For an object to be weakly referenceable, the extension type must set the " "``Py_TPFLAGS_MANAGED_WEAKREF`` bit of the :c:member:`~PyTypeObject.tp_flags` " "field. The legacy :c:member:`~PyTypeObject.tp_weaklistoffset` field should " "be left as zero." @@ -541,12 +875,33 @@ msgid "" "Concretely, here is how the statically declared type object would look::" msgstr "" +#: ../../extending/newtypes.rst:555 +msgid "" +"static PyTypeObject TrivialType = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" /* ... other members omitted for brevity ... */\n" +" .tp_flags = Py_TPFLAGS_MANAGED_WEAKREF | ...,\n" +"};" +msgstr "" + #: ../../extending/newtypes.rst:562 msgid "" "The only further addition is that ``tp_dealloc`` needs to clear any weak " "references (by calling :c:func:`PyObject_ClearWeakRefs`)::" msgstr "" +#: ../../extending/newtypes.rst:565 +msgid "" +"static void\n" +"Trivial_dealloc(TrivialObject *self)\n" +"{\n" +" /* Clear weakrefs first before calling any destructors */\n" +" PyObject_ClearWeakRefs((PyObject *) self);\n" +" /* ... remainder of destruction code omitted for brevity ... */\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:576 msgid "More Suggestions" msgstr "" @@ -567,6 +922,14 @@ msgid "" "sample of its use might be something like the following::" msgstr "" +#: ../../extending/newtypes.rst:588 +msgid "" +"if (!PyObject_TypeCheck(some_object, &MyType)) {\n" +" PyErr_SetString(PyExc_TypeError, \"arg #1 not a mything\");\n" +" return NULL;\n" +"}" +msgstr "" + #: ../../extending/newtypes.rst:594 msgid "Download CPython source releases." msgstr "" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 4f3371347..304310b43 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# felipe caridade fernandes , 2021 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -82,6 +80,55 @@ msgid "" "`PyType_FromSpec` function, which isn't covered in this tutorial." msgstr "" +#: ../../extending/newtypes_tutorial.rst:48 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" /* Type-specific fields go here. */\n" +"} CustomObject;\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT,\n" +" .tp_new = PyType_GenericNew,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" Py_INCREF(&CustomType);\n" +" if (PyModule_AddObject(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" +" Py_DECREF(&CustomType);\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:50 msgid "" "Now that's quite a bit to take in at once, but hopefully bits will seem " @@ -114,6 +161,13 @@ msgstr "" msgid "The first bit is::" msgstr "O primeiro bit é ::" +#: ../../extending/newtypes_tutorial.rst:63 +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +"} CustomObject;" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:67 msgid "" "This is what a Custom object will contain. ``PyObject_HEAD`` is mandatory " @@ -138,10 +192,31 @@ msgid "" "standard Python floats::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:83 +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" double ob_fval;\n" +"} PyFloatObject;" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:88 msgid "The second bit is the definition of the type object. ::" msgstr "O segundo bit é a definição do objeto de tipo. ::" +#: ../../extending/newtypes_tutorial.rst:90 +msgid "" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT,\n" +" .tp_new = PyType_GenericNew,\n" +"};" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:101 msgid "" "We recommend using C99-style designated initializers as above, to avoid " @@ -161,18 +236,34 @@ msgstr "" msgid "We're going to pick it apart, one field at a time::" msgstr "Vamos separá-lo, um campo de cada vez ::" +#: ../../extending/newtypes_tutorial.rst:112 +msgid ".ob_base = PyVarObject_HEAD_INIT(NULL, 0)" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:114 msgid "" "This line is mandatory boilerplate to initialize the ``ob_base`` field " "mentioned above. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:117 +msgid ".tp_name = \"custom.Custom\"," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:119 msgid "" "The name of our type. This will appear in the default textual " "representation of our objects and in some error messages, for example:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:122 +msgid "" +">>> \"\" + custom.Custom()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: can only concatenate str (not \"custom.Custom\") to str" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:129 msgid "" "Note that the name is a dotted name that includes both the module name and " @@ -182,6 +273,12 @@ msgid "" "your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:135 +msgid "" +".tp_basicsize = sizeof(CustomObject),\n" +".tp_itemsize = 0," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:138 msgid "" "This is so that Python knows how much memory to allocate when creating new :" @@ -207,6 +304,10 @@ msgstr "" msgid "We set the class flags to :c:macro:`Py_TPFLAGS_DEFAULT`. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:156 +msgid ".tp_flags = Py_TPFLAGS_DEFAULT," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:158 msgid "" "All types should include this constant in their flags. It enables all of " @@ -219,6 +320,10 @@ msgid "" "We provide a doc string for the type in :c:member:`~PyTypeObject.tp_doc`. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:164 +msgid ".tp_doc = PyDoc_STR(\"Custom objects\")," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:166 msgid "" "To enable object creation, we have to provide a :c:member:`~PyTypeObject." @@ -228,12 +333,22 @@ msgid "" "`PyType_GenericNew`. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:171 +msgid ".tp_new = PyType_GenericNew," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:173 msgid "" "Everything else in the file should be familiar, except for some code in :c:" "func:`!PyInit_custom`::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:176 +msgid "" +"if (PyType_Ready(&CustomType) < 0)\n" +" return;" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:179 msgid "" "This initializes the :class:`!Custom` type, filling in a number of members " @@ -241,26 +356,64 @@ msgid "" "that we initially set to ``NULL``. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:183 +msgid "" +"Py_INCREF(&CustomType);\n" +"if (PyModule_AddObject(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" +" Py_DECREF(&CustomType);\n" +" Py_DECREF(m);\n" +" return NULL;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:190 msgid "" "This adds the type to the module dictionary. This allows us to create :" "class:`!Custom` instances by calling the :class:`!Custom` class:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:193 +msgid "" +">>> import custom\n" +">>> mycustom = custom.Custom()" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:198 msgid "" "That's it! All that remains is to build it; put the above code in a file " "called :file:`custom.c`," msgstr "" +#: ../../extending/newtypes_tutorial.rst:201 +msgid "" +"[build-system]\n" +"requires = [\"setuptools\"]\n" +"build-backend = \"setuptools.build_meta\"\n" +"\n" +"[project]\n" +"name = \"custom\"\n" +"version = \"1\"\n" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:203 msgid "in a file called :file:`pyproject.toml`, and" msgstr "" +#: ../../extending/newtypes_tutorial.rst:205 +msgid "" +"from setuptools import Extension, setup\n" +"setup(ext_modules=[Extension(\"custom\", [\"custom.c\"])])" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:210 msgid "in a file called :file:`setup.py`; then typing" msgstr "" +#: ../../extending/newtypes_tutorial.rst:212 +#: ../../extending/newtypes_tutorial.rst:527 +msgid "$ python -m pip install ." +msgstr "" + #: ../../extending/newtypes_tutorial.rst:216 msgid "" "in a shell should produce a file :file:`custom.so` in a subdirectory and " @@ -291,6 +444,141 @@ msgid "" "custom2` that adds these capabilities:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:233 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_XSETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_XSETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" +" \"first name\"},\n" +" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" +" \"last name\"},\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" if (self->first == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"first\");\n" +" return NULL;\n" +" }\n" +" if (self->last == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"last\");\n" +" return NULL;\n" +" }\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom2.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_new = Custom_new,\n" +" .tp_init = (initproc) Custom_init,\n" +" .tp_dealloc = (destructor) Custom_dealloc,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base =PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom2\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom2(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:236 msgid "This version of the module has a number of changes." msgstr "Esta versão do módulo possui várias alterações." @@ -307,16 +595,41 @@ msgstr "" msgid "The object structure is updated accordingly::" msgstr "A estrutura do objeto é atualizada de acordo ::" +#: ../../extending/newtypes_tutorial.rst:244 +msgid "" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:251 msgid "" "Because we now have data to manage, we have to be more careful about object " "allocation and deallocation. At a minimum, we need a deallocation method::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:254 +msgid "" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:262 msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:264 +msgid ".tp_dealloc = (destructor) Custom_dealloc," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:266 msgid "" "This method first clears the reference counts of the two Python attributes. :" @@ -343,10 +656,38 @@ msgid "" "strings, so we provide a ``tp_new`` implementation::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:284 +msgid "" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:305 msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:307 +msgid ".tp_new = Custom_new," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:309 msgid "" "The ``tp_new`` handler is responsible for creating (as opposed to " @@ -380,6 +721,10 @@ msgid "" "slot to allocate memory::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:331 +msgid "self = (CustomObject *) type->tp_alloc(type, 0);" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:333 msgid "" "Since memory allocation may fail, we must check the :c:member:`~PyTypeObject." @@ -413,10 +758,43 @@ msgid "" "initial values for our instance::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:356 +msgid "" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_XDECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:382 msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:384 +msgid ".tp_init = (initproc) Custom_init," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:386 msgid "" "The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" @@ -436,6 +814,15 @@ msgid "" "``first`` member like this::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:399 +msgid "" +"if (first) {\n" +" Py_XDECREF(self->first);\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:405 msgid "" "But this would be risky. Our type doesn't restrict the type of the " @@ -480,11 +867,28 @@ msgid "" "of ways to do that. The simplest way is to define member definitions::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:427 +msgid "" +"static PyMemberDef Custom_members[] = {\n" +" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" +" \"first name\"},\n" +" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" +" \"last name\"},\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:437 msgid "" "and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:439 +msgid ".tp_members = Custom_members," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:441 msgid "" "Each member definition has a member name, type, offset, access flags and " @@ -509,6 +913,23 @@ msgid "" "name as the concatenation of the first and last names. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:455 +msgid "" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" if (self->first == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"first\");\n" +" return NULL;\n" +" }\n" +" if (self->last == NULL) {\n" +" PyErr_SetString(PyExc_AttributeError, \"last\");\n" +" return NULL;\n" +" }\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:469 msgid "" "The method is implemented as a C function that takes a :class:`!Custom` (or :" @@ -519,6 +940,12 @@ msgid "" "method is equivalent to the Python method:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:476 +msgid "" +"def name(self):\n" +" return \"%s %s\" % (self.first, self.last)" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:481 msgid "" "Note that we have to check for the possibility that our :attr:`!first` and :" @@ -536,6 +963,16 @@ msgstr "" "Agora que definimos o método, precisamos criar uma array de definições de " "métodos::" +#: ../../extending/newtypes_tutorial.rst:490 +msgid "" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:497 msgid "" "(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " @@ -546,6 +983,10 @@ msgstr "" msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:502 +msgid ".tp_methods = Custom_methods," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:504 msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " @@ -554,6 +995,10 @@ msgid "" "to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:509 +msgid ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:511 msgid "" "We rename :c:func:`!PyInit_custom` to :c:func:`!PyInit_custom2`, update the " @@ -565,6 +1010,15 @@ msgstr "" msgid "Finally, we update our :file:`setup.py` file to include the new module," msgstr "" +#: ../../extending/newtypes_tutorial.rst:517 +msgid "" +"from setuptools import Extension, setup\n" +"setup(ext_modules=[\n" +" Extension(\"custom\", [\"custom.c\"]),\n" +" Extension(\"custom2\", [\"custom2.c\"]),\n" +"])" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:525 msgid "and then we re-install so that we can ``import custom2``:" msgstr "" @@ -582,6 +1036,184 @@ msgid "" "make sure that these attributes always contain strings." msgstr "" +#: ../../extending/newtypes_tutorial.rst:540 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" Py_XDECREF(self->first);\n" +" Py_XDECREF(self->last);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_SETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_SETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_getfirst(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->first);\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->first, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_getlast(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->last);\n" +"}\n" +"\n" +"static int\n" +"Custom_setlast(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The last attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_SETREF(self->last, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", (getter) Custom_getfirst, (setter) Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", (getter) Custom_getlast, (setter) Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom3.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_new = Custom_new,\n" +" .tp_init = (initproc) Custom_init,\n" +" .tp_dealloc = (destructor) Custom_dealloc,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +" .tp_getset = Custom_getsetters,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom3\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom3(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:543 msgid "" "To provide greater control, over the :attr:`!first` and :attr:`!last` " @@ -589,6 +1221,37 @@ msgid "" "functions for getting and setting the :attr:`!first` attribute::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:547 +msgid "" +"static PyObject *\n" +"Custom_getfirst(CustomObject *self, void *closure)\n" +"{\n" +" Py_INCREF(self->first);\n" +" return self->first;\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" PyObject *tmp;\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" tmp = self->first;\n" +" Py_INCREF(value);\n" +" self->first = value;\n" +" Py_DECREF(tmp);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:574 msgid "" "The getter function is passed a :class:`!Custom` object and a \"closure\", " @@ -611,10 +1274,25 @@ msgstr "" msgid "We create an array of :c:type:`PyGetSetDef` structures::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:587 +msgid "" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", (getter) Custom_getfirst, (setter) Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", (getter) Custom_getlast, (setter) Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:595 msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::" msgstr "e registra isso num slot :c:member:`~PyTypeObject.tp_getset`::" +#: ../../extending/newtypes_tutorial.rst:597 +msgid ".tp_getset = Custom_getsetters," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:599 msgid "" "The last item in a :c:type:`PyGetSetDef` structure is the \"closure\" " @@ -626,12 +1304,50 @@ msgstr "" msgid "We also remove the member definitions for these attributes::" msgstr "Também removemos as definições de membros para esses atributos::" +#: ../../extending/newtypes_tutorial.rst:604 +msgid "" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:610 msgid "" "We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only " "allow strings [#]_ to be passed::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:613 +msgid "" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL, *tmp;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" tmp = self->first;\n" +" Py_INCREF(first);\n" +" self->first = first;\n" +" Py_DECREF(tmp);\n" +" }\n" +" if (last) {\n" +" tmp = self->last;\n" +" Py_INCREF(last);\n" +" self->last = last;\n" +" Py_DECREF(tmp);\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:639 msgid "" "With these changes, we can assure that the ``first`` and ``last`` members " @@ -660,6 +1376,13 @@ msgid "" "This can happen when objects are involved in cycles. For example, consider:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:658 +msgid "" +">>> l = []\n" +">>> l.append(l)\n" +">>> del l" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:664 msgid "" "In this example, we create a list that contains itself. When we delete it, " @@ -677,6 +1400,15 @@ msgid "" "those two reasons, :class:`!Custom` objects can participate in cycles:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:675 +msgid "" +">>> import custom3\n" +">>> class Derived(custom3.Custom): pass\n" +"...\n" +">>> n = Derived()\n" +">>> n.some_attribute = n" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:683 msgid "" "To allow a :class:`!Custom` instance participating in a reference cycle to " @@ -685,12 +1417,229 @@ msgid "" "these slots:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:687 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"#include /* for offsetof() */\n" +"\n" +"typedef struct {\n" +" PyObject_HEAD\n" +" PyObject *first; /* first name */\n" +" PyObject *last; /* last name */\n" +" int number;\n" +"} CustomObject;\n" +"\n" +"static int\n" +"Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->first);\n" +" Py_VISIT(self->last);\n" +" return 0;\n" +"}\n" +"\n" +"static int\n" +"Custom_clear(CustomObject *self)\n" +"{\n" +" Py_CLEAR(self->first);\n" +" Py_CLEAR(self->last);\n" +" return 0;\n" +"}\n" +"\n" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" Custom_clear(self);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" +"{\n" +" CustomObject *self;\n" +" self = (CustomObject *) type->tp_alloc(type, 0);\n" +" if (self != NULL) {\n" +" self->first = PyUnicode_FromString(\"\");\n" +" if (self->first == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->last = PyUnicode_FromString(\"\");\n" +" if (self->last == NULL) {\n" +" Py_DECREF(self);\n" +" return NULL;\n" +" }\n" +" self->number = 0;\n" +" }\n" +" return (PyObject *) self;\n" +"}\n" +"\n" +"static int\n" +"Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" +" PyObject *first = NULL, *last = NULL;\n" +"\n" +" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" +" &first, &last,\n" +" &self->number))\n" +" return -1;\n" +"\n" +" if (first) {\n" +" Py_SETREF(self->first, Py_NewRef(first));\n" +" }\n" +" if (last) {\n" +" Py_SETREF(self->last, Py_NewRef(last));\n" +" }\n" +" return 0;\n" +"}\n" +"\n" +"static PyMemberDef Custom_members[] = {\n" +" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" +" \"custom number\"},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_getfirst(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->first);\n" +"}\n" +"\n" +"static int\n" +"Custom_setfirst(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The first attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_XSETREF(self->first, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyObject *\n" +"Custom_getlast(CustomObject *self, void *closure)\n" +"{\n" +" return Py_NewRef(self->last);\n" +"}\n" +"\n" +"static int\n" +"Custom_setlast(CustomObject *self, PyObject *value, void *closure)\n" +"{\n" +" if (value == NULL) {\n" +" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " +"attribute\");\n" +" return -1;\n" +" }\n" +" if (!PyUnicode_Check(value)) {\n" +" PyErr_SetString(PyExc_TypeError,\n" +" \"The last attribute value must be a string\");\n" +" return -1;\n" +" }\n" +" Py_XSETREF(self->last, Py_NewRef(value));\n" +" return 0;\n" +"}\n" +"\n" +"static PyGetSetDef Custom_getsetters[] = {\n" +" {\"first\", (getter) Custom_getfirst, (setter) Custom_setfirst,\n" +" \"first name\", NULL},\n" +" {\"last\", (getter) Custom_getlast, (setter) Custom_setlast,\n" +" \"last name\", NULL},\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyObject *\n" +"Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" +"{\n" +" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" +"}\n" +"\n" +"static PyMethodDef Custom_methods[] = {\n" +" {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" +" \"Return the name, combining the first and last name\"\n" +" },\n" +" {NULL} /* Sentinel */\n" +"};\n" +"\n" +"static PyTypeObject CustomType = {\n" +" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"custom4.Custom\",\n" +" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" +" .tp_basicsize = sizeof(CustomObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | " +"Py_TPFLAGS_HAVE_GC,\n" +" .tp_new = Custom_new,\n" +" .tp_init = (initproc) Custom_init,\n" +" .tp_dealloc = (destructor) Custom_dealloc,\n" +" .tp_traverse = (traverseproc) Custom_traverse,\n" +" .tp_clear = (inquiry) Custom_clear,\n" +" .tp_members = Custom_members,\n" +" .tp_methods = Custom_methods,\n" +" .tp_getset = Custom_getsetters,\n" +"};\n" +"\n" +"static PyModuleDef custommodule = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"custom4\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_custom4(void)\n" +"{\n" +" PyObject *m;\n" +" if (PyType_Ready(&CustomType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&custommodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:690 msgid "" "First, the traversal method lets the cyclic GC know about subobjects that " "could participate in cycles::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:693 +msgid "" +"static int\n" +"Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" +"{\n" +" int vret;\n" +" if (self->first) {\n" +" vret = visit(self->first, arg);\n" +" if (vret != 0)\n" +" return vret;\n" +" }\n" +" if (self->last) {\n" +" vret = visit(self->last, arg);\n" +" if (vret != 0)\n" +" return vret;\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:710 msgid "" "For each subobject that can participate in cycles, we need to call the :c:" @@ -707,6 +1656,17 @@ msgid "" "boilerplate in ``Custom_traverse``::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:720 +msgid "" +"static int\n" +"Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" +"{\n" +" Py_VISIT(self->first);\n" +" Py_VISIT(self->last);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:729 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` implementation must name its " @@ -719,6 +1679,17 @@ msgid "" "participate in cycles::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:735 +msgid "" +"static int\n" +"Custom_clear(CustomObject *self)\n" +"{\n" +" Py_CLEAR(self->first);\n" +" Py_CLEAR(self->last);\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:743 msgid "" "Notice the use of the :c:func:`Py_CLEAR` macro. It is the recommended and " @@ -733,6 +1704,14 @@ msgstr "" msgid "You could emulate :c:func:`Py_CLEAR` by writing::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:753 +msgid "" +"PyObject *tmp;\n" +"tmp = self->first;\n" +"self->first = NULL;\n" +"Py_XDECREF(tmp);" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:758 msgid "" "Nevertheless, it is much easier and less error-prone to always use :c:func:" @@ -750,11 +1729,27 @@ msgid "" "`PyObject_GC_UnTrack` and ``Custom_clear``::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:769 +msgid "" +"static void\n" +"Custom_dealloc(CustomObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" Custom_clear(self);\n" +" Py_TYPE(self)->tp_free((PyObject *) self);\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:777 msgid "" "Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:779 +msgid "" +".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC," +msgstr "" + #: ../../extending/newtypes_tutorial.rst:781 msgid "" "That's pretty much it. If we had written custom :c:member:`~PyTypeObject." @@ -783,6 +1778,93 @@ msgid "" "that increases an internal counter:" msgstr "" +#: ../../extending/newtypes_tutorial.rst:799 +msgid "" +">>> import sublist\n" +">>> s = sublist.SubList(range(3))\n" +">>> s.extend(s)\n" +">>> print(len(s))\n" +"6\n" +">>> print(s.increment())\n" +"1\n" +">>> print(s.increment())\n" +"2" +msgstr "" + +#: ../../extending/newtypes_tutorial.rst:811 +msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" +"typedef struct {\n" +" PyListObject list;\n" +" int state;\n" +"} SubListObject;\n" +"\n" +"static PyObject *\n" +"SubList_increment(SubListObject *self, PyObject *unused)\n" +"{\n" +" self->state++;\n" +" return PyLong_FromLong(self->state);\n" +"}\n" +"\n" +"static PyMethodDef SubList_methods[] = {\n" +" {\"increment\", (PyCFunction) SubList_increment, METH_NOARGS,\n" +" PyDoc_STR(\"increment state counter\")},\n" +" {NULL},\n" +"};\n" +"\n" +"static int\n" +"SubList_init(SubListObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" if (PyList_Type.tp_init((PyObject *) self, args, kwds) < 0)\n" +" return -1;\n" +" self->state = 0;\n" +" return 0;\n" +"}\n" +"\n" +"static PyTypeObject SubListType = {\n" +" PyVarObject_HEAD_INIT(NULL, 0)\n" +" .tp_name = \"sublist.SubList\",\n" +" .tp_doc = PyDoc_STR(\"SubList objects\"),\n" +" .tp_basicsize = sizeof(SubListObject),\n" +" .tp_itemsize = 0,\n" +" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" +" .tp_init = (initproc) SubList_init,\n" +" .tp_methods = SubList_methods,\n" +"};\n" +"\n" +"static PyModuleDef sublistmodule = {\n" +" PyModuleDef_HEAD_INIT,\n" +" .m_name = \"sublist\",\n" +" .m_doc = \"Example module that creates an extension type.\",\n" +" .m_size = -1,\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_sublist(void)\n" +"{\n" +" PyObject *m;\n" +" SubListType.tp_base = &PyList_Type;\n" +" if (PyType_Ready(&SubListType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&sublistmodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" Py_INCREF(&SubListType);\n" +" if (PyModule_AddObject(m, \"SubList\", (PyObject *) &SubListType) < 0) " +"{\n" +" Py_DECREF(&SubListType);\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}\n" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:814 msgid "" "As you can see, the source code closely resembles the :class:`!Custom` " @@ -790,6 +1872,14 @@ msgid "" "between them. ::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:817 +msgid "" +"typedef struct {\n" +" PyListObject list;\n" +" int state;\n" +"} SubListObject;" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:822 msgid "" "The primary difference for derived type objects is that the base type's " @@ -804,6 +1894,18 @@ msgid "" "*``::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:829 +msgid "" +"static int\n" +"SubList_init(SubListObject *self, PyObject *args, PyObject *kwds)\n" +"{\n" +" if (PyList_Type.tp_init((PyObject *) self, args, kwds) < 0)\n" +" return -1;\n" +" self->state = 0;\n" +" return 0;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:838 msgid "" "We see above how to call through to the :meth:`~object.__init__` method of " @@ -828,6 +1930,32 @@ msgid "" "function::" msgstr "" +#: ../../extending/newtypes_tutorial.rst:853 +msgid "" +"PyMODINIT_FUNC\n" +"PyInit_sublist(void)\n" +"{\n" +" PyObject* m;\n" +" SubListType.tp_base = &PyList_Type;\n" +" if (PyType_Ready(&SubListType) < 0)\n" +" return NULL;\n" +"\n" +" m = PyModule_Create(&sublistmodule);\n" +" if (m == NULL)\n" +" return NULL;\n" +"\n" +" Py_INCREF(&SubListType);\n" +" if (PyModule_AddObject(m, \"SubList\", (PyObject *) &SubListType) < 0) " +"{\n" +" Py_DECREF(&SubListType);\n" +" Py_DECREF(m);\n" +" return NULL;\n" +" }\n" +"\n" +" return m;\n" +"}" +msgstr "" + #: ../../extending/newtypes_tutorial.rst:875 msgid "" "Before calling :c:func:`PyType_Ready`, the type structure must have the :c:" diff --git a/extending/windows.po b/extending/windows.po index 802415cfb..b88c18e77 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# felipe caridade fernandes , 2021 -# Rafael Fontenelle , 2023 -# Guilherme Alves da Silva, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Guilherme Alves da Silva, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -240,6 +237,12 @@ msgstr "" "vinculador. Para construir duas DLLs, spam e ni (que usa funções C " "encontradas em spam), você pode usar estes comandos::" +#: ../../extending/windows.rst:115 +msgid "" +"cl /LD /I/python/include spam.c ../libs/pythonXY.lib\n" +"cl /LD /I/python/include ni.c spam.lib ../libs/pythonXY.lib" +msgstr "" + #: ../../extending/windows.rst:118 msgid "" "The first command created three files: :file:`spam.obj`, :file:`spam.dll` " diff --git a/faq/design.po b/faq/design.po index 571563cdf..d95254d6c 100644 --- a/faq/design.po +++ b/faq/design.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Fernando, 2021 -# Aline Balogh , 2021 -# Amanda Savluchinske , 2021 -# Alexsandro Matias de Almeida , 2021 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-14 22:56+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -62,6 +56,14 @@ msgstr "" "humano. Ocasionalmente, programadores C irão encontrar um fragmento de " "código como este::" +#: ../../faq/design.rst:21 +msgid "" +"if (x <= y)\n" +" x++;\n" +" y--;\n" +"z++;" +msgstr "" + #: ../../faq/design.rst:26 msgid "" "Only the ``x++`` statement is executed if the condition is true, but the " @@ -126,6 +128,12 @@ msgstr "Por que o cálculo de pontos flutuantes são tão imprecisos?" msgid "Users are often surprised by results like this::" msgstr "Usuários são frequentemente surpreendidos por resultados como este::" +#: ../../faq/design.rst:58 +msgid "" +">>> 1.2 - 1.0\n" +"0.19999999999999996" +msgstr "" + #: ../../faq/design.rst:61 msgid "" "and think it is a bug in Python. It's not. This has little to do with " @@ -156,12 +164,16 @@ msgstr "" #: ../../faq/design.rst:72 msgid "" "Many numbers that can be written easily in decimal notation cannot be " -"expressed exactly in binary floating-point. For example, after::" +"expressed exactly in binary floating point. For example, after::" msgstr "" "Muitos números podem ser escritos facilmente em notação decimal, mas não " "podem ser expressados exatamente em ponto flutuante binário. Por exemplo, " "após::" +#: ../../faq/design.rst:75 +msgid ">>> x = 1.2" +msgstr "" + #: ../../faq/design.rst:77 msgid "" "the value stored for ``x`` is a (very good) approximation to the decimal " @@ -172,10 +184,18 @@ msgstr "" "``1.2``, mas não é exatamente igual. Em uma máquina típica, o valor real " "armazenado é::" +#: ../../faq/design.rst:81 +msgid "1.0011001100110011001100110011001100110011001100110011 (binary)" +msgstr "" + #: ../../faq/design.rst:83 msgid "which is exactly::" msgstr "que é exatamente::" +#: ../../faq/design.rst:85 +msgid "1.1999999999999999555910790149937383830547332763671875 (decimal)" +msgstr "" + #: ../../faq/design.rst:87 msgid "" "The typical precision of 53 bits provides Python floats with 15--16 decimal " @@ -186,7 +206,7 @@ msgstr "" #: ../../faq/design.rst:90 msgid "" -"For a fuller explanation, please see the :ref:`floating point arithmetic " +"For a fuller explanation, please see the :ref:`floating-point arithmetic " "` chapter in the Python tutorial." msgstr "" "Para uma explicação mais completa, consulte o capítulo de :ref:`aritmética " @@ -331,6 +351,12 @@ msgstr "" "Expressões de atribuição usando o operador morsa ``:=`` atribuem uma " "variável em uma expressão::" +#: ../../faq/design.rst:161 +msgid "" +"while chunk := fp.read(200):\n" +" print(chunk)" +msgstr "" + #: ../../faq/design.rst:164 msgid "See :pep:`572` for more information." msgstr "Veja :pep:`572` para mais informações." @@ -407,10 +433,18 @@ msgstr "" "maior parte desses novos métodos foram amplamente aceitos, mas o que parece " "deixar alguns programadores desconfortáveis é::" +#: ../../faq/design.rst:201 +msgid "\", \".join(['1', '2', '4', '8', '16'])" +msgstr "" + #: ../../faq/design.rst:203 msgid "which gives the result::" msgstr "que dá o resultado::" +#: ../../faq/design.rst:205 +msgid "\"1, 2, 4, 8, 16\"" +msgstr "" + #: ../../faq/design.rst:207 msgid "There are two common arguments against this usage." msgstr "Existem dois argumentos comuns contra esse uso." @@ -442,6 +476,10 @@ msgstr "" "dificuldade em ter :meth:`~str.split` como um método string, já que nesse " "caso é fácil ver que ::" +#: ../../faq/design.rst:220 +msgid "\"1, 2, 4, 8, 16\".split(\", \")" +msgstr "" + #: ../../faq/design.rst:222 msgid "" "is an instruction to a string literal to return the substrings delimited by " @@ -480,6 +518,15 @@ msgstr "" "nenhuma exceção for levantada. Na verdade, capturar uma exceção é caro. Nas " "versões do Python anteriores à 2.0 era comum usar esta expressão::" +#: ../../faq/design.rst:240 +msgid "" +"try:\n" +" value = mydict[key]\n" +"except KeyError:\n" +" mydict[key] = getvalue(key)\n" +" value = mydict[key]" +msgstr "" + #: ../../faq/design.rst:246 msgid "" "This only made sense when you expected the dict to have the key almost all " @@ -489,6 +536,14 @@ msgstr "" "chave quase que toda vez. Se esse não fosse o caso, você escrevia desta " "maneira::" +#: ../../faq/design.rst:249 +msgid "" +"if key in mydict:\n" +" value = mydict[key]\n" +"else:\n" +" value = mydict[key] = getvalue(key)" +msgstr "" + #: ../../faq/design.rst:254 msgid "" "For this specific case, you could also use ``value = dict.setdefault(key, " @@ -528,6 +583,16 @@ msgstr "" "possibilidades, você pode criar um dicionário mapeando valores de caso para " "funções a serem chamadas. Por exemplo::" +#: ../../faq/design.rst:272 +msgid "" +"functions = {'a': function_1,\n" +" 'b': function_2,\n" +" 'c': self.method_1}\n" +"\n" +"func = functions[value]\n" +"func()" +msgstr "" + #: ../../faq/design.rst:279 msgid "" "For calling methods on objects, you can simplify yet further by using the :" @@ -537,6 +602,18 @@ msgstr "" "função embutida :func:`getattr` para recuperar métodos com um nome " "específico::" +#: ../../faq/design.rst:282 +msgid "" +"class MyVisitor:\n" +" def visit_a(self):\n" +" ...\n" +"\n" +" def dispatch(self, value):\n" +" method_name = 'visit_' + str(value)\n" +" method = getattr(self, method_name)\n" +" method()" +msgstr "" + #: ../../faq/design.rst:291 msgid "" "It's suggested that you use a prefix for the method names, such as " @@ -684,6 +761,13 @@ msgstr "" "Em algumas implementações do Python, o código a seguir (que funciona bem no " "CPython) provavelmente ficará sem descritores de arquivo:" +#: ../../faq/design.rst:356 +msgid "" +"for file in very_long_list_of_files:\n" +" f = open(file)\n" +" c = f.read(1)" +msgstr "" + #: ../../faq/design.rst:360 msgid "" "Indeed, using CPython's reference counting and destructor scheme, each new " @@ -707,6 +791,13 @@ msgstr "" "keyword:`with`; isso funcionará independentemente do esquema de " "gerenciamento de memória::" +#: ../../faq/design.rst:369 +msgid "" +"for file in very_long_list_of_files:\n" +" with open(file) as f:\n" +" c = f.read(1)" +msgstr "" + #: ../../faq/design.rst:375 msgid "Why doesn't CPython use a more traditional garbage collection scheme?" msgstr "" @@ -951,6 +1042,12 @@ msgstr "" "construir uma nova lista com o mesmo valor ela não será encontrada; por " "exemplo.::" +#: ../../faq/design.rst:483 +msgid "" +"mydict = {[1, 2]: '12'}\n" +"print(mydict[[1, 2]])" +msgstr "" + #: ../../faq/design.rst:486 msgid "" "would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` " @@ -1019,6 +1116,26 @@ msgstr "" "estrutura baseada em hash) permaneça fixo enquanto o objeto estiver no " "dicionário (ou outra estrutura). ::" +#: ../../faq/design.rst:513 +msgid "" +"class ListWrapper:\n" +" def __init__(self, the_list):\n" +" self.the_list = the_list\n" +"\n" +" def __eq__(self, other):\n" +" return self.the_list == other.the_list\n" +"\n" +" def __hash__(self):\n" +" l = self.the_list\n" +" result = 98767 - len(l)*555\n" +" for i, el in enumerate(l):\n" +" try:\n" +" result = result + (hash(el) % 9999999) * 1001 + i\n" +" except Exception:\n" +" result = (result % 7777777) + i * 333\n" +" return result" +msgstr "" + #: ../../faq/design.rst:530 msgid "" "Note that the hash computation is complicated by the possibility that some " @@ -1088,6 +1205,12 @@ msgstr "" "ordena e retorna. Por exemplo, aqui é como se itera em cima das chaves de um " "dicionário de maneira ordenada::" +#: ../../faq/design.rst:559 +msgid "" +"for key in sorted(mydict):\n" +" ... # do whatever with mydict[key]..." +msgstr "" + #: ../../faq/design.rst:564 msgid "How do you specify and enforce an interface spec in Python?" msgstr "" @@ -1218,6 +1341,19 @@ msgstr "" "convenientemente emular todos os usos razoáveis das construções ``go`` ou " "``goto`` de C, Fortran e outras linguagens. Por exemplo::" +#: ../../faq/design.rst:620 +msgid "" +"class label(Exception): pass # declare a label\n" +"\n" +"try:\n" +" ...\n" +" if condition: raise label() # goto label\n" +" ...\n" +"except label: # where to goto\n" +" pass\n" +"..." +msgstr "" + #: ../../faq/design.rst:630 msgid "" "This doesn't allow you to jump into the middle of a loop, but that's usually " @@ -1267,6 +1403,10 @@ msgstr "" "Se você estiver tentando criar nomes de caminho do Windows, observe que " "todas as chamadas do sistema do Windows também aceitam barras::" +#: ../../faq/design.rst:651 +msgid "f = open(\"/mydir/file.txt\") # works fine!" +msgstr "" + #: ../../faq/design.rst:653 msgid "" "If you're trying to build a pathname for a DOS command, try e.g. one of ::" @@ -1274,6 +1414,13 @@ msgstr "" "Se você estiver tentando criar um nome de caminho para um comando DOS, " "tente, por exemplo. um de ::" +#: ../../faq/design.rst:655 +msgid "" +"dir = r\"\\this\\is\\my\\dos\\dir\" \"\\\\\"\n" +"dir = r\"\\this\\is\\my\\dos\\dir\\ \"[:-1]\n" +"dir = \"\\\\this\\\\is\\\\my\\\\dos\\\\dir\\\\\"" +msgstr "" + #: ../../faq/design.rst:661 msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" msgstr "" @@ -1289,6 +1436,13 @@ msgstr "" "chamando o código na entrada e na saída do bloco. Algumas linguagens têm uma " "construção desta forma::" +#: ../../faq/design.rst:667 +msgid "" +"with obj:\n" +" a = 1 # equivalent to obj.a = 1\n" +" total = total + 1 # obj.total = obj.total + 1" +msgstr "" + #: ../../faq/design.rst:671 msgid "In Python, such a construct would be ambiguous." msgstr "Em Python, tal construção seria ambígua." @@ -1323,6 +1477,13 @@ msgstr "" msgid "For instance, take the following incomplete snippet::" msgstr "Por exemplo, pegue o seguinte trecho incompleto::" +#: ../../faq/design.rst:686 +msgid "" +"def foo(a):\n" +" with a:\n" +" print(x)" +msgstr "" + #: ../../faq/design.rst:690 msgid "" "The snippet assumes that ``a`` must have a member attribute called ``x``. " @@ -1348,10 +1509,25 @@ msgstr "" "(redução do volume de código) pode, no entanto, ser facilmente alcançado em " "Python por atribuição. Em vez de::" +#: ../../faq/design.rst:699 +msgid "" +"function(args).mydict[index][index].a = 21\n" +"function(args).mydict[index][index].b = 42\n" +"function(args).mydict[index][index].c = 63" +msgstr "" + #: ../../faq/design.rst:703 msgid "write this::" msgstr "escreva isso::" +#: ../../faq/design.rst:705 +msgid "" +"ref = function(args).mydict[index][index]\n" +"ref.a = 21\n" +"ref.b = 42\n" +"ref.c = 63" +msgstr "" + #: ../../faq/design.rst:710 msgid "" "This also has the side-effect of increasing execution speed because name " @@ -1404,10 +1580,22 @@ msgstr "" "Os dois pontos são obrigatórios primeiramente para melhorar a leitura (um " "dos resultados da linguagem experimental ABC). Considere isso::" +#: ../../faq/design.rst:735 +msgid "" +"if a == b\n" +" print(a)" +msgstr "" + #: ../../faq/design.rst:738 msgid "versus ::" msgstr "versus ::" +#: ../../faq/design.rst:740 +msgid "" +"if a == b:\n" +" print(a)" +msgstr "" + #: ../../faq/design.rst:743 msgid "" "Notice how the second one is slightly easier to read. Notice further how a " @@ -1442,6 +1630,16 @@ msgstr "" "O Python deixa você adicionar uma vírgula ao final de listas, tuplas e " "dicionários::" +#: ../../faq/design.rst:757 +msgid "" +"[1, 2, 3,]\n" +"('a', 'b', 'c',)\n" +"d = {\n" +" \"A\": [1, 5],\n" +" \"B\": [6, 7], # last trailing comma is optional but good style\n" +"}" +msgstr "" + #: ../../faq/design.rst:765 msgid "There are several reasons to allow this." msgstr "Existem várias razões para permitir isso." @@ -1466,6 +1664,16 @@ msgstr "" "Acidentalmente omitir a vírgula pode levar a erros que são difíceis de " "diagnosticar. Por exemplo::" +#: ../../faq/design.rst:775 +msgid "" +"x = [\n" +" \"fee\",\n" +" \"fie\"\n" +" \"foo\",\n" +" \"fum\"\n" +"]" +msgstr "" + #: ../../faq/design.rst:782 msgid "" "This list looks like it has four elements, but it actually contains three: " diff --git a/faq/extending.po b/faq/extending.po index a680e7bb5..f41f1faef 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# mvpetri , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rogério Araújo , 2021 -# Alexsandro Matias de Almeida , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-15 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Alexsandro Matias de Almeida , " -"2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -189,6 +184,13 @@ msgid "" "the argument values::" msgstr "" +#: ../../faq/extending.rst:117 +msgid "" +"PyObject *\n" +"PyObject_CallMethod(PyObject *object, const char *method_name,\n" +" const char *arg_format, ...);" +msgstr "" + #: ../../faq/extending.rst:121 msgid "" "This works for any object that has methods -- whether built-in or user-" @@ -202,6 +204,17 @@ msgid "" "(assuming the file object pointer is \"f\")::" msgstr "" +#: ../../faq/extending.rst:127 +msgid "" +"res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n" +"if (res == NULL) {\n" +" ... an exception occurred ...\n" +"}\n" +"else {\n" +" Py_DECREF(res);\n" +"}" +msgstr "" + #: ../../faq/extending.rst:135 msgid "" "Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the " @@ -228,10 +241,39 @@ msgstr "" msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" msgstr "" +#: ../../faq/extending.rst:151 +msgid "" +">>> import io, sys\n" +">>> sys.stdout = io.StringIO()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(sys.stdout.getvalue())\n" +"foo\n" +"hello world!" +msgstr "" + #: ../../faq/extending.rst:161 msgid "A custom object to do the same would look like this:" msgstr "Um objeto personalizado para fazer a mesma coisa seria esse:" +#: ../../faq/extending.rst:163 +msgid "" +">>> import io, sys\n" +">>> class StdoutCatcher(io.TextIOBase):\n" +"... def __init__(self):\n" +"... self.data = []\n" +"... def write(self, stuff):\n" +"... self.data.append(stuff)\n" +"...\n" +">>> import sys\n" +">>> sys.stdout = StdoutCatcher()\n" +">>> print('foo')\n" +">>> print('hello world!')\n" +">>> sys.stderr.write(''.join(sys.stdout.data))\n" +"foo\n" +"hello world!" +msgstr "" + #: ../../faq/extending.rst:182 msgid "How do I access a module written in Python from C?" msgstr "" @@ -240,6 +282,10 @@ msgstr "" msgid "You can get a pointer to the module object as follows::" msgstr "" +#: ../../faq/extending.rst:186 +msgid "module = PyImport_ImportModule(\"\");" +msgstr "" + #: ../../faq/extending.rst:188 msgid "" "If the module hasn't been imported yet (i.e. it is not yet present in :data:" @@ -255,6 +301,10 @@ msgid "" "module) as follows::" msgstr "" +#: ../../faq/extending.rst:197 +msgid "attr = PyObject_GetAttrString(module, \"\");" +msgstr "" + #: ../../faq/extending.rst:199 msgid "" "Calling :c:func:`PyObject_SetAttrString` to assign to variables in the " @@ -304,10 +354,24 @@ msgstr "" msgid "In your ``.gdbinit`` file (or interactively), add the command:" msgstr "" +#: ../../faq/extending.rst:231 +msgid "br _PyImport_LoadDynamicModule" +msgstr "" + #: ../../faq/extending.rst:235 msgid "Then, when you run GDB:" msgstr "" +#: ../../faq/extending.rst:237 +msgid "" +"$ gdb /local/bin/python\n" +"gdb) run myscript.py\n" +"gdb) continue # repeat until your extension is loaded\n" +"gdb) finish # so that your extension is loaded\n" +"gdb) br myfunction.c:50\n" +"gdb) continue" +msgstr "" + #: ../../faq/extending.rst:247 msgid "" "I want to compile a Python module on my Linux system, but some files are " diff --git a/faq/general.po b/faq/general.po index ede2481b5..e5ee5b658 100644 --- a/faq/general.po +++ b/faq/general.po @@ -4,11 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Bruno Leuenroth , 2021 -# Nicolas Evangelista, 2022 -# Vitor Buxbaum Orlandi, 2023 -# Adorilson Bezerra , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -16,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -281,15 +276,15 @@ msgstr "" "disponível. Consulte `o Python Package Index `_ para " "encontrar pacotes de seu interesse." -#: ../../faq/general.rst:126 +#: ../../faq/general.rst:128 msgid "How does the Python version numbering scheme work?" msgstr "Como funciona o esquema de numeração de versões do Python?" -#: ../../faq/general.rst:128 +#: ../../faq/general.rst:130 msgid "Python versions are numbered \"A.B.C\" or \"A.B\":" msgstr "As versões de Python são enumeradas como \"A.B.C\" ou \"A.B\":" -#: ../../faq/general.rst:130 +#: ../../faq/general.rst:132 msgid "" "*A* is the major version number -- it is only incremented for really major " "changes in the language." @@ -297,7 +292,7 @@ msgstr "" "*A* é o número da versão principal - sendo incrementada apenas em grandes " "mudanças na linguagem." -#: ../../faq/general.rst:132 +#: ../../faq/general.rst:134 msgid "" "*B* is the minor version number -- it is incremented for less earth-" "shattering changes." @@ -305,14 +300,14 @@ msgstr "" "*B* é o número da versão menor - sendo incrementada apenas para mudanças " "menos estruturais." -#: ../../faq/general.rst:134 +#: ../../faq/general.rst:136 msgid "" "*C* is the micro version number -- it is incremented for each bugfix release." msgstr "" "*C* é o número para micro versão -- sendo incrementada apenas para " "lançamento com correção de bugs." -#: ../../faq/general.rst:136 +#: ../../faq/general.rst:138 msgid "" "Not all releases are bugfix releases. In the run-up to a new feature " "release, a series of development releases are made, denoted as alpha, beta, " @@ -332,20 +327,20 @@ msgstr "" "candidatas a lançamento são congeladas, sem alterações, exceto quando " "necessário para corrigir erros críticos." -#: ../../faq/general.rst:144 +#: ../../faq/general.rst:146 msgid "Alpha, beta and release candidate versions have an additional suffix:" msgstr "" "As versões alpha, beta e candidata a lançamento possuem um sufixo adicional:" -#: ../../faq/general.rst:146 +#: ../../faq/general.rst:148 msgid "The suffix for an alpha version is \"aN\" for some small number *N*." msgstr "O sufixo para uma versão alfa é \"aN\" para algum número pequeno *N*." -#: ../../faq/general.rst:147 +#: ../../faq/general.rst:149 msgid "The suffix for a beta version is \"bN\" for some small number *N*." msgstr "O sufixo para uma versão beta é \"bN\" para algum número pequeno *N*." -#: ../../faq/general.rst:148 +#: ../../faq/general.rst:150 msgid "" "The suffix for a release candidate version is \"rcN\" for some small number " "*N*." @@ -353,7 +348,7 @@ msgstr "" "O sufixo para um lançamento em versão candidata é \"rcN\" para algum número " "pequeno *N*." -#: ../../faq/general.rst:150 +#: ../../faq/general.rst:152 msgid "" "In other words, all versions labeled *2.0aN* precede the versions labeled " "*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." @@ -362,7 +357,7 @@ msgstr "" "versões rotuladas como *2.0bN*, que por sua vez precedem versões rotuladas " "como *2.0rcN*, e *estas* precedem 2.0." -#: ../../faq/general.rst:153 +#: ../../faq/general.rst:155 msgid "" "You may also find version numbers with a \"+\" suffix, e.g. \"2.2+\". These " "are unreleased versions, built directly from the CPython development " @@ -376,7 +371,7 @@ msgstr "" "versão menor, a versão é incrementada para a próxima versão secundária, que " "se torna a versão \"a0\", por exemplo, \"2.4a0\"." -#: ../../faq/general.rst:158 +#: ../../faq/general.rst:160 msgid "" "See the `Developer's Guide `__ for more information about the development cycle, " @@ -390,11 +385,11 @@ msgstr "" "compatibilidade com versões anteriores do Python. Veja também a documentação " "para :data:`sys.version`, :data:`sys.hexversion`, e :data:`sys.version_info`." -#: ../../faq/general.rst:167 +#: ../../faq/general.rst:169 msgid "How do I obtain a copy of the Python source?" msgstr "Como faço para obter uma cópia dos fonte do Python?" -#: ../../faq/general.rst:169 +#: ../../faq/general.rst:171 msgid "" "The latest Python source distribution is always available from python.org, " "at https://www.python.org/downloads/. The latest development sources can be " @@ -404,7 +399,7 @@ msgstr "" "em https://www.python.org/downloads/. As últimas fontes de desenvolvimento " "podem ser obtidas em https://github.com/python/cpython/." -#: ../../faq/general.rst:173 +#: ../../faq/general.rst:175 msgid "" "The source distribution is a gzipped tar file containing the complete C " "source, Sphinx-formatted documentation, Python library modules, example " @@ -417,7 +412,7 @@ msgstr "" "distribuível. A fonte compilará e executará sem a necessidade de " "configurações extras na maioria das plataformas UNIX." -#: ../../faq/general.rst:178 +#: ../../faq/general.rst:180 msgid "" "Consult the `Getting Started section of the Python Developer's Guide " "`__ for more information on getting the " @@ -427,7 +422,7 @@ msgstr "" "devguide.python.org/setup/>`__ para obter mais informações sobre como obter " "o código-fonte e compilá-lo." -#: ../../faq/general.rst:184 +#: ../../faq/general.rst:186 msgid "How do I get documentation on Python?" msgstr "Como faço para obter a documentação do Python?" @@ -913,6 +908,34 @@ msgstr "" "outra janela. Se eles não conseguirem se lembrar dos métodos de uma lista, " "eles podem fazer algo assim::" +#: ../../faq/general.rst:412 +msgid "" +">>> L = []\n" +">>> dir(L) \n" +"['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',\n" +"'__dir__', '__doc__', '__eq__', '__format__', '__ge__',\n" +"'__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',\n" +"'__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__',\n" +"'__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',\n" +"'__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__',\n" +"'__sizeof__', '__str__', '__subclasshook__', 'append', 'clear',\n" +"'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove',\n" +"'reverse', 'sort']\n" +">>> [d for d in dir(L) if '__' not in d]\n" +"['append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', " +"'remove', 'reverse', 'sort']\n" +"\n" +">>> help(L.append)\n" +"Help on built-in function append:\n" +"\n" +"append(...)\n" +" L.append(object) -> None -- append object to end\n" +"\n" +">>> L.append(1)\n" +">>> L\n" +"[1]" +msgstr "" + #: ../../faq/general.rst:436 msgid "" "With the interpreter, documentation is never far from the student as they " diff --git a/faq/gui.po b/faq/gui.po index 19b38643b..4edbcbe60 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/index.po b/faq/index.po index 37a732b99..8d385dc5f 100644 --- a/faq/index.po +++ b/faq/index.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Ruan Aragão , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Ruan Aragão , 2021\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/installed.po b/faq/installed.po index 399e89bc6..e99fbbf81 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Tiago Henrique , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Bruno Leuenroth , 2021 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/faq/library.po b/faq/library.po index ba9bdf803..231985855 100644 --- a/faq/library.po +++ b/faq/library.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Adson Rodrigues , 2021 -# Alexandre B A Villares, 2021 -# Mariana Costa , 2021 -# a76d6fb6142d7607ab0526dcbddb02d7_7bf0da0 <3b5fb0f281c8dfb4c0170f2ee2a6cfcf_843623>, 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-26 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -108,6 +102,12 @@ msgstr "" "módulos escritos em C e vinculados ao interpretador; para obter uma dessas " "listas, digite::" +#: ../../faq/library.rst:42 +msgid "" +"import sys\n" +"print(sys.builtin_module_names)" +msgstr "" + #: ../../faq/library.rst:47 msgid "How do I make a Python script executable on Unix?" msgstr "Como tornar um script Python executável no Unix?" @@ -138,6 +138,10 @@ msgstr "" "A segunda coisa pode ser feita de várias maneiras. A maneira mais direta é " "escrever ::" +#: ../../faq/library.rst:59 +msgid "#!/usr/local/bin/python" +msgstr "" + #: ../../faq/library.rst:61 msgid "" "as the very first line of your file, using the pathname for where the Python " @@ -158,6 +162,10 @@ msgstr "" "Unix suportam o seguinte, presumindo que o interpretador Python esteja em um " "diretório no :envvar:`PATH` do usuário::" +#: ../../faq/library.rst:69 +msgid "#!/usr/bin/env python" +msgstr "" + #: ../../faq/library.rst:71 msgid "" "*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI " @@ -178,6 +186,14 @@ msgstr "" "program:`/usr/bin/env` falha; ou não há nenhum programa env. Nesse caso, " "você pode tentar o seguinte hack (graças a Alex Rezinsky):" +#: ../../faq/library.rst:79 +msgid "" +"#! /bin/sh\n" +"\"\"\":\"\n" +"exec python $0 ${1+\"$@\"}\n" +"\"\"\"" +msgstr "" + #: ../../faq/library.rst:86 msgid "" "The minor disadvantage is that this defines the script's __doc__ string. " @@ -186,6 +202,10 @@ msgstr "" "Uma pequena desvantagem é que isso define o script's __doc__ string. " "Entretanto, você pode corrigir isso adicionando ::" +#: ../../faq/library.rst:89 +msgid "__doc__ = \"\"\"...Whatever...\"\"\"" +msgstr "" + #: ../../faq/library.rst:94 msgid "Is there a curses/termcap package for Python?" msgstr "Existe um pacote de curses/termcap para Python?" @@ -242,10 +262,20 @@ msgstr "" "O maior problema é que o manipulador de sinal é declarado com uma lista de " "argumentos incorretos. Isso é chamado como ::" +#: ../../faq/library.rst:123 +msgid "handler(signum, frame)" +msgstr "" + #: ../../faq/library.rst:125 msgid "so it should be declared with two parameters::" msgstr "portanto, isso deve ser declarado com dois parâmetros::" +#: ../../faq/library.rst:127 +msgid "" +"def handler(signum, frame):\n" +" ..." +msgstr "" + #: ../../faq/library.rst:132 msgid "Common tasks" msgstr "Tarefas comuns" @@ -294,6 +324,12 @@ msgstr "" msgid "The \"global main logic\" of your program may be as simple as ::" msgstr "A lógica principal do seu programa pode tão simples quanto ::" +#: ../../faq/library.rst:154 +msgid "" +"if __name__ == \"__main__\":\n" +" main_logic()" +msgstr "" + #: ../../faq/library.rst:157 msgid "at the bottom of the main module of your program." msgstr "no botão do módulo principal do seus programa." @@ -327,6 +363,12 @@ msgstr "" "Os \"módulos de suporte\" que não se destinam a ser o módulo principal de um " "programa podem incluir um autoteste do módulo. ::" +#: ../../faq/library.rst:170 +msgid "" +"if __name__ == \"__main__\":\n" +" self_test()" +msgstr "" + #: ../../faq/library.rst:173 msgid "" "Even programs that interact with complex external interfaces may be tested " @@ -405,6 +447,21 @@ msgstr "" "Uma solução simples é adicionar um tempo de espera no final do programa até " "que todos os threads sejam concluídos::" +#: ../../faq/library.rst:253 +msgid "" +"import threading, time\n" +"\n" +"def thread_task(name, n):\n" +" for i in range(n):\n" +" print(name, i)\n" +"\n" +"for i in range(10):\n" +" T = threading.Thread(target=thread_task, args=(str(i), i))\n" +" T.start()\n" +"\n" +"time.sleep(10) # <---------------------------!" +msgstr "" + #: ../../faq/library.rst:265 msgid "" "But now (on many platforms) the threads don't run in parallel, but appear to " @@ -422,6 +479,20 @@ msgstr "" "Uma solução simples é adicionar um pequeno tempo de espera no início da " "função::" +#: ../../faq/library.rst:271 +msgid "" +"def thread_task(name, n):\n" +" time.sleep(0.001) # <--------------------!\n" +" for i in range(n):\n" +" print(name, i)\n" +"\n" +"for i in range(10):\n" +" T = threading.Thread(target=thread_task, args=(str(i), i))\n" +" T.start()\n" +"\n" +"time.sleep(10)" +msgstr "" + #: ../../faq/library.rst:282 msgid "" "Instead of trying to guess a good delay value for :func:`time.sleep`, it's " @@ -469,10 +540,66 @@ msgstr "" msgid "Here's a trivial example::" msgstr "Aqui está um exemplo simples::" +#: ../../faq/library.rst:304 +msgid "" +"import threading, queue, time\n" +"\n" +"# The worker thread gets jobs off the queue. When the queue is empty, it\n" +"# assumes there will be no more work and exits.\n" +"# (Realistically workers will run until terminated.)\n" +"def worker():\n" +" print('Running worker')\n" +" time.sleep(0.1)\n" +" while True:\n" +" try:\n" +" arg = q.get(block=False)\n" +" except queue.Empty:\n" +" print('Worker', threading.current_thread(), end=' ')\n" +" print('queue empty')\n" +" break\n" +" else:\n" +" print('Worker', threading.current_thread(), end=' ')\n" +" print('running with argument', arg)\n" +" time.sleep(0.5)\n" +"\n" +"# Create queue\n" +"q = queue.Queue()\n" +"\n" +"# Start a pool of 5 workers\n" +"for i in range(5):\n" +" t = threading.Thread(target=worker, name='worker %i' % (i+1))\n" +" t.start()\n" +"\n" +"# Begin adding work to the queue\n" +"for i in range(50):\n" +" q.put(i)\n" +"\n" +"# Give threads time to run\n" +"print('Main thread sleeping')\n" +"time.sleep(5)" +msgstr "" + #: ../../faq/library.rst:340 msgid "When run, this will produce the following output:" msgstr "Quando executado, isso produzirá a seguinte saída:" +#: ../../faq/library.rst:342 +msgid "" +"Running worker\n" +"Running worker\n" +"Running worker\n" +"Running worker\n" +"Running worker\n" +"Main thread sleeping\n" +"Worker running with argument 0\n" +"Worker running with argument 1\n" +"Worker running with argument 2\n" +"Worker running with argument 3\n" +"Worker running with argument 4\n" +"Worker running with argument 5\n" +"..." +msgstr "" + #: ../../faq/library.rst:358 msgid "" "Consult the module's documentation for more details; the :class:`~queue." @@ -522,10 +649,33 @@ msgstr "" "Por exemplo, as seguintes operações são todas atômicas (L, L1, L2 são " "listas, D, D1, D2 são dicionários, x, y são objetos, i, j são inteiros)::" +#: ../../faq/library.rst:380 +msgid "" +"L.append(x)\n" +"L1.extend(L2)\n" +"x = L[i]\n" +"x = L.pop()\n" +"L1[i:j] = L2\n" +"L.sort()\n" +"x = y\n" +"x.field = y\n" +"D[x] = y\n" +"D1.update(D2)\n" +"D.keys()" +msgstr "" + #: ../../faq/library.rst:392 msgid "These aren't::" msgstr "Esses não são::" +#: ../../faq/library.rst:394 +msgid "" +"i = i+1\n" +"L.append(L[-1])\n" +"L[i] = L[j]\n" +"D[x] = D[x] + 1" +msgstr "" + #: ../../faq/library.rst:399 msgid "" "Operations that replace other objects may invoke those other objects' :meth:" @@ -754,6 +904,15 @@ msgstr "" "Por exemplo, o código a seguir lê dois inteiros de 2 bytes e um inteiro de 4 " "bytes no formato big-endian de um arquivo:" +#: ../../faq/library.rst:506 +msgid "" +"import struct\n" +"\n" +"with open(filename, \"rb\") as f:\n" +" s = f.read(8)\n" +" x, y, z = struct.unpack(\">hhl\", s)" +msgstr "" + #: ../../faq/library.rst:512 msgid "" "The '>' in the format string forces big-endian data; the letter 'h' reads " @@ -871,6 +1030,13 @@ msgstr "" "exemplo, você pode confundir módulos de extensão tentando fazer E/S). Se " "for, use :func:`os.close`::" +#: ../../faq/library.rst:649 +msgid "" +"os.close(stdin.fileno())\n" +"os.close(stdout.fileno())\n" +"os.close(stderr.fileno())" +msgstr "" + #: ../../faq/library.rst:653 msgid "Or you can use the numeric constants 0, 1 and 2, respectively." msgstr "Ou você pode usar as constantes numéricas 0, 1 e 2, respectivamente." @@ -924,6 +1090,22 @@ msgstr "" msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::" msgstr "" +#: ../../faq/library.rst:683 +msgid "" +"#!/usr/local/bin/python\n" +"\n" +"import urllib.request\n" +"\n" +"# build the query string\n" +"qs = \"First=Josephine&MI=Q&Last=Public\"\n" +"\n" +"# connect and send the server a path\n" +"req = urllib.request.urlopen('http://www.some-server.out-there'\n" +" '/cgi-bin/some-cgi-script', data=qs)\n" +"with req:\n" +" msg, hdrs = req.read(), req.info()" +msgstr "" + #: ../../faq/library.rst:696 msgid "" "Note that in general for percent-encoded POST operations, query strings must " @@ -931,6 +1113,13 @@ msgid "" "``name=Guy Steele, Jr.``::" msgstr "" +#: ../../faq/library.rst:700 +msgid "" +">>> import urllib.parse\n" +">>> urllib.parse.urlencode({'name': 'Guy Steele, Jr.'})\n" +"'name=Guy+Steele%2C+Jr.'" +msgstr "" + #: ../../faq/library.rst:704 msgid ":ref:`urllib-howto` for extensive examples." msgstr ":ref:`urllib-howto` para mais exemplos." @@ -963,6 +1152,26 @@ msgstr "" "Aqui está um remetente de e-mail interativo muito simples. Este método " "funcionará em qualquer host que suporte o protocolo SMTP. ::" +#: ../../faq/library.rst:724 +msgid "" +"import sys, smtplib\n" +"\n" +"fromaddr = input(\"From: \")\n" +"toaddrs = input(\"To: \").split(',')\n" +"print(\"Enter message, end with ^D:\")\n" +"msg = ''\n" +"while True:\n" +" line = sys.stdin.readline()\n" +" if not line:\n" +" break\n" +" msg += line\n" +"\n" +"# The actual mail send\n" +"server = smtplib.SMTP('localhost')\n" +"server.sendmail(fromaddr, toaddrs, msg)\n" +"server.quit()" +msgstr "" + #: ../../faq/library.rst:741 msgid "" "A Unix-only alternative uses sendmail. The location of the sendmail program " @@ -975,6 +1184,22 @@ msgstr "" "``/usr/sbin/sendmail``. A página de manual do sendmail vai ajudar você. Aqui " "está um código de exemplo::" +#: ../../faq/library.rst:746 +msgid "" +"import os\n" +"\n" +"SENDMAIL = \"/usr/sbin/sendmail\" # sendmail location\n" +"p = os.popen(\"%s -t -i\" % SENDMAIL, \"w\")\n" +"p.write(\"To: receiver@example.com\\n\")\n" +"p.write(\"Subject: test\\n\")\n" +"p.write(\"\\n\") # blank line separating headers from body\n" +"p.write(\"Some text\\n\")\n" +"p.write(\"some more text\\n\")\n" +"sts = p.close()\n" +"if sts != 0:\n" +" print(\"Sendmail exit status\", sts)" +msgstr "" + #: ../../faq/library.rst:761 msgid "How do I avoid blocking in the connect() method of a socket?" msgstr "Como evito um bloqueio no método connect() de um soquete?" @@ -1098,8 +1323,14 @@ msgstr "" "O módulo padrão :mod:`random` implementa um gerador de números aleatórios. O " "uso é simples::" +#: ../../faq/library.rst:825 +msgid "" +"import random\n" +"random.random()" +msgstr "" + #: ../../faq/library.rst:828 -msgid "This returns a random floating point number in the range [0, 1)." +msgid "This returns a random floating-point number in the range [0, 1)." msgstr "Isso retorna um número flutuante aleatório no intervalo [0, 1)." #: ../../faq/library.rst:830 @@ -1113,8 +1344,9 @@ msgstr "" "``randrange(a, b)`` escolhe um número inteiro no intervalo entre [a, b)." #: ../../faq/library.rst:833 -msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)." -msgstr "``uniform(a, b)`` escolhe um número float no intervalo [a, b)." +msgid "``uniform(a, b)`` chooses a floating-point number in the range [a, b)." +msgstr "" +"``uniform(a, b)`` escolhe um número de ponto flutuante no intervalo [a, b)." #: ../../faq/library.rst:834 msgid "" diff --git a/faq/programming.po b/faq/programming.po index 237ff0977..82f97b8b8 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -4,31 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Tiago Henrique , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Aline Balogh , 2021 -# Augusta Carla Klug , 2021 -# Leonardo Mendes, 2021 -# Rodrigo Cendamore, 2023 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -393,6 +384,13 @@ msgstr "" "Suponha que utilizes um loop for para definir algumas funções lambdas (ou " "mesmo funções simples), por exemplo.::" +#: ../../faq/programming.rst:213 +msgid "" +">>> squares = []\n" +">>> for x in range(5):\n" +"... squares.append(lambda: x**2)" +msgstr "" + #: ../../faq/programming.rst:217 msgid "" "This gives you a list that contains 5 lambdas that calculate ``x**2``. You " @@ -405,6 +403,14 @@ msgstr "" "``1``, ``4``, ``9``, e ``16``. No entanto, quando realmente tentares, verás " "que todos retornam ``16``::" +#: ../../faq/programming.rst:222 +msgid "" +">>> squares[2]()\n" +"16\n" +">>> squares[4]()\n" +"16" +msgstr "" + #: ../../faq/programming.rst:227 msgid "" "This happens because ``x`` is not local to the lambdas, but is defined in " @@ -420,6 +426,13 @@ msgstr "" "isso alterando o valor de ``x`` e vendo como os resultados dos lambdas " "mudam::" +#: ../../faq/programming.rst:233 +msgid "" +">>> x = 8\n" +">>> squares[2]()\n" +"64" +msgstr "" + #: ../../faq/programming.rst:237 msgid "" "In order to avoid this, you need to save the values in variables local to " @@ -428,6 +441,13 @@ msgstr "" "Para evitar isso, precisarás salvar os valores nas variáveis locais para os " "lambdas, para que eles não dependam do valor de ``x`` global::" +#: ../../faq/programming.rst:240 +msgid "" +">>> squares = []\n" +">>> for x in range(5):\n" +"... squares.append(lambda n=x: n**2)" +msgstr "" + #: ../../faq/programming.rst:244 msgid "" "Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed " @@ -443,6 +463,14 @@ msgstr "" "e assim por diante. Portanto, cada lambda agora retornará o resultado " "correto::" +#: ../../faq/programming.rst:250 +msgid "" +">>> squares[2]()\n" +"4\n" +">>> squares[4]()\n" +"16" +msgstr "" + #: ../../faq/programming.rst:255 msgid "" "Note that this behaviour is not peculiar to lambdas, but applies to regular " @@ -475,14 +503,31 @@ msgstr "" msgid "config.py::" msgstr "config.py::" +#: ../../faq/programming.rst:270 +msgid "x = 0 # Default value of the 'x' configuration setting" +msgstr "" + #: ../../faq/programming.rst:272 msgid "mod.py::" msgstr "mod.py::" +#: ../../faq/programming.rst:274 +msgid "" +"import config\n" +"config.x = 1" +msgstr "" + #: ../../faq/programming.rst:277 msgid "main.py::" msgstr "main.py::" +#: ../../faq/programming.rst:279 +msgid "" +"import config\n" +"import mod\n" +"print(config.x)" +msgstr "" + #: ../../faq/programming.rst:283 msgid "" "Note that using a module is also the basis for implementing the singleton " @@ -630,6 +675,14 @@ msgstr "" "Este tipo de erro geralmente pega programadores neófitos. Considere esta " "função::" +#: ../../faq/programming.rst:342 +msgid "" +"def foo(mydict={}): # Danger: shared reference to one dict for all calls\n" +" ... compute something ...\n" +" mydict[key] = value\n" +" return mydict" +msgstr "" + #: ../../faq/programming.rst:347 msgid "" "The first time you call this function, ``mydict`` contains a single item. " @@ -679,10 +732,23 @@ msgstr "" "e crie uma nova lista /dicionário/ o que quer que seja. Por exemplo, escreva " "o seguinte código::" +#: ../../faq/programming.rst:365 +msgid "" +"def foo(mydict={}):\n" +" ..." +msgstr "" + #: ../../faq/programming.rst:368 msgid "but::" msgstr "mas::" +#: ../../faq/programming.rst:370 +msgid "" +"def foo(mydict=None):\n" +" if mydict is None:\n" +" mydict = {} # create a new dict for local namespace" +msgstr "" + #: ../../faq/programming.rst:374 msgid "" "This feature can be useful. When you have a function that's time-consuming " @@ -697,6 +763,20 @@ msgstr "" "se o mesmo valor for solicitado novamente. Isso se chama \"memoizar\", e " "pode ser implementado da seguinte forma::" +#: ../../faq/programming.rst:379 +msgid "" +"# Callers can only provide two parameters and optionally pass _cache by " +"keyword\n" +"def expensive(arg1, arg2, *, _cache={}):\n" +" if (arg1, arg2) in _cache:\n" +" return _cache[(arg1, arg2)]\n" +"\n" +" # Calculate the value\n" +" result = ... expensive computation ...\n" +" _cache[(arg1, arg2)] = result # Store result in the cache\n" +" return result" +msgstr "" + #: ../../faq/programming.rst:389 msgid "" "You could use a global variable containing a dictionary instead of the " @@ -725,6 +805,15 @@ msgstr "" "também, passar esses argumentos ao invocar outra função usando ``*`` e " "``**``::" +#: ../../faq/programming.rst:401 +msgid "" +"def f(x, *args, **kwargs):\n" +" ...\n" +" kwargs['width'] = '14.3c'\n" +" ...\n" +" g(x, *args, **kwargs)" +msgstr "" + #: ../../faq/programming.rst:415 msgid "What is the difference between arguments and parameters?" msgstr "Qual a diferença entre argumentos e parâmetros?" @@ -738,6 +827,12 @@ msgid "" "the function definition::" msgstr "" +#: ../../faq/programming.rst:423 +msgid "" +"def func(foo, bar=None, **kwargs):\n" +" pass" +msgstr "" + #: ../../faq/programming.rst:426 msgid "" "*foo*, *bar* and *kwargs* are parameters of ``func``. However, when calling " @@ -746,6 +841,10 @@ msgstr "" "*foo*, *bar* e *kwargs* são parâmetros de ``func``. Dessa forma, ao invocar " "``func``, por exemplo::" +#: ../../faq/programming.rst:429 +msgid "func(42, bar=314, extra=somevar)" +msgstr "" + #: ../../faq/programming.rst:431 msgid "the values ``42``, ``314``, and ``somevar`` are arguments." msgstr "os valores ``42``, ``314``, e ``somevar`` são os argumentos." @@ -758,6 +857,17 @@ msgstr "Por que ao alterar a lista 'y' também altera a lista 'x'?" msgid "If you wrote code like::" msgstr "Se escreveres um código como::" +#: ../../faq/programming.rst:439 +msgid "" +">>> x = []\n" +">>> y = x\n" +">>> y.append(10)\n" +">>> y\n" +"[10]\n" +">>> x\n" +"[10]" +msgstr "" + #: ../../faq/programming.rst:447 msgid "" "you might be wondering why appending an element to ``y`` changed ``x`` too." @@ -800,6 +910,17 @@ msgstr "" msgid "If we instead assign an immutable object to ``x``::" msgstr "Se por acaso, atribuímos um objeto imutável a ``x``::" +#: ../../faq/programming.rst:463 +msgid "" +">>> x = 5 # ints are immutable\n" +">>> y = x\n" +">>> x = x + 1 # 5 can't be mutated, we are creating a new object here\n" +">>> x\n" +"6\n" +">>> y\n" +"5" +msgstr "" + #: ../../faq/programming.rst:471 msgid "" "we can see that in this case ``x`` and ``y`` are not equal anymore. This is " @@ -903,6 +1024,18 @@ msgstr "" msgid "By returning a tuple of the results::" msgstr "Retornando um Tupla com os resultados::" +#: ../../faq/programming.rst:519 +msgid "" +">>> def func1(a, b):\n" +"... a = 'new-value' # a and b are local names\n" +"... b = b + 1 # assigned to new objects\n" +"... return a, b # return new values\n" +"...\n" +">>> x, y = 'old-value', 99\n" +">>> func1(x, y)\n" +"('new-value', 100)" +msgstr "" + #: ../../faq/programming.rst:528 msgid "This is almost always the clearest solution." msgstr "Esta quase sempre é a solução mais clara." @@ -919,14 +1052,55 @@ msgid "By passing a mutable (changeable in-place) object::" msgstr "" "Pela passagem de um objeto mutável (que possa ser alterado internamente)::" +#: ../../faq/programming.rst:534 +msgid "" +">>> def func2(a):\n" +"... a[0] = 'new-value' # 'a' references a mutable list\n" +"... a[1] = a[1] + 1 # changes a shared object\n" +"...\n" +">>> args = ['old-value', 99]\n" +">>> func2(args)\n" +">>> args\n" +"['new-value', 100]" +msgstr "" + #: ../../faq/programming.rst:543 msgid "By passing in a dictionary that gets mutated::" msgstr "Pela passagem de um dicionário que seja mutável::" +#: ../../faq/programming.rst:545 +msgid "" +">>> def func3(args):\n" +"... args['a'] = 'new-value' # args is a mutable dictionary\n" +"... args['b'] = args['b'] + 1 # change it in-place\n" +"...\n" +">>> args = {'a': 'old-value', 'b': 99}\n" +">>> func3(args)\n" +">>> args\n" +"{'a': 'new-value', 'b': 100}" +msgstr "" + #: ../../faq/programming.rst:554 msgid "Or bundle up values in a class instance::" msgstr "Ou agrupando valores numa instância de classe::" +#: ../../faq/programming.rst:556 +msgid "" +">>> class Namespace:\n" +"... def __init__(self, /, **args):\n" +"... for key, value in args.items():\n" +"... setattr(self, key, value)\n" +"...\n" +">>> def func4(args):\n" +"... args.a = 'new-value' # args is a mutable Namespace\n" +"... args.b = args.b + 1 # change object in-place\n" +"...\n" +">>> args = Namespace(a='old-value', b=99)\n" +">>> func4(args)\n" +">>> vars(args)\n" +"{'a': 'new-value', 'b': 100}" +msgstr "" + #: ../../faq/programming.rst:571 msgid "There's almost never a good reason to get this complicated." msgstr "Quase nunca existe uma boa razão para complicar isso." @@ -953,14 +1127,37 @@ msgstr "" "retorne uma função ``f(x)`` que calcule o valor ``a*x+b``. Usando escopos " "aninhados, temos::" +#: ../../faq/programming.rst:583 +msgid "" +"def linear(a, b):\n" +" def result(x):\n" +" return a * x + b\n" +" return result" +msgstr "" + #: ../../faq/programming.rst:588 msgid "Or using a callable object::" msgstr "Ou utilizando objetos chamáveis::" +#: ../../faq/programming.rst:590 +msgid "" +"class linear:\n" +"\n" +" def __init__(self, a, b):\n" +" self.a, self.b = a, b\n" +"\n" +" def __call__(self, x):\n" +" return self.a * x + self.b" +msgstr "" + #: ../../faq/programming.rst:598 msgid "In both cases, ::" msgstr "Em ambos os casos::" +#: ../../faq/programming.rst:600 +msgid "taxes = linear(0.3, 2)" +msgstr "" + #: ../../faq/programming.rst:602 msgid "gives a callable object where ``taxes(10e6) == 0.3 * 10e6 + 2``." msgstr "dado um objeto chamável, onde ``taxes(10e6) == 0.3 * 10e6 + 2``." @@ -975,10 +1172,37 @@ msgstr "" "lento e resulta num código ligeiramente mais longo. No entanto, note que uma " "coleção de chamáveis pode compartilhar sua assinatura via herança::" +#: ../../faq/programming.rst:608 +msgid "" +"class exponential(linear):\n" +" # __init__ inherited\n" +" def __call__(self, x):\n" +" return self.a * (x ** self.b)" +msgstr "" + #: ../../faq/programming.rst:613 msgid "Object can encapsulate state for several methods::" msgstr "Objetos podem encapsular o estado para vários métodos::" +#: ../../faq/programming.rst:615 +msgid "" +"class counter:\n" +"\n" +" value = 0\n" +"\n" +" def set(self, x):\n" +" self.value = x\n" +"\n" +" def up(self):\n" +" self.value = self.value + 1\n" +"\n" +" def down(self):\n" +" self.value = self.value - 1\n" +"\n" +"count = counter()\n" +"inc, dec, reset = count.up, count.down, count.set" +msgstr "" + #: ../../faq/programming.rst:631 msgid "" "Here ``inc()``, ``dec()`` and ``reset()`` act like functions which share the " @@ -1008,10 +1232,18 @@ msgstr "" "Alguns objetos podem ser copiados com mais facilidade. Os dicionários têm um " "método :meth:`~dict.copy`::" +#: ../../faq/programming.rst:644 +msgid "newdict = olddict.copy()" +msgstr "" + #: ../../faq/programming.rst:646 msgid "Sequences can be copied by slicing::" msgstr "As sequências podem ser copiadas através do uso de fatiamento::" +#: ../../faq/programming.rst:648 +msgid "new_l = l[:]" +msgstr "" + #: ../../faq/programming.rst:652 msgid "How can I find the methods or attributes of an object?" msgstr "Como posso encontrar os métodos ou atributos de um objeto?" @@ -1039,6 +1271,20 @@ msgstr "" "verdade para as instruções ``def`` e ``class``, mas nesse caso o valor é um " "chamável. Considere o seguinte código::" +#: ../../faq/programming.rst:667 +msgid "" +">>> class A:\n" +"... pass\n" +"...\n" +">>> B = A\n" +">>> a = B()\n" +">>> b = a\n" +">>> print(b)\n" +"<__main__.A object at 0x16D07CC>\n" +">>> print(a)\n" +"<__main__.A object at 0x16D07CC>" +msgstr "" + #: ../../faq/programming.rst:678 msgid "" "Arguably the class has a name: even though it is bound to two names and " @@ -1097,6 +1343,12 @@ msgstr "O que há com a precedência do operador vírgula?" msgid "Comma is not an operator in Python. Consider this session::" msgstr "A vírgula não é um operador em Python. Considere este código::" +#: ../../faq/programming.rst:705 +msgid "" +">>> \"a\" in \"b\", \"a\"\n" +"(False, 'a')" +msgstr "" + #: ../../faq/programming.rst:708 msgid "" "Since the comma is not an operator, but a separator between expressions the " @@ -1105,10 +1357,18 @@ msgstr "" "Uma vez que a vírgula não seja um operador, mas um separador entre as " "expressões acima, o código será avaliado como se tivéssemos entrado::" +#: ../../faq/programming.rst:711 +msgid "(\"a\" in \"b\"), \"a\"" +msgstr "" + #: ../../faq/programming.rst:713 msgid "not::" msgstr "não::" +#: ../../faq/programming.rst:715 +msgid "\"a\" in (\"b\", \"a\")" +msgstr "" + #: ../../faq/programming.rst:717 msgid "" "The same is true of the various assignment operators (``=``, ``+=`` etc). " @@ -1127,6 +1387,14 @@ msgstr "Existe um equivalente ao operador \"?:\" ternário do C?" msgid "Yes, there is. The syntax is as follows::" msgstr "Sim existe. A sintaxe é a seguinte::" +#: ../../faq/programming.rst:726 +msgid "" +"[on_true] if [expression] else [on_false]\n" +"\n" +"x, y = 50, 25\n" +"small = x if x < y else y" +msgstr "" + #: ../../faq/programming.rst:731 msgid "" "Before this syntax was introduced in Python 2.5, a common idiom was to use " @@ -1135,6 +1403,10 @@ msgstr "" "Antes que essa sintaxe fosse introduzida no Python 2.5, um idioma comum era " "usar operadores lógicos::" +#: ../../faq/programming.rst:734 +msgid "[expression] and [on_true] or [on_false]" +msgstr "" + #: ../../faq/programming.rst:736 msgid "" "However, this idiom is unsafe, as it can give wrong results when *on_true* " @@ -1156,6 +1428,34 @@ msgid "" "Bartelt::" msgstr "" +#: ../../faq/programming.rst:747 +msgid "" +"from functools import reduce\n" +"\n" +"# Primes < 1000\n" +"print(list(filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,\n" +"map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))))\n" +"\n" +"# First 10 Fibonacci numbers\n" +"print(list(map(lambda x,f=lambda x,f:(f(x-1,f)+f(x-2,f)) if x>1 else 1:\n" +"f(x,f), range(10))))\n" +"\n" +"# Mandelbrot set\n" +"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+'\\n'+y,map(lambda " +"y,\n" +"Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,\n" +"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,\n" +"i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y\n" +">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(\n" +"64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy\n" +"))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24))\n" +"# \\___ ___/ \\___ ___/ | | |__ lines on screen\n" +"# V V | |______ columns on screen\n" +"# | | |__________ maximum of \"iterations\"\n" +"# | |_________________ range on y axis\n" +"# |____________________________ range on x axis" +msgstr "" + #: ../../faq/programming.rst:771 msgid "Don't try this at home, kids!" msgstr "Não tente isso em casa, crianças!" @@ -1181,6 +1481,15 @@ msgstr "" "função que aceita parâmetros somente-posicionais. Sua documentação tem esta " "forma:" +#: ../../faq/programming.rst:786 +msgid "" +">>> help(divmod)\n" +"Help on built-in function divmod in module builtins:\n" +"\n" +"divmod(x, y, /)\n" +" Return the tuple (x//y, x%y). Invariant: div*y + mod == x." +msgstr "" + #: ../../faq/programming.rst:792 msgid "" "The slash at the end of the parameter list means that both parameters are " @@ -1191,6 +1500,14 @@ msgstr "" "são somente-posicionais. Assim, chamar :func:`divmod` com argumentos " "nomeados levaria a um erro::" +#: ../../faq/programming.rst:796 +msgid "" +">>> divmod(x=3, y=4)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: divmod() takes no keyword arguments" +msgstr "" + #: ../../faq/programming.rst:803 msgid "Numbers and strings" msgstr "Números e Strings" @@ -1209,6 +1526,13 @@ msgstr "" "zero e, em seguida, um \"o\" minúsculo ou maiúsculo. Por exemplo, para " "definir a variável \"a\" para o valor octal \"10\" (8 em decimal), digite::" +#: ../../faq/programming.rst:812 +msgid "" +">>> a = 0o10\n" +">>> a\n" +"8" +msgstr "" + #: ../../faq/programming.rst:816 msgid "" "Hexadecimal is just as easy. Simply precede the hexadecimal number with a " @@ -1220,6 +1544,16 @@ msgstr "" "ser especificados em letras maiúsculas e minúsculas. Por exemplo, no " "interpretador Python::" +#: ../../faq/programming.rst:820 +msgid "" +">>> a = 0xa5\n" +">>> a\n" +"165\n" +">>> b = 0XB2\n" +">>> b\n" +"178" +msgstr "" + #: ../../faq/programming.rst:829 msgid "Why does -22 // 10 return -3?" msgstr "Por que -22 // 10 retorna -3?" @@ -1232,6 +1566,10 @@ msgstr "" "É principalmente direcionado pelo desejo de que ``i % j`` possui o mesmo " "sinal que ``j``. Se quiseres isso, e também se desejares::" +#: ../../faq/programming.rst:834 +msgid "i == (i // j) * j + (i % j)" +msgstr "" + #: ../../faq/programming.rst:836 msgid "" "then integer division has to return the floor. C also requires that " @@ -1266,6 +1604,15 @@ msgid "" "exc:`SyntaxError` because the period is seen as a decimal point::" msgstr "" +#: ../../faq/programming.rst:853 +msgid "" +">>> 1.__class__\n" +" File \"\", line 1\n" +" 1.__class__\n" +" ^\n" +"SyntaxError: invalid decimal literal" +msgstr "" + #: ../../faq/programming.rst:859 msgid "" "The solution is to separate the literal from the period with either a space " @@ -1280,8 +1627,8 @@ msgstr "Como faço para converter uma String em um número?" #: ../../faq/programming.rst:871 msgid "" "For integers, use the built-in :func:`int` type constructor, e.g. " -"``int('144') == 144``. Similarly, :func:`float` converts to floating-point, " -"e.g. ``float('144') == 144.0``." +"``int('144') == 144``. Similarly, :func:`float` converts to a floating-" +"point number, e.g. ``float('144') == 144.0``." msgstr "" "Para inteiros, use o tipo embutido :func:`int`, por exemplo, ``int('144') == " "144``. Da mesma forma, :func:`float` converterá para um valor do tipo ponto " @@ -1362,6 +1709,31 @@ msgstr "" "internamente, tente usar a classe :class:`io.StringIO` ou o módulo :mod:" "`array`::" +#: ../../faq/programming.rst:914 +msgid "" +">>> import io\n" +">>> s = \"Hello, world\"\n" +">>> sio = io.StringIO(s)\n" +">>> sio.getvalue()\n" +"'Hello, world'\n" +">>> sio.seek(7)\n" +"7\n" +">>> sio.write(\"there!\")\n" +"6\n" +">>> sio.getvalue()\n" +"'Hello, there!'\n" +"\n" +">>> import array\n" +">>> a = array.array('u', s)\n" +">>> print(a)\n" +"array('u', 'Hello, world')\n" +">>> a[0] = 'y'\n" +">>> print(a)\n" +"array('u', 'yello, world')\n" +">>> a.tounicode()\n" +"'yello, world'" +msgstr "" + #: ../../faq/programming.rst:938 msgid "How do I use strings to call functions/methods?" msgstr "Como faço para invocar funções/métodos através de uma String?" @@ -1382,10 +1754,29 @@ msgstr "" "nomes das funções. Esta é também a principal técnica utilizada para emular " "uma construção de maiúsculas e minúsculas ::" +#: ../../faq/programming.rst:947 +msgid "" +"def a():\n" +" pass\n" +"\n" +"def b():\n" +" pass\n" +"\n" +"dispatch = {'go': a, 'stop': b} # Note lack of parens for funcs\n" +"\n" +"dispatch[get_input()]() # Note trailing parens to call function" +msgstr "" + #: ../../faq/programming.rst:957 msgid "Use the built-in function :func:`getattr`::" msgstr "Utilize a função embutida :func:`getattr`::" +#: ../../faq/programming.rst:959 +msgid "" +"import foo\n" +"getattr(foo, 'bar')()" +msgstr "" + #: ../../faq/programming.rst:962 msgid "" "Note that :func:`getattr` works on any object, including classes, class " @@ -1398,10 +1789,34 @@ msgstr "" msgid "This is used in several places in the standard library, like this::" msgstr "A mesma é usado em vários lugares na biblioteca padrão, como este::" +#: ../../faq/programming.rst:967 +msgid "" +"class Foo:\n" +" def do_foo(self):\n" +" ...\n" +"\n" +" def do_bar(self):\n" +" ...\n" +"\n" +"f = getattr(foo_instance, 'do_' + opname)\n" +"f()" +msgstr "" + #: ../../faq/programming.rst:978 msgid "Use :func:`locals` to resolve the function name::" msgstr "Use :func:`locals` para determinar o nome da função::" +#: ../../faq/programming.rst:980 +msgid "" +"def myFunc():\n" +" print(\"hello\")\n" +"\n" +"fname = \"myFunc\"\n" +"\n" +"f = locals()[fname]\n" +"f()" +msgstr "" + #: ../../faq/programming.rst:990 msgid "" "Is there an equivalent to Perl's chomp() for removing trailing newlines from " @@ -1424,6 +1839,15 @@ msgstr "" "contendo várias linhas vazias no final, os terminadores de linha de todas " "linhas em branco serão removidos::" +#: ../../faq/programming.rst:998 +msgid "" +">>> lines = (\"line 1 \\r\\n\"\n" +"... \"\\r\\n\"\n" +"... \"\\r\\n\")\n" +">>> lines.rstrip(\"\\n\\r\")\n" +"'line 1 '" +msgstr "" + #: ../../faq/programming.rst:1004 msgid "" "Since this is typically only desired when reading text one line at a time, " @@ -1481,24 +1905,51 @@ msgid "" "string's quote::" msgstr "" +#: ../../faq/programming.rst:1036 +msgid "" +">>> r'C:\\this\\will\\not\\work\\'\n" +" File \"\", line 1\n" +" r'C:\\this\\will\\not\\work\\'\n" +" ^\n" +"SyntaxError: unterminated string literal (detected at line 1)" +msgstr "" + #: ../../faq/programming.rst:1042 msgid "" "There are several workarounds for this. One is to use regular strings and " "double the backslashes::" msgstr "" +#: ../../faq/programming.rst:1045 +msgid "" +">>> 'C:\\\\this\\\\will\\\\work\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" +msgstr "" + #: ../../faq/programming.rst:1048 msgid "" "Another is to concatenate a regular string containing an escaped backslash " "to the raw string::" msgstr "" +#: ../../faq/programming.rst:1051 +msgid "" +">>> r'C:\\this\\will\\work' '\\\\'\n" +"'C:\\\\this\\\\will\\\\work\\\\'" +msgstr "" + #: ../../faq/programming.rst:1054 msgid "" "It is also possible to use :func:`os.path.join` to append a backslash on " "Windows::" msgstr "" +#: ../../faq/programming.rst:1056 +msgid "" +">>> os.path.join(r'C:\\this\\will\\work', '')\n" +"'C:\\\\this\\\\will\\\\work\\\\'" +msgstr "" + #: ../../faq/programming.rst:1059 msgid "" "Note that while a backslash will \"escape\" a quote for the purposes of " @@ -1507,6 +1958,12 @@ msgid "" "value of the raw string::" msgstr "" +#: ../../faq/programming.rst:1064 +msgid "" +">>> r'backslash\\'preserved'\n" +"\"backslash\\\\'preserved\"" +msgstr "" + #: ../../faq/programming.rst:1067 msgid "Also see the specification in the :ref:`language reference `." msgstr "" @@ -1674,6 +2131,14 @@ msgstr "" "Para juntar vários objetos :class:`str`, a linguagem recomendada colocá-los " "numa lista e invocar o método :meth:`str.join`::" +#: ../../faq/programming.rst:1141 +msgid "" +"chunks = []\n" +"for s in my_strings:\n" +" chunks.append(s)\n" +"result = ''.join(chunks)" +msgstr "" + #: ../../faq/programming.rst:1146 msgid "(another reasonably efficient idiom is to use :class:`io.StringIO`)" msgstr "" @@ -1689,6 +2154,13 @@ msgstr "" "uma classe :class:`bytearray` usando a concatenação local (com o operador " "``+=``)::" +#: ../../faq/programming.rst:1151 +msgid "" +"result = bytearray()\n" +"for b in my_bytes_objects:\n" +" result += b" +msgstr "" + #: ../../faq/programming.rst:1157 msgid "Sequences (Tuples/Lists)" msgstr "Sequencias (Tuples/Lists)" @@ -1758,6 +2230,12 @@ msgstr "Como que eu itero uma sequência na ordem inversa?" msgid "Use the :func:`reversed` built-in function::" msgstr "Use a função embutida :func:`reversed`::" +#: ../../faq/programming.rst:1194 +msgid "" +"for x in reversed(sequence):\n" +" ... # do something with x ..." +msgstr "" + #: ../../faq/programming.rst:1197 msgid "" "This won't touch your original sequence, but build a new copy with reversed " @@ -1784,6 +2262,18 @@ msgid "" "the list, deleting duplicates as you go::" msgstr "" +#: ../../faq/programming.rst:1211 +msgid "" +"if mylist:\n" +" mylist.sort()\n" +" last = mylist[-1]\n" +" for i in range(len(mylist)-2, -1, -1):\n" +" if last == mylist[i]:\n" +" del mylist[i]\n" +" else:\n" +" last = mylist[i]" +msgstr "" + #: ../../faq/programming.rst:1220 msgid "" "If all elements of the list may be used as set keys (i.e. they are all :term:" @@ -1793,6 +2283,10 @@ msgstr "" "(isto é, eles são todos :term:`hasheáveis `) isso é muitas vezes " "mais rápido ::" +#: ../../faq/programming.rst:1223 +msgid "mylist = list(set(mylist))" +msgstr "" + #: ../../faq/programming.rst:1225 msgid "" "This converts the list into a set, thereby removing duplicates, and then " @@ -1813,6 +2307,13 @@ msgid "" "variations.::" msgstr "" +#: ../../faq/programming.rst:1237 +msgid "" +"mylist[:] = filter(keep_function, mylist)\n" +"mylist[:] = (x for x in mylist if keep_condition)\n" +"mylist[:] = [x for x in mylist if keep_condition]" +msgstr "" + #: ../../faq/programming.rst:1241 msgid "The list comprehension may be fastest." msgstr "A compreensão de lista pode ser a mais rápida." @@ -1825,6 +2326,10 @@ msgstr "Como fazer um vetor em Python?" msgid "Use a list::" msgstr "Utilize uma lista::" +#: ../../faq/programming.rst:1249 +msgid "[\"this\", 1, \"is\", \"an\", \"array\"]" +msgstr "" + #: ../../faq/programming.rst:1251 msgid "" "Lists are equivalent to C or Pascal arrays in their time complexity; the " @@ -1845,6 +2350,10 @@ msgid "" "To get Lisp-style linked lists, you can emulate *cons cells* using tuples::" msgstr "" +#: ../../faq/programming.rst:1262 +msgid "lisp_list = (\"like\", (\"this\", (\"example\", None) ) )" +msgstr "" + #: ../../faq/programming.rst:1264 msgid "" "If mutability is desired, you could use lists instead of tuples. Here the " @@ -1861,14 +2370,31 @@ msgstr "Como faço para criar uma lista multidimensional?" msgid "You probably tried to make a multidimensional array like this::" msgstr "Você provavelmente tentou fazer um Array multidimensional como isso::" +#: ../../faq/programming.rst:1277 +msgid ">>> A = [[None] * 2] * 3" +msgstr "" + #: ../../faq/programming.rst:1279 msgid "This looks correct if you print it:" msgstr "Isso parece correto se você imprimir:" +#: ../../faq/programming.rst:1285 +msgid "" +">>> A\n" +"[[None, None], [None, None], [None, None]]" +msgstr "" + #: ../../faq/programming.rst:1290 msgid "But when you assign a value, it shows up in multiple places:" msgstr "Mas quando atribuíres um valor, o mesmo aparecerá em vários lugares:" +#: ../../faq/programming.rst:1296 +msgid "" +">>> A[0][0] = 5\n" +">>> A\n" +"[[5, None], [5, None], [5, None]]" +msgstr "" + #: ../../faq/programming.rst:1302 msgid "" "The reason is that replicating a list with ``*`` doesn't create copies, it " @@ -1889,6 +2415,13 @@ msgstr "" "A abordagem sugerida é criar uma lista de comprimento desejado primeiro e, " "em seguida, preencher cada elemento com uma lista recém-criada::" +#: ../../faq/programming.rst:1310 +msgid "" +"A = [None] * 3\n" +"for i in range(3):\n" +" A[i] = [None] * 2" +msgstr "" + #: ../../faq/programming.rst:1314 msgid "" "This generates a list containing 3 different lists of length two. You can " @@ -1897,6 +2430,12 @@ msgstr "" "Isso gera uma lista contendo 3 listas diferentes contendo 2 itens cadas. " "Você também pode usar uma compreensão de lista::" +#: ../../faq/programming.rst:1317 +msgid "" +"w, h = 2, 3\n" +"A = [[None] * w for i in range(h)]" +msgstr "" + #: ../../faq/programming.rst:1320 msgid "" "Or, you can use an extension that provides a matrix datatype; `NumPy " @@ -1913,12 +2452,28 @@ msgid "" "term:`list comprehension` is an elegant solution::" msgstr "" +#: ../../faq/programming.rst:1330 +msgid "" +"result = [obj.method() for obj in mylist]\n" +"\n" +"result = [function(obj) for obj in mylist]" +msgstr "" + #: ../../faq/programming.rst:1334 msgid "" "To just run the method or function without saving the return values, a " "plain :keyword:`for` loop will suffice::" msgstr "" +#: ../../faq/programming.rst:1337 +msgid "" +"for obj in mylist:\n" +" obj.method()\n" +"\n" +"for obj in mylist:\n" +" function(obj)" +msgstr "" + #: ../../faq/programming.rst:1346 msgid "" "Why does a_tuple[i] += ['item'] raise an exception when the addition works?" @@ -1943,6 +2498,15 @@ msgstr "" msgid "If you wrote::" msgstr "Se você escrever::" +#: ../../faq/programming.rst:1358 +msgid "" +">>> a_tuple = (1, 2)\n" +">>> a_tuple[0] += 1\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + #: ../../faq/programming.rst:1364 msgid "" "The reason for the exception should be immediately clear: ``1`` is added to " @@ -1960,6 +2524,15 @@ msgstr "" "Por baixo, o que a instrução de atribuição aumentada está fazendo é " "aproximadamente isso::" +#: ../../faq/programming.rst:1373 +msgid "" +">>> result = a_tuple[0] + 1\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + #: ../../faq/programming.rst:1379 msgid "" "It is the assignment part of the operation that produces the error, since a " @@ -1972,12 +2545,27 @@ msgstr "" msgid "When you write something like::" msgstr "Quando você escreve algo como::" +#: ../../faq/programming.rst:1384 +msgid "" +">>> a_tuple = (['foo'], 'bar')\n" +">>> a_tuple[0] += ['item']\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + #: ../../faq/programming.rst:1390 msgid "" "The exception is a bit more surprising, and even more surprising is the fact " "that even though there was an error, the append worked::" msgstr "" +#: ../../faq/programming.rst:1393 +msgid "" +">>> a_tuple[0]\n" +"['foo', 'item']" +msgstr "" + #: ../../faq/programming.rst:1396 msgid "" "To see why this happens, you need to know that (a) if an object implements " @@ -1988,10 +2576,24 @@ msgid "" "we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list.extend`::" msgstr "" +#: ../../faq/programming.rst:1404 +msgid "" +">>> a_list = []\n" +">>> a_list += [1]\n" +">>> a_list\n" +"[1]" +msgstr "" + #: ../../faq/programming.rst:1409 msgid "This is equivalent to::" msgstr "Isso equivale a::" +#: ../../faq/programming.rst:1411 +msgid "" +">>> result = a_list.__iadd__([1])\n" +">>> a_list = result" +msgstr "" + #: ../../faq/programming.rst:1414 msgid "" "The object pointed to by a_list has been mutated, and the pointer to the " @@ -2004,6 +2606,15 @@ msgstr "" msgid "Thus, in our tuple example what is happening is equivalent to::" msgstr "" +#: ../../faq/programming.rst:1421 +msgid "" +">>> result = a_tuple[0].__iadd__(['item'])\n" +">>> a_tuple[0] = result\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: 'tuple' object does not support item assignment" +msgstr "" + #: ../../faq/programming.rst:1427 msgid "" "The :meth:`!__iadd__` succeeds, and thus the list is extended, but even " @@ -2026,6 +2637,12 @@ msgid "" "method::" msgstr "" +#: ../../faq/programming.rst:1439 +msgid "" +"Isorted = L[:]\n" +"Isorted.sort(key=lambda s: int(s[10:15]))" +msgstr "" + #: ../../faq/programming.rst:1444 msgid "How can I sort one list by values from another list?" msgstr "Como eu posso ordenar uma lista pelos valores de outra lista?" @@ -2036,6 +2653,20 @@ msgid "" "pick out the element you want. ::" msgstr "" +#: ../../faq/programming.rst:1449 +msgid "" +">>> list1 = [\"what\", \"I'm\", \"sorting\", \"by\"]\n" +">>> list2 = [\"something\", \"else\", \"to\", \"sort\"]\n" +">>> pairs = zip(list1, list2)\n" +">>> pairs = sorted(pairs)\n" +">>> pairs\n" +"[(\"I'm\", 'else'), ('by', 'sort'), ('sorting', 'to'), ('what', " +"'something')]\n" +">>> result = [x[1] for x in pairs]\n" +">>> result\n" +"['else', 'sort', 'to', 'something']" +msgstr "" + #: ../../faq/programming.rst:1461 msgid "Objects" msgstr "Objetos" @@ -2073,6 +2704,13 @@ msgid "" "definition::" msgstr "" +#: ../../faq/programming.rst:1485 +msgid "" +"class C:\n" +" def meth(self, arg):\n" +" return arg * 2 + self.attribute" +msgstr "" + #: ../../faq/programming.rst:1491 msgid "What is self?" msgstr "O que é o self?" @@ -2115,6 +2753,38 @@ msgid "" "To test for \"true inheritance\", scan the :term:`MRO` of the class:" msgstr "" +#: ../../faq/programming.rst:1516 +msgid "" +"from collections.abc import Mapping\n" +"\n" +"class P:\n" +" pass\n" +"\n" +"class C(P):\n" +" pass\n" +"\n" +"Mapping.register(P)" +msgstr "" + +#: ../../faq/programming.rst:1528 +msgid "" +">>> c = C()\n" +">>> isinstance(c, C) # direct\n" +"True\n" +">>> isinstance(c, P) # indirect\n" +"True\n" +">>> isinstance(c, Mapping) # virtual\n" +"True\n" +"\n" +"# Actual inheritance chain\n" +">>> type(c).__mro__\n" +"(, , )\n" +"\n" +"# Test for \"true inheritance\"\n" +">>> Mapping in type(c).__mro__\n" +"False" +msgstr "" + #: ../../faq/programming.rst:1546 msgid "" "Note that most programs do not use :func:`isinstance` on user-defined " @@ -2125,12 +2795,35 @@ msgid "" "have a function that does something::" msgstr "" +#: ../../faq/programming.rst:1553 +msgid "" +"def search(obj):\n" +" if isinstance(obj, Mailbox):\n" +" ... # code to search a mailbox\n" +" elif isinstance(obj, Document):\n" +" ... # code to search a document\n" +" elif ..." +msgstr "" + #: ../../faq/programming.rst:1560 msgid "" "A better approach is to define a ``search()`` method on all the classes and " "just call it::" msgstr "" +#: ../../faq/programming.rst:1563 +msgid "" +"class Mailbox:\n" +" def search(self):\n" +" ... # code to search a mailbox\n" +"\n" +"class Document:\n" +" def search(self):\n" +" ... # code to search a document\n" +"\n" +"obj.search()" +msgstr "" + #: ../../faq/programming.rst:1575 msgid "What is delegation?" msgstr "O que é delegation?" @@ -2151,6 +2844,20 @@ msgid "" "written data to uppercase::" msgstr "" +#: ../../faq/programming.rst:1587 +msgid "" +"class UpperOut:\n" +"\n" +" def __init__(self, outfile):\n" +" self._outfile = outfile\n" +"\n" +" def write(self, s):\n" +" self._outfile.write(s.upper())\n" +"\n" +" def __getattr__(self, name):\n" +" return getattr(self._outfile, name)" +msgstr "" + #: ../../faq/programming.rst:1598 msgid "" "Here the ``UpperOut`` class redefines the ``write()`` method to convert the " @@ -2170,6 +2877,15 @@ msgid "" "following::" msgstr "" +#: ../../faq/programming.rst:1610 +msgid "" +"class X:\n" +" ...\n" +" def __setattr__(self, name, value):\n" +" self.__dict__[name] = value\n" +" ..." +msgstr "" + #: ../../faq/programming.rst:1616 msgid "" "Most :meth:`!__setattr__` implementations must modify :meth:`self.__dict__ " @@ -2189,6 +2905,13 @@ msgstr "" msgid "Use the built-in :func:`super` function::" msgstr "Use a função embutida :func:`super`::" +#: ../../faq/programming.rst:1626 +msgid "" +"class Derived(Base):\n" +" def meth(self):\n" +" super().meth() # calls Base.meth" +msgstr "" + #: ../../faq/programming.rst:1630 msgid "" "In the example, :func:`super` will automatically determine the instance from " @@ -2210,6 +2933,17 @@ msgid "" "on availability of resources) which base class to use. Example::" msgstr "" +#: ../../faq/programming.rst:1644 +msgid "" +"class Base:\n" +" ...\n" +"\n" +"BaseAlias = Base\n" +"\n" +"class Derived(BaseAlias):\n" +" ..." +msgstr "" + #: ../../faq/programming.rst:1654 msgid "How do I create static class data and static class methods?" msgstr "" @@ -2226,6 +2960,18 @@ msgid "" "the attribute, you have to explicitly use the class name in the assignment::" msgstr "" +#: ../../faq/programming.rst:1662 +msgid "" +"class C:\n" +" count = 0 # number of times C.__init__ called\n" +"\n" +" def __init__(self):\n" +" C.count = C.count + 1\n" +"\n" +" def getcount(self):\n" +" return C.count # or return self.count" +msgstr "" + #: ../../faq/programming.rst:1671 msgid "" "``c.count`` also refers to ``C.count`` for any ``c`` such that " @@ -2241,16 +2987,35 @@ msgid "" "whether inside a method or not::" msgstr "" +#: ../../faq/programming.rst:1680 +msgid "C.count = 314" +msgstr "" + #: ../../faq/programming.rst:1682 msgid "Static methods are possible::" msgstr "Métodos estáticos são possíveis::" +#: ../../faq/programming.rst:1684 +msgid "" +"class C:\n" +" @staticmethod\n" +" def static(arg1, arg2, arg3):\n" +" # No 'self' parameter!\n" +" ..." +msgstr "" + #: ../../faq/programming.rst:1690 msgid "" "However, a far more straightforward way to get the effect of a static method " "is via a simple module-level function::" msgstr "" +#: ../../faq/programming.rst:1693 +msgid "" +"def getcount():\n" +" return C.count" +msgstr "" + #: ../../faq/programming.rst:1696 msgid "" "If your code is structured so as to define one class (or tightly related " @@ -2273,6 +3038,14 @@ msgstr "" msgid "In C++ you'd write" msgstr "Em C++ escreveríamos" +#: ../../faq/programming.rst:1708 +msgid "" +"class C {\n" +" C() { cout << \"No arguments\\n\"; }\n" +" C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" +"}" +msgstr "" + #: ../../faq/programming.rst:1715 msgid "" "In Python you have to write a single constructor that catches all cases " @@ -2281,6 +3054,16 @@ msgstr "" "Em Python você tem que escrever um único construtor que pega todos os casos " "usando argumentos padrão. Por exemplo::" +#: ../../faq/programming.rst:1718 +msgid "" +"class C:\n" +" def __init__(self, i=None):\n" +" if i is None:\n" +" print(\"No arguments\")\n" +" else:\n" +" print(\"Argument is\", i)" +msgstr "" + #: ../../faq/programming.rst:1725 msgid "This is not entirely equivalent, but close enough in practice." msgstr "Isso não é inteiramente equivalente, mas já está bem próximo." @@ -2291,6 +3074,12 @@ msgstr "" "Você também pode tentar uma lista de argumentos de comprimento variável, por " "exemplo::" +#: ../../faq/programming.rst:1729 +msgid "" +"def __init__(self, *args):\n" +" ..." +msgstr "" + #: ../../faq/programming.rst:1732 msgid "The same approach works for all method definitions." msgstr "A mesma abordagem funciona para todas as definições de métodos." @@ -2311,30 +3100,58 @@ msgstr "" #: ../../faq/programming.rst:1744 msgid "" -"This doesn't guarantee privacy: an outside user can still deliberately " -"access the \"_classname__spam\" attribute, and private values are visible in " -"the object's ``__dict__``. Many Python programmers never bother to use " -"private variable names at all." +"The identifier can be used unchanged within the class, but to access it " +"outside the class, the mangled name must be used:" +msgstr "" + +#: ../../faq/programming.rst:1747 +msgid "" +"class A:\n" +" def __one(self):\n" +" return 1\n" +" def two(self):\n" +" return 2 * self.__one()\n" +"\n" +"class B(A):\n" +" def three(self):\n" +" return 3 * self._A__one()\n" +"\n" +"four = 4 * A()._A__one()" msgstr "" -#: ../../faq/programming.rst:1751 +#: ../../faq/programming.rst:1761 +msgid "" +"In particular, this does not guarantee privacy since an outside user can " +"still deliberately access the private attribute; many Python programmers " +"never bother to use private variable names at all." +msgstr "" + +#: ../../faq/programming.rst:1767 +msgid "" +"The :ref:`private name mangling specifications ` for " +"details and special cases." +msgstr "" +"O :ref:`especificações de desfiguração de nome privado ` para detalhes e casos especiais." + +#: ../../faq/programming.rst:1771 msgid "My class defines __del__ but it is not called when I delete the object." msgstr "" "Minha classe define __del__, mas o mesmo não é chamado quando eu excluo o " "objeto." -#: ../../faq/programming.rst:1753 +#: ../../faq/programming.rst:1773 msgid "There are several possible reasons for this." msgstr "Há várias razões possíveis para isto." -#: ../../faq/programming.rst:1755 +#: ../../faq/programming.rst:1775 msgid "" "The :keyword:`del` statement does not necessarily call :meth:`~object." "__del__` -- it simply decrements the object's reference count, and if this " "reaches zero :meth:`!__del__` is called." msgstr "" -#: ../../faq/programming.rst:1759 +#: ../../faq/programming.rst:1779 msgid "" "If your data structures contain circular links (e.g. a tree where each child " "has a parent reference and each parent has a list of children) the reference " @@ -2348,7 +3165,7 @@ msgid "" "cases where objects will never be collected." msgstr "" -#: ../../faq/programming.rst:1770 +#: ../../faq/programming.rst:1790 msgid "" "Despite the cycle collector, it's still a good idea to define an explicit " "``close()`` method on objects to be called whenever you're done with them. " @@ -2358,7 +3175,7 @@ msgid "" "once for the same object." msgstr "" -#: ../../faq/programming.rst:1777 +#: ../../faq/programming.rst:1797 msgid "" "Another way to avoid cyclical references is to use the :mod:`weakref` " "module, which allows you to point to objects without incrementing their " @@ -2366,29 +3183,29 @@ msgid "" "references for their parent and sibling references (if they need them!)." msgstr "" -#: ../../faq/programming.rst:1790 +#: ../../faq/programming.rst:1810 msgid "" "Finally, if your :meth:`!__del__` method raises an exception, a warning " "message is printed to :data:`sys.stderr`." msgstr "" -#: ../../faq/programming.rst:1795 +#: ../../faq/programming.rst:1815 msgid "How do I get a list of all instances of a given class?" msgstr "" "Como eu consigo pegar uma lista de todas as instâncias de uma dada classe?" -#: ../../faq/programming.rst:1797 +#: ../../faq/programming.rst:1817 msgid "" "Python does not keep track of all instances of a class (or of a built-in " "type). You can program the class's constructor to keep track of all " "instances by keeping a list of weak references to each instance." msgstr "" -#: ../../faq/programming.rst:1803 +#: ../../faq/programming.rst:1823 msgid "Why does the result of ``id()`` appear to be not unique?" msgstr "Por que o resultado de ``id()`` aparenta não ser único?" -#: ../../faq/programming.rst:1805 +#: ../../faq/programming.rst:1825 msgid "" "The :func:`id` builtin returns an integer that is guaranteed to be unique " "during the lifetime of the object. Since in CPython, this is the object's " @@ -2397,7 +3214,7 @@ msgid "" "memory. This is illustrated by this example:" msgstr "" -#: ../../faq/programming.rst:1816 +#: ../../faq/programming.rst:1836 msgid "" "The two ids belong to different integer objects that are created before, and " "deleted immediately after execution of the ``id()`` call. To be sure that " @@ -2405,17 +3222,17 @@ msgid "" "reference to the object:" msgstr "" -#: ../../faq/programming.rst:1829 +#: ../../faq/programming.rst:1849 msgid "When can I rely on identity tests with the *is* operator?" msgstr "Quando eu posso depender dos testes de identidade com o operador *is*?" -#: ../../faq/programming.rst:1831 +#: ../../faq/programming.rst:1851 msgid "" "The ``is`` operator tests for object identity. The test ``a is b`` is " "equivalent to ``id(a) == id(b)``." msgstr "" -#: ../../faq/programming.rst:1834 +#: ../../faq/programming.rst:1854 msgid "" "The most important property of an identity test is that an object is always " "identical to itself, ``a is a`` always returns ``True``. Identity tests are " @@ -2423,34 +3240,34 @@ msgid "" "tests are guaranteed to return a boolean ``True`` or ``False``." msgstr "" -#: ../../faq/programming.rst:1839 +#: ../../faq/programming.rst:1859 msgid "" "However, identity tests can *only* be substituted for equality tests when " "object identity is assured. Generally, there are three circumstances where " "identity is guaranteed:" msgstr "" -#: ../../faq/programming.rst:1843 +#: ../../faq/programming.rst:1863 msgid "" "1) Assignments create new names but do not change object identity. After " "the assignment ``new = old``, it is guaranteed that ``new is old``." msgstr "" -#: ../../faq/programming.rst:1846 +#: ../../faq/programming.rst:1866 msgid "" "2) Putting an object in a container that stores object references does not " "change object identity. After the list assignment ``s[0] = x``, it is " "guaranteed that ``s[0] is x``." msgstr "" -#: ../../faq/programming.rst:1850 +#: ../../faq/programming.rst:1870 msgid "" "3) If an object is a singleton, it means that only one instance of that " "object can exist. After the assignments ``a = None`` and ``b = None``, it " "is guaranteed that ``a is b`` because ``None`` is a singleton." msgstr "" -#: ../../faq/programming.rst:1854 +#: ../../faq/programming.rst:1874 msgid "" "In most other circumstances, identity tests are inadvisable and equality " "tests are preferred. In particular, identity tests should not be used to " @@ -2458,19 +3275,42 @@ msgid "" "guaranteed to be singletons::" msgstr "" -#: ../../faq/programming.rst:1871 +#: ../../faq/programming.rst:1879 +msgid "" +">>> a = 1000\n" +">>> b = 500\n" +">>> c = b + 500\n" +">>> a is c\n" +"False\n" +"\n" +">>> a = 'Python'\n" +">>> b = 'Py'\n" +">>> c = b + 'thon'\n" +">>> a is c\n" +"False" +msgstr "" + +#: ../../faq/programming.rst:1891 msgid "Likewise, new instances of mutable containers are never identical::" msgstr "" "Do mesmo jeito, novas instâncias de contêineres mutáveis nunca são " "idênticas::" -#: ../../faq/programming.rst:1878 +#: ../../faq/programming.rst:1893 +msgid "" +">>> a = []\n" +">>> b = []\n" +">>> a is b\n" +"False" +msgstr "" + +#: ../../faq/programming.rst:1898 msgid "" "In the standard library code, you will see several common patterns for " "correctly using identity tests:" msgstr "" -#: ../../faq/programming.rst:1881 +#: ../../faq/programming.rst:1901 msgid "" "1) As recommended by :pep:`8`, an identity test is the preferred way to " "check for ``None``. This reads like plain English in code and avoids " @@ -2478,7 +3318,7 @@ msgid "" "false." msgstr "" -#: ../../faq/programming.rst:1885 +#: ../../faq/programming.rst:1905 msgid "" "2) Detecting optional arguments can be tricky when ``None`` is a valid input " "value. In those situations, you can create a singleton sentinel object " @@ -2486,25 +3326,48 @@ msgid "" "implement a method that behaves like :meth:`dict.pop`::" msgstr "" -#: ../../faq/programming.rst:1901 +#: ../../faq/programming.rst:1910 +msgid "" +"_sentinel = object()\n" +"\n" +"def pop(self, key, default=_sentinel):\n" +" if key in self:\n" +" value = self[key]\n" +" del self[key]\n" +" return value\n" +" if default is _sentinel:\n" +" raise KeyError(key)\n" +" return default" +msgstr "" + +#: ../../faq/programming.rst:1921 msgid "" "3) Container implementations sometimes need to augment equality tests with " "identity tests. This prevents the code from being confused by objects such " "as ``float('NaN')`` that are not equal to themselves." msgstr "" -#: ../../faq/programming.rst:1905 +#: ../../faq/programming.rst:1925 msgid "" "For example, here is the implementation of :meth:`!collections.abc.Sequence." "__contains__`::" msgstr "" -#: ../../faq/programming.rst:1916 +#: ../../faq/programming.rst:1928 +msgid "" +"def __contains__(self, value):\n" +" for v in self:\n" +" if v is value or v == value:\n" +" return True\n" +" return False" +msgstr "" + +#: ../../faq/programming.rst:1936 msgid "" "How can a subclass control what data is stored in an immutable instance?" msgstr "" -#: ../../faq/programming.rst:1918 +#: ../../faq/programming.rst:1938 msgid "" "When subclassing an immutable type, override the :meth:`~object.__new__` " "method instead of the :meth:`~object.__init__` method. The latter only runs " @@ -2512,35 +3375,71 @@ msgid "" "immutable instance." msgstr "" -#: ../../faq/programming.rst:1923 +#: ../../faq/programming.rst:1943 msgid "" "All of these immutable classes have a different signature than their parent " "class:" msgstr "" -#: ../../faq/programming.rst:1949 +#: ../../faq/programming.rst:1946 +msgid "" +"from datetime import date\n" +"\n" +"class FirstOfMonthDate(date):\n" +" \"Always choose the first day of the month\"\n" +" def __new__(cls, year, month, day):\n" +" return super().__new__(cls, year, month, 1)\n" +"\n" +"class NamedInt(int):\n" +" \"Allow text names for some numbers\"\n" +" xlat = {'zero': 0, 'one': 1, 'ten': 10}\n" +" def __new__(cls, value):\n" +" value = cls.xlat.get(value, value)\n" +" return super().__new__(cls, value)\n" +"\n" +"class TitleStr(str):\n" +" \"Convert str to name suitable for a URL path\"\n" +" def __new__(cls, s):\n" +" s = s.lower().replace(' ', '-')\n" +" s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" +" return super().__new__(cls, s)" +msgstr "" + +#: ../../faq/programming.rst:1969 msgid "The classes can be used like this:" msgstr "" -#: ../../faq/programming.rst:1966 +#: ../../faq/programming.rst:1971 +msgid "" +">>> FirstOfMonthDate(2012, 2, 14)\n" +"FirstOfMonthDate(2012, 2, 1)\n" +">>> NamedInt('ten')\n" +"10\n" +">>> NamedInt(20)\n" +"20\n" +">>> TitleStr('Blog: Why Python Rocks')\n" +"'blog-why-python-rocks'" +msgstr "" + +#: ../../faq/programming.rst:1986 msgid "How do I cache method calls?" msgstr "" -#: ../../faq/programming.rst:1968 +#: ../../faq/programming.rst:1988 msgid "" "The two principal tools for caching methods are :func:`functools." "cached_property` and :func:`functools.lru_cache`. The former stores results " "at the instance level and the latter at the class level." msgstr "" -#: ../../faq/programming.rst:1973 +#: ../../faq/programming.rst:1993 msgid "" "The *cached_property* approach only works with methods that do not take any " "arguments. It does not create a reference to the instance. The cached " "method result will be kept only as long as the instance is alive." msgstr "" -#: ../../faq/programming.rst:1977 +#: ../../faq/programming.rst:1997 msgid "" "The advantage is that when an instance is no longer used, the cached method " "result will be released right away. The disadvantage is that if instances " @@ -2548,47 +3447,95 @@ msgid "" "without bound." msgstr "" -#: ../../faq/programming.rst:1982 +#: ../../faq/programming.rst:2002 msgid "" "The *lru_cache* approach works with methods that have :term:`hashable` " "arguments. It creates a reference to the instance unless special efforts " "are made to pass in weak references." msgstr "" -#: ../../faq/programming.rst:1986 +#: ../../faq/programming.rst:2006 msgid "" "The advantage of the least recently used algorithm is that the cache is " "bounded by the specified *maxsize*. The disadvantage is that instances are " "kept alive until they age out of the cache or until the cache is cleared." msgstr "" -#: ../../faq/programming.rst:1991 +#: ../../faq/programming.rst:2011 msgid "This example shows the various techniques::" msgstr "Esse exemplo mostra as várias técnicas::" -#: ../../faq/programming.rst:2015 +#: ../../faq/programming.rst:2013 +msgid "" +"class Weather:\n" +" \"Lookup weather information on a government website\"\n" +"\n" +" def __init__(self, station_id):\n" +" self._station_id = station_id\n" +" # The _station_id is private and immutable\n" +"\n" +" def current_temperature(self):\n" +" \"Latest hourly observation\"\n" +" # Do not cache this because old results\n" +" # can be out of date.\n" +"\n" +" @cached_property\n" +" def location(self):\n" +" \"Return the longitude/latitude coordinates of the station\"\n" +" # Result only depends on the station_id\n" +"\n" +" @lru_cache(maxsize=20)\n" +" def historic_rainfall(self, date, units='mm'):\n" +" \"Rainfall on a given date\"\n" +" # Depends on the station_id, date, and units." +msgstr "" + +#: ../../faq/programming.rst:2035 msgid "" "The above example assumes that the *station_id* never changes. If the " "relevant instance attributes are mutable, the *cached_property* approach " "can't be made to work because it cannot detect changes to the attributes." msgstr "" -#: ../../faq/programming.rst:2020 +#: ../../faq/programming.rst:2040 msgid "" "To make the *lru_cache* approach work when the *station_id* is mutable, the " "class needs to define the :meth:`~object.__eq__` and :meth:`~object." "__hash__` methods so that the cache can detect relevant attribute updates::" msgstr "" -#: ../../faq/programming.rst:2046 +#: ../../faq/programming.rst:2044 +msgid "" +"class Weather:\n" +" \"Example with a mutable station identifier\"\n" +"\n" +" def __init__(self, station_id):\n" +" self.station_id = station_id\n" +"\n" +" def change_station(self, station_id):\n" +" self.station_id = station_id\n" +"\n" +" def __eq__(self, other):\n" +" return self.station_id == other.station_id\n" +"\n" +" def __hash__(self):\n" +" return hash(self.station_id)\n" +"\n" +" @lru_cache(maxsize=20)\n" +" def historic_rainfall(self, date, units='cm'):\n" +" 'Rainfall on a given date'\n" +" # Depends on the station_id, date, and units." +msgstr "" + +#: ../../faq/programming.rst:2066 msgid "Modules" msgstr "Módulos" -#: ../../faq/programming.rst:2049 +#: ../../faq/programming.rst:2069 msgid "How do I create a .pyc file?" msgstr "Como faço para criar um arquivo .pyc?" -#: ../../faq/programming.rst:2051 +#: ../../faq/programming.rst:2071 msgid "" "When a module is imported for the first time (or when the source file has " "changed since the current compiled file was created) a ``.pyc`` file " @@ -2599,7 +3546,7 @@ msgid "" "particular ``python`` binary that created it. (See :pep:`3147` for details.)" msgstr "" -#: ../../faq/programming.rst:2059 +#: ../../faq/programming.rst:2079 msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " "with the directory containing the source file, meaning that the " @@ -2608,7 +3555,7 @@ msgid "" "testing with a web server." msgstr "" -#: ../../faq/programming.rst:2064 +#: ../../faq/programming.rst:2084 msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " "creation of a .pyc file is automatic if you're importing a module and Python " @@ -2617,7 +3564,7 @@ msgid "" "subdirectory." msgstr "" -#: ../../faq/programming.rst:2069 +#: ../../faq/programming.rst:2089 msgid "" "Running Python on a top level script is not considered an import and no ``." "pyc`` will be created. For example, if you have a top-level module ``foo." @@ -2627,27 +3574,33 @@ msgid "" "for ``foo`` since ``foo.py`` isn't being imported." msgstr "" -#: ../../faq/programming.rst:2076 +#: ../../faq/programming.rst:2096 msgid "" "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." "pyc`` file for a module that is not imported -- you can, using the :mod:" "`py_compile` and :mod:`compileall` modules." msgstr "" -#: ../../faq/programming.rst:2080 +#: ../../faq/programming.rst:2100 msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " "use the ``compile()`` function in that module interactively::" msgstr "" -#: ../../faq/programming.rst:2086 +#: ../../faq/programming.rst:2103 +msgid "" +">>> import py_compile\n" +">>> py_compile.compile('foo.py') " +msgstr "" + +#: ../../faq/programming.rst:2106 msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " "location as ``foo.py`` (or you can override that with the optional parameter " "``cfile``)." msgstr "" -#: ../../faq/programming.rst:2090 +#: ../../faq/programming.rst:2110 msgid "" "You can also automatically compile all files in a directory or directories " "using the :mod:`compileall` module. You can do it from the shell prompt by " @@ -2655,11 +3608,15 @@ msgid "" "Python files to compile::" msgstr "" -#: ../../faq/programming.rst:2099 +#: ../../faq/programming.rst:2115 +msgid "python -m compileall ." +msgstr "" + +#: ../../faq/programming.rst:2119 msgid "How do I find the current module name?" msgstr "Como encontro o nome do módulo atual?" -#: ../../faq/programming.rst:2101 +#: ../../faq/programming.rst:2121 msgid "" "A module can find out its own module name by looking at the predefined " "global variable ``__name__``. If this has the value ``'__main__'``, the " @@ -2668,79 +3625,101 @@ msgid "" "only execute this code after checking ``__name__``::" msgstr "" -#: ../../faq/programming.rst:2116 +#: ../../faq/programming.rst:2127 +msgid "" +"def main():\n" +" print('Running test...')\n" +" ...\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + +#: ../../faq/programming.rst:2136 msgid "How can I have modules that mutually import each other?" msgstr "" -#: ../../faq/programming.rst:2118 +#: ../../faq/programming.rst:2138 msgid "Suppose you have the following modules:" msgstr "Suponha que tenhas os seguintes módulos:" -#: ../../faq/programming.rst:2120 +#: ../../faq/programming.rst:2140 msgid ":file:`foo.py`::" msgstr ":file:`foo.py`::" -#: ../../faq/programming.rst:2125 +#: ../../faq/programming.rst:2142 +msgid "" +"from bar import bar_var\n" +"foo_var = 1" +msgstr "" + +#: ../../faq/programming.rst:2145 msgid ":file:`bar.py`::" msgstr ":file:`bar.py`::" -#: ../../faq/programming.rst:2130 +#: ../../faq/programming.rst:2147 +msgid "" +"from foo import foo_var\n" +"bar_var = 2" +msgstr "" + +#: ../../faq/programming.rst:2150 msgid "The problem is that the interpreter will perform the following steps:" msgstr "O problema é que o interpretador vai realizar os seguintes passos:" -#: ../../faq/programming.rst:2132 +#: ../../faq/programming.rst:2152 msgid "main imports ``foo``" msgstr "" -#: ../../faq/programming.rst:2133 +#: ../../faq/programming.rst:2153 msgid "Empty globals for ``foo`` are created" msgstr "" -#: ../../faq/programming.rst:2134 +#: ../../faq/programming.rst:2154 msgid "``foo`` is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:2135 +#: ../../faq/programming.rst:2155 msgid "``foo`` imports ``bar``" msgstr "" -#: ../../faq/programming.rst:2136 +#: ../../faq/programming.rst:2156 msgid "Empty globals for ``bar`` are created" msgstr "" -#: ../../faq/programming.rst:2137 +#: ../../faq/programming.rst:2157 msgid "``bar`` is compiled and starts executing" msgstr "" -#: ../../faq/programming.rst:2138 +#: ../../faq/programming.rst:2158 msgid "" "``bar`` imports ``foo`` (which is a no-op since there already is a module " "named ``foo``)" msgstr "" -#: ../../faq/programming.rst:2139 +#: ../../faq/programming.rst:2159 msgid "" "The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " "``bar.foo_var = foo.foo_var``" msgstr "" -#: ../../faq/programming.rst:2141 +#: ../../faq/programming.rst:2161 msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " "and the global symbol dictionary for ``foo`` is still empty." msgstr "" -#: ../../faq/programming.rst:2144 +#: ../../faq/programming.rst:2164 msgid "" "The same thing happens when you use ``import foo``, and then try to access " "``foo.foo_var`` in global code." msgstr "" -#: ../../faq/programming.rst:2147 +#: ../../faq/programming.rst:2167 msgid "There are (at least) three possible workarounds for this problem." msgstr "" -#: ../../faq/programming.rst:2149 +#: ../../faq/programming.rst:2169 msgid "" "Guido van Rossum recommends avoiding all uses of ``from import ..." "``, and placing all code inside functions. Initializations of global " @@ -2749,54 +3728,58 @@ msgid "" "``.``." msgstr "" -#: ../../faq/programming.rst:2154 +#: ../../faq/programming.rst:2174 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "" -#: ../../faq/programming.rst:2156 +#: ../../faq/programming.rst:2176 msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" msgstr "" -#: ../../faq/programming.rst:2158 +#: ../../faq/programming.rst:2178 msgid "``import`` statements" msgstr "Declaração ``import``" -#: ../../faq/programming.rst:2159 +#: ../../faq/programming.rst:2179 msgid "" "active code (including globals that are initialized from imported values)." msgstr "" "código ativo (incluindo globais que são inicializadas de valores importados)" -#: ../../faq/programming.rst:2161 +#: ../../faq/programming.rst:2181 msgid "" "Van Rossum doesn't like this approach much because the imports appear in a " "strange place, but it does work." msgstr "" -#: ../../faq/programming.rst:2164 +#: ../../faq/programming.rst:2184 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." msgstr "" -#: ../../faq/programming.rst:2167 +#: ../../faq/programming.rst:2187 msgid "These solutions are not mutually exclusive." msgstr "Essas soluções não são mutualmente exclusivas." -#: ../../faq/programming.rst:2171 +#: ../../faq/programming.rst:2191 msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "__import__('x.y.z') returns ; how do I get z?" -#: ../../faq/programming.rst:2173 +#: ../../faq/programming.rst:2193 msgid "" "Consider using the convenience function :func:`~importlib.import_module` " "from :mod:`importlib` instead::" msgstr "" -#: ../../faq/programming.rst:2180 +#: ../../faq/programming.rst:2196 +msgid "z = importlib.import_module('x.y.z')" +msgstr "" + +#: ../../faq/programming.rst:2200 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" @@ -2804,7 +3787,7 @@ msgstr "" "Quando eu edito um módulo importado e o reimporto, as mudanças não aparecem. " "Por que isso acontece?" -#: ../../faq/programming.rst:2182 +#: ../../faq/programming.rst:2202 msgid "" "For reasons of efficiency as well as consistency, Python only reads the " "module file on the first time a module is imported. If it didn't, in a " @@ -2813,7 +3796,14 @@ msgid "" "re-reading of a changed module, do this::" msgstr "" -#: ../../faq/programming.rst:2192 +#: ../../faq/programming.rst:2208 +msgid "" +"import importlib\n" +"import modname\n" +"importlib.reload(modname)" +msgstr "" + +#: ../../faq/programming.rst:2212 msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" @@ -2821,7 +3811,11 @@ msgstr "" "Aviso: essa técnica não é 100% a prova de falhas. Em particular, módulos " "contendo instruções como ::" -#: ../../faq/programming.rst:2197 +#: ../../faq/programming.rst:2215 +msgid "from modname import some_objects" +msgstr "" + +#: ../../faq/programming.rst:2217 msgid "" "will continue to work with the old version of the imported objects. If the " "module contains class definitions, existing class instances will *not* be " @@ -2829,7 +3823,18 @@ msgid "" "paradoxical behaviour::" msgstr "" -#: ../../faq/programming.rst:2210 +#: ../../faq/programming.rst:2222 +msgid "" +">>> import importlib\n" +">>> import cls\n" +">>> c = cls.C() # Create an instance of C\n" +">>> importlib.reload(cls)\n" +"\n" +">>> isinstance(c, cls.C) # isinstance is false?!?\n" +"False" +msgstr "" + +#: ../../faq/programming.rst:2230 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" @@ -2837,6 +3842,14 @@ msgstr "" "A natureza do problema fica clara se você exibir a \"identidade\" dos " "objetos da classe::" +#: ../../faq/programming.rst:2233 +msgid "" +">>> hex(id(c.__class__))\n" +"'0x7352a0'\n" +">>> hex(id(cls.C))\n" +"'0x4198d0'" +msgstr "" + #: ../../faq/programming.rst:408 msgid "argument" msgstr "argumento" diff --git a/faq/windows.po b/faq/windows.po index 999e9fb34..db628940f 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Ruan Aragão , 2021 -# Adorilson Bezerra , 2021 -# Amanda Savluchinske , 2021 -# Raul Lima , 2021 -# Hortencia_Arliane , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -68,6 +62,10 @@ msgstr "" "reconhecer quando iniciar porque você verá um \"Prompt de Comando do " "Windows\", que geralmente tem esta forma:" +#: ../../faq/windows.rst:35 +msgid "C:\\>" +msgstr "" + #: ../../faq/windows.rst:39 msgid "" "The letter may be different, and there might be other things after it, so " @@ -76,6 +74,10 @@ msgstr "" "A letra pode ser diferente, e pode haver outras coisas depois, então você " "facilmente pode ver algo como:" +#: ../../faq/windows.rst:42 +msgid "D:\\YourName\\Projects\\Python>" +msgstr "" + #: ../../faq/windows.rst:46 msgid "" "depending on how your computer has been set up and what else you have " @@ -110,10 +112,23 @@ msgstr "" "abriu a janela de comando, você deve tentar digitar o comando \"py\" e o " "observar o retorno:" +#: ../../faq/windows.rst:60 +msgid "C:\\Users\\YourName> py" +msgstr "" + #: ../../faq/windows.rst:64 msgid "You should then see something like:" msgstr "Você deve então ver algo como:" +#: ../../faq/windows.rst:66 +msgid "" +"Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit " +"(Intel)] on win32\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" +">>>" +msgstr "" + #: ../../faq/windows.rst:72 msgid "" "You have started the interpreter in \"interactive mode\". That means you can " @@ -127,6 +142,14 @@ msgstr "" "do Python. Verifique isso digitando algumas instruções de sua escolha e veja " "os resultados:" +#: ../../faq/windows.rst:77 +msgid "" +">>> print(\"Hello\")\n" +"Hello\n" +">>> \"Hello\" * 3\n" +"'HelloHelloHello'" +msgstr "" + #: ../../faq/windows.rst:84 msgid "" "Many people use the interactive mode as a convenient yet highly programmable " @@ -172,6 +195,10 @@ msgstr "" "sua área de trabalho e se chama ``hello.py``, e seu prompt de comando está " "aberto no seu diretório raiz de forma que você está vendo algo similar a::" +#: ../../faq/windows.rst:104 +msgid "C:\\Users\\YourName>" +msgstr "" + #: ../../faq/windows.rst:106 msgid "" "So now you'll ask the ``py`` command to give your script to Python by typing " @@ -180,6 +207,12 @@ msgstr "" "Então, agora você solicitará o comando ``py`` para fornecer seu script para " "Python, digitando ``py`` seguido pelo seu caminho de script::" +#: ../../faq/windows.rst:110 +msgid "" +"C:\\Users\\YourName> py Desktop\\hello.py\n" +"hello" +msgstr "" + #: ../../faq/windows.rst:114 msgid "How do I make Python scripts executable?" msgstr "Como eu faço para criar programas Python executáveis?" @@ -394,6 +427,15 @@ msgstr "" "Em suma, você pode utilizar o código a seguir para inicializar o " "interpretador Python com seu módulo de extensão." +#: ../../faq/windows.rst:210 +msgid "" +"#include \n" +"...\n" +"Py_Initialize(); // Initialize Python.\n" +"initmyAppc(); // Initialize (import) the helper class.\n" +"PyRun_SimpleString(\"import myApp\"); // Import the shadow class." +msgstr "" + #: ../../faq/windows.rst:218 msgid "" "There are two problems with Python's C API which will become apparent if you " @@ -423,6 +465,13 @@ msgstr "" "Problema 2: SWIG gera o seguinte código ao gerar invólucros para funções sem " "retorno:" +#: ../../faq/windows.rst:229 +msgid "" +"Py_INCREF(Py_None);\n" +"_resultobj = Py_None;\n" +"return _resultobj;" +msgstr "" + #: ../../faq/windows.rst:235 msgid "" "Alas, Py_None is a macro that expands to a reference to a complex data " @@ -434,6 +483,10 @@ msgstr "" "Novamente, esse código falhará em um ambiente com vários compiladores. " "Substitua esse código por:" +#: ../../faq/windows.rst:239 +msgid "return Py_BuildValue(\"\");" +msgstr "" + #: ../../faq/windows.rst:243 msgid "" "It may be possible to use SWIG's ``%typemap`` command to make the change " diff --git a/glossary.po b/glossary.po index 65427db37..e5a40490f 100644 --- a/glossary.po +++ b/glossary.po @@ -4,15 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# felipe caridade fernandes , 2021 -# Marco Rougeth , 2021 -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Alexandre B A Villares, 2021 -# Vinicius Gubiani Ferreira , 2021 -# yyyyyyyan , 2021 -# David Macedo, 2022 -# Adorilson Bezerra , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -20,8 +11,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-04 01:27+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" @@ -184,6 +175,12 @@ msgstr "" "dicionário precedido por ``**``. Por exemplo, ``3`` e ``5`` são ambos " "argumentos nomeados na chamada da função :func:`complex` a seguir::" +#: ../../glossary.rst:72 +msgid "" +"complex(real=3, imag=5)\n" +"complex(**{'real': 3, 'imag': 5})" +msgstr "" + #: ../../glossary.rst:75 msgid "" ":dfn:`positional argument`: an argument that is not a keyword argument. " @@ -197,6 +194,12 @@ msgstr "" "por ``*``. Por exemplo, ``3`` e ``5`` são ambos argumentos posicionais nas " "chamadas a seguir::" +#: ../../glossary.rst:81 +msgid "" +"complex(3, 5)\n" +"complex(*(3, 5))" +msgstr "" + #: ../../glossary.rst:84 msgid "" "Arguments are assigned to the named local variables in a function body. See " @@ -528,6 +531,10 @@ msgstr "" "Um chamável é um objeto que pode ser chamado, possivelmente com um conjunto " "de argumentos (veja :term:`argumento`), com a seguinte sintaxe::" +#: ../../glossary.rst:218 +msgid "callable(argument1, argument2, argumentN)" +msgstr "" + #: ../../glossary.rst:220 msgid "" "A :term:`function`, and by extension a :term:`method`, is a callable. An " @@ -729,6 +736,17 @@ msgstr "" "A sintaxe do decorador é meramente um açúcar sintático, as duas definições " "de funções a seguir são semanticamente equivalentes::" +#: ../../glossary.rst:303 +msgid "" +"def f(arg):\n" +" ...\n" +"f = staticmethod(f)\n" +"\n" +"@staticmethod\n" +"def f(arg):\n" +" ..." +msgstr "" + #: ../../glossary.rst:311 msgid "" "The same concept exists for classes, but is less commonly used there. See " @@ -885,7 +903,7 @@ msgid "" msgstr "" "Iniciais da expressão em inglês \"easier to ask for forgiveness than " "permission\" que significa \"é mais fácil pedir perdão que permissão\". Este " -"estilo de codificação comum no Python assume a existência de chaves ou " +"estilo de codificação comum no Python presume a existência de chaves ou " "atributos válidos e captura exceções caso essa premissa se prove falsa. Este " "estilo limpo e rápido se caracteriza pela presença de várias instruções :" "keyword:`try` e :keyword:`except`. A técnica diverge do estilo :term:`LBYL`, " @@ -1030,7 +1048,7 @@ msgstr "" #: ../../glossary.rst:430 msgid "See also the :term:`locale encoding`." -msgstr "Veja também :term:`codificação da localidade`." +msgstr "Veja também a :term:`codificação da localidade`." #: ../../glossary.rst:431 msgid "finder" @@ -1046,18 +1064,17 @@ msgstr "" #: ../../glossary.rst:436 msgid "" -"Since Python 3.3, there are two types of finder: :term:`meta path finders " -"` for use with :data:`sys.meta_path`, and :term:`path " -"entry finders ` for use with :data:`sys.path_hooks`." +"There are two types of finder: :term:`meta path finders ` " +"for use with :data:`sys.meta_path`, and :term:`path entry finders ` for use with :data:`sys.path_hooks`." msgstr "" -"Desde o Python 3.3, existem dois tipos de localizador: :term:`localizadores " -"de metacaminho ` para uso com :data:`sys.meta_path`, e :" -"term:`localizadores de entrada de caminho ` para uso com :" -"data:`sys.path_hooks`." +"Existem dois tipos de localizador: :term:`localizadores de metacaminho ` para uso com :data:`sys.meta_path`, e :term:`localizadores de " +"entrada de caminho ` para uso com :data:`sys.path_hooks`." #: ../../glossary.rst:440 -msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." -msgstr "Veja :pep:`302`, :pep:`420` e :pep:`451` para mais informações." +msgid "See :ref:`importsystem` and :mod:`importlib` for much more detail." +msgstr "Veja :ref:`importsystem` e :mod:`importlib` para muito mais detalhes." #: ../../glossary.rst:441 msgid "floor division" @@ -1111,6 +1128,12 @@ msgstr "" "hint>`: por exemplo, essa função espera receber dois argumentos :class:`int` " "e também é esperado que devolva um valor :class:`int`::" +#: ../../glossary.rst:463 +msgid "" +"def sum_two_numbers(a: int, b: int) -> int:\n" +" return a + b" +msgstr "" + #: ../../glossary.rst:466 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "A sintaxe de anotação de função é explicada na seção :ref:`function`." @@ -1146,6 +1169,13 @@ msgstr "" "avaliando suas variáveis, você pode ver quando um novo recurso foi " "inicialmente adicionado à linguagem e quando será (ou se já é) o padrão::" +#: ../../glossary.rst:482 +msgid "" +">>> import __future__\n" +">>> __future__.division\n" +"_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" +msgstr "" + #: ../../glossary.rst:485 msgid "garbage collection" msgstr "coleta de lixo" @@ -1227,6 +1257,12 @@ msgstr "" "uma cláusula :keyword:`!if` opcional. A expressão combinada gera valores " "para uma função encapsuladora::" +#: ../../glossary.rst:521 +msgid "" +">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" +"285" +msgstr "" + #: ../../glossary.rst:523 msgid "generic function" msgstr "função genérica" @@ -1277,11 +1313,11 @@ msgstr "GIL" #: ../../glossary.rst:542 msgid "See :term:`global interpreter lock`." -msgstr "Veja :term:`bloqueio global do interpretador`." +msgstr "Veja :term:`trava global do interpretador`." #: ../../glossary.rst:543 msgid "global interpreter lock" -msgstr "bloqueio global do interpretador" +msgstr "trava global do interpretador" #: ../../glossary.rst:545 msgid "" @@ -1309,9 +1345,9 @@ msgid "" "I/O." msgstr "" "No entanto, alguns módulos de extensão, tanto da biblioteca padrão quanto de " -"terceiros, são desenvolvidos de forma a liberar o GIL ao realizar tarefas " +"terceiros, são desenvolvidos de forma a liberar a GIL ao realizar tarefas " "computacionalmente muito intensas, como compactação ou cálculos de hash. " -"Além disso, o GIL é sempre liberado nas operações de E/S." +"Além disso, a GIL é sempre liberado nas operações de E/S." #: ../../glossary.rst:559 msgid "" @@ -1535,7 +1571,7 @@ msgstr "" #: ../../glossary.rst:645 msgid "iterable" -msgstr "iterável" +msgstr "Iterável" #: ../../glossary.rst:647 msgid "" @@ -1667,8 +1703,8 @@ msgstr "" "caixa. Alternativamente, uma função chave ad-hoc pode ser construída a " "partir de uma expressão :keyword:`lambda`, como ``lambda r: (r[0], r[2])``. " "Além disso, :func:`operator.attrgetter`, :func:`operator.itemgetter` e :func:" -"`operator.methodcaller` são três construtores de função chave. Consulte o :" -"ref:`HowTo de Ordenação ` para ver exemplos de como criar e " +"`operator.methodcaller` são três construtores de função chave. Consulte o " +"guia de :ref:`Ordenação ` para ver exemplos de como criar e " "utilizar funções chave." #: ../../glossary.rst:708 @@ -1722,7 +1758,7 @@ msgstr "" "uma condição de corrida entre \"o olhar\" e \"o pisar\". Por exemplo, o " "código ``if key in mapping: return mapping[key]`` pode falhar se outra " "thread remover *key* do *mapping* após o teste, mas antes da olhada. Esse " -"problema pode ser resolvido com bloqueios ou usando a abordagem EAFP." +"problema pode ser resolvido com travas ou usando a abordagem EAFP." #: ../../glossary.rst:728 msgid "list" @@ -1994,6 +2030,16 @@ msgstr "" "retornados por :func:`time.localtime` e :func:`os.stat`. Outro exemplo é :" "data:`sys.float_info`::" +#: ../../glossary.rst:832 +msgid "" +">>> sys.float_info[1] # indexed access\n" +"1024\n" +">>> sys.float_info.max_exp # named field access\n" +"1024\n" +">>> isinstance(sys.float_info, tuple) # kind of tuple\n" +"True" +msgstr "" + #: ../../glossary.rst:839 msgid "" "Some named tuples are built-in types (such as the above examples). " @@ -2155,6 +2201,10 @@ msgstr "" "term:`posicional ` quanto :term:`nomeado `. Esse é o " "tipo padrão de parâmetro, por exemplo *foo* e *bar* a seguir::" +#: ../../glossary.rst:906 +msgid "def func(foo, bar=None): ..." +msgstr "" + #: ../../glossary.rst:910 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " @@ -2167,6 +2217,10 @@ msgstr "" "incluindo o caractere ``/`` na lista de parâmetros da definição da função " "após eles, por exemplo *posonly1* e *posonly2* a seguir::" +#: ../../glossary.rst:915 +msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." +msgstr "" + #: ../../glossary.rst:919 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " @@ -2181,6 +2235,10 @@ msgstr "" "parâmetros na definição da função, por exemplo *kw_only1* and *kw_only2* a " "seguir::" +#: ../../glossary.rst:925 +msgid "def func(arg, *, kw_only1, kw_only2): ..." +msgstr "" + #: ../../glossary.rst:927 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " @@ -2194,6 +2252,10 @@ msgstr "" "aceito por outros parâmetros). Tal parâmetro pode ser definido colocando um " "``*`` antes do nome do parâmetro, por exemplo *args* a seguir::" +#: ../../glossary.rst:933 +msgid "def func(*args, **kwargs): ..." +msgstr "" + #: ../../glossary.rst:935 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " @@ -2446,10 +2508,22 @@ msgstr "" "Muitas outras linguagens não têm esse tipo de construção, então as pessoas " "que não estão familiarizadas com o Python usam um contador numérico::" +#: ../../glossary.rst:1036 +msgid "" +"for i in range(len(food)):\n" +" print(food[i])" +msgstr "" + #: ../../glossary.rst:1039 msgid "As opposed to the cleaner, Pythonic method::" msgstr "Ao contrário do método limpo, ou então, Pythônico::" +#: ../../glossary.rst:1041 +msgid "" +"for piece in food:\n" +" print(piece)" +msgstr "" + #: ../../glossary.rst:1043 msgid "qualified name" msgstr "nome qualificado" @@ -2467,6 +2541,21 @@ msgstr "" "funções e classes de nível superior, o nome qualificado é o mesmo que o nome " "do objeto::" +#: ../../glossary.rst:1050 +msgid "" +">>> class C:\n" +"... class D:\n" +"... def meth(self):\n" +"... pass\n" +"...\n" +">>> C.__qualname__\n" +"'C'\n" +">>> C.D.__qualname__\n" +"'C.D'\n" +">>> C.D.meth.__qualname__\n" +"'C.D.meth'" +msgstr "" + #: ../../glossary.rst:1062 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " @@ -2477,6 +2566,13 @@ msgstr "" "significa todo o caminho pontilhado para o módulo, incluindo quaisquer " "pacotes pai, por exemplo: ``email.mime.text``::" +#: ../../glossary.rst:1066 +msgid "" +">>> import email.mime.text\n" +">>> email.mime.text.__name__\n" +"'email.mime.text'" +msgstr "" + #: ../../glossary.rst:1069 msgid "reference count" msgstr "contagem de referências" @@ -2756,7 +2852,7 @@ msgstr "" #: ../../glossary.rst:1183 msgid "triple-quoted string" -msgstr "aspas triplas" +msgstr "string entre aspas triplas" #: ../../glossary.rst:1185 msgid "" @@ -2808,10 +2904,25 @@ msgstr "" "Tipos alias são úteis para simplificar :term:`dicas de tipo `. " "Por exemplo::" +#: ../../glossary.rst:1205 +msgid "" +"def remove_gray_shades(\n" +" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" +" pass" +msgstr "" + #: ../../glossary.rst:1209 msgid "could be made more readable like this::" msgstr "pode tornar-se mais legível desta forma::" +#: ../../glossary.rst:1211 +msgid "" +"Color = tuple[int, int, int]\n" +"\n" +"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" +" pass" +msgstr "" + #: ../../glossary.rst:1216 ../../glossary.rst:1230 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "Veja :mod:`typing` e :pep:`484`, a qual descreve esta funcionalidade." @@ -2880,6 +2991,12 @@ msgstr "" "Ao fazer uma anotação de uma variável ou um atributo de classe, a atribuição " "é opcional::" +#: ../../glossary.rst:1244 +msgid "" +"class C:\n" +" field: 'annotation'" +msgstr "" + #: ../../glossary.rst:1247 msgid "" "Variable annotations are usually used for :term:`type hints `: " @@ -2889,6 +3006,10 @@ msgstr "" "`: por exemplo, espera-se que esta variável receba valores do " "tipo :class:`int`::" +#: ../../glossary.rst:1251 +msgid "count: int = 0" +msgstr "" + #: ../../glossary.rst:1253 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "" diff --git a/howto/annotations.po b/howto/annotations.po index ec90e8391..9412923ea 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Hemílio Lauro , 2021 -# Flávio Neves, 2022 -# Nicolas Evangelista, 2022 -# Ruan Aragão , 2023 -# PAULO NASCIMENTO, 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-22 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -194,6 +188,18 @@ msgstr "" "``__annotations__`` de uma classe pode inesperadamente retornar o dicionário " "de anotações de uma *classe base.* Por exemplo::" +#: ../../howto/annotations.rst:89 +msgid "" +"class Base:\n" +" a: int = 3\n" +" b: str = 'abc'\n" +"\n" +"class Derived(Base):\n" +" pass\n" +"\n" +"print(Derived.__annotations__)" +msgstr "" + #: ../../howto/annotations.rst:98 msgid "This will print the annotations dict from ``Base``, not ``Derived``." msgstr "" @@ -226,6 +232,14 @@ msgstr "" "segura o atributo ``__annotations__`` em um objeto arbitrário em Python 3.9 " "e anteriores::" +#: ../../howto/annotations.rst:113 +msgid "" +"if isinstance(o, type):\n" +" ann = o.__dict__.get('__annotations__', None)\n" +"else:\n" +" ann = getattr(o, '__annotations__', None)" +msgstr "" + #: ../../howto/annotations.rst:118 msgid "" "After running this code, ``ann`` should be either a dictionary or ``None``. " @@ -463,6 +477,14 @@ msgstr "" "string será posta entre aspas. Na prática a anotação receberá aspas " "*duplas*. Por exemplo::" +#: ../../howto/annotations.rst:227 +msgid "" +"from __future__ import annotations\n" +"def foo(a: \"str\"): pass\n" +"\n" +"print(foo.__annotations__)" +msgstr "" + #: ../../howto/annotations.rst:232 msgid "" "This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " diff --git a/howto/argparse.po b/howto/argparse.po index 49da02bea..8424dfbaa 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Humberto Rocha , 2021 -# Hemílio Lauro , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-14 22:56+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -72,6 +69,26 @@ msgstr "" "Demonstraremos o tipo de funcionalidade que vamos explorar neste tutorial " "introdutório fazendo uso do comando :command:`ls`:" +#: ../../howto/argparse.rst:29 +msgid "" +"$ ls\n" +"cpython devguide prog.py pypy rm-unused-function.patch\n" +"$ ls pypy\n" +"ctypes_configure demo dotviewer include lib_pypy lib-python ...\n" +"$ ls -l\n" +"total 20\n" +"drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython\n" +"drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide\n" +"-rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py\n" +"drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy\n" +"-rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch\n" +"$ ls --help\n" +"Usage: ls [OPTION]... [FILE]...\n" +"List information about the FILEs (the current directory by default).\n" +"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" +"..." +msgstr "" + #: ../../howto/argparse.rst:48 msgid "A few concepts we can learn from the four commands:" msgstr "Alguns conceitos que podemos aprender a partir destes quatro comandos:" @@ -133,11 +150,34 @@ msgstr "O básico" msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "Comecemos com um exemplo muito simples que irá fazer (quase) nada::" +#: ../../howto/argparse.rst:76 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.parse_args()" +msgstr "" + #: ../../howto/argparse.rst:80 ../../howto/argparse.rst:188 #: ../../howto/argparse.rst:209 msgid "Following is a result of running the code:" msgstr "A seguir, temos o resultado da execução do código:" +#: ../../howto/argparse.rst:82 +msgid "" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py --verbose\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: --verbose\n" +"$ python prog.py foo\n" +"usage: prog.py [-h]\n" +"prog.py: error: unrecognized arguments: foo" +msgstr "" + #: ../../howto/argparse.rst:97 ../../howto/argparse.rst:254 #: ../../howto/argparse.rst:298 msgid "Here is what is happening:" @@ -179,10 +219,36 @@ msgstr "Apresentando os argumentos posicionais" msgid "An example::" msgstr "Um exemplo::" +#: ../../howto/argparse.rst:116 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" +msgstr "" + #: ../../howto/argparse.rst:122 msgid "And running the code:" msgstr "E executando o código:" +#: ../../howto/argparse.rst:124 +msgid "" +"$ python prog.py\n" +"usage: prog.py [-h] echo\n" +"prog.py: error: the following arguments are required: echo\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"$ python prog.py foo\n" +"foo" +msgstr "" + #: ../../howto/argparse.rst:140 msgid "Here is what's happening:" msgstr "Aqui está o que acontecerá:" @@ -238,14 +304,54 @@ msgstr "" "de adivinhar ou ler o código-fonte. Então, vamos torná-lo um pouco mais " "útil::" +#: ../../howto/argparse.rst:161 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"echo\", help=\"echo the string you use here\")\n" +"args = parser.parse_args()\n" +"print(args.echo)" +msgstr "" + #: ../../howto/argparse.rst:167 msgid "And we get:" msgstr "E, iremos obter:" +#: ../../howto/argparse.rst:169 +msgid "" +"$ python prog.py -h\n" +"usage: prog.py [-h] echo\n" +"\n" +"positional arguments:\n" +" echo echo the string you use here\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + #: ../../howto/argparse.rst:180 msgid "Now, how about doing something even more useful::" msgstr "Agora, que tal fazer algo ainda mais útil::" +#: ../../howto/argparse.rst:182 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given " +"number\")\n" +"args = parser.parse_args()\n" +"print(args.square**2)" +msgstr "" + +#: ../../howto/argparse.rst:190 +msgid "" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 5, in \n" +" print(args.square**2)\n" +"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" +msgstr "" + #: ../../howto/argparse.rst:198 msgid "" "That didn't go so well. That's because :mod:`argparse` treats the options we " @@ -256,6 +362,26 @@ msgstr "" "damos a ele como strings, a menos que digamos o contrário. Então, vamos " "dizer ao :mod:`argparse` para tratar essa entrada como um inteiro::" +#: ../../howto/argparse.rst:202 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", help=\"display a square of a given " +"number\",\n" +" type=int)\n" +"args = parser.parse_args()\n" +"print(args.square**2)" +msgstr "" + +#: ../../howto/argparse.rst:211 +msgid "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py four\n" +"usage: prog.py [-h] square\n" +"prog.py: error: argument square: invalid int value: 'four'" +msgstr "" + #: ../../howto/argparse.rst:219 msgid "" "That went well. The program now even helpfully quits on bad illegal input " @@ -276,11 +402,38 @@ msgstr "" "Até agora, jogamos com argumentos posicionais. Vamos dar uma olhada em como " "adicionar opcionais::" +#: ../../howto/argparse.rst:229 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbosity\", help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"if args.verbosity:\n" +" print(\"verbosity turned on\")" +msgstr "" + #: ../../howto/argparse.rst:236 ../../howto/argparse.rst:282 #: ../../howto/argparse.rst:398 ../../howto/argparse.rst:432 msgid "And the output:" msgstr "E a saída:" +#: ../../howto/argparse.rst:238 +msgid "" +"$ python prog.py --verbosity 1\n" +"verbosity turned on\n" +"$ python prog.py\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbosity VERBOSITY\n" +" increase output verbosity\n" +"$ python prog.py --verbosity\n" +"usage: prog.py [-h] [--verbosity VERBOSITY]\n" +"prog.py: error: argument --verbosity: expected one argument" +msgstr "" + #: ../../howto/argparse.rst:256 msgid "" "The program is written so as to display something when ``--verbosity`` is " @@ -325,6 +478,32 @@ msgstr "" "mas para nosso programa simples, apenas dois valores são realmente úteis, " "``True`` ou ``False``. Vamos modificar o código de acordo::" +#: ../../howto/argparse.rst:274 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"--verbose\", help=\"increase output verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" +msgstr "" + +#: ../../howto/argparse.rst:284 +msgid "" +"$ python prog.py --verbose\n" +"verbosity turned on\n" +"$ python prog.py --verbose 1\n" +"usage: prog.py [-h] [--verbose]\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [--verbose]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --verbose increase output verbosity" +msgstr "" + #: ../../howto/argparse.rst:300 msgid "" "The option is now more of a flag than something that requires a value. We " @@ -365,10 +544,34 @@ msgstr "" "Se você estiver familiarizado com o uso da linha de comando, notará que " "ainda não toquei no tópico das versões curtas das opções. É bem simples::" +#: ../../howto/argparse.rst:320 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"-v\", \"--verbose\", help=\"increase output " +"verbosity\",\n" +" action=\"store_true\")\n" +"args = parser.parse_args()\n" +"if args.verbose:\n" +" print(\"verbosity turned on\")" +msgstr "" + #: ../../howto/argparse.rst:328 msgid "And here goes:" msgstr "E aqui vai:" +#: ../../howto/argparse.rst:330 +msgid "" +"$ python prog.py -v\n" +"verbosity turned on\n" +"$ python prog.py --help\n" +"usage: prog.py [-h] [-v]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose increase output verbosity" +msgstr "" + #: ../../howto/argparse.rst:341 msgid "Note that the new ability is also reflected in the help text." msgstr "Observe que a nova habilidade também é refletida no texto de ajuda." @@ -381,10 +584,39 @@ msgstr "Combinando argumentos posicionais e opcionais" msgid "Our program keeps growing in complexity::" msgstr "Nosso programa continua crescendo em complexidade::" +#: ../../howto/argparse.rst:349 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbose\", action=\"store_true\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbose:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + #: ../../howto/argparse.rst:362 msgid "And now the output:" msgstr "E agora a saída:" +#: ../../howto/argparse.rst:364 +msgid "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: the following arguments are required: square\n" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 --verbose\n" +"the square of 4 equals 16\n" +"$ python prog.py --verbose 4\n" +"the square of 4 equals 16" +msgstr "" + #: ../../howto/argparse.rst:376 msgid "We've brought back a positional argument, hence the complaint." msgstr "Trouxemos de volta um argumento posicional, daí a reclamação." @@ -401,6 +633,39 @@ msgstr "" "Que tal devolvermos a este nosso programa a capacidade de ter vários valores " "de verbosidade e realmente usá-los::" +#: ../../howto/argparse.rst:383 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +#: ../../howto/argparse.rst:400 +msgid "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"usage: prog.py [-h] [-v VERBOSITY] square\n" +"prog.py: error: argument -v/--verbosity: expected one argument\n" +"$ python prog.py 4 -v 1\n" +"4^2 == 16\n" +"$ python prog.py 4 -v 2\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 3\n" +"16" +msgstr "" + #: ../../howto/argparse.rst:414 msgid "" "These all look good except the last one, which exposes a bug in our program. " @@ -411,6 +676,42 @@ msgstr "" "programa. Vamos corrigi-lo restringindo os valores que a opção ``--" "verbosity`` pode aceitar::" +#: ../../howto/argparse.rst:417 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", type=int, choices=[0, 1, 2],\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + +#: ../../howto/argparse.rst:434 +msgid "" +"$ python prog.py 4 -v 3\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, " +"1, 2)\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v {0,1,2}] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v {0,1,2}, --verbosity {0,1,2}\n" +" increase output verbosity" +msgstr "" + #: ../../howto/argparse.rst:450 msgid "" "Note that the change also reflects both in the error message as well as the " @@ -430,6 +731,24 @@ msgstr "" "CPython trata seu próprio argumento de verbosidade (verifique a saída de " "``python --help``)::" +#: ../../howto/argparse.rst:457 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display the square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity == 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity == 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + #: ../../howto/argparse.rst:472 msgid "" "We have introduced another action, \"count\", to count the number of " @@ -438,6 +757,32 @@ msgstr "" "Introduzimos outra ação, \"contar\", para contar o número de ocorrências de " "opções específicas." +#: ../../howto/argparse.rst:476 +msgid "" +"$ python prog.py 4\n" +"16\n" +"$ python prog.py 4 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 -vv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 --verbosity --verbosity\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -v 1\n" +"usage: prog.py [-h] [-v] square\n" +"prog.py: error: unrecognized arguments: 1\n" +"$ python prog.py 4 -h\n" +"usage: prog.py [-h] [-v] square\n" +"\n" +"positional arguments:\n" +" square display a square of a given number\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity increase output verbosity\n" +"$ python prog.py 4 -vvv\n" +"16" +msgstr "" + #: ../../howto/argparse.rst:501 msgid "" "Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the " @@ -493,10 +838,43 @@ msgstr "Essa última saída expõe um bug em nosso programa." msgid "Let's fix::" msgstr "Vamos corrigir::" +#: ../../howto/argparse.rst:524 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"\n" +"# bugfix: replace == with >=\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + #: ../../howto/argparse.rst:541 msgid "And this is what it gives:" msgstr "E isso aqui é o mesmo retorna:" +#: ../../howto/argparse.rst:543 +msgid "" +"$ python prog.py 4 -vvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4 -vvvv\n" +"the square of 4 equals 16\n" +"$ python prog.py 4\n" +"Traceback (most recent call last):\n" +" File \"prog.py\", line 11, in \n" +" if args.verbosity >= 2:\n" +"TypeError: '>=' not supported between instances of 'NoneType' and 'int'" +msgstr "" + #: ../../howto/argparse.rst:556 msgid "" "First output went well, and fixes the bug we had before. That is, we want " @@ -513,6 +891,24 @@ msgstr "A terceira saída não está tão boa." msgid "Let's fix that bug::" msgstr "Vamos corrigir esse bug::" +#: ../../howto/argparse.rst:563 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"square\", type=int,\n" +" help=\"display a square of a given number\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0,\n" +" help=\"increase output verbosity\")\n" +"args = parser.parse_args()\n" +"answer = args.square**2\n" +"if args.verbosity >= 2:\n" +" print(f\"the square of {args.square} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.square}^2 == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + #: ../../howto/argparse.rst:578 msgid "" "We've just introduced yet another keyword, ``default``. We've set it to " @@ -531,6 +927,12 @@ msgstr "" msgid "And:" msgstr "E:" +#: ../../howto/argparse.rst:587 +msgid "" +"$ python prog.py 4\n" +"16" +msgstr "" + #: ../../howto/argparse.rst:592 msgid "" "You can go quite far just with what we've learned so far, and we have only " @@ -552,10 +954,46 @@ msgid "" msgstr "" "E se quiséssemos expandir nosso pequeno programa, ampliando seu potencial::" +#: ../../howto/argparse.rst:604 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"elif args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == {answer}\")\n" +"else:\n" +" print(answer)" +msgstr "" + #: ../../howto/argparse.rst:618 ../../howto/argparse.rst:656 msgid "Output:" msgstr "Saída:" +#: ../../howto/argparse.rst:620 +msgid "" +"$ python prog.py\n" +"usage: prog.py [-h] [-v] x y\n" +"prog.py: error: the following arguments are required: x, y\n" +"$ python prog.py -h\n" +"usage: prog.py [-h] [-v] x y\n" +"\n" +"positional arguments:\n" +" x the base\n" +" y the exponent\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbosity\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16" +msgstr "" + #: ../../howto/argparse.rst:639 msgid "" "Notice that so far we've been using verbosity level to *change* the text " @@ -566,6 +1004,33 @@ msgstr "" "texto que é exibido. O exemplo a seguir usa o nível de verbosidade para " "exibir *mais* texto::" +#: ../../howto/argparse.rst:643 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"if args.verbosity >= 2:\n" +" print(f\"Running '{__file__}'\")\n" +"if args.verbosity >= 1:\n" +" print(f\"{args.x}^{args.y} == \", end=\"\")\n" +"print(answer)" +msgstr "" + +#: ../../howto/argparse.rst:658 +msgid "" +"$ python prog.py 4 2\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -vv\n" +"Running 'prog.py'\n" +"4^2 == 16" +msgstr "" + #: ../../howto/argparse.rst:672 msgid "Specifying ambiguous arguments" msgstr "Especificando argumentos ambíguos" @@ -580,6 +1045,28 @@ msgstr "" "argumento, ``--`` pode ser usado para dizer :meth:`~ArgumentParser." "parse_args` que tudo depois disso é um argumento posicional::" +#: ../../howto/argparse.rst:678 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-n', nargs='+')\n" +">>> parser.add_argument('args', nargs='*')\n" +"\n" +">>> # ambiguous, so parse_args assumes it's an option\n" +">>> parser.parse_args(['-f'])\n" +"usage: PROG [-h] [-n N [N ...]] [args ...]\n" +"PROG: error: unrecognized arguments: -f\n" +"\n" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(args=['-f'], n=None)\n" +"\n" +">>> # ambiguous, so the -n option greedily accepts arguments\n" +">>> parser.parse_args(['-n', '1', '2', '3'])\n" +"Namespace(args=[], n=['1', '2', '3'])\n" +"\n" +">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" +"Namespace(args=['2', '3'], n=['1'])" +msgstr "" + #: ../../howto/argparse.rst:699 msgid "Conflicting options" msgstr "Opções conflitantes" @@ -600,6 +1087,27 @@ msgstr "" "para que a nova funcionalidade faça mais sentido: vamos introduzir a opção " "``--quiet``, que será o oposto da opção ``--verbose``::" +#: ../../howto/argparse.rst:709 +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" +msgstr "" + #: ../../howto/argparse.rst:727 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " @@ -608,6 +1116,22 @@ msgstr "" "Nosso programa agora está mais simples e perdemos algumas funcionalidades " "para demonstração. De qualquer forma, aqui está a saída:" +#: ../../howto/argparse.rst:730 +msgid "" +"$ python prog.py 4 2\n" +"4^2 == 16\n" +"$ python prog.py 4 2 -q\n" +"16\n" +"$ python prog.py 4 2 -v\n" +"4 to the power 2 equals 16\n" +"$ python prog.py 4 2 -vq\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose\n" +"$ python prog.py 4 2 -v --quiet\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" +msgstr "" + #: ../../howto/argparse.rst:745 msgid "" "That should be easy to follow. I've added that last output so you can see " @@ -626,6 +1150,28 @@ msgstr "" "Antes de concluirmos, você provavelmente quer dizer aos seus usuários o " "propósito principal do seu programa, caso eles não saibam::" +#: ../../howto/argparse.rst:752 +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(description=\"calculate X to the power of " +"Y\")\n" +"group = parser.add_mutually_exclusive_group()\n" +"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" +"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" +"parser.add_argument(\"x\", type=int, help=\"the base\")\n" +"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" +"args = parser.parse_args()\n" +"answer = args.x**args.y\n" +"\n" +"if args.quiet:\n" +" print(answer)\n" +"elif args.verbose:\n" +" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" +"else:\n" +" print(f\"{args.x}^{args.y} == {answer}\")" +msgstr "" + #: ../../howto/argparse.rst:770 msgid "" "Note that slight difference in the usage text. Note the ``[-v | -q]``, which " @@ -635,6 +1181,23 @@ msgstr "" "Observe essa pequena diferença no texto de uso. Observe o ``[-v | -q]``, que " "nos diz que podemos usar ``-v`` ou ``-q``, mas não ambos ao mesmo tempo:" +#: ../../howto/argparse.rst:774 ../../howto/argparse.rst:801 +msgid "" +"$ python prog.py --help\n" +"usage: prog.py [-h] [-v | -q] x y\n" +"\n" +"calculate X to the power of Y\n" +"\n" +"positional arguments:\n" +" x the base\n" +" y the exponent\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -v, --verbose\n" +" -q, --quiet" +msgstr "" + #: ../../howto/argparse.rst:792 msgid "How to translate the argparse output" msgstr "Como traduzir a saída do argparse" @@ -673,6 +1236,10 @@ msgstr "" "``.po``. Por exemplo, usando `Babel `__, execute " "este comando:" +#: ../../howto/argparse.rst:824 +msgid "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" +msgstr "" + #: ../../howto/argparse.rst:828 msgid "" "This command will extract all translatable strings from the :mod:`argparse` " @@ -691,6 +1258,12 @@ msgstr "" "Você pode descobrir a localização do módulo :mod:`argparse` em seu sistema " "usando este script::" +#: ../../howto/argparse.rst:835 +msgid "" +"import argparse\n" +"print(argparse.__file__)" +msgstr "" + #: ../../howto/argparse.rst:838 msgid "" "Once the messages in the ``.po`` file are translated and the translations " diff --git a/howto/clinic.po b/howto/clinic.po index 20e92a45a..cc4f4f760 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/cporting.po b/howto/cporting.po index 6386e82b0..590d3beb5 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/curses.po b/howto/curses.po index e93f7c3bc..1eb435bee 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Marciel Leal , 2021 -# Aline Balogh , 2021 -# 82596da39877db21448335599650eb68_ac09920 <1d2e18e2f37f0ba6c4f06b239e0670bd_848591>, 2021 -# Danilo Lima , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -184,6 +178,12 @@ msgid "" "after the name of the corresponding C variable. ::" msgstr "" +#: ../../howto/curses.rst:90 +msgid "" +"import curses\n" +"stdscr = curses.initscr()" +msgstr "" + #: ../../howto/curses.rst:93 msgid "" "Usually curses applications turn off automatic echoing of keys to the " @@ -194,6 +194,10 @@ msgstr "" "tela, para que seja possível ler chaves e somente exibi-las sob certas " "circunstâncias. Isto requer a chamada da função :func:`~curses.noecho`. ::" +#: ../../howto/curses.rst:98 +msgid "curses.noecho()" +msgstr "" + #: ../../howto/curses.rst:100 msgid "" "Applications will also commonly need to react to keys instantly, without " @@ -204,6 +208,10 @@ msgstr "" "sem requisitar que a tecla Enter seja pressionada; isto é chamado de modo " "cbreak, ao contrário do modo de entrada buferizada usual. ::" +#: ../../howto/curses.rst:104 +msgid "curses.cbreak()" +msgstr "" + #: ../../howto/curses.rst:106 msgid "" "Terminals usually return special keys, such as the cursor keys or navigation " @@ -220,6 +228,10 @@ msgstr "" "valor especial como :const:`curses.KEY_LEFT`. Para permitir que curses faça " "esse trabalho, você precisará habilitar o modo keypad. ::" +#: ../../howto/curses.rst:113 +msgid "stdscr.keypad(True)" +msgstr "" + #: ../../howto/curses.rst:115 msgid "" "Terminating a curses application is much easier than starting one. You'll " @@ -228,6 +240,13 @@ msgstr "" "Finalizar uma aplicação curses é mais fácil do que iniciar uma. Você " "precisará executar::" +#: ../../howto/curses.rst:118 +msgid "" +"curses.nocbreak()\n" +"stdscr.keypad(False)\n" +"curses.echo()" +msgstr "" + #: ../../howto/curses.rst:122 msgid "" "to reverse the curses-friendly terminal settings. Then call the :func:" @@ -238,6 +257,10 @@ msgstr "" "a função :func:`~curses.endwin` para restaurar o terminal para seu modo de " "operação original. ::" +#: ../../howto/curses.rst:126 +msgid "curses.endwin()" +msgstr "" + #: ../../howto/curses.rst:128 msgid "" "A common problem when debugging a curses application is to get your terminal " @@ -262,6 +285,25 @@ msgstr "" "mais simples importando a função :func:`curses.wrapper` e utilizando-a desta " "forma::" +#: ../../howto/curses.rst:137 +msgid "" +"from curses import wrapper\n" +"\n" +"def main(stdscr):\n" +" # Clear screen\n" +" stdscr.clear()\n" +"\n" +" # This raises ZeroDivisionError when i == 10.\n" +" for i in range(0, 11):\n" +" v = i-10\n" +" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n" +"\n" +" stdscr.refresh()\n" +" stdscr.getkey()\n" +"\n" +"wrapper(main)" +msgstr "" + #: ../../howto/curses.rst:153 msgid "" "The :func:`~curses.wrapper` function takes a callable object and does the " @@ -305,6 +347,13 @@ msgstr "" "func:`~curses.newwin` cria uma nova janela de um dado tamanho, retornando o " "novo objeto janela. ::" +#: ../../howto/curses.rst:178 +msgid "" +"begin_x = 20; begin_y = 7\n" +"height = 5; width = 40\n" +"win = curses.newwin(height, width, begin_y, begin_x)" +msgstr "" + #: ../../howto/curses.rst:182 msgid "" "Note that the coordinate system used in curses is unusual. Coordinates are " @@ -377,6 +426,24 @@ msgstr "" "altura e largura, enquanto atualizar o pad requer dar as coordenadas da área " "na tela onde uma subseção do pad será exibida. ::" +#: ../../howto/curses.rst:223 +msgid "" +"pad = curses.newpad(100, 100)\n" +"# These loops fill the pad with letters; addch() is\n" +"# explained in the next section\n" +"for y in range(0, 99):\n" +" for x in range(0, 99):\n" +" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n" +"\n" +"# Displays a section of the pad in the middle of the screen.\n" +"# (0,0) : coordinate of upper-left corner of pad area to display.\n" +"# (5,5) : coordinate of upper-left corner of window area to be filled\n" +"# with pad content.\n" +"# (20, 75) : coordinate of lower-right corner of window area to be\n" +"# : filled with pad content.\n" +"pad.refresh( 0,0, 5,5, 20,75)" +msgstr "" + #: ../../howto/curses.rst:238 msgid "" "The :meth:`!refresh` call displays a section of the pad in the rectangle " @@ -645,6 +712,13 @@ msgid "" "you could code::" msgstr "" +#: ../../howto/curses.rst:364 +msgid "" +"stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n" +" curses.A_REVERSE)\n" +"stdscr.refresh()" +msgstr "" + #: ../../howto/curses.rst:368 msgid "" "The curses library also supports color on those terminals that provide it. " @@ -678,6 +752,12 @@ msgstr "" msgid "An example, which displays a line of text using color pair 1::" msgstr "" +#: ../../howto/curses.rst:391 +msgid "" +"stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n" +"stdscr.refresh()" +msgstr "" + #: ../../howto/curses.rst:394 msgid "" "As I said before, a color pair consists of a foreground and background " @@ -701,6 +781,10 @@ msgid "" "background, you would call::" msgstr "" +#: ../../howto/curses.rst:408 +msgid "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)" +msgstr "" + #: ../../howto/curses.rst:410 msgid "" "When you change a color pair, any text already displayed using that color " @@ -708,6 +792,10 @@ msgid "" "color with::" msgstr "" +#: ../../howto/curses.rst:414 +msgid "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))" +msgstr "" + #: ../../howto/curses.rst:416 msgid "" "Very fancy terminals can change the definitions of the actual colors to a " @@ -773,6 +861,18 @@ msgid "" "program may look something like this::" msgstr "" +#: ../../howto/curses.rst:462 +msgid "" +"while True:\n" +" c = stdscr.getch()\n" +" if c == ord('p'):\n" +" PrintDocument()\n" +" elif c == ord('q'):\n" +" break # Exit the while loop\n" +" elif c == curses.KEY_HOME:\n" +" x = y = 0" +msgstr "" + #: ../../howto/curses.rst:471 msgid "" "The :mod:`curses.ascii` module supplies ASCII class membership functions " @@ -792,6 +892,14 @@ msgid "" "number of characters. ::" msgstr "" +#: ../../howto/curses.rst:484 +msgid "" +"curses.echo() # Enable echoing of characters\n" +"\n" +"# Get a 15-character string, with the cursor on the top line\n" +"s = stdscr.getstr(0,0, 15)" +msgstr "" + #: ../../howto/curses.rst:489 msgid "" "The :mod:`curses.textpad` module supplies a text box that supports an Emacs-" @@ -800,6 +908,27 @@ msgid "" "results either with or without trailing spaces. Here's an example::" msgstr "" +#: ../../howto/curses.rst:495 +msgid "" +"import curses\n" +"from curses.textpad import Textbox, rectangle\n" +"\n" +"def main(stdscr):\n" +" stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n" +"\n" +" editwin = curses.newwin(5,30, 2,1)\n" +" rectangle(stdscr, 1,0, 1+5+1, 1+30+1)\n" +" stdscr.refresh()\n" +"\n" +" box = Textbox(editwin)\n" +"\n" +" # Let the user edit until Ctrl-G is struck.\n" +" box.edit()\n" +"\n" +" # Get resulting contents\n" +" message = box.gather()" +msgstr "" + #: ../../howto/curses.rst:513 msgid "" "See the library documentation on :mod:`curses.textpad` for more details." diff --git a/howto/descriptor.po b/howto/descriptor.po index eb0138825..9bc8e9e82 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-23 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -124,6 +121,13 @@ msgid "" "returns the constant ``10``:" msgstr "" +#: ../../howto/descriptor.rst:48 +msgid "" +"class Ten:\n" +" def __get__(self, obj, objtype=None):\n" +" return 10" +msgstr "" + #: ../../howto/descriptor.rst:54 msgid "" "To use the descriptor, it must be stored as a class variable in another " @@ -132,6 +136,13 @@ msgstr "" "Para usar o descritor, ele deve ser armazenado como uma variável de classe " "em outra classe:" +#: ../../howto/descriptor.rst:56 +msgid "" +"class A:\n" +" x = 5 # Regular class attribute\n" +" y = Ten() # Descriptor instance" +msgstr "" + #: ../../howto/descriptor.rst:62 msgid "" "An interactive session shows the difference between normal attribute lookup " @@ -140,6 +151,15 @@ msgstr "" "Uma sessão interativa mostra a diferença entre a pesquisa de atributo normal " "e a pesquisa de descritor:" +#: ../../howto/descriptor.rst:65 +msgid "" +">>> a = A() # Make an instance of class A\n" +">>> a.x # Normal attribute lookup\n" +"5\n" +">>> a.y # Descriptor lookup\n" +"10" +msgstr "" + #: ../../howto/descriptor.rst:73 msgid "" "In the ``a.x`` attribute lookup, the dot operator finds ``'x': 5`` in the " @@ -182,6 +202,23 @@ msgstr "" "Descritores interessantes normalmente executam cálculos em vez de retornar " "constantes:" +#: ../../howto/descriptor.rst:93 +msgid "" +"import os\n" +"\n" +"class DirectorySize:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return len(os.listdir(obj.dirname))\n" +"\n" +"class Directory:\n" +"\n" +" size = DirectorySize() # Descriptor instance\n" +"\n" +" def __init__(self, dirname):\n" +" self.dirname = dirname # Regular instance attribute" +msgstr "" + #: ../../howto/descriptor.rst:109 msgid "" "An interactive session shows that the lookup is dynamic — it computes " @@ -190,6 +227,22 @@ msgstr "" "Uma sessão interativa mostra que a pesquisa é dinâmica – calcula respostas " "diferentes e atualizadas a cada vez::" +#: ../../howto/descriptor.rst:112 +msgid "" +">>> s = Directory('songs')\n" +">>> g = Directory('games')\n" +">>> s.size # The songs directory has twenty " +"files\n" +"20\n" +">>> g.size # The games directory has three " +"files\n" +"3\n" +">>> os.remove('games/chess') # Delete a game\n" +">>> g.size # File count is automatically " +"updated\n" +"2" +msgstr "" + #: ../../howto/descriptor.rst:122 msgid "" "Besides showing how descriptors can run computations, this example also " @@ -234,6 +287,35 @@ msgstr "" "privado. Quando o atributo público é acessado, o descritor registra a " "pesquisa ou atualização:" +#: ../../howto/descriptor.rst:143 +msgid "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAgeAccess:\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = obj._age\n" +" logging.info('Accessing %r giving %r', 'age', value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', 'age', value)\n" +" obj._age = value\n" +"\n" +"class Person:\n" +"\n" +" age = LoggedAgeAccess() # Descriptor instance\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # Regular instance attribute\n" +" self.age = age # Calls __set__()\n" +"\n" +" def birthday(self):\n" +" self.age += 1 # Calls both __get__() and __set__()" +msgstr "" + #: ../../howto/descriptor.rst:172 msgid "" "An interactive session shows that all access to the managed attribute *age* " @@ -242,6 +324,36 @@ msgstr "" "Uma sessão interativa mostra que todo o acesso ao atributo gerenciado *age* " "é registrado, mas que o atributo regular *name* não é registrado:" +#: ../../howto/descriptor.rst:181 +msgid "" +">>> mary = Person('Mary M', 30) # The initial age update is logged\n" +"INFO:root:Updating 'age' to 30\n" +">>> dave = Person('David D', 40)\n" +"INFO:root:Updating 'age' to 40\n" +"\n" +">>> vars(mary) # The actual data is in a private " +"attribute\n" +"{'name': 'Mary M', '_age': 30}\n" +">>> vars(dave)\n" +"{'name': 'David D', '_age': 40}\n" +"\n" +">>> mary.age # Access the data and log the " +"lookup\n" +"INFO:root:Accessing 'age' giving 30\n" +"30\n" +">>> mary.birthday() # Updates are logged as well\n" +"INFO:root:Accessing 'age' giving 30\n" +"INFO:root:Updating 'age' to 31\n" +"\n" +">>> dave.name # Regular attribute lookup isn't " +"logged\n" +"'David D'\n" +">>> dave.age # Only the managed attribute is " +"logged\n" +"INFO:root:Accessing 'age' giving 40\n" +"40" +msgstr "" + #: ../../howto/descriptor.rst:206 msgid "" "One major issue with this example is that the private name *_age* is " @@ -280,6 +392,40 @@ msgstr "" "nomes dos campos possam ser registrados, dando a cada descritor o seu " "próprio *public_name* e *private_name*:" +#: ../../howto/descriptor.rst:223 +msgid "" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class LoggedAccess:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.public_name = name\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" value = getattr(obj, self.private_name)\n" +" logging.info('Accessing %r giving %r', self.public_name, value)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" logging.info('Updating %r to %r', self.public_name, value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +"class Person:\n" +"\n" +" name = LoggedAccess() # First descriptor instance\n" +" age = LoggedAccess() # Second descriptor instance\n" +"\n" +" def __init__(self, name, age):\n" +" self.name = name # Calls the first descriptor\n" +" self.age = age # Calls the second descriptor\n" +"\n" +" def birthday(self):\n" +" self.age += 1" +msgstr "" + #: ../../howto/descriptor.rst:256 msgid "" "An interactive session shows that the :class:`Person` class has called :meth:" @@ -290,14 +436,40 @@ msgstr "" "`__set_name__` para que os nomes dos campos fossem registrados. Aqui " "chamamos :func:`vars` para pesquisar o descritor sem acioná-lo:" +#: ../../howto/descriptor.rst:260 +msgid "" +">>> vars(vars(Person)['name'])\n" +"{'public_name': 'name', 'private_name': '_name'}\n" +">>> vars(vars(Person)['age'])\n" +"{'public_name': 'age', 'private_name': '_age'}" +msgstr "" + #: ../../howto/descriptor.rst:267 msgid "The new class now logs access to both *name* and *age*:" msgstr "A nova classe agora registra acesso a *name* e *age*:" +#: ../../howto/descriptor.rst:275 +msgid "" +">>> pete = Person('Peter P', 10)\n" +"INFO:root:Updating 'name' to 'Peter P'\n" +"INFO:root:Updating 'age' to 10\n" +">>> kate = Person('Catherine C', 20)\n" +"INFO:root:Updating 'name' to 'Catherine C'\n" +"INFO:root:Updating 'age' to 20" +msgstr "" + #: ../../howto/descriptor.rst:284 msgid "The two *Person* instances contain only the private names:" msgstr "As duas instâncias *Person* contêm apenas os nomes privados:" +#: ../../howto/descriptor.rst:286 +msgid "" +">>> vars(pete)\n" +"{'_name': 'Peter P', '_age': 10}\n" +">>> vars(kate)\n" +"{'_name': 'Catherine C', '_age': 20}" +msgstr "" + #: ../../howto/descriptor.rst:295 msgid "Closing thoughts" msgstr "Pensamentos finais" @@ -380,6 +552,27 @@ msgid "" "managed attribute descriptor:" msgstr "" +#: ../../howto/descriptor.rst:343 +msgid "" +"from abc import ABC, abstractmethod\n" +"\n" +"class Validator(ABC):\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.private_name = '_' + name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return getattr(obj, self.private_name)\n" +"\n" +" def __set__(self, obj, value):\n" +" self.validate(value)\n" +" setattr(obj, self.private_name, value)\n" +"\n" +" @abstractmethod\n" +" def validate(self, value):\n" +" pass" +msgstr "" + #: ../../howto/descriptor.rst:363 msgid "" "Custom validators need to inherit from :class:`Validator` and must supply a :" @@ -414,6 +607,61 @@ msgid "" "as well." msgstr "" +#: ../../howto/descriptor.rst:383 +msgid "" +"class OneOf(Validator):\n" +"\n" +" def __init__(self, *options):\n" +" self.options = set(options)\n" +"\n" +" def validate(self, value):\n" +" if value not in self.options:\n" +" raise ValueError(f'Expected {value!r} to be one of {self.options!" +"r}')\n" +"\n" +"class Number(Validator):\n" +"\n" +" def __init__(self, minvalue=None, maxvalue=None):\n" +" self.minvalue = minvalue\n" +" self.maxvalue = maxvalue\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, (int, float)):\n" +" raise TypeError(f'Expected {value!r} to be an int or float')\n" +" if self.minvalue is not None and value < self.minvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be at least {self.minvalue!r}'\n" +" )\n" +" if self.maxvalue is not None and value > self.maxvalue:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no more than {self.maxvalue!r}'\n" +" )\n" +"\n" +"class String(Validator):\n" +"\n" +" def __init__(self, minsize=None, maxsize=None, predicate=None):\n" +" self.minsize = minsize\n" +" self.maxsize = maxsize\n" +" self.predicate = predicate\n" +"\n" +" def validate(self, value):\n" +" if not isinstance(value, str):\n" +" raise TypeError(f'Expected {value!r} to be an str')\n" +" if self.minsize is not None and len(value) < self.minsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no smaller than {self.minsize!" +"r}'\n" +" )\n" +" if self.maxsize is not None and len(value) > self.maxsize:\n" +" raise ValueError(\n" +" f'Expected {value!r} to be no bigger than {self.maxsize!r}'\n" +" )\n" +" if self.predicate is not None and not self.predicate(value):\n" +" raise ValueError(\n" +" f'Expected {self.predicate} to be true for {value!r}'\n" +" )" +msgstr "" + #: ../../howto/descriptor.rst:437 msgid "Practical application" msgstr "Aplicação prática" @@ -422,10 +670,50 @@ msgstr "Aplicação prática" msgid "Here's how the data validators can be used in a real class:" msgstr "" +#: ../../howto/descriptor.rst:441 +msgid "" +"class Component:\n" +"\n" +" name = String(minsize=3, maxsize=10, predicate=str.isupper)\n" +" kind = OneOf('wood', 'metal', 'plastic')\n" +" quantity = Number(minvalue=0)\n" +"\n" +" def __init__(self, name, kind, quantity):\n" +" self.name = name\n" +" self.kind = kind\n" +" self.quantity = quantity" +msgstr "" + #: ../../howto/descriptor.rst:454 msgid "The descriptors prevent invalid instances from being created:" msgstr "" +#: ../../howto/descriptor.rst:456 +msgid "" +">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all " +"uppercase\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected to be true for " +"'Widget'\n" +"\n" +">>> Component('WIDGET', 'metle', 5) # Blocked: 'metle' is misspelled\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected 'metle' to be one of {'metal', 'plastic', 'wood'}\n" +"\n" +">>> Component('WIDGET', 'metal', -5) # Blocked: -5 is negative\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: Expected -5 to be at least 0\n" +">>> Component('WIDGET', 'metal', 'V') # Blocked: 'V' isn't a number\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: Expected 'V' to be an int or float\n" +"\n" +">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" +msgstr "" + #: ../../howto/descriptor.rst:481 msgid "Technical Tutorial" msgstr "" @@ -480,9 +768,9 @@ msgstr "" msgid "" "Descriptors are a powerful, general purpose protocol. They are the " "mechanism behind properties, methods, static methods, class methods, and :" -"func:`super()`. They are used throughout Python itself. Descriptors " -"simplify the underlying C code and offer a flexible set of new tools for " -"everyday Python programs." +"func:`super`. They are used throughout Python itself. Descriptors simplify " +"the underlying C code and offer a flexible set of new tools for everyday " +"Python programs." msgstr "" #: ../../howto/descriptor.rst:522 @@ -587,6 +875,35 @@ msgid "" "is a pure Python equivalent:" msgstr "" +#: ../../howto/descriptor.rst:583 +msgid "" +"def find_name_in_mro(cls, name, default):\n" +" \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n" +" for base in cls.__mro__:\n" +" if name in vars(base):\n" +" return vars(base)[name]\n" +" return default\n" +"\n" +"def object_getattribute(obj, name):\n" +" \"Emulate PyObject_GenericGetAttr() in Objects/object.c\"\n" +" null = object()\n" +" objtype = type(obj)\n" +" cls_var = find_name_in_mro(objtype, name, null)\n" +" descr_get = getattr(type(cls_var), '__get__', null)\n" +" if descr_get is not null:\n" +" if (hasattr(type(cls_var), '__set__')\n" +" or hasattr(type(cls_var), '__delete__')):\n" +" return descr_get(cls_var, obj, objtype) # data descriptor\n" +" if hasattr(obj, '__dict__') and name in vars(obj):\n" +" return vars(obj)[name] # instance variable\n" +" if descr_get is not null:\n" +" return descr_get(cls_var, obj, objtype) # non-data " +"descriptor\n" +" if cls_var is not null:\n" +" return cls_var # class variable\n" +" raise AttributeError(name)" +msgstr "" + #: ../../howto/descriptor.rst:719 msgid "" "Note, there is no :meth:`__getattr__` hook in the :meth:`__getattribute__` " @@ -602,6 +919,18 @@ msgid "" "encapsulated in a helper function:" msgstr "" +#: ../../howto/descriptor.rst:728 +msgid "" +"def getattr_hook(obj, name):\n" +" \"Emulate slot_tp_getattr_hook() in Objects/typeobject.c\"\n" +" try:\n" +" return obj.__getattribute__(name)\n" +" except AttributeError:\n" +" if not hasattr(type(obj), '__getattr__'):\n" +" raise\n" +" return type(obj).__getattr__(obj, name) # __getattr__" +msgstr "" + #: ../../howto/descriptor.rst:773 msgid "Invocation from a class" msgstr "" @@ -631,7 +960,7 @@ msgstr "" #: ../../howto/descriptor.rst:789 msgid "" "The logic for super's dotted lookup is in the :meth:`__getattribute__` " -"method for object returned by :class:`super()`." +"method for object returned by :func:`super`." msgstr "" #: ../../howto/descriptor.rst:792 @@ -743,6 +1072,24 @@ msgid "" "care of lookups or updates:" msgstr "" +#: ../../howto/descriptor.rst:858 +msgid "" +"class Field:\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self.fetch = f'SELECT {name} FROM {owner.table} WHERE {owner.key}" +"=?;'\n" +" self.store = f'UPDATE {owner.table} SET {name}=? WHERE {owner.key}" +"=?;'\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return conn.execute(self.fetch, [obj.key]).fetchone()[0]\n" +"\n" +" def __set__(self, obj, value):\n" +" conn.execute(self.store, [value, obj.key])\n" +" conn.commit()" +msgstr "" + #: ../../howto/descriptor.rst:873 msgid "" "We can use the :class:`Field` class to define `models >> import sqlite3\n" +">>> conn = sqlite3.connect('entertainment.db')" +msgstr "" + #: ../../howto/descriptor.rst:903 msgid "" "An interactive session shows how data is retrieved from the database and how " "it can be updated:" msgstr "" +#: ../../howto/descriptor.rst:931 +msgid "" +">>> Movie('Star Wars').director\n" +"'George Lucas'\n" +">>> jaws = Movie('Jaws')\n" +">>> f'Released in {jaws.year} by {jaws.director}'\n" +"'Released in 1975 by Steven Spielberg'\n" +"\n" +">>> Song('Country Roads').artist\n" +"'John Denver'\n" +"\n" +">>> Movie('Star Wars').director = 'J.J. Abrams'\n" +">>> Movie('Star Wars').director\n" +"'J.J. Abrams'" +msgstr "" + #: ../../howto/descriptor.rst:952 msgid "Pure Python Equivalents" msgstr "" @@ -783,17 +1174,89 @@ msgid "" "is::" msgstr "" +#: ../../howto/descriptor.rst:966 +msgid "property(fget=None, fset=None, fdel=None, doc=None) -> property" +msgstr "" + #: ../../howto/descriptor.rst:968 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" +#: ../../howto/descriptor.rst:970 +msgid "" +"class C:\n" +" def getx(self): return self.__x\n" +" def setx(self, value): self.__x = value\n" +" def delx(self): del self.__x\n" +" x = property(getx, setx, delx, \"I'm the 'x' property.\")" +msgstr "" + #: ../../howto/descriptor.rst:992 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent:" msgstr "" +#: ../../howto/descriptor.rst:995 +msgid "" +"class Property:\n" +" \"Emulate PyProperty_Type() in Objects/descrobject.c\"\n" +"\n" +" def __init__(self, fget=None, fset=None, fdel=None, doc=None):\n" +" self.fget = fget\n" +" self.fset = fset\n" +" self.fdel = fdel\n" +" if doc is None and fget is not None:\n" +" doc = fget.__doc__\n" +" self.__doc__ = doc\n" +" self._name = ''\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self._name = name\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" if obj is None:\n" +" return self\n" +" if self.fget is None:\n" +" raise AttributeError(\n" +" f'property {self._name!r} of {type(obj).__name__!r} object " +"has no getter'\n" +" )\n" +" return self.fget(obj)\n" +"\n" +" def __set__(self, obj, value):\n" +" if self.fset is None:\n" +" raise AttributeError(\n" +" f'property {self._name!r} of {type(obj).__name__!r} object " +"has no setter'\n" +" )\n" +" self.fset(obj, value)\n" +"\n" +" def __delete__(self, obj):\n" +" if self.fdel is None:\n" +" raise AttributeError(\n" +" f'property {self._name!r} of {type(obj).__name__!r} object " +"has no deleter'\n" +" )\n" +" self.fdel(obj)\n" +"\n" +" def getter(self, fget):\n" +" prop = type(self)(fget, self.fset, self.fdel, self.__doc__)\n" +" prop._name = self._name\n" +" return prop\n" +"\n" +" def setter(self, fset):\n" +" prop = type(self)(self.fget, fset, self.fdel, self.__doc__)\n" +" prop._name = self._name\n" +" return prop\n" +"\n" +" def deleter(self, fdel):\n" +" prop = type(self)(self.fget, self.fset, fdel, self.__doc__)\n" +" prop._name = self._name\n" +" return prop" +msgstr "" + #: ../../howto/descriptor.rst:1132 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " @@ -811,6 +1274,18 @@ msgid "" "descriptor:" msgstr "" +#: ../../howto/descriptor.rst:1142 +msgid "" +"class Cell:\n" +" ...\n" +"\n" +" @property\n" +" def value(self):\n" +" \"Recalculate the cell before returning value\"\n" +" self.recalc()\n" +" return self._value" +msgstr "" + #: ../../howto/descriptor.rst:1153 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " @@ -841,6 +1316,21 @@ msgid "" "roughly equivalent to:" msgstr "" +#: ../../howto/descriptor.rst:1171 +msgid "" +"class MethodType:\n" +" \"Emulate PyMethod_Type in Objects/classobject.c\"\n" +"\n" +" def __init__(self, func, obj):\n" +" self.__func__ = func\n" +" self.__self__ = obj\n" +"\n" +" def __call__(self, *args, **kwargs):\n" +" func = self.__func__\n" +" obj = self.__self__\n" +" return func(obj, *args, **kwargs)" +msgstr "" + #: ../../howto/descriptor.rst:1185 msgid "" "To support automatic creation of methods, functions include the :meth:" @@ -849,41 +1339,94 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" +#: ../../howto/descriptor.rst:1190 +msgid "" +"class Function:\n" +" ...\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Simulate func_descr_get() in Objects/funcobject.c\"\n" +" if obj is None:\n" +" return self\n" +" return MethodType(self, obj)" +msgstr "" + #: ../../howto/descriptor.rst:1201 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" +#: ../../howto/descriptor.rst:1204 +msgid "" +"class D:\n" +" def f(self, x):\n" +" return x" +msgstr "" + #: ../../howto/descriptor.rst:1210 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" +#: ../../howto/descriptor.rst:1212 +msgid "" +">>> D.f.__qualname__\n" +"'D.f'" +msgstr "" + #: ../../howto/descriptor.rst:1217 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" +#: ../../howto/descriptor.rst:1220 +msgid "" +">>> D.__dict__['f']\n" +"" +msgstr "" + #: ../../howto/descriptor.rst:1223 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" +#: ../../howto/descriptor.rst:1226 +msgid "" +">>> D.f\n" +"" +msgstr "" + #: ../../howto/descriptor.rst:1229 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" +#: ../../howto/descriptor.rst:1232 +msgid "" +">>> d = D()\n" +">>> d.f\n" +">" +msgstr "" + #: ../../howto/descriptor.rst:1236 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" +#: ../../howto/descriptor.rst:1239 +msgid "" +">>> d.f.__func__\n" +"\n" +"\n" +">>> d.f.__self__\n" +"<__main__.D object at 0x00B18C90>" +msgstr "" + #: ../../howto/descriptor.rst:1245 msgid "" "If you have ever wondered where *self* comes from in regular methods or " @@ -989,12 +1532,46 @@ msgid "" "example calls are unexciting:" msgstr "" +#: ../../howto/descriptor.rst:1298 +msgid "" +"class E:\n" +" @staticmethod\n" +" def f(x):\n" +" return x * 10" +msgstr "" + +#: ../../howto/descriptor.rst:1305 +msgid "" +">>> E.f(3)\n" +"30\n" +">>> E().f(3)\n" +"30" +msgstr "" + #: ../../howto/descriptor.rst:1312 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" +#: ../../howto/descriptor.rst:1315 +msgid "" +"import functools\n" +"\n" +"class StaticMethod:\n" +" \"Emulate PyStaticMethod_Type() in Objects/funcobject.c\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" return self.f\n" +"\n" +" def __call__(self, *args, **kwds):\n" +" return self.f(*args, **kwds)" +msgstr "" + #: ../../howto/descriptor.rst:1332 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " @@ -1015,6 +1592,22 @@ msgid "" "whether the caller is an object or a class:" msgstr "" +#: ../../howto/descriptor.rst:1407 +msgid "" +"class F:\n" +" @classmethod\n" +" def f(cls, x):\n" +" return cls.__name__, x" +msgstr "" + +#: ../../howto/descriptor.rst:1414 +msgid "" +">>> F.f(3)\n" +"('F', 3)\n" +">>> F().f(3)\n" +"('F', 3)" +msgstr "" + #: ../../howto/descriptor.rst:1421 msgid "" "This behavior is useful whenever the method only needs to have a class " @@ -1024,16 +1617,58 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" +#: ../../howto/descriptor.rst:1427 +msgid "" +"class Dict(dict):\n" +" @classmethod\n" +" def fromkeys(cls, iterable, value=None):\n" +" \"Emulate dict_fromkeys() in Objects/dictobject.c\"\n" +" d = cls()\n" +" for key in iterable:\n" +" d[key] = value\n" +" return d" +msgstr "" + #: ../../howto/descriptor.rst:1438 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" +#: ../../howto/descriptor.rst:1440 +msgid "" +">>> d = Dict.fromkeys('abracadabra')\n" +">>> type(d) is Dict\n" +"True\n" +">>> d\n" +"{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" +msgstr "" + #: ../../howto/descriptor.rst:1448 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" +#: ../../howto/descriptor.rst:1451 +msgid "" +"import functools\n" +"\n" +"class ClassMethod:\n" +" \"Emulate PyClassMethod_Type() in Objects/funcobject.c\"\n" +"\n" +" def __init__(self, f):\n" +" self.f = f\n" +" functools.update_wrapper(self, f)\n" +"\n" +" def __get__(self, obj, cls=None):\n" +" if cls is None:\n" +" cls = type(obj)\n" +" if hasattr(type(self.f), '__get__'):\n" +" # This code path was added in Python 3.9\n" +" # and was deprecated in Python 3.11.\n" +" return self.f.__get__(cls, cls)\n" +" return MethodType(self.f, cls)" +msgstr "" + #: ../../howto/descriptor.rst:1526 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " @@ -1042,6 +1677,21 @@ msgid "" "together. In Python 3.11, this functionality was deprecated." msgstr "" +#: ../../howto/descriptor.rst:1531 +msgid "" +"class G:\n" +" @classmethod\n" +" @property\n" +" def __doc__(cls):\n" +" return f'A doc for {cls.__name__!r}'" +msgstr "" + +#: ../../howto/descriptor.rst:1539 +msgid "" +">>> G.__doc__\n" +"\"A doc for 'G'\"" +msgstr "" + #: ../../howto/descriptor.rst:1544 msgid "" "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " @@ -1069,12 +1719,62 @@ msgid "" "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" +#: ../../howto/descriptor.rst:1562 +msgid "" +"class Vehicle:\n" +" __slots__ = ('id_number', 'make', 'model')" +msgstr "" + +#: ../../howto/descriptor.rst:1567 +msgid "" +">>> auto = Vehicle()\n" +">>> auto.id_nubmer = 'VYE483814LQEX'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" +msgstr "" + #: ../../howto/descriptor.rst:1575 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" +#: ../../howto/descriptor.rst:1578 +msgid "" +"class Immutable:\n" +"\n" +" __slots__ = ('_dept', '_name') # Replace the instance " +"dictionary\n" +"\n" +" def __init__(self, dept, name):\n" +" self._dept = dept # Store to private attribute\n" +" self._name = name # Store to private attribute\n" +"\n" +" @property # Read-only descriptor\n" +" def dept(self):\n" +" return self._dept\n" +"\n" +" @property\n" +" def name(self): # Read-only descriptor\n" +" return self._name" +msgstr "" + +#: ../../howto/descriptor.rst:1596 +msgid "" +">>> mark = Immutable('Botany', 'Mark Watney')\n" +">>> mark.dept\n" +"'Botany'\n" +">>> mark.dept = 'Space Pirate'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: property 'dept' of 'Immutable' object has no setter\n" +">>> mark.location = 'Mars'\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'Immutable' object has no attribute 'location'" +msgstr "" + #: ../../howto/descriptor.rst:1610 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " @@ -1095,6 +1795,27 @@ msgid "" "instance dictionary to function correctly:" msgstr "" +#: ../../howto/descriptor.rst:1621 +msgid "" +"from functools import cached_property\n" +"\n" +"class CP:\n" +" __slots__ = () # Eliminates the instance dict\n" +"\n" +" @cached_property # Requires an instance dict\n" +" def pi(self):\n" +" return 4 * sum((-1.0)**n / (2.0*n + 1.0)\n" +" for n in reversed(range(100_000)))" +msgstr "" + +#: ../../howto/descriptor.rst:1633 +msgid "" +">>> CP().pi\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." +msgstr "" + #: ../../howto/descriptor.rst:1640 msgid "" "It is not possible to create an exact drop-in pure Python version of " @@ -1105,12 +1826,65 @@ msgid "" "managed by member descriptors:" msgstr "" +#: ../../howto/descriptor.rst:1647 +msgid "" +"null = object()\n" +"\n" +"class Member:\n" +"\n" +" def __init__(self, name, clsname, offset):\n" +" 'Emulate PyMemberDef in Include/structmember.h'\n" +" # Also see descr_new() in Objects/descrobject.c\n" +" self.name = name\n" +" self.clsname = clsname\n" +" self.offset = offset\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" 'Emulate member_get() in Objects/descrobject.c'\n" +" # Also see PyMember_GetOne() in Python/structmember.c\n" +" if obj is None:\n" +" return self\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" return value\n" +"\n" +" def __set__(self, obj, value):\n" +" 'Emulate member_set() in Objects/descrobject.c'\n" +" obj._slotvalues[self.offset] = value\n" +"\n" +" def __delete__(self, obj):\n" +" 'Emulate member_delete() in Objects/descrobject.c'\n" +" value = obj._slotvalues[self.offset]\n" +" if value is null:\n" +" raise AttributeError(self.name)\n" +" obj._slotvalues[self.offset] = null\n" +"\n" +" def __repr__(self):\n" +" 'Emulate member_repr() in Objects/descrobject.c'\n" +" return f''" +msgstr "" + #: ../../howto/descriptor.rst:1685 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" +#: ../../howto/descriptor.rst:1688 +msgid "" +"class Type(type):\n" +" 'Simulate how the type metaclass adds member objects for slots'\n" +"\n" +" def __new__(mcls, clsname, bases, mapping, **kwargs):\n" +" 'Emulate type_new() in Objects/typeobject.c'\n" +" # type_new() calls PyTypeReady() which calls add_methods()\n" +" slot_names = mapping.get('slot_names', [])\n" +" for offset, name in enumerate(slot_names):\n" +" mapping[name] = Member(name, clsname, offset)\n" +" return type.__new__(mcls, clsname, bases, mapping, **kwargs)" +msgstr "" + #: ../../howto/descriptor.rst:1701 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " @@ -1118,23 +1892,97 @@ msgid "" "Python:" msgstr "" +#: ../../howto/descriptor.rst:1705 +msgid "" +"class Object:\n" +" 'Simulate how object.__new__() allocates memory for __slots__'\n" +"\n" +" def __new__(cls, *args, **kwargs):\n" +" 'Emulate object_new() in Objects/typeobject.c'\n" +" inst = super().__new__(cls)\n" +" if hasattr(cls, 'slot_names'):\n" +" empty_slots = [null] * len(cls.slot_names)\n" +" object.__setattr__(inst, '_slotvalues', empty_slots)\n" +" return inst\n" +"\n" +" def __setattr__(self, name, value):\n" +" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__setattr__(name, value)\n" +"\n" +" def __delattr__(self, name):\n" +" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" +" cls = type(self)\n" +" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" +" raise AttributeError(\n" +" f'{cls.__name__!r} object has no attribute {name!r}'\n" +" )\n" +" super().__delattr__(name)" +msgstr "" + #: ../../howto/descriptor.rst:1736 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" +#: ../../howto/descriptor.rst:1739 +msgid "" +"class H(Object, metaclass=Type):\n" +" 'Instance variables stored in slots'\n" +"\n" +" slot_names = ['x', 'y']\n" +"\n" +" def __init__(self, x, y):\n" +" self.x = x\n" +" self.y = y" +msgstr "" + #: ../../howto/descriptor.rst:1750 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" +#: ../../howto/descriptor.rst:1752 +msgid "" +">>> from pprint import pp\n" +">>> pp(dict(vars(H)))\n" +"{'__module__': '__main__',\n" +" '__doc__': 'Instance variables stored in slots',\n" +" 'slot_names': ['x', 'y'],\n" +" '__init__': ,\n" +" 'x': ,\n" +" 'y': }" +msgstr "" + #: ../../howto/descriptor.rst:1771 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" +#: ../../howto/descriptor.rst:1774 +msgid "" +">>> h = H(10, 20)\n" +">>> vars(h)\n" +"{'_slotvalues': [10, 20]}\n" +">>> h.x = 55\n" +">>> vars(h)\n" +"{'_slotvalues': [55, 20]}" +msgstr "" + #: ../../howto/descriptor.rst:1783 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" + +#: ../../howto/descriptor.rst:1785 +msgid "" +">>> h.xz\n" +"Traceback (most recent call last):\n" +" ...\n" +"AttributeError: 'H' object has no attribute 'xz'" +msgstr "" diff --git a/howto/enum.po b/howto/enum.po index c9f987b5f..29d8ecb2c 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Misael borges , 2021 -# Guilherme Alves da Silva, 2023 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -36,13 +30,9 @@ msgstr "Enum" #: ../../howto/enum.rst:9 msgid "" "An :class:`Enum` is a set of symbolic names bound to unique values. They " -"are similar to global variables, but they offer a more useful :func:" -"`repr()`, grouping, type-safety, and a few other features." +"are similar to global variables, but they offer a more useful :func:`repr`, " +"grouping, type-safety, and a few other features." msgstr "" -"Uma classe :class:`Enum` é um conjunto de nomes simbólicos vinculados a " -"valores únicos. Eles são semelhantes às variáveis globais, mas oferecem um :" -"func:`repr()` mais útil, agrupamento, segurança de tipo e alguns outros " -"recursos." #: ../../howto/enum.rst:13 msgid "" @@ -52,10 +42,32 @@ msgstr "" "Eles são mais úteis quando você tem uma variável que pode ter uma seleção " "limitada de valores. Por exemplo, os dias da semana::" +#: ../../howto/enum.rst:16 +msgid "" +">>> from enum import Enum\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7" +msgstr "" + #: ../../howto/enum.rst:26 msgid "Or perhaps the RGB primary colors::" msgstr "Ou talvez as cores primárias RGB::" +#: ../../howto/enum.rst:28 +msgid "" +">>> from enum import Enum\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3" +msgstr "" + #: ../../howto/enum.rst:34 msgid "" "As you can see, creating an :class:`Enum` is as simple as writing a class " @@ -90,6 +102,12 @@ msgstr "" "importante, mas de qualquer forma esse valor pode ser usado para obter o " "membro correspondente::" +#: ../../howto/enum.rst:48 +msgid "" +">>> Weekday(3)\n" +"" +msgstr "" + #: ../../howto/enum.rst:51 msgid "" "As you can see, the ``repr()`` of a member shows the enum name, the member " @@ -100,19 +118,45 @@ msgstr "" "do membro e o valor. O ``str()`` de um membro mostra apenas o nome do enum e " "o nome do membro::" +#: ../../howto/enum.rst:55 +msgid "" +">>> print(Weekday.THURSDAY)\n" +"Weekday.THURSDAY" +msgstr "" + #: ../../howto/enum.rst:58 msgid "The *type* of an enumeration member is the enum it belongs to::" msgstr "O *tipo* de um membro de enumeração é o enum ao qual ele pertence::" +#: ../../howto/enum.rst:60 +msgid "" +">>> type(Weekday.MONDAY)\n" +"\n" +">>> isinstance(Weekday.FRIDAY, Weekday)\n" +"True" +msgstr "" + #: ../../howto/enum.rst:65 msgid "Enum members have an attribute that contains just their :attr:`name`::" msgstr "" "Os membros do Enum têm um atributo que contém apenas seu :attr:`name`::" +#: ../../howto/enum.rst:67 +msgid "" +">>> print(Weekday.TUESDAY.name)\n" +"TUESDAY" +msgstr "" + #: ../../howto/enum.rst:70 msgid "Likewise, they have an attribute for their :attr:`value`::" msgstr "Da mesma forma, eles têm um atributo para seu :attr:`value`::" +#: ../../howto/enum.rst:73 +msgid "" +">>> Weekday.WEDNESDAY.value\n" +"3" +msgstr "" + #: ../../howto/enum.rst:76 msgid "" "Unlike many languages that treat enumerations solely as name/value pairs, " @@ -131,14 +175,44 @@ msgstr "" "podemos adicionar um método ao enum de :class:`Weekday` para extrair o dia " "da instância de :class:`date` e retornar o membro enum correspondente::" +#: ../../howto/enum.rst:84 +msgid "" +"@classmethod\n" +"def from_date(cls, date):\n" +" return cls(date.isoweekday())" +msgstr "" + #: ../../howto/enum.rst:88 msgid "The complete :class:`Weekday` enum now looks like this::" msgstr "O enum de :class:`Weekday` completa agora tem esta forma::" +#: ../../howto/enum.rst:90 +msgid "" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... #\n" +"... @classmethod\n" +"... def from_date(cls, date):\n" +"... return cls(date.isoweekday())" +msgstr "" + #: ../../howto/enum.rst:103 msgid "Now we can find out what today is! Observe::" msgstr "Agora podemos descobrir o que é hoje! Observar::" +#: ../../howto/enum.rst:105 +msgid "" +">>> from datetime import date\n" +">>> Weekday.from_date(date.today()) \n" +"" +msgstr "" + #: ../../howto/enum.rst:109 msgid "" "Of course, if you're reading this on some other day, you'll see that day " @@ -158,6 +232,19 @@ msgstr "" "para traçar tarefas durante uma semana e não queremos usar uma :class:`list` " "-- poderíamos usar um tipo diferente de :class:`Enum`::" +#: ../../howto/enum.rst:116 +msgid "" +">>> from enum import Flag\n" +">>> class Weekday(Flag):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 4\n" +"... THURSDAY = 8\n" +"... FRIDAY = 16\n" +"... SATURDAY = 32\n" +"... SUNDAY = 64" +msgstr "" + #: ../../howto/enum.rst:126 msgid "" "We've changed two things: we're inherited from :class:`Flag`, and the values " @@ -174,6 +261,13 @@ msgstr "" "Assim como o enum :class:`Weekday` original acima, podemos ter uma seleção " "única:" +#: ../../howto/enum.rst:131 +msgid "" +">>> first_week_day = Weekday.MONDAY\n" +">>> first_week_day\n" +"" +msgstr "" + #: ../../howto/enum.rst:135 msgid "" "But :class:`Flag` also allows us to combine several members into a single " @@ -182,25 +276,73 @@ msgstr "" "Porem :class:`Flag` também nos permite combinar vários membros em uma única " "variável:" +#: ../../howto/enum.rst:138 +msgid "" +">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" +">>> weekend\n" +"" +msgstr "" + #: ../../howto/enum.rst:142 msgid "You can even iterate over a :class:`Flag` variable::" msgstr "Você pode até mesmo iterar sobre uma variável :class:`Flag`:" +#: ../../howto/enum.rst:144 +msgid "" +">>> for day in weekend:\n" +"... print(day)\n" +"Weekday.SATURDAY\n" +"Weekday.SUNDAY" +msgstr "" + #: ../../howto/enum.rst:149 msgid "Okay, let's get some chores set up::" msgstr "Certo, vamos configurar algumas tarefas domésticas:" +#: ../../howto/enum.rst:151 +msgid "" +">>> chores_for_ethan = {\n" +"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." +"FRIDAY,\n" +"... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,\n" +"... 'answer SO questions': Weekday.SATURDAY,\n" +"... }" +msgstr "" + #: ../../howto/enum.rst:157 msgid "And a function to display the chores for a given day::" msgstr "E a função para mostrar as tarefas domésticas para um determinado dia:" +#: ../../howto/enum.rst:159 +msgid "" +">>> def show_chores(chores, day):\n" +"... for chore, days in chores.items():\n" +"... if day in days:\n" +"... print(chore)\n" +"...\n" +">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" +"answer SO questions" +msgstr "" + #: ../../howto/enum.rst:167 msgid "" "In cases where the actual values of the members do not matter, you can save " -"yourself some work and use :func:`auto()` for the values::" +"yourself some work and use :func:`auto` for the values::" +msgstr "" + +#: ../../howto/enum.rst:170 +msgid "" +">>> from enum import auto\n" +">>> class Weekday(Flag):\n" +"... MONDAY = auto()\n" +"... TUESDAY = auto()\n" +"... WEDNESDAY = auto()\n" +"... THURSDAY = auto()\n" +"... FRIDAY = auto()\n" +"... SATURDAY = auto()\n" +"... SUNDAY = auto()\n" +"... WEEKEND = SATURDAY | SUNDAY" msgstr "" -"Nos casos onde os valores reais dos membros não importam, você pode " -"economizar trabalho e usar :func:`auto()` para os valores:" #: ../../howto/enum.rst:186 msgid "Programmatic access to enumeration members and their attributes" @@ -217,17 +359,42 @@ msgstr "" "porque a cor exata não é conhecida no momento da escrita do programa)." "``Enum`` permite esse tipo de acesso:" +#: ../../howto/enum.rst:192 +msgid "" +">>> Color(1)\n" +"\n" +">>> Color(3)\n" +"" +msgstr "" + #: ../../howto/enum.rst:197 msgid "If you want to access enum members by *name*, use item access::" msgstr "" "Se você deseja ter acesso aos membros do enum pelo *nome*, use o acesso por " "itens:" +#: ../../howto/enum.rst:199 +msgid "" +">>> Color['RED']\n" +"\n" +">>> Color['GREEN']\n" +"" +msgstr "" + #: ../../howto/enum.rst:204 msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" msgstr "" "Se você tem um membro do enum e precisa do seu :attr:`name` ou :attr:`value`:" +#: ../../howto/enum.rst:206 +msgid "" +">>> member = Color.RED\n" +">>> member.name\n" +"'RED'\n" +">>> member.value\n" +"1" +msgstr "" + #: ../../howto/enum.rst:214 msgid "Duplicating enum members and values" msgstr "Duplicar membros do enum e seus valores." @@ -236,6 +403,17 @@ msgstr "Duplicar membros do enum e seus valores." msgid "Having two enum members with the same name is invalid::" msgstr "Ter dois membros de um enum com o mesmo nome é inválido:" +#: ../../howto/enum.rst:218 +msgid "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... SQUARE = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: 'SQUARE' already defined as 2" +msgstr "" + #: ../../howto/enum.rst:226 msgid "" "However, an enum member can have other names associated with it. Given two " @@ -250,6 +428,22 @@ msgstr "" "membro ``A``. A Pesquisa por nome de ``A`` também retorna o membro ``A``. A " "pesquisa por nome de ``B`` também retorna o membro ``A``:" +#: ../../howto/enum.rst:232 +msgid "" +">>> class Shape(Enum):\n" +"... SQUARE = 2\n" +"... DIAMOND = 1\n" +"... CIRCLE = 3\n" +"... ALIAS_FOR_SQUARE = 2\n" +"...\n" +">>> Shape.SQUARE\n" +"\n" +">>> Shape.ALIAS_FOR_SQUARE\n" +"\n" +">>> Shape(2)\n" +"" +msgstr "" + #: ../../howto/enum.rst:247 msgid "" "Attempting to create a member with the same name as an already defined " @@ -273,6 +467,21 @@ msgstr "" "valor. Quando esse comportamento não é desejado, você pode usar o decorador :" "func:`unique`:" +#: ../../howto/enum.rst:258 +msgid "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" +msgstr "" + #: ../../howto/enum.rst:272 msgid "Using automatic values" msgstr "Usando valores automáticos" @@ -281,6 +490,18 @@ msgstr "Usando valores automáticos" msgid "If the exact value is unimportant you can use :class:`auto`::" msgstr "Se o exato valor não é importante, você pode usar :class:`auto`:" +#: ../../howto/enum.rst:276 +msgid "" +">>> from enum import Enum, auto\n" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> [member.value for member in Color]\n" +"[1, 2, 3]" +msgstr "" + #: ../../howto/enum.rst:285 msgid "" "The values are chosen by :func:`_generate_next_value_`, which can be " @@ -289,6 +510,23 @@ msgstr "" "Os valores são escolhidos por :func:`_generate_next_value_`, o qual pode ser " "substituído:" +#: ../../howto/enum.rst:288 +msgid "" +">>> class AutoName(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return name\n" +"...\n" +">>> class Ordinal(AutoName):\n" +"... NORTH = auto()\n" +"... SOUTH = auto()\n" +"... EAST = auto()\n" +"... WEST = auto()\n" +"...\n" +">>> [member.value for member in Ordinal]\n" +"['NORTH', 'SOUTH', 'EAST', 'WEST']" +msgstr "" + #: ../../howto/enum.rst:304 msgid "" "The :meth:`_generate_next_value_` method must be defined before any members." @@ -304,6 +542,16 @@ msgstr "Iteração" msgid "Iterating over the members of an enum does not provide the aliases::" msgstr "Iterar sobre os membros de um enum não fornece os apelidos:" +#: ../../howto/enum.rst:311 +msgid "" +">>> list(Shape)\n" +"[, , ]\n" +">>> list(Weekday)\n" +"[, , , , , , ]" +msgstr "" + #: ../../howto/enum.rst:316 msgid "" "Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " @@ -322,6 +570,17 @@ msgstr "" "de nomes para os membros. Isso inclui todos os nomes definidos na " "enumeração, incluindo os apelidos:" +#: ../../howto/enum.rst:322 +msgid "" +">>> for name, member in Shape.__members__.items():\n" +"... name, member\n" +"...\n" +"('SQUARE', )\n" +"('DIAMOND', )\n" +"('CIRCLE', )\n" +"('ALIAS_FOR_SQUARE', )" +msgstr "" + #: ../../howto/enum.rst:330 msgid "" "The ``__members__`` attribute can be used for detailed programmatic access " @@ -330,6 +589,13 @@ msgstr "" "O atributo ``__members__`` pode ser usado para um acesso programático " "detalhado aos membros da enumeração. Por exemplo, achar todos os apelidos:" +#: ../../howto/enum.rst:333 +msgid "" +">>> [name for name, member in Shape.__members__.items() if member.name != " +"name]\n" +"['ALIAS_FOR_SQUARE']" +msgstr "" + #: ../../howto/enum.rst:338 msgid "" "Aliases for flags include values with multiple flags set, such as ``3``, and " @@ -344,16 +610,44 @@ msgstr "Comparações" msgid "Enumeration members are compared by identity::" msgstr "" +#: ../../howto/enum.rst:347 +msgid "" +">>> Color.RED is Color.RED\n" +"True\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED is not Color.BLUE\n" +"True" +msgstr "" + #: ../../howto/enum.rst:354 msgid "" "Ordered comparisons between enumeration values are *not* supported. Enum " "members are not integers (but see `IntEnum`_ below)::" msgstr "" +#: ../../howto/enum.rst:357 +msgid "" +">>> Color.RED < Color.BLUE\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: '<' not supported between instances of 'Color' and 'Color'" +msgstr "" + #: ../../howto/enum.rst:362 msgid "Equality comparisons are defined though::" msgstr "" +#: ../../howto/enum.rst:364 +msgid "" +">>> Color.BLUE == Color.RED\n" +"False\n" +">>> Color.BLUE != Color.RED\n" +"True\n" +">>> Color.BLUE == Color.BLUE\n" +"True" +msgstr "" + #: ../../howto/enum.rst:371 msgid "" "Comparisons against non-enumeration values will always compare not equal " @@ -361,6 +655,12 @@ msgid "" "below)::" msgstr "" +#: ../../howto/enum.rst:375 +msgid "" +">>> Color.BLUE == 2\n" +"False" +msgstr "" + #: ../../howto/enum.rst:380 msgid "" "It is possible to reload modules -- if a reloaded module contains enums, " @@ -387,10 +687,40 @@ msgid "" "usual. If we have this enumeration::" msgstr "" +#: ../../howto/enum.rst:396 +msgid "" +">>> class Mood(Enum):\n" +"... FUNKY = 1\n" +"... HAPPY = 3\n" +"...\n" +"... def describe(self):\n" +"... # self is the member here\n" +"... return self.name, self.value\n" +"...\n" +"... def __str__(self):\n" +"... return 'my custom str! {0}'.format(self.value)\n" +"...\n" +"... @classmethod\n" +"... def favorite_mood(cls):\n" +"... # cls here is the enumeration\n" +"... return cls.HAPPY\n" +"..." +msgstr "" + #: ../../howto/enum.rst:413 msgid "Then::" msgstr "" +#: ../../howto/enum.rst:415 +msgid "" +">>> Mood.favorite_mood()\n" +"\n" +">>> Mood.HAPPY.describe()\n" +"('HAPPY', 3)\n" +">>> str(Mood.FUNKY)\n" +"'my custom str! 1'" +msgstr "" + #: ../../howto/enum.rst:422 msgid "" "The rules for what is allowed are as follows: names that start and end with " @@ -427,16 +757,44 @@ msgid "" "order of these base classes is::" msgstr "" +#: ../../howto/enum.rst:448 +msgid "" +"class EnumName([mix-in, ...,] [data-type,] base-enum):\n" +" pass" +msgstr "" + #: ../../howto/enum.rst:451 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" +#: ../../howto/enum.rst:454 +msgid "" +">>> class MoreColor(Color):\n" +"... PINK = 17\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: cannot extend " +msgstr "" + #: ../../howto/enum.rst:461 msgid "But this is allowed::" msgstr "" +#: ../../howto/enum.rst:463 +msgid "" +">>> class Foo(Enum):\n" +"... def some_behavior(self):\n" +"... pass\n" +"...\n" +">>> class Bar(Foo):\n" +"... HAPPY = 1\n" +"... SAD = 2\n" +"..." +msgstr "" + #: ../../howto/enum.rst:472 msgid "" "Allowing subclassing of enums that define members would lead to a violation " @@ -455,6 +813,23 @@ msgid "" "__repr__` omits the inherited class' name. For example::" msgstr "" +#: ../../howto/enum.rst:486 +msgid "" +">>> from dataclasses import dataclass, field\n" +">>> @dataclass\n" +"... class CreatureDataMixin:\n" +"... size: str\n" +"... legs: int\n" +"... tail: bool = field(repr=False, default=True)\n" +"...\n" +">>> class Creature(CreatureDataMixin, Enum):\n" +"... BEETLE = 'small', 6\n" +"... DOG = 'medium', 4\n" +"...\n" +">>> Creature.DOG\n" +"" +msgstr "" + #: ../../howto/enum.rst:500 msgid "" "Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" @@ -475,6 +850,14 @@ msgstr "Pickling" msgid "Enumerations can be pickled and unpickled::" msgstr "" +#: ../../howto/enum.rst:513 +msgid "" +">>> from test.test_enum import Fruit\n" +">>> from pickle import dumps, loads\n" +">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" +"True" +msgstr "" + #: ../../howto/enum.rst:518 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " @@ -495,6 +878,13 @@ msgid "" "value, but enums with complicated values may want to use by-name::" msgstr "" +#: ../../howto/enum.rst:531 +msgid "" +">>> import enum\n" +">>> class MyEnum(enum.Enum):\n" +"... __reduce_ex__ = enum.pickle_by_enum_name" +msgstr "" + #: ../../howto/enum.rst:537 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " @@ -510,6 +900,17 @@ msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" +#: ../../howto/enum.rst:546 +msgid "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" +">>> Animal\n" +"\n" +">>> Animal.ANT\n" +"\n" +">>> list(Animal)\n" +"[, , , ]" +msgstr "" + #: ../../howto/enum.rst:554 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " @@ -528,6 +929,16 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" +#: ../../howto/enum.rst:566 +msgid "" +">>> class Animal(Enum):\n" +"... ANT = 1\n" +"... BEE = 2\n" +"... CAT = 3\n" +"... DOG = 4\n" +"..." +msgstr "" + #: ../../howto/enum.rst:573 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " @@ -544,6 +955,10 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" +#: ../../howto/enum.rst:583 +msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" +msgstr "" + #: ../../howto/enum.rst:587 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " @@ -559,10 +974,28 @@ msgid "" "class SomeData in the global scope::" msgstr "" +#: ../../howto/enum.rst:596 +msgid "" +">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" +msgstr "" + #: ../../howto/enum.rst:598 msgid "The complete signature is::" msgstr "" +#: ../../howto/enum.rst:600 +msgid "" +"Enum(\n" +" value='NewEnumName',\n" +" names=<...>,\n" +" *,\n" +" module='...',\n" +" qualname='...',\n" +" type=,\n" +" start=1,\n" +" )" +msgstr "" + #: ../../howto/enum.rst:610 msgid "*value*: What the new enum class will record as its name." msgstr "" @@ -573,18 +1006,34 @@ msgid "" "string (values will start at 1 unless otherwise specified)::" msgstr "" +#: ../../howto/enum.rst:615 +msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" +msgstr "" + #: ../../howto/enum.rst:617 msgid "or an iterator of names::" msgstr "" +#: ../../howto/enum.rst:619 +msgid "['RED', 'GREEN', 'BLUE']" +msgstr "" + #: ../../howto/enum.rst:621 msgid "or an iterator of (name, value) pairs::" msgstr "" +#: ../../howto/enum.rst:623 +msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" +msgstr "" + #: ../../howto/enum.rst:625 msgid "or a mapping::" msgstr "" +#: ../../howto/enum.rst:627 +msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" +msgstr "" + #: ../../howto/enum.rst:629 msgid "*module*: name of module where new enum class can be found." msgstr "" @@ -621,17 +1070,60 @@ msgid "" "each other::" msgstr "" +#: ../../howto/enum.rst:652 +msgid "" +">>> from enum import IntEnum\n" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Request(IntEnum):\n" +"... POST = 1\n" +"... GET = 2\n" +"...\n" +">>> Shape == 1\n" +"False\n" +">>> Shape.CIRCLE == 1\n" +"True\n" +">>> Shape.CIRCLE == Request.POST\n" +"True" +msgstr "" + #: ../../howto/enum.rst:668 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" +#: ../../howto/enum.rst:670 +msgid "" +">>> class Shape(IntEnum):\n" +"... CIRCLE = 1\n" +"... SQUARE = 2\n" +"...\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"...\n" +">>> Shape.CIRCLE == Color.RED\n" +"False" +msgstr "" + #: ../../howto/enum.rst:681 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" +#: ../../howto/enum.rst:683 +msgid "" +">>> int(Shape.CIRCLE)\n" +"1\n" +">>> ['a', 'b', 'c'][Shape.CIRCLE]\n" +"'b'\n" +">>> [i for i in range(Shape.SQUARE)]\n" +"[0, 1]" +msgstr "" + #: ../../howto/enum.rst:692 msgid "StrEnum" msgstr "StrEnum" @@ -674,10 +1166,43 @@ msgstr "" msgid "Sample :class:`IntFlag` class::" msgstr "" +#: ../../howto/enum.rst:725 +msgid "" +">>> from enum import IntFlag\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> Perm.R | Perm.W\n" +"\n" +">>> Perm.R + Perm.W\n" +"6\n" +">>> RW = Perm.R | Perm.W\n" +">>> Perm.R in RW\n" +"True" +msgstr "" + #: ../../howto/enum.rst:739 msgid "It is also possible to name the combinations::" msgstr "" +#: ../../howto/enum.rst:741 +msgid "" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"... RWX = 7\n" +"...\n" +">>> Perm.RWX\n" +"\n" +">>> ~Perm.RWX\n" +"\n" +">>> Perm(7)\n" +"" +msgstr "" + #: ../../howto/enum.rst:756 msgid "" "Named combinations are considered aliases. Aliases do not show up during " @@ -691,22 +1216,51 @@ msgid "" "`False`::" msgstr "" +#: ../../howto/enum.rst:764 +msgid "" +">>> Perm.R & Perm.X\n" +"\n" +">>> bool(Perm.R & Perm.X)\n" +"False" +msgstr "" + #: ../../howto/enum.rst:769 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" +#: ../../howto/enum.rst:772 +msgid "" +">>> Perm.X | 4\n" +"\n" +"\n" +">>> Perm.X + 8\n" +"9" +msgstr "" + #: ../../howto/enum.rst:780 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" +#: ../../howto/enum.rst:783 +msgid "" +">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" +"True" +msgstr "" + #: ../../howto/enum.rst:786 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" +#: ../../howto/enum.rst:788 +msgid "" +">>> list(RW)\n" +"[, ]" +msgstr "" + #: ../../howto/enum.rst:795 msgid "Flag" msgstr "Sinalizador" @@ -727,22 +1281,69 @@ msgid "" "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" +#: ../../howto/enum.rst:809 +msgid "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.RED & Color.GREEN\n" +"\n" +">>> bool(Color.RED & Color.GREEN)\n" +"False" +msgstr "" + #: ../../howto/enum.rst:820 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" +#: ../../howto/enum.rst:823 +msgid "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"... WHITE = RED | BLUE | GREEN\n" +"...\n" +">>> Color.WHITE\n" +"" +msgstr "" + #: ../../howto/enum.rst:832 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" +#: ../../howto/enum.rst:835 +msgid "" +">>> class Color(Flag):\n" +"... BLACK = 0\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.BLACK\n" +"\n" +">>> bool(Color.BLACK)\n" +"False" +msgstr "" + #: ../../howto/enum.rst:846 msgid ":class:`Flag` members can also be iterated over::" msgstr "" +#: ../../howto/enum.rst:848 +msgid "" +">>> purple = Color.RED | Color.BLUE\n" +">>> list(purple)\n" +"[, ]" +msgstr "" + #: ../../howto/enum.rst:856 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " @@ -764,6 +1365,12 @@ msgid "" "simple to implement independently::" msgstr "" +#: ../../howto/enum.rst:871 +msgid "" +"class IntEnum(int, Enum):\n" +" pass" +msgstr "" + #: ../../howto/enum.rst:874 msgid "" "This demonstrates how similar derived enumerations can be defined; for " @@ -847,6 +1454,31 @@ msgid "" "want one of them to be the value::" msgstr "" +#: ../../howto/enum.rst:919 +msgid "" +">>> class Coordinate(bytes, Enum):\n" +"... \"\"\"\n" +"... Coordinate with binary codes that can be indexed by the int code.\n" +"... \"\"\"\n" +"... def __new__(cls, value, label, unit):\n" +"... obj = bytes.__new__(cls, [value])\n" +"... obj._value_ = value\n" +"... obj.label = label\n" +"... obj.unit = unit\n" +"... return obj\n" +"... PX = (0, 'P.X', 'km')\n" +"... PY = (1, 'P.Y', 'km')\n" +"... VX = (2, 'V.X', 'km/s')\n" +"... VY = (3, 'V.Y', 'km/s')\n" +"...\n" +"\n" +">>> print(Coordinate['PY'])\n" +"Coordinate.PY\n" +"\n" +">>> print(Coordinate(3))\n" +"Coordinate.VY" +msgstr "" + #: ../../howto/enum.rst:943 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " @@ -951,6 +1583,21 @@ msgid "" "enumeration and raise an error if the two do not match::" msgstr "" +#: ../../howto/enum.rst:993 +msgid "" +">>> class Color(Enum):\n" +"... _order_ = 'RED GREEN BLUE'\n" +"... RED = 1\n" +"... BLUE = 3\n" +"... GREEN = 2\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"TypeError: member order does not match _order_:\n" +" ['RED', 'BLUE', 'GREEN']\n" +" ['RED', 'GREEN', 'BLUE']" +msgstr "" + #: ../../howto/enum.rst:1007 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " @@ -992,6 +1639,15 @@ msgid "" "type's constructor. For example::" msgstr "" +#: ../../howto/enum.rst:1040 +msgid "" +">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" +"... example = '11', 16 # so x='11' and base=16\n" +"...\n" +">>> MyEnum.example.value # and hex(11) is...\n" +"17" +msgstr "" + #: ../../howto/enum.rst:1048 msgid "Boolean value of ``Enum`` classes and members" msgstr "" @@ -1005,6 +1661,12 @@ msgid "" "your class::" msgstr "" +#: ../../howto/enum.rst:1056 +msgid "" +"def __bool__(self):\n" +" return bool(self.value)" +msgstr "" + #: ../../howto/enum.rst:1059 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" @@ -1020,6 +1682,16 @@ msgid "" "the class::" msgstr "" +#: ../../howto/enum.rst:1069 +msgid "" +">>> dir(Planet) \n" +"['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " +"'VENUS', '__class__', '__doc__', '__members__', '__module__']\n" +">>> dir(Planet.EARTH) \n" +"['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " +"'surface_gravity', 'value']" +msgstr "" + #: ../../howto/enum.rst:1076 msgid "Combining members of ``Flag``" msgstr "" @@ -1030,6 +1702,22 @@ msgid "" "members that are comprised of a single bit::" msgstr "" +#: ../../howto/enum.rst:1081 +msgid "" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"... MAGENTA = RED | BLUE\n" +"... YELLOW = RED | GREEN\n" +"... CYAN = GREEN | BLUE\n" +"...\n" +">>> Color(3) # named combination\n" +"\n" +">>> Color(7) # not named combination\n" +"" +msgstr "" + #: ../../howto/enum.rst:1096 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" @@ -1038,6 +1726,18 @@ msgstr "" msgid "Using the following snippet for our examples::" msgstr "" +#: ../../howto/enum.rst:1100 +msgid "" +">>> class Color(IntFlag):\n" +"... BLACK = 0\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... PURPLE = RED | BLUE\n" +"... WHITE = RED | GREEN | BLUE\n" +"..." +msgstr "" + #: ../../howto/enum.rst:1109 msgid "the following are true:" msgstr "" @@ -1054,88 +1754,144 @@ msgstr "" msgid "only canonical flags are returned during iteration::" msgstr "" +#: ../../howto/enum.rst:1115 +msgid "" +">>> list(Color.WHITE)\n" +"[, , ]" +msgstr "" + #: ../../howto/enum.rst:1118 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" +#: ../../howto/enum.rst:1121 +msgid "" +">>> Color.BLUE\n" +"\n" +"\n" +">>> ~Color.BLUE\n" +"" +msgstr "" + #: ../../howto/enum.rst:1127 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1132 +#: ../../howto/enum.rst:1129 +msgid "" +">>> (Color.RED | Color.GREEN).name\n" +"'RED|GREEN'\n" +"\n" +">>> class Perm(IntFlag):\n" +"... R = 4\n" +"... W = 2\n" +"... X = 1\n" +"...\n" +">>> (Perm.R & Perm.W).name is None # effectively Perm(0)\n" +"True" +msgstr "" + +#: ../../howto/enum.rst:1140 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1143 +#: ../../howto/enum.rst:1142 +msgid "" +">>> Color.RED | Color.BLUE\n" +"\n" +"\n" +">>> Color(7) # or Color(-1)\n" +"\n" +"\n" +">>> Color(0)\n" +"" +msgstr "" + +#: ../../howto/enum.rst:1151 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1149 +#: ../../howto/enum.rst:1154 +msgid "" +">>> Color.BLACK in Color.WHITE\n" +"True" +msgstr "" + +#: ../../howto/enum.rst:1157 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1158 +#: ../../howto/enum.rst:1160 +msgid "" +">>> Color.PURPLE in Color.WHITE\n" +"True\n" +"\n" +">>> Color.GREEN in Color.PURPLE\n" +"False" +msgstr "" + +#: ../../howto/enum.rst:1166 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1161 +#: ../../howto/enum.rst:1169 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1162 +#: ../../howto/enum.rst:1170 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1171 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1172 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1166 +#: ../../howto/enum.rst:1174 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1167 +#: ../../howto/enum.rst:1175 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1176 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1170 +#: ../../howto/enum.rst:1178 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1178 +#: ../../howto/enum.rst:1186 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1180 +#: ../../howto/enum.rst:1188 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1185 +#: ../../howto/enum.rst:1193 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1187 +#: ../../howto/enum.rst:1195 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1146,11 +1902,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1204 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1198 +#: ../../howto/enum.rst:1206 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1159,11 +1915,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1204 +#: ../../howto/enum.rst:1212 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1206 +#: ../../howto/enum.rst:1214 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1172,37 +1928,55 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1212 +#: ../../howto/enum.rst:1220 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1214 +#: ../../howto/enum.rst:1222 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1220 +#: ../../howto/enum.rst:1225 +msgid "" +">>> list(Color)\n" +"[, , ]" +msgstr "" + +#: ../../howto/enum.rst:1228 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1222 +#: ../../howto/enum.rst:1230 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1228 +#: ../../howto/enum.rst:1233 +msgid "" +">>> ~Color.RED\n" +"" +msgstr "" + +#: ../../howto/enum.rst:1236 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1238 +#: ../../howto/enum.rst:1239 +msgid "" +">>> len(Color.PURPLE)\n" +"2" +msgstr "" + +#: ../../howto/enum.rst:1246 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1241 +#: ../../howto/enum.rst:1249 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1210,80 +1984,144 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1248 +#: ../../howto/enum.rst:1256 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1258 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1261 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1254 +#: ../../howto/enum.rst:1262 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1255 +#: ../../howto/enum.rst:1263 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1256 +#: ../../howto/enum.rst:1264 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1259 +#: ../../howto/enum.rst:1267 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1265 +#: ../../howto/enum.rst:1273 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1267 +#: ../../howto/enum.rst:1275 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1279 +#: ../../howto/enum.rst:1277 +msgid "" +">>> class Color(Enum):\n" +"... RED = auto()\n" +"... BLUE = auto()\n" +"... GREEN = auto()\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +#: ../../howto/enum.rst:1287 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1281 +#: ../../howto/enum.rst:1289 msgid "Using :class:`object` would look like::" msgstr "" #: ../../howto/enum.rst:1291 msgid "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"...\n" +">>> Color.GREEN \n" +">" +msgstr "" + +#: ../../howto/enum.rst:1299 +msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1307 +#: ../../howto/enum.rst:1302 +msgid "" +">>> class Color(Enum):\n" +"... RED = object()\n" +"... GREEN = object()\n" +"... BLUE = object()\n" +"... def __repr__(self):\n" +"... return \"<%s.%s>\" % (self.__class__.__name__, self._name_)\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +#: ../../howto/enum.rst:1315 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1309 +#: ../../howto/enum.rst:1317 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1321 +#: ../../howto/enum.rst:1319 +msgid "" +">>> class Color(Enum):\n" +"... RED = 'stop'\n" +"... GREEN = 'go'\n" +"... BLUE = 'too fast!'\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +#: ../../howto/enum.rst:1329 msgid "Using a custom :meth:`__new__`" msgstr "Usando um :meth:`__new__` personalizado" -#: ../../howto/enum.rst:1323 +#: ../../howto/enum.rst:1331 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1340 +#: ../../howto/enum.rst:1333 +msgid "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls):\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"...\n" +">>> class Color(AutoNumber):\n" +"... RED = ()\n" +"... GREEN = ()\n" +"... BLUE = ()\n" +"...\n" +">>> Color.GREEN\n" +"" +msgstr "" + +#: ../../howto/enum.rst:1348 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" @@ -1291,74 +2129,205 @@ msgstr "" #: ../../howto/enum.rst:1350 msgid "" +">>> class AutoNumber(Enum):\n" +"... def __new__(cls, *args): # this is the only change from above\n" +"... value = len(cls.__members__) + 1\n" +"... obj = object.__new__(cls)\n" +"... obj._value_ = value\n" +"... return obj\n" +"..." +msgstr "" + +#: ../../howto/enum.rst:1358 +msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1369 +#: ../../howto/enum.rst:1361 +msgid "" +">>> class Swatch(AutoNumber):\n" +"... def __init__(self, pantone='unknown'):\n" +"... self.pantone = pantone\n" +"... AUBURN = '3497'\n" +"... SEA_GREEN = '1246'\n" +"... BLEACHED_CORAL = () # New color, no Pantone code yet!\n" +"...\n" +">>> Swatch.SEA_GREEN\n" +"\n" +">>> Swatch.SEA_GREEN.pantone\n" +"'1246'\n" +">>> Swatch.BLEACHED_CORAL.pantone\n" +"'unknown'" +msgstr "" + +#: ../../howto/enum.rst:1377 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1375 +#: ../../howto/enum.rst:1383 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1382 +#: ../../howto/enum.rst:1386 +msgid "obj = int.__new__(cls, value)" +msgstr "" + +#: ../../howto/enum.rst:1390 msgid "OrderedEnum" msgstr "OrderedEnum" -#: ../../howto/enum.rst:1384 +#: ../../howto/enum.rst:1392 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1418 +#: ../../howto/enum.rst:1396 +msgid "" +">>> class OrderedEnum(Enum):\n" +"... def __ge__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value >= other.value\n" +"... return NotImplemented\n" +"... def __gt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value > other.value\n" +"... return NotImplemented\n" +"... def __le__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value <= other.value\n" +"... return NotImplemented\n" +"... def __lt__(self, other):\n" +"... if self.__class__ is other.__class__:\n" +"... return self.value < other.value\n" +"... return NotImplemented\n" +"...\n" +">>> class Grade(OrderedEnum):\n" +"... A = 5\n" +"... B = 4\n" +"... C = 3\n" +"... D = 2\n" +"... F = 1\n" +"...\n" +">>> Grade.C < Grade.A\n" +"True" +msgstr "" + +#: ../../howto/enum.rst:1426 msgid "DuplicateFreeEnum" msgstr "DuplicateFreeEnum" -#: ../../howto/enum.rst:1420 +#: ../../howto/enum.rst:1428 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1445 +#: ../../howto/enum.rst:1431 +msgid "" +">>> class DuplicateFreeEnum(Enum):\n" +"... def __init__(self, *args):\n" +"... cls = self.__class__\n" +"... if any(self.value == e.value for e in cls):\n" +"... a = self.name\n" +"... e = cls(self.value).name\n" +"... raise ValueError(\n" +"... \"aliases not allowed in DuplicateFreeEnum: %r --> " +"%r\"\n" +"... % (a, e))\n" +"...\n" +">>> class Color(DuplicateFreeEnum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... GRENE = 2\n" +"...\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" +msgstr "" + +#: ../../howto/enum.rst:1453 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1451 +#: ../../howto/enum.rst:1459 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1453 +#: ../../howto/enum.rst:1461 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1482 +#: ../../howto/enum.rst:1464 +msgid "" +">>> class Planet(Enum):\n" +"... MERCURY = (3.303e+23, 2.4397e6)\n" +"... VENUS = (4.869e+24, 6.0518e6)\n" +"... EARTH = (5.976e+24, 6.37814e6)\n" +"... MARS = (6.421e+23, 3.3972e6)\n" +"... JUPITER = (1.9e+27, 7.1492e7)\n" +"... SATURN = (5.688e+26, 6.0268e7)\n" +"... URANUS = (8.686e+25, 2.5559e7)\n" +"... NEPTUNE = (1.024e+26, 2.4746e7)\n" +"... def __init__(self, mass, radius):\n" +"... self.mass = mass # in kilograms\n" +"... self.radius = radius # in meters\n" +"... @property\n" +"... def surface_gravity(self):\n" +"... # universal gravitational constant (m3 kg-1 s-2)\n" +"... G = 6.67300E-11\n" +"... return G * self.mass / (self.radius * self.radius)\n" +"...\n" +">>> Planet.EARTH.value\n" +"(5.976e+24, 6378140.0)\n" +">>> Planet.EARTH.surface_gravity\n" +"9.802652743337129" +msgstr "" + +#: ../../howto/enum.rst:1490 msgid "TimePeriod" msgstr "TimePeriod" -#: ../../howto/enum.rst:1484 +#: ../../howto/enum.rst:1492 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1503 +#: ../../howto/enum.rst:1494 +msgid "" +">>> from datetime import timedelta\n" +">>> class Period(timedelta, Enum):\n" +"... \"different lengths of time\"\n" +"... _ignore_ = 'Period i'\n" +"... Period = vars()\n" +"... for i in range(367):\n" +"... Period['day_%d' % i] = i\n" +"...\n" +">>> list(Period)[:2]\n" +"[, ]\n" +">>> list(Period)[-2:]\n" +"[, ]" +msgstr "" + +#: ../../howto/enum.rst:1511 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1505 +#: ../../howto/enum.rst:1513 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/functional.po b/howto/functional.po index 5ae3012f4..d1739c853 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -4,31 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Ruan Aragão , 2021 -# Vinicius Gubiani Ferreira , 2021 -# i17obot , 2021 -# ApenasRR Mesmo , 2021 -# Raphael Mendonça, 2021 -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2021 -# Alexandre B A Villares, 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -493,6 +484,15 @@ msgstr "" "ser um iterador ou algum objeto para o qual :func:`iter` pode criar um " "iterador. Estas duas declarações são equivalentes::" +#: ../../howto/functional.rst:222 +msgid "" +"for i in iter(obj):\n" +" print(i)\n" +"\n" +"for i in obj:\n" +" print(i)" +msgstr "" + #: ../../howto/functional.rst:228 msgid "" "Iterators can be materialized as lists or tuples by using the :func:`list` " @@ -567,6 +567,26 @@ msgstr "" "Chamar :func:`iter` em um dicionário retorna um iterador que irá percorrer " "as chaves do dicionário::" +#: ../../howto/functional.rst:273 +msgid "" +">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" +"... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}\n" +">>> for key in m:\n" +"... print(key, m[key])\n" +"Jan 1\n" +"Feb 2\n" +"Mar 3\n" +"Apr 4\n" +"May 5\n" +"Jun 6\n" +"Jul 7\n" +"Aug 8\n" +"Sep 9\n" +"Oct 10\n" +"Nov 11\n" +"Dec 12" +msgstr "" + #: ../../howto/functional.rst:290 msgid "" "Note that starting with Python 3.7, dictionary iteration order is guaranteed " @@ -608,6 +628,13 @@ msgstr "" "TextIOBase.readline` até que não haja mais linhas no arquivo. Isso significa " "que você pode ler cada linha de um arquivo como este::" +#: ../../howto/functional.rst:311 +msgid "" +"for line in file:\n" +" # do something for each line\n" +" ..." +msgstr "" + #: ../../howto/functional.rst:315 msgid "" "Sets can take their contents from an iterable and let you iterate over the " @@ -616,6 +643,19 @@ msgstr "" "Os conjuntos podem tirar seus conteúdos de uma iterável e permitir que você " "faça uma iteração sobre os elementos do conjunto::" +#: ../../howto/functional.rst:318 +msgid "" +">>> S = {2, 3, 5, 7, 11, 13}\n" +">>> for i in S:\n" +"... print(i)\n" +"2\n" +"3\n" +"5\n" +"7\n" +"11\n" +"13" +msgstr "" + #: ../../howto/functional.rst:331 msgid "Generator expressions and list comprehensions" msgstr "Expressões do gerador e compreensões de lista" @@ -648,6 +688,17 @@ msgstr "" "haskell.org/). Você pode tirar todos os espaços em branco de um fluxo de " "strings com o seguinte código::" +#: ../../howto/functional.rst:344 +msgid "" +">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" +"\n" +">>> # Generator expression -- returns iterator\n" +">>> stripped_iter = (line.strip() for line in line_list)\n" +"\n" +">>> # List comprehension -- returns list\n" +">>> stripped_list = [line.strip() for line in line_list]" +msgstr "" + #: ../../howto/functional.rst:352 msgid "" "You can select only certain elements by adding an ``\"if\"`` condition::" @@ -655,6 +706,12 @@ msgstr "" "Você pode selecionar apenas determinados elementos adicionando uma condição " "``\"if\"``::" +#: ../../howto/functional.rst:354 +msgid "" +">>> stripped_list = [line.strip() for line in line_list\n" +"... if line != \"\"]" +msgstr "" + #: ../../howto/functional.rst:357 msgid "" "With a list comprehension, you get back a Python list; ``stripped_list`` is " @@ -684,6 +741,19 @@ msgstr "" "compreensões da lista são cercadas por colchetes (\"[]\"). As expressões do " "gerador têm a forma::" +#: ../../howto/functional.rst:368 +msgid "" +"( expression for expr in sequence1\n" +" if condition1\n" +" for expr2 in sequence2\n" +" if condition2\n" +" for expr3 in sequence3\n" +" ...\n" +" if condition3\n" +" for exprN in sequenceN\n" +" if conditionN )" +msgstr "" + #: ../../howto/functional.rst:378 msgid "" "Again, for a list comprehension only the outside brackets are different " @@ -715,6 +785,10 @@ msgstr "" "quiser criar um iterador que será imediatamente passado para uma função, " "você pode escrever::" +#: ../../howto/functional.rst:389 +msgid "obj_total = sum(obj.count for obj in list_all_objects())" +msgstr "" + #: ../../howto/functional.rst:391 msgid "" "The ``for...in`` clauses contain the sequences to be iterated over. The " @@ -739,6 +813,23 @@ msgstr "" "Em outras palavras, uma lista de compreensão ou expressão do gerador é " "equivalente ao seguinte código Python::" +#: ../../howto/functional.rst:400 +msgid "" +"for expr1 in sequence1:\n" +" if not (condition1):\n" +" continue # Skip this element\n" +" for expr2 in sequence2:\n" +" if not (condition2):\n" +" continue # Skip this element\n" +" ...\n" +" for exprN in sequenceN:\n" +" if not (conditionN):\n" +" continue # Skip this element\n" +"\n" +" # Output the value of\n" +" # the expression." +msgstr "" + #: ../../howto/functional.rst:414 msgid "" "This means that when there are multiple ``for...in`` clauses but no ``if`` " @@ -762,6 +853,14 @@ msgstr "" "parênteses. A primeira lista de compreensão abaixo é um erro de sintaxe, " "enquanto o segundo está correto::" +#: ../../howto/functional.rst:430 +msgid "" +"# Syntax error\n" +"[x, y for x in seq1 for y in seq2]\n" +"# Correct\n" +"[(x, y) for x in seq1 for y in seq2]" +msgstr "" + #: ../../howto/functional.rst:437 msgid "Generators" msgstr "Geradores" @@ -887,6 +986,20 @@ msgstr "" "gerador que implementa uma passagem em ordem de uma árvore usando geradores " "de forma recursiva. ::" +#: ../../howto/functional.rst:509 +msgid "" +"# A recursive generator that generates Tree leaves in in-order.\n" +"def inorder(t):\n" +" if t:\n" +" for x in inorder(t.left):\n" +" yield x\n" +"\n" +" yield t.label\n" +"\n" +" for x in inorder(t.right):\n" +" yield x" +msgstr "" + #: ../../howto/functional.rst:520 msgid "" "Two other examples in ``test_generators.py`` produce solutions for the N-" @@ -931,6 +1044,10 @@ msgstr "" "keyword:`yield` tornou-se uma expressão, retornando um valor que pode ser " "atribuído a uma variável ou operado de outra forma::" +#: ../../howto/functional.rst:541 +msgid "val = (yield i)" +msgstr "" + #: ../../howto/functional.rst:543 msgid "" "I recommend that you **always** put parentheses around a ``yield`` " @@ -977,6 +1094,19 @@ msgstr "" "Aqui está um contador simples que aumenta em 1 e permite alterar o valor do " "contador interno." +#: ../../howto/functional.rst:562 +msgid "" +"def counter(maximum):\n" +" i = 0\n" +" while i < maximum:\n" +" val = (yield i)\n" +" # If value provided, change counter\n" +" if val is not None:\n" +" i = val\n" +" else:\n" +" i += 1" +msgstr "" + #: ../../howto/functional.rst:574 msgid "And here's an example of changing the counter:" msgstr "E aqui um exemplo de mudança de contador:" @@ -1091,12 +1221,29 @@ msgid "" "element. ::" msgstr "" +#: ../../howto/functional.rst:667 +msgid "" +">>> for item in enumerate(['subject', 'verb', 'object']):\n" +"... print(item)\n" +"(0, 'subject')\n" +"(1, 'verb')\n" +"(2, 'object')" +msgstr "" + #: ../../howto/functional.rst:673 msgid "" ":func:`enumerate` is often used when looping through a list and recording " "the indexes at which certain conditions are met::" msgstr "" +#: ../../howto/functional.rst:676 +msgid "" +"f = open('data.txt', 'r')\n" +"for i, line in enumerate(f):\n" +" if line.strip() == '':\n" +" print('Blank line at line #%i' % i)" +msgstr "" + #: ../../howto/functional.rst:681 msgid "" ":func:`sorted(iterable, key=None, reverse=False) ` collects all the " @@ -1105,6 +1252,19 @@ msgid "" "constructed list's :meth:`~list.sort` method. ::" msgstr "" +#: ../../howto/functional.rst:686 +msgid "" +">>> import random\n" +">>> # Generate 8 random numbers between [0, 10000)\n" +">>> rand_list = random.sample(range(10000), 8)\n" +">>> rand_list \n" +"[769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]\n" +">>> sorted(rand_list) \n" +"[769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]\n" +">>> sorted(rand_list, reverse=True) \n" +"[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" +msgstr "" + #: ../../howto/functional.rst:696 msgid "" "(For a more detailed discussion of sorting, see the :ref:`sortinghowto`.)" @@ -1124,6 +1284,12 @@ msgid "" "and returns them in a tuple::" msgstr "" +#: ../../howto/functional.rst:721 +msgid "" +"zip(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2), ('c', 3)" +msgstr "" + #: ../../howto/functional.rst:724 msgid "" "It doesn't construct an in-memory list and exhaust all the input iterators " @@ -1139,6 +1305,12 @@ msgid "" "will be the same length as the shortest iterable. ::" msgstr "" +#: ../../howto/functional.rst:733 +msgid "" +"zip(['a', 'b'], (1, 2, 3)) =>\n" +" ('a', 1), ('b', 2)" +msgstr "" + #: ../../howto/functional.rst:736 msgid "" "You should avoid doing this, though, because an element may be taken from " @@ -1190,6 +1362,16 @@ msgid "" "defaults to 1::" msgstr "" +#: ../../howto/functional.rst:762 +msgid "" +"itertools.count() =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"itertools.count(10) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"itertools.count(10, 5) =>\n" +" 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, ..." +msgstr "" + #: ../../howto/functional.rst:769 msgid "" ":func:`itertools.cycle(iter) ` saves a copy of the contents " @@ -1198,6 +1380,12 @@ msgid "" "infinitely. ::" msgstr "" +#: ../../howto/functional.rst:773 +msgid "" +"itertools.cycle([1, 2, 3, 4, 5]) =>\n" +" 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ..." +msgstr "" + #: ../../howto/functional.rst:776 msgid "" ":func:`itertools.repeat(elem, [n]) ` returns the provided " @@ -1205,6 +1393,14 @@ msgid "" "provided. ::" msgstr "" +#: ../../howto/functional.rst:779 +msgid "" +"itertools.repeat('abc') =>\n" +" abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...\n" +"itertools.repeat('abc', 5) =>\n" +" abc, abc, abc, abc, abc" +msgstr "" + #: ../../howto/functional.rst:784 msgid "" ":func:`itertools.chain(iterA, iterB, ...) ` takes an " @@ -1213,6 +1409,12 @@ msgid "" "the iterables have been exhausted. ::" msgstr "" +#: ../../howto/functional.rst:789 +msgid "" +"itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>\n" +" a, b, c, 1, 2, 3" +msgstr "" + #: ../../howto/functional.rst:792 msgid "" ":func:`itertools.islice(iter, [start], stop, [step]) ` " @@ -1224,6 +1426,16 @@ msgid "" "*step*. ::" msgstr "" +#: ../../howto/functional.rst:799 +msgid "" +"itertools.islice(range(10), 8) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8) =>\n" +" 2, 3, 4, 5, 6, 7\n" +"itertools.islice(range(10), 2, 8, 2) =>\n" +" 2, 4, 6" +msgstr "" + #: ../../howto/functional.rst:806 msgid "" ":func:`itertools.tee(iter, [n]) ` replicates an iterator; it " @@ -1234,6 +1446,18 @@ msgid "" "and one of the new iterators is consumed more than the others. ::" msgstr "" +#: ../../howto/functional.rst:814 +msgid "" +"itertools.tee( itertools.count() ) =>\n" +" iterA, iterB\n" +"\n" +"where iterA ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" +"\n" +"and iterB ->\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..." +msgstr "" + #: ../../howto/functional.rst:825 msgid "Calling functions on elements" msgstr "" @@ -1254,6 +1478,15 @@ msgid "" "as the arguments::" msgstr "" +#: ../../howto/functional.rst:837 +msgid "" +"itertools.starmap(os.path.join,\n" +" [('/bin', 'python'), ('/usr', 'bin', 'java'),\n" +" ('/usr', 'bin', 'perl'), ('/usr', 'bin', 'ruby')])\n" +"=>\n" +" /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby" +msgstr "" + #: ../../howto/functional.rst:845 msgid "Selecting elements" msgstr "Selecionando elementos" @@ -1271,6 +1504,12 @@ msgid "" "predicate returns false::" msgstr "" +#: ../../howto/functional.rst:854 +msgid "" +"itertools.filterfalse(is_even, itertools.count()) =>\n" +" 1, 3, 5, 7, 9, 11, 13, 15, ..." +msgstr "" + #: ../../howto/functional.rst:857 msgid "" ":func:`itertools.takewhile(predicate, iter) ` returns " @@ -1278,6 +1517,18 @@ msgid "" "returns false, the iterator will signal the end of its results. ::" msgstr "" +#: ../../howto/functional.rst:861 +msgid "" +"def less_than_10(x):\n" +" return x < 10\n" +"\n" +"itertools.takewhile(less_than_10, itertools.count()) =>\n" +" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n" +"\n" +"itertools.takewhile(is_even, itertools.count()) =>\n" +" 0" +msgstr "" + #: ../../howto/functional.rst:870 msgid "" ":func:`itertools.dropwhile(predicate, iter) ` discards " @@ -1285,6 +1536,15 @@ msgid "" "iterable's results. ::" msgstr "" +#: ../../howto/functional.rst:874 +msgid "" +"itertools.dropwhile(less_than_10, itertools.count()) =>\n" +" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" +"\n" +"itertools.dropwhile(is_even, itertools.count()) =>\n" +" 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..." +msgstr "" + #: ../../howto/functional.rst:880 msgid "" ":func:`itertools.compress(data, selectors) ` takes two " @@ -1293,6 +1553,12 @@ msgid "" "is exhausted::" msgstr "" +#: ../../howto/functional.rst:884 +msgid "" +"itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>\n" +" 1, 2, 5" +msgstr "" + #: ../../howto/functional.rst:889 msgid "Combinatoric functions" msgstr "" @@ -1304,6 +1570,20 @@ msgid "" "elements contained in *iterable*. ::" msgstr "" +#: ../../howto/functional.rst:895 +msgid "" +"itertools.combinations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 3), (2, 4), (2, 5),\n" +" (3, 4), (3, 5),\n" +" (4, 5)\n" +"\n" +"itertools.combinations([1, 2, 3, 4, 5], 3) =>\n" +" (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, 3, 5), (1, 4, 5),\n" +" (2, 3, 4), (2, 3, 5), (2, 4, 5),\n" +" (3, 4, 5)" +msgstr "" + #: ../../howto/functional.rst:906 msgid "" "The elements within each tuple remain in the same order as *iterable* " @@ -1313,6 +1593,21 @@ msgid "" "constraint on the order, returning all possible arrangements of length *r*::" msgstr "" +#: ../../howto/functional.rst:913 +msgid "" +"itertools.permutations([1, 2, 3, 4, 5], 2) =>\n" +" (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 1), (2, 3), (2, 4), (2, 5),\n" +" (3, 1), (3, 2), (3, 4), (3, 5),\n" +" (4, 1), (4, 2), (4, 3), (4, 5),\n" +" (5, 1), (5, 2), (5, 3), (5, 4)\n" +"\n" +"itertools.permutations([1, 2, 3, 4, 5]) =>\n" +" (1, 2, 3, 4, 5), (1, 2, 3, 5, 4), (1, 2, 4, 3, 5),\n" +" ...\n" +" (5, 4, 3, 2, 1)" +msgstr "" + #: ../../howto/functional.rst:925 msgid "" "If you don't supply a value for *r* the length of the iterable is used, " @@ -1325,6 +1620,13 @@ msgid "" "position and don't require that the contents of *iterable* are unique::" msgstr "" +#: ../../howto/functional.rst:931 +msgid "" +"itertools.permutations('aba', 3) =>\n" +" ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),\n" +" ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')" +msgstr "" + #: ../../howto/functional.rst:935 msgid "" "The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a' " @@ -1340,6 +1642,16 @@ msgid "" "the second element is selected. ::" msgstr "" +#: ../../howto/functional.rst:944 +msgid "" +"itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>\n" +" (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),\n" +" (2, 2), (2, 3), (2, 4), (2, 5),\n" +" (3, 3), (3, 4), (3, 5),\n" +" (4, 4), (4, 5),\n" +" (5, 5)" +msgstr "" + #: ../../howto/functional.rst:953 msgid "Grouping elements" msgstr "Agrupando elementos" @@ -1360,6 +1672,31 @@ msgid "" "tuples containing a key value and an iterator for the elements with that key." msgstr "" +#: ../../howto/functional.rst:966 +msgid "" +"city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),\n" +" ('Anchorage', 'AK'), ('Nome', 'AK'),\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'),\n" +" ...\n" +" ]\n" +"\n" +"def get_state(city_state):\n" +" return city_state[1]\n" +"\n" +"itertools.groupby(city_list, get_state) =>\n" +" ('AL', iterator-1),\n" +" ('AK', iterator-2),\n" +" ('AZ', iterator-3), ...\n" +"\n" +"where\n" +"iterator-1 =>\n" +" ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL')\n" +"iterator-2 =>\n" +" ('Anchorage', 'AK'), ('Nome', 'AK')\n" +"iterator-3 =>\n" +" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')" +msgstr "" + #: ../../howto/functional.rst:988 msgid "" ":func:`~itertools.groupby` assumes that the underlying iterable's contents " @@ -1402,6 +1739,19 @@ msgstr "" msgid "Here's a small but realistic example::" msgstr "Aqui está um pequeno mas bem realístico exemplo::" +#: ../../howto/functional.rst:1015 +msgid "" +"import functools\n" +"\n" +"def log(message, subsystem):\n" +" \"\"\"Write the contents of 'message' to the specified subsystem.\"\"\"\n" +" print('%s: %s' % (subsystem, message))\n" +" ...\n" +"\n" +"server_log = functools.partial(log, subsystem='server')\n" +"server_log('Unable to open socket')" +msgstr "" + #: ../../howto/functional.rst:1025 msgid "" ":func:`functools.reduce(func, iter, [initial_value]) ` " @@ -1417,6 +1767,21 @@ msgid "" "``func(initial_value, A)`` is the first calculation. ::" msgstr "" +#: ../../howto/functional.rst:1037 +msgid "" +">>> import operator, functools\n" +">>> functools.reduce(operator.concat, ['A', 'BB', 'C'])\n" +"'ABBC'\n" +">>> functools.reduce(operator.concat, [])\n" +"Traceback (most recent call last):\n" +" ...\n" +"TypeError: reduce() of empty sequence with no initial value\n" +">>> functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"6\n" +">>> functools.reduce(operator.mul, [], 1)\n" +"1" +msgstr "" + #: ../../howto/functional.rst:1049 msgid "" "If you use :func:`operator.add` with :func:`functools.reduce`, you'll add up " @@ -1430,6 +1795,18 @@ msgid "" "write the obvious :keyword:`for` loop::" msgstr "" +#: ../../howto/functional.rst:1064 +msgid "" +"import functools\n" +"# Instead of:\n" +"product = functools.reduce(operator.mul, [1, 2, 3], 1)\n" +"\n" +"# You can write:\n" +"product = 1\n" +"for i in [1, 2, 3]:\n" +" product *= i" +msgstr "" + #: ../../howto/functional.rst:1073 msgid "" "A related function is :func:`itertools.accumulate(iterable, func=operator." @@ -1438,6 +1815,15 @@ msgid "" "iterator that also yields each partial result::" msgstr "" +#: ../../howto/functional.rst:1078 +msgid "" +"itertools.accumulate([1, 2, 3, 4, 5]) =>\n" +" 1, 3, 6, 10, 15\n" +"\n" +"itertools.accumulate([1, 2, 3, 4, 5], operator.mul) =>\n" +" 1, 2, 6, 24, 120" +msgstr "" + #: ../../howto/functional.rst:1086 msgid "The operator module" msgstr "O módulo operator" @@ -1497,6 +1883,12 @@ msgid "" "need to define a new function at all::" msgstr "" +#: ../../howto/functional.rst:1113 +msgid "" +"stripped_lines = [line.strip() for line in lines]\n" +"existing_files = filter(os.path.exists, file_list)" +msgstr "" + #: ../../howto/functional.rst:1116 msgid "" "If the function you need doesn't exist, you need to write it. One way to " @@ -1506,12 +1898,28 @@ msgid "" "expression::" msgstr "" +#: ../../howto/functional.rst:1121 +msgid "" +"adder = lambda x, y: x+y\n" +"\n" +"print_assign = lambda name, value: name + '=' + str(value)" +msgstr "" + #: ../../howto/functional.rst:1125 msgid "" "An alternative is to just use the ``def`` statement and define a function in " "the usual way::" msgstr "" +#: ../../howto/functional.rst:1128 +msgid "" +"def adder(x, y):\n" +" return x + y\n" +"\n" +"def print_assign(name, value):\n" +" return name + '=' + str(value)" +msgstr "" + #: ../../howto/functional.rst:1134 msgid "" "Which alternative is preferable? That's a style question; my usual course " @@ -1535,6 +1943,12 @@ msgstr "" "complicada que é difícil de ler. Rápido, o que o seguinte código está " "fazendo? ::" +#: ../../howto/functional.rst:1144 +msgid "" +"import functools\n" +"total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]" +msgstr "" + #: ../../howto/functional.rst:1147 msgid "" "You can figure it out, but it takes time to disentangle the expression to " @@ -1545,16 +1959,36 @@ msgstr "" "descobrir o que está acontecendo. Usar uma breve instrução de ``def`` " "aninhada torna as coisas um pouco melhor::" +#: ../../howto/functional.rst:1151 +msgid "" +"import functools\n" +"def combine(a, b):\n" +" return 0, a[1] + b[1]\n" +"\n" +"total = functools.reduce(combine, items)[1]" +msgstr "" + #: ../../howto/functional.rst:1157 msgid "But it would be best of all if I had simply used a ``for`` loop::" msgstr "" "Mas seria o melhor de tudo se eu tivesse usado simplesmente um bucle " "``for``::" +#: ../../howto/functional.rst:1159 +msgid "" +"total = 0\n" +"for a, b in items:\n" +" total += b" +msgstr "" + #: ../../howto/functional.rst:1163 msgid "Or the :func:`sum` built-in and a generator expression::" msgstr "Ou o :func:`sum` embutida e uma expressão do gerador::" +#: ../../howto/functional.rst:1165 +msgid "total = sum(b for a, b in items)" +msgstr "" + #: ../../howto/functional.rst:1167 msgid "" "Many uses of :func:`functools.reduce` are clearer when written as ``for`` " diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po index 1e231048b..5ea4c3acd 100644 --- a/howto/gdb_helpers.po +++ b/howto/gdb_helpers.po @@ -4,7 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -12,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-25 01:09+0000\n" -"PO-Revision-Date: 2024-02-25 01:11+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -156,6 +155,10 @@ msgstr "" "Se você não encontrar instruções para a sua versão do GDB, coloque isso no " "seu arquivo de configuração (``~/.gdbinit`` ou ``~/.config/gdb/gdbinit``)::" +#: ../../howto/gdb_helpers.rst:68 +msgid "add-auto-load-safe-path /path/to/cpython" +msgstr "" + #: ../../howto/gdb_helpers.rst:70 msgid "You can also add multiple paths, separated by ``:``." msgstr "Você também pode adicionar vários caminhos, separados por ``:``." @@ -177,10 +180,20 @@ msgstr "" msgid "Fedora:" msgstr "Fedora:" +#: ../../howto/gdb_helpers.rst:82 +msgid "" +"sudo dnf install gdb\n" +"sudo dnf debuginfo-install python3" +msgstr "" + #: ../../howto/gdb_helpers.rst:87 msgid "Ubuntu:" msgstr "Ubuntu:" +#: ../../howto/gdb_helpers.rst:89 +msgid "sudo apt install gdb python3-dbg" +msgstr "" + #: ../../howto/gdb_helpers.rst:93 msgid "" "On several recent Linux systems, GDB can download debugging symbols " @@ -252,6 +265,37 @@ msgstr "" "Este é o aspecto de um backtrace do GDB (truncado) quando esta extensão está " "habilitada:" +#: ../../howto/gdb_helpers.rst:126 +msgid "" +"#0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at " +"address 0x7fffff7fefe8\n" +") at Objects/obmalloc.c:748\n" +"#1 0x000000000041b7c0 in _PyObject_DebugMallocApi (id=111 'o', nbytes=24) " +"at Objects/obmalloc.c:1445\n" +"#2 0x000000000041b717 in _PyObject_DebugMalloc (nbytes=24) at Objects/" +"obmalloc.c:1412\n" +"#3 0x000000000044060a in _PyUnicode_New (length=11) at Objects/" +"unicodeobject.c:346\n" +"#4 0x00000000004466aa in PyUnicodeUCS2_DecodeUTF8Stateful (s=0x5c2b8d " +"\"__lltrace__\", size=11, errors=0x0, consumed=\n" +" 0x0) at Objects/unicodeobject.c:2531\n" +"#5 0x0000000000446647 in PyUnicodeUCS2_DecodeUTF8 (s=0x5c2b8d " +"\"__lltrace__\", size=11, errors=0x0)\n" +" at Objects/unicodeobject.c:2495\n" +"#6 0x0000000000440d1b in PyUnicodeUCS2_FromStringAndSize (u=0x5c2b8d " +"\"__lltrace__\", size=11)\n" +" at Objects/unicodeobject.c:551\n" +"#7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d " +"\"__lltrace__\") at Objects/unicodeobject.c:569\n" +"#8 0x0000000000584abd in PyDict_GetItemString (v=\n" +" {'Yuck': , '__builtins__': , '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', " +"'__package__': None, 'y': , 'dict': {0: 0, 1: " +"1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': , '__doc__': None}, key=\n" +" 0x5c2b8d \"__lltrace__\") at Objects/dictobject.c:2171" +msgstr "" + #: ../../howto/gdb_helpers.rst:142 msgid "" "Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed " @@ -272,6 +316,28 @@ msgstr "" "inferior de um objeto, então converta o valor para um ponteiro do tipo " "apropriado. Por exemplo:" +#: ../../howto/gdb_helpers.rst:149 +msgid "" +"(gdb) p globals\n" +"$1 = {'__builtins__': , '__name__':\n" +"'__main__', 'ctypes': , '__doc__': None,\n" +"'__package__': None}\n" +"\n" +"(gdb) p *(PyDictObject*)globals\n" +"$2 = {ob_refcnt = 3, ob_type = 0x3dbdf85820, ma_fill = 5, ma_used = 5,\n" +"ma_mask = 7, ma_table = 0x63d0f8, ma_lookup = 0x3dbdc7ea70\n" +", ma_smalltable = {{me_hash = 7065186196740147912,\n" +"me_key = '__builtins__', me_value = },\n" +"{me_hash = -368181376027291943, me_key = '__name__',\n" +"me_value ='__main__'}, {me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0},\n" +"{me_hash = -9177857982131165996, me_key = 'ctypes',\n" +"me_value = },\n" +"{me_hash = -8518757509529533123, me_key = '__doc__', me_value = None},\n" +"{me_hash = 0, me_key = 0x0, me_value = 0x0}, {\n" +" me_hash = 6614918939584953775, me_key = '__package__', me_value = None}}}" +msgstr "" + #: ../../howto/gdb_helpers.rst:168 msgid "" "Note that the pretty-printers do not actually call ``repr()``. For basic " @@ -294,6 +360,15 @@ msgstr "" "`PyLongObject *`) fornece uma representação que não é distinguível de um " "inteiro de nível de máquina regular." +#: ../../howto/gdb_helpers.rst:177 +msgid "" +"(gdb) p some_machine_integer\n" +"$3 = 42\n" +"\n" +"(gdb) p some_python_integer\n" +"$4 = 42" +msgstr "" + #: ../../howto/gdb_helpers.rst:183 msgid "" "The internal structure can be revealed with a cast to :c:expr:`PyLongObject " @@ -318,6 +393,12 @@ msgstr "" "Uma confusão semelhante pode surgir com o tipo ``str``, onde a saída se " "parece muito com a a impressão embutida do gdb para ``char *``." +#: ../../howto/gdb_helpers.rst:192 +msgid "" +"(gdb) p ptr_to_python_str\n" +"$6 = '__builtins__'" +msgstr "" + #: ../../howto/gdb_helpers.rst:195 msgid "" "The pretty-printer for ``str`` instances defaults to using single-quotes (as " @@ -329,6 +410,12 @@ msgstr "" "padrão para valores de ``char *`` usa aspas duplas e contém um endereço " "hexadecimal." +#: ../../howto/gdb_helpers.rst:199 +msgid "" +"(gdb) p ptr_to_char_star\n" +"$7 = 0x6d72c0 \"hello world\"" +msgstr "" + #: ../../howto/gdb_helpers.rst:202 msgid "" "Again, the implementation details can be revealed with a cast to :c:expr:" @@ -337,6 +424,13 @@ msgstr "" "Novamente, os detalhes de implementação podem ser revelados com um chamada " "a :c:expr:`PyUnicodeObject *`::." +#: ../../howto/gdb_helpers.rst:205 +msgid "" +"(gdb) p *(PyUnicodeObject*)$6\n" +"$8 = {ob_base = {ob_refcnt = 33, ob_type = 0x3dad3a95a0}, length = 12,\n" +"str = 0x7ffff2128500, hash = 7065186196740147912, state = 1, defenc = 0x0}" +msgstr "" + #: ../../howto/gdb_helpers.rst:210 msgid "``py-list``" msgstr "``py-list``" @@ -351,6 +445,22 @@ msgstr "" "(se houver) para o quadro atual na thread selecionada. A linha atual é " "marcada com um \">\"::" +#: ../../howto/gdb_helpers.rst:216 +msgid "" +"(gdb) py-list\n" +" 901 if options.profile:\n" +" 902 options.profile = False\n" +" 903 profile_me()\n" +" 904 return\n" +" 905\n" +">906 u = UI()\n" +" 907 if not u.quit:\n" +" 908 try:\n" +" 909 gtk.main()\n" +" 910 except KeyboardInterrupt:\n" +" 911 # properly quit on a keyboard interrupt..." +msgstr "" + #: ../../howto/gdb_helpers.rst:229 msgid "" "Use ``py-list START`` to list at a different line number within the Python " @@ -397,6 +507,21 @@ msgstr "Eles emitem o número do quadro (no nível C) dentro da thread." msgid "For example::" msgstr "Por exemplo::" +#: ../../howto/gdb_helpers.rst:250 +msgid "" +"(gdb) py-up\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-up\n" +"#40 Frame 0x948e82c, for file /usr/lib/python2.6/site-packages/\n" +"gnome_sudoku/gnome_sudoku.py, line 22, in start_game(main=)\n" +" main.start_game()\n" +"(gdb) py-up\n" +"Unable to find an older python frame" +msgstr "" + #: ../../howto/gdb_helpers.rst:261 msgid "so we're at the top of the Python stack." msgstr "de forma estamos no topo da pilha do Python." @@ -415,6 +540,47 @@ msgstr "" msgid "Going back down::" msgstr "Voltando para baixo::" +#: ../../howto/gdb_helpers.rst:269 +msgid "" +"(gdb) py-down\n" +"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"main.py, line 906, in start_game ()\n" +" u = UI()\n" +"(gdb) py-down\n" +"#34 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#23 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#19 (unable to read python frame information)\n" +"(gdb) py-down\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"game_selector.py, line 201, in run_swallowed_dialog " +"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " +"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " +"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " +"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " +"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " +"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " +"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=, main_page=0) " +"at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"(gdb) py-down\n" +"#8 (unable to read python frame information)\n" +"(gdb) py-down\n" +"Unable to find a newer python frame" +msgstr "" + #: ../../howto/gdb_helpers.rst:289 msgid "and we're at the bottom of the Python stack." msgstr "e estamos na parte inferior da pilha do Python." @@ -430,6 +596,33 @@ msgstr "" "``py-up`` e ``py-down`` podem mover vários quadros Python de uma vez. Por " "exemplo::" +#: ../../howto/gdb_helpers.rst:295 +msgid "" +"(gdb) py-up\n" +"#6 Frame 0x7ffff7fb62b0, for file /tmp/rec.py, line 5, in recursive_function " +"(n=0)\n" +" time.sleep(5)\n" +"#6 Frame 0x7ffff7fb6240, for file /tmp/rec.py, line 7, in recursive_function " +"(n=1)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb61d0, for file /tmp/rec.py, line 7, in recursive_function " +"(n=2)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6160, for file /tmp/rec.py, line 7, in recursive_function " +"(n=3)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb60f0, for file /tmp/rec.py, line 7, in recursive_function " +"(n=4)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6080, for file /tmp/rec.py, line 7, in recursive_function " +"(n=5)\n" +" recursive_function(n-1)\n" +"#6 Frame 0x7ffff7fb6020, for file /tmp/rec.py, line 9, in ()\n" +" recursive_function(5)\n" +"(gdb) py-up\n" +"Unable to find an older python frame" +msgstr "" + #: ../../howto/gdb_helpers.rst:315 msgid "``py-bt``" msgstr "``py-bt``" @@ -442,6 +635,43 @@ msgstr "" "O comando ``py-bt`` tenta mostrar uma rastreabilidade em nível Python da " "thread atual." +#: ../../howto/gdb_helpers.rst:322 +msgid "" +"(gdb) py-bt\n" +"#8 (unable to read python frame information)\n" +"#11 Frame 0x9aead74, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"dialog_swallower.py, line 48, in run_dialog " +"(self=, main_page=0) " +"at remote 0x98fa6e4>, d=)\n" +" gtk.main()\n" +"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" +"game_selector.py, line 201, in run_swallowed_dialog " +"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " +"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " +"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " +"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " +"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " +"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " +"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=)\n" +" main.start_game()" +msgstr "" + #: ../../howto/gdb_helpers.rst:336 msgid "" "The frame numbers correspond to those displayed by GDB's standard " @@ -464,6 +694,19 @@ msgstr "" "procura em locais dentro da thread atual, depois em globais e, finalmente, " "em embutidos::" +#: ../../howto/gdb_helpers.rst:346 +msgid "" +"(gdb) py-print self\n" +"local 'self' = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"(gdb) py-print __name__\n" +"global '__name__' = 'gnome_sudoku.dialog_swallower'\n" +"(gdb) py-print len\n" +"builtin 'len' = \n" +"(gdb) py-print scarlet_pimpernel\n" +"'scarlet_pimpernel' not found" +msgstr "" + #: ../../howto/gdb_helpers.rst:356 msgid "" "If the current C frame corresponds to multiple Python frames, ``py-print`` " @@ -484,6 +727,14 @@ msgstr "" "O comando ``py-locals`` busca todas as variáveis locais do Python no quadro " "Python atual na thread selecionada e imprime suas representações::" +#: ../../howto/gdb_helpers.rst:365 +msgid "" +"(gdb) py-locals\n" +"self = ,\n" +"main_page=0) at remote 0x98fa6e4>\n" +"d = " +msgstr "" + #: ../../howto/gdb_helpers.rst:370 msgid "" "If the current C frame corresponds to multiple Python frames, locals from " @@ -492,6 +743,24 @@ msgstr "" "Se o quadro C atual corresponder a vários quadros Python, serão mostrados os " "locais de todos eles:" +#: ../../howto/gdb_helpers.rst:373 +msgid "" +"(gdb) py-locals\n" +"Locals for recursive_function\n" +"n = 0\n" +"Locals for recursive_function\n" +"n = 1\n" +"Locals for recursive_function\n" +"n = 2\n" +"Locals for recursive_function\n" +"n = 3\n" +"Locals for recursive_function\n" +"n = 4\n" +"Locals for recursive_function\n" +"n = 5\n" +"Locals for " +msgstr "" + #: ../../howto/gdb_helpers.rst:390 msgid "Use with GDB commands" msgstr "Uso com comandos do GDB" @@ -507,6 +776,30 @@ msgstr "" "comando ``frame`` para ir a um quadro específico dentro da thread " "selecionada, assim::" +#: ../../howto/gdb_helpers.rst:396 +msgid "" +"(gdb) py-bt\n" +"(output snipped)\n" +"#68 Frame 0xaa4560, for file Lib/test/regrtest.py, line 1548, in " +"()\n" +" main()\n" +"(gdb) frame 68\n" +"#68 0x00000000004cd1e6 in PyEval_EvalFrameEx (f=Frame 0xaa4560, for file Lib/" +"test/regrtest.py, line 1548, in (), throwflag=0) at Python/ceval." +"c:2665\n" +"2665 x = call_function(&sp, oparg);\n" +"(gdb) py-list\n" +"1543 # Run the tests in a context manager that temporary changes the " +"CWD to a\n" +"1544 # temporary and writable directory. If it's not possible to " +"create or\n" +"1545 # change the CWD, the original CWD will be used. The original " +"CWD is\n" +"1546 # available from test_support.SAVEDCWD.\n" +"1547 with test_support.temp_cwd(TESTCWD, quiet=True):\n" +">1548 main()" +msgstr "" + #: ../../howto/gdb_helpers.rst:411 msgid "" "The ``info threads`` command will give you a list of the threads within the " @@ -516,6 +809,17 @@ msgstr "" "processo, e você pode usar o comando ``thread`` para selecionar uma " "diferente::" +#: ../../howto/gdb_helpers.rst:414 +msgid "" +"(gdb) info threads\n" +" 105 Thread 0x7fffefa18710 (LWP 10260) sem_wait () at ../nptl/sysdeps/unix/" +"sysv/linux/x86_64/sem_wait.S:86\n" +" 104 Thread 0x7fffdf5fe710 (LWP 10259) sem_wait () at ../nptl/sysdeps/unix/" +"sysv/linux/x86_64/sem_wait.S:86\n" +"* 1 Thread 0x7ffff7fe2700 (LWP 10145) 0x00000038e46d73e3 in select () at ../" +"sysdeps/unix/syscall-template.S:82" +msgstr "" + #: ../../howto/gdb_helpers.rst:419 msgid "" "You can use ``thread apply all COMMAND`` or (``t a a COMMAND`` for short) to " @@ -525,3 +829,84 @@ msgstr "" "Você pode usar ``thread apply all COMANDO`` ou (``t a a COMANDO`` para " "abreviar) para executar um comando em todas as threads. Com ``py-bt``, isso " "permite que você veja o que cada thread está fazendo no nível do Python::" + +#: ../../howto/gdb_helpers.rst:423 +msgid "" +"(gdb) t a a py-bt\n" +"\n" +"Thread 105 (Thread 0x7fffefa18710 (LWP 10260)):\n" +"#5 Frame 0x7fffd00019d0, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 155, in _acquire_restore " +"(self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, " +"_RLock__block=, _RLock__count=1) at remote " +"0xd7ff40>, count_owner=(1, 140737213728528), count=1, " +"owner=140737213728528)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffac001640, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 269, in wait " +"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " +"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " +"_release_save=, release=, _acquire_restore=, " +"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " +"timeout=None, waiter=, saved_state=(1, " +"140737213728528))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffb8001a10, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffb8001c40, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 37, in task (tid=140737213728528)\n" +" f()\n" +"\n" +"Thread 104 (Thread 0x7fffdf5fe710 (LWP 10259)):\n" +"#5 Frame 0x7fffe4001580, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 155, in _acquire_restore " +"(self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, " +"_RLock__block=, _RLock__count=1) at remote " +"0xd7ff40>, count_owner=(1, 140736940992272), count=1, " +"owner=140736940992272)\n" +" self.__block.acquire()\n" +"#8 Frame 0x7fffc8002090, for file /home/david/coding/python-svn/Lib/" +"threading.py, line 269, in wait " +"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " +"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " +"_release_save=, release=, _acquire_restore=, " +"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " +"timeout=None, waiter=, saved_state=(1, " +"140736940992272))\n" +" self._acquire_restore(saved_state)\n" +"#12 Frame 0x7fffac001c90, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 348, in f ()\n" +" cond.wait()\n" +"#16 Frame 0x7fffac0011c0, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 37, in task (tid=140736940992272)\n" +" f()\n" +"\n" +"Thread 1 (Thread 0x7ffff7fe2700 (LWP 10145)):\n" +"#5 Frame 0xcb5380, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 16, in _wait ()\n" +" time.sleep(0.01)\n" +"#8 Frame 0x7fffd00024a0, for file /home/david/coding/python-svn/Lib/test/" +"lock_tests.py, line 378, in _check_notify " +"(self=, skipped=[], _mirrorOutput=False, testsRun=39, " +"buffer=False, _original_stderr=, " +"_stdout_buffer=, " +"_stderr_buffer=, " +"_moduleSetUpFailed=False, expectedFailures=[], errors=[], " +"_previousTestClass=, unexpectedSuccesses=[], " +"failures=[], shouldStop=False, failfast=False) at remote 0xc185a0>, " +"_threads=(0,), _cleanups=[], _type_equality_funcs={: , : " +", : " +", : " +", , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index ecbc20227..63d8c8d10 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Hemílio Lauro , 2021 -# i17obot , 2021 -# Leandro Cavalcante Damascena , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-04 01:27+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Leandro Cavalcante Damascena , " -"2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -94,16 +88,28 @@ msgstr "" msgid "On a Linux machine, this can be done via::" msgstr "" +#: ../../howto/instrumentation.rst:42 +msgid "$ yum install systemtap-sdt-devel" +msgstr "" + #: ../../howto/instrumentation.rst:44 msgid "or::" msgstr "ou::" +#: ../../howto/instrumentation.rst:46 +msgid "$ sudo apt-get install systemtap-sdt-dev" +msgstr "" + #: ../../howto/instrumentation.rst:49 msgid "" "CPython must then be :option:`configured with the --with-dtrace option <--" "with-dtrace>`:" msgstr "" +#: ../../howto/instrumentation.rst:52 +msgid "checking for --with-dtrace... yes" +msgstr "" + #: ../../howto/instrumentation.rst:56 msgid "" "On macOS, you can list available DTrace probes by running a Python process " @@ -111,12 +117,40 @@ msgid "" "provider::" msgstr "" +#: ../../howto/instrumentation.rst:60 +msgid "" +"$ python3.6 -q &\n" +"$ sudo dtrace -l -P python$! # or: dtrace -l -m python3.6\n" +"\n" +" ID PROVIDER MODULE FUNCTION NAME\n" +"29564 python18035 python3.6 _PyEval_EvalFrameDefault " +"function-entry\n" +"29565 python18035 python3.6 dtrace_function_entry " +"function-entry\n" +"29566 python18035 python3.6 _PyEval_EvalFrameDefault " +"function-return\n" +"29567 python18035 python3.6 dtrace_function_return " +"function-return\n" +"29568 python18035 python3.6 collect gc-" +"done\n" +"29569 python18035 python3.6 collect gc-" +"start\n" +"29570 python18035 python3.6 _PyEval_EvalFrameDefault line\n" +"29571 python18035 python3.6 maybe_dtrace_line line" +msgstr "" + #: ../../howto/instrumentation.rst:73 msgid "" "On Linux, you can verify if the SystemTap static markers are present in the " "built binary by seeing if it contains a \".note.stapsdt\" section." msgstr "" +#: ../../howto/instrumentation.rst:78 +msgid "" +"$ readelf -S ./python | grep .note.stapsdt\n" +"[30] .note.stapsdt NOTE 0000000000000000 00308d78" +msgstr "" + #: ../../howto/instrumentation.rst:81 msgid "" "If you've built Python as a shared library (with the :option:`--enable-" @@ -124,10 +158,64 @@ msgid "" "library. For example::" msgstr "" +#: ../../howto/instrumentation.rst:85 +msgid "" +"$ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt\n" +"[29] .note.stapsdt NOTE 0000000000000000 00365b68" +msgstr "" + #: ../../howto/instrumentation.rst:88 msgid "Sufficiently modern readelf can print the metadata::" msgstr "" +#: ../../howto/instrumentation.rst:90 +msgid "" +"$ readelf -n ./python\n" +"\n" +"Displaying notes found at file offset 0x00000254 with length 0x00000020:\n" +" Owner Data size Description\n" +" GNU 0x00000010 NT_GNU_ABI_TAG (ABI version " +"tag)\n" +" OS: Linux, ABI: 2.6.32\n" +"\n" +"Displaying notes found at file offset 0x00000274 with length 0x00000024:\n" +" Owner Data size Description\n" +" GNU 0x00000014 NT_GNU_BUILD_ID (unique build " +"ID bitstring)\n" +" Build ID: df924a2b08a7e89f6e11251d4602022977af2670\n" +"\n" +"Displaying notes found at file offset 0x002d6c30 with length 0x00000144:\n" +" Owner Data size Description\n" +" stapsdt 0x00000031 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: gc__start\n" +" Location: 0x00000000004371c3, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bf6\n" +" Arguments: -4@%ebx\n" +" stapsdt 0x00000030 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: gc__done\n" +" Location: 0x00000000004374e1, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bf8\n" +" Arguments: -8@%rax\n" +" stapsdt 0x00000045 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: function__entry\n" +" Location: 0x000000000053db6c, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6be8\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax\n" +" stapsdt 0x00000046 NT_STAPSDT (SystemTap probe " +"descriptors)\n" +" Provider: python\n" +" Name: function__return\n" +" Location: 0x000000000053dba8, Base: 0x0000000000630ce2, Semaphore: " +"0x00000000008d6bea\n" +" Arguments: 8@%rbp 8@%r12 -4@%eax" +msgstr "" + #: ../../howto/instrumentation.rst:125 msgid "" "The above metadata contains information for SystemTap describing how it can " @@ -147,14 +235,77 @@ msgid "" "are not going to be listed:" msgstr "" +#: ../../howto/instrumentation.rst:138 +msgid "" +"self int indent;\n" +"\n" +"python$target:::function-entry\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 1;\n" +"}\n" +"\n" +"python$target:::function-entry\n" +"/self->trace/\n" +"{\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " +"arg2);\n" +" self->indent++;\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/self->trace/\n" +"{\n" +" self->indent--;\n" +" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" +" printf(\"%*s\", self->indent, \"\");\n" +" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " +"arg2);\n" +"}\n" +"\n" +"python$target:::function-return\n" +"/copyinstr(arg1) == \"start\"/\n" +"{\n" +" self->trace = 0;\n" +"}" +msgstr "" + #: ../../howto/instrumentation.rst:172 ../../howto/instrumentation.rst:230 msgid "It can be invoked like this::" msgstr "" +#: ../../howto/instrumentation.rst:174 +msgid "$ sudo dtrace -q -s call_stack.d -c \"python3.6 script.py\"" +msgstr "" + #: ../../howto/instrumentation.rst:176 ../../howto/instrumentation.rst:236 msgid "The output looks like this:" msgstr "O resultado deve ser algo assim:" +#: ../../howto/instrumentation.rst:178 +msgid "" +"156641360502280 function-entry:call_stack.py:start:23\n" +"156641360518804 function-entry: call_stack.py:function_1:1\n" +"156641360532797 function-entry: call_stack.py:function_3:9\n" +"156641360546807 function-return: call_stack.py:function_3:10\n" +"156641360563367 function-return: call_stack.py:function_1:2\n" +"156641360578365 function-entry: call_stack.py:function_2:5\n" +"156641360591757 function-entry: call_stack.py:function_1:1\n" +"156641360605556 function-entry: call_stack.py:function_3:9\n" +"156641360617482 function-return: call_stack.py:function_3:10\n" +"156641360629814 function-return: call_stack.py:function_1:2\n" +"156641360642285 function-return: call_stack.py:function_2:6\n" +"156641360656770 function-entry: call_stack.py:function_3:9\n" +"156641360669707 function-return: call_stack.py:function_3:10\n" +"156641360687853 function-entry: call_stack.py:function_4:13\n" +"156641360700719 function-return: call_stack.py:function_4:14\n" +"156641360719640 function-entry: call_stack.py:function_5:18\n" +"156641360732567 function-return: call_stack.py:function_5:21\n" +"156641360747370 function-return:call_stack.py:start:28" +msgstr "" + #: ../../howto/instrumentation.rst:201 msgid "Static SystemTap markers" msgstr "" @@ -172,6 +323,44 @@ msgid "" "hierarchy of a Python script:" msgstr "" +#: ../../howto/instrumentation.rst:210 +msgid "" +"probe process(\"python\").mark(\"function__entry\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s => %s in %s:%d\\\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe process(\"python\").mark(\"function__return\") {\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +"\n" +" printf(\"%s <= %s in %s:%d\\\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" +msgstr "" + +#: ../../howto/instrumentation.rst:232 +msgid "" +"$ stap \\\n" +" show-call-hierarchy.stp \\\n" +" -c \"./python test.py\"" +msgstr "" + +#: ../../howto/instrumentation.rst:238 +msgid "" +"11408 python(8274): => __contains__ in Lib/_abcoll.py:362\n" +"11414 python(8274): => __getitem__ in Lib/os.py:425\n" +"11418 python(8274): => encode in Lib/os.py:490\n" +"11424 python(8274): <= encode in Lib/os.py:493\n" +"11428 python(8274): <= __getitem__ in Lib/os.py:426\n" +"11433 python(8274): <= __contains__ in Lib/_abcoll.py:366" +msgstr "" + #: ../../howto/instrumentation.rst:247 msgid "where the columns are:" msgstr "" @@ -200,10 +389,20 @@ msgid "" "reflect this. For example, this line from the above example:" msgstr "" +#: ../../howto/instrumentation.rst:259 +msgid "probe process(\"python\").mark(\"function__entry\") {" +msgstr "" + #: ../../howto/instrumentation.rst:263 msgid "should instead read:" msgstr "" +#: ../../howto/instrumentation.rst:265 +msgid "" +"probe process(\"python\").library(\"libpython3.6dm.so.1.0\")." +"mark(\"function__entry\") {" +msgstr "" + #: ../../howto/instrumentation.rst:269 msgid "(assuming a :ref:`debug build ` of CPython 3.6)" msgstr "" @@ -266,7 +465,7 @@ msgstr "" #: ../../howto/instrumentation.rst:309 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " -"``arg0`` is the generation to scan, like :func:`gc.collect()`." +"``arg0`` is the generation to scan, like :func:`gc.collect`." msgstr "" #: ../../howto/instrumentation.rst:314 @@ -309,6 +508,29 @@ msgstr "" msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "" +#: ../../howto/instrumentation.rst:351 +msgid "" +"/*\n" +" Provide a higher-level wrapping around the function__entry and\n" +" function__return markers:\n" +" \\*/\n" +"probe python.function.entry = process(\"python\").mark(\"function__entry\")\n" +"{\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +" frameptr = $arg4\n" +"}\n" +"probe python.function.return = process(\"python\")." +"mark(\"function__return\")\n" +"{\n" +" filename = user_string($arg1);\n" +" funcname = user_string($arg2);\n" +" lineno = $arg3;\n" +" frameptr = $arg4\n" +"}" +msgstr "" + #: ../../howto/instrumentation.rst:372 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" @@ -340,9 +562,46 @@ msgid "" "needing to directly name the static markers:" msgstr "" +#: ../../howto/instrumentation.rst:395 +msgid "" +"probe python.function.entry\n" +"{\n" +" printf(\"%s => %s in %s:%d\\n\",\n" +" thread_indent(1), funcname, filename, lineno);\n" +"}\n" +"\n" +"probe python.function.return\n" +"{\n" +" printf(\"%s <= %s in %s:%d\\n\",\n" +" thread_indent(-1), funcname, filename, lineno);\n" +"}" +msgstr "" + #: ../../howto/instrumentation.rst:410 msgid "" "The following script uses the tapset above to provide a top-like view of all " "running CPython code, showing the top 20 most frequently entered bytecode " "frames, each second, across the whole system:" msgstr "" + +#: ../../howto/instrumentation.rst:414 +msgid "" +"global fn_calls;\n" +"\n" +"probe python.function.entry\n" +"{\n" +" fn_calls[pid(), filename, funcname, lineno] += 1;\n" +"}\n" +"\n" +"probe timer.ms(1000) {\n" +" printf(\"\\033[2J\\033[1;1H\") /* clear screen \\*/\n" +" printf(\"%6s %80s %6s %30s %6s\\n\",\n" +" \"PID\", \"FILENAME\", \"LINE\", \"FUNCTION\", \"CALLS\")\n" +" foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {\n" +" printf(\"%6d %80s %6d %30s %6d\\n\",\n" +" pid, filename, lineno, funcname,\n" +" fn_calls[pid, filename, funcname, lineno]);\n" +" }\n" +" delete fn_calls;\n" +"}" +msgstr "" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index ac9c2cf5f..e6f2cb5e6 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -4,11 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Cauê Baasch de Souza , 2021 -# Misael borges , 2021 -# Hemílio Lauro , 2021 -# i17obot , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -16,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -136,6 +131,14 @@ msgstr "" "Os endereços também podem ser criados diretamente a partir de números " "inteiros. Os valores que cabem em 32 bits são considerados endereços IPv4::" +#: ../../howto/ipaddress.rst:64 +msgid "" +">>> ipaddress.ip_address(3221225985)\n" +"IPv4Address('192.0.2.1')\n" +">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n" +"IPv6Address('2001:db8::1')" +msgstr "" + #: ../../howto/ipaddress.rst:69 msgid "" "To force the use of IPv4 or IPv6 addresses, the relevant classes can be " @@ -146,6 +149,16 @@ msgstr "" "invocadas diretamente. Isto é particularmente útil para forçar a criação de " "endereços IPv6 para números inteiros pequenos:" +#: ../../howto/ipaddress.rst:73 +msgid "" +">>> ipaddress.ip_address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv4Address(1)\n" +"IPv4Address('0.0.0.1')\n" +">>> ipaddress.IPv6Address(1)\n" +"IPv6Address('::1')" +msgstr "" + #: ../../howto/ipaddress.rst:82 msgid "Defining Networks" msgstr "Definindo redes" @@ -178,6 +191,14 @@ msgstr "" "Quanto aos endereços, é fornecida uma função de fábrica que determina " "automaticamente a versão correta do IP:" +#: ../../howto/ipaddress.rst:96 +msgid "" +">>> ipaddress.ip_network('192.0.2.0/24')\n" +"IPv4Network('192.0.2.0/24')\n" +">>> ipaddress.ip_network('2001:db8::0/96')\n" +"IPv6Network('2001:db8::/96')" +msgstr "" + #: ../../howto/ipaddress.rst:101 msgid "" "Network objects cannot have any host bits set. The practical effect of this " @@ -204,6 +225,16 @@ msgstr "" "adicionais sejam forçados a zero, o sinalizador ``strict=False`` pode ser " "passada para o construtor::" +#: ../../howto/ipaddress.rst:112 +msgid "" +">>> ipaddress.ip_network('192.0.2.1/24')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: 192.0.2.1/24 has host bits set\n" +">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n" +"IPv4Network('192.0.2.0/24')" +msgstr "" + #: ../../howto/ipaddress.rst:119 msgid "" "While the string form offers significantly more flexibility, networks can " @@ -217,6 +248,14 @@ msgstr "" "endereço único identificado pelo número inteiro, portanto o prefixo da rede " "inclui todo o endereço da rede::" +#: ../../howto/ipaddress.rst:124 +msgid "" +">>> ipaddress.ip_network(3221225984)\n" +"IPv4Network('192.0.2.0/32')\n" +">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n" +"IPv6Network('2001:db8::/128')" +msgstr "" + #: ../../howto/ipaddress.rst:129 msgid "" "As with addresses, creation of a particular kind of network can be forced by " @@ -279,18 +318,63 @@ msgstr "" msgid "Extracting the IP version::" msgstr "Extraindo a versão do IP::" +#: ../../howto/ipaddress.rst:165 +msgid "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr6 = ipaddress.ip_address('2001:db8::1')\n" +">>> addr6.version\n" +"6\n" +">>> addr4.version\n" +"4" +msgstr "" + #: ../../howto/ipaddress.rst:172 msgid "Obtaining the network from an interface::" msgstr "Obtendo a rede de uma interface::" +#: ../../howto/ipaddress.rst:174 +msgid "" +">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n" +">>> host4.network\n" +"IPv4Network('192.0.2.0/24')\n" +">>> host6 = ipaddress.ip_interface('2001:db8::1/96')\n" +">>> host6.network\n" +"IPv6Network('2001:db8::/96')" +msgstr "" + #: ../../howto/ipaddress.rst:181 msgid "Finding out how many individual addresses are in a network::" msgstr "Descobrindo quantos endereços individuais estão em uma rede::" +#: ../../howto/ipaddress.rst:183 +msgid "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> net4.num_addresses\n" +"256\n" +">>> net6 = ipaddress.ip_network('2001:db8::0/96')\n" +">>> net6.num_addresses\n" +"4294967296" +msgstr "" + #: ../../howto/ipaddress.rst:190 msgid "Iterating through the \"usable\" addresses on a network::" msgstr "Iterando através dos endereços \"utilizáveis\" em uma rede::" +#: ../../howto/ipaddress.rst:192 +msgid "" +">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" +">>> for x in net4.hosts():\n" +"... print(x) \n" +"192.0.2.1\n" +"192.0.2.2\n" +"192.0.2.3\n" +"192.0.2.4\n" +"...\n" +"192.0.2.252\n" +"192.0.2.253\n" +"192.0.2.254" +msgstr "" + #: ../../howto/ipaddress.rst:205 msgid "" "Obtaining the netmask (i.e. set bits corresponding to the network prefix) or " @@ -304,6 +388,18 @@ msgstr "" msgid "Exploding or compressing the address::" msgstr "Explodindo ou compactando o endereço::" +#: ../../howto/ipaddress.rst:222 +msgid "" +">>> addr6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0001'\n" +">>> addr6.compressed\n" +"'2001:db8::1'\n" +">>> net6.exploded\n" +"'2001:0db8:0000:0000:0000:0000:0000:0000/96'\n" +">>> net6.compressed\n" +"'2001:db8::/96'" +msgstr "" + #: ../../howto/ipaddress.rst:231 msgid "" "While IPv4 doesn't support explosion or compression, the associated objects " @@ -327,16 +423,43 @@ msgid "" "to index them like this::" msgstr "" +#: ../../howto/ipaddress.rst:243 +msgid "" +">>> net4[1]\n" +"IPv4Address('192.0.2.1')\n" +">>> net4[-1]\n" +"IPv4Address('192.0.2.255')\n" +">>> net6[1]\n" +"IPv6Address('2001:db8::1')\n" +">>> net6[-1]\n" +"IPv6Address('2001:db8::ffff:ffff')" +msgstr "" + #: ../../howto/ipaddress.rst:253 msgid "" "It also means that network objects lend themselves to using the list " "membership test syntax like this::" msgstr "" +#: ../../howto/ipaddress.rst:256 +msgid "" +"if address in network:\n" +" # do something" +msgstr "" + #: ../../howto/ipaddress.rst:259 msgid "Containment testing is done efficiently based on the network prefix::" msgstr "" +#: ../../howto/ipaddress.rst:261 +msgid "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n" +"True\n" +">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n" +"False" +msgstr "" + #: ../../howto/ipaddress.rst:269 msgid "Comparisons" msgstr "Comparações" @@ -347,6 +470,12 @@ msgid "" "objects, where it makes sense::" msgstr "" +#: ../../howto/ipaddress.rst:274 +msgid "" +">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n" +"True" +msgstr "" + #: ../../howto/ipaddress.rst:277 msgid "" "A :exc:`TypeError` exception is raised if you try to compare objects of " @@ -364,6 +493,15 @@ msgid "" "an integer or string that the other module will accept::" msgstr "" +#: ../../howto/ipaddress.rst:288 +msgid "" +">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" +">>> str(addr4)\n" +"'192.0.2.1'\n" +">>> int(addr4)\n" +"3221225985" +msgstr "" + #: ../../howto/ipaddress.rst:296 msgid "Getting more detail when instance creation fails" msgstr "" @@ -393,9 +531,39 @@ msgid "" "constructors directly. For example::" msgstr "" +#: ../../howto/ipaddress.rst:314 +msgid "" +">>> ipaddress.ip_address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.256' does not appear to be an IPv4 or IPv6 address\n" +">>> ipaddress.IPv4Address(\"192.168.0.256\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.AddressValueError: Octet 256 (> 255) not permitted in " +"'192.168.0.256'\n" +"\n" +">>> ipaddress.ip_network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: '192.168.0.1/64' does not appear to be an IPv4 or IPv6 network\n" +">>> ipaddress.IPv4Network(\"192.168.0.1/64\")\n" +"Traceback (most recent call last):\n" +" ...\n" +"ipaddress.NetmaskValueError: '64' is not a valid netmask" +msgstr "" + #: ../../howto/ipaddress.rst:332 msgid "" "However, both of the module specific exceptions have :exc:`ValueError` as " "their parent class, so if you're not concerned with the particular type of " "error, you can still write code like the following::" msgstr "" + +#: ../../howto/ipaddress.rst:336 +msgid "" +"try:\n" +" network = ipaddress.IPv4Network(address)\n" +"except ValueError:\n" +" print('address/netmask is invalid for IPv4:', address)" +msgstr "" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 5f91bd309..4dd4b126c 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2022 -# Claudio Rogerio Carvalho Filho , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-26 14:13+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -214,6 +212,17 @@ msgstr "" "que vários objetos de módulo podem ser criados a partir de uma única " "biblioteca compartilhada. Por exemplo:" +#: ../../howto/isolating-extensions.rst:93 +msgid "" +">>> import sys\n" +">>> import binascii\n" +">>> old_binascii = binascii\n" +">>> del sys.modules['binascii']\n" +">>> import binascii # create a new module object\n" +">>> old_binascii == binascii\n" +"False" +msgstr "" + #: ../../howto/isolating-extensions.rst:103 msgid "" "As a rule of thumb, the two modules should be completely independent. All " @@ -261,6 +270,20 @@ msgstr "" "``old_binascii.Error`` e ``binascii.Error`` são objetos separados. No código " "a seguir, a exceção *não* é capturada:" +#: ../../howto/isolating-extensions.rst:126 +msgid "" +">>> old_binascii.Error == binascii.Error\n" +"False\n" +">>> try:\n" +"... old_binascii.unhexlify(b'qwertyuiop')\n" +"... except binascii.Error:\n" +"... print('boo')\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 2, in \n" +"binascii.Error: Non-hexadecimal digit found" +msgstr "" + #: ../../howto/isolating-extensions.rst:139 msgid "" "This is expected. Notice that pure-Python modules behave the same way: it is " @@ -428,6 +451,23 @@ msgstr "" "seu módulo, you pode explicitamente torná-lo carregável somente uma vez por " "processo. Por exemplo::" +#: ../../howto/isolating-extensions.rst:218 +msgid "" +"static int loaded = 0;\n" +"\n" +"static int\n" +"exec_module(PyObject* module)\n" +"{\n" +" if (loaded) {\n" +" PyErr_SetString(PyExc_ImportError,\n" +" \"cannot load module more than once per process\");\n" +" return -1;\n" +" }\n" +" loaded = 1;\n" +" // ... rest of initialization\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:234 msgid "Module State Access from Functions" msgstr "Acesso ao estado de módulo a partir de funções" @@ -442,6 +482,19 @@ msgstr "" "recebem o objeto de módulo como o primeiro argumento; para extrair o estado, " "você pode usar ``PyModule_GetState``::" +#: ../../howto/isolating-extensions.rst:240 +msgid "" +"static PyObject *\n" +"func(PyObject *module, PyObject *args)\n" +"{\n" +" my_struct *state = (my_struct*)PyModule_GetState(module);\n" +" if (state == NULL) {\n" +" return NULL;\n" +" }\n" +" // ... rest of logic\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:251 msgid "" "``PyModule_GetState`` may return ``NULL`` without setting an exception if " @@ -634,8 +687,8 @@ msgstr "" #: ../../howto/isolating-extensions.rst:342 msgid "" -"Please refer to the the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :" -"c:member:`~PyTypeObject.tp_traverse` for additional considerations." +"Please refer to the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :c:" +"member:`~PyTypeObject.tp_traverse` for additional considerations." msgstr "" "Por favor veja as documentações de :c:macro:`Py_TPFLAGS_HAVE_GC` e de :c:" "member:`~PyTypeObject.tp_traverse` para considerações adicionais." @@ -664,6 +717,17 @@ msgstr "" "3.9. Se você suporta Python 3.8 e anteriores, a função de travessia *não* " "deve visitar o tipo, de forma que ela precisa ser mais complicada::" +#: ../../howto/isolating-extensions.rst:358 +msgid "" +"static int my_traverse(PyObject *self, visitproc visit, void *arg)\n" +"{\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +" return 0;\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:366 msgid "" "Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a " @@ -704,11 +768,26 @@ msgstr "" msgid "For example, if your traverse function includes::" msgstr "Por exemplo, se a sua função de travessia incluir::" +#: ../../howto/isolating-extensions.rst:384 +msgid "base->tp_traverse(self, visit, arg)" +msgstr "" + #: ../../howto/isolating-extensions.rst:386 msgid "...and ``base`` may be a static type, then it should also include::" msgstr "" "...e ``base`` puder ser um tipo estático, então ela também precisa incluir::" +#: ../../howto/isolating-extensions.rst:388 +msgid "" +"if (base->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" +" // a heap type's tp_traverse already visited Py_TYPE(self)\n" +"} else {\n" +" if (Py_Version >= 0x03090000) {\n" +" Py_VISIT(Py_TYPE(self));\n" +" }\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:396 msgid "" "It is not necessary to handle the type's reference count in :c:member:" @@ -748,6 +827,18 @@ msgstr "" "Para que o tipo permaneça válido durante o ``tp_free``, o refcount do tipo " "precisa ser decrementado *depois* de a instância ser liberada. Por exemplo::" +#: ../../howto/isolating-extensions.rst:412 +msgid "" +"static void my_dealloc(PyObject *self)\n" +"{\n" +" PyObject_GC_UnTrack(self);\n" +" ...\n" +" PyTypeObject *type = Py_TYPE(self);\n" +" type->tp_free(self);\n" +" Py_DECREF(type);\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:421 msgid "" "The default ``tp_dealloc`` function does this, so if your type does *not* " @@ -790,6 +881,10 @@ msgstr "" "Se possível, chame o slot :c:member:`~PyTypeObject.tp_alloc` do tipo. Isto " "é, troque ``TYPE *o = PyObject_New(TYPE, typeobj)`` por::" +#: ../../howto/isolating-extensions.rst:444 +msgid "TYPE *o = typeobj->tp_alloc(typeobj, 0);" +msgstr "" + #: ../../howto/isolating-extensions.rst:446 msgid "" "Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use " @@ -807,6 +902,13 @@ msgstr "" "customizado), chame :c:func:`PyObject_GC_New` or :c:func:" "`PyObject_GC_NewVar`::" +#: ../../howto/isolating-extensions.rst:452 +msgid "" +"TYPE *o = PyObject_GC_New(TYPE, typeobj);\n" +"\n" +"TYPE *o = PyObject_GC_NewVar(TYPE, typeobj, size);" +msgstr "" + #: ../../howto/isolating-extensions.rst:458 msgid "Module State Access from Classes" msgstr "Acessando o estado do módulo a partir de classes" @@ -829,6 +931,14 @@ msgstr "" "Para evitar o tedioso código de tratamento de erros de sempre, você pode " "combinar essas duas etapas com o :c:func:`PyType_GetModuleState` assim::" +#: ../../howto/isolating-extensions.rst:467 +msgid "" +"my_struct *state = (my_struct*)PyType_GetModuleState(type);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:474 msgid "Module State Access from Regular Methods" msgstr "Acesso ao estado do módulo a partir de métodos regulares" @@ -874,6 +984,19 @@ msgstr "" "O código Python a seguir ilustra esse conceito. ``Base.get_defining_class`` " "retorna ``Base`` mesmo quando ``type(self) == Sub``:" +#: ../../howto/isolating-extensions.rst:494 +msgid "" +"class Base:\n" +" def get_type_of_self(self):\n" +" return type(self)\n" +"\n" +" def get_defining_class(self):\n" +" return __class__\n" +"\n" +"class Sub(Base):\n" +" pass" +msgstr "" + #: ../../howto/isolating-extensions.rst:506 msgid "" "For a method to get its \"defining class\", it must use the :ref:" @@ -886,6 +1009,16 @@ msgstr "" "| METH_KEYWORDS ` e a assinatura :c:" "type:`PyCMethod` correspondente:" +#: ../../howto/isolating-extensions.rst:511 +msgid "" +"PyObject *PyCMethod(\n" +" PyObject *self, // object the method was called on\n" +" PyTypeObject *defining_class, // defining class\n" +" PyObject *const *args, // C array of arguments\n" +" Py_ssize_t nargs, // length of \"args\"\n" +" PyObject *kwnames) // NULL, or dict of keyword arguments" +msgstr "" + #: ../../howto/isolating-extensions.rst:518 msgid "" "Once you have the defining class, call :c:func:`PyType_GetModuleState` to " @@ -898,6 +1031,33 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../howto/isolating-extensions.rst:523 +msgid "" +"static PyObject *\n" +"example_method(PyObject *self,\n" +" PyTypeObject *defining_class,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames)\n" +"{\n" +" my_struct *state = (my_struct*)PyType_GetModuleState(defining_class);\n" +" if (state == NULL) {\n" +" return NULL;\n" +" }\n" +" ... // rest of logic\n" +"}\n" +"\n" +"PyDoc_STRVAR(example_method_doc, \"...\");\n" +"\n" +"static PyMethodDef my_methods[] = {\n" +" {\"example_method\",\n" +" (PyCFunction)(void(*)(void))example_method,\n" +" METH_METHOD|METH_FASTCALL|METH_KEYWORDS,\n" +" example_method_doc}\n" +" {NULL},\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:549 msgid "Module State Access from Slot Methods, Getters and Setters" msgstr "Acesso ao estado do módulo a partir de métodos slot, getters e setters" @@ -932,6 +1092,15 @@ msgstr "" "`PyType_GetModuleByDef`, e passe a definição do módulo. Uma vez encontrado o " "módulo, chame :c:func:`PyModule_GetState` para obter o estado::" +#: ../../howto/isolating-extensions.rst:573 +msgid "" +"PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &module_def);\n" +"my_struct *state = (my_struct*)PyModule_GetState(module);\n" +"if (state == NULL) {\n" +" return NULL;\n" +"}" +msgstr "" + #: ../../howto/isolating-extensions.rst:579 msgid "" ":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index f1d403bf1..96e9c991d 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Katyanna Moura , 2021 -# Marco Rougeth , 2021 -# Hildeberto Abreu Magalhães , 2022 -# Claudio Rogerio Carvalho Filho , 2022 -# Rafael Fontenelle , 2023 -# Leandro Cavalcante Damascena , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Leandro Cavalcante Damascena , " -"2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -64,14 +58,94 @@ msgid "" "module::" msgstr "" +#: ../../howto/logging-cookbook.rst:26 +msgid "" +"import logging\n" +"import auxiliary_module\n" +"\n" +"# create logger with 'spam_application'\n" +"logger = logging.getLogger('spam_application')\n" +"logger.setLevel(logging.DEBUG)\n" +"# create file handler which logs even debug messages\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# create console handler with a higher log level\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# create formatter and add it to the handlers\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"fh.setFormatter(formatter)\n" +"ch.setFormatter(formatter)\n" +"# add the handlers to the logger\n" +"logger.addHandler(fh)\n" +"logger.addHandler(ch)\n" +"\n" +"logger.info('creating an instance of auxiliary_module.Auxiliary')\n" +"a = auxiliary_module.Auxiliary()\n" +"logger.info('created an instance of auxiliary_module.Auxiliary')\n" +"logger.info('calling auxiliary_module.Auxiliary.do_something')\n" +"a.do_something()\n" +"logger.info('finished auxiliary_module.Auxiliary.do_something')\n" +"logger.info('calling auxiliary_module.some_function()')\n" +"auxiliary_module.some_function()\n" +"logger.info('done with auxiliary_module.some_function()')" +msgstr "" + #: ../../howto/logging-cookbook.rst:56 msgid "Here is the auxiliary module::" msgstr "" +#: ../../howto/logging-cookbook.rst:58 +msgid "" +"import logging\n" +"\n" +"# create logger\n" +"module_logger = logging.getLogger('spam_application.auxiliary')\n" +"\n" +"class Auxiliary:\n" +" def __init__(self):\n" +" self.logger = logging.getLogger('spam_application.auxiliary." +"Auxiliary')\n" +" self.logger.info('creating an instance of Auxiliary')\n" +"\n" +" def do_something(self):\n" +" self.logger.info('doing something')\n" +" a = 1 + 1\n" +" self.logger.info('done doing something')\n" +"\n" +"def some_function():\n" +" module_logger.info('received a call to \"some_function\"')" +msgstr "" + #: ../../howto/logging-cookbook.rst:76 msgid "The output looks like this:" msgstr "O resultado deve ser algo assim:" +#: ../../howto/logging-cookbook.rst:78 +msgid "" +"2005-03-23 23:47:11,663 - spam_application - INFO -\n" +" creating an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -\n" +" creating an instance of Auxiliary\n" +"2005-03-23 23:47:11,665 - spam_application - INFO -\n" +" created an instance of auxiliary_module.Auxiliary\n" +"2005-03-23 23:47:11,668 - spam_application - INFO -\n" +" calling auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -\n" +" doing something\n" +"2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -\n" +" done doing something\n" +"2005-03-23 23:47:11,670 - spam_application - INFO -\n" +" finished auxiliary_module.Auxiliary.do_something\n" +"2005-03-23 23:47:11,671 - spam_application - INFO -\n" +" calling auxiliary_module.some_function()\n" +"2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -\n" +" received a call to 'some_function'\n" +"2005-03-23 23:47:11,673 - spam_application - INFO -\n" +" done with auxiliary_module.some_function()" +msgstr "" + #: ../../howto/logging-cookbook.rst:102 msgid "Logging from multiple threads" msgstr "" @@ -82,10 +156,61 @@ msgid "" "example shows logging from the main (initial) thread and another thread::" msgstr "" +#: ../../howto/logging-cookbook.rst:107 +msgid "" +"import logging\n" +"import threading\n" +"import time\n" +"\n" +"def worker(arg):\n" +" while not arg['stop']:\n" +" logging.debug('Hi from myfunc')\n" +" time.sleep(0.5)\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d " +"%(threadName)s %(message)s')\n" +" info = {'stop': False}\n" +" thread = threading.Thread(target=worker, args=(info,))\n" +" thread.start()\n" +" while True:\n" +" try:\n" +" logging.debug('Hello from main')\n" +" time.sleep(0.75)\n" +" except KeyboardInterrupt:\n" +" info['stop'] = True\n" +" break\n" +" thread.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:133 msgid "When run, the script should print something like the following:" msgstr "" +#: ../../howto/logging-cookbook.rst:135 +msgid "" +" 0 Thread-1 Hi from myfunc\n" +" 3 MainThread Hello from main\n" +" 505 Thread-1 Hi from myfunc\n" +" 755 MainThread Hello from main\n" +"1007 Thread-1 Hi from myfunc\n" +"1507 MainThread Hello from main\n" +"1508 Thread-1 Hi from myfunc\n" +"2010 Thread-1 Hi from myfunc\n" +"2258 MainThread Hello from main\n" +"2512 Thread-1 Hi from myfunc\n" +"3009 MainThread Hello from main\n" +"3013 Thread-1 Hi from myfunc\n" +"3515 Thread-1 Hi from myfunc\n" +"3761 MainThread Hello from main\n" +"4017 Thread-1 Hi from myfunc\n" +"4513 MainThread Hello from main\n" +"4518 Thread-1 Hi from myfunc" +msgstr "" + #: ../../howto/logging-cookbook.rst:155 msgid "" "This shows the logging output interspersed as one might expect. This " @@ -108,6 +233,35 @@ msgid "" "example::" msgstr "" +#: ../../howto/logging-cookbook.rst:169 +msgid "" +"import logging\n" +"\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"# create file handler which logs even debug messages\n" +"fh = logging.FileHandler('spam.log')\n" +"fh.setLevel(logging.DEBUG)\n" +"# create console handler with a higher log level\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.ERROR)\n" +"# create formatter and add it to the handlers\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"ch.setFormatter(formatter)\n" +"fh.setFormatter(formatter)\n" +"# add the handlers to logger\n" +"logger.addHandler(ch)\n" +"logger.addHandler(fh)\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" +msgstr "" + #: ../../howto/logging-cookbook.rst:194 msgid "" "Notice that the 'application' code does not care about multiple handlers. " @@ -140,14 +294,69 @@ msgid "" "console messages should not. Here's how you can achieve this::" msgstr "" +#: ../../howto/logging-cookbook.rst:216 +msgid "" +"import logging\n" +"\n" +"# set up logging to file - see previous section for more details\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)s %(name)-12s %(levelname)-8s " +"%(message)s',\n" +" datefmt='%m-%d %H:%M',\n" +" filename='/tmp/myapp.log',\n" +" filemode='w')\n" +"# define a Handler which writes INFO messages or higher to the sys.stderr\n" +"console = logging.StreamHandler()\n" +"console.setLevel(logging.INFO)\n" +"# set a format which is simpler for console use\n" +"formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')\n" +"# tell the handler to use this format\n" +"console.setFormatter(formatter)\n" +"# add the handler to the root logger\n" +"logging.getLogger('').addHandler(console)\n" +"\n" +"# Now, we can log to the root logger, or any other logger. First the " +"root...\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# Now, define a couple of other loggers which might represent areas in your\n" +"# application:\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" +msgstr "" + #: ../../howto/logging-cookbook.rst:248 msgid "When you run this, on the console you will see" msgstr "" +#: ../../howto/logging-cookbook.rst:250 +msgid "" +"root : INFO Jackdaws love my big sphinx of quartz.\n" +"myapp.area1 : INFO How quickly daft jumping zebras vex.\n" +"myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.\n" +"myapp.area2 : ERROR The five boxing wizards jump quickly." +msgstr "" + #: ../../howto/logging-cookbook.rst:257 msgid "and in the file you will see something like" msgstr "" +#: ../../howto/logging-cookbook.rst:259 +msgid "" +"10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.\n" +"10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +"10-22 22:19 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +"10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from " +"quack.\n" +"10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly." +msgstr "" + #: ../../howto/logging-cookbook.rst:267 msgid "" "As you can see, the DEBUG message only shows up in the file. The other " @@ -197,6 +406,47 @@ msgstr "" msgid "Suppose you configure logging with the following JSON:" msgstr "" +#: ../../howto/logging-cookbook.rst:295 +msgid "" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\"\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}" +msgstr "" + #: ../../howto/logging-cookbook.rst:335 msgid "" "This configuration does *almost* what we want, except that ``sys.stdout`` " @@ -206,16 +456,52 @@ msgid "" "adding a ``filters`` section parallel to ``formatters`` and ``handlers``:" msgstr "" +#: ../../howto/logging-cookbook.rst:341 +msgid "" +"{\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" }\n" +"}" +msgstr "" + #: ../../howto/logging-cookbook.rst:352 msgid "and changing the section on the ``stdout`` handler to add it:" msgstr "" +#: ../../howto/logging-cookbook.rst:354 +msgid "" +"{\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" }\n" +"}" +msgstr "" + #: ../../howto/logging-cookbook.rst:366 msgid "" "A filter is just a function, so we can define the ``filter_maker`` (a " "factory function) as follows:" msgstr "" +#: ../../howto/logging-cookbook.rst:369 +msgid "" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter" +msgstr "" + #: ../../howto/logging-cookbook.rst:379 msgid "" "This converts the string argument passed in to a numeric level, and returns " @@ -231,14 +517,110 @@ msgstr "" msgid "With the filter added, we can run ``main.py``, which in full is:" msgstr "" +#: ../../howto/logging-cookbook.rst:389 +msgid "" +"import json\n" +"import logging\n" +"import logging.config\n" +"\n" +"CONFIG = '''\n" +"{\n" +" \"version\": 1,\n" +" \"disable_existing_loggers\": false,\n" +" \"formatters\": {\n" +" \"simple\": {\n" +" \"format\": \"%(levelname)-8s - %(message)s\"\n" +" }\n" +" },\n" +" \"filters\": {\n" +" \"warnings_and_below\": {\n" +" \"()\" : \"__main__.filter_maker\",\n" +" \"level\": \"WARNING\"\n" +" }\n" +" },\n" +" \"handlers\": {\n" +" \"stdout\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"INFO\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stdout\",\n" +" \"filters\": [\"warnings_and_below\"]\n" +" },\n" +" \"stderr\": {\n" +" \"class\": \"logging.StreamHandler\",\n" +" \"level\": \"ERROR\",\n" +" \"formatter\": \"simple\",\n" +" \"stream\": \"ext://sys.stderr\"\n" +" },\n" +" \"file\": {\n" +" \"class\": \"logging.FileHandler\",\n" +" \"formatter\": \"simple\",\n" +" \"filename\": \"app.log\",\n" +" \"mode\": \"w\"\n" +" }\n" +" },\n" +" \"root\": {\n" +" \"level\": \"DEBUG\",\n" +" \"handlers\": [\n" +" \"stderr\",\n" +" \"stdout\",\n" +" \"file\"\n" +" ]\n" +" }\n" +"}\n" +"'''\n" +"\n" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter\n" +"\n" +"logging.config.dictConfig(json.loads(CONFIG))\n" +"logging.debug('A DEBUG message')\n" +"logging.info('An INFO message')\n" +"logging.warning('A WARNING message')\n" +"logging.error('An ERROR message')\n" +"logging.critical('A CRITICAL message')" +msgstr "" + #: ../../howto/logging-cookbook.rst:457 msgid "And after running it like this:" msgstr "" +#: ../../howto/logging-cookbook.rst:459 +msgid "python main.py 2>stderr.log >stdout.log" +msgstr "" + #: ../../howto/logging-cookbook.rst:463 msgid "We can see the results are as expected:" msgstr "" +#: ../../howto/logging-cookbook.rst:465 +msgid "" +"$ more *.log\n" +"::::::::::::::\n" +"app.log\n" +"::::::::::::::\n" +"DEBUG - A DEBUG message\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stderr.log\n" +"::::::::::::::\n" +"ERROR - An ERROR message\n" +"CRITICAL - A CRITICAL message\n" +"::::::::::::::\n" +"stdout.log\n" +"::::::::::::::\n" +"INFO - An INFO message\n" +"WARNING - A WARNING message" +msgstr "" + #: ../../howto/logging-cookbook.rst:489 msgid "Configuration server example" msgstr "" @@ -247,6 +629,38 @@ msgstr "" msgid "Here is an example of a module using the logging configuration server::" msgstr "" +#: ../../howto/logging-cookbook.rst:493 +msgid "" +"import logging\n" +"import logging.config\n" +"import time\n" +"import os\n" +"\n" +"# read initial config file\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# create and start listener on port 9999\n" +"t = logging.config.listen(9999)\n" +"t.start()\n" +"\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"try:\n" +" # loop through logging calls to see the difference\n" +" # new configurations make, until Ctrl+C is pressed\n" +" while True:\n" +" logger.debug('debug message')\n" +" logger.info('info message')\n" +" logger.warning('warn message')\n" +" logger.error('error message')\n" +" logger.critical('critical message')\n" +" time.sleep(5)\n" +"except KeyboardInterrupt:\n" +" # cleanup\n" +" logging.config.stopListening()\n" +" t.join()" +msgstr "" + #: ../../howto/logging-cookbook.rst:522 msgid "" "And here is a script that takes a filename and sends that file to the " @@ -254,6 +668,26 @@ msgid "" "configuration::" msgstr "" +#: ../../howto/logging-cookbook.rst:526 +msgid "" +"#!/usr/bin/env python\n" +"import socket, sys, struct\n" +"\n" +"with open(sys.argv[1], 'rb') as f:\n" +" data_to_send = f.read()\n" +"\n" +"HOST = 'localhost'\n" +"PORT = 9999\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"print('connecting...')\n" +"s.connect((HOST, PORT))\n" +"print('sending config...')\n" +"s.send(struct.pack('>L', len(data_to_send)))\n" +"s.send(data_to_send)\n" +"s.close()\n" +"print('complete')" +msgstr "" + #: ../../howto/logging-cookbook.rst:547 msgid "Dealing with handlers that block" msgstr "" @@ -314,10 +748,33 @@ msgstr "" msgid "An example of using these two classes follows (imports omitted)::" msgstr "" +#: ../../howto/logging-cookbook.rst:589 +msgid "" +"que = queue.Queue(-1) # no limit on size\n" +"queue_handler = QueueHandler(que)\n" +"handler = logging.StreamHandler()\n" +"listener = QueueListener(que, handler)\n" +"root = logging.getLogger()\n" +"root.addHandler(queue_handler)\n" +"formatter = logging.Formatter('%(threadName)s: %(message)s')\n" +"handler.setFormatter(formatter)\n" +"listener.start()\n" +"# The log output will display the thread which generated\n" +"# the event (the main thread) rather than the internal\n" +"# thread which monitors the internal queue. This is what\n" +"# you want to happen.\n" +"root.warning('Look out!')\n" +"listener.stop()" +msgstr "" + #: ../../howto/logging-cookbook.rst:605 msgid "which, when run, will produce:" msgstr "" +#: ../../howto/logging-cookbook.rst:607 +msgid "MainThread: Look out!" +msgstr "" + #: ../../howto/logging-cookbook.rst:611 msgid "" "Although the earlier discussion wasn't specifically talking about async " @@ -352,18 +809,147 @@ msgid "" "`SocketHandler` instance to the root logger at the sending end::" msgstr "" +#: ../../howto/logging-cookbook.rst:638 +msgid "" +"import logging, logging.handlers\n" +"\n" +"rootLogger = logging.getLogger('')\n" +"rootLogger.setLevel(logging.DEBUG)\n" +"socketHandler = logging.handlers.SocketHandler('localhost',\n" +" logging.handlers.DEFAULT_TCP_LOGGING_PORT)\n" +"# don't bother with a formatter, since a socket handler sends the event as\n" +"# an unformatted pickle\n" +"rootLogger.addHandler(socketHandler)\n" +"\n" +"# Now, we can log to the root logger, or any other logger. First the " +"root...\n" +"logging.info('Jackdaws love my big sphinx of quartz.')\n" +"\n" +"# Now, define a couple of other loggers which might represent areas in your\n" +"# application:\n" +"\n" +"logger1 = logging.getLogger('myapp.area1')\n" +"logger2 = logging.getLogger('myapp.area2')\n" +"\n" +"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" +"logger1.info('How quickly daft jumping zebras vex.')\n" +"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" +"logger2.error('The five boxing wizards jump quickly.')" +msgstr "" + #: ../../howto/logging-cookbook.rst:662 msgid "" "At the receiving end, you can set up a receiver using the :mod:" "`socketserver` module. Here is a basic working example::" msgstr "" +#: ../../howto/logging-cookbook.rst:665 +msgid "" +"import pickle\n" +"import logging\n" +"import logging.handlers\n" +"import socketserver\n" +"import struct\n" +"\n" +"\n" +"class LogRecordStreamHandler(socketserver.StreamRequestHandler):\n" +" \"\"\"Handler for a streaming logging request.\n" +"\n" +" This basically logs the record using whatever logging policy is\n" +" configured locally.\n" +" \"\"\"\n" +"\n" +" def handle(self):\n" +" \"\"\"\n" +" Handle multiple requests - each expected to be a 4-byte length,\n" +" followed by the LogRecord in pickle format. Logs the record\n" +" according to whatever policy is configured locally.\n" +" \"\"\"\n" +" while True:\n" +" chunk = self.connection.recv(4)\n" +" if len(chunk) < 4:\n" +" break\n" +" slen = struct.unpack('>L', chunk)[0]\n" +" chunk = self.connection.recv(slen)\n" +" while len(chunk) < slen:\n" +" chunk = chunk + self.connection.recv(slen - len(chunk))\n" +" obj = self.unPickle(chunk)\n" +" record = logging.makeLogRecord(obj)\n" +" self.handleLogRecord(record)\n" +"\n" +" def unPickle(self, data):\n" +" return pickle.loads(data)\n" +"\n" +" def handleLogRecord(self, record):\n" +" # if a name is specified, we use the named logger rather than the " +"one\n" +" # implied by the record.\n" +" if self.server.logname is not None:\n" +" name = self.server.logname\n" +" else:\n" +" name = record.name\n" +" logger = logging.getLogger(name)\n" +" # N.B. EVERY record gets logged. This is because Logger.handle\n" +" # is normally called AFTER logger-level filtering. If you want\n" +" # to do filtering, do it at the client end to save wasting\n" +" # cycles and network bandwidth!\n" +" logger.handle(record)\n" +"\n" +"class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):\n" +" \"\"\"\n" +" Simple TCP socket-based logging receiver suitable for testing.\n" +" \"\"\"\n" +"\n" +" allow_reuse_address = True\n" +"\n" +" def __init__(self, host='localhost',\n" +" port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,\n" +" handler=LogRecordStreamHandler):\n" +" socketserver.ThreadingTCPServer.__init__(self, (host, port), " +"handler)\n" +" self.abort = 0\n" +" self.timeout = 1\n" +" self.logname = None\n" +"\n" +" def serve_until_stopped(self):\n" +" import select\n" +" abort = 0\n" +" while not abort:\n" +" rd, wr, ex = select.select([self.socket.fileno()],\n" +" [], [],\n" +" self.timeout)\n" +" if rd:\n" +" self.handle_request()\n" +" abort = self.abort\n" +"\n" +"def main():\n" +" logging.basicConfig(\n" +" format='%(relativeCreated)5d %(name)-15s %(levelname)-8s " +"%(message)s')\n" +" tcpserver = LogRecordSocketReceiver()\n" +" print('About to start TCP server...')\n" +" tcpserver.serve_until_stopped()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:750 msgid "" "First run the server, and then the client. On the client side, nothing is " "printed on the console; on the server side, you should see something like:" msgstr "" +#: ../../howto/logging-cookbook.rst:753 +msgid "" +"About to start TCP server...\n" +" 59 root INFO Jackdaws love my big sphinx of quartz.\n" +" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" +" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" +" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" +" 69 myapp.area2 ERROR The five boxing wizards jump quickly." +msgstr "" + #: ../../howto/logging-cookbook.rst:762 msgid "" "Note that there are some security issues with pickle in some scenarios. If " @@ -566,6 +1152,17 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" +#: ../../howto/logging-cookbook.rst:878 +msgid "" +"def debug(self, msg, /, *args, **kwargs):\n" +" \"\"\"\n" +" Delegate a debug call to the underlying logger, after adding\n" +" contextual information from this adapter instance.\n" +" \"\"\"\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.debug(msg, *args, **kwargs)" +msgstr "" + #: ../../howto/logging-cookbook.rst:886 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " @@ -590,10 +1187,27 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" +#: ../../howto/logging-cookbook.rst:903 +msgid "" +"class CustomAdapter(logging.LoggerAdapter):\n" +" \"\"\"\n" +" This example adapter expects the passed in dict-like object to have a\n" +" 'connid' key, whose value in brackets is prepended to the log message.\n" +" \"\"\"\n" +" def process(self, msg, kwargs):\n" +" return '[%s] %s' % (self.extra['connid'], msg), kwargs" +msgstr "" + #: ../../howto/logging-cookbook.rst:911 msgid "which you can use like this::" msgstr "" +#: ../../howto/logging-cookbook.rst:913 +msgid "" +"logger = logging.getLogger(__name__)\n" +"adapter = CustomAdapter(logger, {'connid': some_conn_id})" +msgstr "" + #: ../../howto/logging-cookbook.rst:916 msgid "" "Then any events that you log to the adapter will have the value of " @@ -638,10 +1252,81 @@ msgid "" "an example script::" msgstr "" +#: ../../howto/logging-cookbook.rst:947 +msgid "" +"import logging\n" +"from random import choice\n" +"\n" +"class ContextFilter(logging.Filter):\n" +" \"\"\"\n" +" This is a filter which injects contextual information into the log.\n" +"\n" +" Rather than use actual contextual information, we just use random\n" +" data in this demo.\n" +" \"\"\"\n" +"\n" +" USERS = ['jim', 'fred', 'sheila']\n" +" IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']\n" +"\n" +" def filter(self, record):\n" +"\n" +" record.ip = choice(ContextFilter.IPS)\n" +" record.user = choice(ContextFilter.USERS)\n" +" return True\n" +"\n" +"if __name__ == '__main__':\n" +" levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, " +"logging.CRITICAL)\n" +" logging.basicConfig(level=logging.DEBUG,\n" +" format='%(asctime)-15s %(name)-5s %(levelname)-8s " +"IP: %(ip)-15s User: %(user)-8s %(message)s')\n" +" a1 = logging.getLogger('a.b.c')\n" +" a2 = logging.getLogger('d.e.f')\n" +"\n" +" f = ContextFilter()\n" +" a1.addFilter(f)\n" +" a2.addFilter(f)\n" +" a1.debug('A debug message')\n" +" a1.info('An info message with %s', 'some parameters')\n" +" for x in range(10):\n" +" lvl = choice(levels)\n" +" lvlname = logging.getLevelName(lvl)\n" +" a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, " +"'parameters')" +msgstr "" + #: ../../howto/logging-cookbook.rst:984 msgid "which, when run, produces something like:" msgstr "" +#: ../../howto/logging-cookbook.rst:986 +msgid "" +"2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A " +"debug message\n" +"2010-09-06 22:38:15,300 a.b.c INFO IP: 192.168.0.1 User: sheila An " +"info message with some parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 127.0.0.1 User: jim A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 127.0.0.1 User: sheila A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f ERROR IP: 123.231.231.123 User: fred A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1 User: jim A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " +"message at CRITICAL level with 2 parameters\n" +"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 192.168.0.1 User: jim A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f ERROR IP: 127.0.0.1 User: sheila A " +"message at ERROR level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A " +"message at DEBUG level with 2 parameters\n" +"2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A " +"message at INFO level with 2 parameters" +msgstr "" + #: ../../howto/logging-cookbook.rst:1002 msgid "Use of ``contextvars``" msgstr "" @@ -671,6 +1356,21 @@ msgstr "" msgid "Let's assume that the library can be simulated by the following code:" msgstr "" +#: ../../howto/logging-cookbook.rst:1019 +msgid "" +"# webapplib.py\n" +"import logging\n" +"import time\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def useful():\n" +" # Just a representative event logged from the library\n" +" logger.debug('Hello from webapplib!')\n" +" # Just sleep for a bit so other threads get to run\n" +" time.sleep(0.01)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1033 msgid "" "We can simulate the multiple web applications by means of two simple " @@ -678,6 +1378,161 @@ msgid "" "applications work - each request is handled by a thread:" msgstr "" +#: ../../howto/logging-cookbook.rst:1037 +msgid "" +"# main.py\n" +"import argparse\n" +"from contextvars import ContextVar\n" +"import logging\n" +"import os\n" +"from random import choice\n" +"import threading\n" +"import webapplib\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"root = logging.getLogger()\n" +"root.setLevel(logging.DEBUG)\n" +"\n" +"class Request:\n" +" \"\"\"\n" +" A simple dummy request class which just holds dummy HTTP request " +"method,\n" +" client IP address and client username\n" +" \"\"\"\n" +" def __init__(self, method, ip, user):\n" +" self.method = method\n" +" self.ip = ip\n" +" self.user = user\n" +"\n" +"# A dummy set of requests which will be used in the simulation - we'll just " +"pick\n" +"# from this list randomly. Note that all GET requests are from 192.168.2." +"XXX\n" +"# addresses, whereas POST requests are from 192.16.3.XXX addresses. Three " +"users\n" +"# are represented in the sample requests.\n" +"\n" +"REQUESTS = [\n" +" Request('GET', '192.168.2.20', 'jim'),\n" +" Request('POST', '192.168.3.20', 'fred'),\n" +" Request('GET', '192.168.2.21', 'sheila'),\n" +" Request('POST', '192.168.3.21', 'jim'),\n" +" Request('GET', '192.168.2.22', 'fred'),\n" +" Request('POST', '192.168.3.22', 'sheila'),\n" +"]\n" +"\n" +"# Note that the format string includes references to request context " +"information\n" +"# such as HTTP method, client IP and username\n" +"\n" +"formatter = logging.Formatter('%(threadName)-11s %(appName)s %(name)-9s " +"%(user)-6s %(ip)s %(method)-4s %(message)s')\n" +"\n" +"# Create our context variables. These will be filled at the start of " +"request\n" +"# processing, and used in the logging that happens during that processing\n" +"\n" +"ctx_request = ContextVar('request')\n" +"ctx_appname = ContextVar('appname')\n" +"\n" +"class InjectingFilter(logging.Filter):\n" +" \"\"\"\n" +" A filter which injects context-specific information into logs and " +"ensures\n" +" that only information for a specific webapp is included in its log\n" +" \"\"\"\n" +" def __init__(self, app):\n" +" self.app = app\n" +"\n" +" def filter(self, record):\n" +" request = ctx_request.get()\n" +" record.method = request.method\n" +" record.ip = request.ip\n" +" record.user = request.user\n" +" record.appName = appName = ctx_appname.get()\n" +" return appName == self.app.name\n" +"\n" +"class WebApp:\n" +" \"\"\"\n" +" A dummy web application class which has its own handler and filter for " +"a\n" +" webapp-specific log.\n" +" \"\"\"\n" +" def __init__(self, name):\n" +" self.name = name\n" +" handler = logging.FileHandler(name + '.log', 'w')\n" +" f = InjectingFilter(self)\n" +" handler.setFormatter(formatter)\n" +" handler.addFilter(f)\n" +" root.addHandler(handler)\n" +" self.num_requests = 0\n" +"\n" +" def process_request(self, request):\n" +" \"\"\"\n" +" This is the dummy method for processing a request. It's called on a\n" +" different thread for every request. We store the context information " +"into\n" +" the context vars before doing anything else.\n" +" \"\"\"\n" +" ctx_request.set(request)\n" +" ctx_appname.set(self.name)\n" +" self.num_requests += 1\n" +" logger.debug('Request processing started')\n" +" webapplib.useful()\n" +" logger.debug('Request processing finished')\n" +"\n" +"def main():\n" +" fn = os.path.splitext(os.path.basename(__file__))[0]\n" +" adhf = argparse.ArgumentDefaultsHelpFormatter\n" +" ap = argparse.ArgumentParser(formatter_class=adhf, prog=fn,\n" +" description='Simulate a couple of web '\n" +" 'applications handling some '\n" +" 'requests, showing how request " +"'\n" +" 'context can be used to '\n" +" 'populate logs')\n" +" aa = ap.add_argument\n" +" aa('--count', '-c', type=int, default=100, help='How many requests to " +"simulate')\n" +" options = ap.parse_args()\n" +"\n" +" # Create the dummy webapps and put them in a list which we can use to " +"select\n" +" # from randomly\n" +" app1 = WebApp('app1')\n" +" app2 = WebApp('app2')\n" +" apps = [app1, app2]\n" +" threads = []\n" +" # Add a common handler which will capture all events\n" +" handler = logging.FileHandler('app.log', 'w')\n" +" handler.setFormatter(formatter)\n" +" root.addHandler(handler)\n" +"\n" +" # Generate calls to process requests\n" +" for i in range(options.count):\n" +" try:\n" +" # Pick an app at random and a request for it to process\n" +" app = choice(apps)\n" +" request = choice(REQUESTS)\n" +" # Process the request in its own thread\n" +" t = threading.Thread(target=app.process_request, " +"args=(request,))\n" +" threads.append(t)\n" +" t.start()\n" +" except KeyboardInterrupt:\n" +" break\n" +"\n" +" # Wait for the threads to terminate\n" +" for t in threads:\n" +" t.join()\n" +"\n" +" for app in apps:\n" +" print('%s processed %s requests' % (app.name, app.num_requests))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:1177 msgid "" "If you run the above, you should find that roughly half the requests go " @@ -689,6 +1544,61 @@ msgid "" "illustrated by the following shell output:" msgstr "" +#: ../../howto/logging-cookbook.rst:1184 +msgid "" +"~/logging-contextual-webapp$ python main.py\n" +"app1 processed 51 requests\n" +"app2 processed 49 requests\n" +"~/logging-contextual-webapp$ wc -l *.log\n" +" 153 app1.log\n" +" 147 app2.log\n" +" 300 app.log\n" +" 600 total\n" +"~/logging-contextual-webapp$ head -3 app1.log\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " +"from webapplib!\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"~/logging-contextual-webapp$ head -3 app2.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " +"processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " +"from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " +"processing started\n" +"~/logging-contextual-webapp$ head app.log\n" +"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " +"processing started\n" +"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " +"from webapplib!\n" +"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " +"processing started\n" +"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-2 (process_request) app2 webapplib jim 192.168.2.20 GET Hello " +"from webapplib!\n" +"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " +"from webapplib!\n" +"Thread-4 (process_request) app2 __main__ fred 192.168.2.22 GET Request " +"processing started\n" +"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"Thread-4 (process_request) app2 webapplib fred 192.168.2.22 GET Hello " +"from webapplib!\n" +"Thread-6 (process_request) app1 __main__ jim 192.168.3.21 POST Request " +"processing started\n" +"~/logging-contextual-webapp$ grep app1 app1.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app2.log | wc -l\n" +"147\n" +"~/logging-contextual-webapp$ grep app1 app.log | wc -l\n" +"153\n" +"~/logging-contextual-webapp$ grep app2 app.log | wc -l\n" +"147" +msgstr "" + #: ../../howto/logging-cookbook.rst:1224 msgid "Imparting contextual information in handlers" msgstr "" @@ -701,6 +1611,28 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" +#: ../../howto/logging-cookbook.rst:1231 +msgid "" +"import copy\n" +"import logging\n" +"\n" +"def filter(record: logging.LogRecord):\n" +" record = copy.copy(record)\n" +" record.user = 'jim'\n" +" return record\n" +"\n" +"if __name__ == '__main__':\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.INFO)\n" +" handler = logging.StreamHandler()\n" +" formatter = logging.Formatter('%(message)s from %(user)-8s')\n" +" handler.setFormatter(formatter)\n" +" handler.addFilter(filter)\n" +" logger.addHandler(handler)\n" +"\n" +" logger.info('A log message')" +msgstr "" + #: ../../howto/logging-cookbook.rst:1253 msgid "Logging to a single file from multiple processes" msgstr "" @@ -747,12 +1679,229 @@ msgid "" "requirements::" msgstr "" +#: ../../howto/logging-cookbook.rst:1289 +msgid "" +"# You'll need these imports in your own code\n" +"import logging\n" +"import logging.handlers\n" +"import multiprocessing\n" +"\n" +"# Next two import lines for this demo only\n" +"from random import choice, random\n" +"import time\n" +"\n" +"#\n" +"# Because you'll want to define the logging configurations for listener and " +"workers, the\n" +"# listener and worker process functions take a configurer parameter which is " +"a callable\n" +"# for configuring logging for that process. These functions are also passed " +"the queue,\n" +"# which they use for communication.\n" +"#\n" +"# In practice, you can configure the listener however you want, but note " +"that in this\n" +"# simple example, the listener does not apply level or filter logic to " +"received records.\n" +"# In practice, you would probably want to do this logic in the worker " +"processes, to avoid\n" +"# sending events which would be filtered out between processes.\n" +"#\n" +"# The size of the rotated files is made small so you can see the results " +"easily.\n" +"def listener_configurer():\n" +" root = logging.getLogger()\n" +" h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)\n" +" f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s " +"%(levelname)-8s %(message)s')\n" +" h.setFormatter(f)\n" +" root.addHandler(h)\n" +"\n" +"# This is the listener process top-level loop: wait for logging events\n" +"# (LogRecords)on the queue and handle them, quit when you get a None for a\n" +"# LogRecord.\n" +"def listener_process(queue, configurer):\n" +" configurer()\n" +" while True:\n" +" try:\n" +" record = queue.get()\n" +" if record is None: # We send this as a sentinel to tell the " +"listener to quit.\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record) # No level or filter logic applied - just " +"do it!\n" +" except Exception:\n" +" import sys, traceback\n" +" print('Whoops! Problem:', file=sys.stderr)\n" +" traceback.print_exc(file=sys.stderr)\n" +"\n" +"# Arrays used for random selections in this demo\n" +"\n" +"LEVELS = [logging.DEBUG, logging.INFO, logging.WARNING,\n" +" logging.ERROR, logging.CRITICAL]\n" +"\n" +"LOGGERS = ['a.b.c', 'd.e.f']\n" +"\n" +"MESSAGES = [\n" +" 'Random message #1',\n" +" 'Random message #2',\n" +" 'Random message #3',\n" +"]\n" +"\n" +"# The worker configuration is done at the start of the worker process run.\n" +"# Note that on Windows you can't rely on fork semantics, so each process\n" +"# will run the logging configuration code when it starts.\n" +"def worker_configurer(queue):\n" +" h = logging.handlers.QueueHandler(queue) # Just the one handler needed\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # send all messages, for demo; no other level or filter logic applied.\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"# This is the worker process top-level loop, which just logs ten events " +"with\n" +"# random intervening delays before terminating.\n" +"# The print messages are just so you know it's doing something!\n" +"def worker_process(queue, configurer):\n" +" configurer(queue)\n" +" name = multiprocessing.current_process().name\n" +" print('Worker started: %s' % name)\n" +" for i in range(10):\n" +" time.sleep(random())\n" +" logger = logging.getLogger(choice(LOGGERS))\n" +" level = choice(LEVELS)\n" +" message = choice(MESSAGES)\n" +" logger.log(level, message)\n" +" print('Worker finished: %s' % name)\n" +"\n" +"# Here's where the demo gets orchestrated. Create the queue, create and " +"start\n" +"# the listener, create ten workers and start them, wait for them to finish,\n" +"# then send a None to the queue to tell the listener to finish.\n" +"def main():\n" +" queue = multiprocessing.Queue(-1)\n" +" listener = multiprocessing.Process(target=listener_process,\n" +" args=(queue, listener_configurer))\n" +" listener.start()\n" +" workers = []\n" +" for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +" for w in workers:\n" +" w.join()\n" +" queue.put_nowait(None)\n" +" listener.join()\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:1394 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" +#: ../../howto/logging-cookbook.rst:1397 +msgid "" +"import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue\n" +"import random\n" +"import threading\n" +"import time\n" +"\n" +"def logger_thread(q):\n" +" while True:\n" +" record = q.get()\n" +" if record is None:\n" +" break\n" +" logger = logging.getLogger(record.name)\n" +" logger.handle(record)\n" +"\n" +"\n" +"def worker_process(q):\n" +" qh = logging.handlers.QueueHandler(q)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(qh)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" +"\n" +"if __name__ == '__main__':\n" +" q = Queue()\n" +" d = {\n" +" 'version': 1,\n" +" 'formatters': {\n" +" 'detailed': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " +"%(processName)-10s %(message)s'\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'level': 'INFO',\n" +" },\n" +" 'file': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'foofile': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-foo.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" },\n" +" 'errors': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-errors.log',\n" +" 'mode': 'w',\n" +" 'level': 'ERROR',\n" +" 'formatter': 'detailed',\n" +" },\n" +" },\n" +" 'loggers': {\n" +" 'foo': {\n" +" 'handlers': ['foofile']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console', 'file', 'errors']\n" +" },\n" +" }\n" +" workers = []\n" +" for i in range(5):\n" +" wp = Process(target=worker_process, name='worker %d' % (i + 1), " +"args=(q,))\n" +" workers.append(wp)\n" +" wp.start()\n" +" logging.config.dictConfig(d)\n" +" lp = threading.Thread(target=logger_thread, args=(q,))\n" +" lp.start()\n" +" # At this point, the main process could do some useful work of its own\n" +" # Once it's done that, it can wait for the workers to terminate...\n" +" for wp in workers:\n" +" wp.join()\n" +" # And now tell the logging thread to finish up, too\n" +" q.put(None)\n" +" lp.join()" +msgstr "" + #: ../../howto/logging-cookbook.rst:1489 msgid "" "This variant shows how you can e.g. apply configuration for particular " @@ -774,18 +1923,47 @@ msgid "" "Instead of" msgstr "" +#: ../../howto/logging-cookbook.rst:1502 +msgid "queue = multiprocessing.Queue(-1)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1506 msgid "you should use" msgstr "" +#: ../../howto/logging-cookbook.rst:1508 +msgid "" +"queue = multiprocessing.Manager().Queue(-1) # also works with the examples " +"above" +msgstr "" + #: ../../howto/logging-cookbook.rst:1512 msgid "and you can then replace the worker creation from this::" msgstr "" +#: ../../howto/logging-cookbook.rst:1514 +msgid "" +"workers = []\n" +"for i in range(10):\n" +" worker = multiprocessing.Process(target=worker_process,\n" +" args=(queue, worker_configurer))\n" +" workers.append(worker)\n" +" worker.start()\n" +"for w in workers:\n" +" w.join()" +msgstr "" + #: ../../howto/logging-cookbook.rst:1523 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" +#: ../../howto/logging-cookbook.rst:1525 +msgid "" +"with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" +" for i in range(10):\n" +" executor.submit(worker_process, queue, worker_configurer)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1530 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" @@ -815,12 +1993,51 @@ msgid "" "usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" +#: ../../howto/logging-cookbook.rst:1553 +msgid "" +"import glob\n" +"import logging\n" +"import logging.handlers\n" +"\n" +"LOG_FILENAME = 'logging_rotatingfile_example.out'\n" +"\n" +"# Set up a specific logger with our desired output level\n" +"my_logger = logging.getLogger('MyLogger')\n" +"my_logger.setLevel(logging.DEBUG)\n" +"\n" +"# Add the log message handler to the logger\n" +"handler = logging.handlers.RotatingFileHandler(\n" +" LOG_FILENAME, maxBytes=20, backupCount=5)\n" +"\n" +"my_logger.addHandler(handler)\n" +"\n" +"# Log some messages\n" +"for i in range(20):\n" +" my_logger.debug('i = %d' % i)\n" +"\n" +"# See what files are created\n" +"logfiles = glob.glob('%s*' % LOG_FILENAME)\n" +"\n" +"for filename in logfiles:\n" +" print(filename)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1579 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" +#: ../../howto/logging-cookbook.rst:1582 +msgid "" +"logging_rotatingfile_example.out\n" +"logging_rotatingfile_example.out.1\n" +"logging_rotatingfile_example.out.2\n" +"logging_rotatingfile_example.out.3\n" +"logging_rotatingfile_example.out.4\n" +"logging_rotatingfile_example.out.5" +msgstr "" + #: ../../howto/logging-cookbook.rst:1591 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " @@ -861,6 +2078,31 @@ msgid "" "session to show the possibilities:" msgstr "" +#: ../../howto/logging-cookbook.rst:1622 +msgid "" +">>> import logging\n" +">>> root = logging.getLogger()\n" +">>> root.setLevel(logging.DEBUG)\n" +">>> handler = logging.StreamHandler()\n" +">>> bf = logging.Formatter('{asctime} {name} {levelname:8s} {message}',\n" +"... style='{')\n" +">>> handler.setFormatter(bf)\n" +">>> root.addHandler(handler)\n" +">>> logger = logging.getLogger('foo.bar')\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:11:55,341 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:12:11,526 foo.bar CRITICAL This is a CRITICAL message\n" +">>> df = logging.Formatter('$asctime $name ${levelname} $message',\n" +"... style='$')\n" +">>> handler.setFormatter(df)\n" +">>> logger.debug('This is a DEBUG message')\n" +"2010-10-28 15:13:06,924 foo.bar DEBUG This is a DEBUG message\n" +">>> logger.critical('This is a CRITICAL message')\n" +"2010-10-28 15:13:11,494 foo.bar CRITICAL This is a CRITICAL message\n" +">>>" +msgstr "" + #: ../../howto/logging-cookbook.rst:1646 msgid "" "Note that the formatting of logging messages for final output to logs is " @@ -868,6 +2110,13 @@ msgid "" "That can still use %-formatting, as shown here::" msgstr "" +#: ../../howto/logging-cookbook.rst:1650 +msgid "" +">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" +"2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" +">>>" +msgstr "" + #: ../../howto/logging-cookbook.rst:1654 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " @@ -893,6 +2142,27 @@ msgid "" "the following two classes::" msgstr "" +#: ../../howto/logging-cookbook.rst:1673 ../../howto/logging-cookbook.rst:2761 +msgid "" +"class BraceMessage:\n" +" def __init__(self, fmt, /, *args, **kwargs):\n" +" self.fmt = fmt\n" +" self.args = args\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args, **self.kwargs)\n" +"\n" +"class DollarMessage:\n" +" def __init__(self, fmt, /, **kwargs):\n" +" self.fmt = fmt\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" from string import Template\n" +" return Template(self.fmt).substitute(**self.kwargs)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1691 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" @@ -911,6 +2181,25 @@ msgid "" "that they're declared in a module called ``wherever``):" msgstr "" +#: ../../howto/logging-cookbook.rst:1703 +msgid "" +">>> from wherever import BraceMessage as __\n" +">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})',\n" +"... point=p))\n" +"Message with coordinates: (0.50, 0.50)\n" +">>> from wherever import DollarMessage as __\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" +msgstr "" + #: ../../howto/logging-cookbook.rst:1721 msgid "" "While the above examples use ``print()`` to show how the formatting works, " @@ -935,6 +2224,35 @@ msgid "" "effect to the above, as in the following example::" msgstr "" +#: ../../howto/logging-cookbook.rst:1736 +msgid "" +"import logging\n" +"\n" +"class Message:\n" +" def __init__(self, fmt, args):\n" +" self.fmt = fmt\n" +" self.args = args\n" +"\n" +" def __str__(self):\n" +" return self.fmt.format(*self.args)\n" +"\n" +"class StyleAdapter(logging.LoggerAdapter):\n" +" def log(self, level, msg, /, *args, stacklevel=1, **kwargs):\n" +" if self.isEnabledFor(level):\n" +" msg, kwargs = self.process(msg, kwargs)\n" +" self.logger.log(level, Message(msg, args), **kwargs,\n" +" stacklevel=stacklevel+1)\n" +"\n" +"logger = StyleAdapter(logging.getLogger(__name__))\n" +"\n" +"def main():\n" +" logger.debug('Hello, {}', 'world!')\n" +"\n" +"if __name__ == '__main__':\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:1762 msgid "" "The above script should log the message ``Hello, world!`` when run with " @@ -1008,6 +2326,10 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" +#: ../../howto/logging-cookbook.rst:1810 +msgid "logger = logging.getLogger(__name__)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1812 msgid "" "at module level). It's probably one too many things to think about. " @@ -1036,6 +2358,18 @@ msgid "" "this::" msgstr "" +#: ../../howto/logging-cookbook.rst:1829 +msgid "" +"old_factory = logging.getLogRecordFactory()\n" +"\n" +"def record_factory(*args, **kwargs):\n" +" record = old_factory(*args, **kwargs)\n" +" record.custom_attribute = 0xdecafbad\n" +" return record\n" +"\n" +"logging.setLogRecordFactory(record_factory)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1838 msgid "" "This pattern allows different libraries to chain factories together, and as " @@ -1061,12 +2395,45 @@ msgid "" "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" +#: ../../howto/logging-cookbook.rst:1859 +msgid "" +"import zmq # using pyzmq, the Python binding for ZeroMQ\n" +"import json # for serializing records portably\n" +"\n" +"ctx = zmq.Context()\n" +"sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value\n" +"sock.bind('tcp://*:5556') # or wherever\n" +"\n" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +"\n" +"handler = ZeroMQSocketHandler(sock)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1874 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" +#: ../../howto/logging-cookbook.rst:1877 +msgid "" +"class ZeroMQSocketHandler(QueueHandler):\n" +" def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" +" self.ctx = ctx or zmq.Context()\n" +" socket = zmq.Socket(self.ctx, socktype)\n" +" socket.bind(uri)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" self.queue.send_json(record.__dict__)\n" +"\n" +" def close(self):\n" +" self.queue.close()" +msgstr "" + #: ../../howto/logging-cookbook.rst:1892 ../../howto/logging-cookbook.rst:1922 msgid "Subclass ``QueueListener``" msgstr "" @@ -1077,6 +2444,22 @@ msgid "" "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" +#: ../../howto/logging-cookbook.rst:1897 +msgid "" +"class ZeroMQSocketListener(QueueListener):\n" +" def __init__(self, uri, /, *handlers, **kwargs):\n" +" self.ctx = kwargs.get('ctx') or zmq.Context()\n" +" socket = zmq.Socket(self.ctx, zmq.SUB)\n" +" socket.setsockopt_string(zmq.SUBSCRIBE, '') # subscribe to " +"everything\n" +" socket.connect(uri)\n" +" super().__init__(socket, *handlers, **kwargs)\n" +"\n" +" def dequeue(self):\n" +" msg = self.queue.recv_json()\n" +" return logging.makeLogRecord(msg)" +msgstr "" + #: ../../howto/logging-cookbook.rst:1912 msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" msgstr "" @@ -1090,6 +2473,117 @@ msgid "" "``pynng`` installed. Just for variety, we present the listener first." msgstr "" +#: ../../howto/logging-cookbook.rst:1924 +msgid "" +"# listener.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"interrupted = False\n" +"\n" +"class NNGSocketListener(logging.handlers.QueueListener):\n" +"\n" +" def __init__(self, uri, /, *handlers, **kwargs):\n" +" # Have a timeout for interruptability, and open a\n" +" # subscriber socket\n" +" socket = pynng.Sub0(listen=uri, recv_timeout=500)\n" +" # The b'' subscription matches all topics\n" +" topics = kwargs.pop('topics', None) or b''\n" +" socket.subscribe(topics)\n" +" # We treat the socket as a queue\n" +" super().__init__(socket, *handlers, **kwargs)\n" +"\n" +" def dequeue(self, block):\n" +" data = None\n" +" # Keep looping while not interrupted and no data received over the\n" +" # socket\n" +" while not interrupted:\n" +" try:\n" +" data = self.queue.recv(block=block)\n" +" break\n" +" except pynng.Timeout:\n" +" pass\n" +" except pynng.Closed: # sometimes happens when you hit Ctrl-C\n" +" break\n" +" if data is None:\n" +" return None\n" +" # Get the logging event sent from a publisher\n" +" event = json.loads(data.decode('utf-8'))\n" +" return logging.makeLogRecord(event)\n" +"\n" +" def enqueue_sentinel(self):\n" +" # Not used in this implementation, as the socket isn't really a\n" +" # queue\n" +" pass\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"listener = NNGSocketListener(DEFAULT_ADDR, logging.StreamHandler(), " +"topics=b'')\n" +"listener.start()\n" +"print('Press Ctrl-C to stop.')\n" +"try:\n" +" while True:\n" +" pass\n" +"except KeyboardInterrupt:\n" +" interrupted = True\n" +"finally:\n" +" listener.stop()" +msgstr "" + +#: ../../howto/logging-cookbook.rst:1990 +msgid "" +"# sender.py\n" +"import json\n" +"import logging\n" +"import logging.handlers\n" +"import time\n" +"import random\n" +"\n" +"import pynng\n" +"\n" +"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" +"\n" +"class NNGSocketHandler(logging.handlers.QueueHandler):\n" +"\n" +" def __init__(self, uri):\n" +" socket = pynng.Pub0(dial=uri, send_timeout=500)\n" +" super().__init__(socket)\n" +"\n" +" def enqueue(self, record):\n" +" # Send the record as UTF-8 encoded JSON\n" +" d = dict(record.__dict__)\n" +" data = json.dumps(d)\n" +" self.queue.send(data.encode('utf-8'))\n" +"\n" +" def close(self):\n" +" self.queue.close()\n" +"\n" +"logging.getLogger('pynng').propagate = False\n" +"handler = NNGSocketHandler(DEFAULT_ADDR)\n" +"# Make sure the process ID is in the output\n" +"logging.basicConfig(level=logging.DEBUG,\n" +" handlers=[logging.StreamHandler(), handler],\n" +" format='%(levelname)-8s %(name)10s %(process)6s " +"%(message)s')\n" +"levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"logger_names = ('myapp', 'myapp.lib1', 'myapp.lib2')\n" +"msgno = 1\n" +"while True:\n" +" # Just randomly select some loggers and levels and log away\n" +" level = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(logger_names))\n" +" logger.log(level, 'Message no. %5d' % msgno)\n" +" msgno += 1\n" +" delay = random.random() * 2 + 0.5\n" +" time.sleep(delay)" +msgstr "" + #: ../../howto/logging-cookbook.rst:2037 msgid "" "You can run the above two snippets in separate command shells. If we run the " @@ -1097,14 +2591,65 @@ msgid "" "see something like the following. In the first sender shell:" msgstr "" +#: ../../howto/logging-cookbook.rst:2041 +msgid "" +"$ python sender.py\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"(and so on)" +msgstr "" + #: ../../howto/logging-cookbook.rst:2054 msgid "In the second sender shell:" msgstr "" +#: ../../howto/logging-cookbook.rst:2056 +msgid "" +"$ python sender.py\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(and so on)" +msgstr "" + #: ../../howto/logging-cookbook.rst:2069 msgid "In the listener shell:" msgstr "" +#: ../../howto/logging-cookbook.rst:2071 +msgid "" +"$ python listener.py\n" +"Press Ctrl-C to stop.\n" +"DEBUG myapp 613 Message no. 1\n" +"WARNING myapp.lib2 613 Message no. 2\n" +"INFO myapp.lib2 657 Message no. 1\n" +"CRITICAL myapp.lib2 613 Message no. 3\n" +"CRITICAL myapp.lib2 657 Message no. 2\n" +"CRITICAL myapp 657 Message no. 3\n" +"WARNING myapp.lib2 613 Message no. 4\n" +"CRITICAL myapp.lib1 613 Message no. 5\n" +"CRITICAL myapp.lib1 657 Message no. 4\n" +"INFO myapp.lib1 657 Message no. 5\n" +"DEBUG myapp 613 Message no. 6\n" +"WARNING myapp.lib2 657 Message no. 6\n" +"CRITICAL myapp 657 Message no. 7\n" +"CRITICAL myapp.lib1 613 Message no. 7\n" +"INFO myapp.lib1 613 Message no. 8\n" +"DEBUG myapp.lib1 657 Message no. 8\n" +"(and so on)" +msgstr "" + #: ../../howto/logging-cookbook.rst:2093 msgid "" "As you can see, the logging from the two sender processes is interleaved in " @@ -1123,6 +2668,59 @@ msgid "" "func:`~config.dictConfig` to put the configuration into effect::" msgstr "" +#: ../../howto/logging-cookbook.rst:2104 +msgid "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'verbose': {\n" +" 'format': '{levelname} {asctime} {module} {process:d} {thread:d} " +"{message}',\n" +" 'style': '{',\n" +" },\n" +" 'simple': {\n" +" 'format': '{levelname} {message}',\n" +" 'style': '{',\n" +" },\n" +" },\n" +" 'filters': {\n" +" 'special': {\n" +" '()': 'project.logging.SpecialFilter',\n" +" 'foo': 'bar',\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'level': 'INFO',\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'simple',\n" +" },\n" +" 'mail_admins': {\n" +" 'level': 'ERROR',\n" +" 'class': 'django.utils.log.AdminEmailHandler',\n" +" 'filters': ['special']\n" +" }\n" +" },\n" +" 'loggers': {\n" +" 'django': {\n" +" 'handlers': ['console'],\n" +" 'propagate': True,\n" +" },\n" +" 'django.request': {\n" +" 'handlers': ['mail_admins'],\n" +" 'level': 'ERROR',\n" +" 'propagate': False,\n" +" },\n" +" 'myproject.custom': {\n" +" 'handlers': ['console', 'mail_admins'],\n" +" 'level': 'INFO',\n" +" 'filters': ['special']\n" +" }\n" +" }\n" +"}" +msgstr "" + #: ../../howto/logging-cookbook.rst:2153 msgid "" "For more information about this configuration, you can see the `relevant " @@ -1140,11 +2738,54 @@ msgid "" "following runnable script, which shows gzip compression of the log file::" msgstr "" +#: ../../howto/logging-cookbook.rst:2165 +msgid "" +"import gzip\n" +"import logging\n" +"import logging.handlers\n" +"import os\n" +"import shutil\n" +"\n" +"def namer(name):\n" +" return name + \".gz\"\n" +"\n" +"def rotator(source, dest):\n" +" with open(source, 'rb') as f_in:\n" +" with gzip.open(dest, 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)\n" +" os.remove(source)\n" +"\n" +"\n" +"rh = logging.handlers.RotatingFileHandler('rotated.log', maxBytes=128, " +"backupCount=5)\n" +"rh.rotator = rotator\n" +"rh.namer = namer\n" +"\n" +"root = logging.getLogger()\n" +"root.setLevel(logging.INFO)\n" +"root.addHandler(rh)\n" +"f = logging.Formatter('%(asctime)s %(message)s')\n" +"rh.setFormatter(f)\n" +"for i in range(1000):\n" +" root.info(f'Message no. {i + 1}')" +msgstr "" + #: ../../howto/logging-cookbook.rst:2193 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" +#: ../../howto/logging-cookbook.rst:2195 +msgid "" +"$ ls rotated.log*\n" +"rotated.log rotated.log.2.gz rotated.log.4.gz\n" +"rotated.log.1.gz rotated.log.3.gz rotated.log.5.gz\n" +"$ zcat rotated.log.1.gz\n" +"2023-01-20 02:28:17,767 Message no. 996\n" +"2023-01-20 02:28:17,767 Message no. 997\n" +"2023-01-20 02:28:17,767 Message no. 998" +msgstr "" + #: ../../howto/logging-cookbook.rst:2206 msgid "A more elaborate multiprocessing example" msgstr "" @@ -1176,6 +2817,229 @@ msgid "" "works::" msgstr "" +#: ../../howto/logging-cookbook.rst:2226 +msgid "" +"import logging\n" +"import logging.config\n" +"import logging.handlers\n" +"from multiprocessing import Process, Queue, Event, current_process\n" +"import os\n" +"import random\n" +"import time\n" +"\n" +"class MyHandler:\n" +" \"\"\"\n" +" A simple handler for logging events. It runs in the listener process " +"and\n" +" dispatches events to loggers based on the name in the received record,\n" +" which then get dispatched, by the logging system, to the handlers\n" +" configured for those loggers.\n" +" \"\"\"\n" +"\n" +" def handle(self, record):\n" +" if record.name == \"root\":\n" +" logger = logging.getLogger()\n" +" else:\n" +" logger = logging.getLogger(record.name)\n" +"\n" +" if logger.isEnabledFor(record.levelno):\n" +" # The process name is transformed just to show that it's the " +"listener\n" +" # doing the logging to files and console\n" +" record.processName = '%s (for %s)' % (current_process().name, " +"record.processName)\n" +" logger.handle(record)\n" +"\n" +"def listener_process(q, stop_event, config):\n" +" \"\"\"\n" +" This could be done in the main process, but is just done in a separate\n" +" process for illustrative purposes.\n" +"\n" +" This initialises logging according to the specified configuration,\n" +" starts the listener and waits for the main process to signal completion\n" +" via the event. The listener is then stopped, and the process exits.\n" +" \"\"\"\n" +" logging.config.dictConfig(config)\n" +" listener = logging.handlers.QueueListener(q, MyHandler())\n" +" listener.start()\n" +" if os.name == 'posix':\n" +" # On POSIX, the setup logger will have been configured in the\n" +" # parent process, but should have been disabled following the\n" +" # dictConfig call.\n" +" # On Windows, since fork isn't used, the setup logger won't\n" +" # exist in the child, so it would be created and the message\n" +" # would appear - hence the \"if posix\" clause.\n" +" logger = logging.getLogger('setup')\n" +" logger.critical('Should not appear, because of disabled " +"logger ...')\n" +" stop_event.wait()\n" +" listener.stop()\n" +"\n" +"def worker_process(config):\n" +" \"\"\"\n" +" A number of these are spawned for the purpose of illustration. In\n" +" practice, they could be a heterogeneous bunch of processes rather than\n" +" ones which are identical to each other.\n" +"\n" +" This initialises logging according to the specified configuration,\n" +" and logs a hundred messages with random levels to randomly selected\n" +" loggers.\n" +"\n" +" A small sleep is added to allow other processes a chance to run. This\n" +" is not strictly needed, but it mixes the output from the different\n" +" processes a bit more than if it's left out.\n" +" \"\"\"\n" +" logging.config.dictConfig(config)\n" +" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL]\n" +" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" +" 'spam', 'spam.ham', 'spam.ham.eggs']\n" +" if os.name == 'posix':\n" +" # On POSIX, the setup logger will have been configured in the\n" +" # parent process, but should have been disabled following the\n" +" # dictConfig call.\n" +" # On Windows, since fork isn't used, the setup logger won't\n" +" # exist in the child, so it would be created and the message\n" +" # would appear - hence the \"if posix\" clause.\n" +" logger = logging.getLogger('setup')\n" +" logger.critical('Should not appear, because of disabled " +"logger ...')\n" +" for i in range(100):\n" +" lvl = random.choice(levels)\n" +" logger = logging.getLogger(random.choice(loggers))\n" +" logger.log(lvl, 'Message no. %d', i)\n" +" time.sleep(0.01)\n" +"\n" +"def main():\n" +" q = Queue()\n" +" # The main process gets a simple configuration which prints to the " +"console.\n" +" config_initial = {\n" +" 'version': 1,\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'level': 'INFO'\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # The worker process configuration is just a QueueHandler attached to " +"the\n" +" # root logger, which allows all messages to be sent to the queue.\n" +" # We disable existing loggers to disable the \"setup\" logger used in " +"the\n" +" # parent process. This is needed on POSIX because the logger will\n" +" # be there in the child following a fork().\n" +" config_worker = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': True,\n" +" 'handlers': {\n" +" 'queue': {\n" +" 'class': 'logging.handlers.QueueHandler',\n" +" 'queue': q\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['queue'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # The listener process configuration shows that the full flexibility of\n" +" # logging configuration is available to dispatch events to handlers " +"however\n" +" # you want.\n" +" # We disable existing loggers to disable the \"setup\" logger used in " +"the\n" +" # parent process. This is needed on POSIX because the logger will\n" +" # be there in the child following a fork().\n" +" config_listener = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': True,\n" +" 'formatters': {\n" +" 'detailed': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " +"%(processName)-10s %(message)s'\n" +" },\n" +" 'simple': {\n" +" 'class': 'logging.Formatter',\n" +" 'format': '%(name)-15s %(levelname)-8s %(processName)-10s " +"%(message)s'\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'simple',\n" +" 'level': 'INFO'\n" +" },\n" +" 'file': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed'\n" +" },\n" +" 'foofile': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-foo.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed'\n" +" },\n" +" 'errors': {\n" +" 'class': 'logging.FileHandler',\n" +" 'filename': 'mplog-errors.log',\n" +" 'mode': 'w',\n" +" 'formatter': 'detailed',\n" +" 'level': 'ERROR'\n" +" }\n" +" },\n" +" 'loggers': {\n" +" 'foo': {\n" +" 'handlers': ['foofile']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console', 'file', 'errors'],\n" +" 'level': 'DEBUG'\n" +" }\n" +" }\n" +" # Log some initial events, just to show that logging in the parent " +"works\n" +" # normally.\n" +" logging.config.dictConfig(config_initial)\n" +" logger = logging.getLogger('setup')\n" +" logger.info('About to create workers ...')\n" +" workers = []\n" +" for i in range(5):\n" +" wp = Process(target=worker_process, name='worker %d' % (i + 1),\n" +" args=(config_worker,))\n" +" workers.append(wp)\n" +" wp.start()\n" +" logger.info('Started worker: %s', wp.name)\n" +" logger.info('About to create listener ...')\n" +" stop_event = Event()\n" +" lp = Process(target=listener_process, name='listener',\n" +" args=(q, stop_event, config_listener))\n" +" lp.start()\n" +" logger.info('Started listener')\n" +" # We now hang around for the workers to finish their work.\n" +" for wp in workers:\n" +" wp.join()\n" +" # Workers all done, listening can now stop.\n" +" # Logging in the parent still works normally.\n" +" logger.info('Telling listener to stop ...')\n" +" stop_event.set()\n" +" lp.join()\n" +" logger.info('All done.')\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:2435 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" @@ -1212,6 +3076,10 @@ msgid "" "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" +#: ../../howto/logging-cookbook.rst:2459 +msgid "'ASCII section\\ufeffUnicode section'" +msgstr "" + #: ../../howto/logging-cookbook.rst:2461 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " @@ -1257,10 +3125,35 @@ msgid "" "machine-parseable manner::" msgstr "" +#: ../../howto/logging-cookbook.rst:2489 +msgid "" +"import json\n" +"import logging\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" return '%s >>> %s' % (self.message, json.dumps(self.kwargs))\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +"logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" +msgstr "" + #: ../../howto/logging-cookbook.rst:2505 msgid "If the above script is run, it prints:" msgstr "" +#: ../../howto/logging-cookbook.rst:2507 +msgid "" +"message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " +"\"bar\"}" +msgstr "" + #: ../../howto/logging-cookbook.rst:2511 ../../howto/logging-cookbook.rst:2553 msgid "" "Note that the order of items might be different according to the version of " @@ -1273,10 +3166,47 @@ msgid "" "as in the following complete example::" msgstr "" +#: ../../howto/logging-cookbook.rst:2517 +msgid "" +"import json\n" +"import logging\n" +"\n" +"\n" +"class Encoder(json.JSONEncoder):\n" +" def default(self, o):\n" +" if isinstance(o, set):\n" +" return tuple(o)\n" +" elif isinstance(o, str):\n" +" return o.encode('unicode_escape').decode('ascii')\n" +" return super().default(o)\n" +"\n" +"class StructuredMessage:\n" +" def __init__(self, message, /, **kwargs):\n" +" self.message = message\n" +" self.kwargs = kwargs\n" +"\n" +" def __str__(self):\n" +" s = Encoder().encode(self.kwargs)\n" +" return '%s >>> %s' % (self.message, s)\n" +"\n" +"_ = StructuredMessage # optional, to improve readability\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.INFO, format='%(message)s')\n" +" logging.info(_('message 1', set_value={1, 2, 3}, snowman='\\u2603'))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:2547 msgid "When the above script is run, it prints:" msgstr "" +#: ../../howto/logging-cookbook.rst:2549 +msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" +msgstr "" + #: ../../howto/logging-cookbook.rst:2562 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" @@ -1291,12 +3221,55 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" +#: ../../howto/logging-cookbook.rst:2571 +msgid "" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)" +msgstr "" + #: ../../howto/logging-cookbook.rst:2578 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" +#: ../../howto/logging-cookbook.rst:2581 +msgid "" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # The values below are popped from this dictionary and\n" +" # used to create the handler, set the handler's level and\n" +" # its formatter.\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # The values below are passed to the handler creator callable\n" +" # as keyword arguments.\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}" +msgstr "" + #: ../../howto/logging-cookbook.rst:2611 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " @@ -1304,10 +3277,65 @@ msgid "" "working script, ``chowntest.py``::" msgstr "" +#: ../../howto/logging-cookbook.rst:2615 +msgid "" +"import logging, logging.config, os, shutil\n" +"\n" +"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" +" if owner:\n" +" if not os.path.exists(filename):\n" +" open(filename, 'a').close()\n" +" shutil.chown(filename, *owner)\n" +" return logging.FileHandler(filename, mode, encoding)\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'default': {\n" +" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" +" },\n" +" },\n" +" 'handlers': {\n" +" 'file':{\n" +" # The values below are popped from this dictionary and\n" +" # used to create the handler, set the handler's level and\n" +" # its formatter.\n" +" '()': owned_file_handler,\n" +" 'level':'DEBUG',\n" +" 'formatter': 'default',\n" +" # The values below are passed to the handler creator callable\n" +" # as keyword arguments.\n" +" 'owner': ['pulse', 'pulse'],\n" +" 'filename': 'chowntest.log',\n" +" 'mode': 'w',\n" +" 'encoding': 'utf-8',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['file'],\n" +" 'level': 'DEBUG',\n" +" },\n" +"}\n" +"\n" +"logging.config.dictConfig(LOGGING)\n" +"logger = logging.getLogger('mylogger')\n" +"logger.debug('A debug message')" +msgstr "" + #: ../../howto/logging-cookbook.rst:2658 msgid "To run this, you will probably need to run as ``root``:" msgstr "" +#: ../../howto/logging-cookbook.rst:2660 +msgid "" +"$ sudo python3.3 chowntest.py\n" +"$ cat chowntest.log\n" +"2013-11-05 09:34:51,128 DEBUG mylogger A debug message\n" +"$ ls -l chowntest.log\n" +"-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" +msgstr "" + #: ../../howto/logging-cookbook.rst:2668 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." @@ -1323,10 +3351,18 @@ msgid "" "somewhere in your project. Instead of the line in the configuration::" msgstr "" +#: ../../howto/logging-cookbook.rst:2677 +msgid "'()': owned_file_handler," +msgstr "" + #: ../../howto/logging-cookbook.rst:2679 msgid "you could use e.g.::" msgstr "" +#: ../../howto/logging-cookbook.rst:2681 +msgid "'()': 'ext://project.util.owned_file_handler'," +msgstr "" + #: ../../howto/logging-cookbook.rst:2683 msgid "" "where ``project.util`` can be replaced with the actual name of the package " @@ -1451,10 +3487,33 @@ msgid "" "`str.format`::" msgstr "" +#: ../../howto/logging-cookbook.rst:2790 +msgid "" +">>> __ = BraceMessage\n" +">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" +"Message with 2 placeholders\n" +">>> class Point: pass\n" +"...\n" +">>> p = Point()\n" +">>> p.x = 0.5\n" +">>> p.y = 0.5\n" +">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})', " +"point=p))\n" +"Message with coordinates: (0.50, 0.50)" +msgstr "" + #: ../../howto/logging-cookbook.rst:2801 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" +#: ../../howto/logging-cookbook.rst:2803 +msgid "" +">>> __ = DollarMessage\n" +">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" +"Message with 2 placeholders\n" +">>>" +msgstr "" + #: ../../howto/logging-cookbook.rst:2808 msgid "" "One thing to note is that you pay no significant performance penalty with " @@ -1486,6 +3545,51 @@ msgid "" "complete example::" msgstr "" +#: ../../howto/logging-cookbook.rst:2835 +msgid "" +"import logging\n" +"import logging.config\n" +"import sys\n" +"\n" +"class MyFilter(logging.Filter):\n" +" def __init__(self, param=None):\n" +" self.param = param\n" +"\n" +" def filter(self, record):\n" +" if self.param is None:\n" +" allow = True\n" +" else:\n" +" allow = self.param not in record.msg\n" +" if allow:\n" +" record.msg = 'changed: ' + record.msg\n" +" return allow\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'filters': {\n" +" 'myfilter': {\n" +" '()': MyFilter,\n" +" 'param': 'noshow',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'filters': ['myfilter']\n" +" }\n" +" },\n" +" 'root': {\n" +" 'level': 'DEBUG',\n" +" 'handlers': ['console']\n" +" },\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.debug('hello')\n" +" logging.debug('hello - noshow')" +msgstr "" + #: ../../howto/logging-cookbook.rst:2877 msgid "" "This example shows how you can pass configuration data to the callable which " @@ -1493,6 +3597,10 @@ msgid "" "above script will print:" msgstr "" +#: ../../howto/logging-cookbook.rst:2881 +msgid "changed: hello" +msgstr "" + #: ../../howto/logging-cookbook.rst:2885 msgid "which shows that the filter is working as configured." msgstr "" @@ -1532,10 +3640,58 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" +#: ../../howto/logging-cookbook.rst:2912 +msgid "" +"import logging\n" +"\n" +"class OneLineExceptionFormatter(logging.Formatter):\n" +" def formatException(self, exc_info):\n" +" \"\"\"\n" +" Format an exception so that it prints on a single line.\n" +" \"\"\"\n" +" result = super().formatException(exc_info)\n" +" return repr(result) # or format into one line however you want to\n" +"\n" +" def format(self, record):\n" +" s = super().format(record)\n" +" if record.exc_text:\n" +" s = s.replace('\\n', '') + '|'\n" +" return s\n" +"\n" +"def configure_logging():\n" +" fh = logging.FileHandler('output.txt', 'w')\n" +" f = OneLineExceptionFormatter('%(asctime)s|%(levelname)s|%(message)s|',\n" +" '%d/%m/%Y %H:%M:%S')\n" +" fh.setFormatter(f)\n" +" root = logging.getLogger()\n" +" root.setLevel(logging.DEBUG)\n" +" root.addHandler(fh)\n" +"\n" +"def main():\n" +" configure_logging()\n" +" logging.info('Sample message')\n" +" try:\n" +" x = 1 / 0\n" +" except ZeroDivisionError as e:\n" +" logging.exception('ZeroDivisionError: %s', e)\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:2948 msgid "When run, this produces a file with exactly two lines:" msgstr "" +#: ../../howto/logging-cookbook.rst:2950 +msgid "" +"28/01/2015 07:21:23|INFO|Sample message|\n" +"28/01/2015 07:21:23|ERROR|ZeroDivisionError: integer division or modulo by " +"zero|'Traceback (most recent call last):\\n File \"logtest7.py\", line 30, " +"in main\\n x = 1 / 0\\nZeroDivisionError: integer division or modulo by " +"zero'|" +msgstr "" + #: ../../howto/logging-cookbook.rst:2955 msgid "" "While the above treatment is simplistic, it points the way to how exception " @@ -1564,6 +3720,38 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" +#: ../../howto/logging-cookbook.rst:2977 +msgid "" +"import logging\n" +"import subprocess\n" +"import sys\n" +"\n" +"class TTSHandler(logging.Handler):\n" +" def emit(self, record):\n" +" msg = self.format(record)\n" +" # Speak slowly in a female English voice\n" +" cmd = ['espeak', '-s150', '-ven+f3', msg]\n" +" p = subprocess.Popen(cmd, stdout=subprocess.PIPE,\n" +" stderr=subprocess.STDOUT)\n" +" # wait for the program to finish\n" +" p.communicate()\n" +"\n" +"def configure_logging():\n" +" h = TTSHandler()\n" +" root = logging.getLogger()\n" +" root.addHandler(h)\n" +" # the default formatter just returns the message\n" +" root.setLevel(logging.DEBUG)\n" +"\n" +"def main():\n" +" logging.info('Hello')\n" +" logging.debug('Goodbye')\n" +"\n" +"if __name__ == '__main__':\n" +" configure_logging()\n" +" sys.exit(main())" +msgstr "" + #: ../../howto/logging-cookbook.rst:3006 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " @@ -1629,10 +3817,105 @@ msgstr "" msgid "Here's the script::" msgstr "" +#: ../../howto/logging-cookbook.rst:3051 +msgid "" +"import logging\n" +"from logging.handlers import MemoryHandler\n" +"import sys\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"logger.addHandler(logging.NullHandler())\n" +"\n" +"def log_if_errors(logger, target_handler=None, flush_level=None, " +"capacity=None):\n" +" if target_handler is None:\n" +" target_handler = logging.StreamHandler()\n" +" if flush_level is None:\n" +" flush_level = logging.ERROR\n" +" if capacity is None:\n" +" capacity = 100\n" +" handler = MemoryHandler(capacity, flushLevel=flush_level, " +"target=target_handler)\n" +"\n" +" def decorator(fn):\n" +" def wrapper(*args, **kwargs):\n" +" logger.addHandler(handler)\n" +" try:\n" +" return fn(*args, **kwargs)\n" +" except Exception:\n" +" logger.exception('call failed')\n" +" raise\n" +" finally:\n" +" super(MemoryHandler, handler).flush()\n" +" logger.removeHandler(handler)\n" +" return wrapper\n" +"\n" +" return decorator\n" +"\n" +"def write_line(s):\n" +" sys.stderr.write('%s\\n' % s)\n" +"\n" +"def foo(fail=False):\n" +" write_line('about to log at DEBUG ...')\n" +" logger.debug('Actually logged at DEBUG')\n" +" write_line('about to log at INFO ...')\n" +" logger.info('Actually logged at INFO')\n" +" write_line('about to log at WARNING ...')\n" +" logger.warning('Actually logged at WARNING')\n" +" if fail:\n" +" write_line('about to log at ERROR ...')\n" +" logger.error('Actually logged at ERROR')\n" +" write_line('about to log at CRITICAL ...')\n" +" logger.critical('Actually logged at CRITICAL')\n" +" return fail\n" +"\n" +"decorated_foo = log_if_errors(logger)(foo)\n" +"\n" +"if __name__ == '__main__':\n" +" logger.setLevel(logging.DEBUG)\n" +" write_line('Calling undecorated foo with False')\n" +" assert not foo(False)\n" +" write_line('Calling undecorated foo with True')\n" +" assert foo(True)\n" +" write_line('Calling decorated foo with False')\n" +" assert not decorated_foo(False)\n" +" write_line('Calling decorated foo with True')\n" +" assert decorated_foo(True)" +msgstr "" + #: ../../howto/logging-cookbook.rst:3112 msgid "When this script is run, the following output should be observed:" msgstr "" +#: ../../howto/logging-cookbook.rst:3114 +msgid "" +"Calling undecorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling undecorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"about to log at CRITICAL ...\n" +"Calling decorated foo with False\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"Calling decorated foo with True\n" +"about to log at DEBUG ...\n" +"about to log at INFO ...\n" +"about to log at WARNING ...\n" +"about to log at ERROR ...\n" +"Actually logged at DEBUG\n" +"Actually logged at INFO\n" +"Actually logged at WARNING\n" +"Actually logged at ERROR\n" +"about to log at CRITICAL ...\n" +"Actually logged at CRITICAL" +msgstr "" + #: ../../howto/logging-cookbook.rst:3142 msgid "" "As you can see, actual logging output only occurs when an event is logged " @@ -1644,6 +3927,13 @@ msgstr "" msgid "You can of course use the conventional means of decoration::" msgstr "" +#: ../../howto/logging-cookbook.rst:3148 +msgid "" +"@log_if_errors(logger)\n" +"def foo(fail=False):\n" +" ..." +msgstr "" + #: ../../howto/logging-cookbook.rst:3156 msgid "Sending logging messages to email, with buffering" msgstr "" @@ -1659,6 +3949,74 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" +#: ../../howto/logging-cookbook.rst:3166 +msgid "" +"import logging\n" +"import logging.handlers\n" +"import smtplib\n" +"\n" +"class BufferingSMTPHandler(logging.handlers.BufferingHandler):\n" +" def __init__(self, mailhost, port, username, password, fromaddr, " +"toaddrs,\n" +" subject, capacity):\n" +" logging.handlers.BufferingHandler.__init__(self, capacity)\n" +" self.mailhost = mailhost\n" +" self.mailport = port\n" +" self.username = username\n" +" self.password = password\n" +" self.fromaddr = fromaddr\n" +" if isinstance(toaddrs, str):\n" +" toaddrs = [toaddrs]\n" +" self.toaddrs = toaddrs\n" +" self.subject = subject\n" +" self.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)-5s " +"%(message)s\"))\n" +"\n" +" def flush(self):\n" +" if len(self.buffer) > 0:\n" +" try:\n" +" smtp = smtplib.SMTP(self.mailhost, self.mailport)\n" +" smtp.starttls()\n" +" smtp.login(self.username, self.password)\n" +" msg = \"From: %s\\r\\nTo: %s\\r\\nSubject: %s\\r\\n\\r\\n\" " +"% (self.fromaddr, ','.join(self.toaddrs), self.subject)\n" +" for record in self.buffer:\n" +" s = self.format(record)\n" +" msg = msg + s + \"\\r\\n\"\n" +" smtp.sendmail(self.fromaddr, self.toaddrs, msg)\n" +" smtp.quit()\n" +" except Exception:\n" +" if logging.raiseExceptions:\n" +" raise\n" +" self.buffer = []\n" +"\n" +"if __name__ == '__main__':\n" +" import argparse\n" +"\n" +" ap = argparse.ArgumentParser()\n" +" aa = ap.add_argument\n" +" aa('host', metavar='HOST', help='SMTP server')\n" +" aa('--port', '-p', type=int, default=587, help='SMTP port')\n" +" aa('user', metavar='USER', help='SMTP username')\n" +" aa('password', metavar='PASSWORD', help='SMTP password')\n" +" aa('to', metavar='TO', help='Addressee for emails')\n" +" aa('sender', metavar='SENDER', help='Sender email address')\n" +" aa('--subject', '-s',\n" +" default='Test Logging email from Python logging module (buffering)',\n" +" help='Subject of email')\n" +" options = ap.parse_args()\n" +" logger = logging.getLogger()\n" +" logger.setLevel(logging.DEBUG)\n" +" h = BufferingSMTPHandler(options.host, options.port, options.user,\n" +" options.password, options.sender,\n" +" options.to, options.subject, 10)\n" +" logger.addHandler(h)\n" +" for i in range(102):\n" +" logger.info(\"Info index = %d\", i)\n" +" h.flush()\n" +" h.close()" +msgstr "" + #: ../../howto/logging-cookbook.rst:3230 msgid "" "If you run this script and your SMTP server is correctly set up, you should " @@ -1677,6 +4035,15 @@ msgid "" "class such as ``UTCFormatter``, shown below::" msgstr "" +#: ../../howto/logging-cookbook.rst:3243 +msgid "" +"import logging\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime" +msgstr "" + #: ../../howto/logging-cookbook.rst:3249 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" @@ -1685,10 +4052,57 @@ msgid "" "the following complete example::" msgstr "" +#: ../../howto/logging-cookbook.rst:3254 +msgid "" +"import logging\n" +"import logging.config\n" +"import time\n" +"\n" +"class UTCFormatter(logging.Formatter):\n" +" converter = time.gmtime\n" +"\n" +"LOGGING = {\n" +" 'version': 1,\n" +" 'disable_existing_loggers': False,\n" +" 'formatters': {\n" +" 'utc': {\n" +" '()': UTCFormatter,\n" +" 'format': '%(asctime)s %(message)s',\n" +" },\n" +" 'local': {\n" +" 'format': '%(asctime)s %(message)s',\n" +" }\n" +" },\n" +" 'handlers': {\n" +" 'console1': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'utc',\n" +" },\n" +" 'console2': {\n" +" 'class': 'logging.StreamHandler',\n" +" 'formatter': 'local',\n" +" },\n" +" },\n" +" 'root': {\n" +" 'handlers': ['console1', 'console2'],\n" +" }\n" +"}\n" +"\n" +"if __name__ == '__main__':\n" +" logging.config.dictConfig(LOGGING)\n" +" logging.warning('The local time is %s', time.asctime())" +msgstr "" + #: ../../howto/logging-cookbook.rst:3292 msgid "When this script is run, it should print something like:" msgstr "" +#: ../../howto/logging-cookbook.rst:3294 +msgid "" +"2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" +"2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" +msgstr "" + #: ../../howto/logging-cookbook.rst:3299 msgid "" "showing how the time is formatted both as local time and UTC, one for each " @@ -1709,6 +4123,35 @@ msgid "" "scope of the context manager::" msgstr "" +#: ../../howto/logging-cookbook.rst:3315 +msgid "" +"import logging\n" +"import sys\n" +"\n" +"class LoggingContext:\n" +" def __init__(self, logger, level=None, handler=None, close=True):\n" +" self.logger = logger\n" +" self.level = level\n" +" self.handler = handler\n" +" self.close = close\n" +"\n" +" def __enter__(self):\n" +" if self.level is not None:\n" +" self.old_level = self.logger.level\n" +" self.logger.setLevel(self.level)\n" +" if self.handler:\n" +" self.logger.addHandler(self.handler)\n" +"\n" +" def __exit__(self, et, ev, tb):\n" +" if self.level is not None:\n" +" self.logger.setLevel(self.old_level)\n" +" if self.handler:\n" +" self.logger.removeHandler(self.handler)\n" +" if self.handler and self.close:\n" +" self.handler.close()\n" +" # implicit return of None => don't swallow exceptions" +msgstr "" + #: ../../howto/logging-cookbook.rst:3341 msgid "" "If you specify a level value, the logger's level is set to that value in the " @@ -1724,6 +4167,26 @@ msgid "" "above::" msgstr "" +#: ../../howto/logging-cookbook.rst:3350 +msgid "" +"if __name__ == '__main__':\n" +" logger = logging.getLogger('foo')\n" +" logger.addHandler(logging.StreamHandler())\n" +" logger.setLevel(logging.INFO)\n" +" logger.info('1. This should appear just once on stderr.')\n" +" logger.debug('2. This should not appear.')\n" +" with LoggingContext(logger, level=logging.DEBUG):\n" +" logger.debug('3. This should appear once on stderr.')\n" +" logger.debug('4. This should not appear.')\n" +" h = logging.StreamHandler(sys.stdout)\n" +" with LoggingContext(logger, level=logging.DEBUG, handler=h, " +"close=True):\n" +" logger.debug('5. This should appear twice - once on stderr and once " +"on stdout.')\n" +" logger.info('6. This should appear just once on stderr.')\n" +" logger.debug('7. This should not appear.')" +msgstr "" + #: ../../howto/logging-cookbook.rst:3365 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " @@ -1741,16 +4204,41 @@ msgstr "" msgid "If we run the resulting script, the result is as follows:" msgstr "" +#: ../../howto/logging-cookbook.rst:3377 +msgid "" +"$ python logctx.py\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." +msgstr "" + #: ../../howto/logging-cookbook.rst:3386 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" +#: ../../howto/logging-cookbook.rst:3389 +msgid "" +"$ python logctx.py 2>/dev/null\n" +"5. This should appear twice - once on stderr and once on stdout." +msgstr "" + #: ../../howto/logging-cookbook.rst:3394 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" +#: ../../howto/logging-cookbook.rst:3396 +msgid "" +"$ python logctx.py >/dev/null\n" +"1. This should appear just once on stderr.\n" +"3. This should appear once on stderr.\n" +"5. This should appear twice - once on stderr and once on stdout.\n" +"6. This should appear just once on stderr." +msgstr "" + #: ../../howto/logging-cookbook.rst:3404 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " @@ -1797,26 +4285,142 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" +#: ../../howto/logging-cookbook.rst:3431 +msgid "" +"import argparse\n" +"import importlib\n" +"import logging\n" +"import os\n" +"import sys\n" +"\n" +"def main(args=None):\n" +" scriptname = os.path.basename(__file__)\n" +" parser = argparse.ArgumentParser(scriptname)\n" +" levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')\n" +" parser.add_argument('--log-level', default='INFO', choices=levels)\n" +" subparsers = parser.add_subparsers(dest='command',\n" +" help='Available commands:')\n" +" start_cmd = subparsers.add_parser('start', help='Start a service')\n" +" start_cmd.add_argument('name', metavar='NAME',\n" +" help='Name of service to start')\n" +" stop_cmd = subparsers.add_parser('stop',\n" +" help='Stop one or more services')\n" +" stop_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to stop')\n" +" restart_cmd = subparsers.add_parser('restart',\n" +" help='Restart one or more " +"services')\n" +" restart_cmd.add_argument('names', metavar='NAME', nargs='+',\n" +" help='Name of service to restart')\n" +" options = parser.parse_args()\n" +" # the code to dispatch commands could all be in this file. For the " +"purposes\n" +" # of illustration only, we implement each command in a separate module.\n" +" try:\n" +" mod = importlib.import_module(options.command)\n" +" cmd = getattr(mod, 'command')\n" +" except (ImportError, AttributeError):\n" +" print('Unable to find the code for command \\'%s\\'' % options." +"command)\n" +" return 1\n" +" # Could get fancy here and load configuration from file or dictionary\n" +" logging.basicConfig(level=options.log_level,\n" +" format='%(levelname)s %(name)s %(message)s')\n" +" cmd(options)\n" +"\n" +"if __name__ == '__main__':\n" +" sys.exit(main())" +msgstr "" + #: ../../howto/logging-cookbook.rst:3472 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" +#: ../../howto/logging-cookbook.rst:3475 +msgid "" +"# start.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" logger.debug('About to start %s', options.name)\n" +" # actually do the command processing here ...\n" +" logger.info('Started the \\'%s\\' service.', options.name)" +msgstr "" + #: ../../howto/logging-cookbook.rst:3485 msgid "and thus for stopping::" msgstr "" +#: ../../howto/logging-cookbook.rst:3487 +msgid "" +"# stop.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to stop %s', services)\n" +" # actually do the command processing here ...\n" +" logger.info('Stopped the %s service%s.', services, plural)" +msgstr "" + #: ../../howto/logging-cookbook.rst:3506 msgid "and similarly for restarting::" msgstr "" +#: ../../howto/logging-cookbook.rst:3508 +msgid "" +"# restart.py\n" +"import logging\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"def command(options):\n" +" n = len(options.names)\n" +" if n == 1:\n" +" plural = ''\n" +" services = '\\'%s\\'' % options.names[0]\n" +" else:\n" +" plural = 's'\n" +" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" +" i = services.rfind(', ')\n" +" services = services[:i] + ' and ' + services[i + 2:]\n" +" logger.debug('About to restart %s', services)\n" +" # actually do the command processing here ...\n" +" logger.info('Restarted the %s service%s.', services, plural)" +msgstr "" + #: ../../howto/logging-cookbook.rst:3527 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" +#: ../../howto/logging-cookbook.rst:3529 +msgid "" +"$ python app.py start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py stop foo bar\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py restart foo bar baz\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." +msgstr "" + #: ../../howto/logging-cookbook.rst:3540 msgid "" "The first word is the logging level, and the second word is the module or " @@ -1829,10 +4433,32 @@ msgid "" "the log. For example, if we want more information:" msgstr "" +#: ../../howto/logging-cookbook.rst:3546 +msgid "" +"$ python app.py --log-level DEBUG start foo\n" +"DEBUG start About to start foo\n" +"INFO start Started the 'foo' service.\n" +"\n" +"$ python app.py --log-level DEBUG stop foo bar\n" +"DEBUG stop About to stop 'foo' and 'bar'\n" +"INFO stop Stopped the 'foo' and 'bar' services.\n" +"\n" +"$ python app.py --log-level DEBUG restart foo bar baz\n" +"DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" +"INFO restart Restarted the 'foo', 'bar' and 'baz' services." +msgstr "" + #: ../../howto/logging-cookbook.rst:3560 msgid "And if we want less:" msgstr "" +#: ../../howto/logging-cookbook.rst:3562 +msgid "" +"$ python app.py --log-level WARNING start foo\n" +"$ python app.py --log-level WARNING stop foo bar\n" +"$ python app.py --log-level WARNING restart foo bar baz" +msgstr "" + #: ../../howto/logging-cookbook.rst:3568 msgid "" "In this case, the commands don't print anything to the console, since " @@ -1876,6 +4502,257 @@ msgid "" "more detailed information." msgstr "" +#: ../../howto/logging-cookbook.rst:3597 +msgid "" +"import datetime\n" +"import logging\n" +"import random\n" +"import sys\n" +"import time\n" +"\n" +"# Deal with minor differences between different Qt packages\n" +"try:\n" +" from PySide6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +"except ImportError:\n" +" try:\n" +" from PyQt6 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +" except ImportError:\n" +" try:\n" +" from PySide2 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.Signal\n" +" Slot = QtCore.Slot\n" +" except ImportError:\n" +" from PyQt5 import QtCore, QtGui, QtWidgets\n" +" Signal = QtCore.pyqtSignal\n" +" Slot = QtCore.pyqtSlot\n" +"\n" +"logger = logging.getLogger(__name__)\n" +"\n" +"\n" +"#\n" +"# Signals need to be contained in a QObject or subclass in order to be " +"correctly\n" +"# initialized.\n" +"#\n" +"class Signaller(QtCore.QObject):\n" +" signal = Signal(str, logging.LogRecord)\n" +"\n" +"#\n" +"# Output to a Qt GUI is only supposed to happen on the main thread. So, " +"this\n" +"# handler is designed to take a slot function which is set up to run in the " +"main\n" +"# thread. In this example, the function takes a string argument which is a\n" +"# formatted log message, and the log record which generated it. The " +"formatted\n" +"# string is just a convenience - you could format a string for output any " +"way\n" +"# you like in the slot function itself.\n" +"#\n" +"# You specify the slot function to do whatever GUI updates you want. The " +"handler\n" +"# doesn't know or care about specific UI elements.\n" +"#\n" +"class QtHandler(logging.Handler):\n" +" def __init__(self, slotfunc, *args, **kwargs):\n" +" super().__init__(*args, **kwargs)\n" +" self.signaller = Signaller()\n" +" self.signaller.signal.connect(slotfunc)\n" +"\n" +" def emit(self, record):\n" +" s = self.format(record)\n" +" self.signaller.signal.emit(s, record)\n" +"\n" +"#\n" +"# This example uses QThreads, which means that the threads at the Python " +"level\n" +"# are named something like \"Dummy-1\". The function below gets the Qt name " +"of the\n" +"# current thread.\n" +"#\n" +"def ctname():\n" +" return QtCore.QThread.currentThread().objectName()\n" +"\n" +"\n" +"#\n" +"# Used to generate random levels for logging.\n" +"#\n" +"LEVELS = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" +" logging.CRITICAL)\n" +"\n" +"#\n" +"# This worker class represents work that is done in a thread separate to " +"the\n" +"# main thread. The way the thread is kicked off to do work is via a button " +"press\n" +"# that connects to a slot in the worker.\n" +"#\n" +"# Because the default threadName value in the LogRecord isn't much use, we " +"add\n" +"# a qThreadName which contains the QThread name as computed above, and pass " +"that\n" +"# value in an \"extra\" dictionary which is used to update the LogRecord " +"with the\n" +"# QThread name.\n" +"#\n" +"# This example worker just outputs messages sequentially, interspersed with\n" +"# random delays of the order of a few seconds.\n" +"#\n" +"class Worker(QtCore.QObject):\n" +" @Slot()\n" +" def start(self):\n" +" extra = {'qThreadName': ctname() }\n" +" logger.debug('Started work', extra=extra)\n" +" i = 1\n" +" # Let the thread run until interrupted. This allows reasonably " +"clean\n" +" # thread termination.\n" +" while not QtCore.QThread.currentThread().isInterruptionRequested():\n" +" delay = 0.5 + random.random() * 2\n" +" time.sleep(delay)\n" +" try:\n" +" if random.random() < 0.1:\n" +" raise ValueError('Exception raised: %d' % i)\n" +" else:\n" +" level = random.choice(LEVELS)\n" +" logger.log(level, 'Message after delay of %3.1f: %d', " +"delay, i, extra=extra)\n" +" except ValueError as e:\n" +" logger.exception('Failed: %s', e, extra=extra)\n" +" i += 1\n" +"\n" +"#\n" +"# Implement a simple UI for this cookbook example. This contains:\n" +"#\n" +"# * A read-only text edit window which holds formatted log messages\n" +"# * A button to start work and log stuff in a separate thread\n" +"# * A button to log something from the main thread\n" +"# * A button to clear the log window\n" +"#\n" +"class Window(QtWidgets.QWidget):\n" +"\n" +" COLORS = {\n" +" logging.DEBUG: 'black',\n" +" logging.INFO: 'blue',\n" +" logging.WARNING: 'orange',\n" +" logging.ERROR: 'red',\n" +" logging.CRITICAL: 'purple',\n" +" }\n" +"\n" +" def __init__(self, app):\n" +" super().__init__()\n" +" self.app = app\n" +" self.textedit = te = QtWidgets.QPlainTextEdit(self)\n" +" # Set whatever the default monospace font is for the platform\n" +" f = QtGui.QFont('nosuchfont')\n" +" if hasattr(f, 'Monospace'):\n" +" f.setStyleHint(f.Monospace)\n" +" else:\n" +" f.setStyleHint(f.StyleHint.Monospace) # for Qt6\n" +" te.setFont(f)\n" +" te.setReadOnly(True)\n" +" PB = QtWidgets.QPushButton\n" +" self.work_button = PB('Start background work', self)\n" +" self.log_button = PB('Log a message at a random level', self)\n" +" self.clear_button = PB('Clear log window', self)\n" +" self.handler = h = QtHandler(self.update_status)\n" +" # Remember to use qThreadName rather than threadName in the format " +"string.\n" +" fs = '%(asctime)s %(qThreadName)-12s %(levelname)-8s %(message)s'\n" +" formatter = logging.Formatter(fs)\n" +" h.setFormatter(formatter)\n" +" logger.addHandler(h)\n" +" # Set up to terminate the QThread when we exit\n" +" app.aboutToQuit.connect(self.force_quit)\n" +"\n" +" # Lay out all the widgets\n" +" layout = QtWidgets.QVBoxLayout(self)\n" +" layout.addWidget(te)\n" +" layout.addWidget(self.work_button)\n" +" layout.addWidget(self.log_button)\n" +" layout.addWidget(self.clear_button)\n" +" self.setFixedSize(900, 400)\n" +"\n" +" # Connect the non-worker slots and signals\n" +" self.log_button.clicked.connect(self.manual_update)\n" +" self.clear_button.clicked.connect(self.clear_display)\n" +"\n" +" # Start a new worker thread and connect the slots for the worker\n" +" self.start_thread()\n" +" self.work_button.clicked.connect(self.worker.start)\n" +" # Once started, the button should be disabled\n" +" self.work_button.clicked.connect(lambda : self.work_button." +"setEnabled(False))\n" +"\n" +" def start_thread(self):\n" +" self.worker = Worker()\n" +" self.worker_thread = QtCore.QThread()\n" +" self.worker.setObjectName('Worker')\n" +" self.worker_thread.setObjectName('WorkerThread') # for qThreadName\n" +" self.worker.moveToThread(self.worker_thread)\n" +" # This will start an event loop in the worker thread\n" +" self.worker_thread.start()\n" +"\n" +" def kill_thread(self):\n" +" # Just tell the worker to stop, then tell it to quit and wait for " +"that\n" +" # to happen\n" +" self.worker_thread.requestInterruption()\n" +" if self.worker_thread.isRunning():\n" +" self.worker_thread.quit()\n" +" self.worker_thread.wait()\n" +" else:\n" +" print('worker has already exited.')\n" +"\n" +" def force_quit(self):\n" +" # For use when the window is closed\n" +" if self.worker_thread.isRunning():\n" +" self.kill_thread()\n" +"\n" +" # The functions below update the UI and run in the main thread because\n" +" # that's where the slots are set up\n" +"\n" +" @Slot(str, logging.LogRecord)\n" +" def update_status(self, status, record):\n" +" color = self.COLORS.get(record.levelno, 'black')\n" +" s = '
%s
' % (color, status)\n" +" self.textedit.appendHtml(s)\n" +"\n" +" @Slot()\n" +" def manual_update(self):\n" +" # This function uses the formatted message passed in, but also uses\n" +" # information from the record to format the message in an " +"appropriate\n" +" # color according to its severity (level).\n" +" level = random.choice(LEVELS)\n" +" extra = {'qThreadName': ctname() }\n" +" logger.log(level, 'Manually logged!', extra=extra)\n" +"\n" +" @Slot()\n" +" def clear_display(self):\n" +" self.textedit.clear()\n" +"\n" +"\n" +"def main():\n" +" QtCore.QThread.currentThread().setObjectName('MainThread')\n" +" logging.getLogger().setLevel(logging.DEBUG)\n" +" app = QtWidgets.QApplication(sys.argv)\n" +" example = Window(app)\n" +" example.show()\n" +" if hasattr(app, 'exec'):\n" +" rc = app.exec()\n" +" else:\n" +" rc = app.exec_()\n" +" sys.exit(rc)\n" +"\n" +"if __name__=='__main__':\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:3829 msgid "Logging to syslog with RFC5424 support" msgstr "" @@ -1897,6 +4774,76 @@ msgid "" "you can do so with a subclassed handler which looks something like this::" msgstr "" +#: ../../howto/logging-cookbook.rst:3842 +msgid "" +"import datetime\n" +"import logging.handlers\n" +"import re\n" +"import socket\n" +"import time\n" +"\n" +"class SysLogHandler5424(logging.handlers.SysLogHandler):\n" +"\n" +" tz_offset = re.compile(r'([+-]\\d{2})(\\d{2})$')\n" +" escaped = re.compile(r'([\\]\"\\\\])')\n" +"\n" +" def __init__(self, *args, **kwargs):\n" +" self.msgid = kwargs.pop('msgid', None)\n" +" self.appname = kwargs.pop('appname', None)\n" +" super().__init__(*args, **kwargs)\n" +"\n" +" def format(self, record):\n" +" version = 1\n" +" asctime = datetime.datetime.fromtimestamp(record.created)." +"isoformat()\n" +" m = self.tz_offset.match(time.strftime('%z'))\n" +" has_offset = False\n" +" if m and time.timezone:\n" +" hrs, mins = m.groups()\n" +" if int(hrs) or int(mins):\n" +" has_offset = True\n" +" if not has_offset:\n" +" asctime += 'Z'\n" +" else:\n" +" asctime += f'{hrs}:{mins}'\n" +" try:\n" +" hostname = socket.gethostname()\n" +" except Exception:\n" +" hostname = '-'\n" +" appname = self.appname or '-'\n" +" procid = record.process\n" +" msgid = '-'\n" +" msg = super().format(record)\n" +" sdata = '-'\n" +" if hasattr(record, 'structured_data'):\n" +" sd = record.structured_data\n" +" # This should be a dict where the keys are SD-ID and the value " +"is a\n" +" # dict mapping PARAM-NAME to PARAM-VALUE (refer to the RFC for " +"what these\n" +" # mean)\n" +" # There's no error checking here - it's purely for illustration, " +"and you\n" +" # can adapt this code for use in production environments\n" +" parts = []\n" +"\n" +" def replacer(m):\n" +" g = m.groups()\n" +" return '\\\\' + g[0]\n" +"\n" +" for sdid, dv in sd.items():\n" +" part = f'[{sdid}'\n" +" for k, v in dv.items():\n" +" s = str(v)\n" +" s = self.escaped.sub(replacer, s)\n" +" part += f' {k}=\"{s}\"'\n" +" part += ']'\n" +" parts.append(part)\n" +" sdata = ''.join(parts)\n" +" return f'{version} {asctime} {hostname} {appname} {procid} {msgid} " +"{sdata} {msg}'" +msgstr "" + #: ../../howto/logging-cookbook.rst:3904 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " @@ -1906,6 +4853,17 @@ msgid "" "using something like this::" msgstr "" +#: ../../howto/logging-cookbook.rst:3909 +msgid "" +"sd = {\n" +" 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" +" 'foo@54321': {'rab': 'baz', 'zab': 'bozz', 'zzif': r'buzz'}\n" +"}\n" +"extra = {'structured_data': sd}\n" +"i = 1\n" +"logger.debug('Message %d', i, extra=extra)" +msgstr "" + #: ../../howto/logging-cookbook.rst:3918 msgid "How to treat a logger like an output stream" msgstr "" @@ -1918,16 +4876,68 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" +#: ../../howto/logging-cookbook.rst:3925 +msgid "" +"import logging\n" +"\n" +"class LoggerWriter:\n" +" def __init__(self, logger, level):\n" +" self.logger = logger\n" +" self.level = level\n" +"\n" +" def write(self, message):\n" +" if message != '\\n': # avoid printing bare newlines, if you like\n" +" self.logger.log(self.level, message)\n" +"\n" +" def flush(self):\n" +" # doesn't actually do anything, but might be expected of a file-" +"like\n" +" # object - so optional depending on your situation\n" +" pass\n" +"\n" +" def close(self):\n" +" # doesn't actually do anything, but might be expected of a file-" +"like\n" +" # object - so optional depending on your situation. You might want\n" +" # to set a flag so that later calls to write raise an exception\n" +" pass\n" +"\n" +"def main():\n" +" logging.basicConfig(level=logging.DEBUG)\n" +" logger = logging.getLogger('demo')\n" +" info_fp = LoggerWriter(logger, logging.INFO)\n" +" debug_fp = LoggerWriter(logger, logging.DEBUG)\n" +" print('An INFO message', file=info_fp)\n" +" print('A DEBUG message', file=debug_fp)\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" +msgstr "" + #: ../../howto/logging-cookbook.rst:3960 msgid "When this script is run, it prints" msgstr "" +#: ../../howto/logging-cookbook.rst:3962 +msgid "" +"INFO:demo:An INFO message\n" +"DEBUG:demo:A DEBUG message" +msgstr "" + #: ../../howto/logging-cookbook.rst:3967 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" +#: ../../howto/logging-cookbook.rst:3970 +msgid "" +"import sys\n" +"\n" +"sys.stdout = LoggerWriter(logger, logging.INFO)\n" +"sys.stderr = LoggerWriter(logger, logging.WARNING)" +msgstr "" + #: ../../howto/logging-cookbook.rst:3977 msgid "" "You should do this *after* configuring logging for your needs. In the above " @@ -1936,6 +4946,15 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" +#: ../../howto/logging-cookbook.rst:3982 +msgid "" +">>> print('Foo')\n" +"INFO:demo:Foo\n" +">>> print('Bar', file=sys.stderr)\n" +"WARNING:demo:Bar\n" +">>>" +msgstr "" + #: ../../howto/logging-cookbook.rst:3990 msgid "" "Of course, the examples above show output according to the format used by :" @@ -1950,26 +4969,83 @@ msgid "" "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" +#: ../../howto/logging-cookbook.rst:3998 +msgid "" +"sys.stderr = LoggerWriter(logger, logging.WARNING)\n" +"1 / 0" +msgstr "" + #: ../../howto/logging-cookbook.rst:4003 msgid "then running the script results in" msgstr "" +#: ../../howto/logging-cookbook.rst:4005 +msgid "" +"WARNING:demo:Traceback (most recent call last):\n" +"\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 53, " +"in \n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 49, " +"in main\n" +"\n" +"WARNING:demo:\n" +"WARNING:demo:1 / 0\n" +"WARNING:demo:ZeroDivisionError\n" +"WARNING:demo::\n" +"WARNING:demo:division by zero" +msgstr "" + #: ../../howto/logging-cookbook.rst:4021 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " "in a separate logged line (for example, the last three lines above). To get " "around this problem, you need to buffer things and only output log lines " -"when newlines are seen. Let's use a slghtly better implementation of " +"when newlines are seen. Let's use a slightly better implementation of " "``LoggerWriter``:" msgstr "" +#: ../../howto/logging-cookbook.rst:4027 +msgid "" +"class BufferingLoggerWriter(LoggerWriter):\n" +" def __init__(self, logger, level):\n" +" super().__init__(logger, level)\n" +" self.buffer = ''\n" +"\n" +" def write(self, message):\n" +" if '\\n' not in message:\n" +" self.buffer += message\n" +" else:\n" +" parts = message.split('\\n')\n" +" if self.buffer:\n" +" s = self.buffer + parts.pop(0)\n" +" self.logger.log(self.level, s)\n" +" self.buffer = parts.pop()\n" +" for part in parts:\n" +" self.logger.log(self.level, part)" +msgstr "" + #: ../../howto/logging-cookbook.rst:4046 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" +#: ../../howto/logging-cookbook.rst:4049 +msgid "" +"WARNING:demo:Traceback (most recent call last):\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " +"in \n" +"WARNING:demo: main()\n" +"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 52, " +"in main\n" +"WARNING:demo: 1/0\n" +"WARNING:demo:ZeroDivisionError: division by zero" +msgstr "" + #: ../../howto/logging-cookbook.rst:4062 msgid "Patterns to avoid" msgstr "" diff --git a/howto/logging.po b/howto/logging.po index d15ca978e..0de2ab448 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -4,32 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Hildeberto Abreu Magalhães , 2021 -# Leticia Portella , 2021 -# Marco Rougeth , 2021 -# Katyanna Moura , 2021 -# Aline Balogh , 2021 -# i17obot , 2021 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 -# Vinicius vinicinbgs, 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Vinicius vinicinbgs, 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -168,7 +158,7 @@ msgid "" "below (in increasing order of severity):" msgstr "" -#: ../../howto/logging.rst:75 ../../howto/logging.rst:830 +#: ../../howto/logging.rst:75 ../../howto/logging.rst:870 msgid "Level" msgstr "Nível" @@ -176,7 +166,7 @@ msgstr "Nível" msgid "When it's used" msgstr "Quando é usado" -#: ../../howto/logging.rst:77 ../../howto/logging.rst:840 +#: ../../howto/logging.rst:77 ../../howto/logging.rst:880 msgid "``DEBUG``" msgstr "``DEBUG``" @@ -187,7 +177,7 @@ msgstr "" "Informação detalhada, tipicamente de interesse apenas quando diagnosticando " "problemas." -#: ../../howto/logging.rst:80 ../../howto/logging.rst:838 +#: ../../howto/logging.rst:80 ../../howto/logging.rst:878 msgid "``INFO``" msgstr "``INFO``" @@ -195,7 +185,7 @@ msgstr "``INFO``" msgid "Confirmation that things are working as expected." msgstr "Confirmação de que as coisas estão funcionando como esperado." -#: ../../howto/logging.rst:83 ../../howto/logging.rst:836 +#: ../../howto/logging.rst:83 ../../howto/logging.rst:876 msgid "``WARNING``" msgstr "``WARNING``" @@ -209,7 +199,7 @@ msgstr "" "problema em um futuro próximo (ex.: 'pouco espaço em disco'). O software " "está ainda funcionando como esperado." -#: ../../howto/logging.rst:88 ../../howto/logging.rst:834 +#: ../../howto/logging.rst:88 ../../howto/logging.rst:874 msgid "``ERROR``" msgstr "``ERROR``" @@ -221,7 +211,7 @@ msgstr "" "Por conta de um problema mais grave, o software não conseguiu executar " "alguma função." -#: ../../howto/logging.rst:91 ../../howto/logging.rst:832 +#: ../../howto/logging.rst:91 ../../howto/logging.rst:872 msgid "``CRITICAL``" msgstr "``CRITICAL``" @@ -260,10 +250,21 @@ msgstr "Um exemplo simples" msgid "A very simple example is::" msgstr "Um exemplo bastante simples é::" +#: ../../howto/logging.rst:111 +msgid "" +"import logging\n" +"logging.warning('Watch out!') # will print a message to the console\n" +"logging.info('I told you so') # will not print anything" +msgstr "" + #: ../../howto/logging.rst:115 msgid "If you type these lines into a script and run it, you'll see:" msgstr "Se você digitar essas linhas no script e executá-lo, você verá:" +#: ../../howto/logging.rst:117 +msgid "WARNING:root:Watch out!" +msgstr "" + #: ../../howto/logging.rst:121 msgid "" "printed out on the console. The ``INFO`` message doesn't appear because the " @@ -297,6 +298,18 @@ msgid "" "above::" msgstr "" +#: ../../howto/logging.rst:142 +msgid "" +"import logging\n" +"logger = logging.getLogger(__name__)\n" +"logging.basicConfig(filename='example.log', encoding='utf-8', level=logging." +"DEBUG)\n" +"logger.debug('This message should go to the log file')\n" +"logger.info('So should this')\n" +"logger.warning('And this, too')\n" +"logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" +msgstr "" + #: ../../howto/logging.rst:150 msgid "" "The *encoding* argument was added. In earlier Python versions, or if not " @@ -314,6 +327,14 @@ msgstr "" "E agora se nós abrirmos o arquivo e olharmos o que temos, deveremos " "encontrar essas mensagens de log:" +#: ../../howto/logging.rst:160 +msgid "" +"DEBUG:__main__:This message should go to the log file\n" +"INFO:__main__:So should this\n" +"WARNING:__main__:And this, too\n" +"ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö" +msgstr "" + #: ../../howto/logging.rst:167 msgid "" "This example also shows how you can set the logging level which acts as the " @@ -331,6 +352,10 @@ msgstr "" "Se você quer definir o nível de logging a partir de uma opção da linha de " "comando como:" +#: ../../howto/logging.rst:173 +msgid "--log=INFO" +msgstr "" + #: ../../howto/logging.rst:177 msgid "" "and you have the value of the parameter passed for ``--log`` in some " @@ -339,6 +364,10 @@ msgstr "" "e você tem o valor do parâmetro passado pelo ``--log`` em alguma variável " "*loglevel*, você pode usar::" +#: ../../howto/logging.rst:180 +msgid "getattr(logging, loglevel.upper())" +msgstr "" + #: ../../howto/logging.rst:182 msgid "" "to get the value which you'll pass to :func:`basicConfig` via the *level* " @@ -349,6 +378,17 @@ msgstr "" "argumento. Você pode querer verificar qualquer erros introduzidos pelo " "usuário, talvez como no exemplo a seguir::" +#: ../../howto/logging.rst:186 +msgid "" +"# assuming loglevel is bound to the string value obtained from the\n" +"# command line argument. Convert to upper case to allow the user to\n" +"# specify --log=DEBUG or --log=debug\n" +"numeric_level = getattr(logging, loglevel.upper(), None)\n" +"if not isinstance(numeric_level, int):\n" +" raise ValueError('Invalid log level: %s' % loglevel)\n" +"logging.basicConfig(level=numeric_level, ...)" +msgstr "" + #: ../../howto/logging.rst:194 msgid "" "The call to :func:`basicConfig` should come *before* any calls to a logger's " @@ -369,6 +409,12 @@ msgstr "" "execuções anteriores, você pode especificar o *filemode* argumento, mudando " "a chamada no exemplo acima::" +#: ../../howto/logging.rst:203 +msgid "" +"logging.basicConfig(filename='example.log', filemode='w', level=logging." +"DEBUG)" +msgstr "" + #: ../../howto/logging.rst:205 msgid "" "The output will be the same as before, but the log file is no longer " @@ -390,10 +436,20 @@ msgstr "" "Para logar o dado de uma variável, use o formato string para a mensagem " "descritiva do evento e adicione a variável como argumento. Exemplo::" +#: ../../howto/logging.rst:215 +msgid "" +"import logging\n" +"logging.warning('%s before you %s', 'Look', 'leap!')" +msgstr "" + #: ../../howto/logging.rst:218 msgid "will display:" msgstr "exibirá:" +#: ../../howto/logging.rst:220 +msgid "WARNING:root:Look before you leap!" +msgstr "" + #: ../../howto/logging.rst:224 msgid "" "As you can see, merging of variable data into the event description message " @@ -423,10 +479,27 @@ msgstr "" "Para mudar o formato usado para exibir mensagens, você precisa especificar o " "formato que quer usar::" +#: ../../howto/logging.rst:238 +msgid "" +"import logging\n" +"logging.basicConfig(format='%(levelname)s:%(message)s', level=logging." +"DEBUG)\n" +"logging.debug('This message should appear on the console')\n" +"logging.info('So should this')\n" +"logging.warning('And this, too')" +msgstr "" + #: ../../howto/logging.rst:244 msgid "which would print:" msgstr "que vai exibir:" +#: ../../howto/logging.rst:246 +msgid "" +"DEBUG:This message should appear on the console\n" +"INFO:So should this\n" +"WARNING:And this, too" +msgstr "" + #: ../../howto/logging.rst:252 msgid "" "Notice that the 'root' which appeared in earlier examples has disappeared. " @@ -455,10 +528,21 @@ msgstr "" "Para exibir a data e hora de um evento, você pode colocar '%(asctime)s' no " "seu formato string::" +#: ../../howto/logging.rst:266 +msgid "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s')\n" +"logging.warning('is when this event was logged.')" +msgstr "" + #: ../../howto/logging.rst:270 msgid "which should print something like this:" msgstr "que deve exibir algo assim:" +#: ../../howto/logging.rst:272 +msgid "2010-12-12 11:41:42,612 is when this event was logged." +msgstr "" + #: ../../howto/logging.rst:276 msgid "" "The default format for date/time display (shown above) is like ISO8601 or :" @@ -469,10 +553,22 @@ msgstr "" "`3339`. Se você precisa de mais controle sobre a formatação de data/hora, " "informe o *datefmt* argumento para ``basicConfig``, como neste exemplo::" +#: ../../howto/logging.rst:280 +msgid "" +"import logging\n" +"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" +"%M:%S %p')\n" +"logging.warning('is when this event was logged.')" +msgstr "" + #: ../../howto/logging.rst:284 msgid "which would display something like this:" msgstr "que deve exibir algo assim:" +#: ../../howto/logging.rst:286 +msgid "12/12/2010 11:46:36 AM is when this event was logged." +msgstr "" + #: ../../howto/logging.rst:290 msgid "" "The format of the *datefmt* argument is the same as supported by :func:`time." @@ -589,6 +685,10 @@ msgstr "" "Uma boa convenção para usar quando nomear loggers é usar um módulo-nível " "logger, em cada módulo que usa o logging, nomeado como sugerido abaixo::" +#: ../../howto/logging.rst:342 +msgid "logger = logging.getLogger(__name__)" +msgstr "" + #: ../../howto/logging.rst:344 msgid "" "This means that logger names track the package/module hierarchy, and it's " @@ -634,6 +734,10 @@ msgstr "" msgid "The default format set by :func:`basicConfig` for messages is:" msgstr "O formato padrão definido por :func:`basicConfig` para mensagens é:" +#: ../../howto/logging.rst:370 +msgid "severity:logger name:message" +msgstr "" + #: ../../howto/logging.rst:374 msgid "" "You can change this by passing a format string to :func:`basicConfig` with " @@ -651,11 +755,11 @@ msgid "" "the following diagram." msgstr "" -#: ../../howto/logging.rst:388 +#: ../../howto/logging.rst:428 msgid "Loggers" msgstr "Registradores" -#: ../../howto/logging.rst:390 +#: ../../howto/logging.rst:430 msgid "" ":class:`Logger` objects have a threefold job. First, they expose several " "methods to application code so that applications can log messages at " @@ -665,7 +769,7 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:396 +#: ../../howto/logging.rst:436 msgid "" "The most widely used methods on logger objects fall into two categories: " "configuration and message sending." @@ -673,11 +777,11 @@ msgstr "" "Os métodos mais usados em objetos logger se enquadram em duas categorias: " "configuração e envio de mensagem." -#: ../../howto/logging.rst:399 +#: ../../howto/logging.rst:439 msgid "These are the most common configuration methods:" msgstr "Esses são os métodos de configuração mais comuns:" -#: ../../howto/logging.rst:401 +#: ../../howto/logging.rst:441 msgid "" ":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " "will handle, where debug is the lowest built-in severity level and critical " @@ -686,32 +790,32 @@ msgid "" "messages and will ignore DEBUG messages." msgstr "" -#: ../../howto/logging.rst:407 +#: ../../howto/logging.rst:447 msgid "" ":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " "handler objects from the logger object. Handlers are covered in more detail " "in :ref:`handler-basic`." msgstr "" -#: ../../howto/logging.rst:411 +#: ../../howto/logging.rst:451 msgid "" ":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " "filter objects from the logger object. Filters are covered in more detail " "in :ref:`filter`." msgstr "" -#: ../../howto/logging.rst:415 +#: ../../howto/logging.rst:455 msgid "" "You don't need to always call these methods on every logger you create. See " "the last two paragraphs in this section." msgstr "" -#: ../../howto/logging.rst:418 +#: ../../howto/logging.rst:458 msgid "" "With the logger object configured, the following methods create log messages:" msgstr "" -#: ../../howto/logging.rst:420 +#: ../../howto/logging.rst:460 msgid "" ":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" "`Logger.error`, and :meth:`Logger.critical` all create log records with a " @@ -724,14 +828,14 @@ msgid "" "exception information." msgstr "" -#: ../../howto/logging.rst:430 +#: ../../howto/logging.rst:470 msgid "" ":meth:`Logger.exception` creates a log message similar to :meth:`Logger." "error`. The difference is that :meth:`Logger.exception` dumps a stack trace " "along with it. Call this method only from an exception handler." msgstr "" -#: ../../howto/logging.rst:434 +#: ../../howto/logging.rst:474 msgid "" ":meth:`Logger.log` takes a log level as an explicit argument. This is a " "little more verbose for logging messages than using the log level " @@ -739,7 +843,7 @@ msgid "" "levels." msgstr "" -#: ../../howto/logging.rst:438 +#: ../../howto/logging.rst:478 msgid "" ":func:`getLogger` returns a reference to a logger instance with the " "specified name if it is provided, or ``root`` if not. The names are period-" @@ -751,7 +855,7 @@ msgid "" "descendants of ``foo``." msgstr "" -#: ../../howto/logging.rst:446 +#: ../../howto/logging.rst:486 msgid "" "Loggers have a concept of *effective level*. If a level is not explicitly " "set on a logger, the level of its parent is used instead as its effective " @@ -763,7 +867,7 @@ msgid "" "handlers." msgstr "" -#: ../../howto/logging.rst:454 +#: ../../howto/logging.rst:494 msgid "" "Child loggers propagate messages up to the handlers associated with their " "ancestor loggers. Because of this, it is unnecessary to define and configure " @@ -773,11 +877,11 @@ msgid "" "attribute of a logger to ``False``.)" msgstr "" -#: ../../howto/logging.rst:465 +#: ../../howto/logging.rst:505 msgid "Handlers" msgstr "Manipuladores" -#: ../../howto/logging.rst:467 +#: ../../howto/logging.rst:507 msgid "" ":class:`~logging.Handler` objects are responsible for dispatching the " "appropriate log messages (based on the log messages' severity) to the " @@ -790,14 +894,14 @@ msgid "" "of a specific severity to a specific location." msgstr "" -#: ../../howto/logging.rst:477 +#: ../../howto/logging.rst:517 msgid "" "The standard library includes quite a few handler types (see :ref:`useful-" "handlers`); the tutorials use mainly :class:`StreamHandler` and :class:" "`FileHandler` in its examples." msgstr "" -#: ../../howto/logging.rst:481 +#: ../../howto/logging.rst:521 msgid "" "There are very few methods in a handler for application developers to " "concern themselves with. The only handler methods that seem relevant for " @@ -805,7 +909,7 @@ msgid "" "not creating custom handlers) are the following configuration methods:" msgstr "" -#: ../../howto/logging.rst:486 +#: ../../howto/logging.rst:526 msgid "" "The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " "the lowest severity that will be dispatched to the appropriate destination. " @@ -815,19 +919,19 @@ msgid "" "send on." msgstr "" -#: ../../howto/logging.rst:492 +#: ../../howto/logging.rst:532 msgid "" ":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " "use." msgstr "" -#: ../../howto/logging.rst:495 +#: ../../howto/logging.rst:535 msgid "" ":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " "configure and deconfigure filter objects on handlers." msgstr "" -#: ../../howto/logging.rst:498 +#: ../../howto/logging.rst:538 msgid "" "Application code should not directly instantiate and use instances of :class:" "`Handler`. Instead, the :class:`Handler` class is a base class that defines " @@ -835,11 +939,11 @@ msgid "" "behavior that child classes can use (or override)." msgstr "" -#: ../../howto/logging.rst:505 +#: ../../howto/logging.rst:545 msgid "Formatters" msgstr "Formatadores" -#: ../../howto/logging.rst:507 +#: ../../howto/logging.rst:547 msgid "" "Formatter objects configure the final order, structure, and contents of the " "log message. Unlike the base :class:`logging.Handler` class, application " @@ -849,20 +953,24 @@ msgid "" "string and a style indicator." msgstr "" -#: ../../howto/logging.rst:516 +#: ../../howto/logging.rst:556 msgid "" "If there is no message format string, the default is to use the raw " "message. If there is no date format string, the default date format is:" msgstr "" -#: ../../howto/logging.rst:523 +#: ../../howto/logging.rst:559 +msgid "%Y-%m-%d %H:%M:%S" +msgstr "" + +#: ../../howto/logging.rst:563 msgid "" "with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " "``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " "used." msgstr "" -#: ../../howto/logging.rst:526 +#: ../../howto/logging.rst:566 msgid "" "If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :" @@ -872,18 +980,22 @@ msgid "" "should conform to what is expected by :meth:`string.Template.substitute`." msgstr "" -#: ../../howto/logging.rst:533 +#: ../../howto/logging.rst:573 msgid "Added the ``style`` parameter." msgstr "Adicionado o parâmetro ``style``." -#: ../../howto/logging.rst:536 +#: ../../howto/logging.rst:576 msgid "" "The following message format string will log the time in a human-readable " "format, the severity of the message, and the contents of the message, in " "that order::" msgstr "" -#: ../../howto/logging.rst:542 +#: ../../howto/logging.rst:580 +msgid "'%(asctime)s - %(levelname)s - %(message)s'" +msgstr "" + +#: ../../howto/logging.rst:582 msgid "" "Formatters use a user-configurable function to convert the creation time of " "a record to a tuple. By default, :func:`time.localtime` is used; to change " @@ -894,68 +1006,167 @@ msgid "" "in the Formatter class (to ``time.gmtime`` for GMT display)." msgstr "" -#: ../../howto/logging.rst:552 +#: ../../howto/logging.rst:592 msgid "Configuring Logging" msgstr "Configurando Logging" -#: ../../howto/logging.rst:556 +#: ../../howto/logging.rst:596 msgid "Programmers can configure logging in three ways:" msgstr "Programadores podem configurar logging de três formas:" -#: ../../howto/logging.rst:558 +#: ../../howto/logging.rst:598 msgid "" "Creating loggers, handlers, and formatters explicitly using Python code that " "calls the configuration methods listed above." msgstr "" -#: ../../howto/logging.rst:560 +#: ../../howto/logging.rst:600 msgid "" "Creating a logging config file and reading it using the :func:`fileConfig` " "function." msgstr "" -#: ../../howto/logging.rst:562 +#: ../../howto/logging.rst:602 msgid "" "Creating a dictionary of configuration information and passing it to the :" "func:`dictConfig` function." msgstr "" -#: ../../howto/logging.rst:565 +#: ../../howto/logging.rst:605 msgid "" "For the reference documentation on the last two options, see :ref:`logging-" "config-api`. The following example configures a very simple logger, a " "console handler, and a simple formatter using Python code::" msgstr "" -#: ../../howto/logging.rst:595 +#: ../../howto/logging.rst:609 +msgid "" +"import logging\n" +"\n" +"# create logger\n" +"logger = logging.getLogger('simple_example')\n" +"logger.setLevel(logging.DEBUG)\n" +"\n" +"# create console handler and set level to debug\n" +"ch = logging.StreamHandler()\n" +"ch.setLevel(logging.DEBUG)\n" +"\n" +"# create formatter\n" +"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " +"%(message)s')\n" +"\n" +"# add formatter to ch\n" +"ch.setFormatter(formatter)\n" +"\n" +"# add ch to logger\n" +"logger.addHandler(ch)\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" +msgstr "" + +#: ../../howto/logging.rst:635 msgid "" "Running this module from the command line produces the following output:" msgstr "" -#: ../../howto/logging.rst:606 +#: ../../howto/logging.rst:637 +msgid "" +"$ python simple_logging_module.py\n" +"2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message\n" +"2005-03-19 15:10:26,620 - simple_example - INFO - info message\n" +"2005-03-19 15:10:26,695 - simple_example - WARNING - warn message\n" +"2005-03-19 15:10:26,697 - simple_example - ERROR - error message\n" +"2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" +msgstr "" + +#: ../../howto/logging.rst:646 msgid "" "The following Python module creates a logger, handler, and formatter nearly " "identical to those in the example listed above, with the only difference " "being the names of the objects::" msgstr "" -#: ../../howto/logging.rst:625 +#: ../../howto/logging.rst:650 +msgid "" +"import logging\n" +"import logging.config\n" +"\n" +"logging.config.fileConfig('logging.conf')\n" +"\n" +"# create logger\n" +"logger = logging.getLogger('simpleExample')\n" +"\n" +"# 'application' code\n" +"logger.debug('debug message')\n" +"logger.info('info message')\n" +"logger.warning('warn message')\n" +"logger.error('error message')\n" +"logger.critical('critical message')" +msgstr "" + +#: ../../howto/logging.rst:665 msgid "Here is the logging.conf file:" msgstr "Aqui está o arquivo logging.conf:" -#: ../../howto/logging.rst:657 +#: ../../howto/logging.rst:667 +msgid "" +"[loggers]\n" +"keys=root,simpleExample\n" +"\n" +"[handlers]\n" +"keys=consoleHandler\n" +"\n" +"[formatters]\n" +"keys=simpleFormatter\n" +"\n" +"[logger_root]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"\n" +"[logger_simpleExample]\n" +"level=DEBUG\n" +"handlers=consoleHandler\n" +"qualname=simpleExample\n" +"propagate=0\n" +"\n" +"[handler_consoleHandler]\n" +"class=StreamHandler\n" +"level=DEBUG\n" +"formatter=simpleFormatter\n" +"args=(sys.stdout,)\n" +"\n" +"[formatter_simpleFormatter]\n" +"format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" +msgstr "" + +#: ../../howto/logging.rst:697 msgid "" "The output is nearly identical to that of the non-config-file-based example:" msgstr "" -#: ../../howto/logging.rst:668 +#: ../../howto/logging.rst:699 +msgid "" +"$ python simple_logging_config.py\n" +"2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message\n" +"2005-03-19 15:38:55,979 - simpleExample - INFO - info message\n" +"2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message\n" +"2005-03-19 15:38:56,055 - simpleExample - ERROR - error message\n" +"2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" +msgstr "" + +#: ../../howto/logging.rst:708 msgid "" "You can see that the config file approach has a few advantages over the " "Python code approach, mainly separation of configuration and code and the " "ability of noncoders to easily modify the logging properties." msgstr "" -#: ../../howto/logging.rst:672 +#: ../../howto/logging.rst:712 msgid "" "The :func:`fileConfig` function takes a default parameter, " "``disable_existing_loggers``, which defaults to ``True`` for reasons of " @@ -966,7 +1177,7 @@ msgid "" "information, and specify ``False`` for this parameter if you wish." msgstr "" -#: ../../howto/logging.rst:680 +#: ../../howto/logging.rst:720 msgid "" "The dictionary passed to :func:`dictConfig` can also specify a Boolean value " "with key ``disable_existing_loggers``, which if not specified explicitly in " @@ -975,7 +1186,7 @@ msgid "" "want - in which case, provide the key explicitly with a value of ``False``." msgstr "" -#: ../../howto/logging.rst:690 +#: ../../howto/logging.rst:730 msgid "" "Note that the class names referenced in config files need to be either " "relative to the logging module, or absolute values which can be resolved " @@ -986,7 +1197,7 @@ msgid "" "path)." msgstr "" -#: ../../howto/logging.rst:698 +#: ../../howto/logging.rst:738 msgid "" "In Python 3.2, a new means of configuring logging has been introduced, using " "dictionaries to hold configuration information. This provides a superset of " @@ -1001,30 +1212,52 @@ msgid "" "a socket, or use whatever approach makes sense for your application." msgstr "" -#: ../../howto/logging.rst:710 +#: ../../howto/logging.rst:750 msgid "" "Here's an example of the same configuration as above, in YAML format for the " "new dictionary-based approach:" msgstr "" -#: ../../howto/logging.rst:734 +#: ../../howto/logging.rst:753 +msgid "" +"version: 1\n" +"formatters:\n" +" simple:\n" +" format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'\n" +"handlers:\n" +" console:\n" +" class: logging.StreamHandler\n" +" level: DEBUG\n" +" formatter: simple\n" +" stream: ext://sys.stdout\n" +"loggers:\n" +" simpleExample:\n" +" level: DEBUG\n" +" handlers: [console]\n" +" propagate: no\n" +"root:\n" +" level: DEBUG\n" +" handlers: [console]" +msgstr "" + +#: ../../howto/logging.rst:774 msgid "" "For more information about logging using a dictionary, see :ref:`logging-" "config-api`." msgstr "" -#: ../../howto/logging.rst:738 +#: ../../howto/logging.rst:778 msgid "What happens if no configuration is provided" msgstr "O que acontece se nenhuma configuração é fornecida" -#: ../../howto/logging.rst:740 +#: ../../howto/logging.rst:780 msgid "" "If no logging configuration is provided, it is possible to have a situation " "where a logging event needs to be output, but no handlers can be found to " "output the event." msgstr "" -#: ../../howto/logging.rst:744 +#: ../../howto/logging.rst:784 msgid "" "The event is output using a 'handler of last resort', stored in :data:" "`lastResort`. This internal handler is not associated with any logger, and " @@ -1036,32 +1269,32 @@ msgid "" "severities will be output." msgstr "" -#: ../../howto/logging.rst:755 +#: ../../howto/logging.rst:795 msgid "For versions of Python prior to 3.2, the behaviour is as follows:" msgstr "Para versões do Python anteriores à 3.2, o comportamento é o seguinte:" -#: ../../howto/logging.rst:757 +#: ../../howto/logging.rst:797 msgid "" "If :data:`raiseExceptions` is ``False`` (production mode), the event is " "silently dropped." msgstr "" -#: ../../howto/logging.rst:760 +#: ../../howto/logging.rst:800 msgid "" "If :data:`raiseExceptions` is ``True`` (development mode), a message 'No " "handlers could be found for logger X.Y.Z' is printed once." msgstr "" -#: ../../howto/logging.rst:763 +#: ../../howto/logging.rst:803 msgid "" "To obtain the pre-3.2 behaviour, :data:`lastResort` can be set to ``None``." msgstr "" -#: ../../howto/logging.rst:769 +#: ../../howto/logging.rst:809 msgid "Configuring Logging for a Library" msgstr "" -#: ../../howto/logging.rst:771 +#: ../../howto/logging.rst:811 msgid "" "When developing a library which uses logging, you should take care to " "document how the library uses logging - for example, the names of loggers " @@ -1072,7 +1305,7 @@ msgid "" "is regarded as the best default behaviour." msgstr "" -#: ../../howto/logging.rst:779 +#: ../../howto/logging.rst:819 msgid "" "If for some reason you *don't* want these messages printed in the absence of " "any logging configuration, you can attach a do-nothing handler to the top-" @@ -1084,7 +1317,7 @@ msgid "" "to those handlers, as normal." msgstr "" -#: ../../howto/logging.rst:788 +#: ../../howto/logging.rst:828 msgid "" "A do-nothing handler is included in the logging package: :class:`~logging." "NullHandler` (since Python 3.1). An instance of this handler could be added " @@ -1095,14 +1328,20 @@ msgid "" "etc. then the code::" msgstr "" -#: ../../howto/logging.rst:799 +#: ../../howto/logging.rst:836 +msgid "" +"import logging\n" +"logging.getLogger('foo').addHandler(logging.NullHandler())" +msgstr "" + +#: ../../howto/logging.rst:839 msgid "" "should have the desired effect. If an organisation produces a number of " "libraries, then the logger name specified can be 'orgname.foo' rather than " "just 'foo'." msgstr "" -#: ../../howto/logging.rst:803 +#: ../../howto/logging.rst:843 msgid "" "It is strongly advised that you *do not log to the root logger* in your " "library. Instead, use a logger with a unique and easily identifiable name, " @@ -1112,7 +1351,7 @@ msgid "" "library as they wish." msgstr "" -#: ../../howto/logging.rst:810 +#: ../../howto/logging.rst:850 msgid "" "It is strongly advised that you *do not add any handlers other than* :class:" "`~logging.NullHandler` *to your library's loggers*. This is because the " @@ -1123,11 +1362,11 @@ msgid "" "carry out unit tests and deliver logs which suit their requirements." msgstr "" -#: ../../howto/logging.rst:821 +#: ../../howto/logging.rst:861 msgid "Logging Levels" msgstr "" -#: ../../howto/logging.rst:823 +#: ../../howto/logging.rst:863 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -1136,39 +1375,39 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: ../../howto/logging.rst:830 +#: ../../howto/logging.rst:870 msgid "Numeric value" msgstr "Valor numérico" -#: ../../howto/logging.rst:832 +#: ../../howto/logging.rst:872 msgid "50" msgstr "50" -#: ../../howto/logging.rst:834 +#: ../../howto/logging.rst:874 msgid "40" msgstr "40" -#: ../../howto/logging.rst:836 +#: ../../howto/logging.rst:876 msgid "30" msgstr "30" -#: ../../howto/logging.rst:838 +#: ../../howto/logging.rst:878 msgid "20" msgstr "20" -#: ../../howto/logging.rst:840 +#: ../../howto/logging.rst:880 msgid "10" msgstr "10" -#: ../../howto/logging.rst:842 +#: ../../howto/logging.rst:882 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../howto/logging.rst:842 +#: ../../howto/logging.rst:882 msgid "0" msgstr "0" -#: ../../howto/logging.rst:845 +#: ../../howto/logging.rst:885 msgid "" "Levels can also be associated with loggers, being set either by the " "developer or through loading a saved logging configuration. When a logging " @@ -1178,14 +1417,14 @@ msgid "" "basic mechanism controlling the verbosity of logging output." msgstr "" -#: ../../howto/logging.rst:852 +#: ../../howto/logging.rst:892 msgid "" "Logging messages are encoded as instances of the :class:`~logging.LogRecord` " "class. When a logger decides to actually log an event, a :class:`~logging." "LogRecord` instance is created from the logging message." msgstr "" -#: ../../howto/logging.rst:856 +#: ../../howto/logging.rst:896 msgid "" "Logging messages are subjected to a dispatch mechanism through the use of :" "dfn:`handlers`, which are instances of subclasses of the :class:`Handler` " @@ -1202,7 +1441,7 @@ msgid "" "at which point the passing to ancestor handlers stops)." msgstr "" -#: ../../howto/logging.rst:870 +#: ../../howto/logging.rst:910 msgid "" "Just as for loggers, handlers can have levels associated with them. A " "handler's level acts as a filter in the same way as a logger's level does. " @@ -1212,11 +1451,11 @@ msgid "" "`~Handler.emit`." msgstr "" -#: ../../howto/logging.rst:879 +#: ../../howto/logging.rst:919 msgid "Custom Levels" msgstr "" -#: ../../howto/logging.rst:881 +#: ../../howto/logging.rst:921 msgid "" "Defining your own levels is possible, but should not be necessary, as the " "existing levels have been chosen on the basis of practical experience. " @@ -1229,11 +1468,11 @@ msgid "" "given numeric value might mean different things for different libraries." msgstr "" -#: ../../howto/logging.rst:894 +#: ../../howto/logging.rst:934 msgid "Useful Handlers" msgstr "" -#: ../../howto/logging.rst:896 +#: ../../howto/logging.rst:936 msgid "" "In addition to the base :class:`Handler` class, many useful subclasses are " "provided:" @@ -1241,17 +1480,17 @@ msgstr "" "Em adição à classe base :class:`Handler`, muitas subclasses úteis são " "fornecidas:" -#: ../../howto/logging.rst:899 +#: ../../howto/logging.rst:939 msgid "" ":class:`StreamHandler` instances send messages to streams (file-like " "objects)." msgstr "" -#: ../../howto/logging.rst:902 +#: ../../howto/logging.rst:942 msgid ":class:`FileHandler` instances send messages to disk files." msgstr "" -#: ../../howto/logging.rst:904 +#: ../../howto/logging.rst:944 msgid "" ":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " "rotate log files at a certain point. It is not meant to be instantiated " @@ -1259,61 +1498,61 @@ msgid "" "`~handlers.TimedRotatingFileHandler`." msgstr "" -#: ../../howto/logging.rst:909 +#: ../../howto/logging.rst:949 msgid "" ":class:`~handlers.RotatingFileHandler` instances send messages to disk " "files, with support for maximum log file sizes and log file rotation." msgstr "" -#: ../../howto/logging.rst:912 +#: ../../howto/logging.rst:952 msgid "" ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " "files, rotating the log file at certain timed intervals." msgstr "" -#: ../../howto/logging.rst:915 +#: ../../howto/logging.rst:955 msgid "" ":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:918 +#: ../../howto/logging.rst:958 msgid "" ":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: ../../howto/logging.rst:921 +#: ../../howto/logging.rst:961 msgid "" ":class:`~handlers.SMTPHandler` instances send messages to a designated email " "address." msgstr "" -#: ../../howto/logging.rst:924 +#: ../../howto/logging.rst:964 msgid "" ":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " "daemon, possibly on a remote machine." msgstr "" -#: ../../howto/logging.rst:927 +#: ../../howto/logging.rst:967 msgid "" ":class:`~handlers.NTEventLogHandler` instances send messages to a Windows " "NT/2000/XP event log." msgstr "" -#: ../../howto/logging.rst:930 +#: ../../howto/logging.rst:970 msgid "" ":class:`~handlers.MemoryHandler` instances send messages to a buffer in " "memory, which is flushed whenever specific criteria are met." msgstr "" -#: ../../howto/logging.rst:933 +#: ../../howto/logging.rst:973 msgid "" ":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " "using either ``GET`` or ``POST`` semantics." msgstr "" -#: ../../howto/logging.rst:936 +#: ../../howto/logging.rst:976 msgid "" ":class:`~handlers.WatchedFileHandler` instances watch the file they are " "logging to. If the file changes, it is closed and reopened using the file " @@ -1321,13 +1560,13 @@ msgid "" "support the underlying mechanism used." msgstr "" -#: ../../howto/logging.rst:941 +#: ../../howto/logging.rst:981 msgid "" ":class:`~handlers.QueueHandler` instances send messages to a queue, such as " "those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../howto/logging.rst:944 +#: ../../howto/logging.rst:984 msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " @@ -1336,15 +1575,15 @@ msgid "" "more information." msgstr "" -#: ../../howto/logging.rst:950 +#: ../../howto/logging.rst:990 msgid "The :class:`NullHandler` class." msgstr "A classe :class:`NullHandler`." -#: ../../howto/logging.rst:953 +#: ../../howto/logging.rst:993 msgid "The :class:`~handlers.QueueHandler` class." msgstr "A classe :class:`~handlers.QueueHandler`." -#: ../../howto/logging.rst:956 +#: ../../howto/logging.rst:996 msgid "" "The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " "classes are defined in the core logging package. The other handlers are " @@ -1352,14 +1591,14 @@ msgid "" "module, :mod:`logging.config`, for configuration functionality.)" msgstr "" -#: ../../howto/logging.rst:961 +#: ../../howto/logging.rst:1001 msgid "" "Logged messages are formatted for presentation through instances of the :" "class:`Formatter` class. They are initialized with a format string suitable " "for use with the % operator and a dictionary." msgstr "" -#: ../../howto/logging.rst:965 +#: ../../howto/logging.rst:1005 msgid "" "For formatting multiple messages in a batch, instances of :class:" "`BufferingFormatter` can be used. In addition to the format string (which is " @@ -1367,7 +1606,7 @@ msgid "" "trailer format strings." msgstr "" -#: ../../howto/logging.rst:970 +#: ../../howto/logging.rst:1010 msgid "" "When filtering based on logger level and/or handler level is not enough, " "instances of :class:`Filter` can be added to both :class:`Logger` and :class:" @@ -1377,18 +1616,18 @@ msgid "" "value, the message is not processed further." msgstr "" -#: ../../howto/logging.rst:977 +#: ../../howto/logging.rst:1017 msgid "" "The basic :class:`Filter` functionality allows filtering by specific logger " "name. If this feature is used, messages sent to the named logger and its " "children are allowed through the filter, and all others dropped." msgstr "" -#: ../../howto/logging.rst:985 +#: ../../howto/logging.rst:1025 msgid "Exceptions raised during logging" msgstr "Exceções levantadas durante logging" -#: ../../howto/logging.rst:987 +#: ../../howto/logging.rst:1027 msgid "" "The logging package is designed to swallow exceptions which occur while " "logging in production. This is so that errors which occur while handling " @@ -1396,7 +1635,7 @@ msgid "" "errors - do not cause the application using logging to terminate prematurely." msgstr "" -#: ../../howto/logging.rst:992 +#: ../../howto/logging.rst:1032 msgid "" ":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " "swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " @@ -1404,7 +1643,7 @@ msgid "" "handleError` method." msgstr "" -#: ../../howto/logging.rst:997 +#: ../../howto/logging.rst:1037 msgid "" "The default implementation of :meth:`~Handler.handleError` in :class:" "`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " @@ -1412,7 +1651,7 @@ msgid "" "the exception is swallowed." msgstr "" -#: ../../howto/logging.rst:1003 +#: ../../howto/logging.rst:1043 msgid "" "The default value of :data:`raiseExceptions` is ``True``. This is because " "during development, you typically want to be notified of any exceptions that " @@ -1420,11 +1659,11 @@ msgid "" "production usage." msgstr "" -#: ../../howto/logging.rst:1013 +#: ../../howto/logging.rst:1053 msgid "Using arbitrary objects as messages" msgstr "Usando objetos arbitrários como mensagens" -#: ../../howto/logging.rst:1015 +#: ../../howto/logging.rst:1055 msgid "" "In the preceding sections and examples, it has been assumed that the message " "passed when logging the event is a string. However, this is not the only " @@ -1436,11 +1675,11 @@ msgid "" "the wire." msgstr "" -#: ../../howto/logging.rst:1026 +#: ../../howto/logging.rst:1066 msgid "Optimization" msgstr "Optimização" -#: ../../howto/logging.rst:1028 +#: ../../howto/logging.rst:1068 msgid "" "Formatting of message arguments is deferred until it cannot be avoided. " "However, computing the arguments passed to the logging method can also be " @@ -1451,13 +1690,20 @@ msgid "" "code like this::" msgstr "" -#: ../../howto/logging.rst:1040 +#: ../../howto/logging.rst:1076 +msgid "" +"if logger.isEnabledFor(logging.DEBUG):\n" +" logger.debug('Message with %s, %s', expensive_func1(),\n" +" expensive_func2())" +msgstr "" + +#: ../../howto/logging.rst:1080 msgid "" "so that if the logger's threshold is set above ``DEBUG``, the calls to " "``expensive_func1`` and ``expensive_func2`` are never made." msgstr "" -#: ../../howto/logging.rst:1043 +#: ../../howto/logging.rst:1083 msgid "" "In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " "than you'd like (e.g. for deeply nested loggers where an explicit level is " @@ -1469,7 +1715,7 @@ msgid "" "while the application is running (which is not all that common)." msgstr "" -#: ../../howto/logging.rst:1052 +#: ../../howto/logging.rst:1092 msgid "" "There are other optimizations which can be made for specific applications " "which need more precise control over what logging information is collected. " @@ -1477,94 +1723,94 @@ msgid "" "you don't need:" msgstr "" -#: ../../howto/logging.rst:1058 +#: ../../howto/logging.rst:1098 msgid "What you don't want to collect" msgstr "O que você não quer coletar" -#: ../../howto/logging.rst:1058 +#: ../../howto/logging.rst:1098 msgid "How to avoid collecting it" msgstr "" -#: ../../howto/logging.rst:1060 +#: ../../howto/logging.rst:1100 msgid "Information about where calls were made from." msgstr "" -#: ../../howto/logging.rst:1060 +#: ../../howto/logging.rst:1100 msgid "" "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." "_getframe`, which may help to speed up your code in environments like PyPy " "(which can't speed up code that uses :func:`sys._getframe`)." msgstr "" -#: ../../howto/logging.rst:1066 +#: ../../howto/logging.rst:1106 msgid "Threading information." msgstr "" -#: ../../howto/logging.rst:1066 +#: ../../howto/logging.rst:1106 msgid "Set ``logging.logThreads`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1068 +#: ../../howto/logging.rst:1108 msgid "Current process ID (:func:`os.getpid`)" msgstr "" -#: ../../howto/logging.rst:1068 +#: ../../howto/logging.rst:1108 msgid "Set ``logging.logProcesses`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1070 +#: ../../howto/logging.rst:1110 msgid "" "Current process name when using ``multiprocessing`` to manage multiple " "processes." msgstr "" -#: ../../howto/logging.rst:1070 +#: ../../howto/logging.rst:1110 msgid "Set ``logging.logMultiprocessing`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1073 +#: ../../howto/logging.rst:1113 msgid "Current :class:`asyncio.Task` name when using ``asyncio``." msgstr "" -#: ../../howto/logging.rst:1073 +#: ../../howto/logging.rst:1113 msgid "Set ``logging.logAsyncioTasks`` to ``False``." msgstr "" -#: ../../howto/logging.rst:1077 +#: ../../howto/logging.rst:1117 msgid "" "Also note that the core logging module only includes the basic handlers. If " "you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " "won't take up any memory." msgstr "" -#: ../../howto/logging.rst:1084 +#: ../../howto/logging.rst:1124 msgid "Other resources" msgstr "Outros recursos" -#: ../../howto/logging.rst:1088 +#: ../../howto/logging.rst:1128 msgid "Module :mod:`logging`" msgstr "Módulo :mod:`logging`" -#: ../../howto/logging.rst:1089 +#: ../../howto/logging.rst:1129 msgid "API reference for the logging module." msgstr "Referência da API para o módulo de logging." -#: ../../howto/logging.rst:1091 +#: ../../howto/logging.rst:1131 msgid "Module :mod:`logging.config`" msgstr "Módulo :mod:`logging.config`" -#: ../../howto/logging.rst:1092 +#: ../../howto/logging.rst:1132 msgid "Configuration API for the logging module." msgstr "API de configuração para o módulo logging." -#: ../../howto/logging.rst:1094 +#: ../../howto/logging.rst:1134 msgid "Module :mod:`logging.handlers`" msgstr "Módulo :mod:`logging.handlers`" -#: ../../howto/logging.rst:1095 +#: ../../howto/logging.rst:1135 msgid "Useful handlers included with the logging module." msgstr "Manipuladores úteis incluídos no módulo logging." -#: ../../howto/logging.rst:1097 +#: ../../howto/logging.rst:1137 msgid ":ref:`A logging cookbook `" msgstr ":ref:`Um livro de receitas do logging `" diff --git a/howto/mro.po b/howto/mro.po index e53964c78..cd5a123fc 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -4,8 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2024 -# Marco Rougeth , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -13,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2024-04-19 14:15+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -259,6 +257,20 @@ msgstr "" "com O a classe ``object``, que é o início de qualquer hierarquia para " "classes de novo estilo:" +#: ../../howto/mro.rst:120 +msgid "" +" -----------\n" +"| |\n" +"| O |\n" +"| / \\ |\n" +" - X Y /\n" +" | / | /\n" +" | / |/\n" +" A B\n" +" \\ /\n" +" ?" +msgstr "" + #: ../../howto/mro.rst:133 msgid "" "In this case, it is not possible to derive a new class C from A and B, since " @@ -293,6 +305,10 @@ msgstr "" "Deixe-me apresentar algumas notações simples que serão úteis para a " "discussão a seguir. Usarei a notação de atalho::" +#: ../../howto/mro.rst:148 +msgid "C1 C2 ... CN" +msgstr "" + #: ../../howto/mro.rst:150 msgid "to indicate the list of classes [C1, C2, ... , CN]." msgstr "para indicar a lista de classes [C1, C2, ... , CN]." @@ -301,14 +317,26 @@ msgstr "para indicar a lista de classes [C1, C2, ... , CN]." msgid "The *head* of the list is its first element::" msgstr "*head* da lista é o seu primeiro elemento::" +#: ../../howto/mro.rst:154 +msgid "head = C1" +msgstr "" + #: ../../howto/mro.rst:156 msgid "whereas the *tail* is the rest of the list::" msgstr "enquanto *tail* é o resto da lista::" +#: ../../howto/mro.rst:158 +msgid "tail = C2 ... CN." +msgstr "" + #: ../../howto/mro.rst:160 msgid "I shall also use the notation::" msgstr "Também usarei a notação::" +#: ../../howto/mro.rst:162 +msgid "C + (C1 C2 ... CN) = C C1 C2 ... CN" +msgstr "" + #: ../../howto/mro.rst:164 msgid "to denote the sum of the lists [C] + [C1, C2, ... ,CN]." msgstr "para denotar a soma das listas [C] + [C1, C2, ..., CN]." @@ -339,6 +367,10 @@ msgstr "" msgid "In symbolic notation::" msgstr "Em notação simbólica::" +#: ../../howto/mro.rst:178 +msgid "L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1 ... BN)" +msgstr "" + #: ../../howto/mro.rst:180 msgid "" "In particular, if C is the ``object`` class, which has no parents, the " @@ -347,6 +379,10 @@ msgstr "" "Em particular, se C é a classe ``object``, que não tem pais, a linearização " "é trivial::" +#: ../../howto/mro.rst:183 +msgid "L[object] = object." +msgstr "" + #: ../../howto/mro.rst:185 msgid "" "However, in general one has to compute the merge according to the following " @@ -394,6 +430,10 @@ msgstr "" "O cálculo da mesclagem é trivial se C tiver apenas um pai (herança única); " "nesse caso::" +#: ../../howto/mro.rst:205 +msgid "L[C(B)] = C + merge(L[B],B) = C + L[B]" +msgstr "" + #: ../../howto/mro.rst:207 msgid "" "However, in the case of multiple inheritance things are more cumbersome and " @@ -414,14 +454,51 @@ msgstr "Primeiro exemplo. Considere a seguinte hierarquia:" msgid "In this case the inheritance graph can be drawn as:" msgstr "Neste caso, o grafo de herança pode ser desenhado como:" +#: ../../howto/mro.rst:226 +msgid "" +" 6\n" +" ---\n" +"Level 3 | O | (more general)\n" +" / --- \\\n" +" / | \\ |\n" +" / | \\ |\n" +" / | \\ |\n" +" --- --- --- |\n" +"Level 2 3 | D | 4| E | | F | 5 |\n" +" --- --- --- |\n" +" \\ \\ _ / | |\n" +" \\ / \\ _ | |\n" +" \\ / \\ | |\n" +" --- --- |\n" +"Level 1 1 | B | | C | 2 |\n" +" --- --- |\n" +" \\ / |\n" +" \\ / \\ /\n" +" ---\n" +"Level 0 0 | A | (more specialized)\n" +" ---" +msgstr "" + #: ../../howto/mro.rst:251 msgid "The linearizations of O,D,E and F are trivial::" msgstr "As linearizações de O,D,E e F são triviais::" +#: ../../howto/mro.rst:253 +msgid "" +"L[O] = O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[F] = F O" +msgstr "" + #: ../../howto/mro.rst:258 msgid "The linearization of B can be computed as::" msgstr "A linearização de B pode ser calculada como::" +#: ../../howto/mro.rst:260 +msgid "L[B] = B + merge(DO, EO, DE)" +msgstr "" + #: ../../howto/mro.rst:262 msgid "" "We see that D is a good head, therefore we take it and we are reduced to " @@ -436,14 +513,37 @@ msgstr "" "sequência. Então vemos que E é um bom *head*; nós pegamos isso e somos " "reduzidos a calcular ``merge(O,O)`` que dá O. Portanto::" +#: ../../howto/mro.rst:268 +msgid "L[B] = B D E O" +msgstr "" + #: ../../howto/mro.rst:270 msgid "Using the same procedure one finds::" msgstr "Usando o mesmo procedimento encontra-se::" +#: ../../howto/mro.rst:272 +msgid "" +"L[C] = C + merge(DO,FO,DF)\n" +" = C + D + merge(O,FO,F)\n" +" = C + D + F + merge(O,O)\n" +" = C D F O" +msgstr "" + #: ../../howto/mro.rst:277 msgid "Now we can compute::" msgstr "Agora podemos calcular::" +#: ../../howto/mro.rst:279 +msgid "" +"L[A] = A + merge(BDEO,CDFO,BC)\n" +" = A + B + merge(DEO,CDFO,C)\n" +" = A + B + C + merge(DEO,DFO)\n" +" = A + B + C + D + merge(EO,FO)\n" +" = A + B + C + D + E + merge(O,FO)\n" +" = A + B + C + D + E + F + merge(O,O)\n" +" = A B C D E F O" +msgstr "" + #: ../../howto/mro.rst:287 msgid "" "In this example, the linearization is ordered in a pretty nice way according " @@ -474,6 +574,31 @@ msgstr "" "entanto, mesmo uma pequena modificação muda completamente a ordem da " "hierarquia:" +#: ../../howto/mro.rst:307 +msgid "" +" 6\n" +" ---\n" +"Level 3 | O |\n" +" / --- \\\n" +" / | \\\n" +" / | \\\n" +" / | \\\n" +" --- --- ---\n" +"Level 2 2 | E | 4 | D | | F | 5\n" +" --- --- ---\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" \\ / \\ /\n" +" --- ---\n" +"Level 1 1 | B | | C | 3\n" +" --- ---\n" +" \\ /\n" +" \\ /\n" +" ---\n" +"Level 0 0 | A |\n" +" ---" +msgstr "" + #: ../../howto/mro.rst:332 msgid "" "Notice that the class E, which is in the second level of the hierarchy, " @@ -504,6 +629,15 @@ msgstr "" "envolvendo um sério desacordo de ordem. Neste caso, é simples calcular as " "linearizações de O, X, Y, A e B:" +#: ../../howto/mro.rst:349 +msgid "" +"L[O] = 0\n" +"L[X] = X O\n" +"L[Y] = Y O\n" +"L[A] = A X Y O\n" +"L[B] = B Y X O" +msgstr "" + #: ../../howto/mro.rst:357 msgid "" "However, it is impossible to compute the linearization for a class C that " @@ -512,6 +646,13 @@ msgstr "" "Porém, é impossível calcular a linearização para uma classe C que herda de A " "e B::" +#: ../../howto/mro.rst:360 +msgid "" +"L[C] = C + merge(AXYO, BYXO, AB)\n" +" = C + A + merge(XYO, BYXO, B)\n" +" = C + A + B + merge(XYO, YXO)" +msgstr "" + #: ../../howto/mro.rst:364 msgid "" "At this point we cannot merge the lists XYO and YXO, since X is in the tail " @@ -552,6 +693,19 @@ msgstr "" msgid "with inheritance diagram" msgstr "com diagrama de herança" +#: ../../howto/mro.rst:386 +msgid "" +" O\n" +" |\n" +"(buy spam) F\n" +" | \\\n" +" | E (buy eggs)\n" +" | /\n" +" G\n" +"\n" +" (buy eggs or spam ?)" +msgstr "" + #: ../../howto/mro.rst:399 msgid "" "We see that class G inherits from F and E, with F *before* E: therefore we " @@ -572,6 +726,10 @@ msgstr "" "lista de precedência local, ou seja, a lista dos pais de G, não é preservada " "na linearização de G em Python 2.2::" +#: ../../howto/mro.rst:411 +msgid "L[G,P22]= G E F object # F *follows* E" +msgstr "" + #: ../../howto/mro.rst:413 msgid "" "One could argue that the reason why F follows E in the Python 2.2 " @@ -594,7 +752,7 @@ msgstr "Neste caso a MRO é GFEF e a ordem de precedência local é preservada." #: ../../howto/mro.rst:428 msgid "" "As a general rule, hierarchies such as the previous one should be avoided, " -"since it is unclear if F should override E or viceversa. Python 2.3 solves " +"since it is unclear if F should override E or vice-versa. Python 2.3 solves " "the ambiguity by raising an exception in the creation of class G, " "effectively stopping the programmer from generating ambiguous hierarchies. " "The reason for that is that the C3 algorithm fails when the merge::" @@ -605,6 +763,10 @@ msgstr "" "impedindo efetivamente o programador de gerar hierarquias ambíguas. A razão " "para isso é que o algoritmo C3 falha quando a mesclagem::" +#: ../../howto/mro.rst:435 +msgid "merge(FO,EFO,FE)" +msgstr "" + #: ../../howto/mro.rst:437 msgid "" "cannot be computed, because F is in the tail of EFO and E is in the tail of " @@ -623,6 +785,18 @@ msgstr "" "G de E e F (o mais específico primeiro) e não de F e E; neste caso a MRO é " "GEF, sem dúvida." +#: ../../howto/mro.rst:444 +msgid "" +" O\n" +" |\n" +" F (spam)\n" +" / |\n" +"(eggs) E |\n" +" \\ |\n" +" G\n" +" (eggs, no doubt)" +msgstr "" + #: ../../howto/mro.rst:456 msgid "" "Python 2.3 forces the programmer to write good hierarchies (or, at least, " @@ -689,10 +863,27 @@ msgstr "" "Para provar que a MRO para classes clássicas não é monotônica é bastante " "trivial, basta olhar o diagrama em losango:" +#: ../../howto/mro.rst:489 +msgid "" +" C\n" +" / \\\n" +" / \\\n" +"A B\n" +" \\ /\n" +" \\ /\n" +" D" +msgstr "" + #: ../../howto/mro.rst:500 msgid "One easily discerns the inconsistency::" msgstr "Percebe-se facilmente a inconsistência::" +#: ../../howto/mro.rst:502 +msgid "" +"L[B,P21] = B C # B precedes C : B's methods win\n" +"L[D,P21] = D A C B C # B follows C : C's methods win!" +msgstr "" + #: ../../howto/mro.rst:505 msgid "" "On the other hand, there are no problems with the Python 2.2 and 2.3 MROs, " @@ -701,6 +892,10 @@ msgstr "" "Por outro lado, não há problemas com as MROs do Python 2.2 e do 2.3, elas " "fornecem ambos::" +#: ../../howto/mro.rst:508 +msgid "L[D] = D A B C" +msgstr "" + #: ../../howto/mro.rst:510 msgid "" "Guido points out in his essay [#]_ that the classic MRO is not so bad in " @@ -734,6 +929,19 @@ msgstr "" "verificar essas linearizações como exercício e desenhar o diagrama de " "herança ;-) ::" +#: ../../howto/mro.rst:534 +msgid "" +"L[A] = A O\n" +"L[B] = B O\n" +"L[C] = C O\n" +"L[D] = D O\n" +"L[E] = E O\n" +"L[K1]= K1 A B C O\n" +"L[K2]= K2 D B E O\n" +"L[K3]= K3 D A O\n" +"L[Z] = Z K1 K2 K3 D A B C E O" +msgstr "" + #: ../../howto/mro.rst:544 msgid "" "Python 2.2 gives exactly the same linearizations for A, B, C, D, E, K1, K2 " @@ -742,6 +950,10 @@ msgstr "" "Python 2.2 fornece exatamente as mesmas linearizações para A, B, C, D, E, " "K1, K2 e K3, mas uma linearização diferente para Z::" +#: ../../howto/mro.rst:547 +msgid "L[Z,P22] = Z K1 K3 A K2 D B C E O" +msgstr "" + #: ../../howto/mro.rst:549 msgid "" "It is clear that this linearization is *wrong*, since A comes before D " @@ -793,6 +1005,92 @@ msgstr "" "alterar a última linha para brincar com os vários exemplos que discuti neste " "artigo.::" +#: ../../howto/mro.rst:574 +msgid "" +"#\n" +"\n" +"\"\"\"C3 algorithm by Samuele Pedroni (with readability enhanced by me)." +"\"\"\"\n" +"\n" +"class __metaclass__(type):\n" +" \"All classes are metamagically modified to be nicely printed\"\n" +" __repr__ = lambda cls: cls.__name__\n" +"\n" +"class ex_2:\n" +" \"Serious order disagreement\" #From Guido\n" +" class O: pass\n" +" class X(O): pass\n" +" class Y(O): pass\n" +" class A(X,Y): pass\n" +" class B(Y,X): pass\n" +" try:\n" +" class Z(A,B): pass #creates Z(A,B) in Python 2.2\n" +" except TypeError:\n" +" pass # Z(A,B) cannot be created in Python 2.3\n" +"\n" +"class ex_5:\n" +" \"My first example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(D,E): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_6:\n" +" \"My second example\"\n" +" class O: pass\n" +" class F(O): pass\n" +" class E(O): pass\n" +" class D(O): pass\n" +" class C(D,F): pass\n" +" class B(E,D): pass\n" +" class A(B,C): pass\n" +"\n" +"class ex_9:\n" +" \"Difference between Python 2.2 MRO and C3\" #From Samuele\n" +" class O: pass\n" +" class A(O): pass\n" +" class B(O): pass\n" +" class C(O): pass\n" +" class D(O): pass\n" +" class E(O): pass\n" +" class K1(A,B,C): pass\n" +" class K2(D,B,E): pass\n" +" class K3(D,A): pass\n" +" class Z(K1,K2,K3): pass\n" +"\n" +"def merge(seqs):\n" +" print '\\n\\nCPL[%s]=%s' % (seqs[0][0],seqs),\n" +" res = []; i=0\n" +" while 1:\n" +" nonemptyseqs=[seq for seq in seqs if seq]\n" +" if not nonemptyseqs: return res\n" +" i+=1; print '\\n',i,'round: candidates...',\n" +" for seq in nonemptyseqs: # find merge candidates among seq heads\n" +" cand = seq[0]; print ' ',cand,\n" +" nothead=[s for s in nonemptyseqs if cand in s[1:]]\n" +" if nothead: cand=None #reject candidate\n" +" else: break\n" +" if not cand: raise \"Inconsistent hierarchy\"\n" +" res.append(cand)\n" +" for seq in nonemptyseqs: # remove cand\n" +" if seq[0] == cand: del seq[0]\n" +"\n" +"def mro(C):\n" +" \"Compute the class precedence list (mro) according to C3\"\n" +" return merge([[C]]+map(mro,C.__bases__)+[list(C.__bases__)])\n" +"\n" +"def print_mro(C):\n" +" print '\\nMRO[%s]=%s' % (C,mro(C))\n" +" print '\\nP22 MRO[%s]=%s' % (C,C.mro())\n" +"\n" +"print_mro(ex_9.Z)\n" +"\n" +"#" +msgstr "" + #: ../../howto/mro.rst:656 msgid "That's all folks," msgstr "Isso é tudo, pessoal!" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index bae2ee4dc..08f45931c 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -4,7 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hemílio Lauro , 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -12,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-14 22:56+0000\n" -"PO-Revision-Date: 2023-05-24 13:07+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -95,16 +94,94 @@ msgstr "" msgid "For example, consider the following script:" msgstr "Por exemplo, considere o seguinte script:" +#: ../../howto/perf_profiling.rst:38 +msgid "" +"def foo(n):\n" +" result = 0\n" +" for _ in range(n):\n" +" result += 1\n" +" return result\n" +"\n" +"def bar(n):\n" +" foo(n)\n" +"\n" +"def baz(n):\n" +" bar(n)\n" +"\n" +"if __name__ == \"__main__\":\n" +" baz(1000000)" +msgstr "" + #: ../../howto/perf_profiling.rst:55 msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::" msgstr "" "Podemos executar ``perf`` para obter amostras de rastreamentos de pilha da " "CPU em 9999 hertz::" +#: ../../howto/perf_profiling.rst:57 +msgid "$ perf record -F 9999 -g -o perf.data python my_script.py" +msgstr "" + #: ../../howto/perf_profiling.rst:59 msgid "Then we can use ``perf report`` to analyze the data:" msgstr "Então podemos usar ``perf report`` para analisar os dados:" +#: ../../howto/perf_profiling.rst:61 +msgid "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. ..........................................\n" +"#\n" +" 91.08% 0.00% 0 python.exe python.exe [.] " +"_start\n" +" |\n" +" ---_start\n" +" |\n" +" --90.71%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--56.88%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--56.13%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--55.02%--run_mod\n" +" | | | |\n" +" | | | --54.65%--" +"PyEval_EvalCode\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | |\n" +" | | | " +"|--51.67%--_PyEval_EvalFrameDefault\n" +" | | | " +"| |\n" +" | | | " +"| |--11.52%--_PyLong_Add\n" +" | | | " +"| | |\n" +" | | | " +"| | |--2.97%--_PyObject_Malloc\n" +"..." +msgstr "" + #: ../../howto/perf_profiling.rst:100 msgid "" "As you can see, the Python functions are not shown in the output, only " @@ -126,6 +203,69 @@ msgstr "" "Em vez disso, se executarmos o mesmo experimento com o suporte ``perf`` " "ativado, obteremos:" +#: ../../howto/perf_profiling.rst:107 +msgid "" +"$ perf report --stdio -n -g\n" +"\n" +"# Children Self Samples Command Shared Object Symbol\n" +"# ........ ........ ............ .......... .................. .....................................................................\n" +"#\n" +" 90.58% 0.36% 1 python.exe python.exe [.] " +"_start\n" +" |\n" +" ---_start\n" +" |\n" +" --89.86%--__libc_start_main\n" +" Py_BytesMain\n" +" |\n" +" |--55.43%--pymain_run_python.constprop.0\n" +" | |\n" +" | |--54.71%--_PyRun_AnyFileObject\n" +" | | _PyRun_SimpleFileObject\n" +" | | |\n" +" | | |--53.62%--run_mod\n" +" | | | |\n" +" | | | --53.26%--" +"PyEval_EvalCode\n" +" | | | py::" +":/src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::baz:/" +"src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::bar:/" +"src/script.py\n" +" | | | " +"_PyEval_EvalFrameDefault\n" +" | | | " +"PyObject_Vectorcall\n" +" | | | " +"_PyEval_Vector\n" +" | | | py::foo:/" +"src/script.py\n" +" | | | |\n" +" | | | " +"|--51.81%--_PyEval_EvalFrameDefault\n" +" | | | " +"| |\n" +" | | | " +"| |--13.77%--_PyLong_Add\n" +" | | | " +"| | |\n" +" | | | " +"| | |--3.26%--_PyObject_Malloc" +msgstr "" + #: ../../howto/perf_profiling.rst:152 msgid "How to enable ``perf`` profiling support" msgstr "Como habilitar o suporte a perfilação com ``perf``" @@ -154,18 +294,47 @@ msgstr "" msgid "Example, using the environment variable::" msgstr "Exemplo usando a variável de ambiente::" +#: ../../howto/perf_profiling.rst:165 +msgid "" +"$ PYTHONPERFSUPPORT=1 python script.py\n" +"$ perf report -g -i perf.data" +msgstr "" + #: ../../howto/perf_profiling.rst:168 msgid "Example, using the :option:`!-X` option::" msgstr "Exemplo usando a opção :option:`!-X`::" +#: ../../howto/perf_profiling.rst:170 +msgid "" +"$ python -X perf script.py\n" +"$ perf report -g -i perf.data" +msgstr "" + #: ../../howto/perf_profiling.rst:173 msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" msgstr "Exemplo usando as APIs de :mod:`sys` em :file:`example.py`:" +#: ../../howto/perf_profiling.rst:175 +msgid "" +"import sys\n" +"\n" +"sys.activate_stack_trampoline(\"perf\")\n" +"do_profiled_stuff()\n" +"sys.deactivate_stack_trampoline()\n" +"\n" +"non_profiled_stuff()" +msgstr "" + #: ../../howto/perf_profiling.rst:185 msgid "...then::" msgstr "... então::" +#: ../../howto/perf_profiling.rst:187 +msgid "" +"$ python ./example.py\n" +"$ perf report -g -i perf.data" +msgstr "" + #: ../../howto/perf_profiling.rst:192 msgid "How to obtain the best results" msgstr "Como obter os melhores resultados" @@ -194,6 +363,10 @@ msgstr "" "Você pode verificar se o seu sistema foi compilado com este sinalizador " "executando::" +#: ../../howto/perf_profiling.rst:203 +msgid "$ python -m sysconfig | grep 'no-omit-frame-pointer'" +msgstr "" + #: ../../howto/perf_profiling.rst:205 msgid "" "If you don't see any output it means that your interpreter has not been " diff --git a/howto/pyporting.po b/howto/pyporting.po index a777aec33..42032fbe2 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -4,7 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hemílio Lauro , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -12,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-14 22:56+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -65,12 +64,12 @@ msgstr "" #: ../../howto/pyporting.rst:21 msgid "" -"Since Python 3.13 the original porting guide was discontinued. You can find " -"the old guide in the `archive `_." msgstr "" -"Desde o Python 3.13, o guia de portabilidade original foi descontinuado. " -"Você pode encontrar o guia antigo no `arquivo `_." #: ../../howto/pyporting.rst:27 diff --git a/howto/regex.po b/howto/regex.po index 71a2cbfa1..67b2948a0 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -4,30 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Welington Carlos , 2021 -# Ruan Aragão , 2021 -# i17obot , 2021 -# Denis Vicentainer , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Leticia Portella , 2021 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -198,6 +190,10 @@ msgstr "" "Aqui está a lista completa de metacaracteres; seus significados serão " "discutidos ao longo deste documento." +#: ../../howto/regex.rst:79 +msgid ". ^ $ * + ? { } [ ] \\ | ( )" +msgstr "" + #: ../../howto/regex.rst:83 msgid "" "The first metacharacters we'll look at are ``[`` and ``]``. They're used for " @@ -669,6 +665,14 @@ msgstr "" "para várias operações, tais como a procura por padrões de correspondência ou " "realizar substituições de strings. ::" +#: ../../howto/regex.rst:274 +msgid "" +">>> import re\n" +">>> p = re.compile('ab*')\n" +">>> p\n" +"re.compile('ab*')" +msgstr "" + #: ../../howto/regex.rst:279 msgid "" ":func:`re.compile` also accepts an optional *flags* argument, used to enable " @@ -680,6 +684,10 @@ msgstr "" "ver todas as configurações disponíveis mais tarde, mas por agora, um único " "exemplo vai servir::" +#: ../../howto/regex.rst:283 +msgid ">>> p = re.compile('ab*', re.IGNORECASE)" +msgstr "" + #: ../../howto/regex.rst:285 msgid "" "The RE is passed to :func:`re.compile` as a string. REs are handled as " @@ -939,6 +947,14 @@ msgstr "" "Primeiro, execute o interpretador Python, importe o modulo :mod:`re`, e " "compile uma RE::" +#: ../../howto/regex.rst:389 +msgid "" +">>> import re\n" +">>> p = re.compile('[a-z]+')\n" +">>> p\n" +"re.compile('[a-z]+')" +msgstr "" + #: ../../howto/regex.rst:394 msgid "" "Now, you can try matching various strings against the RE ``[a-z]+``. An " @@ -954,6 +970,13 @@ msgstr "" "saída. Você pode imprimir explicitamente o resultado de :meth:`!match` para " "deixar isso claro." +#: ../../howto/regex.rst:400 +msgid "" +">>> p.match(\"\")\n" +">>> print(p.match(\"\"))\n" +"None" +msgstr "" + #: ../../howto/regex.rst:404 msgid "" "Now, let's try it on a string that it should match, such as ``tempo``. In " @@ -965,6 +988,13 @@ msgstr "" "`objeto match `, assim que você deve armazenar o resultado em " "uma variável para uso posterior." +#: ../../howto/regex.rst:408 +msgid "" +">>> m = p.match('tempo')\n" +">>> m\n" +"" +msgstr "" + #: ../../howto/regex.rst:412 msgid "" "Now you can query the :ref:`match object ` for information " @@ -1012,6 +1042,16 @@ msgstr "" msgid "Trying these methods will soon clarify their meaning::" msgstr "Experimentando estes métodos teremos seus significado esclarecidos::" +#: ../../howto/regex.rst:431 +msgid "" +">>> m.group()\n" +"'tempo'\n" +">>> m.start(), m.end()\n" +"(0, 5)\n" +">>> m.span()\n" +"(0, 5)" +msgstr "" + #: ../../howto/regex.rst:438 msgid "" ":meth:`~re.Match.group` returns the substring that was matched by the RE. :" @@ -1032,6 +1072,18 @@ msgstr "" "Pattern.search` dos objetos padrão, varre toda a string, de modo que a " "substring correspondente pode não iniciar em zero nesse caso." +#: ../../howto/regex.rst:446 +msgid "" +">>> print(p.match('::: message'))\n" +"None\n" +">>> m = p.search('::: message'); print(m)\n" +"\n" +">>> m.group()\n" +"'message'\n" +">>> m.span()\n" +"(4, 11)" +msgstr "" + #: ../../howto/regex.rst:455 msgid "" "In actual programs, the most common style is to store the :ref:`match object " @@ -1042,6 +1094,16 @@ msgstr "" "` em uma variável e, em seguida, verificar se ela é ``None``. " "Isso geralmente se parece com::" +#: ../../howto/regex.rst:459 +msgid "" +"p = re.compile( ... )\n" +"m = p.match( 'string goes here' )\n" +"if m:\n" +" print('Match found: ', m.group())\n" +"else:\n" +" print('No match')" +msgstr "" + #: ../../howto/regex.rst:466 msgid "" "Two pattern methods return all of the matches for a pattern. :meth:`~re." @@ -1050,6 +1112,13 @@ msgstr "" "Dois métodos padrão retornam todas as correspondências de um padrão. :meth:" "`~re.Pattern.findall` retorna uma lista de strings correspondentes:" +#: ../../howto/regex.rst:469 +msgid "" +">>> p = re.compile(r'\\d+')\n" +">>> p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping')\n" +"['12', '11', '10']" +msgstr "" + #: ../../howto/regex.rst:473 msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " @@ -1071,6 +1140,19 @@ msgstr "" "sequência de instâncias :ref:`objeto match ` como um :term:" "`iterator`::" +#: ../../howto/regex.rst:483 +msgid "" +">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" +">>> iterator \n" +"\n" +">>> for match in iterator:\n" +"... print(match.span())\n" +"...\n" +"(0, 2)\n" +"(22, 24)\n" +"(29, 31)" +msgstr "" + #: ../../howto/regex.rst:495 msgid "Module-Level Functions" msgstr "Funções de Nível de Módulo" @@ -1092,6 +1174,14 @@ msgstr "" "ainda retornam ``None`` ou uma instância :ref:`objeto match `. ::" +#: ../../howto/regex.rst:504 +msgid "" +">>> print(re.match(r'From\\s+', 'Fromage amk'))\n" +"None\n" +">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998') \n" +"" +msgstr "" + #: ../../howto/regex.rst:509 msgid "" "Under the hood, these functions simply create a pattern object for you and " @@ -1320,10 +1410,30 @@ msgstr "" "Por exemplo, aqui está uma RE que usa :const:`re.VERBOSE`; veja, o quanto " "mais fácil de ler é? ::" +#: ../../howto/regex.rst:651 +msgid "" +"charref = re.compile(r\"\"\"\n" +" &[#] # Start of a numeric entity reference\n" +" (\n" +" 0[0-7]+ # Octal form\n" +" | [0-9]+ # Decimal form\n" +" | x[0-9a-fA-F]+ # Hexadecimal form\n" +" )\n" +" ; # Trailing semicolon\n" +"\"\"\", re.VERBOSE)" +msgstr "" + #: ../../howto/regex.rst:661 msgid "Without the verbose setting, the RE would look like this::" msgstr "Sem o \"verbose\" definido, A RE iria se parecer como isto::" +#: ../../howto/regex.rst:663 +msgid "" +"charref = re.compile(\"&#(0[0-7]+\"\n" +" \"|[0-9]+\"\n" +" \"|x[0-9a-fA-F]+);\")" +msgstr "" + #: ../../howto/regex.rst:667 msgid "" "In the above example, Python's automatic concatenation of string literals " @@ -1427,6 +1537,14 @@ msgstr "" "Por exemplo, para ter correspondência com a palavra ``From`` apenas no " "início de uma linha, aRE a ser usada é ``^From``. ::" +#: ../../howto/regex.rst:714 +msgid "" +">>> print(re.search('^From', 'From Here to Eternity')) \n" +"\n" +">>> print(re.search('^From', 'Reciting From Memory'))\n" +"None" +msgstr "" + #: ../../howto/regex.rst:719 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "" @@ -1443,6 +1561,16 @@ msgstr "" "Corresponde ao fim de uma linha, que tanto é definido como o fim de uma " "string, ou qualquer local seguido por um caractere de nova linha. ::" +#: ../../howto/regex.rst:725 +msgid "" +">>> print(re.search('}$', '{block}')) \n" +"\n" +">>> print(re.search('}$', '{block} '))\n" +"None\n" +">>> print(re.search('}$', '{block}\\n')) \n" +"" +msgstr "" + #: ../../howto/regex.rst:732 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " @@ -1501,6 +1629,17 @@ msgstr "" "O exemplo a seguir corresponde a ``class`` apenas quando é a palavra exata; " "ele não irá corresponder quando for contido dentro de uma outra palavra. ::" +#: ../../howto/regex.rst:753 +msgid "" +">>> p = re.compile(r'\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"\n" +">>> print(p.search('the declassified algorithm'))\n" +"None\n" +">>> print(p.search('one subclass is'))\n" +"None" +msgstr "" + #: ../../howto/regex.rst:761 msgid "" "There are two subtleties you should remember when using this special " @@ -1519,6 +1658,15 @@ msgstr "" "não irá funcionar da maneira que você espera. O exemplo a seguir parece " "igual a nossa RE anterior, mas omite o ``r`` na frente da string RE. ::" +#: ../../howto/regex.rst:769 +msgid "" +">>> p = re.compile('\\bclass\\b')\n" +">>> print(p.search('no class at all'))\n" +"None\n" +">>> print(p.search('\\b' + 'class' + '\\b'))\n" +"" +msgstr "" + #: ../../howto/regex.rst:775 msgid "" "Second, inside a character class, where there's no use for this assertion, " @@ -1561,6 +1709,14 @@ msgstr "" "exemplo, uma linha de cabeçalho RFC-822 é dividida em um nome de cabeçalho e " "um valor, separados por um ``':'``, como essa:" +#: ../../howto/regex.rst:793 +msgid "" +"From: author@example.com\n" +"User-Agent: Thunderbird 1.5.0.9 (X11/20061227)\n" +"MIME-Version: 1.0\n" +"To: editor@example.com" +msgstr "" + #: ../../howto/regex.rst:800 msgid "" "This can be handled by writing a regular expression which matches an entire " @@ -1587,6 +1743,13 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" +#: ../../howto/regex.rst:811 +msgid "" +">>> p = re.compile('(ab)*')\n" +">>> print(p.match('ababababab').span())\n" +"(0, 10)" +msgstr "" + #: ../../howto/regex.rst:815 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " @@ -1599,6 +1762,16 @@ msgid "" "they match. ::" msgstr "" +#: ../../howto/regex.rst:824 +msgid "" +">>> p = re.compile('(a)b')\n" +">>> m = p.match('ab')\n" +">>> m.group()\n" +"'ab'\n" +">>> m.group(0)\n" +"'ab'" +msgstr "" + #: ../../howto/regex.rst:831 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " @@ -1610,6 +1783,18 @@ msgstr "" "número, basta contar os caracteres de abertura de parêntese - ``(``, indo da " "esquerda para a direita. ::" +#: ../../howto/regex.rst:835 +msgid "" +">>> p = re.compile('(a(b)c)d')\n" +">>> m = p.match('abcd')\n" +">>> m.group(0)\n" +"'abcd'\n" +">>> m.group(1)\n" +"'abc'\n" +">>> m.group(2)\n" +"'b'" +msgstr "" + #: ../../howto/regex.rst:844 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " @@ -1620,6 +1805,12 @@ msgstr "" "nesse caso ele irá retornar uma tupla contendo os valores correspondentes " "desses grupos." +#: ../../howto/regex.rst:847 +msgid "" +">>> m.group(2,1,2)\n" +"('b', 'abc', 'b')" +msgstr "" + #: ../../howto/regex.rst:850 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " @@ -1629,6 +1820,12 @@ msgstr "" "todos os subgrupos, de 1 até o último. Independente da quantidade de " "subgrupos informada. ::" +#: ../../howto/regex.rst:853 +msgid "" +">>> m.groups()\n" +"('abc', 'b')" +msgstr "" + #: ../../howto/regex.rst:856 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " @@ -1653,6 +1850,13 @@ msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" "Por exemplo, a seguinte RE detecta palavras duplicadas em uma string. ::" +#: ../../howto/regex.rst:866 +msgid "" +">>> p = re.compile(r'\\b(\\w+)\\s+\\1\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" +msgstr "" + #: ../../howto/regex.rst:870 msgid "" "Backreferences like this aren't often useful for just searching through a " @@ -1739,6 +1943,16 @@ msgstr "" "``(?:...)``, onde você pode substituir o ``...`` por qualquer outra " "expressão regular. ::" +#: ../../howto/regex.rst:912 +msgid "" +">>> m = re.match(\"([abc])+\", \"abc\")\n" +">>> m.groups()\n" +"('c',)\n" +">>> m = re.match(\"(?:[abc])+\", \"abc\")\n" +">>> m.groups()\n" +"()" +msgstr "" + #: ../../howto/regex.rst:919 msgid "" "Except for the fact that you can't retrieve the contents of what the group " @@ -1789,12 +2003,29 @@ msgstr "" "Os grupos nomeados ainda recebem números, então você pode recuperar " "informações sobre um grupo de duas maneiras::" +#: ../../howto/regex.rst:939 +msgid "" +">>> p = re.compile(r'(?P\\b\\w+\\b)')\n" +">>> m = p.search( '(((( Lots of punctuation )))' )\n" +">>> m.group('word')\n" +"'Lots'\n" +">>> m.group(1)\n" +"'Lots'" +msgstr "" + #: ../../howto/regex.rst:946 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" msgstr "" +#: ../../howto/regex.rst:949 +msgid "" +">>> m = re.match(r'(?P\\w+) (?P\\w+)', 'Jane Doe')\n" +">>> m.groupdict()\n" +"{'first': 'Jane', 'last': 'Doe'}" +msgstr "" + #: ../../howto/regex.rst:953 msgid "" "Named groups are handy because they let you use easily remembered names, " @@ -1805,6 +2036,16 @@ msgstr "" "fácil lembrança, em vez de ter que lembrar de números. Aqui está um exemplo " "de RE usando o módulo :mod:`imaplib`::" +#: ../../howto/regex.rst:957 +msgid "" +"InternalDate = re.compile(r'INTERNALDATE \"'\n" +" r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-'\n" +" r'(?P[0-9][0-9][0-9][0-9])'\n" +" r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])'\n" +" r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'\n" +" r'\"')" +msgstr "" + #: ../../howto/regex.rst:964 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " @@ -1831,6 +2072,13 @@ msgstr "" "encontrar palavras duplicadas, ``(\\b\\w+)\\s+\\1``, também pode ser escrita " "como ``(?P\\b\\w+)\\s+(?P=word)``::" +#: ../../howto/regex.rst:974 +msgid "" +">>> p = re.compile(r'\\b(?P\\w+)\\s+(?P=word)\\b')\n" +">>> p.search('Paris in the the spring').group()\n" +"'the the'" +msgstr "" + #: ../../howto/regex.rst:980 msgid "Lookahead Assertions" msgstr "Asserções lookahead" @@ -2104,6 +2352,15 @@ msgstr "" "como o elemento final da lista. No exemplo a seguir, o delimitador é " "qualquer sequência de caracteres não alfanuméricos. ::" +#: ../../howto/regex.rst:1104 +msgid "" +">>> p = re.compile(r'\\W+')\n" +">>> p.split('This is a test, short and sweet, of split().')\n" +"['This', 'is', 'a', 'test', 'short', 'and', 'sweet', 'of', 'split', '']\n" +">>> p.split('This is a test, short and sweet, of split().', 3)\n" +"['This', 'is', 'a', 'test, short and sweet, of split().']" +msgstr "" + #: ../../howto/regex.rst:1110 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " @@ -2117,6 +2374,16 @@ msgstr "" "valores são também retornados como parte da lista. Compare as seguintes " "chamadas::" +#: ../../howto/regex.rst:1115 +msgid "" +">>> p = re.compile(r'\\W+')\n" +">>> p2 = re.compile(r'(\\W+)')\n" +">>> p.split('This... is a test.')\n" +"['This', 'is', 'a', 'test', '']\n" +">>> p2.split('This... is a test.')\n" +"['This', '... ', 'is', ' ', 'a', ' ', 'test', '.', '']" +msgstr "" + #: ../../howto/regex.rst:1122 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " @@ -2125,6 +2392,16 @@ msgstr "" "A função de nível de módulo :func:`re.split` adiciona a RE a ser utilizada " "como o primeiro argumento, mas é, em determinadas circunstâncias, a mesma. ::" +#: ../../howto/regex.rst:1125 +msgid "" +">>> re.split(r'[\\W]+', 'Words, words, words.')\n" +"['Words', 'words', 'words', '']\n" +">>> re.split(r'([\\W]+)', 'Words, words, words.')\n" +"['Words', ', ', 'words', ', ', 'words', '.', '']\n" +">>> re.split(r'[\\W]+', 'Words, words, words.', 1)\n" +"['Words', 'words, words.']" +msgstr "" + #: ../../howto/regex.rst:1134 msgid "Search and Replace" msgstr "Busca e Substituição" @@ -2169,6 +2446,15 @@ msgstr "" "Aqui está um exemplo simples do uso do método :meth:`~re.Pattern.sub`. Ele " "substitui nomes de cores pela palavra ``colour``::" +#: ../../howto/regex.rst:1154 +msgid "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.sub('colour', 'blue socks and red shoes')\n" +"'colour socks and colour shoes'\n" +">>> p.sub('colour', 'blue socks and red shoes', count=1)\n" +"'colour socks and red shoes'" +msgstr "" + #: ../../howto/regex.rst:1160 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" @@ -2179,6 +2465,15 @@ msgstr "" "tupla com duas informações; contém uma string com novo valor e o número de " "substituições que foram realizadas:" +#: ../../howto/regex.rst:1163 +msgid "" +">>> p = re.compile('(blue|white|red)')\n" +">>> p.subn('colour', 'blue socks and red shoes')\n" +"('colour socks and colour shoes', 2)\n" +">>> p.subn('colour', 'no colours at all')\n" +"('no colours at all', 0)" +msgstr "" + #: ../../howto/regex.rst:1169 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " @@ -2187,6 +2482,13 @@ msgstr "" "Correspondências vazias somente são substituídas quando não estão adjacente " "(próxima) a uma correspondência vazia anterior." +#: ../../howto/regex.rst:1172 +msgid "" +">>> p = re.compile('x*')\n" +">>> p.sub('-', 'abxd')\n" +"'-a-b--d-'" +msgstr "" + #: ../../howto/regex.rst:1176 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " @@ -2213,6 +2515,13 @@ msgstr "" "Este exemplo corresponde com a palavra ``section``, seguida por uma string " "colocada entre ``{, }`` e altera ``section`` para ``subsection``::" +#: ../../howto/regex.rst:1186 +msgid "" +">>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First} section{second}')\n" +"'subsection{First} subsection{second}'" +msgstr "" + #: ../../howto/regex.rst:1190 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" @@ -2234,6 +2543,17 @@ msgstr "" "substituições a seguir são todas equivalentes, mas usam todas as três " "variações da string de substituição. ::" +#: ../../howto/regex.rst:1199 +msgid "" +">>> p = re.compile('section{ (?P [^}]* ) }', re.VERBOSE)\n" +">>> p.sub(r'subsection{\\1}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g<1>}','section{First}')\n" +"'subsection{First}'\n" +">>> p.sub(r'subsection{\\g}','section{First}')\n" +"'subsection{First}'" +msgstr "" + #: ../../howto/regex.rst:1207 msgid "" "*replacement* can also be a function, which gives you even more control. If " @@ -2257,6 +2577,18 @@ msgstr "" "No exemplo a seguir, a função de substituição traduz decimais em " "hexadecimal::" +#: ../../howto/regex.rst:1216 +msgid "" +">>> def hexrepl(match):\n" +"... \"Return the hex string for a decimal number\"\n" +"... value = int(match.group())\n" +"... return hex(value)\n" +"...\n" +">>> p = re.compile(r'\\d+')\n" +">>> p.sub(hexrepl, 'Call 65490 for printing, 49152 for user code.')\n" +"'Call 0xffd2 for printing, 0xc000 for user code.'" +msgstr "" + #: ../../howto/regex.rst:1225 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " @@ -2377,6 +2709,14 @@ msgstr "" "sucedida que começa em 0; se a correspondência não começar em zero, :func:`!" "match` não vai reportá-la." +#: ../../howto/regex.rst:1279 +msgid "" +">>> print(re.match('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.match('super', 'insuperable'))\n" +"None" +msgstr "" + #: ../../howto/regex.rst:1284 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " @@ -2385,6 +2725,14 @@ msgstr "" "Por outro lado, :func:`~re.search` fará a varredura percorrendo a string e " "relatando a primeira correspondência que encontrar." +#: ../../howto/regex.rst:1287 +msgid "" +">>> print(re.search('super', 'superstition').span())\n" +"(0, 5)\n" +">>> print(re.search('super', 'insuperable').span())\n" +"(2, 7)" +msgstr "" + #: ../../howto/regex.rst:1292 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." @@ -2436,6 +2784,17 @@ msgstr "" "para combinar uma única tag HTML não funciona por causa da natureza gulosa " "de ``.*``. ::" +#: ../../howto/regex.rst:1315 +msgid "" +">>> s = 'Title'\n" +">>> len(s)\n" +"32\n" +">>> print(re.match('<.*>', s).span())\n" +"(0, 32)\n" +">>> print(re.match('<.*>', s).group())\n" +"Title" +msgstr "" + #: ../../howto/regex.rst:1323 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " @@ -2467,6 +2826,12 @@ msgstr "" "caractere de cada vez, experimentado ``'>'`` a cada passo. Isso produz " "justamente o resultado correto::" +#: ../../howto/regex.rst:1336 +msgid "" +">>> print(re.match('<.*?>', s).group())\n" +"" +msgstr "" + #: ../../howto/regex.rst:1339 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" @@ -2529,10 +2894,26 @@ msgstr "" "caractere ``#`` até a próxima nova linha. Quando usados junto com strings de " "aspas triplas, isso permite as REs serem formatadas mais ordenadamente::" +#: ../../howto/regex.rst:1366 +msgid "" +"pat = re.compile(r\"\"\"\n" +" \\s* # Skip leading whitespace\n" +" (?P
[^:]+) # Header name\n" +" \\s* : # Whitespace, and a colon\n" +" (?P.*?) # The header's value -- *? used to\n" +" # lose the following trailing whitespace\n" +" \\s*$ # Trailing whitespace to end-of-line\n" +"\"\"\", re.VERBOSE)" +msgstr "" + #: ../../howto/regex.rst:1375 msgid "This is far more readable than::" msgstr "Isso é muito mais legível do que::" +#: ../../howto/regex.rst:1377 +msgid "pat = re.compile(r\"\\s*(?P
[^:]+)\\s*:(?P.*?)\\s*$\")" +msgstr "" + #: ../../howto/regex.rst:1381 msgid "Feedback" msgstr "Comentários" diff --git a/howto/sockets.po b/howto/sockets.po index 430da46e9..e00b9442c 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-26 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -138,6 +135,14 @@ msgstr "" "De forma geral, quando clicastes no link que te trouxe até esta página " "(documentação do Python), o que o teu navegador fez, foi o seguinte::" +#: ../../howto/sockets.rst:59 +msgid "" +"# create an INET, STREAMing socket\n" +"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# now connect to the web server on port 80 - the normal http port\n" +"s.connect((\"www.python.org\", 80))" +msgstr "" + #: ../../howto/sockets.rst:64 msgid "" "When the ``connect`` completes, the socket ``s`` can be used to send in a " @@ -160,6 +165,16 @@ msgstr "" "O que acontece no lado do servidor Web é um pouco mais complexo. Primeiro, o " "Servidor Web cria um \"soquete tipo servidor\"::" +#: ../../howto/sockets.rst:73 +msgid "" +"# create an INET, STREAMing socket\n" +"serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"# bind the socket to a public host, and a well-known port\n" +"serversocket.bind((socket.gethostname(), 80))\n" +"# become a server socket\n" +"serversocket.listen(5)" +msgstr "" + #: ../../howto/sockets.rst:80 msgid "" "A couple things to notice: we used ``socket.gethostname()`` so that the " @@ -208,6 +223,17 @@ msgstr "" "Agora que temos um soquete tipo \"servidor\", que está ouvindo a porta 80, " "podemos entrar no mainloop do servidor web::" +#: ../../howto/sockets.rst:98 +msgid "" +"while True:\n" +" # accept connections from outside\n" +" (clientsocket, address) = serversocket.accept()\n" +" # now do something with the clientsocket\n" +" # in this case, we'll pretend this is a threaded server\n" +" ct = client_thread(clientsocket)\n" +" ct.run()" +msgstr "" + #: ../../howto/sockets.rst:106 msgid "" "There's actually 3 general ways in which this loop could work - dispatching " @@ -369,6 +395,43 @@ msgid "" "fixed length message::" msgstr "" +#: ../../howto/sockets.rst:183 +msgid "" +"class MySocket:\n" +" \"\"\"demonstration class only\n" +" - coded for clarity, not efficiency\n" +" \"\"\"\n" +"\n" +" def __init__(self, sock=None):\n" +" if sock is None:\n" +" self.sock = socket.socket(\n" +" socket.AF_INET, socket.SOCK_STREAM)\n" +" else:\n" +" self.sock = sock\n" +"\n" +" def connect(self, host, port):\n" +" self.sock.connect((host, port))\n" +"\n" +" def mysend(self, msg):\n" +" totalsent = 0\n" +" while totalsent < MSGLEN:\n" +" sent = self.sock.send(msg[totalsent:])\n" +" if sent == 0:\n" +" raise RuntimeError(\"socket connection broken\")\n" +" totalsent = totalsent + sent\n" +"\n" +" def myreceive(self):\n" +" chunks = []\n" +" bytes_recd = 0\n" +" while bytes_recd < MSGLEN:\n" +" chunk = self.sock.recv(min(MSGLEN - bytes_recd, 2048))\n" +" if chunk == b'':\n" +" raise RuntimeError(\"socket connection broken\")\n" +" chunks.append(chunk)\n" +" bytes_recd = bytes_recd + len(chunk)\n" +" return b''.join(chunks)" +msgstr "" + #: ../../howto/sockets.rst:217 msgid "" "The sending code here is usable for almost any messaging scheme - in Python " @@ -561,6 +624,16 @@ msgid "" "Python, you'll have little trouble with it in C::" msgstr "" +#: ../../howto/sockets.rst:345 +msgid "" +"ready_to_read, ready_to_write, in_error = \\\n" +" select.select(\n" +" potential_readers,\n" +" potential_writers,\n" +" potential_errs,\n" +" timeout)" +msgstr "" + #: ../../howto/sockets.rst:352 msgid "" "You pass ``select`` three lists: the first contains all sockets that you " diff --git a/howto/sorting.po b/howto/sorting.po index 38504bb3a..d5dd04de7 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Lucas Sanches , 2021 -# Hildeberto Abreu Magalhães , 2022 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-23 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -68,6 +65,12 @@ msgstr "" "Uma ordenação ascendente simples é muito fácil: apenas chame a função :func:" "`sorted`. Retorna uma nova lista ordenada:" +#: ../../howto/sorting.rst:22 +msgid "" +">>> sorted([5, 2, 3, 1, 4])\n" +"[1, 2, 3, 4, 5]" +msgstr "" + #: ../../howto/sorting.rst:27 msgid "" "You can also use the :meth:`list.sort` method. It modifies the list in-place " @@ -80,6 +83,14 @@ msgstr "" "menos conveniente que a função :func:`sorted` - mas se você não precisará da " "lista original, esta maneira é levemente mais eficiente." +#: ../../howto/sorting.rst:32 +msgid "" +">>> a = [5, 2, 3, 1, 4]\n" +">>> a.sort()\n" +">>> a\n" +"[1, 2, 3, 4, 5]" +msgstr "" + #: ../../howto/sorting.rst:39 msgid "" "Another difference is that the :meth:`list.sort` method is only defined for " @@ -88,6 +99,12 @@ msgstr "" "Outra diferença é que o método :meth:`list.sort` é aplicável apenas às " "listas. Em contrapartida, a função :func:`sorted` aceita qualquer iterável." +#: ../../howto/sorting.rst:42 +msgid "" +">>> sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})\n" +"[1, 2, 3, 4, 5]" +msgstr "" + #: ../../howto/sorting.rst:48 msgid "Key Functions" msgstr "Funções Chave" @@ -106,6 +123,12 @@ msgstr "" msgid "For example, here's a case-insensitive string comparison:" msgstr "Por exemplo, aqui há uma comparação case-insensitive de strings." +#: ../../howto/sorting.rst:56 +msgid "" +">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n" +"['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']" +msgstr "" + #: ../../howto/sorting.rst:61 msgid "" "The value of the *key* parameter should be a function (or other callable) " @@ -126,6 +149,17 @@ msgstr "" "Uma padrão comum é ordenar objetos complexos utilizando algum índice do " "objeto como chave. Por exemplo:" +#: ../../howto/sorting.rst:69 +msgid "" +">>> student_tuples = [\n" +"... ('john', 'A', 15),\n" +"... ('jane', 'B', 12),\n" +"... ('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + #: ../../howto/sorting.rst:79 msgid "" "The same technique works for objects with named attributes. For example:" @@ -133,6 +167,26 @@ msgstr "" "A mesma técnica funciona com objetos que possuem atributos nomeados. Por " "exemplo:" +#: ../../howto/sorting.rst:81 +msgid "" +">>> class Student:\n" +"... def __init__(self, name, grade, age):\n" +"... self.name = name\n" +"... self.grade = grade\n" +"... self.age = age\n" +"... def __repr__(self):\n" +"... return repr((self.name, self.grade, self.age))\n" +"\n" +">>> student_objects = [\n" +"... Student('john', 'A', 15),\n" +"... Student('jane', 'B', 12),\n" +"... Student('dave', 'B', 10),\n" +"... ]\n" +">>> sorted(student_objects, key=lambda student: student.age) # sort by " +"age\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + #: ../../howto/sorting.rst:99 msgid "" "Objects with named attributes can be made by a regular class as shown above, " @@ -162,6 +216,17 @@ msgstr "" "Usando estas funções, os exemplos acima se tornam mais simples e mais " "rápidos:" +#: ../../howto/sorting.rst:113 +msgid "" +">>> from operator import itemgetter, attrgetter\n" +"\n" +">>> sorted(student_tuples, key=itemgetter(2))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + #: ../../howto/sorting.rst:123 msgid "" "The operator module functions allow multiple levels of sorting. For example, " @@ -170,6 +235,15 @@ msgstr "" "As funções do módulo operator permite múltiplos níveis de ordenação. Por " "exemplo, ordenar por *grade* e então por *age*:" +#: ../../howto/sorting.rst:126 +msgid "" +">>> sorted(student_tuples, key=itemgetter(1,2))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('grade', 'age'))\n" +"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]" +msgstr "" + #: ../../howto/sorting.rst:134 msgid "" "The :mod:`functools` module provides another helpful tool for making key-" @@ -178,6 +252,20 @@ msgid "" "it suitable for use as a key-function." msgstr "" +#: ../../howto/sorting.rst:139 +msgid "" +">>> from functools import partial\n" +">>> from unicodedata import normalize\n" +"\n" +">>> names = 'Zoë Åbjørn Núñez Élana Zeke Abe Nubia Eloise'.split()\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFD'))\n" +"['Abe', 'Åbjørn', 'Eloise', 'Élana', 'Nubia', 'Núñez', 'Zeke', 'Zoë']\n" +"\n" +">>> sorted(names, key=partial(normalize, 'NFC'))\n" +"['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']" +msgstr "" + #: ../../howto/sorting.rst:153 msgid "Ascending and Descending" msgstr "Ascendente e descendente" @@ -193,6 +281,15 @@ msgstr "" "ordenações descendentes. Por exemplo, para retornar os dados de estudantes " "pela ordem inversa de *age*:" +#: ../../howto/sorting.rst:159 +msgid "" +">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]\n" +"\n" +">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" +msgstr "" + #: ../../howto/sorting.rst:168 msgid "Sort Stability and Complex Sorts" msgstr "Estabilidade de Ordenação e Ordenações Complexas" @@ -207,6 +304,13 @@ msgstr "" "Sorting_algorithm#Stability>`_\\. Isso significa que quando múltiplos " "registros possuem a mesma chave, eles terão sua ordem original preservada." +#: ../../howto/sorting.rst:174 +msgid "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> sorted(data, key=itemgetter(0))\n" +"[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]" +msgstr "" + #: ../../howto/sorting.rst:180 msgid "" "Notice how the two records for *blue* retain their original order so that " @@ -226,6 +330,15 @@ msgstr "" "de estudante por ordem descendente de *grade* e então ascendente de *age*, " "primeiro ordene *age* e depois ordene novamente utilizando *grade*:" +#: ../../howto/sorting.rst:187 +msgid "" +">>> s = sorted(student_objects, key=attrgetter('age')) # sort on " +"secondary key\n" +">>> sorted(s, key=attrgetter('grade'), reverse=True) # now sort on " +"primary key, descending\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + #: ../../howto/sorting.rst:193 msgid "" "This can be abstracted out into a wrapper function that can take a list and " @@ -234,6 +347,17 @@ msgstr "" "Isso pode ser abstrato no caso das funções invólucros que podem receber uma " "lista e uma tupla com o campos e então ordená-los em múltiplos passos." +#: ../../howto/sorting.rst:196 +msgid "" +">>> def multisort(xs, specs):\n" +"... for key, reverse in reversed(specs):\n" +"... xs.sort(key=attrgetter(key), reverse=reverse)\n" +"... return xs\n" +"\n" +">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + #: ../../howto/sorting.rst:206 msgid "" "The `Timsort `_ algorithm used in " @@ -281,6 +405,15 @@ msgstr "" "Por exemplo, para ordenar os dados dos estudantes por *grade* usando a " "abordagem DSU:" +#: ../../howto/sorting.rst:224 +msgid "" +">>> decorated = [(student.grade, i, student) for i, student in " +"enumerate(student_objects)]\n" +">>> decorated.sort()\n" +">>> [student for grade, i, student in decorated] # undecorate\n" +"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" +msgstr "" + #: ../../howto/sorting.rst:231 msgid "" "This idiom works because tuples are compared lexicographically; the first " @@ -371,6 +504,10 @@ msgid "" "function::" msgstr "" +#: ../../howto/sorting.rst:273 +msgid "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order" +msgstr "" + #: ../../howto/sorting.rst:276 msgid "Odds and Ends" msgstr "Curiosidades e conclusões" @@ -395,6 +532,17 @@ msgstr "" "efeito pode ser simulado sem o parâmetro usando a função embutida :func:" "`reversed` duas vezes:" +#: ../../howto/sorting.rst:288 +msgid "" +">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" +">>> standard_way = sorted(data, key=itemgetter(0), reverse=True)\n" +">>> double_reversed = list(reversed(sorted(reversed(data), " +"key=itemgetter(0))))\n" +">>> assert standard_way == double_reversed\n" +">>> standard_way\n" +"[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]" +msgstr "" + #: ../../howto/sorting.rst:297 msgid "" "The sort routines use ``<`` when making comparisons between two objects. So, " @@ -405,6 +553,13 @@ msgstr "" "objetos. Portanto, é fácil adicionar uma ordem de classificação padrão a uma " "classe definindo um método :meth:`~object.__lt__`:" +#: ../../howto/sorting.rst:301 +msgid "" +">>> Student.__lt__ = lambda self, other: self.age < other.age\n" +">>> sorted(student_objects)\n" +"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +msgstr "" + #: ../../howto/sorting.rst:307 msgid "" "However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" @@ -427,6 +582,14 @@ msgstr "" "dicionário, elas poderão ser usadas para ordenar uma lista separada de nomes " "de alunos:" +#: ../../howto/sorting.rst:319 +msgid "" +">>> students = ['dave', 'john', 'jane']\n" +">>> newgrades = {'john': 'F', 'jane':'A', 'dave': 'C'}\n" +">>> sorted(students, key=newgrades.__getitem__)\n" +"['jane', 'dave', 'john']" +msgstr "" + #: ../../howto/sorting.rst:327 msgid "Partial Sorts" msgstr "Ordenações parciais" diff --git a/howto/unicode.po b/howto/unicode.po index a75d4fc1a..1bf4ba1c4 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Leticia Portella , 2021 -# Otávio Carneiro , 2021 -# Victor Matheus Castro , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -119,6 +113,25 @@ msgstr "" "O padrão Unicode contém várias tabelas listando caracteres e seus pontos de " "código:" +#: ../../howto/unicode.rst:53 +msgid "" +"0061 'a'; LATIN SMALL LETTER A\n" +"0062 'b'; LATIN SMALL LETTER B\n" +"0063 'c'; LATIN SMALL LETTER C\n" +"...\n" +"007B '{'; LEFT CURLY BRACKET\n" +"...\n" +"2167 'Ⅷ'; ROMAN NUMERAL EIGHT\n" +"2168 'Ⅸ'; ROMAN NUMERAL NINE\n" +"...\n" +"265E '♞'; BLACK CHESS KNIGHT\n" +"265F '♟'; BLACK CHESS PAWN\n" +"...\n" +"1F600 '😀'; GRINNING FACE\n" +"1F609 '😉'; WINKING FACE\n" +"..." +msgstr "" + #: ../../howto/unicode.rst:71 msgid "" "Strictly, these definitions imply that it's meaningless to say 'this is " @@ -166,6 +179,13 @@ msgid "" "representation, the string \"Python\" might look like this:" msgstr "" +#: ../../howto/unicode.rst:101 +msgid "" +" P y t h o n\n" +"0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00\n" +" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" +msgstr "" + #: ../../howto/unicode.rst:107 msgid "" "This representation is straightforward but using it presents a number of " @@ -345,11 +365,28 @@ msgid "" "include a Unicode character in a string literal::" msgstr "" +#: ../../howto/unicode.rst:199 +msgid "" +"try:\n" +" with open('/tmp/input.txt', 'r') as f:\n" +" ...\n" +"except OSError:\n" +" # 'File not found' error message.\n" +" print(\"Fichier non trouvé\")" +msgstr "" + #: ../../howto/unicode.rst:206 msgid "" "Side note: Python 3 also supports using Unicode characters in identifiers::" msgstr "" +#: ../../howto/unicode.rst:208 +msgid "" +"répertoire = \"/tmp/records.log\"\n" +"with open(répertoire, \"w\") as f:\n" +" f.write(\"test\\n\")" +msgstr "" + #: ../../howto/unicode.rst:212 msgid "" "If you can't enter a particular character in your editor or want to keep the " @@ -358,6 +395,16 @@ msgid "" "delta glyph instead of a \\u escape.) ::" msgstr "" +#: ../../howto/unicode.rst:217 +msgid "" +">>> \"\\N{GREEK CAPITAL LETTER DELTA}\" # Using the character name\n" +"'\\u0394'\n" +">>> \"\\u0394\" # Using a 16-bit hex value\n" +"'\\u0394'\n" +">>> \"\\U00000394\" # Using a 32-bit hex value\n" +"'\\u0394'" +msgstr "" + #: ../../howto/unicode.rst:224 msgid "" "In addition, one can create a string using the :func:`~bytes.decode` method " @@ -376,6 +423,21 @@ msgid "" "examples show the differences::" msgstr "" +#: ../../howto/unicode.rst:236 +msgid "" +">>> b'\\x80abc'.decode(\"utf-8\", \"strict\") \n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:\n" +" invalid start byte\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"replace\")\n" +"'\\ufffdabc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"backslashreplace\")\n" +"'\\\\x80abc'\n" +">>> b'\\x80abc'.decode(\"utf-8\", \"ignore\")\n" +"'abc'" +msgstr "" + #: ../../howto/unicode.rst:248 msgid "" "Encodings are specified as strings containing the encoding's name. Python " @@ -394,6 +456,14 @@ msgid "" "returns the code point value::" msgstr "" +#: ../../howto/unicode.rst:260 +msgid "" +">>> chr(57344)\n" +"'\\ue000'\n" +">>> ord('\\ue000')\n" +"57344" +msgstr "" + #: ../../howto/unicode.rst:266 msgid "Converting to Bytes" msgstr "Convertendo para Bytes" @@ -420,6 +490,28 @@ msgstr "" msgid "The following example shows the different results::" msgstr "" +#: ../../howto/unicode.rst:282 +msgid "" +">>> u = chr(40960) + 'abcd' + chr(1972)\n" +">>> u.encode('utf-8')\n" +"b'\\xea\\x80\\x80abcd\\xde\\xb4'\n" +">>> u.encode('ascii') \n" +"Traceback (most recent call last):\n" +" ...\n" +"UnicodeEncodeError: 'ascii' codec can't encode character '\\ua000' in\n" +" position 0: ordinal not in range(128)\n" +">>> u.encode('ascii', 'ignore')\n" +"b'abcd'\n" +">>> u.encode('ascii', 'replace')\n" +"b'?abcd?'\n" +">>> u.encode('ascii', 'xmlcharrefreplace')\n" +"b'ꀀabcd޴'\n" +">>> u.encode('ascii', 'backslashreplace')\n" +"b'\\\\ua000abcd\\\\u07b4'\n" +">>> u.encode('ascii', 'namereplace')\n" +"b'\\\\N{YI SYLLABLE IT}abcd\\\\u07b4'" +msgstr "" + #: ../../howto/unicode.rst:301 msgid "" "The low-level routines for registering and accessing the available encodings " @@ -442,6 +534,16 @@ msgid "" "digits, not four::" msgstr "" +#: ../../howto/unicode.rst:317 +msgid "" +">>> s = \"a\\xac\\u1234\\u20ac\\U00008000\"\n" +"... # ^^^^ two-digit hex escape\n" +"... # ^^^^^^ four-digit Unicode escape\n" +"... # ^^^^^^^^^^ eight-digit Unicode escape\n" +">>> [ord(c) for c in s]\n" +"[97, 172, 4660, 8364, 32768]" +msgstr "" + #: ../../howto/unicode.rst:324 msgid "" "Using escape sequences for code points greater than 127 is fine in small " @@ -467,6 +569,15 @@ msgid "" "file::" msgstr "" +#: ../../howto/unicode.rst:339 +msgid "" +"#!/usr/bin/env python\n" +"# -*- coding: latin-1 -*-\n" +"\n" +"u = 'abcdé'\n" +"print(ord(u[-1]))" +msgstr "" + #: ../../howto/unicode.rst:345 msgid "" "The syntax is inspired by Emacs's notation for specifying variables local to " @@ -504,10 +615,34 @@ msgstr "" "O programa a seguir exibe alguma informação sobre diversos caracteres e " "imprime o valor numérico de um caractere em particular::" +#: ../../howto/unicode.rst:369 +msgid "" +"import unicodedata\n" +"\n" +"u = chr(233) + chr(0x0bf2) + chr(3972) + chr(6000) + chr(13231)\n" +"\n" +"for i, c in enumerate(u):\n" +" print(i, '%04x' % ord(c), unicodedata.category(c), end=\" \")\n" +" print(unicodedata.name(c))\n" +"\n" +"# Get numeric value of second character\n" +"print(unicodedata.numeric(u[1]))" +msgstr "" + #: ../../howto/unicode.rst:380 msgid "When run, this prints:" msgstr "Quando executado, isso imprime:" +#: ../../howto/unicode.rst:382 +msgid "" +"0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" +"1 0bf2 No TAMIL NUMBER ONE THOUSAND\n" +"2 0f84 Mn TIBETAN MARK HALANTA\n" +"3 1770 Lo TAGBANWA LETTER SA\n" +"4 33af So SQUARE RAD OVER S SQUARED\n" +"1000.0" +msgstr "" + #: ../../howto/unicode.rst:391 msgid "" "The category codes are abbreviations describing the nature of the character. " @@ -544,6 +679,13 @@ msgid "" "which becomes the pair of lowercase letters 'ss'." msgstr "" +#: ../../howto/unicode.rst:421 +msgid "" +">>> street = 'Gürzenichstraße'\n" +">>> street.casefold()\n" +"'gürzenichstrasse'" +msgstr "" + #: ../../howto/unicode.rst:425 msgid "" "A second tool is the :mod:`unicodedata` module's :func:`~unicodedata." @@ -554,10 +696,36 @@ msgid "" "combining characters differently:" msgstr "" +#: ../../howto/unicode.rst:434 +msgid "" +"import unicodedata\n" +"\n" +"def compare_strs(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(s1) == NFD(s2)\n" +"\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN SMALL LETTER E}\\N{COMBINING CIRCUMFLEX " +"ACCENT}'\n" +"print('length of first string=', len(single_char))\n" +"print('length of second string=', len(multiple_chars))\n" +"print(compare_strs(single_char, multiple_chars))" +msgstr "" + #: ../../howto/unicode.rst:448 msgid "When run, this outputs:" msgstr "" +#: ../../howto/unicode.rst:450 +msgid "" +"$ python compare-strs.py\n" +"length of first string= 1\n" +"length of second string= 2\n" +"True" +msgstr "" + #: ../../howto/unicode.rst:457 msgid "" "The first argument to the :func:`~unicodedata.normalize` function is a " @@ -569,6 +737,24 @@ msgstr "" msgid "The Unicode Standard also specifies how to do caseless comparisons::" msgstr "" +#: ../../howto/unicode.rst:463 +msgid "" +"import unicodedata\n" +"\n" +"def compare_caseless(s1, s2):\n" +" def NFD(s):\n" +" return unicodedata.normalize('NFD', s)\n" +"\n" +" return NFD(NFD(s1).casefold()) == NFD(NFD(s2).casefold())\n" +"\n" +"# Example usage\n" +"single_char = 'ê'\n" +"multiple_chars = '\\N{LATIN CAPITAL LETTER E}\\N{COMBINING CIRCUMFLEX " +"ACCENT}'\n" +"\n" +"print(compare_caseless(single_char, multiple_chars))" +msgstr "" + #: ../../howto/unicode.rst:477 msgid "" "This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " @@ -597,6 +783,16 @@ msgid "" "numerals::" msgstr "" +#: ../../howto/unicode.rst:496 +msgid "" +"import re\n" +"p = re.compile(r'\\d+')\n" +"\n" +"s = \"Over \\u0e55\\u0e57 57 flavours\"\n" +"m = p.search(s)\n" +"print(repr(m.group()))" +msgstr "" + #: ../../howto/unicode.rst:503 msgid "" "When executed, ``\\d+`` will match the Thai numerals and print them out. If " @@ -709,12 +905,27 @@ msgstr "" msgid "Reading Unicode from a file is therefore simple::" msgstr "" +#: ../../howto/unicode.rst:576 +msgid "" +"with open('unicode.txt', encoding='utf-8') as f:\n" +" for line in f:\n" +" print(repr(line))" +msgstr "" + #: ../../howto/unicode.rst:580 msgid "" "It's also possible to open files in update mode, allowing both reading and " "writing::" msgstr "" +#: ../../howto/unicode.rst:583 +msgid "" +"with open('test', encoding='utf-8', mode='w+') as f:\n" +" f.write('\\u4500 blah blah blah\\n')\n" +" f.seek(0)\n" +" print(repr(f.readline()[:1]))" +msgstr "" + #: ../../howto/unicode.rst:588 msgid "" "The Unicode character ``U+FEFF`` is used as a byte-order mark (BOM), and is " @@ -763,6 +974,13 @@ msgid "" "and it will be automatically converted to the right encoding for you::" msgstr "" +#: ../../howto/unicode.rst:622 +msgid "" +"filename = 'filename\\u4500abc'\n" +"with open(filename, 'w') as f:\n" +" f.write('blah\\n')" +msgstr "" + #: ../../howto/unicode.rst:626 msgid "" "Functions in the :mod:`os` module such as :func:`os.stat` will also accept " @@ -782,10 +1000,28 @@ msgid "" "error handler>` is UTF-8, running the following program::" msgstr "" +#: ../../howto/unicode.rst:639 +msgid "" +"fn = 'filename\\u4500abc'\n" +"f = open(fn, 'w')\n" +"f.close()\n" +"\n" +"import os\n" +"print(os.listdir(b'.'))\n" +"print(os.listdir('.'))" +msgstr "" + #: ../../howto/unicode.rst:647 msgid "will produce the following output:" msgstr "" +#: ../../howto/unicode.rst:649 +msgid "" +"$ python listdir-test.py\n" +"[b'filename\\xe4\\x94\\x80abc', ...]\n" +"['filename\\u4500abc', ...]" +msgstr "" + #: ../../howto/unicode.rst:655 msgid "" "The first list contains UTF-8-encoded filenames, and the second list " @@ -858,6 +1094,17 @@ msgid "" "it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" msgstr "" +#: ../../howto/unicode.rst:701 +msgid "" +"new_f = codecs.StreamRecoder(f,\n" +" # en/decoder: used by read() to encode its results and\n" +" # by write() to decode its input.\n" +" codecs.getencoder('utf-8'), codecs.getdecoder('utf-8'),\n" +"\n" +" # reader/writer: used to read and write to the stream.\n" +" codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" +msgstr "" + #: ../../howto/unicode.rst:711 msgid "Files in an Unknown Encoding" msgstr "" @@ -870,6 +1117,18 @@ msgid "" "``surrogateescape`` error handler::" msgstr "" +#: ../../howto/unicode.rst:718 +msgid "" +"with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" data = f.read()\n" +"\n" +"# make changes to the string 'data'\n" +"\n" +"with open(fname + '.new', 'w',\n" +" encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" +" f.write(data)" +msgstr "" + #: ../../howto/unicode.rst:727 msgid "" "The ``surrogateescape`` error handler will decode any non-ASCII bytes as " diff --git a/howto/urllib2.po b/howto/urllib2.po index 602d5f531..ae0a20319 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Ruan Aragão , 2021 -# Otávio Carneiro , 2021 -# Adorilson Bezerra , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -124,6 +118,13 @@ msgstr "Acessando URLs" msgid "The simplest way to use urllib.request is as follows::" msgstr "O modo mais simples de usar urllib.request é o seguinte::" +#: ../../howto/urllib2.rst:48 +msgid "" +"import urllib.request\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" html = response.read()" +msgstr "" + #: ../../howto/urllib2.rst:52 msgid "" "If you wish to retrieve a resource via URL and store it in a temporary " @@ -134,6 +135,20 @@ msgstr "" "temporária, você pode fazê-lo com as funções :func:`shutil.copyfileobj` e :" "func:`tempfile.NamedTemporaryFile`::" +#: ../../howto/urllib2.rst:56 +msgid "" +"import shutil\n" +"import tempfile\n" +"import urllib.request\n" +"\n" +"with urllib.request.urlopen('http://python.org/') as response:\n" +" with tempfile.NamedTemporaryFile(delete=False) as tmp_file:\n" +" shutil.copyfileobj(response, tmp_file)\n" +"\n" +"with open(tmp_file.name) as html:\n" +" pass" +msgstr "" + #: ../../howto/urllib2.rst:67 msgid "" "Many uses of urllib will be that simple (note that instead of an 'http:' URL " @@ -165,6 +180,15 @@ msgstr "" "resposta é um objeto arquivo ou similar, o que significa que você pode, por " "exemplo, chamar ``.read()`` na resposta::" +#: ../../howto/urllib2.rst:80 +msgid "" +"import urllib.request\n" +"\n" +"req = urllib.request.Request('http://python.org/')\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" +msgstr "" + #: ../../howto/urllib2.rst:86 msgid "" "Note that urllib.request makes use of the same Request interface to handle " @@ -174,6 +198,10 @@ msgstr "" "esquemas URL. Por exemplo, você pode fazer uma solicitação FTP da seguinte " "forma::" +#: ../../howto/urllib2.rst:89 +msgid "req = urllib.request.Request('ftp://example.com/')" +msgstr "" + #: ../../howto/urllib2.rst:91 msgid "" "In the case of HTTP, there are two extra things that Request objects allow " @@ -200,6 +228,23 @@ msgid "" "function from the :mod:`urllib.parse` library. ::" msgstr "" +#: ../../howto/urllib2.rst:110 +msgid "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"values = {'name' : 'Michael Foord',\n" +" 'location' : 'Northampton',\n" +" 'language' : 'Python' }\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii') # data should be bytes\n" +"req = urllib.request.Request(url, data)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" +msgstr "" + #: ../../howto/urllib2.rst:124 msgid "" "Note that other encodings are sometimes required (e.g. for file upload from " @@ -224,6 +269,22 @@ msgstr "" msgid "This is done as follows::" msgstr "Isso é feito como abaixo::" +#: ../../howto/urllib2.rst:141 +msgid "" +">>> import urllib.request\n" +">>> import urllib.parse\n" +">>> data = {}\n" +">>> data['name'] = 'Somebody Here'\n" +">>> data['location'] = 'Northampton'\n" +">>> data['language'] = 'Python'\n" +">>> url_values = urllib.parse.urlencode(data)\n" +">>> print(url_values) # The order may differ from below. \n" +"name=Somebody+Here&language=Python&location=Northampton\n" +">>> url = 'http://www.example.com/example.cgi'\n" +">>> full_url = url + '?' + url_values\n" +">>> data = urllib.request.urlopen(full_url)" +msgstr "" + #: ../../howto/urllib2.rst:154 msgid "" "Notice that the full URL is created by adding a ``?`` to the URL, followed " @@ -255,6 +316,25 @@ msgid "" "Explorer [#]_. ::" msgstr "" +#: ../../howto/urllib2.rst:174 +msgid "" +"import urllib.parse\n" +"import urllib.request\n" +"\n" +"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" +"user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'\n" +"values = {'name': 'Michael Foord',\n" +" 'location': 'Northampton',\n" +" 'language': 'Python' }\n" +"headers = {'User-Agent': user_agent}\n" +"\n" +"data = urllib.parse.urlencode(values)\n" +"data = data.encode('ascii')\n" +"req = urllib.request.Request(url, data, headers)\n" +"with urllib.request.urlopen(req) as response:\n" +" the_page = response.read()" +msgstr "" + #: ../../howto/urllib2.rst:190 msgid "" "The response also has two useful methods. See the section on `info and " @@ -299,6 +379,16 @@ msgstr "" msgid "e.g. ::" msgstr "" +#: ../../howto/urllib2.rst:216 +msgid "" +">>> req = urllib.request.Request('http://www.pretend_server.org')\n" +">>> try: urllib.request.urlopen(req)\n" +"... except urllib.error.URLError as e:\n" +"... print(e.reason) \n" +"...\n" +"(4, 'getaddrinfo failed')" +msgstr "" + #: ../../howto/urllib2.rst:225 msgid "HTTPError" msgstr "HTTPError" @@ -344,6 +434,77 @@ msgid "" "The dictionary is reproduced here for convenience ::" msgstr "" +#: ../../howto/urllib2.rst:251 +msgid "" +"# Table mapping response codes to messages; entries have the\n" +"# form {code: (shortmessage, longmessage)}.\n" +"responses = {\n" +" 100: ('Continue', 'Request received, please continue'),\n" +" 101: ('Switching Protocols',\n" +" 'Switching to new protocol; obey Upgrade header'),\n" +"\n" +" 200: ('OK', 'Request fulfilled, document follows'),\n" +" 201: ('Created', 'Document created, URL follows'),\n" +" 202: ('Accepted',\n" +" 'Request accepted, processing continues off-line'),\n" +" 203: ('Non-Authoritative Information', 'Request fulfilled from cache'),\n" +" 204: ('No Content', 'Request fulfilled, nothing follows'),\n" +" 205: ('Reset Content', 'Clear input form for further input.'),\n" +" 206: ('Partial Content', 'Partial content follows.'),\n" +"\n" +" 300: ('Multiple Choices',\n" +" 'Object has several resources -- see URI list'),\n" +" 301: ('Moved Permanently', 'Object moved permanently -- see URI list'),\n" +" 302: ('Found', 'Object moved temporarily -- see URI list'),\n" +" 303: ('See Other', 'Object moved -- see Method and URL list'),\n" +" 304: ('Not Modified',\n" +" 'Document has not changed since given time'),\n" +" 305: ('Use Proxy',\n" +" 'You must use proxy specified in Location to access this '\n" +" 'resource.'),\n" +" 307: ('Temporary Redirect',\n" +" 'Object moved temporarily -- see URI list'),\n" +"\n" +" 400: ('Bad Request',\n" +" 'Bad request syntax or unsupported method'),\n" +" 401: ('Unauthorized',\n" +" 'No permission -- see authorization schemes'),\n" +" 402: ('Payment Required',\n" +" 'No payment -- see charging schemes'),\n" +" 403: ('Forbidden',\n" +" 'Request forbidden -- authorization will not help'),\n" +" 404: ('Not Found', 'Nothing matches the given URI'),\n" +" 405: ('Method Not Allowed',\n" +" 'Specified method is invalid for this server.'),\n" +" 406: ('Not Acceptable', 'URI not available in preferred format.'),\n" +" 407: ('Proxy Authentication Required', 'You must authenticate with '\n" +" 'this proxy before proceeding.'),\n" +" 408: ('Request Timeout', 'Request timed out; try again later.'),\n" +" 409: ('Conflict', 'Request conflict.'),\n" +" 410: ('Gone',\n" +" 'URI no longer exists and has been permanently removed.'),\n" +" 411: ('Length Required', 'Client must specify Content-Length.'),\n" +" 412: ('Precondition Failed', 'Precondition in headers is false.'),\n" +" 413: ('Request Entity Too Large', 'Entity is too large.'),\n" +" 414: ('Request-URI Too Long', 'URI is too long.'),\n" +" 415: ('Unsupported Media Type', 'Entity body in unsupported format.'),\n" +" 416: ('Requested Range Not Satisfiable',\n" +" 'Cannot satisfy request range.'),\n" +" 417: ('Expectation Failed',\n" +" 'Expect condition could not be satisfied.'),\n" +"\n" +" 500: ('Internal Server Error', 'Server got itself in trouble'),\n" +" 501: ('Not Implemented',\n" +" 'Server does not support this operation'),\n" +" 502: ('Bad Gateway', 'Invalid responses from another server/proxy.'),\n" +" 503: ('Service Unavailable',\n" +" 'The server cannot process the request due to a high load'),\n" +" 504: ('Gateway Timeout',\n" +" 'The gateway server did not receive a timely response'),\n" +" 505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),\n" +" }" +msgstr "" + #: ../../howto/urllib2.rst:319 msgid "" "When an error is raised the server responds by returning an HTTP error code " @@ -353,6 +514,24 @@ msgid "" "``urllib.response`` module::" msgstr "" +#: ../../howto/urllib2.rst:324 +msgid "" +">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" +">>> try:\n" +"... urllib.request.urlopen(req)\n" +"... except urllib.error.HTTPError as e:\n" +"... print(e.code)\n" +"... print(e.read()) \n" +"...\n" +"404\n" +"b'\\n\\n\\nPage Not Found\\n\n" +" ..." +msgstr "" + #: ../../howto/urllib2.rst:339 msgid "Wrapping it Up" msgstr "" @@ -368,6 +547,23 @@ msgstr "" msgid "Number 1" msgstr "" +#: ../../howto/urllib2.rst:350 +msgid "" +"from urllib.request import Request, urlopen\n" +"from urllib.error import URLError, HTTPError\n" +"req = Request(someurl)\n" +"try:\n" +" response = urlopen(req)\n" +"except HTTPError as e:\n" +" print('The server couldn\\'t fulfill the request.')\n" +" print('Error code: ', e.code)\n" +"except URLError as e:\n" +" print('We failed to reach a server.')\n" +" print('Reason: ', e.reason)\n" +"else:\n" +" # everything is fine" +msgstr "" + #: ../../howto/urllib2.rst:367 msgid "" "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " @@ -378,6 +574,24 @@ msgstr "" msgid "Number 2" msgstr "" +#: ../../howto/urllib2.rst:375 +msgid "" +"from urllib.request import Request, urlopen\n" +"from urllib.error import URLError\n" +"req = Request(someurl)\n" +"try:\n" +" response = urlopen(req)\n" +"except URLError as e:\n" +" if hasattr(e, 'reason'):\n" +" print('We failed to reach a server.')\n" +" print('Reason: ', e.reason)\n" +" elif hasattr(e, 'code'):\n" +" print('The server couldn\\'t fulfill the request.')\n" +" print('Error code: ', e.code)\n" +"else:\n" +" # everything is fine" +msgstr "" + #: ../../howto/urllib2.rst:392 msgid "info and geturl" msgstr "" @@ -493,6 +707,10 @@ msgstr "" msgid "e.g." msgstr "" +#: ../../howto/urllib2.rst:463 +msgid "WWW-Authenticate: Basic realm=\"cPanel Users\"" +msgstr "" + #: ../../howto/urllib2.rst:468 msgid "" "The client should then retry the request with the appropriate name and " @@ -520,6 +738,29 @@ msgid "" "\"deeper\" than the URL you pass to .add_password() will also match. ::" msgstr "" +#: ../../howto/urllib2.rst:486 +msgid "" +"# create a password manager\n" +"password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()\n" +"\n" +"# Add the username and password.\n" +"# If we knew the realm, we could use it instead of None.\n" +"top_level_url = \"http://example.com/foo/\"\n" +"password_mgr.add_password(None, top_level_url, username, password)\n" +"\n" +"handler = urllib.request.HTTPBasicAuthHandler(password_mgr)\n" +"\n" +"# create \"opener\" (OpenerDirector instance)\n" +"opener = urllib.request.build_opener(handler)\n" +"\n" +"# use the opener to fetch a URL\n" +"opener.open(a_url)\n" +"\n" +"# Install the opener.\n" +"# Now all calls to urllib.request.urlopen use our opener.\n" +"urllib.request.install_opener(opener)" +msgstr "" + #: ../../howto/urllib2.rst:508 msgid "" "In the above example we only supplied our ``HTTPBasicAuthHandler`` to " @@ -555,6 +796,13 @@ msgid "" "similar steps to setting up a `Basic Authentication`_ handler: ::" msgstr "" +#: ../../howto/urllib2.rst:534 +msgid "" +">>> proxy_support = urllib.request.ProxyHandler({})\n" +">>> opener = urllib.request.build_opener(proxy_support)\n" +">>> urllib.request.install_opener(opener)" +msgstr "" + #: ../../howto/urllib2.rst:540 msgid "" "Currently ``urllib.request`` *does not* support fetching of ``https`` " @@ -588,6 +836,21 @@ msgid "" "sockets using ::" msgstr "" +#: ../../howto/urllib2.rst:562 +msgid "" +"import socket\n" +"import urllib.request\n" +"\n" +"# timeout in seconds\n" +"timeout = 10\n" +"socket.setdefaulttimeout(timeout)\n" +"\n" +"# this call to urllib.request.urlopen now uses the default timeout\n" +"# we have set in the socket module\n" +"req = urllib.request.Request('http://www.voidspace.org.uk')\n" +"response = urllib.request.urlopen(req)" +msgstr "" + #: ../../howto/urllib2.rst:579 msgid "Footnotes" msgstr "Notas de rodapé" diff --git a/installing/index.po b/installing/index.po index f9b848c89..bc33bf89d 100644 --- a/installing/index.po +++ b/installing/index.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# Ruan Aragão , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -202,6 +200,10 @@ msgstr "" "O comando a seguir instalará a versão mais recente de um módulo e suas " "dependências do Python Package Index::" +#: ../../installing/index.rst:84 +msgid "python -m pip install SomePackage" +msgstr "" + #: ../../installing/index.rst:88 msgid "" "For POSIX users (including macOS and Linux users), the examples in this " @@ -232,6 +234,12 @@ msgstr "" "algum outro caractere especial que é interpretado pelo shell, o nome do " "pacote e a versão devem ser colocados entre aspas duplas::" +#: ../../installing/index.rst:100 +msgid "" +"python -m pip install SomePackage==1.0.4 # specific version\n" +"python -m pip install \"SomePackage>=1.0.4\" # minimum version" +msgstr "" + #: ../../installing/index.rst:103 msgid "" "Normally, if a suitable module is already installed, attempting to install " @@ -242,6 +250,10 @@ msgstr "" "novamente não terá efeito. A atualização de módulos existentes deve ser " "solicitada explicitamente::" +#: ../../installing/index.rst:107 +msgid "python -m pip install --upgrade SomePackage" +msgstr "" + #: ../../installing/index.rst:109 msgid "" "More information and resources regarding ``pip`` and its capabilities can be " @@ -355,6 +367,14 @@ msgstr "" "em combinação com a opção ``-m`` para executar a cópia apropriada de " "``pip`` ::" +#: ../../installing/index.rst:171 +msgid "" +"python2 -m pip install SomePackage # default Python 2\n" +"python2.7 -m pip install SomePackage # specifically Python 2.7\n" +"python3 -m pip install SomePackage # default Python 3\n" +"python3.4 -m pip install SomePackage # specifically Python 3.4" +msgstr "" + #: ../../installing/index.rst:176 msgid "Appropriately versioned ``pip`` commands may also be available." msgstr "Comandos ``pip`` com versão apropriada também podem estar disponíveis." @@ -366,6 +386,14 @@ msgid "" msgstr "" "No Windows, use o iniciador Python ``py`` em combinação com a opção ``-m``::" +#: ../../installing/index.rst:181 +msgid "" +"py -2 -m pip install SomePackage # default Python 2\n" +"py -2.7 -m pip install SomePackage # specifically Python 2.7\n" +"py -3 -m pip install SomePackage # default Python 3\n" +"py -3.4 -m pip install SomePackage # specifically Python 3.4" +msgstr "" + #: ../../installing/index.rst:195 msgid "Common installation issues" msgstr "Problemas comuns de instalação" @@ -408,6 +436,10 @@ msgstr "" "É possível que o ``pip`` não seja instalado por padrão. Uma solução " "potencial é::" +#: ../../installing/index.rst:215 +msgid "python -m ensurepip --default-pip" +msgstr "" + #: ../../installing/index.rst:217 msgid "" "There are also additional resources for `installing pip. , YEAR. # # Translators: -# Sheila Gomes , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Octavio von Sydow , 2021 -# Loyanne Cristine , 2022 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -46,7 +42,7 @@ msgstr "" "entanto, uma biblioteca genérica e flexível, por isso é possível escrever " "seus próprios fixadores para o 2to3." -#: ../../library/2to3.rst:19 +#: ../../library/2to3.rst:14 msgid "" "The ``lib2to3`` module was marked pending for deprecation in Python 3.9 " "(raising :exc:`PendingDeprecationWarning` on import) and fully deprecated in " @@ -85,12 +81,25 @@ msgid "Here is a sample Python 2.x source file, :file:`example.py`::" msgstr "" "Aqui temos um exemplo de arquivo fonte Python 2.x, :file:`example.py`::" +#: ../../library/2to3.rst:33 +msgid "" +"def greet(name):\n" +" print \"Hello, {0}!\".format(name)\n" +"print \"What's your name?\"\n" +"name = raw_input()\n" +"greet(name)" +msgstr "" + #: ../../library/2to3.rst:39 msgid "It can be converted to Python 3.x code via 2to3 on the command line:" msgstr "" "O mesmo pode ser convertido para código Python 3.x através de 2to3 através " "da linha de comando:" +#: ../../library/2to3.rst:41 +msgid "$ 2to3 example.py" +msgstr "" + #: ../../library/2to3.rst:45 msgid "" "A diff against the original source file is printed. 2to3 can also write the " @@ -104,11 +113,24 @@ msgstr "" "utilizada.) Escrever as alterações de volta está disponível com o uso do " "sinalizador :option:`!-w`:" +#: ../../library/2to3.rst:50 +msgid "$ 2to3 -w example.py" +msgstr "" + #: ../../library/2to3.rst:54 msgid "After transformation, :file:`example.py` looks like this::" msgstr "" "Após a transformação, o arquivo :file:`example.py` se parecerá com isso::" +#: ../../library/2to3.rst:56 +msgid "" +"def greet(name):\n" +" print(\"Hello, {0}!\".format(name))\n" +"print(\"What's your name?\")\n" +"name = input()\n" +"greet(name)" +msgstr "" + #: ../../library/2to3.rst:62 msgid "" "Comments and exact indentation are preserved throughout the translation " @@ -132,10 +154,18 @@ msgstr "" "explicitamente um fixadores. O exemplo a seguir executa apenas os fixadores " "``imports`` e ``has_key``:" +#: ../../library/2to3.rst:69 +msgid "$ 2to3 -f imports -f has_key example.py" +msgstr "" + #: ../../library/2to3.rst:73 msgid "This command runs every fixer except the ``apply`` fixer:" msgstr "Este comando executa todos os fixadores, exceto o fixadores ``apply``:" +#: ../../library/2to3.rst:75 +msgid "$ 2to3 -x apply example.py" +msgstr "" + #: ../../library/2to3.rst:79 msgid "" "Some fixers are *explicit*, meaning they aren't run by default and must be " @@ -147,6 +177,10 @@ msgstr "" "serem executados. Aqui, além dos fixadores padrão, o fixador ``idioms`` " "também será executado:" +#: ../../library/2to3.rst:83 +msgid "$ 2to3 -f all -f idioms example.py" +msgstr "" + #: ../../library/2to3.rst:87 msgid "Notice how passing ``all`` enables all default fixers." msgstr "Observe como a passagem de ``all`` permite todos os fixadores padrão." @@ -251,6 +285,10 @@ msgstr "" "especificamos isso, pois os backups não são necessários quando escrevemos em " "nomes de arquivos diferentes. Por exemplo:" +#: ../../library/2to3.rst:131 +msgid "$ 2to3 -n -W --add-suffix=3 example.py" +msgstr "" + #: ../../library/2to3.rst:135 msgid "Will cause a converted file named ``example.py3`` to be written." msgstr "" @@ -265,6 +303,10 @@ msgid "To translate an entire project from one directory tree to another use:" msgstr "" "Para traduzir um projeto inteiro de uma árvore de diretório para outra, use:" +#: ../../library/2to3.rst:142 +msgid "$ 2to3 --output-dir=python3-version/mycode -W -n python2-version/mycode" +msgstr "" + #: ../../library/2to3.rst:150 msgid "Fixers" msgstr "Fixadores" @@ -476,10 +518,20 @@ msgstr "" "``while 1`` vira ``while True``. Este fixador também tenta usar :func:" "`sorted` nos lugares apropriados. Por exemplo, este bloco ::" +#: ../../library/2to3.rst:262 +msgid "" +"L = list(some_iterable)\n" +"L.sort()" +msgstr "" + #: ../../library/2to3.rst:265 msgid "is changed to ::" msgstr "é alterado para::" +#: ../../library/2to3.rst:267 +msgid "L = sorted(some_iterable)" +msgstr "" + #: ../../library/2to3.rst:271 msgid "Detects sibling imports and converts them to relative imports." msgstr "Detecta importações de irmãos e as converte em importações relativas." @@ -792,7 +844,7 @@ msgstr ":mod:`lib2to3` --- biblioteca do 2to3" msgid "**Source code:** :source:`Lib/lib2to3/`" msgstr "**Código-fonte:** :source:`Lib/lib2to3/`" -#: ../../library/2to3.rst:482 +#: ../../library/2to3.rst:473 msgid "" "Python 3.9 switched to a PEG parser (see :pep:`617`) while lib2to3 is using " "a less flexible LL(1) parser. Python 3.10 includes new language syntax that " diff --git a/library/__future__.po b/library/__future__.po index 3c65b4cd7..1f42daefe 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Italo Penaforte , 2021 -# Octavio von Sydow , 2021 # Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -250,6 +247,12 @@ msgstr ":pep:`563`: *Postponed evaluation of annotations*" msgid "Each statement in :file:`__future__.py` is of the form::" msgstr "Cada instrução em :file:`__future__.py` é da forma::" +#: ../../library/__future__.rst:79 +msgid "" +"FeatureName = _Feature(OptionalRelease, MandatoryRelease,\n" +" CompilerFlag)" +msgstr "" + #: ../../library/__future__.rst:82 msgid "" "where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " @@ -258,6 +261,17 @@ msgstr "" "Onde, normalmente, *OptionalRelease* é inferior a *MandatoryRelease*, e " "ambos são tuplas de 5 entradas da mesma forma que :data:`sys.version_info`::" +#: ../../library/__future__.rst:85 +msgid "" +"(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int\n" +" PY_MINOR_VERSION, # the 1; an int\n" +" PY_MICRO_VERSION, # the 0; an int\n" +" PY_RELEASE_LEVEL, # \"alpha\", \"beta\", \"candidate\" or \"final\"; " +"string\n" +" PY_RELEASE_SERIAL # the 3; an int\n" +")" +msgstr "" + #: ../../library/__future__.rst:94 msgid "" "*OptionalRelease* records the first release in which the feature was " diff --git a/library/__main__.po b/library/__main__.po index 675257b39..9d64953c4 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Henrique Junqueira, 2022 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -75,6 +73,13 @@ msgstr "" "o nome do módulo. Normalmente, este é o nome do próprio arquivo Python sem a " "extensão ``.py``::" +#: ../../library/__main__.rst:31 +msgid "" +">>> import configparser\n" +">>> configparser.__name__\n" +"'configparser'" +msgstr "" + #: ../../library/__main__.rst:35 msgid "" "If the file is part of a package, ``__name__`` will also include the parent " @@ -83,6 +88,13 @@ msgstr "" "Caso o arquivo seja parte de um pacote, ``__name__`` também incluirá o nome " "da pasta raiz do pacote." +#: ../../library/__main__.rst:38 +msgid "" +">>> from concurrent.futures import process\n" +">>> process.__name__\n" +"'concurrent.futures.process'" +msgstr "" + #: ../../library/__main__.rst:42 msgid "" "However, if the module is executed in the top-level code environment, its " @@ -117,12 +129,24 @@ msgstr "O ambiente de código principal pode ser:" msgid "the scope of an interactive prompt::" msgstr "o escopo de um prompt de comando interativo:" +#: ../../library/__main__.rst:57 +msgid "" +">>> __name__\n" +"'__main__'" +msgstr "" + #: ../../library/__main__.rst:60 msgid "the Python module passed to the Python interpreter as a file argument:" msgstr "" "o módulo Python passado ao interpretador do Python como um argumento " "correspondente ao nome do arquivo:" +#: ../../library/__main__.rst:62 +msgid "" +"$ python helloworld.py\n" +"Hello, world!" +msgstr "" + #: ../../library/__main__.rst:67 msgid "" "the Python module or package passed to the Python interpreter with the :" @@ -131,12 +155,28 @@ msgstr "" "o módulo ou pacote Python passado ao interpretador do Python com o " "argumento :option:`-m`:" +#: ../../library/__main__.rst:70 +msgid "" +"$ python -m tarfile\n" +"usage: tarfile.py [-h] [-v] (...)" +msgstr "" + #: ../../library/__main__.rst:75 msgid "Python code read by the Python interpreter from standard input:" msgstr "" "código Python lido pelo interpretador através da entrada padrão de linha de " "comando:" +#: ../../library/__main__.rst:77 +msgid "" +"$ echo \"import this\" | python\n" +"The Zen of Python, by Tim Peters\n" +"\n" +"Beautiful is better than ugly.\n" +"Explicit is better than implicit.\n" +"..." +msgstr "" + #: ../../library/__main__.rst:86 msgid "" "Python code passed to the Python interpreter with the :option:`-c` argument:" @@ -144,6 +184,16 @@ msgstr "" "código Python passado ao interpretador do Python com o argumento :option:`-" "c`:" +#: ../../library/__main__.rst:88 +msgid "" +"$ python -c \"import this\"\n" +"The Zen of Python, by Tim Peters\n" +"\n" +"Beautiful is better than ugly.\n" +"Explicit is better than implicit.\n" +"..." +msgstr "" + #: ../../library/__main__.rst:97 msgid "" "In each of these situations, the top-level module's ``__name__`` is set to " @@ -164,6 +214,13 @@ msgstr "" "termo comum para executar código condicionalmente quando o módulo não é " "inicializado a partir de uma instrução de importação::" +#: ../../library/__main__.rst:105 +msgid "" +"if __name__ == '__main__':\n" +" # Execute when the module is not initialized from an import statement.\n" +" ..." +msgstr "" + #: ../../library/__main__.rst:111 msgid "" "For a more detailed look at how ``__name__`` is set in all situations, see " @@ -210,6 +267,29 @@ msgstr "" "vezes, uma função chamada de ``main`` encapsula o comportamento principal do " "programa::" +#: ../../library/__main__.rst:131 +msgid "" +"# echo.py\n" +"\n" +"import shlex\n" +"import sys\n" +"\n" +"def echo(phrase: str) -> None:\n" +" \"\"\"A dummy wrapper around print.\"\"\"\n" +" # for demonstration purposes, you can imagine that there is some\n" +" # valuable and reusable logic inside this function\n" +" print(phrase)\n" +"\n" +"def main() -> int:\n" +" \"\"\"Echo the input arguments to standard output\"\"\"\n" +" phrase = shlex.join(sys.argv)\n" +" echo(phrase)\n" +" return 0\n" +"\n" +"if __name__ == '__main__':\n" +" sys.exit(main()) # next section explains the use of sys.exit" +msgstr "" + #: ../../library/__main__.rst:151 msgid "" "Note that if the module didn't encapsulate code inside the ``main`` function " @@ -255,6 +335,10 @@ msgstr "" "função em um modelo de script, onde o valor de retorno de ``main`` é passado " "para :func:`sys.exit`. Por exemplo::" +#: ../../library/__main__.rst:173 +msgid "sys.exit(main())" +msgstr "" + #: ../../library/__main__.rst:175 msgid "" "Since the call to ``main`` is wrapped in :func:`sys.exit`, the expectation " @@ -320,6 +404,14 @@ msgstr "" "para fornecer uma interface de linha de comando para um pacote. Considere o " "seguinte pacote hipotético, \"bandclass\":" +#: ../../library/__main__.rst:206 +msgid "" +"bandclass\n" +" ├── __init__.py\n" +" ├── __main__.py\n" +" └── student.py" +msgstr "" + #: ../../library/__main__.rst:213 msgid "" "``__main__.py`` will be executed when the package itself is invoked directly " @@ -329,6 +421,10 @@ msgstr "" "diretamente da linha de comando usando o sinalizador :option:`-m`. Por " "exemplo:" +#: ../../library/__main__.rst:216 +msgid "$ python -m bandclass" +msgstr "" + #: ../../library/__main__.rst:220 msgid "" "This command will cause ``__main__.py`` to run. How you utilize this " @@ -341,6 +437,17 @@ msgstr "" "neste caso hipotético, pode fazer sentido permitir que o professor procure " "alunos::" +#: ../../library/__main__.rst:225 +msgid "" +"# bandclass/__main__.py\n" +"\n" +"import sys\n" +"from .student import search_students\n" +"\n" +"student_name = sys.argv[1] if len(sys.argv) >= 2 else ''\n" +"print(f'Found student: {search_students(student_name)}')" +msgstr "" + #: ../../library/__main__.rst:233 msgid "" "Note that ``from .student import search_students`` is an example of a " @@ -376,15 +483,22 @@ msgstr "" "como esperado para o arquivo ``__main__.py`` dentro de um pacote, pois seu " "atributo ``__name__`` incluirá o caminho do pacote se importado::" +#: ../../library/__main__.rst:250 +msgid "" +">>> import asyncio.__main__\n" +">>> asyncio.__main__.__name__\n" +"'asyncio.__main__'" +msgstr "" + #: ../../library/__main__.rst:254 msgid "" -"This won't work for ``__main__.py`` files in the root directory of a .zip " -"file though. Hence, for consistency, minimal ``__main__.py`` like the :mod:" -"`venv` one mentioned below are preferred." +"This won't work for ``__main__.py`` files in the root directory of a ``." +"zip`` file though. Hence, for consistency, a minimal ``__main__.py`` " +"without a ``__name__`` check is preferred." msgstr "" -"Isso não funcionará para arquivos ``__main__.py`` no diretório raiz de um " -"arquivo .zip. Portanto, para consistência, dê preferência para ``__main__." -"py`` minimalistas, como o :mod:`venv` mencionado abaixo." +"Porém, isso não funcionará para arquivos ``__main__.py`` no diretório raiz " +"de um arquivo ``.zip``. Portanto, para consistência, é preferível um " +"``__main__.py`` mínimo sem uma verificação de ``__name__``." #: ../../library/__main__.rst:260 msgid "" @@ -437,14 +551,59 @@ msgid "Here is an example module that consumes the ``__main__`` namespace::" msgstr "" "Aqui está um módulo de exemplo que consome o espaço de nomes ``__main__``::" +#: ../../library/__main__.rst:284 +msgid "" +"# namely.py\n" +"\n" +"import __main__\n" +"\n" +"def did_user_define_their_name():\n" +" return 'my_name' in dir(__main__)\n" +"\n" +"def print_user_name():\n" +" if not did_user_define_their_name():\n" +" raise ValueError('Define the variable `my_name`!')\n" +"\n" +" if '__file__' in dir(__main__):\n" +" print(__main__.my_name, \"found in file\", __main__.__file__)\n" +" else:\n" +" print(__main__.my_name)" +msgstr "" + #: ../../library/__main__.rst:300 msgid "Example usage of this module could be as follows::" msgstr "Exemplo de uso deste módulo pode ser como abaixo::" +#: ../../library/__main__.rst:302 +msgid "" +"# start.py\n" +"\n" +"import sys\n" +"\n" +"from namely import print_user_name\n" +"\n" +"# my_name = \"Dinsdale\"\n" +"\n" +"def main():\n" +" try:\n" +" print_user_name()\n" +" except ValueError as ve:\n" +" return str(ve)\n" +"\n" +"if __name__ == \"__main__\":\n" +" sys.exit(main())" +msgstr "" + #: ../../library/__main__.rst:319 msgid "Now, if we started our program, the result would look like this:" msgstr "Agora, se iniciarmos nosso programa, o resultado seria assim:" +#: ../../library/__main__.rst:321 +msgid "" +"$ python start.py\n" +"Define the variable `my_name`!" +msgstr "" + #: ../../library/__main__.rst:326 msgid "" "The exit code of the program would be 1, indicating an error. Uncommenting " @@ -455,6 +614,12 @@ msgstr "" "linha com ``my_name = \"Dinsdale\"`` corrige o programa e agora ele sai com " "o código de status 0, indicando sucesso:" +#: ../../library/__main__.rst:330 +msgid "" +"$ python start.py\n" +"Dinsdale found in file /path/to/start.py" +msgstr "" + #: ../../library/__main__.rst:335 msgid "" "Note that importing ``__main__`` doesn't cause any issues with " @@ -497,6 +662,22 @@ msgstr "" "O REPL do Python é outro exemplo de um \"ambiente principal\", então " "qualquer coisa definida no REPL se torna parte do escopo do ``__main__``::" +#: ../../library/__main__.rst:351 +msgid "" +">>> import namely\n" +">>> namely.did_user_define_their_name()\n" +"False\n" +">>> namely.print_user_name()\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Define the variable `my_name`!\n" +">>> my_name = 'Jabberwocky'\n" +">>> namely.did_user_define_their_name()\n" +"True\n" +">>> namely.print_user_name()\n" +"Jabberwocky" +msgstr "" + #: ../../library/__main__.rst:364 msgid "" "Note that in this case the ``__main__`` scope doesn't contain a ``__file__`` " diff --git a/library/_thread.po b/library/_thread.po index 3817f4ead..ce56277fb 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -4,30 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Sheila Gomes , 2021 -# Jose Rafael Amaral , 2021 -# Octavio von Sydow , 2021 -# Marcos Jurach , 2021 -# Fabio Aragao , 2021 -# Loyanne Cristine , 2022 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -344,6 +336,16 @@ msgstr "" "Além desses métodos, os objetos de trava também podem ser usados através da " "instrução :keyword:`with`, por exemplo::" +#: ../../library/_thread.rst:202 +msgid "" +"import _thread\n" +"\n" +"a_lock = _thread.allocate_lock()\n" +"\n" +"with a_lock:\n" +" print(\"a_lock is locked while this executes\")" +msgstr "" + #: ../../library/_thread.rst:209 msgid "**Caveats:**" msgstr "**Ressalvas:**" diff --git a/library/abc.po b/library/abc.po index 895ddddb4..32ea2eb5f 100644 --- a/library/abc.po +++ b/library/abc.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Bonifacio de Oliveira , 2021 -# Lilian Corrêa , 2021 -# Alexsandro Felix , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -73,6 +70,14 @@ msgid "" "avoiding sometimes confusing metaclass usage, for example::" msgstr "" +#: ../../library/abc.rst:36 +msgid "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass" +msgstr "" + #: ../../library/abc.rst:41 msgid "" "Note that the type of :class:`!ABC` is still :class:`ABCMeta`, therefore " @@ -82,6 +87,14 @@ msgid "" "and using :class:`!ABCMeta` directly, for example::" msgstr "" +#: ../../library/abc.rst:47 +msgid "" +"from abc import ABCMeta\n" +"\n" +"class MyABC(metaclass=ABCMeta):\n" +" pass" +msgstr "" + #: ../../library/abc.rst:57 msgid "Metaclass for defining Abstract Base Classes (ABCs)." msgstr "Metaclasse para definir Classe Base Abstrata (CBAs)." @@ -118,6 +131,19 @@ msgid "" msgstr "" "Registrar *subclasse* como uma \"subclasse virtual\" desta CBA. Por exemplo::" +#: ../../library/abc.rst:75 +msgid "" +"from abc import ABC\n" +"\n" +"class MyABC(ABC):\n" +" pass\n" +"\n" +"MyABC.register(tuple)\n" +"\n" +"assert issubclass(tuple, MyABC)\n" +"assert isinstance((), MyABC)" +msgstr "" + #: ../../library/abc.rst:85 msgid "Returns the registered subclass, to allow usage as a class decorator." msgstr "" @@ -162,6 +188,36 @@ msgid "" msgstr "" "Para uma demonstração destes conceitos, veja este exemplo de definição CBA::" +#: ../../library/abc.rst:116 +msgid "" +"class Foo:\n" +" def __getitem__(self, index):\n" +" ...\n" +" def __len__(self):\n" +" ...\n" +" def get_iterator(self):\n" +" return iter(self)\n" +"\n" +"class MyIterable(ABC):\n" +"\n" +" @abstractmethod\n" +" def __iter__(self):\n" +" while False:\n" +" yield None\n" +"\n" +" def get_iterator(self):\n" +" return self.__iter__()\n" +"\n" +" @classmethod\n" +" def __subclasshook__(cls, C):\n" +" if cls is MyIterable:\n" +" if any(\"__iter__\" in B.__dict__ for B in C.__mro__):\n" +" return True\n" +" return NotImplemented\n" +"\n" +"MyIterable.register(Foo)" +msgstr "" + #: ../../library/abc.rst:143 msgid "" "The ABC ``MyIterable`` defines the standard iterable method, :meth:" @@ -228,6 +284,39 @@ msgid "" "the following usage examples::" msgstr "" +#: ../../library/abc.rst:187 +msgid "" +"class C(ABC):\n" +" @abstractmethod\n" +" def my_abstract_method(self, arg1):\n" +" ...\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg2):\n" +" ...\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg3):\n" +" ...\n" +"\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ...\n" +" @my_abstract_property.setter\n" +" @abstractmethod\n" +" def my_abstract_property(self, val):\n" +" ...\n" +"\n" +" @abstractmethod\n" +" def _get_x(self):\n" +" ...\n" +" @abstractmethod\n" +" def _set_x(self, val):\n" +" ...\n" +" x = property(_get_x, _set_x)" +msgstr "" + #: ../../library/abc.rst:217 msgid "" "In order to correctly interoperate with the abstract base class machinery, " @@ -237,6 +326,16 @@ msgid "" "Python's built-in :class:`property` does the equivalent of::" msgstr "" +#: ../../library/abc.rst:223 +msgid "" +"class Descriptor:\n" +" ...\n" +" @property\n" +" def __isabstractmethod__(self):\n" +" return any(getattr(f, '__isabstractmethod__', False) for\n" +" f in (self._fget, self._fset, self._fdel))" +msgstr "" + #: ../../library/abc.rst:232 msgid "" "Unlike Java abstract methods, these abstract methods may have an " @@ -279,6 +378,15 @@ msgstr "" "`classmethod` está agora corretamente identificado como abstrato quando " "aplicado a um método abstrato::" +#: ../../library/abc.rst:255 +msgid "" +"class C(ABC):\n" +" @classmethod\n" +" @abstractmethod\n" +" def my_abstract_classmethod(cls, arg):\n" +" ..." +msgstr "" + #: ../../library/abc.rst:265 msgid "" "It is now possible to use :class:`staticmethod` with :func:`abstractmethod`, " @@ -304,6 +412,15 @@ msgstr "" "`staticmethod` está agora corretamente identificado como abstrato quando " "aplicado a um método abstrato::" +#: ../../library/abc.rst:276 +msgid "" +"class C(ABC):\n" +" @staticmethod\n" +" @abstractmethod\n" +" def my_abstract_staticmethod(arg):\n" +" ..." +msgstr "" + #: ../../library/abc.rst:285 msgid "" "It is now possible to use :class:`property`, :meth:`property.getter`, :meth:" @@ -330,6 +447,15 @@ msgstr "" "está agora corretamente identificado como abstrato quando aplicado a um " "método abstrato::" +#: ../../library/abc.rst:297 +msgid "" +"class C(ABC):\n" +" @property\n" +" @abstractmethod\n" +" def my_abstract_property(self):\n" +" ..." +msgstr "" + #: ../../library/abc.rst:303 msgid "" "The above example defines a read-only property; you can also define a read-" @@ -340,6 +466,19 @@ msgstr "" "definir uma propriedade abstrata de leitura e escrita marcando " "apropriadamente um ou mais dos métodos subjacentes como abstratos::" +#: ../../library/abc.rst:307 +msgid "" +"class C(ABC):\n" +" @property\n" +" def x(self):\n" +" ...\n" +"\n" +" @x.setter\n" +" @abstractmethod\n" +" def x(self, val):\n" +" ..." +msgstr "" + #: ../../library/abc.rst:317 msgid "" "If only some components are abstract, only those components need to be " @@ -349,6 +488,14 @@ msgstr "" "precisam ser atualizados para criar uma propriedade concreta em uma " "subclasse::" +#: ../../library/abc.rst:320 +msgid "" +"class D(C):\n" +" @C.x.setter\n" +" def x(self, val):\n" +" ..." +msgstr "" + #: ../../library/abc.rst:326 msgid "The :mod:`!abc` module also provides the following functions:" msgstr "" diff --git a/library/aifc.po b/library/aifc.po index 05180eb48..7be13b784 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Vitor Buxbaum Orlandi, 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-22 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -33,7 +31,7 @@ msgstr ":mod:`aifc` --- Lê e escreve arquivos AIFF e AIFC" msgid "**Source code:** :source:`Lib/aifc.py`" msgstr "**Código-fonte:** :source:`Lib/aifc.py`" -#: ../../library/aifc.rst:19 +#: ../../library/aifc.rst:16 msgid "" "The :mod:`aifc` module is deprecated (see :pep:`PEP 594 <594#aifc>` for " "details)." diff --git a/library/allos.po b/library/allos.po index 8bdda5bd1..c3b5e0586 100644 --- a/library/allos.po +++ b/library/allos.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/archiving.po b/library/archiving.po index e12e229e1..a58c4d25c 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:32+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/argparse.po b/library/argparse.po index 33a88aff3..a7162845a 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -4,31 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# And Past , 2021 -# Alexandre B A Villares, 2021 -# i17obot , 2021 -# Danilo Lima , 2022 -# mvpetri , 2022 -# Marco Rougeth , 2022 -# Leticia Portella , 2023 -# Adorilson Bezerra , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -90,6 +81,14 @@ msgstr "" "um contêiner para especificações de argumentos e possui opções que se " "aplicam ao analisador sintático como um todo::" +#: ../../library/argparse.rst:36 +msgid "" +"parser = argparse.ArgumentParser(\n" +" prog='ProgramName',\n" +" description='What the program does',\n" +" epilog='Text at the bottom of help')" +msgstr "" + #: ../../library/argparse.rst:41 msgid "" "The :meth:`ArgumentParser.add_argument` method attaches individual argument " @@ -100,6 +99,14 @@ msgstr "" "argumentos individuais ao analisador. Ele oferece suporte a argumentos " "posicionais, opções que aceitam valores e sinalizadores liga/desliga::" +#: ../../library/argparse.rst:45 +msgid "" +"parser.add_argument('filename') # positional argument\n" +"parser.add_argument('-c', '--count') # option that takes a value\n" +"parser.add_argument('-v', '--verbose',\n" +" action='store_true') # on/off flag" +msgstr "" + #: ../../library/argparse.rst:50 msgid "" "The :meth:`ArgumentParser.parse_args` method runs the parser and places the " @@ -108,6 +115,12 @@ msgstr "" "O método :meth:`ArgumentParser.parse_args` executa o analisador e coloca os " "dados extraídos em um objeto :class:`argparse.Namespace`::" +#: ../../library/argparse.rst:53 +msgid "" +"args = parser.parse_args()\n" +"print(args.filename, args.count, args.verbose)" +msgstr "" + #: ../../library/argparse.rst:58 msgid "Quick Links for add_argument()" msgstr "Links rápidos para add_argument()" @@ -253,6 +266,21 @@ msgstr "" "O código a seguir é um programa Python que recebe uma lista de inteiros e " "apresenta a soma ou o máximo::" +#: ../../library/argparse.rst:82 +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(description='Process some integers.')\n" +"parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +" help='an integer for the accumulator')\n" +"parser.add_argument('--sum', dest='accumulate', action='store_const',\n" +" const=sum, default=max,\n" +" help='sum the integers (default: find the max)')\n" +"\n" +"args = parser.parse_args()\n" +"print(args.accumulate(args.integers))" +msgstr "" + #: ../../library/argparse.rst:94 msgid "" "Assuming the above Python code is saved into a file called ``prog.py``, it " @@ -262,6 +290,21 @@ msgstr "" "py``, ele pode ser executado pela linha de comando e fornece mensagens de " "ajuda úteis:" +#: ../../library/argparse.rst:97 +msgid "" +"$ python prog.py -h\n" +"usage: prog.py [-h] [--sum] N [N ...]\n" +"\n" +"Process some integers.\n" +"\n" +"positional arguments:\n" +" N an integer for the accumulator\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --sum sum the integers (default: find the max)" +msgstr "" + #: ../../library/argparse.rst:111 msgid "" "When run with the appropriate arguments, it prints either the sum or the max " @@ -270,10 +313,26 @@ msgstr "" "Quando executado com argumentos apropriados, a soma ou o maior número dos " "números digitados na linha de comando:" +#: ../../library/argparse.rst:114 +msgid "" +"$ python prog.py 1 2 3 4\n" +"4\n" +"\n" +"$ python prog.py 1 2 3 4 --sum\n" +"10" +msgstr "" + #: ../../library/argparse.rst:122 msgid "If invalid arguments are passed in, an error will be displayed:" msgstr "Se argumentos inválidos forem passados, um erro será exibido:" +#: ../../library/argparse.rst:124 +msgid "" +"$ python prog.py a b c\n" +"usage: prog.py [-h] [--sum] N [N ...]\n" +"prog.py: error: argument N: invalid int value: 'a'" +msgstr "" + #: ../../library/argparse.rst:130 msgid "The following sections walk you through this example." msgstr "As próximas seções apresentarão detalhes deste exemplo." @@ -290,6 +349,11 @@ msgstr "" "O primeiro passo ao utilizar o :mod:`argparse` é criar um objeto :class:" "`ArgumentParser`::" +#: ../../library/argparse.rst:139 +msgid "" +">>> parser = argparse.ArgumentParser(description='Process some integers.')" +msgstr "" + #: ../../library/argparse.rst:141 msgid "" "The :class:`ArgumentParser` object will hold all the information necessary " @@ -318,6 +382,15 @@ msgstr "" "objetos. Esta informação é armazenada e utilizada quando o método :meth:" "`~ArgumentParser.parse_args` é invocado. Por exemplo::" +#: ../../library/argparse.rst:154 +msgid "" +">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +"... help='an integer for the accumulator')\n" +">>> parser.add_argument('--sum', dest='accumulate', action='store_const',\n" +"... const=sum, default=max,\n" +"... help='sum the integers (default: find the max)')" +msgstr "" + #: ../../library/argparse.rst:160 msgid "" "Later, calling :meth:`~ArgumentParser.parse_args` will return an object with " @@ -351,6 +424,12 @@ msgstr "" "`Namespace` simples será construído a partir de atributos analisados a " "partir da linha de comando::" +#: ../../library/argparse.rst:176 +msgid "" +">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" +"Namespace(accumulate=, integers=[7, -1, 42])" +msgstr "" + #: ../../library/argparse.rst:179 msgid "" "In a script, :meth:`~ArgumentParser.parse_args` will typically be called " @@ -506,6 +585,14 @@ msgstr "" "exemplo, considere um arquivo denominado ``myprogram.py`` com o seguinte " "código::" +#: ../../library/argparse.rst:258 ../../library/argparse.rst:678 +msgid "" +"import argparse\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('--foo', help='foo help')\n" +"args = parser.parse_args()" +msgstr "" + #: ../../library/argparse.rst:263 msgid "" "The help for this program will display ``myprogram.py`` as the program name " @@ -514,6 +601,23 @@ msgstr "" "A ajuda para este programa exibirá ``myprogram.py`` como o nome do programa " "(independentemente de onde o programa foi chamado):" +#: ../../library/argparse.rst:266 +msgid "" +"$ python myprogram.py --help\n" +"usage: myprogram.py [-h] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO foo help\n" +"$ cd ..\n" +"$ python subdir/myprogram.py --help\n" +"usage: myprogram.py [-h] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO foo help" +msgstr "" + #: ../../library/argparse.rst:282 msgid "" "To change this default behavior, another value can be supplied using the " @@ -522,6 +626,16 @@ msgstr "" "Para alterar este comportamento padrão, outro valor pode ser fornecido " "usando o argumento ``prog=`` para :class:`ArgumentParser`::" +#: ../../library/argparse.rst:285 +msgid "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + #: ../../library/argparse.rst:292 msgid "" "Note that the program name, whether determined from ``sys.argv[0]`` or from " @@ -532,6 +646,18 @@ msgstr "" "ou do argumento ``prog=``, está disponível para mensagens de ajuda usando o " "especificador de formato ``%(prog)s``." +#: ../../library/argparse.rst:298 +msgid "" +">>> parser = argparse.ArgumentParser(prog='myprogram')\n" +">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" +">>> parser.print_help()\n" +"usage: myprogram [-h] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO foo of the myprogram program" +msgstr "" + #: ../../library/argparse.rst:309 msgid "usage" msgstr "usage" @@ -544,12 +670,45 @@ msgstr "" "Por padrão, :class:`ArgumentParser` calcula a mensagem de uso a partir dos " "argumentos que contém::" +#: ../../library/argparse.rst:314 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo [FOO] foo help" +msgstr "" + #: ../../library/argparse.rst:327 msgid "" "The default message can be overridden with the ``usage=`` keyword argument::" msgstr "" "A mensagem padrão pode ser substituído com o argumento nomeado ``usage=``::" +#: ../../library/argparse.rst:329 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " +"[options]')\n" +">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [options]\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo [FOO] foo help" +msgstr "" + #: ../../library/argparse.rst:342 msgid "" "The ``%(prog)s`` format specifier is available to fill in the program name " @@ -576,6 +735,18 @@ msgstr "" "descrição é exibida entre a string de uso da linha de comando e as mensagens " "de ajuda para os vários argumentos::" +#: ../../library/argparse.rst:357 +msgid "" +">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" +">>> parser.print_help()\n" +"usage: argparse.py [-h]\n" +"\n" +"A foo that bars\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + #: ../../library/argparse.rst:366 msgid "" "By default, the description will be line-wrapped so that it fits within the " @@ -599,6 +770,22 @@ msgstr "" "descrição dos argumentos. Esse texto pode ser especificado usando o " "argumento ``epilog=`` para :class:`ArgumentParser`::" +#: ../../library/argparse.rst:377 +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... description='A foo that bars',\n" +"... epilog=\"And that's how you'd foo a bar\")\n" +">>> parser.print_help()\n" +"usage: argparse.py [-h]\n" +"\n" +"A foo that bars\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"And that's how you'd foo a bar" +msgstr "" + #: ../../library/argparse.rst:390 msgid "" "As with the description_ argument, the ``epilog=`` text is by default line-" @@ -631,6 +818,22 @@ msgstr "" "as ações posicionais e opcionais deles, e adiciona essas ações ao objeto :" "class:`ArgumentParser` sendo construído::" +#: ../../library/argparse.rst:405 +msgid "" +">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" +">>> parent_parser.add_argument('--parent', type=int)\n" +"\n" +">>> foo_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> foo_parser.add_argument('foo')\n" +">>> foo_parser.parse_args(['--parent', '2', 'XXX'])\n" +"Namespace(foo='XXX', parent=2)\n" +"\n" +">>> bar_parser = argparse.ArgumentParser(parents=[parent_parser])\n" +">>> bar_parser.add_argument('--bar')\n" +">>> bar_parser.parse_args(['--bar', 'YYY'])\n" +"Namespace(bar='YYY', parent=None)" +msgstr "" + #: ../../library/argparse.rst:418 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " @@ -677,6 +880,30 @@ msgstr "" "objetos :class:`ArgumentParser` quebram em linha os textos description_ e " "epilog_ nas mensagens de ajuda da linha de comando::" +#: ../../library/argparse.rst:447 +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... description='''this description\n" +"... was indented weird\n" +"... but that is okay''',\n" +"... epilog='''\n" +"... likewise for this epilog whose whitespace will\n" +"... be cleaned up and whose words will be wrapped\n" +"... across a couple lines''')\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"this description was indented weird but that is okay\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"likewise for this epilog whose whitespace will be cleaned up and whose " +"words\n" +"will be wrapped across a couple lines" +msgstr "" + #: ../../library/argparse.rst:467 msgid "" "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " @@ -687,6 +914,31 @@ msgstr "" "que description_ e epilog_ já estão formatados corretamente e não devem ter " "suas linhas quebradas::" +#: ../../library/argparse.rst:471 +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.RawDescriptionHelpFormatter,\n" +"... description=textwrap.dedent('''\\\n" +"... Please do not mess up this text!\n" +"... --------------------------------\n" +"... I have indented it\n" +"... exactly the way\n" +"... I want it\n" +"... '''))\n" +">>> parser.print_help()\n" +"usage: PROG [-h]\n" +"\n" +"Please do not mess up this text!\n" +"--------------------------------\n" +" I have indented it\n" +" exactly the way\n" +" I want it\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + #: ../../library/argparse.rst:493 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " @@ -707,6 +959,24 @@ msgstr "" ":class:`ArgumentDefaultsHelpFormatter` adiciona automaticamente informações " "sobre os valores padrão para cada uma das mensagens de ajuda do argumento::" +#: ../../library/argparse.rst:501 +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int, default=42, help='FOO!')\n" +">>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo FOO] [bar ...]\n" +"\n" +"positional arguments:\n" +" bar BAR! (default: [1, 2, 3])\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO FOO! (default: 42)" +msgstr "" + #: ../../library/argparse.rst:516 msgid "" ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " @@ -717,6 +987,24 @@ msgstr "" "argumento como o nome de exibição para seus valores (em vez de usar o dest_ " "como o formatador regular faz)::" +#: ../../library/argparse.rst:520 +msgid "" +">>> parser = argparse.ArgumentParser(\n" +"... prog='PROG',\n" +"... formatter_class=argparse.MetavarTypeHelpFormatter)\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', type=float)\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [--foo int] float\n" +"\n" +"positional arguments:\n" +" float\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo int" +msgstr "" + #: ../../library/argparse.rst:537 msgid "prefix_chars" msgstr "prefix_chars" @@ -734,6 +1022,15 @@ msgstr "" "como ``+f`` ou ``/foo``, podem especificá-las usando o argumento " "``prefix_chars=`` para o construtor ArgumentParser::" +#: ../../library/argparse.rst:545 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" +">>> parser.add_argument('+f')\n" +">>> parser.add_argument('++bar')\n" +">>> parser.parse_args('+f X ++bar Y'.split())\n" +"Namespace(bar='Y', f='X')" +msgstr "" + #: ../../library/argparse.rst:551 msgid "" "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " @@ -764,6 +1061,17 @@ msgstr "" "qualquer um dos caracteres especificados serão tratados como arquivos e " "serão substituídos pelos argumentos que eles contêm. Por exemplo::" +#: ../../library/argparse.rst:566 +msgid "" +">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" +"... fp.write('-f\\nbar')\n" +"...\n" +">>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@')\n" +">>> parser.add_argument('-f')\n" +">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" +"Namespace(f='bar')" +msgstr "" + #: ../../library/argparse.rst:574 msgid "" "Arguments read from a file must by default be one per line (but see also :" @@ -836,6 +1144,17 @@ msgstr "" "para suprimir globalmente a criação de atributos em chamadas :meth:" "`~ArgumentParser.parse_args`, fornecemos ``argument_default=SUPPRESS``::" +#: ../../library/argparse.rst:605 +msgid "" +">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar', nargs='?')\n" +">>> parser.parse_args(['--foo', '1', 'BAR'])\n" +"Namespace(bar='BAR', foo='1')\n" +">>> parser.parse_args([])\n" +"Namespace()" +msgstr "" + #: ../../library/argparse.rst:616 msgid "allow_abbrev" msgstr "allow_abbrev" @@ -856,6 +1175,16 @@ msgstr "" "Este recurso pode ser desabilitado configurando ``allow_abbrev`` para " "``False``::" +#: ../../library/argparse.rst:624 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" +">>> parser.add_argument('--foobar', action='store_true')\n" +">>> parser.add_argument('--foonley', action='store_false')\n" +">>> parser.parse_args(['--foon'])\n" +"usage: PROG [-h] [--foobar] [--foonley]\n" +"PROG: error: unrecognized arguments: --foon" +msgstr "" + #: ../../library/argparse.rst:635 msgid "conflict_handler" msgstr "conflict_handler" @@ -872,6 +1201,16 @@ msgstr "" "se for feita uma tentativa de criar um argumento com uma string de opção que " "já esteja em uso::" +#: ../../library/argparse.rst:642 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +"Traceback (most recent call last):\n" +" ..\n" +"ArgumentError: argument --foo: conflicting option string(s): --foo" +msgstr "" + #: ../../library/argparse.rst:649 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " @@ -884,6 +1223,21 @@ msgstr "" "Para obter este comportamento, o valor ``'resolve'`` pode ser fornecido ao " "argumento ``conflict_handler=`` de :class:`ArgumentParser`::" +#: ../../library/argparse.rst:654 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', " +"conflict_handler='resolve')\n" +">>> parser.add_argument('-f', '--foo', help='old foo help')\n" +">>> parser.add_argument('--foo', help='new foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-f FOO] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -f FOO old foo help\n" +" --foo FOO new foo help" +msgstr "" + #: ../../library/argparse.rst:665 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " @@ -918,6 +1272,16 @@ msgstr "" "Se ``-h`` ou ``--help`` for fornecido na linha de comando, a ajuda do " "ArgumentParser será impressa:" +#: ../../library/argparse.rst:686 +msgid "" +"$ python myprogram.py --help\n" +"usage: myprogram.py [-h] [--foo FOO]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO foo help" +msgstr "" + #: ../../library/argparse.rst:695 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " @@ -928,6 +1292,17 @@ msgstr "" "pode ser feito passando ``False`` como o argumento ``add_help=`` para a " "classe :class:`ArgumentParser`::" +#: ../../library/argparse.rst:699 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> parser.add_argument('--foo', help='foo help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO]\n" +"\n" +"options:\n" +" --foo FOO foo help" +msgstr "" + #: ../../library/argparse.rst:707 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " @@ -940,6 +1315,16 @@ msgstr "" "``--help`` não são opções válidas. Neste caso, o primeiro caractere em " "``prefix_chars`` é usado para prefixar as opções de ajuda::" +#: ../../library/argparse.rst:713 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" +">>> parser.print_help()\n" +"usage: PROG [+h]\n" +"\n" +"options:\n" +" +h, ++help show this help message and exit" +msgstr "" + #: ../../library/argparse.rst:722 msgid "exit_on_error" msgstr "exit_on_error" @@ -962,6 +1347,21 @@ msgstr "" "Se o usuário quiser detectar erros manualmente, o recurso pode ser " "habilitado configurando ``exit_on_error`` para ``False``::" +#: ../../library/argparse.rst:730 +msgid "" +">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" +">>> parser.add_argument('--integers', type=int)\n" +"_StoreAction(option_strings=['--integers'], dest='integers', nargs=None, " +"const=None, default=None, type=, choices=None, help=None, " +"metavar=None)\n" +">>> try:\n" +"... parser.parse_args('--integers a'.split())\n" +"... except argparse.ArgumentError:\n" +"... print('Catching an argumentError')\n" +"...\n" +"Catching an argumentError" +msgstr "" + #: ../../library/argparse.rst:744 msgid "The add_argument() method" msgstr "O método add_argument()" @@ -1067,10 +1467,18 @@ msgstr "" msgid "For example, an optional argument could be created like::" msgstr "Por exemplo, um argumento opcional poderia ser criado como::" +#: ../../library/argparse.rst:796 +msgid ">>> parser.add_argument('-f', '--foo')" +msgstr "" + #: ../../library/argparse.rst:798 msgid "while a positional argument could be created like::" msgstr "enquanto um argumento posicional pode ser criado como::" +#: ../../library/argparse.rst:800 +msgid ">>> parser.add_argument('bar')" +msgstr "" + #: ../../library/argparse.rst:802 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " @@ -1081,6 +1489,20 @@ msgstr "" "serão identificados pelo prefixo ``-``, e os argumentos restantes serão " "considerados posicionais::" +#: ../../library/argparse.rst:806 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-f', '--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['BAR'])\n" +"Namespace(bar='BAR', foo=None)\n" +">>> parser.parse_args(['BAR', '--foo', 'FOO'])\n" +"Namespace(bar='BAR', foo='FOO')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"usage: PROG [-h] [-f FOO] bar\n" +"PROG: error: the following arguments are required: bar" +msgstr "" + #: ../../library/argparse.rst:821 msgid "action" msgstr "ação" @@ -1110,6 +1532,14 @@ msgstr "" "``'store'`` - Isso apenas armazena o valor do argumento. Esta é a ação " "padrão. Por exemplo::" +#: ../../library/argparse.rst:832 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args('--foo 1'.split())\n" +"Namespace(foo='1')" +msgstr "" + #: ../../library/argparse.rst:837 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " @@ -1122,6 +1552,14 @@ msgstr "" "``None``. A ação ``'store_const'`` é mais comumente usada com argumentos " "opcionais que especificam algum tipo de sinalizador. Por exemplo::" +#: ../../library/argparse.rst:842 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_const', const=42)\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(foo=42)" +msgstr "" + #: ../../library/argparse.rst:847 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " @@ -1134,6 +1572,16 @@ msgstr "" "respectivamente. Além disso, eles criam valores padrão de ``False`` e " "``True`` respectivamente. Por exemplo::" +#: ../../library/argparse.rst:852 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('--bar', action='store_false')\n" +">>> parser.add_argument('--baz', action='store_false')\n" +">>> parser.parse_args('--foo --bar'.split())\n" +"Namespace(foo=True, bar=False, baz=True)" +msgstr "" + #: ../../library/argparse.rst:859 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " @@ -1148,6 +1596,14 @@ msgstr "" "valor analisado da opção, com quaisquer valores da linha de comando anexados " "após esses valores padrão. Exemplo de uso::" +#: ../../library/argparse.rst:865 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='append')\n" +">>> parser.parse_args('--foo 1 --foo 2'.split())\n" +"Namespace(foo=['1', '2'])" +msgstr "" + #: ../../library/argparse.rst:870 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " @@ -1162,6 +1618,17 @@ msgstr "" "útil quando vários argumentos precisam armazenar constantes na mesma lista. " "Por exemplo::" +#: ../../library/argparse.rst:876 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--str', dest='types', action='append_const', " +"const=str)\n" +">>> parser.add_argument('--int', dest='types', action='append_const', " +"const=int)\n" +">>> parser.parse_args('--str --int'.split())\n" +"Namespace(types=[, ])" +msgstr "" + #: ../../library/argparse.rst:882 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " @@ -1170,6 +1637,14 @@ msgstr "" "``'count'`` - Isso conta o número de vezes que um argumento nomeado ocorre. " "Por exemplo, isso é útil para aumentar os níveis de verbosidade::" +#: ../../library/argparse.rst:885 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" +">>> parser.parse_args(['-vvv'])\n" +"Namespace(verbose=3)" +msgstr "" + #: ../../library/argparse.rst:890 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" @@ -1198,6 +1673,16 @@ msgstr "" "meth:`~ArgumentParser.add_argument` e imprime informações de versão e sai " "quando invocado::" +#: ../../library/argparse.rst:901 +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--version', action='version', version='%(prog)s " +"2.0')\n" +">>> parser.parse_args(['--version'])\n" +"PROG 2.0" +msgstr "" + #: ../../library/argparse.rst:907 msgid "" "``'extend'`` - This stores a list, and extends each argument value to the " @@ -1206,6 +1691,16 @@ msgstr "" "``'extend'`` - Isso armazena uma lista e estende cada valor de argumento " "para a lista. Exemplo de uso::" +#: ../../library/argparse.rst:911 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " +"type=str)\n" +">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " +"\"f4\"])\n" +"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" +msgstr "" + #: ../../library/argparse.rst:918 msgid "" "You may also specify an arbitrary action by passing an Action subclass or " @@ -1218,6 +1713,15 @@ msgstr "" "``BooleanOptionalAction`` está disponível em ``argparse`` e adiciona suporte " "para ações booleanas como ``--foo`` e ``--no-foo``::" +#: ../../library/argparse.rst:923 +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" +">>> parser.parse_args(['--no-foo'])\n" +"Namespace(foo=False)" +msgstr "" + #: ../../library/argparse.rst:931 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " @@ -1232,6 +1736,27 @@ msgstr "" msgid "An example of a custom action::" msgstr "Um exemplo de uma ação personalizada::" +#: ../../library/argparse.rst:937 +msgid "" +">>> class FooAction(argparse.Action):\n" +"... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" +"... if nargs is not None:\n" +"... raise ValueError(\"nargs not allowed\")\n" +"... super().__init__(option_strings, dest, **kwargs)\n" +"... def __call__(self, parser, namespace, values, option_string=None):\n" +"... print('%r %r %r' % (namespace, values, option_string))\n" +"... setattr(namespace, self.dest, values)\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action=FooAction)\n" +">>> parser.add_argument('bar', action=FooAction)\n" +">>> args = parser.parse_args('1 --foo 2'.split())\n" +"Namespace(bar=None, foo=None) '1' None\n" +"Namespace(bar='1', foo=None) '2' '--foo'\n" +">>> args\n" +"Namespace(bar='1', foo='2')" +msgstr "" + #: ../../library/argparse.rst:955 msgid "For more details, see :class:`Action`." msgstr "Para mais detalhes, veja :class:`Action`." @@ -1261,6 +1786,15 @@ msgstr "" "``N`` (um inteiro). Os argumentos ``N`` da linha de comando serão reunidos " "em uma lista. Por exemplo::" +#: ../../library/argparse.rst:971 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs=2)\n" +">>> parser.add_argument('bar', nargs=1)\n" +">>> parser.parse_args('c --foo a b'.split())\n" +"Namespace(bar=['c'], foo=['a', 'b'])" +msgstr "" + #: ../../library/argparse.rst:977 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " @@ -1285,6 +1819,19 @@ msgstr "" "presente, mas não é seguida por um argumento de linha de comando. Neste caso " "o valor de const_ será produzido. Alguns exemplos para ilustrar isso::" +#: ../../library/argparse.rst:989 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" +">>> parser.add_argument('bar', nargs='?', default='d')\n" +">>> parser.parse_args(['XX', '--foo', 'YY'])\n" +"Namespace(bar='XX', foo='YY')\n" +">>> parser.parse_args(['XX', '--foo'])\n" +"Namespace(bar='XX', foo='c')\n" +">>> parser.parse_args([])\n" +"Namespace(bar='d', foo='d')" +msgstr "" + #: ../../library/argparse.rst:999 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " @@ -1293,6 +1840,21 @@ msgstr "" "Um dos usos mais comuns de ``nargs='?'`` é permitir arquivos de entrada e " "saída opcionais::" +#: ../../library/argparse.rst:1002 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" +"... default=sys.stdin)\n" +">>> parser.add_argument('outfile', nargs='?', type=argparse.FileType('w'),\n" +"... default=sys.stdout)\n" +">>> parser.parse_args(['input.txt', 'output.txt'])\n" +"Namespace(infile=<_io.TextIOWrapper name='input.txt' encoding='UTF-8'>,\n" +" outfile=<_io.TextIOWrapper name='output.txt' encoding='UTF-8'>)\n" +">>> parser.parse_args([])\n" +"Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" +" outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" +msgstr "" + #: ../../library/argparse.rst:1016 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " @@ -1305,6 +1867,16 @@ msgstr "" "argumento posicional com ``nargs='*'``, mas vários argumentos opcionais com " "``nargs='*'`` são possíveis. Por exemplo::" +#: ../../library/argparse.rst:1021 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', nargs='*')\n" +">>> parser.add_argument('--bar', nargs='*')\n" +">>> parser.add_argument('baz', nargs='*')\n" +">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" +"Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" +msgstr "" + #: ../../library/argparse.rst:1030 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " @@ -1316,6 +1888,17 @@ msgstr "" "gerada se não houver pelo menos um argumento de linha de comando presente. " "Por exemplo::" +#: ../../library/argparse.rst:1034 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('foo', nargs='+')\n" +">>> parser.parse_args(['a', 'b'])\n" +"Namespace(foo=['a', 'b'])\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] foo [foo ...]\n" +"PROG: error: the following arguments are required: foo" +msgstr "" + #: ../../library/argparse.rst:1042 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " @@ -1404,6 +1987,16 @@ msgstr "" "presente. Para argumentos opcionais, o valor ``default`` é usado quando a " "string de opção não estava presente na linha de comando::" +#: ../../library/argparse.rst:1087 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args(['--foo', '2'])\n" +"Namespace(foo='2')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" +msgstr "" + #: ../../library/argparse.rst:1094 msgid "" "If the target namespace already has an attribute set, the action *default* " @@ -1412,6 +2005,14 @@ msgstr "" "Se o espaço de nomes de destino já tiver um atributo definido, a ação " "*default* não o substituirá::" +#: ../../library/argparse.rst:1097 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=42)\n" +">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" +"Namespace(foo=101)" +msgstr "" + #: ../../library/argparse.rst:1102 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " @@ -1425,6 +2026,15 @@ msgstr "" "atributo no valor de retorno :class:`Namespace`. Caso contrário, o " "analisador usa o valor como está::" +#: ../../library/argparse.rst:1107 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--length', default='10', type=int)\n" +">>> parser.add_argument('--width', default=10.5, type=int)\n" +">>> parser.parse_args()\n" +"Namespace(length=10, width=10.5)" +msgstr "" + #: ../../library/argparse.rst:1113 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " @@ -1434,6 +2044,16 @@ msgstr "" "``default`` é usado quando nenhum argumento de linha de comando estava " "presente::" +#: ../../library/argparse.rst:1116 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', nargs='?', default=42)\n" +">>> parser.parse_args(['a'])\n" +"Namespace(foo='a')\n" +">>> parser.parse_args([])\n" +"Namespace(foo=42)" +msgstr "" + #: ../../library/argparse.rst:1124 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " @@ -1442,6 +2062,16 @@ msgstr "" "Fornecer ``default=argparse.SUPPRESS`` faz com que nenhum atributo seja " "adicionado se o argumento da linha de comando não estiver presente::" +#: ../../library/argparse.rst:1127 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" +">>> parser.parse_args([])\n" +"Namespace()\n" +">>> parser.parse_args(['--foo', '1'])\n" +"Namespace(foo='1')" +msgstr "" + #: ../../library/argparse.rst:1138 msgid "type" msgstr "tipo" @@ -1486,10 +2116,37 @@ msgid "Common built-in types and functions can be used as type converters:" msgstr "" "Tipos e funções embutidas comuns podem ser usados ​​como conversores de tipo:" +#: ../../library/argparse.rst:1156 +msgid "" +"import argparse\n" +"import pathlib\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('count', type=int)\n" +"parser.add_argument('distance', type=float)\n" +"parser.add_argument('street', type=ascii)\n" +"parser.add_argument('code_point', type=ord)\n" +"parser.add_argument('source_file', type=open)\n" +"parser.add_argument('dest_file', type=argparse.FileType('w', " +"encoding='latin-1'))\n" +"parser.add_argument('datapath', type=pathlib.Path)" +msgstr "" + #: ../../library/argparse.rst:1170 msgid "User defined functions can be used as well:" msgstr "Funções definidas pelo usuário também podem ser usadas:" +#: ../../library/argparse.rst:1172 +msgid "" +">>> def hyphenated(string):\n" +"... return '-'.join([word[:4] for word in string.casefold().split()])\n" +"...\n" +">>> parser = argparse.ArgumentParser()\n" +">>> _ = parser.add_argument('short_title', type=hyphenated)\n" +">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" +"Namespace(short_title='\"the-tale-of-two-citi')" +msgstr "" + #: ../../library/argparse.rst:1182 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " @@ -1567,6 +2224,18 @@ msgstr "" "argumentos serão verificados e uma mensagem de erro será exibida se o " "argumento não for um dos valores aceitáveis::" +#: ../../library/argparse.rst:1217 +msgid "" +">>> parser = argparse.ArgumentParser(prog='game.py')\n" +">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" +">>> parser.parse_args(['rock'])\n" +"Namespace(move='rock')\n" +">>> parser.parse_args(['fire'])\n" +"usage: game.py [-h] {rock,paper,scissors}\n" +"game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" +"'paper', 'scissors')" +msgstr "" + #: ../../library/argparse.rst:1226 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " @@ -1577,6 +2246,17 @@ msgstr "" "conversão de type_ ter sido realizada, portanto o tipo dos objetos na " "sequência *choices* deve corresponder ao type_ especificado::" +#: ../../library/argparse.rst:1230 +msgid "" +">>> parser = argparse.ArgumentParser(prog='doors.py')\n" +">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" +">>> print(parser.parse_args(['3']))\n" +"Namespace(door=3)\n" +">>> parser.parse_args(['4'])\n" +"usage: doors.py [-h] {1,2,3}\n" +"doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" +msgstr "" + #: ../../library/argparse.rst:1238 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " @@ -1623,6 +2303,17 @@ msgstr "" "especificado para o argumento nomeado ``required=`` para :meth:" "`~ArgumentParser.add_argument`::" +#: ../../library/argparse.rst:1260 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', required=True)\n" +">>> parser.parse_args(['--foo', 'BAR'])\n" +"Namespace(foo='BAR')\n" +">>> parser.parse_args([])\n" +"usage: [-h] --foo FOO\n" +": error: the following arguments are required: --foo" +msgstr "" + #: ../../library/argparse.rst:1268 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" @@ -1658,6 +2349,24 @@ msgstr "" "linha de comando), estas descrições de ``help`` serão exibidas com cada " "argumento::" +#: ../../library/argparse.rst:1288 +msgid "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('--foo', action='store_true',\n" +"... help='foo the bars before frobbling')\n" +">>> parser.add_argument('bar', nargs='+',\n" +"... help='one of the bars to be frobbled')\n" +">>> parser.parse_args(['-h'])\n" +"usage: frobble [-h] [--foo] bar [bar ...]\n" +"\n" +"positional arguments:\n" +" bar one of the bars to be frobbled\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo foo the bars before frobbling" +msgstr "" + #: ../../library/argparse.rst:1303 msgid "" "The ``help`` strings can include various format specifiers to avoid " @@ -1672,6 +2381,21 @@ msgstr "" "``%(prog)s`` e a maioria dos argumentos nomeados para :meth:`~ArgumentParser." "add_argument`, por exemplo. ``%(default)s``, ``%(type)s``, etc.::" +#: ../../library/argparse.rst:1308 +msgid "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" +"... help='the bar to %(prog)s (default: %(default)s)')\n" +">>> parser.print_help()\n" +"usage: frobble [-h] [bar]\n" +"\n" +"positional arguments:\n" +" bar the bar to frobble (default: 42)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + #: ../../library/argparse.rst:1320 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " @@ -1689,6 +2413,17 @@ msgstr "" ":mod:`argparse` oferece suporte a silenciar a entrada de ajuda para certas " "opções, definindo o valor ``help`` como ``argparse.SUPPRESS``::" +#: ../../library/argparse.rst:1326 +msgid "" +">>> parser = argparse.ArgumentParser(prog='frobble')\n" +">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" +">>> parser.print_help()\n" +"usage: frobble [-h]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit" +msgstr "" + #: ../../library/argparse.rst:1338 msgid "metavar" msgstr "metavar" @@ -1714,10 +2449,46 @@ msgstr "" "seguido por um único argumento de linha de comando será referido como " "``FOO``. Um exemplo::" +#: ../../library/argparse.rst:1349 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo FOO] bar\n" +"\n" +"positional arguments:\n" +" bar\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo FOO" +msgstr "" + #: ../../library/argparse.rst:1364 msgid "An alternative name can be specified with ``metavar``::" msgstr "Um nome alternativo pode ser especificado com ``metavar``::" +#: ../../library/argparse.rst:1366 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', metavar='YYY')\n" +">>> parser.add_argument('bar', metavar='XXX')\n" +">>> parser.parse_args('X --foo Y'.split())\n" +"Namespace(bar='X', foo='Y')\n" +">>> parser.print_help()\n" +"usage: [-h] [--foo YYY] XXX\n" +"\n" +"positional arguments:\n" +" XXX\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo YYY" +msgstr "" + #: ../../library/argparse.rst:1381 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " @@ -1738,6 +2509,20 @@ msgstr "" "múltiplas vezes. Fornecer uma tupla para ``metavar`` especifica uma exibição " "diferente para cada um dos argumentos::" +#: ../../library/argparse.rst:1389 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', nargs=2)\n" +">>> parser.add_argument('--foo', nargs=2, metavar=('bar', 'baz'))\n" +">>> parser.print_help()\n" +"usage: PROG [-h] [-x X X] [--foo bar baz]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" -x X X\n" +" --foo bar baz" +msgstr "" + #: ../../library/argparse.rst:1404 msgid "dest" msgstr "dest" @@ -1758,6 +2543,14 @@ msgstr "" "é normalmente fornecido como o primeiro argumento para :meth:" "`~ArgumentParser.add_argument`::" +#: ../../library/argparse.rst:1413 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_args(['XXX'])\n" +"Namespace(bar='XXX')" +msgstr "" + #: ../../library/argparse.rst:1418 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " @@ -1778,11 +2571,30 @@ msgstr "" "caracteres ``_`` para garantir que a string seja um nome de atributo válido. " "Os exemplos abaixo ilustram esse comportamento:" +#: ../../library/argparse.rst:1427 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" +">>> parser.add_argument('-x', '-y')\n" +">>> parser.parse_args('-f 1 -x 2'.split())\n" +"Namespace(foo_bar='1', x='2')\n" +">>> parser.parse_args('--foo 1 -y 2'.split())\n" +"Namespace(foo_bar='1', x='2')" +msgstr "" + #: ../../library/argparse.rst:1435 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" "``dest`` permite que um nome de atributo personalizado seja fornecido::" +#: ../../library/argparse.rst:1437 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', dest='bar')\n" +">>> parser.parse_args('--foo XXX'.split())\n" +"Namespace(bar='XXX')" +msgstr "" + #: ../../library/argparse.rst:1443 msgid "Action classes" msgstr "Classes de ação" @@ -1900,6 +2712,17 @@ msgid "" "the option and its value are passed as two separate arguments::" msgstr "" +#: ../../library/argparse.rst:1515 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x')\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(['-x', 'X'])\n" +"Namespace(foo=None, x='X')\n" +">>> parser.parse_args(['--foo', 'FOO'])\n" +"Namespace(foo='FOO', x=None)" +msgstr "" + #: ../../library/argparse.rst:1523 msgid "" "For long options (options with names longer than a single character), the " @@ -1907,18 +2730,40 @@ msgid "" "``=`` to separate them::" msgstr "" +#: ../../library/argparse.rst:1527 +msgid "" +">>> parser.parse_args(['--foo=FOO'])\n" +"Namespace(foo='FOO', x=None)" +msgstr "" + #: ../../library/argparse.rst:1530 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" +#: ../../library/argparse.rst:1533 +msgid "" +">>> parser.parse_args(['-xX'])\n" +"Namespace(foo=None, x='X')" +msgstr "" + #: ../../library/argparse.rst:1536 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" +#: ../../library/argparse.rst:1539 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x', action='store_true')\n" +">>> parser.add_argument('-y', action='store_true')\n" +">>> parser.add_argument('-z')\n" +">>> parser.parse_args(['-xyzZ'])\n" +"Namespace(x=True, y=True, z='Z')" +msgstr "" + #: ../../library/argparse.rst:1548 msgid "Invalid arguments" msgstr "Argumentos inválidos" @@ -1931,6 +2776,28 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" +#: ../../library/argparse.rst:1555 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', type=int)\n" +">>> parser.add_argument('bar', nargs='?')\n" +"\n" +">>> # invalid type\n" +">>> parser.parse_args(['--foo', 'spam'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: argument --foo: invalid int value: 'spam'\n" +"\n" +">>> # invalid option\n" +">>> parser.parse_args(['--bar'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: no such option: --bar\n" +"\n" +">>> # wrong number of arguments\n" +">>> parser.parse_args(['spam', 'badger'])\n" +"usage: PROG [-h] [--foo FOO] [bar]\n" +"PROG: error: extra arguments found: badger" +msgstr "" + #: ../../library/argparse.rst:1576 msgid "Arguments containing ``-``" msgstr "Argumentos contendo ``-``" @@ -1947,6 +2814,39 @@ msgid "" "negative numbers::" msgstr "" +#: ../../library/argparse.rst:1586 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-x')\n" +">>> parser.add_argument('foo', nargs='?')\n" +"\n" +">>> # no negative number options, so -1 is a positional argument\n" +">>> parser.parse_args(['-x', '-1'])\n" +"Namespace(foo=None, x='-1')\n" +"\n" +">>> # no negative number options, so -1 and -5 are positional arguments\n" +">>> parser.parse_args(['-x', '-1', '-5'])\n" +"Namespace(foo='-5', x='-1')\n" +"\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-1', dest='one')\n" +">>> parser.add_argument('foo', nargs='?')\n" +"\n" +">>> # negative number options present, so -1 is an option\n" +">>> parser.parse_args(['-1', 'X'])\n" +"Namespace(foo=None, one='X')\n" +"\n" +">>> # negative number options present, so -2 is an option\n" +">>> parser.parse_args(['-2'])\n" +"usage: PROG [-h] [-1 ONE] [foo]\n" +"PROG: error: no such option: -2\n" +"\n" +">>> # negative number options present, so both -1s are options\n" +">>> parser.parse_args(['-1', '-1'])\n" +"usage: PROG [-h] [-1 ONE] [foo]\n" +"PROG: error: argument -1: expected one argument" +msgstr "" + #: ../../library/argparse.rst:1616 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " @@ -1955,6 +2855,12 @@ msgid "" "positional argument::" msgstr "" +#: ../../library/argparse.rst:1621 +msgid "" +">>> parser.parse_args(['--', '-f'])\n" +"Namespace(foo='-f', one=None)" +msgstr "" + #: ../../library/argparse.rst:1624 msgid "" "See also :ref:`the argparse howto on ambiguous arguments >> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('-bacon')\n" +">>> parser.add_argument('-badger')\n" +">>> parser.parse_args('-bac MMM'.split())\n" +"Namespace(bacon='MMM', badger=None)\n" +">>> parser.parse_args('-bad WOOD'.split())\n" +"Namespace(bacon=None, badger='WOOD')\n" +">>> parser.parse_args('-ba BA'.split())\n" +"usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" +"PROG: error: ambiguous option: -ba could match -badger, -bacon" +msgstr "" + #: ../../library/argparse.rst:1647 msgid "" "An error is produced for arguments that could produce more than one options. " @@ -1990,6 +2910,21 @@ msgid "" "testing at the interactive prompt::" msgstr "" +#: ../../library/argparse.rst:1660 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument(\n" +"... 'integers', metavar='int', type=int, choices=range(10),\n" +"... nargs='+', help='an integer in the range 0..9')\n" +">>> parser.add_argument(\n" +"... '--sum', dest='accumulate', action='store_const', const=sum,\n" +"... default=max, help='sum the integers (default: find the max)')\n" +">>> parser.parse_args(['1', '2', '3', '4'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])\n" +">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" +"Namespace(accumulate=, integers=[1, 2, 3, 4])" +msgstr "" + #: ../../library/argparse.rst:1675 msgid "The Namespace object" msgstr "O objeto Namespace" @@ -2007,6 +2942,15 @@ msgid "" "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" +#: ../../library/argparse.rst:1686 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> args = parser.parse_args(['--foo', 'BAR'])\n" +">>> vars(args)\n" +"{'foo': 'BAR'}" +msgstr "" + #: ../../library/argparse.rst:1692 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " @@ -2014,6 +2958,19 @@ msgid "" "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" +#: ../../library/argparse.rst:1696 +msgid "" +">>> class C:\n" +"... pass\n" +"...\n" +">>> c = C()\n" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.parse_args(args=['--foo', 'BAR'], namespace=c)\n" +">>> c.foo\n" +"'BAR'" +msgstr "" + #: ../../library/argparse.rst:1708 msgid "Other utilities" msgstr "" @@ -2100,6 +3057,28 @@ msgstr "" msgid "Some example usage::" msgstr "Alguns exemplos de uso::" +#: ../../library/argparse.rst:1762 +msgid "" +">>> # create the top-level parser\n" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> parser.add_argument('--foo', action='store_true', help='foo help')\n" +">>> subparsers = parser.add_subparsers(help='sub-command help')\n" +">>>\n" +">>> # create the parser for the \"a\" command\n" +">>> parser_a = subparsers.add_parser('a', help='a help')\n" +">>> parser_a.add_argument('bar', type=int, help='bar help')\n" +">>>\n" +">>> # create the parser for the \"b\" command\n" +">>> parser_b = subparsers.add_parser('b', help='b help')\n" +">>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')\n" +">>>\n" +">>> # parse some argument lists\n" +">>> parser.parse_args(['a', '12'])\n" +"Namespace(bar=12, foo=False)\n" +">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" +"Namespace(baz='Z', foo=True)" +msgstr "" + #: ../../library/argparse.rst:1781 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " @@ -2119,6 +3098,37 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" +#: ../../library/argparse.rst:1796 +msgid "" +">>> parser.parse_args(['--help'])\n" +"usage: PROG [-h] [--foo] {a,b} ...\n" +"\n" +"positional arguments:\n" +" {a,b} sub-command help\n" +" a a help\n" +" b b help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --foo foo help\n" +"\n" +">>> parser.parse_args(['a', '--help'])\n" +"usage: PROG a [-h] bar\n" +"\n" +"positional arguments:\n" +" bar bar help\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +">>> parser.parse_args(['b', '--help'])\n" +"usage: PROG b [-h] [--baz {X,Y,Z}]\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +" --baz {X,Y,Z} baz help" +msgstr "" + #: ../../library/argparse.rst:1824 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " @@ -2126,6 +3136,26 @@ msgid "" "commands will appear in their own group in the help output. For example::" msgstr "" +#: ../../library/argparse.rst:1828 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(title='subcommands',\n" +"... description='valid subcommands',\n" +"... help='additional help')\n" +">>> subparsers.add_parser('foo')\n" +">>> subparsers.add_parser('bar')\n" +">>> parser.parse_args(['-h'])\n" +"usage: [-h] {foo,bar} ...\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"subcommands:\n" +" valid subcommands\n" +"\n" +" {foo,bar} additional help" +msgstr "" + #: ../../library/argparse.rst:1845 msgid "" "Furthermore, ``add_parser`` supports an additional ``aliases`` argument, " @@ -2133,6 +3163,16 @@ msgid "" "like ``svn``, aliases ``co`` as a shorthand for ``checkout``::" msgstr "" +#: ../../library/argparse.rst:1849 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers()\n" +">>> checkout = subparsers.add_parser('checkout', aliases=['co'])\n" +">>> checkout.add_argument('foo')\n" +">>> parser.parse_args(['co', 'bar'])\n" +"Namespace(foo='bar')" +msgstr "" + #: ../../library/argparse.rst:1856 msgid "" "One particularly effective way of handling sub-commands is to combine the " @@ -2141,6 +3181,41 @@ msgid "" "example::" msgstr "" +#: ../../library/argparse.rst:1861 +msgid "" +">>> # sub-command functions\n" +">>> def foo(args):\n" +"... print(args.x * args.y)\n" +"...\n" +">>> def bar(args):\n" +"... print('((%s))' % args.z)\n" +"...\n" +">>> # create the top-level parser\n" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(required=True)\n" +">>>\n" +">>> # create the parser for the \"foo\" command\n" +">>> parser_foo = subparsers.add_parser('foo')\n" +">>> parser_foo.add_argument('-x', type=int, default=1)\n" +">>> parser_foo.add_argument('y', type=float)\n" +">>> parser_foo.set_defaults(func=foo)\n" +">>>\n" +">>> # create the parser for the \"bar\" command\n" +">>> parser_bar = subparsers.add_parser('bar')\n" +">>> parser_bar.add_argument('z')\n" +">>> parser_bar.set_defaults(func=bar)\n" +">>>\n" +">>> # parse the args and call whatever function was selected\n" +">>> args = parser.parse_args('foo 1 -x 2'.split())\n" +">>> args.func(args)\n" +"2.0\n" +">>>\n" +">>> # parse the args and call whatever function was selected\n" +">>> args = parser.parse_args('bar XYZYX'.split())\n" +">>> args.func(args)\n" +"((XYZYX))" +msgstr "" + #: ../../library/argparse.rst:1893 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " @@ -2151,6 +3226,18 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" +#: ../../library/argparse.rst:1900 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" +">>> subparser1 = subparsers.add_parser('1')\n" +">>> subparser1.add_argument('-x')\n" +">>> subparser2 = subparsers.add_parser('2')\n" +">>> subparser2.add_argument('y')\n" +">>> parser.parse_args(['2', 'frobble'])\n" +"Namespace(subparser_name='2', y='frobble')" +msgstr "" + #: ../../library/argparse.rst:1909 msgid "New *required* keyword argument." msgstr "" @@ -2168,6 +3255,17 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" +#: ../../library/argparse.rst:1924 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" +">>> parser.add_argument('out', type=argparse.FileType('w', " +"encoding='UTF-8'))\n" +">>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])\n" +"Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " +"raw=<_io.FileIO name='raw.dat' mode='wb'>)" +msgstr "" + #: ../../library/argparse.rst:1930 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " @@ -2175,6 +3273,14 @@ msgid "" "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" +#: ../../library/argparse.rst:1934 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" +">>> parser.parse_args(['-'])\n" +"Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" +msgstr "" + #: ../../library/argparse.rst:1939 msgid "Added the *encodings* and *errors* parameters." msgstr "" @@ -2192,6 +3298,20 @@ msgid "" "method::" msgstr "" +#: ../../library/argparse.rst:1954 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group = parser.add_argument_group('group')\n" +">>> group.add_argument('--foo', help='foo help')\n" +">>> group.add_argument('bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--foo FOO] bar\n" +"\n" +"group:\n" +" bar bar help\n" +" --foo FOO foo help" +msgstr "" + #: ../../library/argparse.rst:1965 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " @@ -2203,6 +3323,27 @@ msgid "" "this display::" msgstr "" +#: ../../library/argparse.rst:1973 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" +">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" +">>> group1.add_argument('foo', help='foo help')\n" +">>> group2 = parser.add_argument_group('group2', 'group2 description')\n" +">>> group2.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [--bar BAR] foo\n" +"\n" +"group1:\n" +" group1 description\n" +"\n" +" foo foo help\n" +"\n" +"group2:\n" +" group2 description\n" +"\n" +" --bar BAR bar help" +msgstr "" + #: ../../library/argparse.rst:1991 msgid "" "Note that any arguments not in your user-defined groups will end up back in " @@ -2228,6 +3369,21 @@ msgid "" "command line::" msgstr "" +#: ../../library/argparse.rst:2010 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group()\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args(['--foo'])\n" +"Namespace(bar=True, foo=True)\n" +">>> parser.parse_args(['--bar'])\n" +"Namespace(bar=False, foo=False)\n" +">>> parser.parse_args(['--foo', '--bar'])\n" +"usage: PROG [-h] [--foo | --bar]\n" +"PROG: error: argument --bar: not allowed with argument --foo" +msgstr "" + #: ../../library/argparse.rst:2022 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " @@ -2235,6 +3391,17 @@ msgid "" "is required::" msgstr "" +#: ../../library/argparse.rst:2026 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_mutually_exclusive_group(required=True)\n" +">>> group.add_argument('--foo', action='store_true')\n" +">>> group.add_argument('--bar', action='store_false')\n" +">>> parser.parse_args([])\n" +"usage: PROG [-h] (--foo | --bar)\n" +"PROG: error: one of the arguments --foo --bar is required" +msgstr "" + #: ../../library/argparse.rst:2034 msgid "" "Note that currently mutually exclusive argument groups do not support the " @@ -2243,6 +3410,26 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" +#: ../../library/argparse.rst:2040 +msgid "" +">>> parser = argparse.ArgumentParser(prog='PROG')\n" +">>> group = parser.add_argument_group('Group title', 'Group description')\n" +">>> exclusive_group = group.add_mutually_exclusive_group(required=True)\n" +">>> exclusive_group.add_argument('--foo', help='foo help')\n" +">>> exclusive_group.add_argument('--bar', help='bar help')\n" +">>> parser.print_help()\n" +"usage: PROG [-h] (--foo FOO | --bar BAR)\n" +"\n" +"options:\n" +" -h, --help show this help message and exit\n" +"\n" +"Group title:\n" +" Group description\n" +"\n" +" --foo FOO foo help\n" +" --bar BAR bar help" +msgstr "" + #: ../../library/argparse.rst:2057 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " @@ -2264,11 +3451,29 @@ msgid "" "command line to be added::" msgstr "" +#: ../../library/argparse.rst:2075 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('foo', type=int)\n" +">>> parser.set_defaults(bar=42, baz='badger')\n" +">>> parser.parse_args(['736'])\n" +"Namespace(bar=42, baz='badger', foo=736)" +msgstr "" + #: ../../library/argparse.rst:2081 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" +#: ../../library/argparse.rst:2083 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='bar')\n" +">>> parser.set_defaults(foo='spam')\n" +">>> parser.parse_args([])\n" +"Namespace(foo='spam')" +msgstr "" + #: ../../library/argparse.rst:2089 msgid "" "Parser-level defaults can be particularly useful when working with multiple " @@ -2282,6 +3487,14 @@ msgid "" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" +#: ../../library/argparse.rst:2099 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', default='badger')\n" +">>> parser.get_default('foo')\n" +"'badger'" +msgstr "" + #: ../../library/argparse.rst:2106 msgid "Printing help" msgstr "Imprimindo a ajuda" @@ -2340,6 +3553,15 @@ msgid "" "remaining argument strings." msgstr "" +#: ../../library/argparse.rst:2152 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo', action='store_true')\n" +">>> parser.add_argument('bar')\n" +">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" +"(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" +msgstr "" + #: ../../library/argparse.rst:2159 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" @@ -2373,6 +3595,13 @@ msgid "" "word as an argument. The following example demonstrates how to do this::" msgstr "" +#: ../../library/argparse.rst:2182 +msgid "" +"class MyArgumentParser(argparse.ArgumentParser):\n" +" def convert_arg_line_to_args(self, arg_line):\n" +" return arg_line.split()" +msgstr "" + #: ../../library/argparse.rst:2188 msgid "Exiting methods" msgstr "Métodos existentes" @@ -2384,6 +3613,15 @@ msgid "" "method to handle these steps differently::" msgstr "" +#: ../../library/argparse.rst:2196 +msgid "" +"class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" +" def exit(self, status=0, message=None):\n" +" if status:\n" +" raise Exception(f'Exiting because of an error: {message}')\n" +" exit(status)" +msgstr "" + #: ../../library/argparse.rst:2204 msgid "" "This method prints a usage message including the *message* to the standard " @@ -2418,6 +3656,18 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" +#: ../../library/argparse.rst:2230 +msgid "" +">>> parser = argparse.ArgumentParser()\n" +">>> parser.add_argument('--foo')\n" +">>> parser.add_argument('cmd')\n" +">>> parser.add_argument('rest', nargs='*', type=int)\n" +">>> parser.parse_known_args('doit 1 --foo bar 2 3'.split())\n" +"(Namespace(cmd='doit', foo='bar', rest=[1]), ['2', '3'])\n" +">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" +"Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" +msgstr "" + #: ../../library/argparse.rst:2239 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " diff --git a/library/array.po b/library/array.po index 1566eb0e4..b1a2177d0 100644 --- a/library/array.po +++ b/library/array.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# (Douglas da Silva) , 2021 -# Misael borges , 2021 -# Adorilson Bezerra , 2021 -# Juliana Karoline , 2021 -# Bonifacio de Oliveira , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Bonifacio de Oliveira , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -36,7 +30,7 @@ msgstr ":mod:`!array`--- Vetores eficientes de valores numéricos" #: ../../library/array.rst:11 msgid "" "This module defines an object type which can compactly represent an array of " -"basic values: characters, integers, floating point numbers. Arrays are " +"basic values: characters, integers, floating-point numbers. Arrays are " "sequence types and behave very much like lists, except that the type of " "objects stored in them is constrained. The type is specified at object " "creation time by using a :dfn:`type code`, which is a single character. The " @@ -467,7 +461,15 @@ msgid "" "be converted back to an array with the same type and value using :func:" "`eval`, so long as the :class:`~array.array` class has been imported using " "``from array import array``. Variables ``inf`` and ``nan`` must also be " -"defined if it contains corresponding floating point values. Examples::" +"defined if it contains corresponding floating-point values. Examples::" +msgstr "" + +#: ../../library/array.rst:259 +msgid "" +"array('l')\n" +"array('u', 'hello \\u2641')\n" +"array('l', [1, 2, 3, 4, 5])\n" +"array('d', [1.0, 2.0, 3.14, -inf, nan])" msgstr "" #: ../../library/array.rst:267 @@ -480,15 +482,13 @@ msgstr "Empacotamento e desempacotamento de dados binários heterogêneos." #: ../../library/array.rst:270 msgid "Module :mod:`xdrlib`" -msgstr "Módulo :mod:`xdrlib`" +msgstr "" #: ../../library/array.rst:271 msgid "" "Packing and unpacking of External Data Representation (XDR) data as used in " "some remote procedure call systems." msgstr "" -"Empacotamento e desempacotamento de dados External Data Representation (XDR) " -"usados em alguns sistemas para chamada remota de procedimentos." #: ../../library/array.rst:274 msgid "`NumPy `_" diff --git a/library/ast.po b/library/ast.po index e3d4caa5e..26cee8de7 100644 --- a/library/ast.po +++ b/library/ast.po @@ -4,11 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Adorilson Bezerra , 2023 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -16,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -72,6 +67,180 @@ msgstr "Gramática Abstrata" msgid "The abstract grammar is currently defined as follows:" msgstr "A gramática abstrata está atualmente definida da seguinte forma:" +#: ../../library/ast.rst:37 +msgid "" +"-- ASDL's 4 builtin types are:\n" +"-- identifier, int, string, constant\n" +"\n" +"module Python\n" +"{\n" +" mod = Module(stmt* body, type_ignore* type_ignores)\n" +" | Interactive(stmt* body)\n" +" | Expression(expr body)\n" +" | FunctionType(expr* argtypes, expr returns)\n" +"\n" +" stmt = FunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? returns,\n" +" string? type_comment, type_param* type_params)\n" +" | AsyncFunctionDef(identifier name, arguments args,\n" +" stmt* body, expr* decorator_list, expr? " +"returns,\n" +" string? type_comment, type_param* type_params)\n" +"\n" +" | ClassDef(identifier name,\n" +" expr* bases,\n" +" keyword* keywords,\n" +" stmt* body,\n" +" expr* decorator_list,\n" +" type_param* type_params)\n" +" | Return(expr? value)\n" +"\n" +" | Delete(expr* targets)\n" +" | Assign(expr* targets, expr value, string? type_comment)\n" +" | TypeAlias(expr name, type_param* type_params, expr value)\n" +" | AugAssign(expr target, operator op, expr value)\n" +" -- 'simple' indicates that we annotate simple name without parens\n" +" | AnnAssign(expr target, expr annotation, expr? value, int " +"simple)\n" +"\n" +" -- use 'orelse' because else is a keyword in target languages\n" +" | For(expr target, expr iter, stmt* body, stmt* orelse, string? " +"type_comment)\n" +" | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, " +"string? type_comment)\n" +" | While(expr test, stmt* body, stmt* orelse)\n" +" | If(expr test, stmt* body, stmt* orelse)\n" +" | With(withitem* items, stmt* body, string? type_comment)\n" +" | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" +"\n" +" | Match(expr subject, match_case* cases)\n" +"\n" +" | Raise(expr? exc, expr? cause)\n" +" | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " +"finalbody)\n" +" | Assert(expr test, expr? msg)\n" +"\n" +" | Import(alias* names)\n" +" | ImportFrom(identifier? module, alias* names, int? level)\n" +"\n" +" | Global(identifier* names)\n" +" | Nonlocal(identifier* names)\n" +" | Expr(expr value)\n" +" | Pass | Break | Continue\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser " +"uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- BoolOp() can use left & right?\n" +" expr = BoolOp(boolop op, expr* values)\n" +" | NamedExpr(expr target, expr value)\n" +" | BinOp(expr left, operator op, expr right)\n" +" | UnaryOp(unaryop op, expr operand)\n" +" | Lambda(arguments args, expr body)\n" +" | IfExp(expr test, expr body, expr orelse)\n" +" | Dict(expr* keys, expr* values)\n" +" | Set(expr* elts)\n" +" | ListComp(expr elt, comprehension* generators)\n" +" | SetComp(expr elt, comprehension* generators)\n" +" | DictComp(expr key, expr value, comprehension* generators)\n" +" | GeneratorExp(expr elt, comprehension* generators)\n" +" -- the grammar constrains where yield expressions can occur\n" +" | Await(expr value)\n" +" | Yield(expr? value)\n" +" | YieldFrom(expr value)\n" +" -- need sequences for compare to distinguish between\n" +" -- x < 4 < 3 and (x < 4) < 3\n" +" | Compare(expr left, cmpop* ops, expr* comparators)\n" +" | Call(expr func, expr* args, keyword* keywords)\n" +" | FormattedValue(expr value, int conversion, expr? format_spec)\n" +" | JoinedStr(expr* values)\n" +" | Constant(constant value, string? kind)\n" +"\n" +" -- the following expression can appear in assignment context\n" +" | Attribute(expr value, identifier attr, expr_context ctx)\n" +" | Subscript(expr value, expr slice, expr_context ctx)\n" +" | Starred(expr value, expr_context ctx)\n" +" | Name(identifier id, expr_context ctx)\n" +" | List(expr* elts, expr_context ctx)\n" +" | Tuple(expr* elts, expr_context ctx)\n" +"\n" +" -- can appear only in Subscript\n" +" | Slice(expr? lower, expr? upper, expr? step)\n" +"\n" +" -- col_offset is the byte offset in the utf8 string the parser " +"uses\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" expr_context = Load | Store | Del\n" +"\n" +" boolop = And | Or\n" +"\n" +" operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n" +" | RShift | BitOr | BitXor | BitAnd | FloorDiv\n" +"\n" +" unaryop = Invert | Not | UAdd | USub\n" +"\n" +" cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n" +"\n" +" comprehension = (expr target, expr iter, expr* ifs, int is_async)\n" +"\n" +" excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n" +" attributes (int lineno, int col_offset, int? end_lineno, " +"int? end_col_offset)\n" +"\n" +" arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" +" expr* kw_defaults, arg? kwarg, expr* defaults)\n" +"\n" +" arg = (identifier arg, expr? annotation, string? type_comment)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- keyword arguments supplied to call (NULL identifier for **kwargs)\n" +" keyword = (identifier? arg, expr value)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" -- import name with optional 'as' alias.\n" +" alias = (identifier name, identifier? asname)\n" +" attributes (int lineno, int col_offset, int? end_lineno, int? " +"end_col_offset)\n" +"\n" +" withitem = (expr context_expr, expr? optional_vars)\n" +"\n" +" match_case = (pattern pattern, expr? guard, stmt* body)\n" +"\n" +" pattern = MatchValue(expr value)\n" +" | MatchSingleton(constant value)\n" +" | MatchSequence(pattern* patterns)\n" +" | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n" +" | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, " +"pattern* kwd_patterns)\n" +"\n" +" | MatchStar(identifier? name)\n" +" -- The optional \"rest\" MatchMapping parameter handles " +"capturing extra mapping keys\n" +"\n" +" | MatchAs(pattern? pattern, identifier? name)\n" +" | MatchOr(pattern* patterns)\n" +"\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"\n" +" type_ignore = TypeIgnore(int lineno, string tag)\n" +"\n" +" type_param = TypeVar(identifier name, expr? bound)\n" +" | ParamSpec(identifier name)\n" +" | TypeVarTuple(identifier name)\n" +" attributes (int lineno, int col_offset, int end_lineno, int " +"end_col_offset)\n" +"}\n" +msgstr "" + #: ../../library/ast.rst:42 msgid "Node classes" msgstr "Classes de nós" @@ -202,10 +371,28 @@ msgstr "" "Por exemplo, para criar e popular um nó :class:`ast.UnaryOp`, você poderia " "usar ::" +#: ../../library/ast.rst:106 +msgid "" +"node = ast.UnaryOp()\n" +"node.op = ast.USub()\n" +"node.operand = ast.Constant()\n" +"node.operand.value = 5\n" +"node.operand.lineno = 0\n" +"node.operand.col_offset = 0\n" +"node.lineno = 0\n" +"node.col_offset = 0" +msgstr "" + #: ../../library/ast.rst:115 msgid "or the more compact ::" msgstr "ou a forma mais compacta ::" +#: ../../library/ast.rst:117 +msgid "" +"node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" +" lineno=0, col_offset=0)" +msgstr "" + #: ../../library/ast.rst:122 msgid "Class :class:`ast.Constant` is now used for all constants." msgstr "A classe :class:`ast.Constant` é agora usada para todas as constantes." @@ -275,6 +462,18 @@ msgstr "" "*type_ignores* é uma :class:`list` dos comentários de ignorar tipo do " "módulo; veja :func:`ast.parse` para mais detalhes." +#: ../../library/ast.rst:165 +msgid "" +">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1))],\n" +" type_ignores=[])" +msgstr "" + #: ../../library/ast.rst:179 msgid "" "A single Python :ref:`expression input `. Node type " @@ -290,6 +489,13 @@ msgid "" msgstr "" "*body* é um nó único, um dos :ref:`tipos de expressão `." +#: ../../library/ast.rst:185 ../../library/ast.rst:255 +msgid "" +">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Constant(value=123))" +msgstr "" + #: ../../library/ast.rst:194 msgid "" "A single :ref:`interactive input `, like in :ref:`tut-interac`. " @@ -304,6 +510,21 @@ msgid "*body* is a :class:`list` of :ref:`statement nodes `." msgstr "" "*body* é uma :class:`list` de :ref:`nós de instrução `." +#: ../../library/ast.rst:199 +msgid "" +">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" +"Interactive(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1)),\n" +" Assign(\n" +" targets=[\n" +" Name(id='y', ctx=Store())],\n" +" value=Constant(value=2))])" +msgstr "" + #: ../../library/ast.rst:216 msgid "" "A representation of an old-style type comments for functions, as Python " @@ -319,6 +540,13 @@ msgstr "" msgid "Such type comments would look like this::" msgstr "Esses comentários de tipo ficariam assim::" +#: ../../library/ast.rst:222 +msgid "" +"def sum_two_number(a, b):\n" +" # type: (int, int) -> int\n" +" return a + b" +msgstr "" + #: ../../library/ast.rst:226 msgid "" "*argtypes* is a :class:`list` of :ref:`expression nodes `." @@ -329,6 +557,20 @@ msgstr "" msgid "*returns* is a single :ref:`expression node `." msgstr "*returns* é um único :ref:`nó de expressão `." +#: ../../library/ast.rst:230 +msgid "" +">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " +"indent=4))\n" +"FunctionType(\n" +" argtypes=[\n" +" Name(id='int', ctx=Load()),\n" +" Name(id='str', ctx=Load())],\n" +" returns=Subscript(\n" +" value=Name(id='List', ctx=Load()),\n" +" slice=Name(id='int', ctx=Load()),\n" +" ctx=Load()))" +msgstr "" + #: ../../library/ast.rst:246 msgid "Literals" msgstr "Literais" @@ -402,6 +644,30 @@ msgstr "" "Uma f-string, compreendendo uma série de nós :class:`FormattedValue` e :" "class:`Constant`." +#: ../../library/ast.rst:287 +msgid "" +">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=JoinedStr(\n" +" values=[\n" +" Constant(value='sin('),\n" +" FormattedValue(\n" +" value=Name(id='a', ctx=Load()),\n" +" conversion=-1),\n" +" Constant(value=') is '),\n" +" FormattedValue(\n" +" value=Call(\n" +" func=Name(id='sin', ctx=Load()),\n" +" args=[\n" +" Name(id='a', ctx=Load())],\n" +" keywords=[]),\n" +" conversion=-1,\n" +" format_spec=JoinedStr(\n" +" values=[\n" +" Constant(value='.3')]))]))" +msgstr "" + #: ../../library/ast.rst:313 msgid "" "A list or tuple. ``elts`` holds a list of nodes representing the elements. " @@ -412,12 +678,43 @@ msgstr "" "elementos. ``ctx`` é :class:`Store` se o contêiner for um alvo de atribuição " "(ou seja, ``(x,y)=algumacoisa``), e :class:`Load` caso contrário." +#: ../../library/ast.rst:317 +msgid "" +">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=List(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)],\n" +" ctx=Load()))\n" +">>> print(ast.dump(ast.parse('(1, 2, 3)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Tuple(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)],\n" +" ctx=Load()))" +msgstr "" + #: ../../library/ast.rst:339 msgid "A set. ``elts`` holds a list of nodes representing the set's elements." msgstr "" "Um conjunto. ``elts`` contém uma lista de nós que representam os elementos " "do conjunto." +#: ../../library/ast.rst:341 +msgid "" +">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Set(\n" +" elts=[\n" +" Constant(value=1),\n" +" Constant(value=2),\n" +" Constant(value=3)]))" +msgstr "" + #: ../../library/ast.rst:354 msgid "" "A dictionary. ``keys`` and ``values`` hold lists of nodes representing the " @@ -438,6 +735,19 @@ msgstr "" "ser expandida vai para a lista ``values``, com um ``None`` na posição " "correspondente em ``keys``." +#: ../../library/ast.rst:362 +msgid "" +">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Dict(\n" +" keys=[\n" +" Constant(value='a'),\n" +" None],\n" +" values=[\n" +" Constant(value=1),\n" +" Name(id='d', ctx=Load())]))" +msgstr "" + #: ../../library/ast.rst:376 msgid "Variables" msgstr "Variáveis" @@ -460,6 +770,33 @@ msgstr "" "variável, para atribuir um novo valor a ela ou para excluí-la. As " "referências de variáveis recebem um contexto para distinguir esses casos." +#: ../../library/ast.rst:392 +msgid "" +">>> print(ast.dump(ast.parse('a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Name(id='a', ctx=Load()))],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('a = 1'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store())],\n" +" value=Constant(value=1))],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('del a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='a', ctx=Del())])],\n" +" type_ignores=[])" +msgstr "" + #: ../../library/ast.rst:421 msgid "" "A ``*var`` variable reference. ``value`` holds the variable, typically a :" @@ -470,6 +807,24 @@ msgstr "" "normalmente um nó :class:`Name`. Este tipo deve ser usado ao construir um " "nó :class:`Call` com ``*args``." +#: ../../library/ast.rst:425 +msgid "" +">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Starred(\n" +" value=Name(id='b', ctx=Store()),\n" +" ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='it', ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + #: ../../library/ast.rst:446 msgid "Expressions" msgstr "Expressões" @@ -488,6 +843,18 @@ msgstr "" "um nó :class:`Constant`, um :class:`Name`, um :class:`Lambda`, um :class:" "`Yield` ou :class:`YieldFrom`." +#: ../../library/ast.rst:455 +msgid "" +">>> print(ast.dump(ast.parse('-a'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=UnaryOp(\n" +" op=USub(),\n" +" operand=Name(id='a', ctx=Load())))],\n" +" type_ignores=[])" +msgstr "" + #: ../../library/ast.rst:469 msgid "" "A unary operation. ``op`` is the operator, and ``operand`` any expression " @@ -504,6 +871,15 @@ msgstr "" "Tokens de operador unário. :class:`Not` é a palavra reservada ``not``, :" "class:`Invert` é o operador ``~``." +#: ../../library/ast.rst:481 +msgid "" +">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" +"Expression(\n" +" body=UnaryOp(\n" +" op=Not(),\n" +" operand=Name(id='x', ctx=Load())))" +msgstr "" + #: ../../library/ast.rst:492 msgid "" "A binary operation (like addition or division). ``op`` is the operator, and " @@ -512,6 +888,16 @@ msgstr "" "Uma operação binária (como adição ou divisão). ``op`` é o operador, e " "``left`` e ``right`` são quaisquer nós de expressão." +#: ../../library/ast.rst:495 +msgid "" +">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BinOp(\n" +" left=Name(id='x', ctx=Load()),\n" +" op=Add(),\n" +" right=Name(id='y', ctx=Load())))" +msgstr "" + #: ../../library/ast.rst:519 msgid "Binary operator tokens." msgstr "Tokens de operador binário." @@ -531,6 +917,17 @@ msgstr "" msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." msgstr "Isso não inclui ``not``, que é um :class:`UnaryOp`." +#: ../../library/ast.rst:531 +msgid "" +">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" +"Expression(\n" +" body=BoolOp(\n" +" op=Or(),\n" +" values=[\n" +" Name(id='x', ctx=Load()),\n" +" Name(id='y', ctx=Load())]))" +msgstr "" + #: ../../library/ast.rst:545 msgid "Boolean operator tokens." msgstr "Tokens de operador booleano." @@ -545,6 +942,20 @@ msgstr "" "comparação, ``ops`` a lista de operadores e ``comparators`` a lista de " "valores após o primeiro elemento na comparação." +#: ../../library/ast.rst:554 +msgid "" +">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Compare(\n" +" left=Constant(value=1),\n" +" ops=[\n" +" LtE(),\n" +" Lt()],\n" +" comparators=[\n" +" Name(id='a', ctx=Load()),\n" +" Constant(value=10)]))" +msgstr "" + #: ../../library/ast.rst:579 msgid "Comparison operator tokens." msgstr "Tokens de operador de comparação." @@ -577,6 +988,26 @@ msgstr "" "Ao criar um nó ``Call``, ``args`` e ``keywords`` são necessários, mas podem " "ser listas vazias." +#: ../../library/ast.rst:594 +msgid "" +">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=Call(\n" +" func=Name(id='func', ctx=Load()),\n" +" args=[\n" +" Name(id='a', ctx=Load()),\n" +" Starred(\n" +" value=Name(id='d', ctx=Load()),\n" +" ctx=Load())],\n" +" keywords=[\n" +" keyword(\n" +" arg='b',\n" +" value=Name(id='c', ctx=Load())),\n" +" keyword(\n" +" value=Name(id='e', ctx=Load()))]))" +msgstr "" + #: ../../library/ast.rst:615 msgid "" "A keyword argument to a function call or class definition. ``arg`` is a raw " @@ -594,6 +1025,16 @@ msgstr "" "Uma expressão como ``a if b else c``. Cada campo contém um único nó, " "portanto, no exemplo a seguir, todos os três são nós :class:`Name`." +#: ../../library/ast.rst:624 +msgid "" +">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" +"Expression(\n" +" body=IfExp(\n" +" test=Name(id='b', ctx=Load()),\n" +" body=Name(id='a', ctx=Load()),\n" +" orelse=Name(id='c', ctx=Load())))" +msgstr "" + #: ../../library/ast.rst:636 msgid "" "Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:" @@ -606,6 +1047,16 @@ msgstr "" "nome do atributo, e ``ctx`` é :class:`Load`, :class:`Store` ou :class:`Del` " "de acordo com como o atributo é acionado sobre." +#: ../../library/ast.rst:641 +msgid "" +">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Attribute(\n" +" value=Name(id='snake', ctx=Load()),\n" +" attr='colour',\n" +" ctx=Load()))" +msgstr "" + #: ../../library/ast.rst:653 msgid "" "A named expression. This AST node is produced by the assignment expressions " @@ -618,6 +1069,15 @@ msgstr "" "contrário do nó :class:`Assign` no qual o primeiro argumento pode ser " "múltiplos nós, neste caso ambos ``target`` e ``value`` devem ser nós únicos." +#: ../../library/ast.rst:658 +msgid "" +">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" +"Expression(\n" +" body=NamedExpr(\n" +" target=Name(id='x', ctx=Store()),\n" +" value=Constant(value=4)))" +msgstr "" + #: ../../library/ast.rst:669 msgid "Subscripting" msgstr "Subscrição" @@ -634,6 +1094,22 @@ msgstr "" "uma :class:`Tuple` e conter uma :class:`Slice`. ``ctx`` é :class:`Load`, :" "class:`Store` ou :class:`Del` de acordo com a ação realizada com o subscrito." +#: ../../library/ast.rst:679 +msgid "" +">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2)),\n" +" Constant(value=3)],\n" +" ctx=Load()),\n" +" ctx=Load()))" +msgstr "" + #: ../../library/ast.rst:697 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " @@ -644,6 +1120,18 @@ msgstr "" "Pode ocorrer apenas dentro do campo *slice* de :class:`Subscript`, " "diretamente ou como um elemento de :class:`Tuple`." +#: ../../library/ast.rst:701 +msgid "" +">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" +"Expression(\n" +" body=Subscript(\n" +" value=Name(id='l', ctx=Load()),\n" +" slice=Slice(\n" +" lower=Constant(value=1),\n" +" upper=Constant(value=2)),\n" +" ctx=Load()))" +msgstr "" + #: ../../library/ast.rst:714 msgid "Comprehensions" msgstr "Compreensões" @@ -662,6 +1150,47 @@ msgstr "" msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "``generators`` é uma lista de nós de :class:`comprehension`." +#: ../../library/ast.rst:727 +msgid "" +">>> print(ast.dump(ast.parse('[x for x in numbers]', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='x', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" ifs=[],\n" +" is_async=0)]))\n" +">>> print(ast.dump(ast.parse('{x: x**2 for x in numbers}', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=DictComp(\n" +" key=Name(id='x', ctx=Load()),\n" +" value=BinOp(\n" +" left=Name(id='x', ctx=Load()),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" ifs=[],\n" +" is_async=0)]))\n" +">>> print(ast.dump(ast.parse('{x for x in numbers}', mode='eval'), " +"indent=4))\n" +"Expression(\n" +" body=SetComp(\n" +" elt=Name(id='x', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='numbers', ctx=Load()),\n" +" ifs=[],\n" +" is_async=0)]))" +msgstr "" + #: ../../library/ast.rst:767 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " @@ -682,6 +1211,71 @@ msgstr "" "``is_async`` indica que uma compreensão é assíncrona (usando um ``async " "for`` em vez de ``for``). O valor é um número inteiro (0 ou 1)." +#: ../../library/ast.rst:775 +msgid "" +">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " +"mode='eval'),\n" +"... indent=4)) # Multiple comprehensions in one.\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Call(\n" +" func=Name(id='ord', ctx=Load()),\n" +" args=[\n" +" Name(id='c', ctx=Load())],\n" +" keywords=[]),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='line', ctx=Store()),\n" +" iter=Name(id='file', ctx=Load()),\n" +" ifs=[],\n" +" is_async=0),\n" +" comprehension(\n" +" target=Name(id='c', ctx=Store()),\n" +" iter=Name(id='line', ctx=Load()),\n" +" ifs=[],\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', " +"mode='eval'),\n" +"... indent=4)) # generator comprehension\n" +"Expression(\n" +" body=GeneratorExp(\n" +" elt=BinOp(\n" +" left=Name(id='n', ctx=Load()),\n" +" op=Pow(),\n" +" right=Constant(value=2)),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='n', ctx=Store()),\n" +" iter=Name(id='it', ctx=Load()),\n" +" ifs=[\n" +" Compare(\n" +" left=Name(id='n', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" Compare(\n" +" left=Name(id='n', ctx=Load()),\n" +" ops=[\n" +" Lt()],\n" +" comparators=[\n" +" Constant(value=10)])],\n" +" is_async=0)]))\n" +"\n" +">>> print(ast.dump(ast.parse('[i async for i in soc]', mode='eval'),\n" +"... indent=4)) # Async comprehension\n" +"Expression(\n" +" body=ListComp(\n" +" elt=Name(id='i', ctx=Load()),\n" +" generators=[\n" +" comprehension(\n" +" target=Name(id='i', ctx=Store()),\n" +" iter=Name(id='soc', ctx=Load()),\n" +" ifs=[],\n" +" is_async=1)]))" +msgstr "" + #: ../../library/ast.rst:841 msgid "Statements" msgstr "Instruções" @@ -703,31 +1297,115 @@ msgstr "" "O desempacotamento é representada colocando uma :class:`Tuple` ou :class:" "`List` dentro de ``targets``." -#: ../../library/ast.rst:853 ../../library/ast.rst:1161 -#: ../../library/ast.rst:1366 ../../library/ast.rst:1891 +#: ../../library/ast.rst:853 ../../library/ast.rst:1165 +#: ../../library/ast.rst:1370 ../../library/ast.rst:1895 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" "``type_comment`` é uma string opcional com a anotação de tipo como " "comentário." +#: ../../library/ast.rst:855 +msgid "" +">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" value=Constant(value=1))],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Tuple(\n" +" elts=[\n" +" Name(id='a', ctx=Store()),\n" +" Name(id='b', ctx=Store())],\n" +" ctx=Store())],\n" +" value=Name(id='c', ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + #: ../../library/ast.rst:883 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " -"a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`. " +"a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. " "``annotation`` is the annotation, such as a :class:`Constant` or :class:" -"`Name` node. ``value`` is a single optional node. ``simple`` is a boolean " -"integer set to True for a :class:`Name` node in ``target`` that do not " -"appear in between parenthesis and are hence pure names and not expressions." +"`Name` node. ``value`` is a single optional node." msgstr "" "Uma atribuição com uma anotação de tipo. ``target`` é um nó único e pode ser " -"um :class:`Name`, um :class:`Attribute` ou um :class:`Subscript`. " -"``annotation`` é a anotação, como um nó de :class:`Constant` ou :class:" -"`Name`. ``value`` é um único nó opcional. ``simple`` é um inteiro booleano " -"definido como True para um nó :class:`Name` em ``target`` que não aparece " -"entre parênteses e são, portanto, nomes puros e não expressões." - -#: ../../library/ast.rst:938 +"uma classe :class:`Name`, :class:`Attribute` ou :class:`Subscript`. " +"``annotation`` é a anotação, como um nó :class:`Constant` ou :class:`Name`. " +"``value`` é um único nó opcional." + +#: ../../library/ast.rst:888 +msgid "" +"``simple`` is always either 0 (indicating a \"complex\" target) or 1 " +"(indicating a \"simple\" target). A \"simple\" target consists solely of a :" +"class:`Name` node that does not appear between parentheses; all other " +"targets are considered complex. Only simple targets appear in the :attr:" +"`__annotations__` dictionary of modules and classes." +msgstr "" +"``simple`` é sempre 0 (indicando um alvo \"complexo\") ou 1 (indicando um " +"alvo \"simples\"). Um alvo \"simples\" consiste apenas em um nó :class:" +"`Name` que não aparece entre parênteses; todos os outros alvos são " +"considerados complexos. Apenas alvos simples aparecem no dicionário :attr:" +"`__annotations__` de módulos e classes." + +#: ../../library/ast.rst:894 +msgid "" +">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='c', ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=1)],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with " +"parenthesis\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='a', ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" value=Constant(value=1),\n" +" simple=0)],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Attribute(\n" +" value=Name(id='a', ctx=Load()),\n" +" attr='b',\n" +" ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=0)],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript " +"annotation\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Subscript(\n" +" value=Name(id='a', ctx=Load()),\n" +" slice=Constant(value=1),\n" +" ctx=Store()),\n" +" annotation=Name(id='int', ctx=Load()),\n" +" simple=0)],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:942 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -738,7 +1416,7 @@ msgstr "" "nó :class:`Name` para ``x`` (com o contexto :class:`Store`), ``op`` é :class:" "`Add`, e ``value`` é uma :class:`Constant` com valor para 1." -#: ../../library/ast.rst:943 +#: ../../library/ast.rst:947 msgid "" "The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." @@ -746,7 +1424,19 @@ msgstr "" "O atributo ``target`` não pode ser da classe :class:`Tuple` ou :class:" "`List`, diferentemente dos alvos de :class:`Assign`." -#: ../../library/ast.rst:960 +#: ../../library/ast.rst:950 +msgid "" +">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" +"Module(\n" +" body=[\n" +" AugAssign(\n" +" target=Name(id='x', ctx=Store()),\n" +" op=Add(),\n" +" value=Constant(value=2))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:964 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " @@ -757,7 +1447,18 @@ msgstr "" "``raise`` independente. ``cause`` é a parte opcional para ``y`` em ``raise x " "from y``." -#: ../../library/ast.rst:977 +#: ../../library/ast.rst:968 +msgid "" +">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Raise(\n" +" exc=Name(id='x', ctx=Load()),\n" +" cause=Name(id='y', ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:981 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." @@ -765,7 +1466,18 @@ msgstr "" "Uma asserção. ``test`` contém a condição, como um nó :class:`Compare`. " "``msg`` contém a mensagem de falha." -#: ../../library/ast.rst:993 +#: ../../library/ast.rst:984 +msgid "" +">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" +"Module(\n" +" body=[\n" +" Assert(\n" +" test=Name(id='x', ctx=Load()),\n" +" msg=Name(id='y', ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:997 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." @@ -773,11 +1485,33 @@ msgstr "" "Representa uma instrução ``del``. ``targets`` é uma lista de nós, como nós :" "class:`Name`, :class:`Attribute` ou :class:`Subscript`." -#: ../../library/ast.rst:1011 +#: ../../library/ast.rst:1000 +msgid "" +">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Delete(\n" +" targets=[\n" +" Name(id='x', ctx=Del()),\n" +" Name(id='y', ctx=Del()),\n" +" Name(id='z', ctx=Del())])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1015 msgid "A ``pass`` statement." msgstr "Uma instrução ``pass``." -#: ../../library/ast.rst:1024 +#: ../../library/ast.rst:1017 +msgid "" +">>> print(ast.dump(ast.parse('pass'), indent=4))\n" +"Module(\n" +" body=[\n" +" Pass()],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1028 msgid "" "A :ref:`type alias ` created through the :keyword:`type` " "statement. ``name`` is the name of the alias, ``type_params`` is a list of :" @@ -789,7 +1523,19 @@ msgstr "" "de :ref:`parâmetros de tipo `, e ``value`` é o valor do " "apelido do tipo." -#: ../../library/ast.rst:1042 +#: ../../library/ast.rst:1033 +msgid "" +">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[],\n" +" value=Name(id='int', ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1046 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." @@ -797,16 +1543,29 @@ msgstr "" "Outras instruções que são aplicáveis apenas dentro de funções ou laços são " "descritas em outras seções." -#: ../../library/ast.rst:1046 +#: ../../library/ast.rst:1050 msgid "Imports" msgstr "Importações" -#: ../../library/ast.rst:1050 +#: ../../library/ast.rst:1054 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" "Uma instrução de importação. ``names`` é uma lista de nós de :class:`alias`." -#: ../../library/ast.rst:1067 +#: ../../library/ast.rst:1056 +msgid "" +">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Import(\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1071 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -818,7 +1577,22 @@ msgstr "" "``from . import foo``. ``level`` é um número inteiro que contém o nível da " "importação relativa (0 significa importação absoluta)." -#: ../../library/ast.rst:1089 +#: ../../library/ast.rst:1076 +msgid "" +">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='y',\n" +" names=[\n" +" alias(name='x'),\n" +" alias(name='y'),\n" +" alias(name='z')],\n" +" level=0)],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1093 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." @@ -826,11 +1600,25 @@ msgstr "" "Ambos os parâmetros são strings brutas dos nomes. ``asname`` pode ser " "``None`` se o nome normal for usado." -#: ../../library/ast.rst:1106 +#: ../../library/ast.rst:1096 +msgid "" +">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" +"Module(\n" +" body=[\n" +" ImportFrom(\n" +" module='foo.bar',\n" +" names=[\n" +" alias(name='a', asname='b'),\n" +" alias(name='c')],\n" +" level=2)],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1110 msgid "Control flow" msgstr "Fluxo de controle" -#: ../../library/ast.rst:1109 +#: ../../library/ast.rst:1113 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." @@ -838,7 +1626,7 @@ msgstr "" "Cláusulas opcionais como ``else`` são armazenadas como uma lista vazia se " "não estiverem presentes." -#: ../../library/ast.rst:1114 +#: ../../library/ast.rst:1118 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." @@ -846,7 +1634,7 @@ msgstr "" "Uma instrução ``if``. ``test`` contém um único nó, como um nó :class:" "`Compare`. ``body`` e ``orelse`` contêm, cada um, uma lista de nós." -#: ../../library/ast.rst:1117 +#: ../../library/ast.rst:1121 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " @@ -856,7 +1644,36 @@ msgstr "" "aparecem como nós extras de :class:`If` dentro da seção ``orelse`` da " "cláusula anterior." -#: ../../library/ast.rst:1152 +#: ../../library/ast.rst:1125 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... if x:\n" +"... ...\n" +"... elif y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" If(\n" +" test=Name(id='x', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" If(\n" +" test=Name(id='y', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1156 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" @@ -872,7 +1689,29 @@ msgstr "" "executar. Aqueles em ``orelse`` são executados se o laço terminar " "normalmente, ao invés de através de uma instrução ``break``." -#: ../../library/ast.rst:1187 +#: ../../library/ast.rst:1167 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... for x in y:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='x', ctx=Store()),\n" +" iter=Name(id='y', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1191 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." @@ -880,11 +1719,63 @@ msgstr "" "Um laço ``while``. ``test`` contém a condição, como um nó de :class:" "`Compare`." -#: ../../library/ast.rst:1214 +#: ../../library/ast.rst:1194 +msgid "" +">> print(ast.dump(ast.parse(\"\"\"\n" +"... while x:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" While(\n" +" test=Name(id='x', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1218 msgid "The ``break`` and ``continue`` statements." msgstr "As instruções ``break`` e ``continue``." -#: ../../library/ast.rst:1249 +#: ../../library/ast.rst:1220 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... for a in b:\n" +"... if a > 5:\n" +"... break\n" +"... else:\n" +"... continue\n" +"...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" For(\n" +" target=Name(id='a', ctx=Store()),\n" +" iter=Name(id='b', ctx=Load()),\n" +" body=[\n" +" If(\n" +" test=Compare(\n" +" left=Name(id='a', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=5)]),\n" +" body=[\n" +" Break()],\n" +" orelse=[\n" +" Continue()])],\n" +" orelse=[])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1253 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." @@ -892,7 +1783,48 @@ msgstr "" "Blocos ``try``. Todos os atributos são uma lista de nós a serem executados, " "exceto ``handlers``, que é uma lista de nós de :class:`ExceptHandler`." -#: ../../library/ast.rst:1295 +#: ../../library/ast.rst:1256 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except Exception:\n" +"... ...\n" +"... except OtherException as e:\n" +"... ...\n" +"... else:\n" +"... ...\n" +"... finally:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" ExceptHandler(\n" +" type=Name(id='OtherException', ctx=Load()),\n" +" name='e',\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" orelse=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" finalbody=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1299 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " @@ -902,7 +1834,32 @@ msgstr "" "os mesmos de :class:`Try`, mas os nós :class:`ExceptHandler` em ``handlers`` " "são interpretados como blocos ``except*`` em vez de ``except``." -#: ../../library/ast.rst:1327 +#: ../../library/ast.rst:1303 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... try:\n" +"... ...\n" +"... except* Exception:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TryStar(\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='Exception', ctx=Load()),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])],\n" +" orelse=[],\n" +" finalbody=[])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1331 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -915,7 +1872,34 @@ msgstr "" "conter a exceção, ou ``None`` se a cláusula não tiver ``as foo``. ``body`` é " "uma lista de nós." -#: ../../library/ast.rst:1361 +#: ../../library/ast.rst:1336 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... try:\n" +"... a + 1\n" +"... except TypeError:\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Try(\n" +" body=[\n" +" Expr(\n" +" value=BinOp(\n" +" left=Name(id='a', ctx=Load()),\n" +" op=Add(),\n" +" right=Constant(value=1)))],\n" +" handlers=[\n" +" ExceptHandler(\n" +" type=Name(id='TypeError', ctx=Load()),\n" +" body=[\n" +" Pass()])],\n" +" orelse=[],\n" +" finalbody=[])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1365 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " @@ -925,7 +1909,7 @@ msgstr "" "representando os gerenciadores de contexto, e ``body`` é o bloco indentado " "dentro do contexto." -#: ../../library/ast.rst:1371 +#: ../../library/ast.rst:1375 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -937,11 +1921,38 @@ msgstr "" "``optional_vars`` é um :class:`Name`, :class:`Tuple` ou :class:`List` para a " "parte ``as foo``, ou ``None`` se não for usado." -#: ../../library/ast.rst:1404 +#: ../../library/ast.rst:1380 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... with a as b, c as d:\n" +"... something(b, d)\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" With(\n" +" items=[\n" +" withitem(\n" +" context_expr=Name(id='a', ctx=Load()),\n" +" optional_vars=Name(id='b', ctx=Store())),\n" +" withitem(\n" +" context_expr=Name(id='c', ctx=Load()),\n" +" optional_vars=Name(id='d', ctx=Store()))],\n" +" body=[\n" +" Expr(\n" +" value=Call(\n" +" func=Name(id='something', ctx=Load()),\n" +" args=[\n" +" Name(id='b', ctx=Load()),\n" +" Name(id='d', ctx=Load())],\n" +" keywords=[]))])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1408 msgid "Pattern matching" msgstr "Correspondência de padrões" -#: ../../library/ast.rst:1409 +#: ../../library/ast.rst:1413 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " @@ -951,7 +1962,7 @@ msgstr "" "objeto que está sendo comparado com os casos) e ``cases`` contém um iterável " "de nós de :class:`match_case` com os diferentes casos." -#: ../../library/ast.rst:1417 +#: ../../library/ast.rst:1421 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" @@ -963,7 +1974,7 @@ msgstr "" "os nós :class:`AST` produzidos para padrões diferem daqueles produzidos para " "expressões, mesmo quando compartilham a mesma sintaxe." -#: ../../library/ast.rst:1422 +#: ../../library/ast.rst:1426 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." @@ -971,7 +1982,7 @@ msgstr "" "O atributo ``guard`` contém uma expressão que será avaliada se o padrão " "corresponder ao assunto." -#: ../../library/ast.rst:1425 +#: ../../library/ast.rst:1429 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." @@ -979,7 +1990,46 @@ msgstr "" "``body`` contém uma lista de nós a serem executados se o padrão corresponder " "e o resultado da avaliação da expressão de guarda for verdadeiro." -#: ../../library/ast.rst:1470 +#: ../../library/ast.rst:1432 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] if x>0:\n" +"... ...\n" +"... case tuple():\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" guard=Compare(\n" +" left=Name(id='x', ctx=Load()),\n" +" ops=[\n" +" Gt()],\n" +" comparators=[\n" +" Constant(value=0)]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='tuple', ctx=Load()),\n" +" patterns=[],\n" +" kwd_attrs=[],\n" +" kwd_patterns=[]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1474 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " @@ -992,7 +2042,28 @@ msgstr "" "Este padrão será bem-sucedido se o assunto da correspondência for igual ao " "valor avaliado." -#: ../../library/ast.rst:1499 +#: ../../library/ast.rst:1479 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case \"Relevant\":\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchValue(\n" +" value=Constant(value='Relevant')),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1503 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " @@ -1003,7 +2074,27 @@ msgstr "" "padrão será bem-sucedido se o assunto da correspondência for a constante " "fornecida." -#: ../../library/ast.rst:1526 +#: ../../library/ast.rst:1507 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case None:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSingleton(value=None),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1530 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " @@ -1016,7 +2107,32 @@ msgstr "" "um nó ``MatchStar``, caso contrário corresponde a uma sequência de " "comprimento fixo." -#: ../../library/ast.rst:1559 +#: ../../library/ast.rst:1535 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [1, 2]:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1563 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " @@ -1028,7 +2144,42 @@ msgstr "" "lista contendo os elementos restantes da sequência será vinculada a esse " "nome se o padrão de sequência geral for bem-sucedido." -#: ../../library/ast.rst:1601 +#: ../../library/ast.rst:1567 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [1, 2, *rest]:\n" +"... ...\n" +"... case [*_]:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=1)),\n" +" MatchValue(\n" +" value=Constant(value=2)),\n" +" MatchStar(name='rest')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchStar()]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1605 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -1042,7 +2193,7 @@ msgstr "" "elementos restantes do mapeamento. As expressões-chave permitidas são " "restritas conforme descrito na documentação da instrução match." -#: ../../library/ast.rst:1607 +#: ../../library/ast.rst:1611 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -1057,7 +2208,41 @@ msgstr "" "restantes será vinculado a esse nome se o padrão de mapeamento geral for bem-" "sucedido." -#: ../../library/ast.rst:1649 +#: ../../library/ast.rst:1617 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case {1: _, 2: _}:\n" +"... ...\n" +"... case {**rest}:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchMapping(\n" +" keys=[\n" +" Constant(value=1),\n" +" Constant(value=2)],\n" +" patterns=[\n" +" MatchAs(),\n" +" MatchAs()]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchMapping(keys=[], patterns=[], " +"rest='rest'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1653 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -1075,7 +2260,7 @@ msgstr "" "padrão de classe), ``kwd_patterns`` são os padrões correspondentes " "(especificados como valores de argumentos nomeados no padrão de classe)." -#: ../../library/ast.rst:1656 +#: ../../library/ast.rst:1660 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " @@ -1087,7 +2272,7 @@ msgstr "" "argumentos nomeados, especificados corresponderem ao seu padrão " "correspondente." -#: ../../library/ast.rst:1660 +#: ../../library/ast.rst:1664 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " @@ -1098,7 +2283,55 @@ msgstr "" "tipos internos também são combinados dessa forma, conforme descrito na " "documentação da instrução match." -#: ../../library/ast.rst:1715 +#: ../../library/ast.rst:1668 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case Point2D(0, 0):\n" +"... ...\n" +"... case Point3D(x=0, y=0, z=0):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point2D', ctx=Load()),\n" +" patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))],\n" +" kwd_attrs=[],\n" +" kwd_patterns=[]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchClass(\n" +" cls=Name(id='Point3D', ctx=Load()),\n" +" patterns=[],\n" +" kwd_attrs=[\n" +" 'x',\n" +" 'y',\n" +" 'z'],\n" +" kwd_patterns=[\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0)),\n" +" MatchValue(\n" +" value=Constant(value=0))]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1719 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " @@ -1110,7 +2343,7 @@ msgstr "" "comparado. Se o padrão for ``None``, o nó representa um padrão de captura " "(ou seja, um nome simples) e sempre terá sucesso." -#: ../../library/ast.rst:1720 +#: ../../library/ast.rst:1724 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " @@ -1120,7 +2353,38 @@ msgstr "" "sucedido. Se ``name`` for ``None``, ``pattern`` também deverá ser ``None`` e " "o nó representa o padrão curinga." -#: ../../library/ast.rst:1758 +#: ../../library/ast.rst:1728 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] as y:\n" +"... ...\n" +"... case _:\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchAs(\n" +" pattern=MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" name='y'),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))]),\n" +" match_case(\n" +" pattern=MatchAs(),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1762 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -1134,11 +2398,36 @@ msgstr "" "sucedido, o padrão or falhará. O atributo ``patterns`` contém uma lista de " "nós de padrões de correspondência que serão comparados com o assunto." -#: ../../library/ast.rst:1793 +#: ../../library/ast.rst:1768 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\n" +"... match x:\n" +"... case [x] | (y):\n" +"... ...\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" Match(\n" +" subject=Name(id='x', ctx=Load()),\n" +" cases=[\n" +" match_case(\n" +" pattern=MatchOr(\n" +" patterns=[\n" +" MatchSequence(\n" +" patterns=[\n" +" MatchAs(name='x')]),\n" +" MatchAs(name='y')]),\n" +" body=[\n" +" Expr(\n" +" value=Constant(value=Ellipsis))])])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1797 msgid "Type parameters" msgstr "Parâmetros de tipo" -#: ../../library/ast.rst:1795 +#: ../../library/ast.rst:1799 msgid "" ":ref:`Type parameters ` can exist on classes, functions, and " "type aliases." @@ -1146,46 +2435,106 @@ msgstr "" ":ref:`Parâmetros de tipo ` podem existir em classes, funções e " "apelidos de tipo." -#: ../../library/ast.rst:1800 +#: ../../library/ast.rst:1804 msgid "" "A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " "``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" "`Tuple`, it represents constraints; otherwise it represents the bound." msgstr "" -#: ../../library/ast.rst:1825 +#: ../../library/ast.rst:1808 +msgid "" +">>> print(ast.dump(ast.parse(\"type Alias[T: int] = list[T]\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVar(\n" +" name='T',\n" +" bound=Name(id='int', ctx=Load()))],\n" +" value=Subscript(\n" +" value=Name(id='list', ctx=Load()),\n" +" slice=Name(id='T', ctx=Load()),\n" +" ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1829 msgid "" "A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " "specification." msgstr "" -#: ../../library/ast.rst:1850 +#: ../../library/ast.rst:1831 +msgid "" +">>> print(ast.dump(ast.parse(\"type Alias[**P] = Callable[P, int]\"), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" ParamSpec(name='P')],\n" +" value=Subscript(\n" +" value=Name(id='Callable', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Name(id='P', ctx=Load()),\n" +" Name(id='int', ctx=Load())],\n" +" ctx=Load()),\n" +" ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1854 msgid "" "A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " "tuple." msgstr "" -#: ../../library/ast.rst:1875 +#: ../../library/ast.rst:1856 +msgid "" +">>> print(ast.dump(ast.parse(\"type Alias[*Ts] = tuple[*Ts]\"), indent=4))\n" +"Module(\n" +" body=[\n" +" TypeAlias(\n" +" name=Name(id='Alias', ctx=Store()),\n" +" type_params=[\n" +" TypeVarTuple(name='Ts')],\n" +" value=Subscript(\n" +" value=Name(id='tuple', ctx=Load()),\n" +" slice=Tuple(\n" +" elts=[\n" +" Starred(\n" +" value=Name(id='Ts', ctx=Load()),\n" +" ctx=Load())],\n" +" ctx=Load()),\n" +" ctx=Load()))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1879 msgid "Function and class definitions" msgstr "Definições de função e classe" -#: ../../library/ast.rst:1879 +#: ../../library/ast.rst:1883 msgid "A function definition." msgstr "Uma definição de função" -#: ../../library/ast.rst:1881 +#: ../../library/ast.rst:1885 msgid "``name`` is a raw string of the function name." msgstr "``name`` é uma string bruta do nome da função." -#: ../../library/ast.rst:1882 +#: ../../library/ast.rst:1886 msgid "``args`` is an :class:`arguments` node." msgstr "``args`` é um nó :class:`arguments`." -#: ../../library/ast.rst:1883 +#: ../../library/ast.rst:1887 msgid "``body`` is the list of nodes inside the function." msgstr "``body`` é a lista de nós dentro da função." -#: ../../library/ast.rst:1884 +#: ../../library/ast.rst:1888 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." @@ -1194,21 +2543,21 @@ msgstr "" "primeiro na parte externa (ou seja, o primeiro da lista será aplicado por " "último)." -#: ../../library/ast.rst:1886 +#: ../../library/ast.rst:1890 msgid "``returns`` is the return annotation." msgstr "``returns`` é a anotação de retorno." -#: ../../library/ast.rst:1887 ../../library/ast.rst:2064 +#: ../../library/ast.rst:1891 ../../library/ast.rst:2068 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "" "``type_params`` é uma lista de :ref:`parâmetros de tipo `." -#: ../../library/ast.rst:1893 ../../library/ast.rst:2093 -#: ../../library/ast.rst:2104 +#: ../../library/ast.rst:1897 ../../library/ast.rst:2097 +#: ../../library/ast.rst:2108 msgid "Added ``type_params``." msgstr "Adicionado ``type_params``." -#: ../../library/ast.rst:1899 +#: ../../library/ast.rst:1903 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." @@ -1216,17 +2565,36 @@ msgstr "" "``lambda`` é uma definição mínima de função que pode ser usada dentro de uma " "expressão. Ao contrário de :class:`FunctionDef`, ``body`` contém um único nó." -#: ../../library/ast.rst:1923 +#: ../../library/ast.rst:1906 +msgid "" +">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Lambda(\n" +" args=arguments(\n" +" posonlyargs=[],\n" +" args=[\n" +" arg(arg='x'),\n" +" arg(arg='y')],\n" +" kwonlyargs=[],\n" +" kw_defaults=[],\n" +" defaults=[]),\n" +" body=Constant(value=Ellipsis)))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1927 msgid "The arguments for a function." msgstr "Os argumentos para uma função." -#: ../../library/ast.rst:1925 +#: ../../library/ast.rst:1929 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" "``posonlyargs``, ``args`` e ``kwonlyargs`` são listas de nós :class:`arg`." -#: ../../library/ast.rst:1926 +#: ../../library/ast.rst:1930 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." @@ -1234,7 +2602,7 @@ msgstr "" "``vararg`` e ``kwarg`` são nós :class:`arg` únicos, referindo-se aos " "parâmetros ``*args, **kwargs``." -#: ../../library/ast.rst:1928 +#: ../../library/ast.rst:1932 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." @@ -1242,7 +2610,7 @@ msgstr "" "``kw_defaults`` é uma lista de valores padrão para argumentos somente-" "nomeados. Se um for ``None``, o argumento correspondente é necessário." -#: ../../library/ast.rst:1930 +#: ../../library/ast.rst:1934 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " @@ -1252,7 +2620,7 @@ msgstr "" "passados ​​posicionalmente. Se houver menos padrões, eles corresponderão aos " "últimos n argumentos." -#: ../../library/ast.rst:1937 +#: ../../library/ast.rst:1941 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name; " "``annotation`` is its annotation, such as a :class:`Name` node." @@ -1260,44 +2628,141 @@ msgstr "" "Um único argumento em uma lista. ``arg`` é uma string bruta do nome do " "argumento; ``annotation`` é sua anotação, como um nó :class:`Name`." -#: ../../library/ast.rst:1942 +#: ../../library/ast.rst:1946 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" "``type_comment`` é uma string opcional com a anotação de tipo como comentário" -#: ../../library/ast.rst:1987 +#: ../../library/ast.rst:1948 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... def f(a: 'annotation', b=1, c=2, *d, e, f=3, **g) -> 'return " +"annotation':\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" FunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" posonlyargs=[],\n" +" args=[\n" +" arg(\n" +" arg='a',\n" +" annotation=Constant(value='annotation')),\n" +" arg(arg='b'),\n" +" arg(arg='c')],\n" +" vararg=arg(arg='d'),\n" +" kwonlyargs=[\n" +" arg(arg='e'),\n" +" arg(arg='f')],\n" +" kw_defaults=[\n" +" None,\n" +" Constant(value=3)],\n" +" kwarg=arg(arg='g'),\n" +" defaults=[\n" +" Constant(value=1),\n" +" Constant(value=2)]),\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1', ctx=Load()),\n" +" Name(id='decorator2', ctx=Load())],\n" +" returns=Constant(value='return annotation'),\n" +" type_params=[])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:1991 msgid "A ``return`` statement." msgstr "Uma instrução ``return``." -#: ../../library/ast.rst:2002 +#: ../../library/ast.rst:1993 +msgid "" +">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" +"Module(\n" +" body=[\n" +" Return(\n" +" value=Constant(value=4))],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:2006 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " -"they must be wrapped in a :class:`Expr` node if the value sent back is not " +"they must be wrapped in an :class:`Expr` node if the value sent back is not " "used." msgstr "" +"Uma expressão ``yield`` ou ``yield from``. Por serem expressões, elas devem " +"ser agrupadas em um nó :class:`Expr` se o valor enviado de volta não for " +"usado." + +#: ../../library/ast.rst:2009 +msgid "" +">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=Yield(\n" +" value=Name(id='x', ctx=Load())))],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('yield from x'), indent=4))\n" +"Module(\n" +" body=[\n" +" Expr(\n" +" value=YieldFrom(\n" +" value=Name(id='x', ctx=Load())))],\n" +" type_ignores=[])" +msgstr "" -#: ../../library/ast.rst:2027 +#: ../../library/ast.rst:2031 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" "Instruções ``global`` e ``nonlocal``. ``names`` é uma lista de strings " "brutas." -#: ../../library/ast.rst:2054 +#: ../../library/ast.rst:2033 +msgid "" +">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Global(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])],\n" +" type_ignores=[])\n" +"\n" +">>> print(ast.dump(ast.parse('nonlocal x,y,z'), indent=4))\n" +"Module(\n" +" body=[\n" +" Nonlocal(\n" +" names=[\n" +" 'x',\n" +" 'y',\n" +" 'z'])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:2058 msgid "A class definition." msgstr "Uma definição de classe" -#: ../../library/ast.rst:2056 +#: ../../library/ast.rst:2060 msgid "``name`` is a raw string for the class name" msgstr "``name`` é uma string bruta para o nome da classe" -#: ../../library/ast.rst:2057 +#: ../../library/ast.rst:2061 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" "``bases`` é uma lista de nós para classes base especificadas explicitamente." -#: ../../library/ast.rst:2058 +#: ../../library/ast.rst:2062 msgid "" "``keywords`` is a list of :class:`.keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " @@ -1307,7 +2772,7 @@ msgstr "" "'metaclass'. Outras argumentos nomeados serão passadas para a metaclasse, " "conforme `PEP-3115 `_." -#: ../../library/ast.rst:2061 +#: ../../library/ast.rst:2065 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." @@ -1315,15 +2780,43 @@ msgstr "" "``body`` é uma lista de nós que representam o código dentro da definição de " "classe." -#: ../../library/ast.rst:2063 +#: ../../library/ast.rst:2067 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "``decorator_list`` é uma lista de nós, como em :class:`FunctionDef`." -#: ../../library/ast.rst:2097 +#: ../../library/ast.rst:2070 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... @decorator1\n" +"... @decorator2\n" +"... class Foo(base1, base2, metaclass=meta):\n" +"... pass\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" ClassDef(\n" +" name='Foo',\n" +" bases=[\n" +" Name(id='base1', ctx=Load()),\n" +" Name(id='base2', ctx=Load())],\n" +" keywords=[\n" +" keyword(\n" +" arg='metaclass',\n" +" value=Name(id='meta', ctx=Load()))],\n" +" body=[\n" +" Pass()],\n" +" decorator_list=[\n" +" Name(id='decorator1', ctx=Load()),\n" +" Name(id='decorator2', ctx=Load())],\n" +" type_params=[])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:2101 msgid "Async and await" msgstr "Async e await" -#: ../../library/ast.rst:2101 +#: ../../library/ast.rst:2105 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." @@ -1331,7 +2824,7 @@ msgstr "" "Uma definição de função ``async def``. Possui os mesmos campos que :class:" "`FunctionDef`." -#: ../../library/ast.rst:2110 +#: ../../library/ast.rst:2114 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." @@ -1339,7 +2832,35 @@ msgstr "" "Uma expressão ``await``. ``value`` é o que ela espera. Válido apenas no " "corpo de um :class:`AsyncFunctionDef`." -#: ../../library/ast.rst:2144 +#: ../../library/ast.rst:2117 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... async def f():\n" +"... await other_func()\n" +"... \"\"\"), indent=4))\n" +"Module(\n" +" body=[\n" +" AsyncFunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" posonlyargs=[],\n" +" args=[],\n" +" kwonlyargs=[],\n" +" kw_defaults=[],\n" +" defaults=[]),\n" +" body=[\n" +" Expr(\n" +" value=Await(\n" +" value=Call(\n" +" func=Name(id='other_func', ctx=Load()),\n" +" args=[],\n" +" keywords=[])))],\n" +" decorator_list=[],\n" +" type_params=[])],\n" +" type_ignores=[])" +msgstr "" + +#: ../../library/ast.rst:2148 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " @@ -1349,7 +2870,7 @@ msgstr "" "mesmos campos que :class:`For` e :class:`With`, respectivamente. Válido " "apenas no corpo de :class:`AsyncFunctionDef`." -#: ../../library/ast.rst:2149 +#: ../../library/ast.rst:2153 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -1363,11 +2884,11 @@ msgstr "" "serão singletons. As alterações em um serão refletidas em todas as outras " "ocorrências do mesmo valor (por exemplo, :class:`ast.Add`)." -#: ../../library/ast.rst:2157 +#: ../../library/ast.rst:2161 msgid ":mod:`ast` Helpers" msgstr "Auxiliares de :mod:`ast`" -#: ../../library/ast.rst:2159 +#: ../../library/ast.rst:2163 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" @@ -1375,7 +2896,7 @@ msgstr "" "Além das classes de nós, o módulo :mod:`ast` define essas funções e classes " "utilitárias para percorrer árvores de sintaxe abstrata:" -#: ../../library/ast.rst:2164 +#: ../../library/ast.rst:2168 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." @@ -1383,30 +2904,20 @@ msgstr "" "Analisa a fonte em um nó AST. Equivalente a ``compile(source, filename, " "mode, ast.PyCF_ONLY_AST)``." -#: ../../library/ast.rst:2167 +#: ../../library/ast.rst:2171 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " "equivalent to adding :data:`ast.PyCF_TYPE_COMMENTS` to the flags passed to :" -"func:`compile()`. This will report syntax errors for misplaced type " +"func:`compile`. This will report syntax errors for misplaced type " "comments. Without this flag, type comments will be ignored, and the " "``type_comment`` field on selected AST nodes will always be ``None``. In " "addition, the locations of ``# type: ignore`` comments will be returned as " "the ``type_ignores`` attribute of :class:`Module` (otherwise it is always an " "empty list)." msgstr "" -"Se ``type_comments=True`` é fornecido, o analisador é modificado para " -"verificar e retornar comentários do tipo, conforme especificado por :pep:" -"`484` e :pep:`526`. Isso é equivalente a adicionar :data:`ast." -"PyCF_TYPE_COMMENTS` aos sinalizadores passados para :func:`compile()`. Isso " -"relatará erros de sintaxe para comentários do tipo extraviado. Sem esse " -"sinalizador, os comentários do tipo serão ignorados e o campo " -"``type_comment`` nos nós AST selecionados sempre será ``None``. Além disso, " -"os locais dos comentários ``# type: ignore`` serão retornados como o " -"atributo ``type_ignores`` de :class:`Module` (caso contrário, é sempre uma " -"lista vazia)." -#: ../../library/ast.rst:2177 +#: ../../library/ast.rst:2181 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " @@ -1416,7 +2927,7 @@ msgstr "" "modificada para corresponder a \"comentários de tipo de assinatura\" de :pep:" "`484`, por exemplo, ``(str, int) -> List[str]``." -#: ../../library/ast.rst:2181 +#: ../../library/ast.rst:2185 msgid "" "Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a " "\"best-effort\" attempt to parse using that Python version's grammar. For " @@ -1429,13 +2940,13 @@ msgid "" "``feature_version``." msgstr "" -#: ../../library/ast.rst:2191 +#: ../../library/ast.rst:2195 msgid "" "If source contains a null character (``\\0``), :exc:`ValueError` is raised." msgstr "" "Se a fonte contém um caractere nulo (``\\0``), :exc:`ValueError` é levantada." -#: ../../library/ast.rst:2194 +#: ../../library/ast.rst:2198 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -1451,7 +2962,7 @@ msgstr "" "uma instrução return, mas não pode ser compilado sozinho (precisa estar " "dentro de um nó de função)." -#: ../../library/ast.rst:2201 +#: ../../library/ast.rst:2205 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." @@ -1459,7 +2970,7 @@ msgstr "" "Em particular, :func:`ast.parse` não fará nenhuma verificação de escopo, o " "que a etapa de compilação faz." -#: ../../library/ast.rst:2205 +#: ../../library/ast.rst:2209 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." @@ -1468,12 +2979,12 @@ msgstr "" "grande/complexa devido às limitações de profundidade da pilha no compilador " "de AST do Python." -#: ../../library/ast.rst:2209 +#: ../../library/ast.rst:2213 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" "Adicionado ``type_comments``, ``mode='func_type'`` e ``feature_version``." -#: ../../library/ast.rst:2215 +#: ../../library/ast.rst:2219 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" @@ -1483,7 +2994,7 @@ msgstr "" "que produziria um objeto :class:`ast.AST` equivalente se analisado novamente " "com :func:`ast.parse`." -#: ../../library/ast.rst:2220 +#: ../../library/ast.rst:2224 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " @@ -1493,7 +3004,7 @@ msgstr "" "original que gerou o objeto :class:`ast.AST` (sem quaisquer otimizações do " "compilador, como tuplas/frozensets constantes)." -#: ../../library/ast.rst:2225 +#: ../../library/ast.rst:2229 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." @@ -1501,7 +3012,7 @@ msgstr "" "Tentar desfazer análise de uma expressão altamente complexa resultaria em :" "exc:`RecursionError`." -#: ../../library/ast.rst:2233 +#: ../../library/ast.rst:2237 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1513,7 +3024,7 @@ msgstr "" "nas seguintes estruturas literais Python: strings, bytes, números, tuplas, " "listas, dicionários, conjuntos, booleanos, ``None`` e ``Ellipsis``." -#: ../../library/ast.rst:2238 +#: ../../library/ast.rst:2242 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " @@ -1524,7 +3035,7 @@ msgstr "" "expressões arbitrariamente complexas, por exemplo, envolvendo operadores ou " "indexação." -#: ../../library/ast.rst:2243 +#: ../../library/ast.rst:2247 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1545,7 +3056,7 @@ msgstr "" "CPU em algumas entradas. Portanto, não é recomendado chamá-la em dados não " "confiáveis." -#: ../../library/ast.rst:2253 +#: ../../library/ast.rst:2257 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." @@ -1553,7 +3064,7 @@ msgstr "" "É possível travar o interpretador Python devido às limitações de " "profundidade da pilha no compilador AST do Python." -#: ../../library/ast.rst:2256 +#: ../../library/ast.rst:2260 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." @@ -1561,21 +3072,21 @@ msgstr "" "Pode levantar :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` e :exc:`RecursionError` dependendo da entrada malformada." -#: ../../library/ast.rst:2260 +#: ../../library/ast.rst:2264 msgid "Now allows bytes and set literals." msgstr "Agora permite bytes e literais de conjuntos." -#: ../../library/ast.rst:2263 +#: ../../library/ast.rst:2267 msgid "Now supports creating empty sets with ``'set()'``." msgstr "Agora oferece suporte à criação de conjuntos vazios com ``'set()'``." -#: ../../library/ast.rst:2266 +#: ../../library/ast.rst:2270 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" "Para entradas de string, os espaços iniciais e tabulações agora são " "removidos." -#: ../../library/ast.rst:2272 +#: ../../library/ast.rst:2276 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1587,11 +3098,11 @@ msgstr "" "`Module`) ou ``None`` se não tiver uma docstring. Se *clean* for verdadeiro, " "limpa o recuo da docstring com :func:`inspect.cleandoc`." -#: ../../library/ast.rst:2278 +#: ../../library/ast.rst:2282 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "Não há suporte a :class:`AsyncFunctionDef`." -#: ../../library/ast.rst:2284 +#: ../../library/ast.rst:2288 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :" @@ -1603,7 +3114,7 @@ msgstr "" "end_lineno`, :attr:`~ast.AST.col_offset` ou :attr:`~ast.AST.end_col_offset`) " "está faltando, retorna ``None``." -#: ../../library/ast.rst:2288 +#: ../../library/ast.rst:2292 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." @@ -1611,7 +3122,7 @@ msgstr "" "Se *padded* for ``True``, a primeira linha de uma instrução multilinha será " "preenchida com espaços para corresponder à sua posição original." -#: ../../library/ast.rst:2296 +#: ../../library/ast.rst:2300 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every " @@ -1627,7 +3138,7 @@ msgstr "" "definidos, definindo-os para os valores do nó pai. Ele funciona " "recursivamente a partir do *node*." -#: ../../library/ast.rst:2305 +#: ../../library/ast.rst:2309 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " @@ -1637,7 +3148,7 @@ msgstr "" "começando em *node* em *n*. Isso é útil para \"mover código\" para um local " "diferente em um arquivo." -#: ../../library/ast.rst:2312 +#: ../../library/ast.rst:2316 msgid "" "Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :" "attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " @@ -1647,7 +3158,7 @@ msgstr "" "col_offset`, :attr:`~ast.AST.end_lineno` e :attr:`~ast.AST.end_col_offset`) " "de *old_node* para *new_node* se possível e, então, retorna *new_node*." -#: ../../library/ast.rst:2319 +#: ../../library/ast.rst:2323 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." @@ -1655,7 +3166,7 @@ msgstr "" "Produz uma tupla de ``(fieldname, value)`` para cada campo em ``node." "_fields`` que esteja presente em *node*." -#: ../../library/ast.rst:2325 +#: ../../library/ast.rst:2329 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." @@ -1663,7 +3174,7 @@ msgstr "" "Produz todos os nós filhos diretos de *node*, ou seja, todos os campos que " "são nós e todos os itens de campos que são listas de nós." -#: ../../library/ast.rst:2331 +#: ../../library/ast.rst:2335 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " @@ -1674,7 +3185,7 @@ msgstr "" "útil se você quiser apenas modificar nós no lugar e não se importar com o " "contexto." -#: ../../library/ast.rst:2338 +#: ../../library/ast.rst:2342 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " @@ -1684,7 +3195,7 @@ msgstr "" "e chama uma função de visitante para cada nó encontrado. Esta função pode " "retornar um valor que é encaminhado pelo método :meth:`visit`." -#: ../../library/ast.rst:2342 +#: ../../library/ast.rst:2346 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." @@ -1692,7 +3203,7 @@ msgstr "" "Esta classe deve ser uma subclasse, com a subclasse adicionando métodos " "visitantes." -#: ../../library/ast.rst:2347 +#: ../../library/ast.rst:2351 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " @@ -1702,11 +3213,11 @@ msgstr "" "visit_{nomedaclasse}` sendo *nomedaclasse* o nome da classe do nó, ou :meth:" "`generic_visit` se aquele método não existir." -#: ../../library/ast.rst:2353 +#: ../../library/ast.rst:2357 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "Este visitante chama :meth:`visit` em todos os filhos do nó." -#: ../../library/ast.rst:2355 +#: ../../library/ast.rst:2359 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." @@ -1715,11 +3226,11 @@ msgstr "" "personalizado não serão visitados, a menos que o visitante chame :meth:" "`generic_visit` ou os visite por conta própria." -#: ../../library/ast.rst:2361 +#: ../../library/ast.rst:2365 msgid "Handles all constant nodes." msgstr "Manipula todos os nós constantes." -#: ../../library/ast.rst:2363 +#: ../../library/ast.rst:2367 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" @@ -1729,7 +3240,7 @@ msgstr "" "durante a travessia. Para isso existe um visitante especial (:class:" "`NodeTransformer`) que permite modificações." -#: ../../library/ast.rst:2369 +#: ../../library/ast.rst:2373 msgid "" "Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:" "`!visit_NameConstant` and :meth:`!visit_Ellipsis` are deprecated now and " @@ -1741,7 +3252,7 @@ msgstr "" "descontinuados e não serão chamados em futuras versões do Python. Adicione " "um método :meth:`visit_Constant` para lidar com nós de constantes." -#: ../../library/ast.rst:2377 +#: ../../library/ast.rst:2381 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." @@ -1749,7 +3260,7 @@ msgstr "" "A subclasse :class:`NodeVisitor` que percorre a árvore de sintaxe abstrata e " "permite a modificação de nós." -#: ../../library/ast.rst:2380 +#: ../../library/ast.rst:2384 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1763,7 +3274,7 @@ msgstr "" "caso contrário, ele será substituído pelo valor de retorno. O valor de " "retorno pode ser o nó original, caso em que não há substituição." -#: ../../library/ast.rst:2386 +#: ../../library/ast.rst:2390 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" @@ -1771,7 +3282,19 @@ msgstr "" "Aqui está um exemplo de transformador que rescreve todas as ocorrências de " "procuras por nome (``foo``) para ``data['foo']``::" -#: ../../library/ast.rst:2398 +#: ../../library/ast.rst:2393 +msgid "" +"class RewriteName(NodeTransformer):\n" +"\n" +" def visit_Name(self, node):\n" +" return Subscript(\n" +" value=Name(id='data', ctx=Load()),\n" +" slice=Constant(value=node.id),\n" +" ctx=node.ctx\n" +" )" +msgstr "" + +#: ../../library/ast.rst:2402 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`~ast." @@ -1781,7 +3304,7 @@ msgstr "" "deve transformar os nós filhos por conta própria ou chamar o método :meth:" "`~ast.NodeVisitor.generic_visit` para o nó primeiro." -#: ../../library/ast.rst:2402 +#: ../../library/ast.rst:2406 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " @@ -1791,7 +3314,7 @@ msgstr "" "todos os nós de instrução), o visitante também pode retornar uma lista de " "nós em vez de apenas um único nó." -#: ../../library/ast.rst:2406 +#: ../../library/ast.rst:2410 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:`~ast." @@ -1803,11 +3326,21 @@ msgstr "" "AST.lineno`), :func:`fix_missing_locations` deve ser chamado com o novo " "subárvore para recalcular as informações de localização::" -#: ../../library/ast.rst:2414 +#: ../../library/ast.rst:2415 +msgid "" +"tree = ast.parse('foo', mode='eval')\n" +"new_tree = fix_missing_locations(RewriteName().visit(tree))" +msgstr "" + +#: ../../library/ast.rst:2418 msgid "Usually you use the transformer like this::" msgstr "Normalmente você usa o transformador assim::" -#: ../../library/ast.rst:2421 +#: ../../library/ast.rst:2420 +msgid "node = YourTransformer().visit(node)" +msgstr "" + +#: ../../library/ast.rst:2425 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1825,7 +3358,7 @@ msgstr "" "deslocamentos de coluna não são despejados por padrão. Se isso for desejado, " "*include_attributes* pode ser definido como verdadeiro." -#: ../../library/ast.rst:2429 +#: ../../library/ast.rst:2433 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1841,15 +3374,15 @@ msgstr "" "indentação terá alguns espaços por nível. Se *indent* for uma string (como " "``\"\\t\"``), essa string será usada para indentar cada nível." -#: ../../library/ast.rst:2436 +#: ../../library/ast.rst:2440 msgid "Added the *indent* option." msgstr "Adicionada a opção *indent*." -#: ../../library/ast.rst:2443 +#: ../../library/ast.rst:2447 msgid "Compiler Flags" msgstr "Sinalizadores do compilador" -#: ../../library/ast.rst:2445 +#: ../../library/ast.rst:2449 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" @@ -1857,7 +3390,7 @@ msgstr "" "Os seguintes sinalizadores podem ser passados para :func:`compile` para " "alterar os efeitos na compilação de um programa:" -#: ../../library/ast.rst:2450 +#: ../../library/ast.rst:2454 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." @@ -1865,7 +3398,7 @@ msgstr "" "Habilita suporte para ``await``, ``async for``, ``async with`` e " "compreensões assíncronas de nível superior." -#: ../../library/ast.rst:2457 +#: ../../library/ast.rst:2461 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." @@ -1873,7 +3406,7 @@ msgstr "" "Gera e retorna uma árvore de sintaxe abstrata em vez de retornar um objeto " "de código compilado." -#: ../../library/ast.rst:2462 +#: ../../library/ast.rst:2466 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." @@ -1881,11 +3414,11 @@ msgstr "" "Habilita suporte para comentários do tipo :pep:`484` e :pep:`526` (``# type: " "``, ``# type: ignore ``)." -#: ../../library/ast.rst:2471 +#: ../../library/ast.rst:2475 msgid "Command-Line Usage" msgstr "Uso da linha de comando" -#: ../../library/ast.rst:2475 +#: ../../library/ast.rst:2479 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" @@ -1894,14 +3427,18 @@ msgstr "" "tão simples quanto:" #: ../../library/ast.rst:2482 +msgid "python -m ast [-m ] [-a] [infile]" +msgstr "" + +#: ../../library/ast.rst:2486 msgid "The following options are accepted:" msgstr "As seguintes opções são aceitas:" -#: ../../library/ast.rst:2488 +#: ../../library/ast.rst:2492 msgid "Show the help message and exit." msgstr "Mostra a mensagem de ajuda e saia." -#: ../../library/ast.rst:2493 +#: ../../library/ast.rst:2497 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." @@ -1909,19 +3446,19 @@ msgstr "" "Especifica que tipo de código deve ser compilado, como o argumento *mode* " "em :func:`parse`." -#: ../../library/ast.rst:2498 +#: ../../library/ast.rst:2502 msgid "Don't parse type comments." msgstr "Não analisa comentários de tipo." -#: ../../library/ast.rst:2502 +#: ../../library/ast.rst:2506 msgid "Include attributes such as line numbers and column offsets." msgstr "Inclui atributos como números de linha e deslocamentos de colunas." -#: ../../library/ast.rst:2507 +#: ../../library/ast.rst:2511 msgid "Indentation of nodes in AST (number of spaces)." msgstr "indentação de nós em AST (número de espaços)." -#: ../../library/ast.rst:2509 +#: ../../library/ast.rst:2513 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." @@ -1929,7 +3466,7 @@ msgstr "" "Se :file:`infile` for especificado, seu conteúdo será analisado no AST e " "despejado no stdout. Caso contrário, o conteúdo será lido em stdin." -#: ../../library/ast.rst:2515 +#: ../../library/ast.rst:2519 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." @@ -1938,7 +3475,7 @@ msgstr "" "de documentação externo, possui bons detalhes sobre trabalhar com ASTs do " "Python." -#: ../../library/ast.rst:2518 +#: ../../library/ast.rst:2522 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1950,7 +3487,7 @@ msgstr "" "as gerou. Isso é útil para ferramentas que fazem transformações de código-" "fonte." -#: ../../library/ast.rst:2523 +#: ../../library/ast.rst:2527 msgid "" "`leoAst.py `_ unifies the token-based and parse-tree-based views of python programs " @@ -1960,7 +3497,7 @@ msgstr "" "py>`_ unifica as visualizações baseadas em token e em árvore de análise de " "programas python, inserindo links duas vias entre tokens e nós de ast." -#: ../../library/ast.rst:2528 +#: ../../library/ast.rst:2532 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " @@ -1971,7 +3508,7 @@ msgstr "" "detalhes de formatação. É útil para construir linters e aplicações de " "refatoração automatizada (codemod)." -#: ../../library/ast.rst:2533 +#: ../../library/ast.rst:2537 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index 50bdd77be..980725e33 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -4,31 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Leticia Portella , 2021 -# Adorilson Bezerra , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Hildeberto Abreu Magalhães , 2021 -# Rafael Fontenelle , 2022 -# Leandro Cavalcante Damascena , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Leandro Cavalcante Damascena , " -"2024\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 72f8fb685..ffc68ffd3 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Marco Rougeth , 2022 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -82,6 +79,10 @@ msgid "" "at startup of the application::" msgstr "" +#: ../../library/asyncio-dev.rst:40 +msgid "logging.basicConfig(level=logging.DEBUG)" +msgstr "" + #: ../../library/asyncio-dev.rst:42 msgid "" "configuring the :mod:`warnings` module to display :exc:`ResourceWarning` " @@ -146,6 +147,10 @@ msgstr "" "Para agendar uma :term:`callback` de outra thread do SO, o método :meth:" "`loop.call_soon_threadsafe` deve ser usado. Exemplo::" +#: ../../library/asyncio-dev.rst:79 +msgid "loop.call_soon_threadsafe(callback, *args)" +msgstr "" + #: ../../library/asyncio-dev.rst:81 msgid "" "Almost all asyncio objects are not thread safe, which is typically not a " @@ -154,6 +159,10 @@ msgid "" "API, the :meth:`loop.call_soon_threadsafe` method should be used, e.g.::" msgstr "" +#: ../../library/asyncio-dev.rst:87 +msgid "loop.call_soon_threadsafe(fut.cancel)" +msgstr "" + #: ../../library/asyncio-dev.rst:89 msgid "" "To schedule a coroutine object from a different OS thread, the :func:" @@ -161,6 +170,18 @@ msgid "" "`concurrent.futures.Future` to access the result::" msgstr "" +#: ../../library/asyncio-dev.rst:93 +msgid "" +"async def coro_func():\n" +" return await asyncio.sleep(1, 42)\n" +"\n" +"# Later in another OS thread:\n" +"\n" +"future = asyncio.run_coroutine_threadsafe(coro_func(), loop)\n" +"# Wait for the result:\n" +"result = future.result()" +msgstr "" + #: ../../library/asyncio-dev.rst:102 msgid "To handle signals the event loop must be run in the main thread." msgstr "" @@ -222,6 +243,10 @@ msgid "" "adjusted::" msgstr "" +#: ../../library/asyncio-dev.rst:148 +msgid "logging.getLogger(\"asyncio\").setLevel(logging.WARNING)" +msgstr "" + #: ../../library/asyncio-dev.rst:151 msgid "" "Network logging can block the event loop. It is recommended to use a " @@ -240,20 +265,59 @@ msgid "" "`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::" msgstr "" +#: ../../library/asyncio-dev.rst:166 +msgid "" +"import asyncio\n" +"\n" +"async def test():\n" +" print(\"never scheduled\")\n" +"\n" +"async def main():\n" +" test()\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-dev.rst:176 ../../library/asyncio-dev.rst:221 msgid "Output::" msgstr "Saída::" +#: ../../library/asyncio-dev.rst:178 +msgid "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +" test()" +msgstr "" + #: ../../library/asyncio-dev.rst:181 ../../library/asyncio-dev.rst:237 msgid "Output in debug mode::" msgstr "" +#: ../../library/asyncio-dev.rst:183 +msgid "" +"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" +"Coroutine created at (most recent call last)\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +" < .. >\n" +"\n" +" File \"../t.py\", line 7, in main\n" +" test()\n" +" test()" +msgstr "" + #: ../../library/asyncio-dev.rst:194 msgid "" "The usual fix is to either await the coroutine or call the :meth:`asyncio." "create_task` function::" msgstr "" +#: ../../library/asyncio-dev.rst:197 +msgid "" +"async def main():\n" +" await test()" +msgstr "" + #: ../../library/asyncio-dev.rst:202 msgid "Detect never-retrieved exceptions" msgstr "" @@ -270,8 +334,55 @@ msgstr "" msgid "Example of an unhandled exception::" msgstr "Exemplo de uma exceção não tratada::" +#: ../../library/asyncio-dev.rst:211 +msgid "" +"import asyncio\n" +"\n" +"async def bug():\n" +" raise Exception(\"not consumed\")\n" +"\n" +"async def main():\n" +" asyncio.create_task(bug())\n" +"\n" +"asyncio.run(main())" +msgstr "" + +#: ../../library/asyncio-dev.rst:223 +msgid "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed')>\n" +"\n" +"Traceback (most recent call last):\n" +" File \"test.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" +msgstr "" + #: ../../library/asyncio-dev.rst:232 msgid "" ":ref:`Enable the debug mode ` to get the traceback where " "the task was created::" msgstr "" + +#: ../../library/asyncio-dev.rst:235 +msgid "asyncio.run(main(), debug=True)" +msgstr "" + +#: ../../library/asyncio-dev.rst:239 +msgid "" +"Task exception was never retrieved\n" +"future: \n" +" exception=Exception('not consumed') created at asyncio/tasks.py:321>\n" +"\n" +"source_traceback: Object created at (most recent call last):\n" +" File \"../t.py\", line 9, in \n" +" asyncio.run(main(), debug=True)\n" +"\n" +"< .. >\n" +"\n" +"Traceback (most recent call last):\n" +" File \"../t.py\", line 4, in bug\n" +" raise Exception(\"not consumed\")\n" +"Exception: not consumed" +msgstr "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 2c10f2f8a..63d14e256 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -4,31 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Humberto Rocha , 2021 -# Raphael Mendonça, 2021 -# Italo Penaforte , 2021 -# i17obot , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Adorilson Bezerra , 2022 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -346,11 +337,20 @@ msgstr "" "for usado." #: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1242 -#: ../../library/asyncio-eventloop.rst:1660 +#: ../../library/asyncio-eventloop.rst:1253 +#: ../../library/asyncio-eventloop.rst:1671 msgid "Example::" msgstr "Exemplo::" +#: ../../library/asyncio-eventloop.rst:178 +msgid "" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.run_until_complete(loop.shutdown_asyncgens())\n" +" loop.close()" +msgstr "" + #: ../../library/asyncio-eventloop.rst:188 msgid "" "Schedule the closure of the default executor and wait for it to join all of " @@ -472,6 +472,13 @@ msgstr "" "Maior parte das funções de agendamento :mod:`asyncio` não permite passar " "argumentos nomeados. Para fazer isso, use :func:`functools.partial`::" +#: ../../library/asyncio-eventloop.rst:257 +msgid "" +"# will schedule \"print(\"Hello\", flush=True)\"\n" +"loop.call_soon(\n" +" functools.partial(print, \"Hello\", flush=True))" +msgstr "" + #: ../../library/asyncio-eventloop.rst:261 msgid "" "Using partial objects is usually more convenient than using lambdas, as " @@ -691,8 +698,8 @@ msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:412 -#: ../../library/asyncio-eventloop.rst:1156 -#: ../../library/asyncio-eventloop.rst:1172 +#: ../../library/asyncio-eventloop.rst:1164 +#: ../../library/asyncio-eventloop.rst:1180 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -1127,7 +1134,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:652 #: ../../library/asyncio-eventloop.rst:794 -#: ../../library/asyncio-eventloop.rst:1225 +#: ../../library/asyncio-eventloop.rst:1233 msgid ":ref:`Availability `: Unix." msgstr ":ref:`Disponibilidade `: Unix." @@ -1528,7 +1535,7 @@ msgstr "" "esteja disponível para escrita." #: ../../library/asyncio-eventloop.rst:955 -#: ../../library/asyncio-eventloop.rst:1212 +#: ../../library/asyncio-eventloop.rst:1220 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." @@ -1785,7 +1792,17 @@ msgstr "Versão assíncrona de :meth:`socket.getaddrinfo`." msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "Versão assíncrona de :meth:`socket.getnameinfo`." -#: ../../library/asyncio-eventloop.rst:1142 +#: ../../library/asyncio-eventloop.rst:1143 +msgid "" +"Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " +"versions through the loop's default thread pool executor. When this executor " +"is saturated, these methods may experience delays, which higher-level " +"networking libraries may report as increased timeouts. To mitigate this, " +"consider using a custom executor for other user tasks, or setting a default " +"executor with a larger number of workers." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1150 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1797,19 +1814,19 @@ msgstr "" "verdade, retornando objetos :class:`asyncio.Future`. A partir do Python 3.7, " "ambos os métodos são corrotinas." -#: ../../library/asyncio-eventloop.rst:1150 +#: ../../library/asyncio-eventloop.rst:1158 msgid "Working with pipes" msgstr "Trabalhando com encadeamentos" -#: ../../library/asyncio-eventloop.rst:1154 +#: ../../library/asyncio-eventloop.rst:1162 msgid "Register the read end of *pipe* in the event loop." msgstr "Registra o extremo da leitura de um *pipe* no laço de eventos." -#: ../../library/asyncio-eventloop.rst:1159 +#: ../../library/asyncio-eventloop.rst:1167 msgid "*pipe* is a :term:`file-like object `." msgstr "*pipe* é um :term:`objeto arquivo ou similar `." -#: ../../library/asyncio-eventloop.rst:1161 +#: ../../library/asyncio-eventloop.rst:1169 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " @@ -1819,8 +1836,8 @@ msgstr "" "interface :class:`ReadTransport` e *protocol* é um objeto instanciado pelo " "*protocol_factory*." -#: ../../library/asyncio-eventloop.rst:1165 -#: ../../library/asyncio-eventloop.rst:1181 +#: ../../library/asyncio-eventloop.rst:1173 +#: ../../library/asyncio-eventloop.rst:1189 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." @@ -1828,15 +1845,15 @@ msgstr "" "Com o :class:`SelectorEventLoop` do laço de eventos, o *pipe* é definido " "para modo não bloqueante." -#: ../../library/asyncio-eventloop.rst:1170 +#: ../../library/asyncio-eventloop.rst:1178 msgid "Register the write end of *pipe* in the event loop." msgstr "Registra o extremo de escrita do *pipe* no laço de eventos." -#: ../../library/asyncio-eventloop.rst:1175 +#: ../../library/asyncio-eventloop.rst:1183 msgid "*pipe* is :term:`file-like object `." msgstr "*pipe* é um :term:`objeto arquivo ou similar `." -#: ../../library/asyncio-eventloop.rst:1177 +#: ../../library/asyncio-eventloop.rst:1185 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " @@ -1846,7 +1863,7 @@ msgstr "" "interface :class:`WriteTransport` e *protocol* é um objeto instanciado pelo " "*protocol_factory*." -#: ../../library/asyncio-eventloop.rst:1186 +#: ../../library/asyncio-eventloop.rst:1194 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." @@ -1854,21 +1871,21 @@ msgstr "" ":class:`SelectorEventLoop` não suporta os métodos acima no Windows. Use :" "class:`ProactorEventLoop` ao invés para Windows." -#: ../../library/asyncio-eventloop.rst:1191 +#: ../../library/asyncio-eventloop.rst:1199 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" "Os métodos :meth:`loop.subprocess_exec` e :meth:`loop.subprocess_shell`." -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:1204 msgid "Unix signals" msgstr "Sinais Unix" -#: ../../library/asyncio-eventloop.rst:1202 +#: ../../library/asyncio-eventloop.rst:1210 msgid "Set *callback* as the handler for the *signum* signal." msgstr "Define *callback* como o tratador para o sinal *signum*." -#: ../../library/asyncio-eventloop.rst:1204 +#: ../../library/asyncio-eventloop.rst:1212 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1881,7 +1898,7 @@ msgstr "" "uma função de retorno registrada com esta função tem autorização para " "interagir com o laço de eventos." -#: ../../library/asyncio-eventloop.rst:1209 +#: ../../library/asyncio-eventloop.rst:1217 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." @@ -1890,18 +1907,18 @@ msgstr "" "capturar. Levanta :exc:`RuntimeError` se existe um problema definindo o " "tratador." -#: ../../library/asyncio-eventloop.rst:1215 +#: ../../library/asyncio-eventloop.rst:1223 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" "Assim como :func:`signal.signal`, esta função deve ser invocada na thread " "principal." -#: ../../library/asyncio-eventloop.rst:1220 +#: ../../library/asyncio-eventloop.rst:1228 msgid "Remove the handler for the *sig* signal." msgstr "Remove o tratador para o sinal *sig*." -#: ../../library/asyncio-eventloop.rst:1222 +#: ../../library/asyncio-eventloop.rst:1230 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." @@ -1909,27 +1926,71 @@ msgstr "" "Retorna ``True`` se o tratador de sinal foi removido, ou ``False`` se nenhum " "tratador foi definido para o sinal fornecido." -#: ../../library/asyncio-eventloop.rst:1229 +#: ../../library/asyncio-eventloop.rst:1237 msgid "The :mod:`signal` module." msgstr "O módulo :mod:`signal`." -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1241 msgid "Executing code in thread or process pools" msgstr "Executando código em conjuntos de threads ou processos" -#: ../../library/asyncio-eventloop.rst:1237 +#: ../../library/asyncio-eventloop.rst:1245 msgid "Arrange for *func* to be called in the specified executor." msgstr "Providencia para a *func* ser chamada no executor especificado." -#: ../../library/asyncio-eventloop.rst:1239 +#: ../../library/asyncio-eventloop.rst:1247 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " -"instance. The default executor is used if *executor* is ``None``." -msgstr "" -"O argumento *executor* deve ser uma instância :class:`concurrent.futures." -"Executor`. O executor padrão é usado se *executor* for ``None``." - -#: ../../library/asyncio-eventloop.rst:1284 +"instance. The default executor is used if *executor* is ``None``. The " +"default executor can be set by :meth:`loop.set_default_executor`, otherwise, " +"a :class:`concurrent.futures.ThreadPoolExecutor` will be lazy-initialized " +"and used by :func:`run_in_executor` if needed." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1255 +msgid "" +"import asyncio\n" +"import concurrent.futures\n" +"\n" +"def blocking_io():\n" +" # File operations (such as logging) can block the\n" +" # event loop: run them in a thread pool.\n" +" with open('/dev/urandom', 'rb') as f:\n" +" return f.read(100)\n" +"\n" +"def cpu_bound():\n" +" # CPU-bound operations will block the event loop:\n" +" # in general it is preferable to run them in a\n" +" # process pool.\n" +" return sum(i * i for i in range(10 ** 7))\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" ## Options:\n" +"\n" +" # 1. Run in the default loop's executor:\n" +" result = await loop.run_in_executor(\n" +" None, blocking_io)\n" +" print('default thread pool', result)\n" +"\n" +" # 2. Run in a custom thread pool:\n" +" with concurrent.futures.ThreadPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, blocking_io)\n" +" print('custom thread pool', result)\n" +"\n" +" # 3. Run in a custom process pool:\n" +" with concurrent.futures.ProcessPoolExecutor() as pool:\n" +" result = await loop.run_in_executor(\n" +" pool, cpu_bound)\n" +" print('custom process pool', result)\n" +"\n" +"if __name__ == '__main__':\n" +" asyncio.run(main())" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1295 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1937,11 +1998,11 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1289 +#: ../../library/asyncio-eventloop.rst:1300 msgid "This method returns a :class:`asyncio.Future` object." msgstr "Este método retorna um objeto :class:`asyncio.Future`." -#: ../../library/asyncio-eventloop.rst:1291 +#: ../../library/asyncio-eventloop.rst:1302 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." @@ -1949,7 +2010,7 @@ msgstr "" "Use :func:`functools.partial` :ref:`para passar argumentos nomeados ` para *func*." -#: ../../library/asyncio-eventloop.rst:1294 +#: ../../library/asyncio-eventloop.rst:1305 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1961,32 +2022,32 @@ msgstr "" "para o executor do conjunto de thread (:class:`~concurrent.futures." "ThreadPoolExecutor`) para setar o valor padrão." -#: ../../library/asyncio-eventloop.rst:1303 +#: ../../library/asyncio-eventloop.rst:1314 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1307 +#: ../../library/asyncio-eventloop.rst:1318 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1324 msgid "Error Handling API" msgstr "Tratando erros da API" -#: ../../library/asyncio-eventloop.rst:1315 +#: ../../library/asyncio-eventloop.rst:1326 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "Permite customizar como exceções são tratadas no laço de eventos." -#: ../../library/asyncio-eventloop.rst:1319 +#: ../../library/asyncio-eventloop.rst:1330 msgid "Set *handler* as the new event loop exception handler." msgstr "Define *handler* como o novo tratador de exceções do laço de eventos." -#: ../../library/asyncio-eventloop.rst:1321 +#: ../../library/asyncio-eventloop.rst:1332 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -2001,20 +2062,20 @@ msgstr "" "(veja a documentação :meth:`call_exception_handler` para detalhes a respeito " "do contexto)." -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1340 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " "task or callback handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1335 +#: ../../library/asyncio-eventloop.rst:1346 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." msgstr "" -#: ../../library/asyncio-eventloop.rst:1340 +#: ../../library/asyncio-eventloop.rst:1351 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." @@ -2022,11 +2083,11 @@ msgstr "" "Retorna o tratador de exceção atual, ou ``None`` se nenhum tratador de " "exceção customizado foi definido." -#: ../../library/asyncio-eventloop.rst:1347 +#: ../../library/asyncio-eventloop.rst:1358 msgid "Default exception handler." msgstr "Tratador de exceção padrão." -#: ../../library/asyncio-eventloop.rst:1349 +#: ../../library/asyncio-eventloop.rst:1360 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " @@ -2036,7 +2097,7 @@ msgstr "" "definido. Isso pode ser chamado por um tratador de exceção customizado que " "quer passar adiante para o comportamento do tratador padrão." -#: ../../library/asyncio-eventloop.rst:1353 +#: ../../library/asyncio-eventloop.rst:1364 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." @@ -2044,11 +2105,11 @@ msgstr "" "parâmetro *context* tem o mesmo significado que em :meth:" "`call_exception_handler`." -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1369 msgid "Call the current event loop exception handler." msgstr "Chama o tratador de exceção do laço de eventos atual." -#: ../../library/asyncio-eventloop.rst:1360 +#: ../../library/asyncio-eventloop.rst:1371 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" @@ -2056,49 +2117,49 @@ msgstr "" "*context* é um objeto ``dict`` contendo as seguintes chaves (novas chaves " "podem ser introduzidas em versões futuras do Python):" -#: ../../library/asyncio-eventloop.rst:1363 +#: ../../library/asyncio-eventloop.rst:1374 msgid "'message': Error message;" msgstr "'message': Mensagem de erro;" -#: ../../library/asyncio-eventloop.rst:1364 +#: ../../library/asyncio-eventloop.rst:1375 msgid "'exception' (optional): Exception object;" msgstr "'exception' (opcional): Objeto Exception;" -#: ../../library/asyncio-eventloop.rst:1365 +#: ../../library/asyncio-eventloop.rst:1376 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "'future' (opcional): instância de :class:`asyncio.Future`;" -#: ../../library/asyncio-eventloop.rst:1366 +#: ../../library/asyncio-eventloop.rst:1377 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "'task' (opcional): instância de :class:`asyncio.Task`;" -#: ../../library/asyncio-eventloop.rst:1367 +#: ../../library/asyncio-eventloop.rst:1378 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "'handle' (opcional): instância de :class:`asyncio.Handle`;" -#: ../../library/asyncio-eventloop.rst:1368 +#: ../../library/asyncio-eventloop.rst:1379 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" "'protocol' (opcional): instância de :ref:`Protocol `;" -#: ../../library/asyncio-eventloop.rst:1369 +#: ../../library/asyncio-eventloop.rst:1380 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" "'transport' (opcional): instância de :ref:`Transport `;" -#: ../../library/asyncio-eventloop.rst:1370 +#: ../../library/asyncio-eventloop.rst:1381 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "'socket' (opcional): instância de :class:`socket.socket`;" -#: ../../library/asyncio-eventloop.rst:1371 +#: ../../library/asyncio-eventloop.rst:1382 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "'asyncgen' (opcional): Gerador assíncrono que causou" -#: ../../library/asyncio-eventloop.rst:1372 +#: ../../library/asyncio-eventloop.rst:1383 msgid "the exception." msgstr "a exceção." -#: ../../library/asyncio-eventloop.rst:1376 +#: ../../library/asyncio-eventloop.rst:1387 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." @@ -2107,15 +2168,15 @@ msgstr "" "tratamento de exceções customizadas, use o método :meth:" "`set_exception_handler()`." -#: ../../library/asyncio-eventloop.rst:1381 +#: ../../library/asyncio-eventloop.rst:1392 msgid "Enabling debug mode" msgstr "Habilitando o modo de debug" -#: ../../library/asyncio-eventloop.rst:1385 +#: ../../library/asyncio-eventloop.rst:1396 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "Obtém o modo de debug (:class:`bool`) do laço de eventos." -#: ../../library/asyncio-eventloop.rst:1387 +#: ../../library/asyncio-eventloop.rst:1398 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." @@ -2124,11 +2185,11 @@ msgstr "" "`PYTHONASYNCIODEBUG` estiver definida para uma string não vazia, ``False`` " "caso contrário." -#: ../../library/asyncio-eventloop.rst:1393 +#: ../../library/asyncio-eventloop.rst:1404 msgid "Set the debug mode of the event loop." msgstr "Define o modo de debug do laço de eventos." -#: ../../library/asyncio-eventloop.rst:1397 +#: ../../library/asyncio-eventloop.rst:1408 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." @@ -2136,26 +2197,26 @@ msgstr "" "O novo :ref:`Modo de Desenvolvimento do Python ` agora também pode " "ser usado para habilitar o modo de debug." -#: ../../library/asyncio-eventloop.rst:1402 +#: ../../library/asyncio-eventloop.rst:1413 msgid "" "This attribute can be used to set the minimum execution duration in seconds " "that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " "are logged." msgstr "" -#: ../../library/asyncio-eventloop.rst:1406 +#: ../../library/asyncio-eventloop.rst:1417 msgid "Default value is 100 milliseconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1410 +#: ../../library/asyncio-eventloop.rst:1421 msgid "The :ref:`debug mode of asyncio `." msgstr "O :ref:`modo de debug de asyncio `." -#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1425 msgid "Running Subprocesses" msgstr "Executando Subprocessos" -#: ../../library/asyncio-eventloop.rst:1416 +#: ../../library/asyncio-eventloop.rst:1427 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " @@ -2166,7 +2227,7 @@ msgstr "" "`asyncio.create_subprocess_shell` e :func:`asyncio.create_subprocess_exec` " "ao invés." -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1434 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" @@ -2177,22 +2238,22 @@ msgstr "" "ref:`Suporte para subprocessos no Windows ` para " "detalhes." -#: ../../library/asyncio-eventloop.rst:1434 +#: ../../library/asyncio-eventloop.rst:1445 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" "Cria um subprocesso a partir de um ou mais argumentos de string " "especificados por *args*." -#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1448 msgid "*args* must be a list of strings represented by:" msgstr "*args* deve ser uma lista de strings representada por:" -#: ../../library/asyncio-eventloop.rst:1439 +#: ../../library/asyncio-eventloop.rst:1450 msgid ":class:`str`;" msgstr ":class:`str`;" -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1451 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." @@ -2200,7 +2261,7 @@ msgstr "" "ou :class:`bytes`, encodados na :ref:`codificação do sistema de arquivos " "`." -#: ../../library/asyncio-eventloop.rst:1443 +#: ../../library/asyncio-eventloop.rst:1454 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " @@ -2210,7 +2271,7 @@ msgstr "" "remanescentes especificam os argumentos. Juntas, argumentos em string formam " "o ``argv`` do programa." -#: ../../library/asyncio-eventloop.rst:1447 +#: ../../library/asyncio-eventloop.rst:1458 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -2223,7 +2284,7 @@ msgstr "" "argumento no qual é uma lista de strings, *subprocess_exec* recebe múltiplos " "argumentos string." -#: ../../library/asyncio-eventloop.rst:1453 +#: ../../library/asyncio-eventloop.rst:1464 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." @@ -2231,29 +2292,29 @@ msgstr "" "O *protocol_factory* deve ser um chamável que retorne uma subclasse da " "classe :class:`asyncio.SubprocessProtocol`." -#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1467 msgid "Other parameters:" msgstr "Outros parâmetros:" -#: ../../library/asyncio-eventloop.rst:1458 +#: ../../library/asyncio-eventloop.rst:1469 msgid "*stdin* can be any of these:" msgstr "*stdin* pode ser qualquer um destes:" -#: ../../library/asyncio-eventloop.rst:1460 #: ../../library/asyncio-eventloop.rst:1471 -#: ../../library/asyncio-eventloop.rst:1481 +#: ../../library/asyncio-eventloop.rst:1482 +#: ../../library/asyncio-eventloop.rst:1492 msgid "a file-like object" msgstr "" -#: ../../library/asyncio-eventloop.rst:1461 +#: ../../library/asyncio-eventloop.rst:1472 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe()`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1462 -#: ../../library/asyncio-eventloop.rst:1472 -#: ../../library/asyncio-eventloop.rst:1482 +#: ../../library/asyncio-eventloop.rst:1473 +#: ../../library/asyncio-eventloop.rst:1483 +#: ../../library/asyncio-eventloop.rst:1493 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," @@ -2261,9 +2322,9 @@ msgstr "" "a constante :const:`subprocess.PIPE` (padrão), a qual criará um novo " "encadeamento e conectar a ele," -#: ../../library/asyncio-eventloop.rst:1464 -#: ../../library/asyncio-eventloop.rst:1474 -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1485 +#: ../../library/asyncio-eventloop.rst:1495 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" @@ -2271,9 +2332,9 @@ msgstr "" "o valor ``None``, o qual fará o subprocesso herdar o descritor de arquivo " "deste processo" -#: ../../library/asyncio-eventloop.rst:1466 -#: ../../library/asyncio-eventloop.rst:1476 -#: ../../library/asyncio-eventloop.rst:1486 +#: ../../library/asyncio-eventloop.rst:1477 +#: ../../library/asyncio-eventloop.rst:1487 +#: ../../library/asyncio-eventloop.rst:1497 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" @@ -2281,15 +2342,15 @@ msgstr "" "a constante :const:`subprocess.DEVNULL`, a qual indica que o arquivo " "especial :data:`os.devnull` será usado" -#: ../../library/asyncio-eventloop.rst:1469 +#: ../../library/asyncio-eventloop.rst:1480 msgid "*stdout* can be any of these:" msgstr "*stdout* pode ser qualquer um destes:" -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1490 msgid "*stderr* can be any of these:" msgstr "*stderr* pode ser qualquer um destes:" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1499 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" @@ -2297,7 +2358,7 @@ msgstr "" "a constante :const:`subprocess.STDOUT`, a qual irá conectar o stream de erro " "padrão ao stream de saída padrão do processo" -#: ../../library/asyncio-eventloop.rst:1491 +#: ../../library/asyncio-eventloop.rst:1502 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " @@ -2308,7 +2369,7 @@ msgstr "" "*text*, *encoding* e *errors*, os quais não devem ser especificados de forma " "alguma." -#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1507 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " @@ -2318,7 +2379,7 @@ msgstr "" "texto. :func:`bytes.decode` pode ser usado para converter os bytes " "retornados do stream para texto." -#: ../../library/asyncio-eventloop.rst:1500 +#: ../../library/asyncio-eventloop.rst:1511 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -2326,7 +2387,7 @@ msgid "" "the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1505 +#: ../../library/asyncio-eventloop.rst:1516 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." @@ -2334,7 +2395,7 @@ msgstr "" "Veja o construtor da classe :class:`subprocess.Popen` para documentação " "sobre outros argumentos." -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1519 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " @@ -2344,7 +2405,7 @@ msgstr "" "classe base :class:`asyncio.SubprocessTransport` e *protocol* é um objeto " "instanciado pelo *protocol_factory*." -#: ../../library/asyncio-eventloop.rst:1516 +#: ../../library/asyncio-eventloop.rst:1527 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, usando a sintaxe \"shell\" da plataforma." -#: ../../library/asyncio-eventloop.rst:1521 +#: ../../library/asyncio-eventloop.rst:1532 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." @@ -2362,7 +2423,7 @@ msgstr "" "Isto é similar a classe :class:`subprocess.Popen` da biblioteca padrão sendo " "chanada com ``shell=True``." -#: ../../library/asyncio-eventloop.rst:1524 +#: ../../library/asyncio-eventloop.rst:1535 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." @@ -2370,7 +2431,7 @@ msgstr "" "O argumento *protocol_factory* deve ser um chamável que retorna uma " "subclasse da classe :class:`SubprocessProtocol`." -#: ../../library/asyncio-eventloop.rst:1527 +#: ../../library/asyncio-eventloop.rst:1538 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." @@ -2378,7 +2439,7 @@ msgstr "" "Veja :meth:`~loop.subprocess_exec` para mais detalhes sobre os argumentos " "remanescentes." -#: ../../library/asyncio-eventloop.rst:1530 +#: ../../library/asyncio-eventloop.rst:1541 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " @@ -2388,7 +2449,7 @@ msgstr "" "classe base :class:`SubprocessTransport` e *protocol* é um objeto " "instanciado pelo *protocol_factory*." -#: ../../library/asyncio-eventloop.rst:1535 +#: ../../library/asyncio-eventloop.rst:1546 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -2404,11 +2465,11 @@ msgstr "" "usada para escapar espaços em branco e caracteres especiais apropriadamente " "em strings que serão usadas para construir comandos shell." -#: ../../library/asyncio-eventloop.rst:1544 +#: ../../library/asyncio-eventloop.rst:1555 msgid "Callback Handles" msgstr "Tratadores de função de retorno" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1559 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." @@ -2416,12 +2477,12 @@ msgstr "" "Um objeto invólucro de função de retorno retornado por :meth:`loop." "call_soon`, :meth:`loop.call_soon_threadsafe`." -#: ../../library/asyncio-eventloop.rst:1553 +#: ../../library/asyncio-eventloop.rst:1564 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1560 +#: ../../library/asyncio-eventloop.rst:1571 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." @@ -2429,11 +2490,11 @@ msgstr "" "Cancela a função de retorno. Se a função de retorno já tiver sido cancelada " "ou executada, este método não tem efeito." -#: ../../library/asyncio-eventloop.rst:1565 +#: ../../library/asyncio-eventloop.rst:1576 msgid "Return ``True`` if the callback was cancelled." msgstr "Retorna ``True`` se a função de retorno foi cancelada." -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1582 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." @@ -2441,17 +2502,17 @@ msgstr "" "Um objeto invólucro de função de retorno retornado por :meth:`loop." "call_later`, e :meth:`loop.call_at`." -#: ../../library/asyncio-eventloop.rst:1574 +#: ../../library/asyncio-eventloop.rst:1585 msgid "This class is a subclass of :class:`Handle`." msgstr "Esta classe é uma subclasse de :class:`Handle`." -#: ../../library/asyncio-eventloop.rst:1578 +#: ../../library/asyncio-eventloop.rst:1589 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" "Retorna o tempo de uma função de retorno agendada como :class:`float` " "segundos." -#: ../../library/asyncio-eventloop.rst:1580 +#: ../../library/asyncio-eventloop.rst:1591 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." @@ -2459,11 +2520,11 @@ msgstr "" "O tempo é um timestamp absoluto, usando a mesma referência de tempo que :" "meth:`loop.time`." -#: ../../library/asyncio-eventloop.rst:1587 +#: ../../library/asyncio-eventloop.rst:1598 msgid "Server Objects" msgstr "Objetos Server" -#: ../../library/asyncio-eventloop.rst:1589 +#: ../../library/asyncio-eventloop.rst:1600 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " @@ -2472,11 +2533,11 @@ msgstr "" "Objetos Server são criados pelas funções :meth:`loop.create_server`, :meth:" "`loop.create_unix_server`, :func:`start_server`, e :func:`start_unix_server`." -#: ../../library/asyncio-eventloop.rst:1593 +#: ../../library/asyncio-eventloop.rst:1604 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1597 +#: ../../library/asyncio-eventloop.rst:1608 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " @@ -2487,18 +2548,28 @@ msgstr "" "não está aceitando novas conexões quando a instrução ``async with`` estiver " "completa::" -#: ../../library/asyncio-eventloop.rst:1610 +#: ../../library/asyncio-eventloop.rst:1613 +msgid "" +"srv = await loop.create_server(...)\n" +"\n" +"async with srv:\n" +" # some code\n" +"\n" +"# At this point, srv is closed and no longer accepts new connections." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1621 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" "Objeto Server é um gerenciador de contexto assíncrono desde o Python 3.7." -#: ../../library/asyncio-eventloop.rst:1613 +#: ../../library/asyncio-eventloop.rst:1624 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" -#: ../../library/asyncio-eventloop.rst:1618 +#: ../../library/asyncio-eventloop.rst:1629 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." @@ -2506,7 +2577,7 @@ msgstr "" "Para de servir: fecha soquetes que estavam ouvindo e define o atributo :attr:" "`sockets` para ``None``." -#: ../../library/asyncio-eventloop.rst:1621 +#: ../../library/asyncio-eventloop.rst:1632 msgid "" "The sockets that represent existing incoming client connections are left " "open." @@ -2514,27 +2585,27 @@ msgstr "" "Os soquetes que representam conexões de clientes existentes que estão " "chegando são deixados em aberto." -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1635 msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1630 +#: ../../library/asyncio-eventloop.rst:1641 msgid "Return the event loop associated with the server object." msgstr "Retorna o laço de eventos associado com o objeto server." -#: ../../library/asyncio-eventloop.rst:1636 +#: ../../library/asyncio-eventloop.rst:1647 msgid "Start accepting connections." msgstr "Começa a aceitar conexões." -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1649 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1641 +#: ../../library/asyncio-eventloop.rst:1652 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2548,7 +2619,7 @@ msgstr "" "meth:`Server.serve_forever` podem ser usados para fazer o Server começar a " "aceitar conexões." -#: ../../library/asyncio-eventloop.rst:1652 +#: ../../library/asyncio-eventloop.rst:1663 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." @@ -2556,7 +2627,7 @@ msgstr "" "Começa a aceitar conexões até que a corrotina seja cancelada. Cancelamento " "da task ``serve_forever`` causa o fechamento do servidor." -#: ../../library/asyncio-eventloop.rst:1656 +#: ../../library/asyncio-eventloop.rst:1667 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." @@ -2564,23 +2635,38 @@ msgstr "" "Este método pode ser chamado se o servidor já estiver aceitando conexões. " "Apenas uma task ``serve_forever`` pode existir para cada objeto *Server*." -#: ../../library/asyncio-eventloop.rst:1678 +#: ../../library/asyncio-eventloop.rst:1673 +msgid "" +"async def client_connected(reader, writer):\n" +" # Communicate with the client with\n" +" # reader/writer streams. For example:\n" +" await reader.readline()\n" +"\n" +"async def main(host, port):\n" +" srv = await asyncio.start_server(\n" +" client_connected, host, port)\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main('127.0.0.1', 0))" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1689 msgid "Return ``True`` if the server is accepting new connections." msgstr "Retorna ``True`` se o servidor estiver aceitando novas conexões." -#: ../../library/asyncio-eventloop.rst:1684 +#: ../../library/asyncio-eventloop.rst:1695 msgid "" "Wait until the :meth:`close` method completes and all active connections " "have finished." msgstr "" -#: ../../library/asyncio-eventloop.rst:1689 +#: ../../library/asyncio-eventloop.rst:1700 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1692 +#: ../../library/asyncio-eventloop.rst:1703 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." @@ -2589,11 +2675,11 @@ msgstr "" "interna de soquetes do server diretamente. No uma cópia dessa lista é " "retornada." -#: ../../library/asyncio-eventloop.rst:1702 +#: ../../library/asyncio-eventloop.rst:1713 msgid "Event Loop Implementations" msgstr "Implementações do Laço de Eventos" -#: ../../library/asyncio-eventloop.rst:1704 +#: ../../library/asyncio-eventloop.rst:1715 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." @@ -2601,19 +2687,17 @@ msgstr "" "asyncio vem com duas implementações de laço de eventos diferente: :class:" "`SelectorEventLoop` e :class:`ProactorEventLoop`." -#: ../../library/asyncio-eventloop.rst:1707 +#: ../../library/asyncio-eventloop.rst:1718 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -"Por padrão asyncio está configurado para usar :class:`SelectorEventLoop` no " -"Unix e :class:`ProactorEventLoop` no Windows." -#: ../../library/asyncio-eventloop.rst:1713 +#: ../../library/asyncio-eventloop.rst:1724 msgid "An event loop based on the :mod:`selectors` module." -msgstr "Um laço de eventos baseado no módulo :mod:`selectors`." +msgstr "" -#: ../../library/asyncio-eventloop.rst:1715 +#: ../../library/asyncio-eventloop.rst:1726 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " @@ -2624,19 +2708,31 @@ msgstr "" "ser utilizada::" #: ../../library/asyncio-eventloop.rst:1730 +msgid "" +"import asyncio\n" +"import selectors\n" +"\n" +"class MyPolicy(asyncio.DefaultEventLoopPolicy):\n" +" def new_event_loop(self):\n" +" selector = selectors.SelectSelector()\n" +" return asyncio.SelectorEventLoop(selector)\n" +"\n" +"asyncio.set_event_loop_policy(MyPolicy())" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1741 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`Disponibilidade`: Unix, Windows." -#: ../../library/asyncio-eventloop.rst:1735 +#: ../../library/asyncio-eventloop.rst:1746 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -"Um laço de eventos para Windows que usa \"Conclusão de Portas I/O\" (IOCP)." -#: ../../library/asyncio-eventloop.rst:1737 +#: ../../library/asyncio-eventloop.rst:1748 msgid ":ref:`Availability `: Windows." msgstr ":ref:`Disponibilidade `: Windows." -#: ../../library/asyncio-eventloop.rst:1741 +#: ../../library/asyncio-eventloop.rst:1752 msgid "" "`MSDN documentation on I/O Completion Ports `_." @@ -2644,21 +2740,21 @@ msgstr "" "`Documentação da MSDN sobre conclusão de portas I/O `_." -#: ../../library/asyncio-eventloop.rst:1747 +#: ../../library/asyncio-eventloop.rst:1758 msgid "Abstract base class for asyncio-compliant event loops." msgstr "Classe base abstrata para laços de eventos compatíveis com asyncio." -#: ../../library/asyncio-eventloop.rst:1749 +#: ../../library/asyncio-eventloop.rst:1760 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1755 +#: ../../library/asyncio-eventloop.rst:1766 msgid "Examples" msgstr "Exemplos" -#: ../../library/asyncio-eventloop.rst:1757 +#: ../../library/asyncio-eventloop.rst:1768 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2671,11 +2767,11 @@ msgstr "" "precisam ser escritas desta forma; considere usar as funções de alto nível " "como :func:`asyncio.run`." -#: ../../library/asyncio-eventloop.rst:1767 +#: ../../library/asyncio-eventloop.rst:1778 msgid "Hello World with call_soon()" msgstr "Hello World com call_soon()" -#: ../../library/asyncio-eventloop.rst:1769 +#: ../../library/asyncio-eventloop.rst:1780 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" @@ -2684,7 +2780,28 @@ msgstr "" "retorno. A função de retorno exibe ``\"Hello World\"`` e então para o laço " "de eventos::" -#: ../../library/asyncio-eventloop.rst:1793 +#: ../../library/asyncio-eventloop.rst:1784 +msgid "" +"import asyncio\n" +"\n" +"def hello_world(loop):\n" +" \"\"\"A callback to print 'Hello World' and stop the event loop\"\"\"\n" +" print('Hello World')\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# Schedule a call to hello_world()\n" +"loop.call_soon(hello_world, loop)\n" +"\n" +"# Blocking call interrupted by loop.stop()\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1804 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." @@ -2692,11 +2809,11 @@ msgstr "" "Um exemplo similar a :ref:`Hello World ` criado com uma corrotina " "e a função :func:`run`." -#: ../../library/asyncio-eventloop.rst:1800 +#: ../../library/asyncio-eventloop.rst:1811 msgid "Display the current date with call_later()" msgstr "Exibe a data atual com call_later()" -#: ../../library/asyncio-eventloop.rst:1802 +#: ../../library/asyncio-eventloop.rst:1813 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " @@ -2706,7 +2823,32 @@ msgstr "" "função de retorno usa o método :meth:`loop.call_later` para reagendar a si " "mesma depois de 5 segundos, e então para o laço de eventos::" -#: ../../library/asyncio-eventloop.rst:1830 +#: ../../library/asyncio-eventloop.rst:1817 +msgid "" +"import asyncio\n" +"import datetime\n" +"\n" +"def display_date(end_time, loop):\n" +" print(datetime.datetime.now())\n" +" if (loop.time() + 1.0) < end_time:\n" +" loop.call_later(1, display_date, end_time, loop)\n" +" else:\n" +" loop.stop()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"# Schedule the first call to display_date()\n" +"end_time = loop.time() + 5.0\n" +"loop.call_soon(display_date, end_time, loop)\n" +"\n" +"# Blocking call interrupted by loop.stop()\n" +"try:\n" +" loop.run_forever()\n" +"finally:\n" +" loop.close()" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1841 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." @@ -2714,11 +2856,11 @@ msgstr "" "Um exemplo similar a :ref:`data atual ` criado com " "uma corrotina e a função :func:`run`." -#: ../../library/asyncio-eventloop.rst:1837 +#: ../../library/asyncio-eventloop.rst:1848 msgid "Watch a file descriptor for read events" msgstr "Observa um descritor de arquivo por eventos de leitura" -#: ../../library/asyncio-eventloop.rst:1839 +#: ../../library/asyncio-eventloop.rst:1850 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" @@ -2726,7 +2868,43 @@ msgstr "" "Aguarda até que um descritor de arquivo tenha recebido alguns dados usando o " "método :meth:`loop.add_reader` e então fecha o laço de eventos::" -#: ../../library/asyncio-eventloop.rst:1877 +#: ../../library/asyncio-eventloop.rst:1853 +msgid "" +"import asyncio\n" +"from socket import socketpair\n" +"\n" +"# Create a pair of connected file descriptors\n" +"rsock, wsock = socketpair()\n" +"\n" +"loop = asyncio.new_event_loop()\n" +"\n" +"def reader():\n" +" data = rsock.recv(100)\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # We are done: unregister the file descriptor\n" +" loop.remove_reader(rsock)\n" +"\n" +" # Stop the event loop\n" +" loop.stop()\n" +"\n" +"# Register the file descriptor for read event\n" +"loop.add_reader(rsock, reader)\n" +"\n" +"# Simulate the reception of data from the network\n" +"loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +"try:\n" +" # Run the event loop\n" +" loop.run_forever()\n" +"finally:\n" +" # We are done. Close sockets and the event loop.\n" +" rsock.close()\n" +" wsock.close()\n" +" loop.close()" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1888 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." @@ -2734,7 +2912,7 @@ msgstr "" "Um :ref:`exemplo ` similar usando " "transportes, protocolos, e o método :meth:`loop.create_connection`." -#: ../../library/asyncio-eventloop.rst:1881 +#: ../../library/asyncio-eventloop.rst:1892 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." @@ -2742,16 +2920,43 @@ msgstr "" "Outro :ref:`exemplo ` similar " "usando a função de alto nível :func:`asyncio.open_connection` e streams." -#: ../../library/asyncio-eventloop.rst:1889 +#: ../../library/asyncio-eventloop.rst:1900 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "Define tratadores de sinais para SIGINT e SIGTERM" -#: ../../library/asyncio-eventloop.rst:1891 +#: ../../library/asyncio-eventloop.rst:1902 msgid "(This ``signals`` example only works on Unix.)" msgstr "(Este exemplo de ``signals`` apenas funciona no Unix.)" -#: ../../library/asyncio-eventloop.rst:1893 +#: ../../library/asyncio-eventloop.rst:1904 msgid "" "Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." "SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" + +#: ../../library/asyncio-eventloop.rst:1907 +msgid "" +"import asyncio\n" +"import functools\n" +"import os\n" +"import signal\n" +"\n" +"def ask_exit(signame, loop):\n" +" print(\"got signal %s: exit\" % signame)\n" +" loop.stop()\n" +"\n" +"async def main():\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" for signame in {'SIGINT', 'SIGTERM'}:\n" +" loop.add_signal_handler(\n" +" getattr(signal, signame),\n" +" functools.partial(ask_exit, signame, loop))\n" +"\n" +" await asyncio.sleep(3600)\n" +"\n" +"print(\"Event loop running for 1 hour, press Ctrl+C to interrupt.\")\n" +"print(f\"pid {os.getpid()}: send SIGINT or SIGTERM to exit.\")\n" +"\n" +"asyncio.run(main())" +msgstr "" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index d03298bdb..d2b07fef8 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Leticia Portella , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index 84fb9553b..83bb02090 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rodrigo Vitorino, 2022 -# Juliana Barros Lima, 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: Juliana Barros Lima, 2022\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 1267ce881..af212a876 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Sheila Gomes , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Adorilson Bezerra , 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -193,7 +190,7 @@ msgstr "" #: ../../library/asyncio-future.rst:122 msgid "" -"If the Future's result isn't yet available, this method raises a :exc:" +"If the Future's result isn't yet available, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" @@ -203,7 +200,7 @@ msgstr "" #: ../../library/asyncio-future.rst:129 ../../library/asyncio-future.rst:136 msgid "" -"Raises a :exc:`InvalidStateError` error if the Future is already *done*." +"Raises an :exc:`InvalidStateError` error if the Future is already *done*." msgstr "" #: ../../library/asyncio-future.rst:134 @@ -230,6 +227,12 @@ msgid "" "setting a result or an exception for it::" msgstr "" +#: ../../library/asyncio-future.rst:154 +msgid "" +"if not fut.cancelled():\n" +" fut.set_result(42)" +msgstr "" + #: ../../library/asyncio-future.rst:159 msgid "Add a callback to be run when the Future is *done*." msgstr "" @@ -260,6 +263,13 @@ msgid "" "g.::" msgstr "" +#: ../../library/asyncio-future.rst:174 +msgid "" +"# Call 'print(\"Future:\", fut)' when \"fut\" is done.\n" +"fut.add_done_callback(\n" +" functools.partial(print, \"Future:\"))" +msgstr "" + #: ../../library/asyncio-future.rst:178 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " @@ -319,6 +329,37 @@ msgid "" "Task to set result for the Future, and waits until the Future has a result::" msgstr "" +#: ../../library/asyncio-future.rst:226 +msgid "" +"async def set_after(fut, delay, value):\n" +" # Sleep for *delay* seconds.\n" +" await asyncio.sleep(delay)\n" +"\n" +" # Set *value* as a result of *fut* Future.\n" +" fut.set_result(value)\n" +"\n" +"async def main():\n" +" # Get the current event loop.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # Create a new Future object.\n" +" fut = loop.create_future()\n" +"\n" +" # Run \"set_after()\" coroutine in a parallel Task.\n" +" # We are using the low-level \"loop.create_task()\" API here because\n" +" # we already have a reference to the event loop at hand.\n" +" # Otherwise we could have just used \"asyncio.create_task()\".\n" +" loop.create_task(\n" +" set_after(fut, 1, '... world'))\n" +"\n" +" print('hello ...')\n" +"\n" +" # Wait until *fut* has a result (1 second) and print it.\n" +" print(await fut)\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-future.rst:257 msgid "" "The Future object was designed to mimic :class:`concurrent.futures.Future`. " diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 3d93b2db3..708cd5459 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# msilvavieira, 2021 -# i17obot , 2021 -# Marco Rougeth , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Adorilson Bezerra , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-05 14:16+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 1842cb6e9..4eaf56422 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# felipe caridade fernandes , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -160,3 +158,13 @@ msgid "" "class:`~selectors.SelectSelector` or :class:`~selectors.PollSelector` to " "support character devices on these older versions of macOS. Example::" msgstr "" + +#: ../../library/asyncio-platforms.rst:100 +msgid "" +"import asyncio\n" +"import selectors\n" +"\n" +"selector = selectors.SelectSelector()\n" +"loop = asyncio.SelectorEventLoop(selector)\n" +"asyncio.set_event_loop(loop)" +msgstr "" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 256f29995..bb324e5ed 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Sheila Gomes , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Rafael Fontenelle , 2021 -# Adorilson Bezerra , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Adorilson Bezerra , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -398,3 +394,19 @@ msgid "" "`DefaultEventLoopPolicy` and override the methods for which custom behavior " "is wanted, e.g.::" msgstr "" + +#: ../../library/asyncio-policy.rst:317 +msgid "" +"class MyEventLoopPolicy(asyncio.DefaultEventLoopPolicy):\n" +"\n" +" def get_event_loop(self):\n" +" \"\"\"Get the event loop.\n" +"\n" +" This may be None or an instance of EventLoop.\n" +" \"\"\"\n" +" loop = super().get_event_loop()\n" +" # Do something with loop ...\n" +" return loop\n" +"\n" +"asyncio.set_event_loop_policy(MyEventLoopPolicy())" +msgstr "" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index e26010977..ba5e12593 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Humberto Rocha , 2021 -# Ruan Aragão , 2021 -# i17obot , 2021 -# Vinicius Gubiani Ferreira , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-16 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Vinicius Gubiani Ferreira , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -271,6 +266,13 @@ msgid "" "of the transport::" msgstr "" +#: ../../library/asyncio-protocol.rst:182 +msgid "" +"sock = transport.get_extra_info('socket')\n" +"if sock is not None:\n" +" print(sock.getsockopt(...))" +msgstr "" + #: ../../library/asyncio-protocol.rst:186 msgid "Categories of information that can be queried on some transports:" msgstr "" @@ -794,6 +796,14 @@ msgstr "" msgid "State machine:" msgstr "" +#: ../../library/asyncio-protocol.rst:580 +msgid "" +"start -> connection_made\n" +" [-> data_received]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" +msgstr "" + #: ../../library/asyncio-protocol.rst:589 msgid "Buffered Streaming Protocols" msgstr "Protocolos de Streaming Bufferizados" @@ -860,6 +870,16 @@ msgid "" "won't be called after it." msgstr "" +#: ../../library/asyncio-protocol.rst:638 +msgid "" +"start -> connection_made\n" +" [-> get_buffer\n" +" [-> buffer_updated]?\n" +" ]*\n" +" [-> eof_received]?\n" +"-> connection_lost -> end" +msgstr "" + #: ../../library/asyncio-protocol.rst:649 msgid "Datagram Protocols" msgstr "Protocolos de Datagramas" @@ -964,6 +984,44 @@ msgid "" "back received data, and close the connection::" msgstr "" +#: ../../library/asyncio-protocol.rst:726 +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol(asyncio.Protocol):\n" +" def connection_made(self, transport):\n" +" peername = transport.get_extra_info('peername')\n" +" print('Connection from {}'.format(peername))\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" message = data.decode()\n" +" print('Data received: {!r}'.format(message))\n" +"\n" +" print('Send: {!r}'.format(message))\n" +" self.transport.write(data)\n" +"\n" +" print('Close the client socket')\n" +" self.transport.close()\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" server = await loop.create_server(\n" +" lambda: EchoServerProtocol(),\n" +" '127.0.0.1', 8888)\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-protocol.rst:764 msgid "" "The :ref:`TCP echo server using streams ` " @@ -980,6 +1038,51 @@ msgid "" "data, and waits until the connection is closed::" msgstr "" +#: ../../library/asyncio-protocol.rst:775 +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol(asyncio.Protocol):\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" transport.write(self.message.encode())\n" +" print('Data sent: {!r}'.format(self.message))\n" +"\n" +" def data_received(self, data):\n" +" print('Data received: {!r}'.format(data.decode()))\n" +"\n" +" def connection_lost(self, exc):\n" +" print('The server closed the connection')\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = 'Hello World!'\n" +"\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" '127.0.0.1', 8888)\n" +"\n" +" # Wait until the protocol signals that the connection\n" +" # is lost and close the transport.\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-protocol.rst:820 msgid "" "The :ref:`TCP echo client using streams ` " @@ -996,6 +1099,44 @@ msgid "" "sends back received data::" msgstr "" +#: ../../library/asyncio-protocol.rst:832 +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoServerProtocol:\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def datagram_received(self, data, addr):\n" +" message = data.decode()\n" +" print('Received %r from %s' % (message, addr))\n" +" print('Send %r to %s' % (message, addr))\n" +" self.transport.sendto(data, addr)\n" +"\n" +"\n" +"async def main():\n" +" print(\"Starting UDP server\")\n" +"\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # One protocol instance will be created to serve all\n" +" # client requests.\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" lambda: EchoServerProtocol(),\n" +" local_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await asyncio.sleep(3600) # Serve for 1 hour.\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-protocol.rst:871 msgid "UDP Echo Client" msgstr "" @@ -1006,6 +1147,57 @@ msgid "" "sends data and closes the transport when it receives the answer::" msgstr "" +#: ../../library/asyncio-protocol.rst:876 +msgid "" +"import asyncio\n" +"\n" +"\n" +"class EchoClientProtocol:\n" +" def __init__(self, message, on_con_lost):\n" +" self.message = message\n" +" self.on_con_lost = on_con_lost\n" +" self.transport = None\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +" print('Send:', self.message)\n" +" self.transport.sendto(self.message.encode())\n" +"\n" +" def datagram_received(self, data, addr):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" print(\"Close the socket\")\n" +" self.transport.close()\n" +"\n" +" def error_received(self, exc):\n" +" print('Error received:', exc)\n" +"\n" +" def connection_lost(self, exc):\n" +" print(\"Connection closed\")\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" on_con_lost = loop.create_future()\n" +" message = \"Hello World!\"\n" +"\n" +" transport, protocol = await loop.create_datagram_endpoint(\n" +" lambda: EchoClientProtocol(message, on_con_lost),\n" +" remote_addr=('127.0.0.1', 9999))\n" +"\n" +" try:\n" +" await on_con_lost\n" +" finally:\n" +" transport.close()\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-protocol.rst:928 msgid "Connecting Existing Sockets" msgstr "" @@ -1016,6 +1208,58 @@ msgid "" "method with a protocol::" msgstr "" +#: ../../library/asyncio-protocol.rst:933 +msgid "" +"import asyncio\n" +"import socket\n" +"\n" +"\n" +"class MyProtocol(asyncio.Protocol):\n" +"\n" +" def __init__(self, on_con_lost):\n" +" self.transport = None\n" +" self.on_con_lost = on_con_lost\n" +"\n" +" def connection_made(self, transport):\n" +" self.transport = transport\n" +"\n" +" def data_received(self, data):\n" +" print(\"Received:\", data.decode())\n" +"\n" +" # We are done: close the transport;\n" +" # connection_lost() will be called automatically.\n" +" self.transport.close()\n" +"\n" +" def connection_lost(self, exc):\n" +" # The socket has been closed\n" +" self.on_con_lost.set_result(True)\n" +"\n" +"\n" +"async def main():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +" on_con_lost = loop.create_future()\n" +"\n" +" # Create a pair of connected sockets\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # Register the socket to wait for data.\n" +" transport, protocol = await loop.create_connection(\n" +" lambda: MyProtocol(on_con_lost), sock=rsock)\n" +"\n" +" # Simulate the reception of data from the network.\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" try:\n" +" await protocol.on_con_lost\n" +" finally:\n" +" transport.close()\n" +" wsock.close()\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-protocol.rst:984 msgid "" "The :ref:`watch a file descriptor for read events " @@ -1044,6 +1288,67 @@ msgstr "" msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" msgstr "" +#: ../../library/asyncio-protocol.rst:1002 +msgid "" +"import asyncio\n" +"import sys\n" +"\n" +"class DateProtocol(asyncio.SubprocessProtocol):\n" +" def __init__(self, exit_future):\n" +" self.exit_future = exit_future\n" +" self.output = bytearray()\n" +" self.pipe_closed = False\n" +" self.exited = False\n" +"\n" +" def pipe_connection_lost(self, fd, exc):\n" +" self.pipe_closed = True\n" +" self.check_for_exit()\n" +"\n" +" def pipe_data_received(self, fd, data):\n" +" self.output.extend(data)\n" +"\n" +" def process_exited(self):\n" +" self.exited = True\n" +" # process_exited() method can be called before\n" +" # pipe_connection_lost() method: wait until both methods are\n" +" # called.\n" +" self.check_for_exit()\n" +"\n" +" def check_for_exit(self):\n" +" if self.pipe_closed and self.exited:\n" +" self.exit_future.set_result(True)\n" +"\n" +"async def get_date():\n" +" # Get a reference to the event loop as we plan to use\n" +" # low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" code = 'import datetime; print(datetime.datetime.now())'\n" +" exit_future = asyncio.Future(loop=loop)\n" +"\n" +" # Create the subprocess controlled by DateProtocol;\n" +" # redirect the standard output into a pipe.\n" +" transport, protocol = await loop.subprocess_exec(\n" +" lambda: DateProtocol(exit_future),\n" +" sys.executable, '-c', code,\n" +" stdin=None, stderr=None)\n" +"\n" +" # Wait for the subprocess exit using the process_exited()\n" +" # method of the protocol.\n" +" await exit_future\n" +"\n" +" # Close the stdout pipe.\n" +" transport.close()\n" +"\n" +" # Read the output which was collected by the\n" +" # pipe_data_received() method of the protocol.\n" +" data = bytes(protocol.output)\n" +" return data.decode('ascii').rstrip()\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" +msgstr "" + #: ../../library/asyncio-protocol.rst:1060 msgid "" "See also the :ref:`same example ` " diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 77dc39ba4..cf39e37eb 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Leticia Portella , 2021 -# Vinicius Gubiani Ferreira , 2021 -# Adorilson Bezerra , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Adorilson Bezerra , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -264,3 +259,60 @@ msgid "" msgstr "" "Filas podem ser usadas para distribuir cargas de trabalho entre diversas " "tarefas concorrentes::" + +#: ../../library/asyncio-queue.rst:156 +msgid "" +"import asyncio\n" +"import random\n" +"import time\n" +"\n" +"\n" +"async def worker(name, queue):\n" +" while True:\n" +" # Get a \"work item\" out of the queue.\n" +" sleep_for = await queue.get()\n" +"\n" +" # Sleep for the \"sleep_for\" seconds.\n" +" await asyncio.sleep(sleep_for)\n" +"\n" +" # Notify the queue that the \"work item\" has been processed.\n" +" queue.task_done()\n" +"\n" +" print(f'{name} has slept for {sleep_for:.2f} seconds')\n" +"\n" +"\n" +"async def main():\n" +" # Create a queue that we will use to store our \"workload\".\n" +" queue = asyncio.Queue()\n" +"\n" +" # Generate random timings and put them into the queue.\n" +" total_sleep_time = 0\n" +" for _ in range(20):\n" +" sleep_for = random.uniform(0.05, 1.0)\n" +" total_sleep_time += sleep_for\n" +" queue.put_nowait(sleep_for)\n" +"\n" +" # Create three worker tasks to process the queue concurrently.\n" +" tasks = []\n" +" for i in range(3):\n" +" task = asyncio.create_task(worker(f'worker-{i}', queue))\n" +" tasks.append(task)\n" +"\n" +" # Wait until the queue is fully processed.\n" +" started_at = time.monotonic()\n" +" await queue.join()\n" +" total_slept_for = time.monotonic() - started_at\n" +"\n" +" # Cancel our worker tasks.\n" +" for task in tasks:\n" +" task.cancel()\n" +" # Wait until all worker tasks are cancelled.\n" +" await asyncio.gather(*tasks, return_exceptions=True)\n" +"\n" +" print('====')\n" +" print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')\n" +" print(f'total expected sleep time: {total_sleep_time:.2f} seconds')\n" +"\n" +"\n" +"asyncio.run(main())" +msgstr "" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 57dc8791a..29828816e 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Vinicius Gubiani Ferreira , 2022 -# Italo Penaforte , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: Italo Penaforte , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -92,6 +91,15 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../library/asyncio-runner.rst:52 +msgid "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-runner.rst:60 msgid "Updated to use :meth:`loop.shutdown_default_executor`." msgstr "Atualizado para usar :meth:`loop.shutdown_default_executor`." @@ -131,10 +139,20 @@ msgstr "" #: ../../library/asyncio-runner.rst:92 msgid "" -"Basically, :func:`asyncio.run()` example can be rewritten with the runner " +"Basically, :func:`asyncio.run` example can be rewritten with the runner " "usage::" msgstr "" +#: ../../library/asyncio-runner.rst:94 +msgid "" +"async def main():\n" +" await asyncio.sleep(1)\n" +" print('hello')\n" +"\n" +"with asyncio.Runner() as runner:\n" +" runner.run(main())" +msgstr "" + #: ../../library/asyncio-runner.rst:105 msgid "Run a :term:`coroutine ` *coro* in the embedded loop." msgstr "" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 6937a2c5e..17357963d 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -4,11 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Cássio Nomura , 2021 -# i17obot , 2021 -# Adorilson Bezerra , 2022 -# Vinicius Gubiani Ferreira , 2022 # Rafael Fontenelle , 2024 # #, fuzzy @@ -16,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-26 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -52,6 +47,28 @@ msgstr "" "Aqui está um exemplo de um cliente TCP realizando eco, escrito usando " "streams asyncio::" +#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:404 +msgid "" +"import asyncio\n" +"\n" +"async def tcp_echo_client(message):\n" +" reader, writer = await asyncio.open_connection(\n" +" '127.0.0.1', 8888)\n" +"\n" +" print(f'Send: {message!r}')\n" +" writer.write(message.encode())\n" +" await writer.drain()\n" +"\n" +" data = await reader.read(100)\n" +" print(f'Received: {data.decode()!r}')\n" +"\n" +" print('Close the connection')\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"asyncio.run(tcp_echo_client('Hello World!'))" +msgstr "" + #: ../../library/asyncio-stream.rst:42 msgid "See also the `Examples`_ section below." msgstr "Veja também a seção `Exemplos`_ abaixo." @@ -370,6 +387,12 @@ msgstr "" msgid "The method should be used along with the ``drain()`` method::" msgstr "O método deve ser usado juntamente com o método ``drain()``::" +#: ../../library/asyncio-stream.rst:291 +msgid "" +"stream.write(data)\n" +"await stream.drain()" +msgstr "" + #: ../../library/asyncio-stream.rst:296 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " @@ -380,6 +403,12 @@ msgstr "" "o soquete subjacente. Se isso falhar, os dados são enfileirados em um buffer " "de escrita interno até que possam ser enviados." +#: ../../library/asyncio-stream.rst:303 +msgid "" +"stream.writelines(lines)\n" +"await stream.drain()" +msgstr "" + #: ../../library/asyncio-stream.rst:308 msgid "The method closes the stream and the underlying socket." msgstr "O método fecha o stream e o soquete subjacente." @@ -390,6 +419,12 @@ msgid "" "``wait_closed()`` method::" msgstr "" +#: ../../library/asyncio-stream.rst:313 +msgid "" +"stream.close()\n" +"await stream.wait_closed()" +msgstr "" + #: ../../library/asyncio-stream.rst:318 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " @@ -422,6 +457,12 @@ msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" "Aguarda até que seja apropriado continuar escrevendo no stream. Exemplo::" +#: ../../library/asyncio-stream.rst:340 +msgid "" +"writer.write(data)\n" +"await writer.drain()" +msgstr "" + #: ../../library/asyncio-stream.rst:343 msgid "" "This is a flow control method that interacts with the underlying IO write " @@ -517,6 +558,38 @@ msgstr "Servidor eco TCP usando streams" msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "Servidor eco TCP usando a função :func:`asyncio.start_server`::" +#: ../../library/asyncio-stream.rst:437 +msgid "" +"import asyncio\n" +"\n" +"async def handle_echo(reader, writer):\n" +" data = await reader.read(100)\n" +" message = data.decode()\n" +" addr = writer.get_extra_info('peername')\n" +"\n" +" print(f\"Received {message!r} from {addr!r}\")\n" +"\n" +" print(f\"Send: {message!r}\")\n" +" writer.write(data)\n" +" await writer.drain()\n" +"\n" +" print(\"Close the connection\")\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"async def main():\n" +" server = await asyncio.start_server(\n" +" handle_echo, '127.0.0.1', 8888)\n" +"\n" +" addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets)\n" +" print(f'Serving on {addrs}')\n" +"\n" +" async with server:\n" +" await server.serve_forever()\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-stream.rst:469 msgid "" "The :ref:`TCP echo server protocol " @@ -538,14 +611,61 @@ msgstr "" "Exemplo simples consultando cabeçalhos HTTP da URL passada na linha de " "comando::" +#: ../../library/asyncio-stream.rst:478 +msgid "" +"import asyncio\n" +"import urllib.parse\n" +"import sys\n" +"\n" +"async def print_http_headers(url):\n" +" url = urllib.parse.urlsplit(url)\n" +" if url.scheme == 'https':\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 443, ssl=True)\n" +" else:\n" +" reader, writer = await asyncio.open_connection(\n" +" url.hostname, 80)\n" +"\n" +" query = (\n" +" f\"HEAD {url.path or '/'} HTTP/1.0\\r\\n\"\n" +" f\"Host: {url.hostname}\\r\\n\"\n" +" f\"\\r\\n\"\n" +" )\n" +"\n" +" writer.write(query.encode('latin-1'))\n" +" while True:\n" +" line = await reader.readline()\n" +" if not line:\n" +" break\n" +"\n" +" line = line.decode('latin1').rstrip()\n" +" if line:\n" +" print(f'HTTP header> {line}')\n" +"\n" +" # Ignore the body, close the socket\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +"url = sys.argv[1]\n" +"asyncio.run(print_http_headers(url))" +msgstr "" + #: ../../library/asyncio-stream.rst:515 msgid "Usage::" msgstr "Uso::" +#: ../../library/asyncio-stream.rst:517 +msgid "python example.py http://example.com/path/page.html" +msgstr "" + #: ../../library/asyncio-stream.rst:519 msgid "or with HTTPS::" msgstr "ou com HTTPS::" +#: ../../library/asyncio-stream.rst:521 +msgid "python example.py https://example.com/path/page.html" +msgstr "" + #: ../../library/asyncio-stream.rst:527 msgid "Register an open socket to wait for data using streams" msgstr "Registra um soquete aberto para aguardar por dados usando streams" @@ -558,6 +678,39 @@ msgstr "" "Corrotina aguardando até que um soquete receba dados usando a função :func:" "`open_connection`::" +#: ../../library/asyncio-stream.rst:532 +msgid "" +"import asyncio\n" +"import socket\n" +"\n" +"async def wait_for_data():\n" +" # Get a reference to the current event loop because\n" +" # we want to access low-level APIs.\n" +" loop = asyncio.get_running_loop()\n" +"\n" +" # Create a pair of connected sockets.\n" +" rsock, wsock = socket.socketpair()\n" +"\n" +" # Register the open socket to wait for data.\n" +" reader, writer = await asyncio.open_connection(sock=rsock)\n" +"\n" +" # Simulate the reception of data from the network\n" +" loop.call_soon(wsock.send, 'abc'.encode())\n" +"\n" +" # Wait for data\n" +" data = await reader.read(100)\n" +"\n" +" # Got data, we are done: close the socket\n" +" print(\"Received:\", data.decode())\n" +" writer.close()\n" +" await writer.wait_closed()\n" +"\n" +" # Close the second socket\n" +" wsock.close()\n" +"\n" +"asyncio.run(wait_for_data())" +msgstr "" + #: ../../library/asyncio-stream.rst:564 msgid "" "The :ref:`register an open socket to wait for data using a protocol " diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index 8c4b268cd..1521d6e85 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Vinicius Gubiani Ferreira , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-29 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -56,10 +51,38 @@ msgstr "" "Aqui está um exemplo de como asyncio pode executar um comando shell e obter " "o seu resultado::" +#: ../../library/asyncio-subprocess.rst:22 +msgid "" +"import asyncio\n" +"\n" +"async def run(cmd):\n" +" proc = await asyncio.create_subprocess_shell(\n" +" cmd,\n" +" stdout=asyncio.subprocess.PIPE,\n" +" stderr=asyncio.subprocess.PIPE)\n" +"\n" +" stdout, stderr = await proc.communicate()\n" +"\n" +" print(f'[{cmd!r} exited with {proc.returncode}]')\n" +" if stdout:\n" +" print(f'[stdout]\\n{stdout.decode()}')\n" +" if stderr:\n" +" print(f'[stderr]\\n{stderr.decode()}')\n" +"\n" +"asyncio.run(run('ls /zzz'))" +msgstr "" + #: ../../library/asyncio-subprocess.rst:40 msgid "will print::" msgstr "irá exibir::" +#: ../../library/asyncio-subprocess.rst:42 +msgid "" +"['ls /zzz' exited with 1]\n" +"[stderr]\n" +"ls: /zzz: No such file or directory" +msgstr "" + #: ../../library/asyncio-subprocess.rst:46 msgid "" "Because all asyncio subprocess functions are asynchronous and asyncio " @@ -73,6 +96,16 @@ msgstr "" "trivial modificar o exemplo acima para executar diversos comandos " "simultaneamente::" +#: ../../library/asyncio-subprocess.rst:51 +msgid "" +"async def main():\n" +" await asyncio.gather(\n" +" run('ls /zzz'),\n" +" run('sleep 1; echo \"hello\"'))\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-subprocess.rst:58 msgid "See also the `Examples`_ subsection." msgstr "Veja também a subseção `Exemplos`_." @@ -572,6 +605,32 @@ msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "O subprocesso é criado pela função :func:`create_subprocess_exec`::" +#: ../../library/asyncio-subprocess.rst:352 +msgid "" +"import asyncio\n" +"import sys\n" +"\n" +"async def get_date():\n" +" code = 'import datetime; print(datetime.datetime.now())'\n" +"\n" +" # Create the subprocess; redirect the standard output\n" +" # into a pipe.\n" +" proc = await asyncio.create_subprocess_exec(\n" +" sys.executable, '-c', code,\n" +" stdout=asyncio.subprocess.PIPE)\n" +"\n" +" # Read one line of output.\n" +" data = await proc.stdout.readline()\n" +" line = data.decode('ascii').rstrip()\n" +"\n" +" # Wait for the subprocess exit.\n" +" await proc.wait()\n" +" return line\n" +"\n" +"date = asyncio.run(get_date())\n" +"print(f\"Current date: {date}\")" +msgstr "" + #: ../../library/asyncio-subprocess.rst:376 msgid "" "See also the :ref:`same example ` written " diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index c52877c4a..524648ffb 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -4,11 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Italo Penaforte , 2021 -# i17obot , 2021 -# Adorilson Bezerra , 2022 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -16,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-04 01:27+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -101,11 +96,32 @@ msgstr "" msgid "The preferred way to use a Lock is an :keyword:`async with` statement::" msgstr "" +#: ../../library/asyncio-sync.rst:50 +msgid "" +"lock = asyncio.Lock()\n" +"\n" +"# ... later\n" +"async with lock:\n" +" # access shared state" +msgstr "" + #: ../../library/asyncio-sync.rst:56 ../../library/asyncio-sync.rst:199 #: ../../library/asyncio-sync.rst:298 msgid "which is equivalent to::" msgstr "" +#: ../../library/asyncio-sync.rst:58 +msgid "" +"lock = asyncio.Lock()\n" +"\n" +"# ... later\n" +"await lock.acquire()\n" +"try:\n" +" # access shared state\n" +"finally:\n" +" lock.release()" +msgstr "" + #: ../../library/asyncio-sync.rst:67 ../../library/asyncio-sync.rst:112 #: ../../library/asyncio-sync.rst:187 ../../library/asyncio-sync.rst:286 #: ../../library/asyncio-sync.rst:341 @@ -176,6 +192,30 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../library/asyncio-sync.rst:119 +msgid "" +"async def waiter(event):\n" +" print('waiting for it ...')\n" +" await event.wait()\n" +" print('... got it!')\n" +"\n" +"async def main():\n" +" # Create an Event object.\n" +" event = asyncio.Event()\n" +"\n" +" # Spawn a Task to wait until 'event' is set.\n" +" waiter_task = asyncio.create_task(waiter(event))\n" +"\n" +" # Sleep for 1 second and set the event.\n" +" await asyncio.sleep(1)\n" +" event.set()\n" +"\n" +" # Wait until the waiter task is finished.\n" +" await waiter_task\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-sync.rst:142 msgid "Wait until the event is set." msgstr "" @@ -242,6 +282,27 @@ msgid "" "The preferred way to use a Condition is an :keyword:`async with` statement::" msgstr "" +#: ../../library/asyncio-sync.rst:193 +msgid "" +"cond = asyncio.Condition()\n" +"\n" +"# ... later\n" +"async with cond:\n" +" await cond.wait()" +msgstr "" + +#: ../../library/asyncio-sync.rst:201 +msgid "" +"cond = asyncio.Condition()\n" +"\n" +"# ... later\n" +"await cond.acquire()\n" +"try:\n" +" await cond.wait()\n" +"finally:\n" +" cond.release()" +msgstr "" + #: ../../library/asyncio-sync.rst:212 msgid "Acquire the underlying lock." msgstr "" @@ -340,6 +401,27 @@ msgid "" "The preferred way to use a Semaphore is an :keyword:`async with` statement::" msgstr "" +#: ../../library/asyncio-sync.rst:292 +msgid "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... later\n" +"async with sem:\n" +" # work with shared resource" +msgstr "" + +#: ../../library/asyncio-sync.rst:300 +msgid "" +"sem = asyncio.Semaphore(10)\n" +"\n" +"# ... later\n" +"await sem.acquire()\n" +"try:\n" +" # work with shared resource\n" +"finally:\n" +" sem.release()" +msgstr "" + #: ../../library/asyncio-sync.rst:311 msgid "Acquire a semaphore." msgstr "" @@ -409,10 +491,42 @@ msgstr "" msgid "The barrier can be reused any number of times." msgstr "" +#: ../../library/asyncio-sync.rst:367 +msgid "" +"async def example_barrier():\n" +" # barrier with 3 parties\n" +" b = asyncio.Barrier(3)\n" +"\n" +" # create 2 new waiting tasks\n" +" asyncio.create_task(b.wait())\n" +" asyncio.create_task(b.wait())\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +" # The third .wait() call passes the barrier\n" +" await b.wait()\n" +" print(b)\n" +" print(\"barrier passed\")\n" +"\n" +" await asyncio.sleep(0)\n" +" print(b)\n" +"\n" +"asyncio.run(example_barrier())" +msgstr "" + #: ../../library/asyncio-sync.rst:388 msgid "Result of this example is::" msgstr "" +#: ../../library/asyncio-sync.rst:390 +msgid "" +"\n" +"\n" +"barrier passed\n" +"" +msgstr "" + #: ../../library/asyncio-sync.rst:399 msgid "" "Pass the barrier. When all the tasks party to the barrier have called this " @@ -433,6 +547,15 @@ msgid "" "housekeeping, e.g.::" msgstr "" +#: ../../library/asyncio-sync.rst:411 +msgid "" +"...\n" +"async with barrier as position:\n" +" if position == 0:\n" +" # Only one task prints this\n" +" print('End of *draining phase*')" +msgstr "" + #: ../../library/asyncio-sync.rst:417 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 53539b03c..3c40d201d 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Italo Penaforte , 2021 -# Danilo Lima , 2021 -# Adorilson Bezerra , 2022 -# Rafael Fontenelle , 2022 -# Vinicius Gubiani Ferreira , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Vinicius Gubiani Ferreira , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -60,6 +54,20 @@ msgstr "" "trecho de código imprime \"hello\", espera 1 segundo, e então imprime " "\"world\"::" +#: ../../library/asyncio-task.rst:30 +msgid "" +">>> import asyncio\n" +"\n" +">>> async def main():\n" +"... print('hello')\n" +"... await asyncio.sleep(1)\n" +"... print('world')\n" +"\n" +">>> asyncio.run(main())\n" +"hello\n" +"world" +msgstr "" + #: ../../library/asyncio-task.rst:41 msgid "" "Note that simply calling a coroutine will not schedule it to be executed::" @@ -67,6 +75,12 @@ msgstr "" "Perceba que simplesmente chamar uma corrotina não irá agendá-la para ser " "executada::" +#: ../../library/asyncio-task.rst:44 +msgid "" +">>> main()\n" +"" +msgstr "" + #: ../../library/asyncio-task.rst:47 msgid "To actually run a coroutine, asyncio provides the following mechanisms:" msgstr "" @@ -89,10 +103,38 @@ msgstr "" "esperar por 1 segundo e, em seguida, exibirá \"world\" após esperar por " "*outros* 2 segundos::" +#: ../../library/asyncio-task.rst:56 +msgid "" +"import asyncio\n" +"import time\n" +"\n" +"async def say_after(delay, what):\n" +" await asyncio.sleep(delay)\n" +" print(what)\n" +"\n" +"async def main():\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" await say_after(1, 'hello')\n" +" await say_after(2, 'world')\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-task.rst:73 msgid "Expected output::" msgstr "Resultado esperado::" +#: ../../library/asyncio-task.rst:75 +msgid "" +"started at 17:13:52\n" +"hello\n" +"world\n" +"finished at 17:13:55" +msgstr "" + #: ../../library/asyncio-task.rst:80 msgid "" "The :func:`asyncio.create_task` function to run coroutines concurrently as " @@ -109,6 +151,25 @@ msgstr "" "Vamos modificar o exemplo acima e executar duas corrotinas ``say_after`` " "*concorrentemente*::" +#: ../../library/asyncio-task.rst:86 +msgid "" +"async def main():\n" +" task1 = asyncio.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = asyncio.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # Wait until both tasks are completed (should take\n" +" # around 2 seconds.)\n" +" await task1\n" +" await task2\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" +msgstr "" + #: ../../library/asyncio-task.rst:102 msgid "" "Note that expected output now shows that the snippet runs 1 second faster " @@ -117,12 +178,37 @@ msgstr "" "Perceba que a saída esperada agora mostra que o trecho de código é executado " "1 segundo mais rápido do que antes::" +#: ../../library/asyncio-task.rst:105 +msgid "" +"started at 17:14:32\n" +"hello\n" +"world\n" +"finished at 17:14:34" +msgstr "" + #: ../../library/asyncio-task.rst:110 msgid "" "The :class:`asyncio.TaskGroup` class provides a more modern alternative to :" "func:`create_task`. Using this API, the last example becomes::" msgstr "" +#: ../../library/asyncio-task.rst:114 +msgid "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(\n" +" say_after(1, 'hello'))\n" +"\n" +" task2 = tg.create_task(\n" +" say_after(2, 'world'))\n" +"\n" +" print(f\"started at {time.strftime('%X')}\")\n" +"\n" +" # The await is implicit when the context manager exits.\n" +"\n" +" print(f\"finished at {time.strftime('%X')}\")" +msgstr "" + #: ../../library/asyncio-task.rst:128 msgid "The timing and output should be the same as for the previous version." msgstr "" @@ -161,6 +247,25 @@ msgstr "" "Corrotinas Python são *aguardáveis* e portanto podem ser aguardadas a partir " "de outras corrotinas::" +#: ../../library/asyncio-task.rst:152 +msgid "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # Nothing happens if we just call \"nested()\".\n" +" # A coroutine object is created but not awaited,\n" +" # so it *won't run at all*.\n" +" nested()\n" +"\n" +" # Let's do it differently now and await it:\n" +" print(await nested()) # will print \"42\".\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-task.rst:170 msgid "" "In this documentation the term \"coroutine\" can be used for two closely " @@ -197,6 +302,25 @@ msgstr "" "`asyncio.create_task`, a corrotina é automaticamente agendada para executar " "em breve::" +#: ../../library/asyncio-task.rst:187 +msgid "" +"import asyncio\n" +"\n" +"async def nested():\n" +" return 42\n" +"\n" +"async def main():\n" +" # Schedule nested() to run soon concurrently\n" +" # with \"main()\".\n" +" task = asyncio.create_task(nested())\n" +"\n" +" # \"task\" can now be used to cancel \"nested()\", or\n" +" # can simply be awaited to wait until it is complete:\n" +" await task\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio-task.rst:205 msgid "Futures" msgstr "Futuros" @@ -241,6 +365,18 @@ msgstr "" "Objetos Future, algumas vezes expostos por bibliotecas e algumas APIs " "asyncio, podem ser aguardados::" +#: ../../library/asyncio-task.rst:221 +msgid "" +"async def main():\n" +" await function_that_returns_a_future_object()\n" +"\n" +" # this is also valid:\n" +" await asyncio.gather(\n" +" function_that_returns_a_future_object(),\n" +" some_python_coroutine()\n" +" )" +msgstr "" + #: ../../library/asyncio-task.rst:230 msgid "" "A good example of a low-level function that returns a Future object is :meth:" @@ -310,6 +446,22 @@ msgstr "" "mesmo da função ser finalizada. Para tarefas de segundo plano \"atire-e-" "esqueça\", junte-as em uma coleção::" +#: ../../library/asyncio-task.rst:272 +msgid "" +"background_tasks = set()\n" +"\n" +"for i in range(10):\n" +" task = asyncio.create_task(some_coro(param=i))\n" +"\n" +" # Add task to the set. This creates a strong reference.\n" +" background_tasks.add(task)\n" +"\n" +" # To prevent keeping references to finished tasks forever,\n" +" # make each task remove its own reference from the set after\n" +" # completion:\n" +" task.add_done_callback(background_tasks.discard)" +msgstr "" + #: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1075 msgid "Added the *name* parameter." msgstr "Adicionado o parâmetro *name*." @@ -378,6 +530,16 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../library/asyncio-task.rst:340 +msgid "" +"async def main():\n" +" async with asyncio.TaskGroup() as tg:\n" +" task1 = tg.create_task(some_coro(...))\n" +" task2 = tg.create_task(another_coro(...))\n" +" print(f\"Both tasks have completed now: {task1.result()}, {task2." +"result()}\")" +msgstr "" + #: ../../library/asyncio-task.rst:346 msgid "" "The ``async with`` statement will wait for all tasks in the group to finish. " @@ -469,6 +631,23 @@ msgstr "" "Exemplo de uma corrotina exibindo a data atual a cada segundo durante 5 " "segundos::" +#: ../../library/asyncio-task.rst:411 +msgid "" +"import asyncio\n" +"import datetime\n" +"\n" +"async def display_date():\n" +" loop = asyncio.get_running_loop()\n" +" end_time = loop.time() + 5.0\n" +" while True:\n" +" print(datetime.datetime.now())\n" +" if (loop.time() + 1.0) >= end_time:\n" +" break\n" +" await asyncio.sleep(1)\n" +"\n" +"asyncio.run(display_date())" +msgstr "" + #: ../../library/asyncio-task.rst:426 ../../library/asyncio-task.rst:521 #: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:794 #: ../../library/asyncio-task.rst:848 ../../library/asyncio-task.rst:874 @@ -556,6 +735,45 @@ msgid "" "tasks)." msgstr "" +#: ../../library/asyncio-task.rst:474 +msgid "" +"import asyncio\n" +"\n" +"async def factorial(name, number):\n" +" f = 1\n" +" for i in range(2, number + 1):\n" +" print(f\"Task {name}: Compute factorial({number}), currently i={i}..." +"\")\n" +" await asyncio.sleep(1)\n" +" f *= i\n" +" print(f\"Task {name}: factorial({number}) = {f}\")\n" +" return f\n" +"\n" +"async def main():\n" +" # Schedule three calls *concurrently*:\n" +" L = await asyncio.gather(\n" +" factorial(\"A\", 2),\n" +" factorial(\"B\", 3),\n" +" factorial(\"C\", 4),\n" +" )\n" +" print(L)\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# Task A: Compute factorial(2), currently i=2...\n" +"# Task B: Compute factorial(3), currently i=2...\n" +"# Task C: Compute factorial(4), currently i=2...\n" +"# Task A: factorial(2) = 2\n" +"# Task B: Compute factorial(3), currently i=3...\n" +"# Task C: Compute factorial(4), currently i=3...\n" +"# Task B: factorial(3) = 6\n" +"# Task C: Compute factorial(4), currently i=4...\n" +"# Task C: factorial(4) = 24\n" +"# [2, 6, 24]" +msgstr "" + #: ../../library/asyncio-task.rst:510 msgid "" "If *return_exceptions* is false, cancelling gather() after it has been " @@ -658,10 +876,20 @@ msgstr "" msgid "The statement::" msgstr "A instrução::" +#: ../../library/asyncio-task.rst:587 +msgid "" +"task = asyncio.create_task(something())\n" +"res = await shield(task)" +msgstr "" + #: ../../library/asyncio-task.rst:590 msgid "is equivalent to::" msgstr "é equivalente a::" +#: ../../library/asyncio-task.rst:592 +msgid "res = await something()" +msgstr "" + #: ../../library/asyncio-task.rst:594 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " @@ -694,6 +922,15 @@ msgstr "" "função ``shield()`` deve ser combinada com uma cláusula try/except, conforme " "abaixo::" +#: ../../library/asyncio-task.rst:607 +msgid "" +"task = asyncio.create_task(something())\n" +"try:\n" +" res = await shield(task)\n" +"except CancelledError:\n" +" res = None" +msgstr "" + #: ../../library/asyncio-task.rst:615 msgid "" "Save a reference to tasks passed to this function, to avoid a task " @@ -738,6 +975,13 @@ msgid "" "meth:`Timeout.reschedule`." msgstr "" +#: ../../library/asyncio-task.rst:647 +msgid "" +"async def main():\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()" +msgstr "" + #: ../../library/asyncio-task.rst:651 msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " @@ -757,6 +1001,18 @@ msgstr "" msgid "Example of catching :exc:`TimeoutError`::" msgstr "" +#: ../../library/asyncio-task.rst:665 +msgid "" +"async def main():\n" +" try:\n" +" async with asyncio.timeout(10):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" +msgstr "" + #: ../../library/asyncio-task.rst:674 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " @@ -798,6 +1054,24 @@ msgstr "" msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" +#: ../../library/asyncio-task.rst:705 +msgid "" +"async def main():\n" +" try:\n" +" # We do not know the timeout when starting, so we pass ``None``.\n" +" async with asyncio.timeout(None) as cm:\n" +" # We know the timeout now, so we reschedule it.\n" +" new_deadline = get_running_loop().time() + 10\n" +" cm.reschedule(new_deadline)\n" +"\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" pass\n" +"\n" +" if cm.expired():\n" +" print(\"Looks like we haven't finished on time.\")" +msgstr "" + #: ../../library/asyncio-task.rst:720 msgid "Timeout context managers can be safely nested." msgstr "" @@ -808,6 +1082,20 @@ msgid "" "stop waiting, or ``None``." msgstr "" +#: ../../library/asyncio-task.rst:731 +msgid "" +"async def main():\n" +" loop = get_running_loop()\n" +" deadline = loop.time() + 20\n" +" try:\n" +" async with asyncio.timeout_at(deadline):\n" +" await long_running_task()\n" +" except TimeoutError:\n" +" print(\"The long operation timed out, but we've handled it.\")\n" +"\n" +" print(\"This statement will run regardless.\")" +msgstr "" + #: ../../library/asyncio-task.rst:746 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " @@ -852,6 +1140,27 @@ msgstr "" msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "Se ele for cancelado, o future *aw* também é cancelado." +#: ../../library/asyncio-task.rst:771 +msgid "" +"async def eternity():\n" +" # Sleep for one hour\n" +" await asyncio.sleep(3600)\n" +" print('yay!')\n" +"\n" +"async def main():\n" +" # Wait for at most 1 second\n" +" try:\n" +" await asyncio.wait_for(eternity(), timeout=1.0)\n" +" except TimeoutError:\n" +" print('timeout!')\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# timeout!" +msgstr "" + #: ../../library/asyncio-task.rst:789 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " @@ -885,6 +1194,10 @@ msgstr "Retorna dois conjuntos de Tarefas/Futuros: ``(done, pending)``." msgid "Usage::" msgstr "Uso::" +#: ../../library/asyncio-task.rst:816 +msgid "done, pending = await asyncio.wait(aws)" +msgstr "" + #: ../../library/asyncio-task.rst:818 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " @@ -956,16 +1269,19 @@ msgid "" "be awaited to get the earliest next result from the iterable of the " "remaining awaitables." msgstr "" -"Executa :ref:`objetos aguardáveis ` no iterável *aws* " -"concorrentemente. Retorna um iterador de corrotinas. Cada corrotina " -"retornada pode ser aguardada para obter o primeiro resultado seguinte a " -"partir do iterável dos aguardáveis restantes." #: ../../library/asyncio-task.rst:865 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" +#: ../../library/asyncio-task.rst:870 +msgid "" +"for coro in as_completed(aws):\n" +" earliest_result = await coro\n" +" # ..." +msgstr "" + #: ../../library/asyncio-task.rst:877 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " @@ -1009,6 +1325,35 @@ msgid "" "were run in the main thread. For example::" msgstr "" +#: ../../library/asyncio-task.rst:903 +msgid "" +"def blocking_io():\n" +" print(f\"start blocking_io at {time.strftime('%X')}\")\n" +" # Note that time.sleep() can be replaced with any blocking\n" +" # IO-bound operation, such as file operations.\n" +" time.sleep(1)\n" +" print(f\"blocking_io complete at {time.strftime('%X')}\")\n" +"\n" +"async def main():\n" +" print(f\"started main at {time.strftime('%X')}\")\n" +"\n" +" await asyncio.gather(\n" +" asyncio.to_thread(blocking_io),\n" +" asyncio.sleep(1))\n" +"\n" +" print(f\"finished main at {time.strftime('%X')}\")\n" +"\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# started main at 19:50:53\n" +"# start blocking_io at 19:50:53\n" +"# blocking_io complete at 19:50:54\n" +"# finished main at 19:50:54" +msgstr "" + #: ../../library/asyncio-task.rst:929 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " @@ -1059,6 +1404,18 @@ msgstr "" "Esta função destina-se a ser chamada partir de uma thread diferente do " "sistema operacional, da qual o laço de eventos está executando. Exemplo::" +#: ../../library/asyncio-task.rst:957 +msgid "" +"# Create a coroutine\n" +"coro = asyncio.sleep(1, result=3)\n" +"\n" +"# Submit the coroutine to a given loop\n" +"future = asyncio.run_coroutine_threadsafe(coro, loop)\n" +"\n" +"# Wait for the result with an optional timeout argument\n" +"assert future.result(timeout) == 3" +msgstr "" + #: ../../library/asyncio-task.rst:966 msgid "" "If an exception is raised in the coroutine, the returned Future will be " @@ -1068,6 +1425,19 @@ msgstr "" "notificado. Isso também pode ser usado para cancelar a tarefa no laço de " "eventos::" +#: ../../library/asyncio-task.rst:970 +msgid "" +"try:\n" +" result = future.result(timeout)\n" +"except TimeoutError:\n" +" print('The coroutine took too long, cancelling the task...')\n" +" future.cancel()\n" +"except Exception as exc:\n" +" print(f'The coroutine raised an exception: {exc!r}')\n" +"else:\n" +" print(f'The coroutine returned: {result!r}')" +msgstr "" + #: ../../library/asyncio-task.rst:980 msgid "" "See the :ref:`concurrency and multithreading ` " @@ -1266,11 +1636,9 @@ msgstr "" #: ../../library/asyncio-task.rst:1106 msgid "" -"If the Task's result isn't yet available, this method raises a :exc:" +"If the Task's result isn't yet available, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" -"Se o resultado da Tarefa não estiver disponível ainda, este método levanta " -"uma exceção :exc:`InvalidStateError`." #: ../../library/asyncio-task.rst:1111 msgid "Return the exception of the Task." @@ -1475,6 +1843,43 @@ msgstr "" "O seguinte exemplo ilustra como corrotinas podem interceptar o cancelamento " "de requisições::" +#: ../../library/asyncio-task.rst:1246 +msgid "" +"async def cancel_me():\n" +" print('cancel_me(): before sleep')\n" +"\n" +" try:\n" +" # Wait for 1 hour\n" +" await asyncio.sleep(3600)\n" +" except asyncio.CancelledError:\n" +" print('cancel_me(): cancel sleep')\n" +" raise\n" +" finally:\n" +" print('cancel_me(): after sleep')\n" +"\n" +"async def main():\n" +" # Create a \"cancel_me\" Task\n" +" task = asyncio.create_task(cancel_me())\n" +"\n" +" # Wait for 1 second\n" +" await asyncio.sleep(1)\n" +"\n" +" task.cancel()\n" +" try:\n" +" await task\n" +" except asyncio.CancelledError:\n" +" print(\"main(): cancel_me is cancelled now\")\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# Expected output:\n" +"#\n" +"# cancel_me(): before sleep\n" +"# cancel_me(): cancel sleep\n" +"# cancel_me(): after sleep\n" +"# main(): cancel_me is cancelled now" +msgstr "" + #: ../../library/asyncio-task.rst:1282 msgid "Return ``True`` if the Task is *cancelled*." msgstr "Retorna ``True`` se a Tarefa for *cancelada*." @@ -1512,6 +1917,20 @@ msgid "" "respective structured block. For example::" msgstr "" +#: ../../library/asyncio-task.rst:1306 +msgid "" +"async def make_request_with_timeout():\n" +" try:\n" +" async with asyncio.timeout(1):\n" +" # Structured block affected by the timeout:\n" +" await make_request()\n" +" await make_another_request()\n" +" except TimeoutError:\n" +" log(\"There was a timeout\")\n" +" # Outer code not affected by the timeout:\n" +" await unrelated_code()" +msgstr "" + #: ../../library/asyncio-task.rst:1317 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " diff --git a/library/asyncio.po b/library/asyncio.po index 37f46057a..979492b51 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Lilian Corrêa , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,27 +11,27 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" -#: ../../library/asyncio.rst:80 +#: ../../library/asyncio.rst:87 msgid "High-level APIs" msgstr "APIs de alto nível" -#: ../../library/asyncio.rst:92 +#: ../../library/asyncio.rst:99 msgid "Low-level APIs" msgstr "APIs de baixo nível" -#: ../../library/asyncio.rst:103 +#: ../../library/asyncio.rst:110 msgid "Guides and Tutorials" msgstr "Guias e tutoriais" @@ -46,6 +43,18 @@ msgstr ":mod:`!asyncio` --- E/S assíncrona" msgid "Hello World!" msgstr "Olá Mundo!" +#: ../../library/asyncio.rst:13 +msgid "" +"import asyncio\n" +"\n" +"async def main():\n" +" print('Hello ...')\n" +" await asyncio.sleep(1)\n" +" print('... World!')\n" +"\n" +"asyncio.run(main())" +msgstr "" + #: ../../library/asyncio.rst:22 msgid "" "asyncio is a library to write **concurrent** code using the **async/await** " @@ -136,10 +145,6 @@ msgstr "" ":ref:`fazer uma ponte ` sobre bibliotecas baseadas em " "chamadas e codificar com a sintaxe de async/await." -#: ../../library/asyncio.rst:61 -msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" -msgstr "Você pode experimentar um contexto concorrente ``asyncio`` no REPL:" - #: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`Disponibilidade `: não Emscripten, não WASI." @@ -154,11 +159,43 @@ msgstr "" "``wasm32-emscripten`` e ``wasm32-wasi``. Veja :ref:`wasm-availability` para " "mais informações." +#: ../../library/asyncio.rst:64 +msgid "asyncio REPL" +msgstr "REPL de asyncio" + +#: ../../library/asyncio.rst:65 +msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" +msgstr "Você pode experimentar um contexto concorrente ``asyncio`` no REPL:" + +#: ../../library/asyncio.rst:67 +msgid "" +"$ python -m asyncio\n" +"asyncio REPL ...\n" +"Use \"await\" directly instead of \"asyncio.run()\".\n" +"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " +"information.\n" +">>> import asyncio\n" +">>> await asyncio.sleep(10, result='hello')\n" +"'hello'" +msgstr "" + +#: ../../library/asyncio.rst:77 +msgid "" +"Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " +"arguments." +msgstr "" +"Levanta um :ref:`evento de auditoria ` ``cpython.run_stdin`` sem " +"argumentos." + #: ../../library/asyncio.rst:79 +msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." +msgstr "(também 3.11.10, 3.10.15, 3.9.20 e 3.8.20) Emite eventos de auditoria." + +#: ../../library/asyncio.rst:86 msgid "Reference" msgstr "Referência" -#: ../../library/asyncio.rst:112 +#: ../../library/asyncio.rst:119 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "" "O código-fonte para o asyncio pode ser encontrado em :source:`Lib/asyncio/`." diff --git a/library/atexit.po b/library/atexit.po index 82a359186..2201c7e02 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -183,6 +182,27 @@ msgstr "" "valor atualizado do contador quando o programa termina, sem depender que a " "aplicação faça uma chamada explícita nesse módulo na finalização. ::" +#: ../../library/atexit.rst:89 +msgid "" +"try:\n" +" with open('counterfile') as infile:\n" +" _count = int(infile.read())\n" +"except FileNotFoundError:\n" +" _count = 0\n" +"\n" +"def incrcounter(n):\n" +" global _count\n" +" _count = _count + n\n" +"\n" +"def savecounter():\n" +" with open('counterfile', 'w') as outfile:\n" +" outfile.write('%d' % _count)\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(savecounter)" +msgstr "" + #: ../../library/atexit.rst:107 msgid "" "Positional and keyword arguments may also be passed to :func:`register` to " @@ -192,10 +212,31 @@ msgstr "" "para :func:`register` para ser passada para a função registrada quando é " "chamada ::" +#: ../../library/atexit.rst:110 +msgid "" +"def goodbye(name, adjective):\n" +" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(goodbye, 'Donny', 'nice')\n" +"# or:\n" +"atexit.register(goodbye, adjective='nice', name='Donny')" +msgstr "" + #: ../../library/atexit.rst:119 msgid "Usage as a :term:`decorator`::" msgstr "Utilizado como um :term:`decorador`::" +#: ../../library/atexit.rst:121 +msgid "" +"import atexit\n" +"\n" +"@atexit.register\n" +"def goodbye():\n" +" print('You are now leaving the Python sector.')" +msgstr "" + #: ../../library/atexit.rst:127 msgid "This only works with functions that can be called without arguments." msgstr "Isso só funciona com funções que podem ser invocadas sem argumentos." diff --git a/library/audioop.po b/library/audioop.po index 6570cc416..c15792e3f 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -28,7 +27,7 @@ msgstr "" msgid ":mod:`audioop` --- Manipulate raw audio data" msgstr ":mod:`audioop` --- Manipulando dados de áudio original" -#: ../../library/audioop.rst:11 +#: ../../library/audioop.rst:8 msgid "" "The :mod:`audioop` module is deprecated (see :pep:`PEP 594 <594#audioop>` " "for details)." @@ -195,6 +194,12 @@ msgid "" "samples for these formats, you need to also add 128 to the result::" msgstr "" +#: ../../library/audioop.rst:163 +msgid "" +"new_frames = audioop.lin2lin(frames, old_width, 1)\n" +"new_frames = audioop.bias(new_frames, 1, 128)" +msgstr "" + #: ../../library/audioop.rst:166 msgid "" "The same, in reverse, has to be applied when converting from 8 to 16, 24 or " @@ -292,6 +297,18 @@ msgid "" "that::" msgstr "" +#: ../../library/audioop.rst:249 +msgid "" +"def mul_stereo(sample, width, lfactor, rfactor):\n" +" lsample = audioop.tomono(sample, width, 1, 0)\n" +" rsample = audioop.tomono(sample, width, 0, 1)\n" +" lsample = audioop.mul(lsample, width, lfactor)\n" +" rsample = audioop.mul(rsample, width, rfactor)\n" +" lsample = audioop.tostereo(lsample, width, 1, 0)\n" +" rsample = audioop.tostereo(rsample, width, 0, 1)\n" +" return audioop.add(lsample, rsample, width)" +msgstr "" + #: ../../library/audioop.rst:258 msgid "" "If you use the ADPCM coder to build network packets and you want your " @@ -319,6 +336,22 @@ msgid "" "input sample and subtract the whole output sample from the input sample::" msgstr "" +#: ../../library/audioop.rst:275 +msgid "" +"def echocancel(outputdata, inputdata):\n" +" pos = audioop.findmax(outputdata, 800) # one tenth second\n" +" out_test = outputdata[pos*2:]\n" +" in_test = inputdata[pos*2:]\n" +" ipos, factor = audioop.findfit(in_test, out_test)\n" +" # Optional (for better cancellation):\n" +" # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],\n" +" # out_test)\n" +" prefill = '\\0'*(pos+ipos)*2\n" +" postfill = '\\0'*(len(inputdata)-len(prefill)-len(outputdata))\n" +" outputdata = prefill + audioop.mul(outputdata, 2, -factor) + postfill\n" +" return audioop.add(inputdata, outputdata, 2)" +msgstr "" + #: ../../library/audioop.rst:24 msgid "Intel/DVI ADPCM" msgstr "Intel/DVI ADPCM" diff --git a/library/audit_events.po b/library/audit_events.po index 9098bddef..a9e288fec 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-29 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/base64.po b/library/base64.po index 0a5a23c0b..6c2b5a662 100644 --- a/library/base64.po +++ b/library/base64.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Bonifacio de Oliveira , 2021 -# Augusta Carla Klug , 2021 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -292,7 +287,7 @@ msgstr "" msgid "" "*wrapcol* controls whether the output should have newline (``b'\\n'``) " "characters added to it. If this is non-zero, each output line will be at " -"most this many characters long." +"most this many characters long, excluding the trailing newline." msgstr "" #: ../../library/base64.rst:198 diff --git a/library/bdb.po b/library/bdb.po index 41e9907a8..28c41282c 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -4,8 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -13,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/binary.po b/library/binary.po index 88f6fdb10..7c5b9236d 100644 --- a/library/binary.po +++ b/library/binary.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/binascii.po b/library/binascii.po index 506083a5c..919919e32 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Marco Rougeth , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -162,6 +158,15 @@ msgid "" "algorithm. Use as follows::" msgstr "" +#: ../../library/binascii.rst:117 +msgid "" +"print(binascii.crc32(b\"hello world\"))\n" +"# Or, in two pieces:\n" +"crc = binascii.crc32(b\"hello\")\n" +"crc = binascii.crc32(b\" world\", crc)\n" +"print('crc32 = {:#010x}'.format(crc))" +msgstr "" + #: ../../library/binascii.rst:123 msgid "The result is always unsigned." msgstr "O resultado é sempre sem sinal." diff --git a/library/bisect.po b/library/bisect.po index 859a97392..e9273d15d 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -239,6 +238,44 @@ msgid "" "sorted lists::" msgstr "" +#: ../../library/bisect.rst:150 +msgid "" +"def index(a, x):\n" +" 'Locate the leftmost value exactly equal to x'\n" +" i = bisect_left(a, x)\n" +" if i != len(a) and a[i] == x:\n" +" return i\n" +" raise ValueError\n" +"\n" +"def find_lt(a, x):\n" +" 'Find rightmost value less than x'\n" +" i = bisect_left(a, x)\n" +" if i:\n" +" return a[i-1]\n" +" raise ValueError\n" +"\n" +"def find_le(a, x):\n" +" 'Find rightmost value less than or equal to x'\n" +" i = bisect_right(a, x)\n" +" if i:\n" +" return a[i-1]\n" +" raise ValueError\n" +"\n" +"def find_gt(a, x):\n" +" 'Find leftmost value greater than x'\n" +" i = bisect_right(a, x)\n" +" if i != len(a):\n" +" return a[i]\n" +" raise ValueError\n" +"\n" +"def find_ge(a, x):\n" +" 'Find leftmost item greater than or equal to x'\n" +" i = bisect_left(a, x)\n" +" if i != len(a):\n" +" return a[i]\n" +" raise ValueError" +msgstr "" + #: ../../library/bisect.rst:187 msgid "Examples" msgstr "Exemplos" @@ -251,6 +288,16 @@ msgid "" "90 and up is an 'A', 80 to 89 is a 'B', and so on::" msgstr "" +#: ../../library/bisect.rst:196 +msgid "" +">>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):\n" +"... i = bisect(breakpoints, score)\n" +"... return grades[i]\n" +"...\n" +">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" +"['F', 'A', 'C', 'C', 'B', 'A', 'A']" +msgstr "" + #: ../../library/bisect.rst:203 msgid "" "The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also " @@ -258,8 +305,56 @@ msgid "" "field used for ordering records in a table::" msgstr "" +#: ../../library/bisect.rst:207 +msgid "" +">>> from collections import namedtuple\n" +">>> from operator import attrgetter\n" +">>> from bisect import bisect, insort\n" +">>> from pprint import pprint\n" +"\n" +">>> Movie = namedtuple('Movie', ('name', 'released', 'director'))\n" +"\n" +">>> movies = [\n" +"... Movie('Jaws', 1975, 'Spielberg'),\n" +"... Movie('Titanic', 1997, 'Cameron'),\n" +"... Movie('The Birds', 1963, 'Hitchcock'),\n" +"... Movie('Aliens', 1986, 'Cameron')\n" +"... ]\n" +"\n" +">>> # Find the first movie released after 1960\n" +">>> by_year = attrgetter('released')\n" +">>> movies.sort(key=by_year)\n" +">>> movies[bisect(movies, 1960, key=by_year)]\n" +"Movie(name='The Birds', released=1963, director='Hitchcock')\n" +"\n" +">>> # Insert a movie while maintaining sort order\n" +">>> romance = Movie('Love Story', 1970, 'Hiller')\n" +">>> insort(movies, romance, key=by_year)\n" +">>> pprint(movies)\n" +"[Movie(name='The Birds', released=1963, director='Hitchcock'),\n" +" Movie(name='Love Story', released=1970, director='Hiller'),\n" +" Movie(name='Jaws', released=1975, director='Spielberg'),\n" +" Movie(name='Aliens', released=1986, director='Cameron'),\n" +" Movie(name='Titanic', released=1997, director='Cameron')]" +msgstr "" + #: ../../library/bisect.rst:237 msgid "" "If the key function is expensive, it is possible to avoid repeated function " "calls by searching a list of precomputed keys to find the index of a record::" msgstr "" + +#: ../../library/bisect.rst:240 +msgid "" +">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n" +">>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).\n" +">>> keys = [r[1] for r in data] # Precompute a list of keys.\n" +">>> data[bisect_left(keys, 0)]\n" +"('black', 0)\n" +">>> data[bisect_left(keys, 1)]\n" +"('blue', 1)\n" +">>> data[bisect_left(keys, 5)]\n" +"('red', 5)\n" +">>> data[bisect_left(keys, 8)]\n" +"('yellow', 8)" +msgstr "" diff --git a/library/builtins.po b/library/builtins.po index 3fec9d2a7..f7c951b54 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -54,6 +54,26 @@ msgstr "" "func:`open` que envolve o embutido :func:`open`, este módulo pode ser usado " "diretamente::" +#: ../../library/builtins.rst:21 +msgid "" +"import builtins\n" +"\n" +"def open(path):\n" +" f = builtins.open(path, 'r')\n" +" return UpperCaser(f)\n" +"\n" +"class UpperCaser:\n" +" '''Wrapper around a file that converts output to uppercase.'''\n" +"\n" +" def __init__(self, f):\n" +" self._f = f\n" +"\n" +" def read(self, count=-1):\n" +" return self._f.read(count).upper()\n" +"\n" +" # ..." +msgstr "" + #: ../../library/builtins.rst:38 msgid "" "As an implementation detail, most modules have the name ``__builtins__`` " diff --git a/library/bz2.po b/library/bz2.po index e93703297..dd55adf30 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-30 14:55+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/calendar.po b/library/calendar.po index bc653efe7..1c44d23b0 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Rafael Fontenelle , 2023 -# i17obot , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: i17obot , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -297,10 +295,21 @@ msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "" +#: ../../library/calendar.rst:213 +msgid "" +"cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" +msgstr "" + #: ../../library/calendar.rst:215 msgid "more styles can be added for each day::" msgstr "" +#: ../../library/calendar.rst:217 +msgid "" +"cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " +"\"sat\", \"sun red\"]" +msgstr "" + #: ../../library/calendar.rst:219 msgid "Note that the length of this list must be seven items." msgstr "" @@ -346,10 +355,24 @@ msgid "" "single CSS class with a space separated list of CSS classes, for example::" msgstr "" +#: ../../library/calendar.rst:273 +msgid "\"text-bold text-red\"" +msgstr "" + #: ../../library/calendar.rst:275 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "" +#: ../../library/calendar.rst:277 +msgid "" +"class CustomHTMLCal(calendar.HTMLCalendar):\n" +" cssclasses = [style + \" text-nowrap\" for style in\n" +" calendar.HTMLCalendar.cssclasses]\n" +" cssclass_month_head = \"text-center month-head\"\n" +" cssclass_month = \"text-center month\"\n" +" cssclass_year = \"text-italic lead\"" +msgstr "" + #: ../../library/calendar.rst:287 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " @@ -383,6 +406,12 @@ msgid "" "provided for convenience. For example, to set the first weekday to Sunday::" msgstr "" +#: ../../library/calendar.rst:314 +msgid "" +"import calendar\n" +"calendar.setfirstweekday(calendar.SUNDAY)" +msgstr "" + #: ../../library/calendar.rst:320 msgid "Returns the current setting for the weekday to start each week." msgstr "" @@ -563,10 +592,58 @@ msgid "" "to interactively print a calendar." msgstr "" +#: ../../library/calendar.rst:511 +msgid "" +"python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" +" [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" +" [year] [month]" +msgstr "" + #: ../../library/calendar.rst:518 msgid "For example, to print a calendar for the year 2000:" msgstr "" +#: ../../library/calendar.rst:520 +msgid "" +"$ python -m calendar 2000\n" +" 2000\n" +"\n" +" January February March\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3 4 5\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26\n" +"24 25 26 27 28 29 30 28 29 27 28 29 30 31\n" +"31\n" +"\n" +" April May June\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 7 1 2 3 4\n" +" 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11\n" +"10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18\n" +"17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25\n" +"24 25 26 27 28 29 30 29 30 31 26 27 28 29 30\n" +"\n" +" July August September\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 2 1 2 3 4 5 6 1 2 3\n" +" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10\n" +"10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17\n" +"17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24\n" +"24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30\n" +"31\n" +"\n" +" October November December\n" +"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" +" 1 1 2 3 4 5 1 2 3\n" +" 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10\n" +" 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17\n" +"16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24\n" +"23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" +"30 31" +msgstr "" + #: ../../library/calendar.rst:561 msgid "The following options are accepted:" msgstr "As seguintes opções são aceitas:" diff --git a/library/cgi.po b/library/cgi.po index 4d203fe8c..64b025cc2 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Ruan Aragão , 2021 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -35,7 +31,7 @@ msgstr ":mod:`cgi` --- Suporte a Common Gateway Interface" msgid "**Source code:** :source:`Lib/cgi.py`" msgstr "**Código-fonte:** :source:`Lib/cgi.py`" -#: ../../library/cgi.rst:27 +#: ../../library/cgi.rst:18 msgid "" "The :mod:`cgi` module is deprecated (see :pep:`PEP 594 <594#cgi>` for " "details and alternatives)." @@ -141,6 +137,12 @@ msgstr "" "cliente que tipo de dados está seguindo. O código Python para gerar uma " "seção de cabeçalho mínima se parece com isto::" +#: ../../library/cgi.rst:68 +msgid "" +"print(\"Content-Type: text/html\") # HTML is following\n" +"print() # blank line, end of headers" +msgstr "" + #: ../../library/cgi.rst:71 msgid "" "The second section is usually HTML, which allows the client software to " @@ -151,6 +153,13 @@ msgstr "" "exiba um texto bem formatado com cabeçalho, imagens em linha etc. Aqui está " "o código Python que imprime um pedaço simples de HTML ::" +#: ../../library/cgi.rst:75 +msgid "" +"print(\"CGI script output\")\n" +"print(\"

This is my first CGI script

\")\n" +"print(\"Hello, world!\")" +msgstr "" + #: ../../library/cgi.rst:83 msgid "Using the cgi module" msgstr "Usando o módulo cgi" @@ -163,6 +172,12 @@ msgstr "Comece escrevendo ``import cgi``." msgid "When you write a new script, consider adding these lines::" msgstr "Ao escrever um novo script, considere adicionar estas linhas::" +#: ../../library/cgi.rst:89 ../../library/cgi.rst:505 +msgid "" +"import cgitb\n" +"cgitb.enable()" +msgstr "" + #: ../../library/cgi.rst:92 msgid "" "This activates a special exception handler that will display detailed " @@ -171,6 +186,12 @@ msgid "" "saved to files instead, with code like this::" msgstr "" +#: ../../library/cgi.rst:97 +msgid "" +"import cgitb\n" +"cgitb.enable(display=0, logdir=\"/path/to/logdir\")" +msgstr "" + #: ../../library/cgi.rst:100 msgid "" "It's very helpful to use this feature during script development. The reports " @@ -221,6 +242,18 @@ msgid "" "the fields ``name`` and ``addr`` are both set to a non-empty string::" msgstr "" +#: ../../library/cgi.rst:127 +msgid "" +"form = cgi.FieldStorage()\n" +"if \"name\" not in form or \"addr\" not in form:\n" +" print(\"

Error

\")\n" +" print(\"Please fill in the name and addr fields.\")\n" +" return\n" +"print(\"

name:\", form[\"name\"].value)\n" +"print(\"

addr:\", form[\"addr\"].value)\n" +"...further form processing here..." +msgstr "" + #: ../../library/cgi.rst:136 msgid "" "Here the fields, accessed through ``form[key]``, are themselves instances " @@ -244,6 +277,12 @@ msgid "" "username fields, separated by commas::" msgstr "" +#: ../../library/cgi.rst:153 +msgid "" +"value = form.getlist(\"username\")\n" +"usernames = \",\".join(value)" +msgstr "" + #: ../../library/cgi.rst:156 msgid "" "If a field represents an uploaded file, accessing the value via the :attr:" @@ -257,6 +296,18 @@ msgid "" "IOBase.readline` methods will return bytes)::" msgstr "" +#: ../../library/cgi.rst:167 +msgid "" +"fileitem = form[\"userfile\"]\n" +"if fileitem.file:\n" +" # It's an uploaded file; count lines\n" +" linecount = 0\n" +" while True:\n" +" line = fileitem.file.readline()\n" +" if not line: break\n" +" linecount = linecount + 1" +msgstr "" + #: ../../library/cgi.rst:176 msgid "" ":class:`FieldStorage` objects also support being used in a :keyword:`with` " @@ -336,12 +387,27 @@ msgid "" "expected a user to post more than one value under one name::" msgstr "" +#: ../../library/cgi.rst:228 +msgid "" +"item = form.getvalue(\"item\")\n" +"if isinstance(item, list):\n" +" # The user is requesting more than one item.\n" +"else:\n" +" # The user is requesting only one item." +msgstr "" + #: ../../library/cgi.rst:234 msgid "" "This situation is common for example when a form contains a group of " "multiple checkboxes with the same name::" msgstr "" +#: ../../library/cgi.rst:237 +msgid "" +"\n" +"" +msgstr "" + #: ../../library/cgi.rst:240 msgid "" "In most situations, however, there's only one form control with a particular " @@ -349,6 +415,10 @@ msgid "" "this name. So you write a script containing for example this code::" msgstr "" +#: ../../library/cgi.rst:244 +msgid "user = form.getvalue(\"user\").upper()" +msgstr "" + #: ../../library/cgi.rst:246 msgid "" "The problem with the code is that you should never expect that a client will " @@ -397,6 +467,15 @@ msgstr "" msgid "Using these methods you can write nice compact code::" msgstr "" +#: ../../library/cgi.rst:281 +msgid "" +"import cgi\n" +"form = cgi.FieldStorage()\n" +"user = form.getfirst(\"user\", \"\").upper() # This way it's safe.\n" +"for item in form.getlist(\"item\"):\n" +" do_something(item)" +msgstr "" + #: ../../library/cgi.rst:291 msgid "Functions" msgstr "Funções" @@ -414,7 +493,7 @@ msgid "" "parameters are passed to :func:`urllib.parse.parse_qs` unchanged." msgstr "" -#: ../../library/cgi.rst:307 +#: ../../library/cgi.rst:303 msgid "" "This function, like the rest of the :mod:`cgi` module, is deprecated. It can " "be replaced by calling :func:`urllib.parse.parse_qs` directly on the desired " @@ -454,7 +533,7 @@ msgstr "" msgid "Added the *separator* parameter." msgstr "" -#: ../../library/cgi.rst:337 +#: ../../library/cgi.rst:332 msgid "" "This function, like the rest of the :mod:`cgi` module, is deprecated. It can " "be replaced with the functionality in the :mod:`email` package (e.g. :class:" @@ -468,7 +547,7 @@ msgid "" "and a dictionary of parameters." msgstr "" -#: ../../library/cgi.rst:355 +#: ../../library/cgi.rst:345 msgid "" "This function, like the rest of the :mod:`cgi` module, is deprecated. It can " "be replaced with the functionality in the :mod:`email` package, which " @@ -479,6 +558,14 @@ msgstr "" msgid "For example, with :class:`email.message.EmailMessage`::" msgstr "" +#: ../../library/cgi.rst:352 +msgid "" +"from email.message import EmailMessage\n" +"msg = EmailMessage()\n" +"msg['content-type'] = 'application/json; charset=\"utf8\"'\n" +"main, params = msg.get_content_type(), msg['content-type'].params" +msgstr "" + #: ../../library/cgi.rst:360 msgid "" "Robust test CGI script, usable as main program. Writes minimal HTTP headers " @@ -542,6 +629,10 @@ msgid "" "column 1 followed by the pathname of the Python interpreter, for instance::" msgstr "" +#: ../../library/cgi.rst:416 +msgid "#!/usr/local/bin/python" +msgstr "" + #: ../../library/cgi.rst:418 msgid "" "Make sure the Python interpreter exists and is executable by \"others\"." @@ -569,6 +660,13 @@ msgid "" "importing other modules. For example::" msgstr "" +#: ../../library/cgi.rst:435 +msgid "" +"import sys\n" +"sys.path.insert(0, \"/usr/home/joe/lib/python\")\n" +"sys.path.insert(0, \"/usr/local/lib/python\")" +msgstr "" + #: ../../library/cgi.rst:439 msgid "(This way, the directory inserted last will be searched first!)" msgstr "" @@ -616,6 +714,10 @@ msgid "" "your browser of the form:" msgstr "" +#: ../../library/cgi.rst:473 +msgid "http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home" +msgstr "" + #: ../../library/cgi.rst:477 msgid "" "If this gives an error of type 404, the server cannot find the script -- " @@ -634,6 +736,10 @@ msgid "" "from your script: replace its main code with the single statement ::" msgstr "" +#: ../../library/cgi.rst:489 +msgid "cgi.test()" +msgstr "" + #: ../../library/cgi.rst:491 msgid "" "This should produce the same results as those gotten from installing the :" @@ -671,6 +777,15 @@ msgid "" "modules)::" msgstr "" +#: ../../library/cgi.rst:515 +msgid "" +"import sys\n" +"sys.stderr = sys.stdout\n" +"print(\"Content-Type: text/plain\")\n" +"print()\n" +"...your code here..." +msgstr "" + #: ../../library/cgi.rst:521 msgid "" "This relies on the Python interpreter to print the traceback. The content " diff --git a/library/cgitb.po b/library/cgitb.po index c5da3bf34..56b82910e 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marcos Wenneton Araújo , 2021 -# Henrique Junqueira, 2022 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -36,7 +33,7 @@ msgstr "" msgid "**Source code:** :source:`Lib/cgitb.py`" msgstr "**Código-fonte:** :source:`Lib/cgitb.py`" -#: ../../library/cgitb.rst:22 +#: ../../library/cgitb.rst:19 msgid "" "The :mod:`cgitb` module is deprecated (see :pep:`PEP 594 <594#cgitb>` for " "details)." @@ -73,6 +70,12 @@ msgid "To enable this feature, simply add this to the top of your CGI script::" msgstr "" "Para habilitar esse recurso, basta adicioná-lo ao topo do seu script CGI::" +#: ../../library/cgitb.rst:37 +msgid "" +"import cgitb\n" +"cgitb.enable()" +msgstr "" + #: ../../library/cgitb.rst:40 msgid "" "The options to the :func:`enable` function control whether the report is " diff --git a/library/chunk.po b/library/chunk.po index a7f1e58bc..0c1d619bd 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Vitor Buxbaum Orlandi, 2023 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-22 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -35,7 +31,7 @@ msgstr "" msgid "**Source code:** :source:`Lib/chunk.py`" msgstr "**Código-fonte:** :source:`Lib/chunk.py`" -#: ../../library/chunk.rst:23 +#: ../../library/chunk.rst:20 msgid "" "The :mod:`chunk` module is deprecated (see :pep:`PEP 594 <594#chunk>` for " "details)." diff --git a/library/cmath.po b/library/cmath.po index 098d9efda..18ada27fb 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Marco Rougeth , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -80,6 +77,12 @@ msgstr "" "tratado como se estivesse *abaixo* do corte de ramificação, e assim dá um " "resultado no eixo imaginário negativo::" +#: ../../library/cmath.rst:31 +msgid "" +">>> cmath.sqrt(complex(-2.0, -0.0))\n" +"-1.4142135623730951j" +msgstr "" + #: ../../library/cmath.rst:34 msgid "" "But an argument of ``complex(-2.0, 0.0)`` is treated as though it lies above " @@ -88,6 +91,12 @@ msgstr "" "Mas um argumento de ``complex(-2.0, 0.0)`` é tratado como se estivesse acima " "do corte de ramificação::" +#: ../../library/cmath.rst:37 +msgid "" +">>> cmath.sqrt(complex(-2.0, 0.0))\n" +"1.4142135623730951j" +msgstr "" + #: ../../library/cmath.rst:42 msgid "Conversions to and from polar coordinates" msgstr "Conversões de e para coordenadas polares" @@ -96,10 +105,13 @@ msgstr "Conversões de e para coordenadas polares" msgid "" "A Python complex number ``z`` is stored internally using *rectangular* or " "*Cartesian* coordinates. It is completely determined by its *real part* ``z." -"real`` and its *imaginary part* ``z.imag``. In other words::" +"real`` and its *imaginary part* ``z.imag``." msgstr "" +"Um número complexo Python ``z`` é armazenado internamente usando coordenadas " +"*retangulares* ou *cartesianas*. É completamente determinado por sua *parte " +"real* ``z.real`` e sua *parte imaginária* ``z.imag``." -#: ../../library/cmath.rst:51 +#: ../../library/cmath.rst:48 msgid "" "*Polar coordinates* give an alternative way to represent a complex number. " "In polar coordinates, a complex number *z* is defined by the modulus *r* and " @@ -114,7 +126,7 @@ msgstr "" "*z* à origem, enquanto a fase *phi* é o ângulo anti-horário, medido em " "radianos, do eixo x positivo ao segmento de reta que une a origem a *z*." -#: ../../library/cmath.rst:58 +#: ../../library/cmath.rst:55 msgid "" "The following functions can be used to convert from the native rectangular " "coordinates to polar coordinates and back." @@ -122,7 +134,7 @@ msgstr "" "As funções a seguir podem ser usadas para converter coordenadas retangulares " "nativas em coordenadas polares e vice-versa." -#: ../../library/cmath.rst:63 +#: ../../library/cmath.rst:60 msgid "" "Return the phase of *x* (also known as the *argument* of *x*), as a float. " "``phase(x)`` is equivalent to ``math.atan2(x.imag, x.real)``. The result " @@ -136,7 +148,15 @@ msgstr "" "ramificação para esta operação está ao longo do eixo real negativo. O sinal " "do resultado é igual ao sinal de ``x.imag``, mesmo quando ``x.imag`` é zero::" -#: ../../library/cmath.rst:77 +#: ../../library/cmath.rst:66 +msgid "" +">>> phase(complex(-1.0, 0.0))\n" +"3.141592653589793\n" +">>> phase(complex(-1.0, -0.0))\n" +"-3.141592653589793" +msgstr "" + +#: ../../library/cmath.rst:74 msgid "" "The modulus (absolute value) of a complex number *x* can be computed using " "the built-in :func:`abs` function. There is no separate :mod:`cmath` module " @@ -146,7 +166,7 @@ msgstr "" "usando a função embutida :func:`abs`. Não há função do módulo :mod:`cmath` " "separada para esta operação." -#: ../../library/cmath.rst:84 +#: ../../library/cmath.rst:81 msgid "" "Return the representation of *x* in polar coordinates. Returns a pair ``(r, " "phi)`` where *r* is the modulus of *x* and phi is the phase of *x*. " @@ -156,24 +176,26 @@ msgstr "" "phi)`` onde *r* é o módulo de *x* e phi é a fase de *x*. ``polar(x)`` é " "equivalente a ``(abs(x), phase(x))``." -#: ../../library/cmath.rst:92 +#: ../../library/cmath.rst:89 msgid "" "Return the complex number *x* with polar coordinates *r* and *phi*. " -"Equivalent to ``r * (math.cos(phi) + math.sin(phi)*1j)``." +"Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi))``." msgstr "" +"Retorna o número complexo *x* com coordenadas polares *r* e *phi*. " +"Equivalente a ``complex(r * math.cos(phi), r * math.sin(phi))``." -#: ../../library/cmath.rst:97 +#: ../../library/cmath.rst:94 msgid "Power and logarithmic functions" msgstr "Funções de potência e logarítmicas" -#: ../../library/cmath.rst:101 +#: ../../library/cmath.rst:98 msgid "" "Return *e* raised to the power *x*, where *e* is the base of natural " "logarithms." msgstr "" "Retorna *e* elevado à potência *x*, onde *e* é a base de logaritmos naturais." -#: ../../library/cmath.rst:107 +#: ../../library/cmath.rst:104 msgid "" "Returns the logarithm of *x* to the given *base*. If the *base* is not " "specified, returns the natural logarithm of *x*. There is one branch cut, " @@ -183,7 +205,7 @@ msgstr "" "especificada, retorna o logaritmo natural de *x*. Há um corte de " "ramificação, de 0 ao longo do eixo real negativo até -∞." -#: ../../library/cmath.rst:114 +#: ../../library/cmath.rst:111 msgid "" "Return the base-10 logarithm of *x*. This has the same branch cut as :func:" "`log`." @@ -191,18 +213,18 @@ msgstr "" "Retorna o logaritmo de *x* na base 10. Este tem o mesmo corte de ramificação " "que :func:`log`." -#: ../../library/cmath.rst:120 +#: ../../library/cmath.rst:117 msgid "" "Return the square root of *x*. This has the same branch cut as :func:`log`." msgstr "" "Retorna a raiz quadrada de *x*. Este tem o mesmo corte de ramificação que :" "func:`log`." -#: ../../library/cmath.rst:124 +#: ../../library/cmath.rst:121 msgid "Trigonometric functions" msgstr "Funções trigonométricas" -#: ../../library/cmath.rst:128 +#: ../../library/cmath.rst:125 msgid "" "Return the arc cosine of *x*. There are two branch cuts: One extends right " "from 1 along the real axis to ∞. The other extends left from -1 along the " @@ -212,14 +234,14 @@ msgstr "" "estende desde 1 ao longo do eixo real até ∞. O outro se estende para a " "esquerda de -1 ao longo do eixo real até -∞." -#: ../../library/cmath.rst:135 +#: ../../library/cmath.rst:132 msgid "" "Return the arc sine of *x*. This has the same branch cuts as :func:`acos`." msgstr "" "Retorna o arco seno de *x*. Tem os mesmos cortes de ramificação que :func:" "`acos`." -#: ../../library/cmath.rst:140 +#: ../../library/cmath.rst:137 msgid "" "Return the arc tangent of *x*. There are two branch cuts: One extends from " "``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " @@ -229,23 +251,23 @@ msgstr "" "estende de ``1j`` ao longo do eixo imaginário até ``∞j``. O outro se estende " "de ``-1j`` ao longo do eixo imaginário até ``-∞j``." -#: ../../library/cmath.rst:147 +#: ../../library/cmath.rst:144 msgid "Return the cosine of *x*." msgstr "Retorna o cosseno de *x*." -#: ../../library/cmath.rst:152 +#: ../../library/cmath.rst:149 msgid "Return the sine of *x*." msgstr "Retorna o seno de *x*." -#: ../../library/cmath.rst:157 +#: ../../library/cmath.rst:154 msgid "Return the tangent of *x*." msgstr "Retorna a tangente de *x*." -#: ../../library/cmath.rst:161 +#: ../../library/cmath.rst:158 msgid "Hyperbolic functions" msgstr "Funções hiperbólicas" -#: ../../library/cmath.rst:165 +#: ../../library/cmath.rst:162 msgid "" "Return the inverse hyperbolic cosine of *x*. There is one branch cut, " "extending left from 1 along the real axis to -∞." @@ -253,7 +275,7 @@ msgstr "" "Retorna o cosseno hiperbólico inverso de *x*. Há um corte de ramificação, " "estendendo-se para a esquerda de 1 ao longo do eixo real até -∞." -#: ../../library/cmath.rst:171 +#: ../../library/cmath.rst:168 msgid "" "Return the inverse hyperbolic sine of *x*. There are two branch cuts: One " "extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " @@ -263,7 +285,7 @@ msgstr "" "ramificação: Um se estende de ``1j`` ao longo do eixo imaginário até ``∞j``. " "O outro se estende de ``-1j`` ao longo do eixo imaginário até ``-∞j``." -#: ../../library/cmath.rst:178 +#: ../../library/cmath.rst:175 msgid "" "Return the inverse hyperbolic tangent of *x*. There are two branch cuts: One " "extends from ``1`` along the real axis to ``∞``. The other extends from " @@ -273,23 +295,23 @@ msgstr "" "ramificação: Um se estende de ``1`` ao longo do eixo real até ``∞``. O outro " "se estende de ``-1`` ao longo do eixo real até ``-∞``." -#: ../../library/cmath.rst:185 +#: ../../library/cmath.rst:182 msgid "Return the hyperbolic cosine of *x*." msgstr "Retorna o cosseno hiperbólico de *x*." -#: ../../library/cmath.rst:190 +#: ../../library/cmath.rst:187 msgid "Return the hyperbolic sine of *x*." msgstr "Retorna o seno hiperbólico de *x*." -#: ../../library/cmath.rst:195 +#: ../../library/cmath.rst:192 msgid "Return the hyperbolic tangent of *x*." msgstr "Retorna a tangente hiperbólica de *x*." -#: ../../library/cmath.rst:199 +#: ../../library/cmath.rst:196 msgid "Classification functions" msgstr "Funções de classificação" -#: ../../library/cmath.rst:203 +#: ../../library/cmath.rst:200 msgid "" "Return ``True`` if both the real and imaginary parts of *x* are finite, and " "``False`` otherwise." @@ -297,7 +319,7 @@ msgstr "" "Retorna ``True`` se ambas as partes real e imaginária de *x* forem finitas, " "e ``False`` caso contrário." -#: ../../library/cmath.rst:211 +#: ../../library/cmath.rst:208 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is an " "infinity, and ``False`` otherwise." @@ -305,7 +327,7 @@ msgstr "" "Retorna ``True`` se ou a parte real ou a imaginária de *x* for infinita, e " "``False`` caso contrário." -#: ../../library/cmath.rst:217 +#: ../../library/cmath.rst:214 msgid "" "Return ``True`` if either the real or the imaginary part of *x* is a NaN, " "and ``False`` otherwise." @@ -313,7 +335,7 @@ msgstr "" "Retorna ``True`` se ou a parte real ou a imaginária de *x* for NaN, e " "``False`` caso contrário." -#: ../../library/cmath.rst:223 +#: ../../library/cmath.rst:220 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." @@ -321,7 +343,7 @@ msgstr "" "Retorna ``True`` se os valores *a* e *b* estiverem próximos e ``False`` caso " "contrário." -#: ../../library/cmath.rst:226 +#: ../../library/cmath.rst:223 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances." @@ -329,7 +351,7 @@ msgstr "" "Se dois valores são ou não considerados próximos, é determinado de acordo " "com as tolerâncias absolutas e relativas fornecidas." -#: ../../library/cmath.rst:229 +#: ../../library/cmath.rst:226 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -343,7 +365,7 @@ msgstr "" "padrão é ``1e-09``, o que garante que os dois valores sejam iguais em cerca " "de 9 dígitos decimais. *rel_tol* deve ser maior que zero." -#: ../../library/cmath.rst:235 +#: ../../library/cmath.rst:232 msgid "" "*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " "zero. *abs_tol* must be at least zero." @@ -351,7 +373,7 @@ msgstr "" "*abs_tol* é a tolerância absoluta mínima -- útil para comparações próximas a " "zero. *abs_tol* deve ser pelo menos zero." -#: ../../library/cmath.rst:238 +#: ../../library/cmath.rst:235 msgid "" "If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " "max(abs(a), abs(b)), abs_tol)``." @@ -359,7 +381,7 @@ msgstr "" "Se nenhum erro ocorrer, o resultado será: ``abs(a-b) <= max(rel_tol * " "max(abs(a), abs(b)), abs_tol)``." -#: ../../library/cmath.rst:241 +#: ../../library/cmath.rst:238 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -371,31 +393,31 @@ msgstr "" "considerado próximo a qualquer outro valor, incluindo ``NaN``. ``inf`` e ``-" "inf`` são considerados apenas próximos a si mesmos." -#: ../../library/cmath.rst:250 +#: ../../library/cmath.rst:247 msgid ":pep:`485` -- A function for testing approximate equality" msgstr ":pep:`485` -- Uma função para testar igualdade aproximada" -#: ../../library/cmath.rst:254 +#: ../../library/cmath.rst:251 msgid "Constants" msgstr "Constantes" -#: ../../library/cmath.rst:258 +#: ../../library/cmath.rst:255 msgid "The mathematical constant *π*, as a float." msgstr "A constante matemática *π*, como um ponto flutuante." -#: ../../library/cmath.rst:263 +#: ../../library/cmath.rst:260 msgid "The mathematical constant *e*, as a float." msgstr "A constante matemática *e*, como um ponto flutuante." -#: ../../library/cmath.rst:268 +#: ../../library/cmath.rst:265 msgid "The mathematical constant *τ*, as a float." msgstr "A constante matemática *τ*, como um ponto flutuante." -#: ../../library/cmath.rst:275 +#: ../../library/cmath.rst:272 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." msgstr "Infinito positivo de ponto flutuante. Equivalente a ``float('inf')``." -#: ../../library/cmath.rst:282 +#: ../../library/cmath.rst:279 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." @@ -403,7 +425,7 @@ msgstr "" "Número complexo com parte real zero e parte imaginária infinita positiva. " "Equivalente a ``complex(0.0, float('inf'))``." -#: ../../library/cmath.rst:290 +#: ../../library/cmath.rst:287 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." @@ -411,7 +433,7 @@ msgstr "" "Um valor de ponto flutuante \"não um número\" (NaN). Equivalente a " "``float('nan')``." -#: ../../library/cmath.rst:298 +#: ../../library/cmath.rst:295 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." @@ -419,7 +441,7 @@ msgstr "" "Número complexo com parte real zero e parte imaginária NaN. Equivalente a " "``complex(0.0, float('nan'))``." -#: ../../library/cmath.rst:306 +#: ../../library/cmath.rst:303 msgid "" "Note that the selection of functions is similar, but not identical, to that " "in module :mod:`math`. The reason for having two modules is that some users " @@ -438,7 +460,7 @@ msgstr "" "retornam um número complexo, mesmo que a resposta possa ser expressa como um " "número real (nesse caso o número complexo tem uma parte imaginária de zero)." -#: ../../library/cmath.rst:314 +#: ../../library/cmath.rst:311 msgid "" "A note on branch cuts: They are curves along which the given function fails " "to be continuous. They are a necessary feature of many complex functions. " @@ -456,7 +478,7 @@ msgstr "" "Para informações sobre a escolha adequada dos cortes de ramificação para " "fins numéricos, uma boa referência deve ser a seguinte:" -#: ../../library/cmath.rst:324 +#: ../../library/cmath.rst:321 msgid "" "Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " "nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the " @@ -466,10 +488,10 @@ msgstr "" "nothing's sign bit. Em Iserles, A. e Powell, M. (eds.), The state of the " "art in numerical analysis. Clarendon Press (1987) pp165--211." -#: ../../library/cmath.rst:304 +#: ../../library/cmath.rst:301 msgid "module" msgstr "módulo" -#: ../../library/cmath.rst:304 +#: ../../library/cmath.rst:301 msgid "math" msgstr "math" diff --git a/library/cmd.po b/library/cmd.po index 1f4cdd051..a58afe41f 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Rafael Fontenelle , 2023 -# Adorilson Bezerra , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Adorilson Bezerra , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -313,6 +311,86 @@ msgid "" "attr:`~Cmd.cmdqueue` for immediate playback::" msgstr "" +#: ../../library/cmd.rst:255 +msgid "" +"import cmd, sys\n" +"from turtle import *\n" +"\n" +"class TurtleShell(cmd.Cmd):\n" +" intro = 'Welcome to the turtle shell. Type help or ? to list commands." +"\\n'\n" +" prompt = '(turtle) '\n" +" file = None\n" +"\n" +" # ----- basic turtle commands -----\n" +" def do_forward(self, arg):\n" +" 'Move the turtle forward by the specified distance: FORWARD 10'\n" +" forward(*parse(arg))\n" +" def do_right(self, arg):\n" +" 'Turn turtle right by given number of degrees: RIGHT 20'\n" +" right(*parse(arg))\n" +" def do_left(self, arg):\n" +" 'Turn turtle left by given number of degrees: LEFT 90'\n" +" left(*parse(arg))\n" +" def do_goto(self, arg):\n" +" 'Move turtle to an absolute position with changing orientation. " +"GOTO 100 200'\n" +" goto(*parse(arg))\n" +" def do_home(self, arg):\n" +" 'Return turtle to the home position: HOME'\n" +" home()\n" +" def do_circle(self, arg):\n" +" 'Draw circle with given radius an options extent and steps: CIRCLE " +"50'\n" +" circle(*parse(arg))\n" +" def do_position(self, arg):\n" +" 'Print the current turtle position: POSITION'\n" +" print('Current position is %d %d\\n' % position())\n" +" def do_heading(self, arg):\n" +" 'Print the current turtle heading in degrees: HEADING'\n" +" print('Current heading is %d\\n' % (heading(),))\n" +" def do_color(self, arg):\n" +" 'Set the color: COLOR BLUE'\n" +" color(arg.lower())\n" +" def do_undo(self, arg):\n" +" 'Undo (repeatedly) the last turtle action(s): UNDO'\n" +" def do_reset(self, arg):\n" +" 'Clear the screen and return turtle to center: RESET'\n" +" reset()\n" +" def do_bye(self, arg):\n" +" 'Stop recording, close the turtle window, and exit: BYE'\n" +" print('Thank you for using Turtle')\n" +" self.close()\n" +" bye()\n" +" return True\n" +"\n" +" # ----- record and playback -----\n" +" def do_record(self, arg):\n" +" 'Save future commands to filename: RECORD rose.cmd'\n" +" self.file = open(arg, 'w')\n" +" def do_playback(self, arg):\n" +" 'Playback commands from a file: PLAYBACK rose.cmd'\n" +" self.close()\n" +" with open(arg) as f:\n" +" self.cmdqueue.extend(f.read().splitlines())\n" +" def precmd(self, line):\n" +" line = line.lower()\n" +" if self.file and 'playback' not in line:\n" +" print(line, file=self.file)\n" +" return line\n" +" def close(self):\n" +" if self.file:\n" +" self.file.close()\n" +" self.file = None\n" +"\n" +"def parse(arg):\n" +" 'Convert a series of zero or more numbers to an argument tuple'\n" +" return tuple(map(int, arg.split()))\n" +"\n" +"if __name__ == '__main__':\n" +" TurtleShell().cmdloop()" +msgstr "" + #: ../../library/cmd.rst:330 msgid "" "Here is a sample session with the turtle shell showing the help functions, " @@ -320,6 +398,67 @@ msgid "" "facility:" msgstr "" +#: ../../library/cmd.rst:333 +msgid "" +"Welcome to the turtle shell. Type help or ? to list commands.\n" +"\n" +"(turtle) ?\n" +"\n" +"Documented commands (type help ):\n" +"========================================\n" +"bye color goto home playback record right\n" +"circle forward heading left position reset undo\n" +"\n" +"(turtle) help forward\n" +"Move the turtle forward by the specified distance: FORWARD 10\n" +"(turtle) record spiral.cmd\n" +"(turtle) position\n" +"Current position is 0 0\n" +"\n" +"(turtle) heading\n" +"Current heading is 0\n" +"\n" +"(turtle) reset\n" +"(turtle) circle 20\n" +"(turtle) right 30\n" +"(turtle) circle 40\n" +"(turtle) right 30\n" +"(turtle) circle 60\n" +"(turtle) right 30\n" +"(turtle) circle 80\n" +"(turtle) right 30\n" +"(turtle) circle 100\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) right 30\n" +"(turtle) circle 120\n" +"(turtle) heading\n" +"Current heading is 180\n" +"\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 100\n" +"(turtle)\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 500\n" +"(turtle) right 90\n" +"(turtle) forward 400\n" +"(turtle) right 90\n" +"(turtle) forward 300\n" +"(turtle) playback spiral.cmd\n" +"Current position is 0 0\n" +"\n" +"Current heading is 0\n" +"\n" +"Current heading is 180\n" +"\n" +"(turtle) bye\n" +"Thank you for using Turtle" +msgstr "" + #: ../../library/cmd.rst:64 msgid "? (question mark)" msgstr "? (interrogação)" diff --git a/library/cmdline.po b/library/cmdline.po index b72c37971..517e69da5 100644 --- a/library/cmdline.po +++ b/library/cmdline.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2023-10-13 14:16+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/code.po b/library/code.po index 7094aae9c..88d14d1a1 100644 --- a/library/code.po +++ b/library/code.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -67,6 +65,10 @@ msgid "" "class builds on :class:`InteractiveInterpreter` and adds prompting using the " "familiar ``sys.ps1`` and ``sys.ps2``, and input buffering." msgstr "" +"Emula de forma bem similiar o comportamento do interpretador Python " +"interativo. Esta classe se baseia em :class:`InteractiveInterpreter` e " +"adiciona prompting usando os familiares ``sys.ps1`` e ``sys.ps2``, e " +"buffering de entrada." #: ../../library/code.rst:35 msgid "" @@ -79,6 +81,15 @@ msgid "" "*banner* and *exitmsg* passed as the banner and exit message to use, if " "provided. The console object is discarded after use." msgstr "" +"Função de conveniência para executar um laço leitura-avaliação-exibição. " +"Isso cria uma nova instância de :class:`InteractiveConsole` e define " +"*readfunc* para ser usado como o método :meth:`InteractiveConsole." +"raw_input`, se fornecido. Se *local* for fornecido, ele é passado para o " +"construtor :class:`InteractiveConsole` para uso como o espaço de nomes " +"padrão para o laço do interpretador. O método :meth:`~InteractiveConsole." +"interact` da instância é então executado com *banner* e *exitmsg* passados ​​" +"como o banner e a mensagem de saída a serem usados, se fornecidos. O objeto " +"console é descartado após o uso." #: ../../library/code.rst:44 msgid "Added *exitmsg* parameter." diff --git a/library/codecs.po b/library/codecs.po index 0f2b0880d..b1c874383 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -4,29 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Welington Carlos , 2021 -# i17obot , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Marco Rougeth , 2022 -# Victor Matheus Castro , 2023 -# Rafael Fontenelle , 2023 -# Adorilson Bezerra , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/codeop.po b/library/codeop.po index 402eec210..011cd3e98 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/collections.abc.po b/library/collections.abc.po index 5034af362..23b82f156 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Vinícius Muniz de Melo , 2021 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -60,6 +57,24 @@ msgid "" "desired. Other methods may be added as needed:" msgstr "" +#: ../../library/collections.abc.rst:35 +msgid "" +"class C(Sequence): # Direct inheritance\n" +" def __init__(self): ... # Extra method not required by the " +"ABC\n" +" def __getitem__(self, index): ... # Required abstract method\n" +" def __len__(self): ... # Required abstract method\n" +" def count(self, value): ... # Optionally override a mixin method" +msgstr "" + +#: ../../library/collections.abc.rst:43 +msgid "" +">>> issubclass(C, Sequence)\n" +"True\n" +">>> isinstance(C(), Sequence)\n" +"True" +msgstr "" + #: ../../library/collections.abc.rst:50 msgid "" "2) Existing classes and built-in classes can be registered as \"virtual " @@ -70,6 +85,27 @@ msgid "" "rule is for methods that are automatically inferred from the rest of the API:" msgstr "" +#: ../../library/collections.abc.rst:58 +msgid "" +"class D: # No inheritance\n" +" def __init__(self): ... # Extra method not required by the " +"ABC\n" +" def __getitem__(self, index): ... # Abstract method\n" +" def __len__(self): ... # Abstract method\n" +" def count(self, value): ... # Mixin method\n" +" def index(self, value): ... # Mixin method\n" +"\n" +"Sequence.register(D) # Register instead of inherit" +msgstr "" + +#: ../../library/collections.abc.rst:69 +msgid "" +">>> issubclass(D, Sequence)\n" +"True\n" +">>> isinstance(D(), Sequence)\n" +"True" +msgstr "" + #: ../../library/collections.abc.rst:76 msgid "" "In this example, class :class:`!D` does not need to define ``__contains__``, " @@ -85,6 +121,21 @@ msgid "" "required methods (unless those methods have been set to :const:`None`):" msgstr "" +#: ../../library/collections.abc.rst:86 +msgid "" +"class E:\n" +" def __iter__(self): ...\n" +" def __next__(self): ..." +msgstr "" + +#: ../../library/collections.abc.rst:92 +msgid "" +">>> issubclass(E, Iterable)\n" +"True\n" +">>> isinstance(E(), Iterable)\n" +"True" +msgstr "" + #: ../../library/collections.abc.rst:99 msgid "" "Complex interfaces do not support this last technique because an interface " @@ -523,7 +574,7 @@ msgid "The index() method added support for *stop* and *start* arguments." msgstr "" "O método index() adicionou suporte para os argumentos *stop* e *start*." -#: ../../library/collections.abc.rst:281 +#: ../../library/collections.abc.rst:277 msgid "" "The :class:`ByteString` ABC has been deprecated. For use in typing, prefer a " "union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. For " @@ -623,6 +674,13 @@ msgid "" "functionality, for example::" msgstr "" +#: ../../library/collections.abc.rst:370 +msgid "" +"size = None\n" +"if isinstance(myvar, collections.abc.Sized):\n" +" size = len(myvar)" +msgstr "" + #: ../../library/collections.abc.rst:374 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " @@ -633,6 +691,32 @@ msgid "" "methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" msgstr "" +#: ../../library/collections.abc.rst:381 +msgid "" +"class ListBasedSet(collections.abc.Set):\n" +" ''' Alternate set implementation favoring space over speed\n" +" and not requiring the set elements to be hashable. '''\n" +" def __init__(self, iterable):\n" +" self.elements = lst = []\n" +" for value in iterable:\n" +" if value not in lst:\n" +" lst.append(value)\n" +"\n" +" def __iter__(self):\n" +" return iter(self.elements)\n" +"\n" +" def __contains__(self, value):\n" +" return value in self.elements\n" +"\n" +" def __len__(self):\n" +" return len(self.elements)\n" +"\n" +"s1 = ListBasedSet('abcdef')\n" +"s2 = ListBasedSet('defghi')\n" +"overlap = s1 & s2 # The __and__() method is supported " +"automatically" +msgstr "" + #: ../../library/collections.abc.rst:403 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "Notas sobre o uso de :class:`Set` e :class:`MutableSet` como um mixin:" diff --git a/library/collections.po b/library/collections.po index a15adc936..1198f28bc 100644 --- a/library/collections.po +++ b/library/collections.po @@ -4,31 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Welington Carlos , 2021 -# Alexandre B A Villares, 2021 -# Vitor Buxbaum Orlandi, 2021 -# João Porfirio, 2022 -# Hildeberto Abreu Magalhães , 2022 -# Jader Oliveira, 2022 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -265,12 +256,20 @@ msgstr "" #: ../../library/collections.rst:102 msgid "" -"Note, the iteration order of a :class:`ChainMap()` is determined by scanning " +"Note, the iteration order of a :class:`ChainMap` is determined by scanning " "the mappings last to first::" msgstr "" -"Observe, a ordem de iteração de um :class:`ChainMap()` é determinada pela " +"Observe, a ordem de iteração de um :class:`ChainMap` é determinada pela " "varredura dos mapeamentos do último ao primeiro::" +#: ../../library/collections.rst:105 +msgid "" +">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n" +">>> adjustments = {'art': 'van gogh', 'opera': 'carmen'}\n" +">>> list(ChainMap(adjustments, baseline))\n" +"['music', 'art', 'opera']" +msgstr "" + #: ../../library/collections.rst:110 msgid "" "This gives the same ordering as a series of :meth:`dict.update` calls " @@ -279,6 +278,14 @@ msgstr "" "Isso dá a mesma ordem de uma série de chamadas de :meth:`dict.update` " "começando com o último mapeamento::" +#: ../../library/collections.rst:113 +msgid "" +">>> combined = baseline.copy()\n" +">>> combined.update(adjustments)\n" +">>> list(combined)\n" +"['music', 'art', 'opera']" +msgstr "" + #: ../../library/collections.rst:118 msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`." msgstr "" @@ -344,6 +351,12 @@ msgstr "" msgid "Example of simulating Python's internal lookup chain::" msgstr "Exemplo de simulação da cadeia de busca interna do Python::" +#: ../../library/collections.rst:153 +msgid "" +"import builtins\n" +"pylookup = ChainMap(locals(), globals(), vars(builtins))" +msgstr "" + #: ../../library/collections.rst:156 msgid "" "Example of letting user specified command-line arguments take precedence " @@ -354,6 +367,24 @@ msgstr "" "pelo usuário tenham precedência sobre as variáveis de ambiente que, por sua " "vez, têm precedência sobre os valores padrão::" +#: ../../library/collections.rst:159 +msgid "" +"import os, argparse\n" +"\n" +"defaults = {'color': 'red', 'user': 'guest'}\n" +"\n" +"parser = argparse.ArgumentParser()\n" +"parser.add_argument('-u', '--user')\n" +"parser.add_argument('-c', '--color')\n" +"namespace = parser.parse_args()\n" +"command_line_args = {k: v for k, v in vars(namespace).items() if v is not " +"None}\n" +"\n" +"combined = ChainMap(command_line_args, os.environ, defaults)\n" +"print(combined['color'])\n" +"print(combined['user'])" +msgstr "" + #: ../../library/collections.rst:173 msgid "" "Example patterns for using the :class:`ChainMap` class to simulate nested " @@ -362,6 +393,26 @@ msgstr "" "Padrões de exemplo para utilização da classe :class:`ChainMap` para simular " "contextos aninhados::" +#: ../../library/collections.rst:176 +msgid "" +"c = ChainMap() # Create root context\n" +"d = c.new_child() # Create nested child context\n" +"e = c.new_child() # Child of c, independent from d\n" +"e.maps[0] # Current context dictionary -- like Python's " +"locals()\n" +"e.maps[-1] # Root context -- like Python's globals()\n" +"e.parents # Enclosing context chain -- like Python's nonlocals\n" +"\n" +"d['x'] = 1 # Set value in current context\n" +"d['x'] # Get first key in the chain of contexts\n" +"del d['x'] # Delete from current context\n" +"list(d) # All nested values\n" +"k in d # Check all nested values\n" +"len(d) # Number of nested values\n" +"d.items() # All nested items\n" +"dict(d) # Flatten into a regular dictionary" +msgstr "" + #: ../../library/collections.rst:192 msgid "" "The :class:`ChainMap` class only makes updates (writes and deletions) to the " @@ -374,6 +425,34 @@ msgstr "" "cadeia. Contudo, se há o desejo de escritas e remoções profundas, é fácil " "fazer uma subclasse que atualiza chaves encontradas mais a fundo na cadeia::" +#: ../../library/collections.rst:197 +msgid "" +"class DeepChainMap(ChainMap):\n" +" 'Variant of ChainMap that allows direct updates to inner scopes'\n" +"\n" +" def __setitem__(self, key, value):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" mapping[key] = value\n" +" return\n" +" self.maps[0][key] = value\n" +"\n" +" def __delitem__(self, key):\n" +" for mapping in self.maps:\n" +" if key in mapping:\n" +" del mapping[key]\n" +" return\n" +" raise KeyError(key)\n" +"\n" +">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': " +"'yellow'})\n" +">>> d['lion'] = 'orange' # update an existing key two levels down\n" +">>> d['snake'] = 'red' # new keys get added to the topmost dict\n" +">>> del d['elephant'] # remove an existing key one level down\n" +">>> d # display result\n" +"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})" +msgstr "" + #: ../../library/collections.rst:223 msgid ":class:`Counter` objects" msgstr "Objetos :class:`Counter`" @@ -386,6 +465,24 @@ msgstr "" "Uma ferramenta de contagem é fornecida para apoiar contas rápidas e " "convenientes. Por exemplo::" +#: ../../library/collections.rst:228 +msgid "" +">>> # Tally occurrences of words in a list\n" +">>> cnt = Counter()\n" +">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n" +"... cnt[word] += 1\n" +"...\n" +">>> cnt\n" +"Counter({'blue': 3, 'red': 2, 'green': 1})\n" +"\n" +">>> # Find the ten most common words in Hamlet\n" +">>> import re\n" +">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n" +">>> Counter(words).most_common(10)\n" +"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n" +" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]" +msgstr "" + #: ../../library/collections.rst:245 msgid "" "A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` " @@ -544,6 +641,19 @@ msgstr "" msgid "Common patterns for working with :class:`Counter` objects::" msgstr "Padrões comuns para trabalhar com objetos :class:`Counter`::" +#: ../../library/collections.rst:356 +msgid "" +"c.total() # total of all counts\n" +"c.clear() # reset all counts\n" +"list(c) # list unique elements\n" +"set(c) # convert to a set\n" +"dict(c) # convert to a regular dictionary\n" +"c.items() # convert to a list of (elem, cnt) pairs\n" +"Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs\n" +"c.most_common()[:-n-1:-1] # n least common elements\n" +"+c # remove zero and negative counts" +msgstr "" + #: ../../library/collections.rst:366 msgid "" "Several mathematical operations are provided for combining :class:`Counter` " @@ -563,6 +673,24 @@ msgstr "" "contagens assinadas, mas a saída vai excluir resultados com contagens de " "zero ou menos." +#: ../../library/collections.rst:374 +msgid "" +">>> c = Counter(a=3, b=1)\n" +">>> d = Counter(a=1, b=2)\n" +">>> c + d # add two counters together: c[x] + d[x]\n" +"Counter({'a': 4, 'b': 3})\n" +">>> c - d # subtract (keeping only positive counts)\n" +"Counter({'a': 2})\n" +">>> c & d # intersection: min(c[x], d[x])\n" +"Counter({'a': 1, 'b': 1})\n" +">>> c | d # union: max(c[x], d[x])\n" +"Counter({'a': 3, 'b': 2})\n" +">>> c == d # equality: c[x] == d[x]\n" +"False\n" +">>> c <= d # inclusion: c[x] <= d[x]\n" +"False" +msgstr "" + #: ../../library/collections.rst:391 msgid "" "Unary addition and subtraction are shortcuts for adding an empty counter or " @@ -687,6 +815,11 @@ msgstr "" "um determinado conjunto de elementos, consulte :func:`itertools." "combinations_with_replacement`::" +#: ../../library/collections.rst:447 +msgid "" +"map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC" +msgstr "" + #: ../../library/collections.rst:451 msgid ":class:`deque` objects" msgstr "Objetos :class:`deque`" @@ -893,6 +1026,62 @@ msgstr "" msgid "Example:" msgstr "Exemplo:" +#: ../../library/collections.rst:596 +msgid "" +">>> from collections import deque\n" +">>> d = deque('ghi') # make a new deque with three items\n" +">>> for elem in d: # iterate over the deque's elements\n" +"... print(elem.upper())\n" +"G\n" +"H\n" +"I\n" +"\n" +">>> d.append('j') # add a new entry to the right side\n" +">>> d.appendleft('f') # add a new entry to the left side\n" +">>> d # show the representation of the deque\n" +"deque(['f', 'g', 'h', 'i', 'j'])\n" +"\n" +">>> d.pop() # return and remove the rightmost item\n" +"'j'\n" +">>> d.popleft() # return and remove the leftmost item\n" +"'f'\n" +">>> list(d) # list the contents of the deque\n" +"['g', 'h', 'i']\n" +">>> d[0] # peek at leftmost item\n" +"'g'\n" +">>> d[-1] # peek at rightmost item\n" +"'i'\n" +"\n" +">>> list(reversed(d)) # list the contents of a deque in " +"reverse\n" +"['i', 'h', 'g']\n" +">>> 'h' in d # search the deque\n" +"True\n" +">>> d.extend('jkl') # add multiple elements at once\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +">>> d.rotate(1) # right rotation\n" +">>> d\n" +"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n" +">>> d.rotate(-1) # left rotation\n" +">>> d\n" +"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" +"\n" +">>> deque(reversed(d)) # make a new deque in reverse order\n" +"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n" +">>> d.clear() # empty the deque\n" +">>> d.pop() # cannot pop from an empty deque\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" d.pop()\n" +"IndexError: pop from an empty deque\n" +"\n" +">>> d.extendleft('abc') # extendleft() reverses the input " +"order\n" +">>> d\n" +"deque(['c', 'b', 'a'])" +msgstr "" + #: ../../library/collections.rst:651 msgid ":class:`deque` Recipes" msgstr "Receitas de :class:`deque`" @@ -909,6 +1098,14 @@ msgstr "" "Deques de comprimento limitado fornecem funcionalidade semelhante ao filtro " "``tail`` em Unix::" +#: ../../library/collections.rst:658 +msgid "" +"def tail(filename, n=10):\n" +" 'Return the last n lines of a file'\n" +" with open(filename) as f:\n" +" return deque(f, n)" +msgstr "" + #: ../../library/collections.rst:663 msgid "" "Another approach to using deques is to maintain a sequence of recently added " @@ -917,6 +1114,21 @@ msgstr "" "Outra abordagem para usar deques é manter uma sequência de elementos " "adicionados recentemente, acrescentando à direita e clicando à esquerda::" +#: ../../library/collections.rst:666 +msgid "" +"def moving_average(iterable, n=3):\n" +" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n" +" # https://en.wikipedia.org/wiki/Moving_average\n" +" it = iter(iterable)\n" +" d = deque(itertools.islice(it, n-1))\n" +" d.appendleft(0)\n" +" s = sum(d)\n" +" for elem in it:\n" +" s += elem - d.popleft()\n" +" d.append(elem)\n" +" yield s / n" +msgstr "" + #: ../../library/collections.rst:678 msgid "" "A `round-robin scheduler A D E B F C\"\n" +" iterators = deque(map(iter, iterables))\n" +" while iterators:\n" +" try:\n" +" while True:\n" +" yield next(iterators[0])\n" +" iterators.rotate(-1)\n" +" except StopIteration:\n" +" # Remove an exhausted iterator.\n" +" iterators.popleft()" +msgstr "" + #: ../../library/collections.rst:697 msgid "" "The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " @@ -944,6 +1171,14 @@ msgstr "" "pura de ``del d[n]`` depende do método ``rotate()`` para posicionar os " "elementos a serem retirados::" +#: ../../library/collections.rst:701 +msgid "" +"def delete_nth(d, n):\n" +" d.rotate(-n)\n" +" d.popleft()\n" +" d.rotate(n)" +msgstr "" + #: ../../library/collections.rst:706 msgid "" "To implement :class:`deque` slicing, use a similar approach applying :meth:" @@ -1275,6 +1510,23 @@ msgid "" msgstr "" "Adicionado o parâmetro *defaults* e o atributo :attr:`_field_defaults`." +#: ../../library/collections.rst:903 +msgid "" +">>> # Basic example\n" +">>> Point = namedtuple('Point', ['x', 'y'])\n" +">>> p = Point(11, y=22) # instantiate with positional or keyword " +"arguments\n" +">>> p[0] + p[1] # indexable like the plain tuple (11, 22)\n" +"33\n" +">>> x, y = p # unpack like a regular tuple\n" +">>> x, y\n" +"(11, 22)\n" +">>> p.x + p.y # fields also accessible by name\n" +"33\n" +">>> p # readable __repr__ with a name=value style\n" +"Point(x=11, y=22)" +msgstr "" + #: ../../library/collections.rst:919 msgid "" "Named tuples are especially useful for assigning field names to result " @@ -1283,6 +1535,25 @@ msgstr "" "Tuplas nomeadas são especialmente úteis para atribuir nomes de campos a " "tuplas de resultados retornadas pelos módulos :mod:`csv` ou :mod:`sqlite3`::" +#: ../../library/collections.rst:922 +msgid "" +"EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, " +"paygrade')\n" +"\n" +"import csv\n" +"for emp in map(EmployeeRecord._make, csv.reader(open(\"employees.csv\", " +"\"rb\"))):\n" +" print(emp.name, emp.title)\n" +"\n" +"import sqlite3\n" +"conn = sqlite3.connect('/companydata')\n" +"cursor = conn.cursor()\n" +"cursor.execute('SELECT name, age, title, department, paygrade FROM " +"employees')\n" +"for emp in map(EmployeeRecord._make, cursor.fetchall()):\n" +" print(emp.name, emp.title)" +msgstr "" + #: ../../library/collections.rst:935 msgid "" "In addition to the methods inherited from tuples, named tuples support three " @@ -1300,6 +1571,13 @@ msgstr "" "Método de classe que cria uma nova instância a partir de uma sequência " "existente ou iterável." +#: ../../library/collections.rst:943 +msgid "" +">>> t = [11, 22]\n" +">>> Point._make(t)\n" +"Point(x=11, y=22)" +msgstr "" + #: ../../library/collections.rst:951 msgid "" "Return a new :class:`dict` which maps field names to their corresponding " @@ -1308,6 +1586,13 @@ msgstr "" "Retorna um novo :class:`dict` que mapeia nomes de campo para seus " "respectivos valores:" +#: ../../library/collections.rst:954 +msgid "" +">>> p = Point(x=11, y=22)\n" +">>> p._asdict()\n" +"{'x': 11, 'y': 22}" +msgstr "" + #: ../../library/collections.rst:960 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." msgstr "Retorna um :class:`OrderedDict` em vez de um :class:`dict` normal." @@ -1333,6 +1618,17 @@ msgstr "" "Retorna uma nova instância da tupla nomeada substituindo os campos " "especificados por novos valores::" +#: ../../library/collections.rst:975 +msgid "" +">>> p = Point(x=11, y=22)\n" +">>> p._replace(x=33)\n" +"Point(x=33, y=22)\n" +"\n" +">>> for partnum, record in inventory.items():\n" +"... inventory[partnum] = record._replace(price=newprices[partnum], " +"timestamp=time.now())" +msgstr "" + #: ../../library/collections.rst:984 msgid "" "Tuple of strings listing the field names. Useful for introspection and for " @@ -1341,10 +1637,30 @@ msgstr "" "Tupla de strings listando os nomes dos campos. Útil para introspecção e para " "criar novos tipos de tuplas nomeadas a partir de tuplas nomeadas existentes." +#: ../../library/collections.rst:987 +msgid "" +">>> p._fields # view the field names\n" +"('x', 'y')\n" +"\n" +">>> Color = namedtuple('Color', 'red green blue')\n" +">>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)\n" +">>> Pixel(11, 22, 128, 255, 0)\n" +"Pixel(x=11, y=22, red=128, green=255, blue=0)" +msgstr "" + #: ../../library/collections.rst:999 msgid "Dictionary mapping field names to default values." msgstr "Dicionário mapeando nomes de campos para valores padrão." +#: ../../library/collections.rst:1001 +msgid "" +">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" +">>> Account._field_defaults\n" +"{'balance': 0}\n" +">>> Account('premium')\n" +"Account(type='premium', balance=0)" +msgstr "" + #: ../../library/collections.rst:1009 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" @@ -1371,6 +1687,23 @@ msgstr "" "alterar funcionalidades com uma subclasse. Veja como adicionar um campo " "calculado e um formato de impressão de largura fixa:" +#: ../../library/collections.rst:1026 +msgid "" +">>> class Point(namedtuple('Point', ['x', 'y'])):\n" +"... __slots__ = ()\n" +"... @property\n" +"... def hypot(self):\n" +"... return (self.x ** 2 + self.y ** 2) ** 0.5\n" +"... def __str__(self):\n" +"... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, " +"self.hypot)\n" +"\n" +">>> for p in Point(3, 4), Point(14, 5/7):\n" +"... print(p)\n" +"Point: x= 3.000 y= 4.000 hypot= 5.000\n" +"Point: x=14.000 y= 0.714 hypot=14.018" +msgstr "" + #: ../../library/collections.rst:1041 msgid "" "The subclass shown above sets ``__slots__`` to an empty tuple. This helps " @@ -1413,6 +1746,14 @@ msgstr "" "para tuplas nomeadas. Ele também fornece uma notação elegante usando a " "palavra reservada :keyword:`class`::" +#: ../../library/collections.rst:1067 +msgid "" +"class Component(NamedTuple):\n" +" part_number: int\n" +" weight: float\n" +" description: Optional[str] = None" +msgstr "" + #: ../../library/collections.rst:1072 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " @@ -1585,6 +1926,17 @@ msgstr "" "verdadeiro (o padrão) ou para o início se *último* for falso. Levanta :exc:" "`KeyError` se a *key* não existir:" +#: ../../library/collections.rst:1151 +msgid "" +">>> d = OrderedDict.fromkeys('abcde')\n" +">>> d.move_to_end('b')\n" +">>> ''.join(d)\n" +"'acdeb'\n" +">>> d.move_to_end('b', last=False)\n" +">>> ''.join(d)\n" +"'bacde'" +msgstr "" + #: ../../library/collections.rst:1163 msgid "" "In addition to the usual mapping methods, ordered dictionaries also support " @@ -1642,6 +1994,16 @@ msgstr "" "substituir uma entrada existente, a posição de inserção original será " "alterada e movida para o final::" +#: ../../library/collections.rst:1194 +msgid "" +"class LastUpdatedOrderedDict(OrderedDict):\n" +" 'Store items in the order the keys were last added'\n" +"\n" +" def __setitem__(self, key, value):\n" +" super().__setitem__(key, value)\n" +" self.move_to_end(key)" +msgstr "" + #: ../../library/collections.rst:1201 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" @@ -1650,6 +2012,71 @@ msgstr "" "Um :class:`OrderedDict` também seria útil para implementar variantes de :" "func:`functools.lru_cache`:" +#: ../../library/collections.rst:1204 +msgid "" +"from collections import OrderedDict\n" +"from time import time\n" +"\n" +"class TimeBoundedLRU:\n" +" \"LRU Cache that invalidates and refreshes old entries.\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxage=30):\n" +" self.cache = OrderedDict() # { args : (timestamp, result)}\n" +" self.func = func\n" +" self.maxsize = maxsize\n" +" self.maxage = maxage\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" timestamp, result = self.cache[args]\n" +" if time() - timestamp <= self.maxage:\n" +" return result\n" +" result = self.func(*args)\n" +" self.cache[args] = time(), result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(0)\n" +" return result" +msgstr "" + +#: ../../library/collections.rst:1231 +msgid "" +"class MultiHitLRUCache:\n" +" \"\"\" LRU cache that defers caching a result until\n" +" it has been requested multiple times.\n" +"\n" +" To avoid flushing the LRU cache with one-time requests,\n" +" we don't cache until a request has been made more than once.\n" +"\n" +" \"\"\"\n" +"\n" +" def __init__(self, func, maxsize=128, maxrequests=4096, cache_after=1):\n" +" self.requests = OrderedDict() # { uncached_key : request_count }\n" +" self.cache = OrderedDict() # { cached_key : function_result }\n" +" self.func = func\n" +" self.maxrequests = maxrequests # max number of uncached requests\n" +" self.maxsize = maxsize # max number of stored return " +"values\n" +" self.cache_after = cache_after\n" +"\n" +" def __call__(self, *args):\n" +" if args in self.cache:\n" +" self.cache.move_to_end(args)\n" +" return self.cache[args]\n" +" result = self.func(*args)\n" +" self.requests[args] = self.requests.get(args, 0) + 1\n" +" if self.requests[args] <= self.cache_after:\n" +" self.requests.move_to_end(args)\n" +" if len(self.requests) > self.maxrequests:\n" +" self.requests.popitem(0)\n" +" else:\n" +" self.requests.pop(args, None)\n" +" self.cache[args] = result\n" +" if len(self.cache) > self.maxsize:\n" +" self.cache.popitem(0)\n" +" return result" +msgstr "" + #: ../../library/collections.rst:1300 msgid ":class:`UserDict` objects" msgstr "Objetos :class:`UserDict`" diff --git a/library/colorsys.po b/library/colorsys.po index 6f63b5341..b712f7ae9 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Italo Penaforte , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Italo Penaforte , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -38,7 +37,7 @@ msgid "" "between colors expressed in the RGB (Red Green Blue) color space used in " "computer monitors and three other coordinate systems: YIQ, HLS (Hue " "Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of " -"these color spaces are floating point values. In the YIQ space, the Y " +"these color spaces are floating-point values. In the YIQ space, the Y " "coordinate is between 0 and 1, but the I and Q coordinates can be positive " "or negative. In all other spaces, the coordinates are all between 0 and 1." msgstr "" @@ -92,3 +91,12 @@ msgstr "Converte a cor de coordenadas HSV para coordenadas RGB." #: ../../library/colorsys.rst:59 msgid "Example::" msgstr "Exemplo::" + +#: ../../library/colorsys.rst:61 +msgid "" +">>> import colorsys\n" +">>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)\n" +"(0.5, 0.5, 0.4)\n" +">>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)\n" +"(0.2, 0.4, 0.4)" +msgstr "" diff --git a/library/compileall.po b/library/compileall.po index e08ca42fa..84cad4d4c 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -175,10 +174,8 @@ msgstr "" #: ../../library/compileall.rst:92 msgid "" "Use *N* workers to compile the files within the given directory. If ``0`` is " -"used, then the result of :func:`os.cpu_count()` will be used." +"used, then the result of :func:`os.cpu_count` will be used." msgstr "" -"Use *N* workers para compilar os arquivos dentro do diretório especificado. " -"Se ``0`` for usado, o resultado de :func:`os.cpu_count()` será usado." #: ../../library/compileall.rst:98 msgid "" @@ -545,6 +542,21 @@ msgstr "" "Para forçar uma recompilação de todos os arquivos :file:`.py` no " "subdiretório :file:`Lib/` e todos os seus subdiretórios::" +#: ../../library/compileall.rst:326 +msgid "" +"import compileall\n" +"\n" +"compileall.compile_dir('Lib/', force=True)\n" +"\n" +"# Perform same compilation, excluding files in .svn directories.\n" +"import re\n" +"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), force=True)\n" +"\n" +"# pathlib.Path objects can also be used.\n" +"import pathlib\n" +"compileall.compile_dir(pathlib.Path('Lib/'), force=True)" +msgstr "" + #: ../../library/compileall.rst:340 msgid "Module :mod:`py_compile`" msgstr "Módulo :mod:`py_compile`" diff --git a/library/concurrency.po b/library/concurrency.po index 37b1bdcc7..0a7e8a5c2 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Hildeberto Abreu Magalhães , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Hildeberto Abreu Magalhães , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index e897acf7b..7c54e63d1 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Vinicius Gubiani Ferreira , 2021 -# i17obot , 2021 -# Danilo Lima , 2021 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -86,6 +80,13 @@ msgid "" "callable. ::" msgstr "" +#: ../../library/concurrent.futures.rst:38 +msgid "" +"with ThreadPoolExecutor(max_workers=1) as executor:\n" +" future = executor.submit(pow, 323, 1235)\n" +" print(future.result())" +msgstr "" + #: ../../library/concurrent.futures.rst:44 msgid "Similar to :func:`map(fn, *iterables) ` except:" msgstr "" @@ -169,6 +170,16 @@ msgid "" "meth:`Executor.shutdown` were called with *wait* set to ``True``)::" msgstr "" +#: ../../library/concurrent.futures.rst:100 +msgid "" +"import shutil\n" +"with ThreadPoolExecutor(max_workers=4) as e:\n" +" e.submit(shutil.copy, 'src1.txt', 'dest1.txt')\n" +" e.submit(shutil.copy, 'src2.txt', 'dest2.txt')\n" +" e.submit(shutil.copy, 'src3.txt', 'dest3.txt')\n" +" e.submit(shutil.copy, 'src4.txt', 'dest4.txt')" +msgstr "" + #: ../../library/concurrent.futures.rst:107 msgid "Added *cancel_futures*." msgstr "Adicionado *cancel_futures*." @@ -189,10 +200,41 @@ msgid "" "waits on the results of another :class:`Future`. For example::" msgstr "" +#: ../../library/concurrent.futures.rst:120 +msgid "" +"import time\n" +"def wait_on_b():\n" +" time.sleep(5)\n" +" print(b.result()) # b will never complete because it is waiting on a.\n" +" return 5\n" +"\n" +"def wait_on_a():\n" +" time.sleep(5)\n" +" print(a.result()) # a will never complete because it is waiting on b.\n" +" return 6\n" +"\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=2)\n" +"a = executor.submit(wait_on_b)\n" +"b = executor.submit(wait_on_a)" +msgstr "" + #: ../../library/concurrent.futures.rst:136 msgid "And::" msgstr "" +#: ../../library/concurrent.futures.rst:138 +msgid "" +"def wait_on_future():\n" +" f = executor.submit(pow, 5, 2)\n" +" # This will never complete because there is only one worker thread and\n" +" # it is executing this function.\n" +" print(f.result())\n" +"\n" +"executor = ThreadPoolExecutor(max_workers=1)\n" +"executor.submit(wait_on_future)" +msgstr "" + #: ../../library/concurrent.futures.rst:150 msgid "" "An :class:`Executor` subclass that uses a pool of at most *max_workers* " @@ -257,6 +299,37 @@ msgstr "" msgid "ThreadPoolExecutor Example" msgstr "Exemplo de ThreadPoolExecutor" +#: ../../library/concurrent.futures.rst:198 +msgid "" +"import concurrent.futures\n" +"import urllib.request\n" +"\n" +"URLS = ['http://www.foxnews.com/',\n" +" 'http://www.cnn.com/',\n" +" 'http://europe.wsj.com/',\n" +" 'http://www.bbc.co.uk/',\n" +" 'http://nonexistant-subdomain.python.org/']\n" +"\n" +"# Retrieve a single page and report the URL and contents\n" +"def load_url(url, timeout):\n" +" with urllib.request.urlopen(url, timeout=timeout) as conn:\n" +" return conn.read()\n" +"\n" +"# We can use a with statement to ensure threads are cleaned up promptly\n" +"with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:\n" +" # Start the load operations and mark each future with its URL\n" +" future_to_url = {executor.submit(load_url, url, 60): url for url in " +"URLS}\n" +" for future in concurrent.futures.as_completed(future_to_url):\n" +" url = future_to_url[future]\n" +" try:\n" +" data = future.result()\n" +" except Exception as exc:\n" +" print('%r generated an exception: %s' % (url, exc))\n" +" else:\n" +" print('%r page is %d bytes' % (url, len(data)))" +msgstr "" + #: ../../library/concurrent.futures.rst:227 msgid "ProcessPoolExecutor" msgstr "```ProcessPoolExecutor```" @@ -361,6 +434,42 @@ msgstr "" msgid "ProcessPoolExecutor Example" msgstr "" +#: ../../library/concurrent.futures.rst:311 +msgid "" +"import concurrent.futures\n" +"import math\n" +"\n" +"PRIMES = [\n" +" 112272535095293,\n" +" 112582705942171,\n" +" 112272535095293,\n" +" 115280095190773,\n" +" 115797848077099,\n" +" 1099726899285419]\n" +"\n" +"def is_prime(n):\n" +" if n < 2:\n" +" return False\n" +" if n == 2:\n" +" return True\n" +" if n % 2 == 0:\n" +" return False\n" +"\n" +" sqrt_n = int(math.floor(math.sqrt(n)))\n" +" for i in range(3, sqrt_n + 1, 2):\n" +" if n % i == 0:\n" +" return False\n" +" return True\n" +"\n" +"def main():\n" +" with concurrent.futures.ProcessPoolExecutor() as executor:\n" +" for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):\n" +" print('%d is prime: %s' % (number, prime))\n" +"\n" +"if __name__ == '__main__':\n" +" main()" +msgstr "" + #: ../../library/concurrent.futures.rst:346 msgid "Future Objects" msgstr "" diff --git a/library/concurrent.po b/library/concurrent.po index 359a906b7..81d5fafd0 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/configparser.po b/library/configparser.po index 7aa9929bd..ce9f0fc77 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -4,10 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Leticia Portella , 2021 -# i17obot , 2021 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -15,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -102,6 +98,22 @@ msgstr "Início rápido" msgid "Let's take a very basic configuration file that looks like this:" msgstr "Vamos pegar um arquivo de configuração bem básico parecido com este:" +#: ../../library/configparser.rst:64 +msgid "" +"[DEFAULT]\n" +"ServerAliveInterval = 45\n" +"Compression = yes\n" +"CompressionLevel = 9\n" +"ForwardX11 = yes\n" +"\n" +"[forge.example]\n" +"User = hg\n" +"\n" +"[topsecret.server.example]\n" +"Port = 50022\n" +"ForwardX11 = no" +msgstr "" + #: ../../library/configparser.rst:79 msgid "" "The structure of INI files is described `in the following section " @@ -116,6 +128,25 @@ msgstr "" "escrever tais arquivos. Vamos começar criando o arquivo de configuração " "acima programaticamente." +#: ../../library/configparser.rst:85 +msgid "" +">>> import configparser\n" +">>> config = configparser.ConfigParser()\n" +">>> config['DEFAULT'] = {'ServerAliveInterval': '45',\n" +"... 'Compression': 'yes',\n" +"... 'CompressionLevel': '9'}\n" +">>> config['forge.example'] = {}\n" +">>> config['forge.example']['User'] = 'hg'\n" +">>> config['topsecret.server.example'] = {}\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['Port'] = '50022' # mutates the parser\n" +">>> topsecret['ForwardX11'] = 'no' # same here\n" +">>> config['DEFAULT']['ForwardX11'] = 'yes'\n" +">>> with open('example.ini', 'w') as configfile:\n" +"... config.write(configfile)\n" +"..." +msgstr "" + #: ../../library/configparser.rst:103 msgid "" "As you can see, we can treat a config parser much like a dictionary. There " @@ -135,6 +166,39 @@ msgstr "" "Agora que criamos e salvamos um arquivo de configuração, vamos lê-lo e " "explorar os dados que ele contém." +#: ../../library/configparser.rst:110 +msgid "" +">>> config = configparser.ConfigParser()\n" +">>> config.sections()\n" +"[]\n" +">>> config.read('example.ini')\n" +"['example.ini']\n" +">>> config.sections()\n" +"['forge.example', 'topsecret.server.example']\n" +">>> 'forge.example' in config\n" +"True\n" +">>> 'python.org' in config\n" +"False\n" +">>> config['forge.example']['User']\n" +"'hg'\n" +">>> config['DEFAULT']['Compression']\n" +"'yes'\n" +">>> topsecret = config['topsecret.server.example']\n" +">>> topsecret['ForwardX11']\n" +"'no'\n" +">>> topsecret['Port']\n" +"'50022'\n" +">>> for key in config['forge.example']: \n" +"... print(key)\n" +"user\n" +"compressionlevel\n" +"serveraliveinterval\n" +"compression\n" +"forwardx11\n" +">>> config['forge.example']['ForwardX11']\n" +"'yes'" +msgstr "" + #: ../../library/configparser.rst:142 msgid "" "As we can see above, the API is pretty straightforward. The only bit of " @@ -147,15 +211,43 @@ msgstr "" "[1]_. Observe também que as chaves nas seções não diferenciam maiúsculas de " "minúsculas e são armazenadas em letras minúsculas [1]_." -#: ../../library/configparser.rst:147 +#: ../../library/configparser.rst:147 ../../library/configparser.rst:966 msgid "" "It is possible to read several configurations into a single :class:" "`ConfigParser`, where the most recently added configuration has the highest " "priority. Any conflicting keys are taken from the more recent configuration " -"while the previously existing keys are retained." +"while the previously existing keys are retained. The example below reads in " +"an ``override.ini`` file, which will override any conflicting keys from the " +"``example.ini`` file." +msgstr "" +"É possível ler diversas configurações para um único :class:`ConfigParser`, " +"onde a configuração adicionada mais recentemente terá a maior prioridade. " +"Para quaisquer chaves repetidas serão usados os valores da configuração mais " +"recente, enquanto os valores das chaves anteriores serão ignorados. O " +"exemplo a seguir lê um arquivo chamado ``override.ini``, que irá substituir " +"chaves repetidas do arquivo ``example.ini``." + +#: ../../library/configparser.rst:154 ../../library/configparser.rst:973 +msgid "" +"[DEFAULT]\n" +"ServerAliveInterval = -1" msgstr "" -#: ../../library/configparser.rst:168 +#: ../../library/configparser.rst:159 ../../library/configparser.rst:978 +msgid "" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" +">>> with open('override.ini', 'w') as configfile:\n" +"... config_override.write(configfile)\n" +"...\n" +">>> config_override = configparser.ConfigParser()\n" +">>> config_override.read(['example.ini', 'override.ini'])\n" +"['example.ini', 'override.ini']\n" +">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" +"-1" +msgstr "" + +#: ../../library/configparser.rst:173 msgid "" "This behaviour is equivalent to a :meth:`ConfigParser.read` call with " "several files passed to the *filenames* parameter." @@ -163,11 +255,11 @@ msgstr "" "Este comportamento é equivalente a uma chamada :meth:`ConfigParser.read` com " "vários arquivos passados ​​para o parâmetro *filenames*." -#: ../../library/configparser.rst:173 +#: ../../library/configparser.rst:178 msgid "Supported Datatypes" msgstr "Tipos de dados suportados" -#: ../../library/configparser.rst:175 +#: ../../library/configparser.rst:180 msgid "" "Config parsers do not guess datatypes of values in configuration files, " "always storing them internally as strings. This means that if you need " @@ -178,7 +270,15 @@ msgstr "" "como strings. Isso significa que se você precisar de outros tipos de dados, " "deverá converter por conta própria:" -#: ../../library/configparser.rst:186 +#: ../../library/configparser.rst:184 +msgid "" +">>> int(topsecret['Port'])\n" +"50022\n" +">>> float(topsecret['CompressionLevel'])\n" +"9.0" +msgstr "" + +#: ../../library/configparser.rst:191 msgid "" "Since this task is so common, config parsers provide a range of handy getter " "methods to handle integers, floats and booleans. The last one is the most " @@ -198,7 +298,17 @@ msgstr "" "booleanos de ``'yes'``/``'no'``, ``'on'``/``'off'``, ``'true'`` /``'false'`` " "e ``'1'``/``'0'`` [1]_. Por exemplo:" -#: ../../library/configparser.rst:203 +#: ../../library/configparser.rst:199 +msgid "" +">>> topsecret.getboolean('ForwardX11')\n" +"False\n" +">>> config['forge.example'].getboolean('ForwardX11')\n" +"True\n" +">>> config.getboolean('forge.example', 'Compression')\n" +"True" +msgstr "" + +#: ../../library/configparser.rst:208 msgid "" "Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide " "equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` " @@ -210,11 +320,11 @@ msgstr "" "`~ConfigParser.getfloat` equivalentes. Você pode registrar seus próprios " "conversores e personalizar os fornecidos. [1]_" -#: ../../library/configparser.rst:209 +#: ../../library/configparser.rst:214 msgid "Fallback Values" msgstr "Valores reservas" -#: ../../library/configparser.rst:211 +#: ../../library/configparser.rst:216 msgid "" "As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " "method to provide fallback values:" @@ -222,7 +332,18 @@ msgstr "" "Assim como acontece com um dicionário, você pode usar o método :meth:" "`~ConfigParser.get` de uma seção para fornecer valores reservas (fallback):" -#: ../../library/configparser.rst:224 +#: ../../library/configparser.rst:219 +msgid "" +">>> topsecret.get('Port')\n" +"'50022'\n" +">>> topsecret.get('CompressionLevel')\n" +"'9'\n" +">>> topsecret.get('Cipher')\n" +">>> topsecret.get('Cipher', '3des-cbc')\n" +"'3des-cbc'" +msgstr "" + +#: ../../library/configparser.rst:229 msgid "" "Please note that default values have precedence over fallback values. For " "instance, in our example the ``'CompressionLevel'`` key was specified only " @@ -238,6 +359,12 @@ msgstr "" #: ../../library/configparser.rst:235 msgid "" +">>> topsecret.get('CompressionLevel', '3')\n" +"'9'" +msgstr "" + +#: ../../library/configparser.rst:240 +msgid "" "One more thing to be aware of is that the parser-level :meth:`~ConfigParser." "get` method provides a custom, more complex interface, maintained for " "backwards compatibility. When using this method, a fallback value can be " @@ -249,7 +376,14 @@ msgstr "" "valor substituto pode ser fornecido através do argumento somente-nomeado " "``fallback``:" -#: ../../library/configparser.rst:246 +#: ../../library/configparser.rst:245 +msgid "" +">>> config.get('forge.example', 'monster',\n" +"... fallback='No such things as monsters')\n" +"'No such things as monsters'" +msgstr "" + +#: ../../library/configparser.rst:251 msgid "" "The same ``fallback`` argument can be used with the :meth:`~ConfigParser." "getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " @@ -259,11 +393,22 @@ msgstr "" "`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat` e :meth:" "`~ConfigParser.getboolean`, por exemplo:" -#: ../../library/configparser.rst:262 +#: ../../library/configparser.rst:255 +msgid "" +">>> 'BatchMode' in topsecret\n" +"False\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"True\n" +">>> config['DEFAULT']['BatchMode'] = 'no'\n" +">>> topsecret.getboolean('BatchMode', fallback=True)\n" +"False" +msgstr "" + +#: ../../library/configparser.rst:267 msgid "Supported INI File Structure" msgstr "Estrutura dos arquivos INI" -#: ../../library/configparser.rst:264 +#: ../../library/configparser.rst:269 msgid "" "A configuration file consists of sections, each led by a ``[section]`` " "header, followed by key/value entries separated by a specific string (``=`` " @@ -287,7 +432,7 @@ msgstr "" "Dependendo do modo do analisador sintático, as linhas em branco podem ser " "tratadas como partes de valores multilinhas ou ignoradas." -#: ../../library/configparser.rst:274 +#: ../../library/configparser.rst:279 msgid "" "By default, a valid section name can be any string that does not contain '\\" "\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." @@ -295,7 +440,7 @@ msgstr "" "Por padrão, um nome de seção válido pode ser qualquer string que não " "contenha '\\\\n'. Para alterar isso, consulte :attr:`ConfigParser.SECTCRE`." -#: ../../library/configparser.rst:277 +#: ../../library/configparser.rst:282 msgid "" "Configuration files may include comments, prefixed by specific characters " "(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " @@ -305,15 +450,60 @@ msgstr "" "caracteres específicos (``#`` e ``;`` por padrão [1]_). Os comentários podem " "aparecer sozinhos em uma linha vazia, possivelmente identados. [1]_" -#: ../../library/configparser.rst:281 ../../library/configparser.rst:344 +#: ../../library/configparser.rst:286 ../../library/configparser.rst:349 msgid "For example:" msgstr "Por exemplo:" -#: ../../library/configparser.rst:329 +#: ../../library/configparser.rst:288 +msgid "" +"[Simple Values]\n" +"key=value\n" +"spaces in keys=allowed\n" +"spaces in values=allowed as well\n" +"spaces around the delimiter = obviously\n" +"you can also use : to delimit keys from values\n" +"\n" +"[All Values Are Strings]\n" +"values like this: 1000000\n" +"or this: 3.14159265359\n" +"are they treated as numbers? : no\n" +"integers, floats and booleans are held as: strings\n" +"can use the API to get converted values directly: true\n" +"\n" +"[Multiline Values]\n" +"chorus: I'm a lumberjack, and I'm okay\n" +" I sleep all night and I work all day\n" +"\n" +"[No Values]\n" +"key_without_value\n" +"empty string value here =\n" +"\n" +"[You can use comments]\n" +"# like this\n" +"; or this\n" +"\n" +"# By default only in an empty line.\n" +"# Inline comments can be harmful because they prevent users\n" +"# from using the delimiting characters as parts of values.\n" +"# That being said, this can be customized.\n" +"\n" +" [Sections Can Be Indented]\n" +" can_values_be_as_well = True\n" +" does_that_mean_anything_special = False\n" +" purpose = formatting for readability\n" +" multiline_values = are\n" +" handled just fine as\n" +" long as they are indented\n" +" deeper than the first line\n" +" of a value\n" +" # Did I mention we can indent comments, too?" +msgstr "" + +#: ../../library/configparser.rst:334 msgid "Interpolation of values" msgstr "Interpolação de valores" -#: ../../library/configparser.rst:331 +#: ../../library/configparser.rst:336 msgid "" "On top of the core functionality, :class:`ConfigParser` supports " "interpolation. This means values can be preprocessed before returning them " @@ -323,7 +513,7 @@ msgstr "" "interpolação. Isso significa que os valores podem ser pré-processados ​​antes " "de retorná-los das chamadas ``get()``." -#: ../../library/configparser.rst:339 +#: ../../library/configparser.rst:344 msgid "" "The default implementation used by :class:`ConfigParser`. It enables values " "to contain format strings which refer to other values in the same section, " @@ -335,7 +525,20 @@ msgstr "" "mesma seção ou valores na seção padrão especial [1]_. Valores padrão " "adicionais podem ser fornecidos na inicialização." -#: ../../library/configparser.rst:357 +#: ../../library/configparser.rst:351 +msgid "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: %(home_dir)s/lumberjack\n" +"my_pictures: %(my_dir)s/Pictures\n" +"\n" +"[Escape]\n" +"# use a %% to escape the % sign (% is the only character that needs to be " +"escaped):\n" +"gain: 80%%" +msgstr "" + +#: ../../library/configparser.rst:362 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -351,7 +554,7 @@ msgstr "" "portanto as chaves usadas na cadeia de referências não precisam ser " "especificadas em nenhuma ordem específica no arquivo de configuração." -#: ../../library/configparser.rst:364 +#: ../../library/configparser.rst:369 msgid "" "With ``interpolation`` set to ``None``, the parser would simply return " "``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" @@ -361,7 +564,7 @@ msgstr "" "simplesmente retornaria ``%(my_dir)s/Pictures`` como o valor de " "``my_pictures`` e ``%(home_dir)s/lumberjack`` como o valor de ``my_dir``." -#: ../../library/configparser.rst:372 +#: ../../library/configparser.rst:377 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -377,7 +580,7 @@ msgstr "" "``section:`` for omitida, a interpolação será padronizada para a seção atual " "(e possivelmente para os valores padrão da seção especial)." -#: ../../library/configparser.rst:379 +#: ../../library/configparser.rst:384 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" @@ -385,15 +588,48 @@ msgstr "" "Por exemplo, a configuração especificada acima com interpolação básica " "ficaria assim com interpolação estendida:" -#: ../../library/configparser.rst:393 +#: ../../library/configparser.rst:387 +msgid "" +"[Paths]\n" +"home_dir: /Users\n" +"my_dir: ${home_dir}/lumberjack\n" +"my_pictures: ${my_dir}/Pictures\n" +"\n" +"[Escape]\n" +"# use a $$ to escape the $ sign ($ is the only character that needs to be " +"escaped):\n" +"cost: $$80" +msgstr "" + +#: ../../library/configparser.rst:398 msgid "Values from other sections can be fetched as well:" msgstr "Valores de outras seções também podem ser obtidos:" -#: ../../library/configparser.rst:415 +#: ../../library/configparser.rst:400 +msgid "" +"[Common]\n" +"home_dir: /Users\n" +"library_dir: /Library\n" +"system_dir: /System\n" +"macports_dir: /opt/local\n" +"\n" +"[Frameworks]\n" +"Python: 3.2\n" +"path: ${Common:system_dir}/Library/Frameworks/\n" +"\n" +"[Arthur]\n" +"nickname: Two Sheds\n" +"last_name: Jackson\n" +"my_dir: ${Common:home_dir}/twosheds\n" +"my_pictures: ${my_dir}/Pictures\n" +"python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" +msgstr "" + +#: ../../library/configparser.rst:420 msgid "Mapping Protocol Access" msgstr "Acesso através do protocolo de mapeamento" -#: ../../library/configparser.rst:419 +#: ../../library/configparser.rst:424 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:" @@ -405,7 +641,7 @@ msgstr "" "dicionários. No caso de :mod:`configparser`, a implementação da interface de " "mapeamento está usando a notação ``parser['section']['option']``." -#: ../../library/configparser.rst:424 +#: ../../library/configparser.rst:429 msgid "" "``parser['section']`` in particular returns a proxy for the section's data " "in the parser. This means that the values are not copied but they are taken " @@ -420,7 +656,7 @@ msgstr "" "intermediário de seção, eles são, na verdade, modificados no analisador " "sintático original." -#: ../../library/configparser.rst:430 +#: ../../library/configparser.rst:435 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -432,7 +668,7 @@ msgstr "" "`~collections.abc.MutableMapping`. No entanto, existem algumas diferenças " "que devem ser levadas em consideração:" -#: ../../library/configparser.rst:435 +#: ../../library/configparser.rst:440 msgid "" "By default, all keys in sections are accessible in a case-insensitive manner " "[1]_. E.g. ``for option in parser[\"section\"]`` yields only " @@ -447,7 +683,13 @@ msgstr "" "padrão. Ao mesmo tempo, para uma seção que contém a chave ``'a'``, ambas as " "expressões retornam ``True``::" -#: ../../library/configparser.rst:443 +#: ../../library/configparser.rst:445 +msgid "" +"\"a\" in parser[\"section\"]\n" +"\"A\" in parser[\"section\"]" +msgstr "" + +#: ../../library/configparser.rst:448 msgid "" "All sections include ``DEFAULTSECT`` values as well which means that ``." "clear()`` on a section may not leave the section visibly empty. This is " @@ -463,23 +705,23 @@ msgstr "" "exclusão fará com que o valor padrão fique visível novamente. Tentar excluir " "um valor padrão causa um :exc:`KeyError`." -#: ../../library/configparser.rst:450 +#: ../../library/configparser.rst:455 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "``DEFAULTSECT`` não pode ser removido do analisador sintático:" -#: ../../library/configparser.rst:452 +#: ../../library/configparser.rst:457 msgid "trying to delete it raises :exc:`ValueError`," msgstr "tentar excluí-lo levanta :exc:`ValueError`," -#: ../../library/configparser.rst:454 +#: ../../library/configparser.rst:459 msgid "``parser.clear()`` leaves it intact," msgstr "``parser.clear()`` deixa-o intacto," -#: ../../library/configparser.rst:456 +#: ../../library/configparser.rst:461 msgid "``parser.popitem()`` never returns it." msgstr "``parser.popitem()`` nunca o retorna." -#: ../../library/configparser.rst:458 +#: ../../library/configparser.rst:463 msgid "" "``parser.get(section, option, **kwargs)`` - the second argument is **not** a " "fallback value. Note however that the section-level ``get()`` methods are " @@ -490,7 +732,7 @@ msgstr "" "seção são compatíveis tanto com o protocolo de mapeamento quanto com a API " "clássica do configparser." -#: ../../library/configparser.rst:462 +#: ../../library/configparser.rst:467 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -506,7 +748,7 @@ msgstr "" "*option*, *value* para uma ``section`` especificada, com todas as " "interpolações expandidas (a menos que ``raw=True`` seja fornecido)." -#: ../../library/configparser.rst:469 +#: ../../library/configparser.rst:474 msgid "" "The mapping protocol is implemented on top of the existing legacy API so " "that subclasses overriding the original interface still should have mappings " @@ -516,11 +758,11 @@ msgstr "" "que as subclasses que substituem a interface original ainda tenham " "mapeamentos funcionando conforme o esperado." -#: ../../library/configparser.rst:475 +#: ../../library/configparser.rst:480 msgid "Customizing Parser Behaviour" msgstr "Personalizando o comportamento do analisador sintático" -#: ../../library/configparser.rst:477 +#: ../../library/configparser.rst:482 msgid "" "There are nearly as many INI format variants as there are applications using " "it. :mod:`configparser` goes a long way to provide support for the largest " @@ -534,7 +776,7 @@ msgstr "" "funcionalidade padrão é determinada principalmente pelo histórico e é muito " "provável que você queira personalizar alguns dos recursos." -#: ../../library/configparser.rst:483 +#: ../../library/configparser.rst:488 msgid "" "The most common way to change the way a specific config parser works is to " "use the :meth:`!__init__` options:" @@ -542,11 +784,11 @@ msgstr "" "A maneira mais comum de alterar a forma como um analisador sintático de " "configuração específico funciona é usar as opções :meth:`!__init__`:" -#: ../../library/configparser.rst:486 +#: ../../library/configparser.rst:491 msgid "*defaults*, default value: ``None``" msgstr "*defaults*, valor padrão: ``None``" -#: ../../library/configparser.rst:488 +#: ../../library/configparser.rst:493 msgid "" "This option accepts a dictionary of key-value pairs which will be initially " "put in the ``DEFAULT`` section. This makes for an elegant way to support " @@ -558,7 +800,7 @@ msgstr "" "suporte a arquivos de configuração concisos que não especificam valores " "iguais ao padrão documentado." -#: ../../library/configparser.rst:493 +#: ../../library/configparser.rst:498 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`~ConfigParser.read_dict` before you read the actual file." @@ -566,11 +808,11 @@ msgstr "" "Dica: se você deseja especificar valores padrão para uma seção específica, " "use :meth:`~ConfigParser.read_dict` antes de ler o arquivo real." -#: ../../library/configparser.rst:496 +#: ../../library/configparser.rst:501 msgid "*dict_type*, default value: :class:`dict`" msgstr "*dict_type*, valor padrão: :class:`dict`" -#: ../../library/configparser.rst:498 +#: ../../library/configparser.rst:503 msgid "" "This option has a major impact on how the mapping protocol will behave and " "how the written configuration files look. With the standard dictionary, " @@ -582,7 +824,7 @@ msgstr "" "padrão, cada seção é armazenada na ordem em que foram adicionadas ao " "analisador sintático. O mesmo vale para opções dentro das seções." -#: ../../library/configparser.rst:503 +#: ../../library/configparser.rst:508 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." @@ -590,7 +832,7 @@ msgstr "" "Um tipo de dicionário alternativo pode ser usado, por exemplo, para ordenar " "as seções e opções ao fazer *write-back*." -#: ../../library/configparser.rst:506 +#: ../../library/configparser.rst:511 msgid "" "Please note: there are ways to add a set of key-value pairs in a single " "operation. When you use a regular dictionary in those operations, the order " @@ -600,11 +842,30 @@ msgstr "" "chave em uma única operação. Quando você usa um dicionário regular nessas " "operações, a classificação das chaves será ordenada. Por exemplo:" -#: ../../library/configparser.rst:528 +#: ../../library/configparser.rst:515 +msgid "" +">>> parser = configparser.ConfigParser()\n" +">>> parser.read_dict({'section1': {'key1': 'value1',\n" +"... 'key2': 'value2',\n" +"... 'key3': 'value3'},\n" +"... 'section2': {'keyA': 'valueA',\n" +"... 'keyB': 'valueB',\n" +"... 'keyC': 'valueC'},\n" +"... 'section3': {'foo': 'x',\n" +"... 'bar': 'y',\n" +"... 'baz': 'z'}\n" +"... })\n" +">>> parser.sections()\n" +"['section1', 'section2', 'section3']\n" +">>> [option for option in parser['section3']]\n" +"['foo', 'bar', 'baz']" +msgstr "" + +#: ../../library/configparser.rst:533 msgid "*allow_no_value*, default value: ``False``" msgstr "*allow_no_value*, valor padrão: ``False``" -#: ../../library/configparser.rst:530 +#: ../../library/configparser.rst:535 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`configparser`. The " @@ -616,11 +877,42 @@ msgstr "" "suportada por :mod:`configparser`. O parâmetro *allow_no_value* para o " "construtor pode ser usado para indicar que tais valores devem ser aceitos:" -#: ../../library/configparser.rst:565 +#: ../../library/configparser.rst:540 +msgid "" +">>> import configparser\n" +"\n" +">>> sample_config = \"\"\"\n" +"... [mysqld]\n" +"... user = mysql\n" +"... pid-file = /var/run/mysqld/mysqld.pid\n" +"... skip-external-locking\n" +"... old_passwords = 1\n" +"... skip-bdb\n" +"... # we don't need ACID today\n" +"... skip-innodb\n" +"... \"\"\"\n" +">>> config = configparser.ConfigParser(allow_no_value=True)\n" +">>> config.read_string(sample_config)\n" +"\n" +">>> # Settings with values are treated as before:\n" +">>> config[\"mysqld\"][\"user\"]\n" +"'mysql'\n" +"\n" +">>> # Settings without values provide None:\n" +">>> config[\"mysqld\"][\"skip-bdb\"]\n" +"\n" +">>> # Settings which aren't specified still raise an error:\n" +">>> config[\"mysqld\"][\"does-not-exist\"]\n" +"Traceback (most recent call last):\n" +" ...\n" +"KeyError: 'does-not-exist'" +msgstr "" + +#: ../../library/configparser.rst:570 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "*delimiters*, valor padrão: ``('=', ':')``" -#: ../../library/configparser.rst:567 +#: ../../library/configparser.rst:572 msgid "" "Delimiters are substrings that delimit keys from values within a section. " "The first occurrence of a delimiting substring on a line is considered a " @@ -631,7 +923,7 @@ msgstr "" "considerada um delimitador. Isso significa que os valores (mas não as " "chaves) podem conter os delimitadores." -#: ../../library/configparser.rst:571 +#: ../../library/configparser.rst:576 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." @@ -639,15 +931,15 @@ msgstr "" "Veja também o argumento *space_around_delimiters* para :meth:`ConfigParser." "write`." -#: ../../library/configparser.rst:574 +#: ../../library/configparser.rst:579 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "*comment_prefixes*, valor padrão: ``('#', ';')``" -#: ../../library/configparser.rst:576 +#: ../../library/configparser.rst:581 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "*inline_comment_prefixes*, valor padrão: ``None``" -#: ../../library/configparser.rst:578 +#: ../../library/configparser.rst:583 msgid "" "Comment prefixes are strings that indicate the start of a valid comment " "within a config file. *comment_prefixes* are used only on otherwise empty " @@ -664,7 +956,7 @@ msgstr "" "comentários embutidos estão desabilitados e ``'#'`` e ``';'`` são usados ​​" "como prefixos para comentários de linha inteira." -#: ../../library/configparser.rst:585 +#: ../../library/configparser.rst:590 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." @@ -672,7 +964,7 @@ msgstr "" "Nas versões anteriores do :mod:`configparser`, o comportamento correspondia " "a ``comment_prefixes=('#',';')`` e ``inline_comment_prefixes=(';',)``." -#: ../../library/configparser.rst:589 +#: ../../library/configparser.rst:594 msgid "" "Please note that config parsers don't support escaping of comment prefixes " "so using *inline_comment_prefixes* may prevent users from specifying option " @@ -689,11 +981,53 @@ msgstr "" "a única maneira de armazenar caracteres de prefixo de comentário no início " "de uma linha em valores multilinha é interpolar o prefixo, por exemplo::" -#: ../../library/configparser.rst:635 +#: ../../library/configparser.rst:601 +msgid "" +">>> from configparser import ConfigParser, ExtendedInterpolation\n" +">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" +">>> # the default BasicInterpolation could be used as well\n" +">>> parser.read_string(\"\"\"\n" +"... [DEFAULT]\n" +"... hash = #\n" +"...\n" +"... [hashes]\n" +"... shebang =\n" +"... ${hash}!/usr/bin/env python\n" +"... ${hash} -*- coding: utf-8 -*-\n" +"...\n" +"... extensions =\n" +"... enabled_extension\n" +"... another_extension\n" +"... #disabled_by_comment\n" +"... yet_another_extension\n" +"...\n" +"... interpolation not necessary = if # is not at line start\n" +"... even in multiline values = line #1\n" +"... line #2\n" +"... line #3\n" +"... \"\"\")\n" +">>> print(parser['hashes']['shebang'])\n" +"\n" +"#!/usr/bin/env python\n" +"# -*- coding: utf-8 -*-\n" +">>> print(parser['hashes']['extensions'])\n" +"\n" +"enabled_extension\n" +"another_extension\n" +"yet_another_extension\n" +">>> print(parser['hashes']['interpolation not necessary'])\n" +"if # is not at line start\n" +">>> print(parser['hashes']['even in multiline values'])\n" +"line #1\n" +"line #2\n" +"line #3" +msgstr "" + +#: ../../library/configparser.rst:640 msgid "*strict*, default value: ``True``" msgstr "*strict*, valor padrão: ``True``" -#: ../../library/configparser.rst:637 +#: ../../library/configparser.rst:642 msgid "" "When set to ``True``, the parser will not allow for any section or option " "duplicates while reading from a single source (using :meth:`~ConfigParser." @@ -706,7 +1040,7 @@ msgstr "" "`~ConfigParser.read_dict`). Recomenda-se usar analisadores sintáticos " "estritos em novas aplicações." -#: ../../library/configparser.rst:642 +#: ../../library/configparser.rst:647 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." @@ -714,11 +1048,11 @@ msgstr "" "Nas versões anteriores do :mod:`configparser`, o comportamento correspondia " "a ``strict=False``." -#: ../../library/configparser.rst:646 +#: ../../library/configparser.rst:651 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "*empty_lines_in_values*, valor padrão: ``True``" -#: ../../library/configparser.rst:648 +#: ../../library/configparser.rst:653 msgid "" "In config parsers, values can span multiple lines as long as they are " "indented more than the key that holds them. By default parsers also let " @@ -735,7 +1069,16 @@ msgstr "" "arquivos de configuração ficam grandes e complexos, é fácil para o usuário " "perder o controle da estrutura do arquivo. Tomemos por exemplo:" -#: ../../library/configparser.rst:663 +#: ../../library/configparser.rst:660 +msgid "" +"[Section]\n" +"key = multiline\n" +" value with a gotcha\n" +"\n" +" this = is still a part of the multiline value of 'key'" +msgstr "" + +#: ../../library/configparser.rst:668 msgid "" "This can be especially problematic for the user to see if she's using a " "proportional font to edit the file. That is why when your application does " @@ -749,7 +1092,7 @@ msgstr "" "proibi-los. Isso fará com que as linhas vazias dividam as chaves sempre. No " "exemplo acima, seriam produzidas duas chaves, ``key`` e ``this``." -#: ../../library/configparser.rst:669 +#: ../../library/configparser.rst:674 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " "``\"DEFAULT\"``)" @@ -757,7 +1100,7 @@ msgstr "" "*default_section*, valor padrão: ``configparser.DEFAULTSECT`` (isto é: " "``\"DEFAULT\"``)" -#: ../../library/configparser.rst:672 +#: ../../library/configparser.rst:677 msgid "" "The convention of allowing a special section of default values for other " "sections or interpolation purposes is a powerful concept of this library, " @@ -781,11 +1124,11 @@ msgstr "" "atributo ``parser_instance.default_section`` e pode ser modificado em tempo " "de execução (ou seja, para converter arquivos de um formato para outro)." -#: ../../library/configparser.rst:683 +#: ../../library/configparser.rst:688 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "*interpolation*, valor padrão: ``configparser.BasicInterpolation``" -#: ../../library/configparser.rst:685 +#: ../../library/configparser.rst:690 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -802,11 +1145,11 @@ msgstr "" "<#interpolation-of-values>`_. :class:`RawConfigParser` tem um valor padrão " "de ``None``." -#: ../../library/configparser.rst:692 +#: ../../library/configparser.rst:697 msgid "*converters*, default value: not set" msgstr "*converters*, valor padrão: não definido" -#: ../../library/configparser.rst:694 +#: ../../library/configparser.rst:699 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -831,7 +1174,7 @@ msgstr "" "getdecimal('section', 'key', fallback=0)`` e ``parser_instance['section']." "getdecimal('key', 0)``." -#: ../../library/configparser.rst:705 +#: ../../library/configparser.rst:710 msgid "" "If the converter needs to access the state of the parser, it can be " "implemented as a method on a config parser subclass. If the name of this " @@ -844,7 +1187,7 @@ msgstr "" "disponível em todos os intermediários de seção, na forma compatível com dict " "(veja o exemplo ``getdecimal()`` acima)." -#: ../../library/configparser.rst:710 +#: ../../library/configparser.rst:715 msgid "" "More advanced customization may be achieved by overriding default values of " "these parser attributes. The defaults are defined on the classes, so they " @@ -855,7 +1198,7 @@ msgstr "" "nas classes, portanto podem ser substituídos por subclasses ou por " "atribuição de atributos." -#: ../../library/configparser.rst:716 +#: ../../library/configparser.rst:721 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -870,7 +1213,20 @@ msgstr "" "especificando um dicionário personalizado de strings e seus resultados " "booleanos. Por exemplo:" -#: ../../library/configparser.rst:734 +#: ../../library/configparser.rst:727 +msgid "" +">>> custom = configparser.ConfigParser()\n" +">>> custom['section1'] = {'funky': 'nope'}\n" +">>> custom['section1'].getboolean('funky')\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: Not a boolean: nope\n" +">>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False}\n" +">>> custom['section1'].getboolean('funky')\n" +"False" +msgstr "" + +#: ../../library/configparser.rst:739 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." @@ -878,7 +1234,7 @@ msgstr "" "Outros pares booleanos típicos incluem ``accept``/``reject`` ou ``enabled``/" "``disabled``." -#: ../../library/configparser.rst:740 +#: ../../library/configparser.rst:745 msgid "" "This method transforms option names on every read, get, or set operation. " "The default converts the name to lowercase. This also means that when a " @@ -891,7 +1247,31 @@ msgstr "" "estarão em letras minúsculas. Substitua esse método se for inadequado. Por " "exemplo:" -#: ../../library/configparser.rst:770 +#: ../../library/configparser.rst:751 +msgid "" +">>> config = \"\"\"\n" +"... [Section1]\n" +"... Key = Value\n" +"...\n" +"... [Section2]\n" +"... AnotherKey = Value\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> list(typical['Section1'].keys())\n" +"['key']\n" +">>> list(typical['Section2'].keys())\n" +"['anotherkey']\n" +">>> custom = configparser.RawConfigParser()\n" +">>> custom.optionxform = lambda option: option\n" +">>> custom.read_string(config)\n" +">>> list(custom['Section1'].keys())\n" +"['Key']\n" +">>> list(custom['Section2'].keys())\n" +"['AnotherKey']" +msgstr "" + +#: ../../library/configparser.rst:775 msgid "" "The optionxform function transforms option names to a canonical form. This " "should be an idempotent function: if the name is already in canonical form, " @@ -901,7 +1281,7 @@ msgstr "" "deve ser uma função idempotente: se o nome já estiver na forma canônica, " "deverá ser retornado inalterado." -#: ../../library/configparser.rst:777 +#: ../../library/configparser.rst:782 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -915,7 +1295,28 @@ msgstr "" "lido como uma seção de nome ``\" larch \"``. Substitua esse atributo se " "for inadequado. Por exemplo:" -#: ../../library/configparser.rst:805 +#: ../../library/configparser.rst:788 +msgid "" +">>> import re\n" +">>> config = \"\"\"\n" +"... [Section 1]\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> typical = configparser.ConfigParser()\n" +">>> typical.read_string(config)\n" +">>> typical.sections()\n" +"['Section 1', ' Section 2 ']\n" +">>> custom = configparser.ConfigParser()\n" +">>> custom.SECTCRE = re.compile(r\"\\[ *(?P

[^]]+?) *\\]\")\n" +">>> custom.read_string(config)\n" +">>> custom.sections()\n" +"['Section 1', 'Section 2']" +msgstr "" + +#: ../../library/configparser.rst:810 msgid "" "While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " "option lines, it's not recommended to override it because that would " @@ -925,11 +1326,11 @@ msgstr "" "reconhecer linhas de opção, não é recomendado substituí-lo porque isso " "interferiria nas opções do construtor *allow_no_value* e *delimiters*." -#: ../../library/configparser.rst:811 +#: ../../library/configparser.rst:816 msgid "Legacy API Examples" msgstr "Exemplos de APIs legadas" -#: ../../library/configparser.rst:813 +#: ../../library/configparser.rst:818 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -944,19 +1345,97 @@ msgstr "" "A API legada é às vezes mais avançada, de baixo nível e totalmente " "contraintuitiva." -#: ../../library/configparser.rst:819 +#: ../../library/configparser.rst:824 msgid "An example of writing to a configuration file::" msgstr "Um exemplo de escrita em um arquivo de configuração::" -#: ../../library/configparser.rst:842 +#: ../../library/configparser.rst:826 +msgid "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"\n" +"# Please note that using RawConfigParser's set functions, you can assign\n" +"# non-string values to keys internally, but will receive an error when\n" +"# attempting to write to a file or when you get it in non-raw mode. Setting\n" +"# values using the mapping protocol or ConfigParser's set() does not allow\n" +"# such assignments to take place.\n" +"config.add_section('Section1')\n" +"config.set('Section1', 'an_int', '15')\n" +"config.set('Section1', 'a_bool', 'true')\n" +"config.set('Section1', 'a_float', '3.1415')\n" +"config.set('Section1', 'baz', 'fun')\n" +"config.set('Section1', 'bar', 'Python')\n" +"config.set('Section1', 'foo', '%(bar)s is %(baz)s!')\n" +"\n" +"# Writing our configuration file to 'example.cfg'\n" +"with open('example.cfg', 'w') as configfile:\n" +" config.write(configfile)" +msgstr "" + +#: ../../library/configparser.rst:847 msgid "An example of reading the configuration file again::" msgstr "Um exemplo de leitura do arquivo de configuração novamente::" -#: ../../library/configparser.rst:860 +#: ../../library/configparser.rst:849 +msgid "" +"import configparser\n" +"\n" +"config = configparser.RawConfigParser()\n" +"config.read('example.cfg')\n" +"\n" +"# getfloat() raises an exception if the value is not a float\n" +"# getint() and getboolean() also do this for their respective types\n" +"a_float = config.getfloat('Section1', 'a_float')\n" +"an_int = config.getint('Section1', 'an_int')\n" +"print(a_float + an_int)\n" +"\n" +"# Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.\n" +"# This is because we are using a RawConfigParser().\n" +"if config.getboolean('Section1', 'a_bool'):\n" +" print(config.get('Section1', 'foo'))" +msgstr "" + +#: ../../library/configparser.rst:865 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "Para obter interpolação, use :class:`ConfigParser`::" -#: ../../library/configparser.rst:893 +#: ../../library/configparser.rst:867 +msgid "" +"import configparser\n" +"\n" +"cfg = configparser.ConfigParser()\n" +"cfg.read('example.cfg')\n" +"\n" +"# Set the optional *raw* argument of get() to True if you wish to disable\n" +"# interpolation in a single get operation.\n" +"print(cfg.get('Section1', 'foo', raw=False)) # -> \"Python is fun!\"\n" +"print(cfg.get('Section1', 'foo', raw=True)) # -> \"%(bar)s is %(baz)s!\"\n" +"\n" +"# The optional *vars* argument is a dict with members that will take\n" +"# precedence in interpolation.\n" +"print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation',\n" +" 'baz': 'evil'}))\n" +"\n" +"# The optional *fallback* argument can be used to provide a fallback value\n" +"print(cfg.get('Section1', 'foo'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'foo', fallback='Monty is not.'))\n" +" # -> \"Python is fun!\"\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback='No such things as " +"monsters.'))\n" +" # -> \"No such things as monsters.\"\n" +"\n" +"# A bare print(cfg.get('Section1', 'monster')) would raise NoOptionError\n" +"# but we can also use:\n" +"\n" +"print(cfg.get('Section1', 'monster', fallback=None))\n" +" # -> None" +msgstr "" + +#: ../../library/configparser.rst:898 msgid "" "Default values are available in both types of ConfigParsers. They are used " "in interpolation if an option used is not defined elsewhere. ::" @@ -965,11 +1444,25 @@ msgstr "" "são usados ​​em interpolação se uma opção usada não estiver definida em outro " "lugar. ::" -#: ../../library/configparser.rst:911 +#: ../../library/configparser.rst:901 +msgid "" +"import configparser\n" +"\n" +"# New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each\n" +"config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'})\n" +"config.read('example.cfg')\n" +"\n" +"print(config.get('Section1', 'foo')) # -> \"Python is fun!\"\n" +"config.remove_option('Section1', 'bar')\n" +"config.remove_option('Section1', 'baz')\n" +"print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" +msgstr "" + +#: ../../library/configparser.rst:916 msgid "ConfigParser Objects" msgstr "Objetos ConfigParser" -#: ../../library/configparser.rst:915 +#: ../../library/configparser.rst:920 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -982,7 +1475,7 @@ msgstr "" "para a lista de seções, para as opções dentro de uma seção e para os valores " "padrão." -#: ../../library/configparser.rst:920 +#: ../../library/configparser.rst:925 msgid "" "When *delimiters* is given, it is used as the set of substrings that divide " "keys from values. When *comment_prefixes* is given, it will be used as the " @@ -997,7 +1490,7 @@ msgstr "" "*inline_comment_prefixes* for fornecido, ele será usado como o conjunto de " "substrings que prefixam comentários em linhas não vazias." -#: ../../library/configparser.rst:926 +#: ../../library/configparser.rst:931 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -1020,7 +1513,7 @@ msgstr "" "mantido para estes é ``None`` e eles são serializados sem o delimitador " "final." -#: ../../library/configparser.rst:936 +#: ../../library/configparser.rst:941 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -1037,7 +1530,7 @@ msgstr "" "analisado, mas será usado ao escrever configurações analisadas em um novo " "arquivo de configuração." -#: ../../library/configparser.rst:943 +#: ../../library/configparser.rst:948 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1052,7 +1545,7 @@ msgstr "" "``zc.buildout``. Mais sobre o assunto na `seção de documentação dedicada " "<#interpolation-of-values>`_." -#: ../../library/configparser.rst:949 +#: ../../library/configparser.rst:954 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -1066,7 +1559,7 @@ msgstr "" "(que converte nomes de opções para letras minúsculas), os valores ``foo " "%(bar)s`` e ``foo %(BAR)s`` são equivalentes." -#: ../../library/configparser.rst:955 +#: ../../library/configparser.rst:960 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -1080,11 +1573,11 @@ msgstr "" "conversor obtém seu próprio método :meth:`!get*()` correspondente no objeto " "analisador sintático e nos intermediários de seção." -#: ../../library/configparser.rst:961 +#: ../../library/configparser.rst:991 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "O padrão *dict_type* é :class:`collections.OrderedDict`." -#: ../../library/configparser.rst:964 +#: ../../library/configparser.rst:994 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." @@ -1093,11 +1586,11 @@ msgstr "" "*empty_lines_in_values*, *default_section* e *interpolation* foram " "adicionados." -#: ../../library/configparser.rst:969 +#: ../../library/configparser.rst:999 msgid "The *converters* argument was added." msgstr "O argumento *converters* foi adicionado." -#: ../../library/configparser.rst:972 +#: ../../library/configparser.rst:1002 msgid "" "The *defaults* argument is read with :meth:`read_dict()`, providing " "consistent behavior across the parser: non-string keys and values are " @@ -1107,7 +1600,7 @@ msgstr "" "comportamento consistente em todo o analisador: chaves e valores que não são " "de string são convertidos implicitamente em strings." -#: ../../library/configparser.rst:977 ../../library/configparser.rst:1240 +#: ../../library/configparser.rst:1007 ../../library/configparser.rst:1270 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." @@ -1115,11 +1608,11 @@ msgstr "" "O *dict_type* padrão é :class:`dict`, pois agora preserva a ordem de " "inserção." -#: ../../library/configparser.rst:983 +#: ../../library/configparser.rst:1013 msgid "Return a dictionary containing the instance-wide defaults." msgstr "Retorna um dicionário contendo os padrões de toda a instância." -#: ../../library/configparser.rst:988 +#: ../../library/configparser.rst:1018 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." @@ -1127,7 +1620,7 @@ msgstr "" "Retorna uma lista das seções disponíveis; a *seção padrão* não está incluída " "na lista." -#: ../../library/configparser.rst:994 +#: ../../library/configparser.rst:1024 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -1139,11 +1632,11 @@ msgstr "" "da *seção padrão* for passado, :exc:`ValueError` será levantada. O nome da " "seção deve ser uma string; caso contrário, :exc:`TypeError` será levantada." -#: ../../library/configparser.rst:999 +#: ../../library/configparser.rst:1029 msgid "Non-string section names raise :exc:`TypeError`." msgstr "Nomes de seções sem string levantam :exc:`TypeError`." -#: ../../library/configparser.rst:1005 +#: ../../library/configparser.rst:1035 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." @@ -1151,11 +1644,11 @@ msgstr "" "Indica se a *section* nomeada está presente na configuração. A *seção " "padrão* não é reconhecida." -#: ../../library/configparser.rst:1011 +#: ../../library/configparser.rst:1041 msgid "Return a list of options available in the specified *section*." msgstr "Retorna uma lista de opções disponíveis na *section* especificada." -#: ../../library/configparser.rst:1016 +#: ../../library/configparser.rst:1046 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " @@ -1165,7 +1658,7 @@ msgstr "" "const:`True`; caso contrário, retorna :const:`False`. Se a *section* " "especificada for :const:`None` ou uma string vazia, DEFAULT será presumido." -#: ../../library/configparser.rst:1023 +#: ../../library/configparser.rst:1053 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." @@ -1173,7 +1666,7 @@ msgstr "" "Tenta ler e analisar um iterável de nomes de arquivos, retornando uma lista " "de nomes de arquivos que foram analisados ​​com sucesso." -#: ../../library/configparser.rst:1026 +#: ../../library/configparser.rst:1056 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -1192,7 +1685,7 @@ msgstr "" "sistema) e todos os arquivos de configuração existentes no iterável serão " "lidos." -#: ../../library/configparser.rst:1035 +#: ../../library/configparser.rst:1065 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -1205,7 +1698,17 @@ msgstr "" "necessários usando :meth:`read_file` antes de chamar :meth:`read` para " "quaisquer arquivos opcionais::" -#: ../../library/configparser.rst:1048 +#: ../../library/configparser.rst:1071 +msgid "" +"import configparser, os\n" +"\n" +"config = configparser.ConfigParser()\n" +"config.read_file(open('defaults.cfg'))\n" +"config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" +" encoding='cp1250')" +msgstr "" + +#: ../../library/configparser.rst:1078 msgid "" "Added the *encoding* parameter. Previously, all files were read using the " "default encoding for :func:`open`." @@ -1213,15 +1716,15 @@ msgstr "" "Adicionado o parâmetro *encoding*. Anteriormente, todos os arquivos eram " "lidos usando a codificação padrão para :func:`open`." -#: ../../library/configparser.rst:1052 +#: ../../library/configparser.rst:1082 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "O parâmetro *filenames* aceita um :term:`objeto caminho ou similar`." -#: ../../library/configparser.rst:1055 +#: ../../library/configparser.rst:1085 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "O parâmetro *filenames* aceita um objeto :class:`bytes`." -#: ../../library/configparser.rst:1061 +#: ../../library/configparser.rst:1091 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." @@ -1229,7 +1732,7 @@ msgstr "" "Lê e analisa dados de configuração de *f* que devem ser iteráveis, " "produzindo strings Unicode (por exemplo, arquivos abertos em modo texto)." -#: ../../library/configparser.rst:1064 +#: ../../library/configparser.rst:1094 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`!name` attribute, that is used for *source*; " @@ -1239,15 +1742,15 @@ msgstr "" "lido. Se não for fornecido e *f* tiver um atributo :attr:`!name`, que é " "usado para *source*; o padrão é ``''``." -#: ../../library/configparser.rst:1068 +#: ../../library/configparser.rst:1098 msgid "Replaces :meth:`!readfp`." msgstr "Substitui :meth:`!readfp`." -#: ../../library/configparser.rst:1073 +#: ../../library/configparser.rst:1103 msgid "Parse configuration data from a string." msgstr "Analisa dados de configuração de uma string." -#: ../../library/configparser.rst:1075 +#: ../../library/configparser.rst:1105 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " @@ -1257,7 +1760,7 @@ msgstr "" "string passada. Se não for fornecido, ``''`` será usado. Geralmente " "deve ser um caminho do sistema de arquivos ou uma URL." -#: ../../library/configparser.rst:1084 +#: ../../library/configparser.rst:1114 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -1271,7 +1774,7 @@ msgstr "" "usado preservar a ordem, as seções e suas chaves serão adicionadas em ordem. " "Os valores são convertidos automaticamente em strings." -#: ../../library/configparser.rst:1090 +#: ../../library/configparser.rst:1120 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." @@ -1279,13 +1782,13 @@ msgstr "" "O argumento opcional *source* especifica um nome específico do contexto do " "dicionário passado. Se não for fornecido, ```` será usado." -#: ../../library/configparser.rst:1093 +#: ../../library/configparser.rst:1123 msgid "This method can be used to copy state between parsers." msgstr "" "Este método pode ser usado para copiar o estado entre analisadores " "sintáticos." -#: ../../library/configparser.rst:1100 +#: ../../library/configparser.rst:1130 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -1299,7 +1802,7 @@ msgstr "" "encontrada e *fallback* for fornecido, ele será usado como um valor " "alternativo. ``None`` pode ser fornecido como um valor *fallback*." -#: ../../library/configparser.rst:1106 +#: ../../library/configparser.rst:1136 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " @@ -1309,7 +1812,7 @@ msgstr "" "menos que o argumento *raw* seja verdadeiro. Os valores das chaves de " "interpolação são consultados da mesma maneira que a opção." -#: ../../library/configparser.rst:1110 +#: ../../library/configparser.rst:1140 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " @@ -1319,7 +1822,7 @@ msgstr "" "proteger os usuários de tentarem usar o terceiro argumento como substituto " "*fallback* (especialmente ao usar o protocolo de mapeamento)." -#: ../../library/configparser.rst:1118 +#: ../../library/configparser.rst:1148 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " @@ -1329,14 +1832,17 @@ msgstr "" "um número inteiro. Veja :meth:`get` para explicação de *raw*, *vars* e " "*fallback*." -#: ../../library/configparser.rst:1125 +#: ../../library/configparser.rst:1155 msgid "" "A convenience method which coerces the *option* in the specified *section* " -"to a floating point number. See :meth:`get` for explanation of *raw*, " +"to a floating-point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" +"Um método de conveniência que força a *option* na *section* especificada ser " +"um número de ponto flutuante. Veja :meth:`get` para explicação de *raw*, " +"*vars* e *fallback*." -#: ../../library/configparser.rst:1132 +#: ../../library/configparser.rst:1162 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -1356,7 +1862,7 @@ msgstr "" "levante :exc:`ValueError`. Veja :meth:`get` para explicação de *raw*, *vars* " "e *fallback*." -#: ../../library/configparser.rst:1145 +#: ../../library/configparser.rst:1175 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." @@ -1364,7 +1870,7 @@ msgstr "" "Quando *section* não é fornecido, retorna uma lista de pares *section_name*, " "*section_proxy*, incluindo DEFAULTSECT." -#: ../../library/configparser.rst:1148 +#: ../../library/configparser.rst:1178 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" @@ -1374,7 +1880,7 @@ msgstr "" "*section* fornecida. Argumentos opcionais têm o mesmo significado do método :" "meth:`get`." -#: ../../library/configparser.rst:1152 +#: ../../library/configparser.rst:1182 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " @@ -1384,7 +1890,7 @@ msgstr "" "anterior misturava opções reais do analisador sintático com variáveis ​​" "fornecidas para interpolação." -#: ../../library/configparser.rst:1160 +#: ../../library/configparser.rst:1190 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " @@ -1394,7 +1900,7 @@ msgstr "" "especificado; caso contrário, levanta :exc:`NoSectionError`. *option* e " "*value* devem ser strings; caso contrário, :exc:`TypeError` será levantada." -#: ../../library/configparser.rst:1167 +#: ../../library/configparser.rst:1197 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -1408,7 +1914,7 @@ msgstr "" "*space_around_delimiters* for verdadeiro, os delimitadores entre chaves e " "valores serão envoltos por espaços." -#: ../../library/configparser.rst:1175 +#: ../../library/configparser.rst:1205 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " @@ -1418,7 +1924,7 @@ msgstr "" "escrever a configuração. O que é considerado um comentário depende dos " "valores fornecidos para *comment_prefix* e *inline_comment_prefix*." -#: ../../library/configparser.rst:1183 +#: ../../library/configparser.rst:1213 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " @@ -1428,7 +1934,7 @@ msgstr "" "existir, levanta :exc:`NoSectionError`. Se existisse a opção de ser " "removida, retorna :const:`True`; caso contrário, retorna :const:`False`." -#: ../../library/configparser.rst:1191 +#: ../../library/configparser.rst:1221 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." @@ -1436,7 +1942,7 @@ msgstr "" "Remove a *section* especificada da configuração. Se a seção de fato existiu, " "retorna ``True``. Caso contrário, retorna ``False``." -#: ../../library/configparser.rst:1197 +#: ../../library/configparser.rst:1227 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1451,7 +1957,7 @@ msgstr "" "cliente pode definir um atributo com esse nome nas instâncias para afetar " "esse comportamento." -#: ../../library/configparser.rst:1203 +#: ../../library/configparser.rst:1233 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1464,7 +1970,13 @@ msgstr "" "por exemplo, faria com que sejam diferenciadas as letras maiúsculas das " "minúsculas nos nomes das opções::" -#: ../../library/configparser.rst:1211 +#: ../../library/configparser.rst:1238 +msgid "" +"cfgparser = ConfigParser()\n" +"cfgparser.optionxform = str" +msgstr "" + +#: ../../library/configparser.rst:1241 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." @@ -1472,7 +1984,7 @@ msgstr "" "Observe que ao ler arquivos de configuração, os espaços em branco ao redor " "dos nomes das opções são removidos antes de :meth:`optionxform` ser chamado." -#: ../../library/configparser.rst:1217 +#: ../../library/configparser.rst:1247 msgid "" "The maximum depth for recursive interpolation for :meth:`~configparser." "ConfigParser.get` when the *raw* parameter is false. This is relevant only " @@ -1482,11 +1994,11 @@ msgstr "" "ConfigParser.get` quando o parâmetro *raw* é falso. Isso é relevante apenas " "quando a *interpolation* padrão é usada." -#: ../../library/configparser.rst:1225 +#: ../../library/configparser.rst:1255 msgid "RawConfigParser Objects" msgstr "Objetos RawConfigParser" -#: ../../library/configparser.rst:1235 +#: ../../library/configparser.rst:1265 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1498,7 +2010,7 @@ msgstr "" "opções e valores através de seus métodos inseguros ``add_section`` e " "``set``, bem como o tratamento de argumentos nomeados legados ``defaults=`` ." -#: ../../library/configparser.rst:1245 +#: ../../library/configparser.rst:1275 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " @@ -1508,7 +2020,7 @@ msgstr "" "serem armazenados internamente. Se você não quiser interpolação, você pode " "usar ``ConfigParser(interpolation=None)``." -#: ../../library/configparser.rst:1252 +#: ../../library/configparser.rst:1282 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -1518,7 +2030,7 @@ msgstr "" "com o nome fornecido, :exc:`DuplicateSectionError` será levantada. Se o nome " "da *seção padrão* for passado, :exc:`ValueError` será levantada." -#: ../../library/configparser.rst:1256 +#: ../../library/configparser.rst:1286 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." @@ -1527,7 +2039,7 @@ msgstr "" "seções nomeadas sem string. Este comportamento não é compatível e pode " "causar erros internos." -#: ../../library/configparser.rst:1262 +#: ../../library/configparser.rst:1292 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1543,7 +2055,7 @@ msgstr "" "valores não-string, funcionalidade completa (incluindo interpolação e saída " "para arquivos) só pode ser alcançado usando valores de string." -#: ../../library/configparser.rst:1269 +#: ../../library/configparser.rst:1299 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1555,19 +2067,19 @@ msgstr "" "escrever em um arquivo ou obtê-lo no modo não bruto. **Use a API do " "protocolo de mapeamento** que não permite que tais atribuições ocorram." -#: ../../library/configparser.rst:1276 +#: ../../library/configparser.rst:1306 msgid "Exceptions" msgstr "Exceções" -#: ../../library/configparser.rst:1280 +#: ../../library/configparser.rst:1310 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "Classe base para todas as outras exceções do :mod:`configparser`." -#: ../../library/configparser.rst:1285 +#: ../../library/configparser.rst:1315 msgid "Exception raised when a specified section is not found." msgstr "Exceção levantada quando uma seção especificada não é encontrada." -#: ../../library/configparser.rst:1290 +#: ../../library/configparser.rst:1320 msgid "" "Exception raised if :meth:`~ConfigParser.add_section` is called with the " "name of a section that is already present or in strict parsers when a " @@ -1578,7 +2090,7 @@ msgstr "" "estritos quando uma seção for encontrada mais de uma vez em um único arquivo " "de entrada, string ou dicionário." -#: ../../library/configparser.rst:1294 +#: ../../library/configparser.rst:1324 msgid "" "Added the optional *source* and *lineno* attributes and parameters to :meth:" "`!__init__`." @@ -1586,7 +2098,7 @@ msgstr "" "Adicionados os atributos e parâmetros opcionais *source* e *lineno* a :meth:" "`!__init__`." -#: ../../library/configparser.rst:1301 +#: ../../library/configparser.rst:1331 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1600,7 +2112,7 @@ msgstr "" "pode ter duas chaves representando a mesma chave de configuração que não " "diferencia maiúsculas de minúsculas." -#: ../../library/configparser.rst:1309 +#: ../../library/configparser.rst:1339 msgid "" "Exception raised when a specified option is not found in the specified " "section." @@ -1608,7 +2120,7 @@ msgstr "" "Exceção levantada quando uma opção especificada não é encontrada na seção " "especificada." -#: ../../library/configparser.rst:1315 +#: ../../library/configparser.rst:1345 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." @@ -1616,7 +2128,7 @@ msgstr "" "Classe base para exceções levantadas quando ocorrem problemas ao executar a " "interpolação de strings." -#: ../../library/configparser.rst:1321 +#: ../../library/configparser.rst:1351 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" @@ -1626,7 +2138,7 @@ msgstr "" "porque o número de iterações excede :const:`MAX_INTERPOLATION_DEPTH`. " "Subclasse de :exc:`InterpolationError`." -#: ../../library/configparser.rst:1328 +#: ../../library/configparser.rst:1358 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." @@ -1634,7 +2146,7 @@ msgstr "" "Exceção levantada quando uma opção referenciada a partir de um valor não " "existe. Subclasse de :exc:`InterpolationError`." -#: ../../library/configparser.rst:1334 +#: ../../library/configparser.rst:1364 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." @@ -1643,7 +2155,7 @@ msgstr "" "não está em conformidade com a sintaxe exigida. Subclasse de :exc:" "`InterpolationError`." -#: ../../library/configparser.rst:1340 +#: ../../library/configparser.rst:1370 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." @@ -1651,11 +2163,11 @@ msgstr "" "Exceção levantada ao tentar analisar um arquivo que não possui cabeçalhos de " "seção." -#: ../../library/configparser.rst:1346 +#: ../../library/configparser.rst:1376 msgid "Exception raised when errors occur attempting to parse a file." msgstr "Exceção levantada quando ocorrem erros ao tentar analisar um arquivo." -#: ../../library/configparser.rst:1348 +#: ../../library/configparser.rst:1378 msgid "" "The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." @@ -1663,11 +2175,11 @@ msgstr "" "O atributo ``filename`` e o argumento do construtor :meth:`!__init__` foram " "removidos. Eles estiveram disponíveis usando o nome ``source`` desde 3.2." -#: ../../library/configparser.rst:1353 +#: ../../library/configparser.rst:1383 msgid "Footnotes" msgstr "Notas de rodapé" -#: ../../library/configparser.rst:1354 +#: ../../library/configparser.rst:1384 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " @@ -1698,14 +2210,14 @@ msgstr "arquivo ini" msgid "Windows ini file" msgstr "arquivo ini do Windows" -#: ../../library/configparser.rst:335 +#: ../../library/configparser.rst:340 msgid "% (percent)" msgstr "% (porcentagem)" -#: ../../library/configparser.rst:335 ../../library/configparser.rst:368 +#: ../../library/configparser.rst:340 ../../library/configparser.rst:373 msgid "interpolation in configuration files" msgstr "interpolação em arquivos de configuração" -#: ../../library/configparser.rst:368 +#: ../../library/configparser.rst:373 msgid "$ (dollar)" msgstr "$ (dólar)" diff --git a/library/constants.po b/library/constants.po index d1b289e18..4bcc92126 100644 --- a/library/constants.po +++ b/library/constants.po @@ -4,8 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Sheila Gomes , 2021 -# Gabriel Crispino , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -13,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/contextlib.po b/library/contextlib.po index 6db61ccf6..1516fac06 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -90,10 +87,32 @@ msgid "" "management::" msgstr "" +#: ../../library/contextlib.rst:57 +msgid "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def managed_resource(*args, **kwds):\n" +" # Code to acquire resource, e.g.:\n" +" resource = acquire_resource(*args, **kwds)\n" +" try:\n" +" yield resource\n" +" finally:\n" +" # Code to release resource, e.g.:\n" +" release_resource(resource)" +msgstr "" + #: ../../library/contextlib.rst:69 msgid "The function can then be used like this::" msgstr "" +#: ../../library/contextlib.rst:71 +msgid "" +">>> with managed_resource(timeout=3600) as resource:\n" +"... # Resource is released at the end of this block,\n" +"... # even if code in the block raises an exception" +msgstr "" + #: ../../library/contextlib.rst:75 msgid "" "The function being decorated must return a :term:`generator`-iterator when " @@ -151,12 +170,47 @@ msgstr "" msgid "A simple example::" msgstr "Um exemplo simples::" +#: ../../library/contextlib.rst:115 +msgid "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def get_connection():\n" +" conn = await acquire_db_connection()\n" +" try:\n" +" yield conn\n" +" finally:\n" +" await release_db_connection(conn)\n" +"\n" +"async def get_all_users():\n" +" async with get_connection() as conn:\n" +" return conn.query('SELECT ...')" +msgstr "" + #: ../../library/contextlib.rst:131 msgid "" "Context managers defined with :func:`asynccontextmanager` can be used either " "as decorators or with :keyword:`async with` statements::" msgstr "" +#: ../../library/contextlib.rst:134 +msgid "" +"import time\n" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def timeit():\n" +" now = time.monotonic()\n" +" try:\n" +" yield\n" +" finally:\n" +" print(f'it took {time.monotonic() - now}s to run')\n" +"\n" +"@timeit()\n" +"async def main():\n" +" # ... async code ..." +msgstr "" + #: ../../library/contextlib.rst:149 msgid "" "When used as a decorator, a new generator instance is implicitly created on " @@ -177,10 +231,32 @@ msgid "" "This is basically equivalent to::" msgstr "" +#: ../../library/contextlib.rst:164 +msgid "" +"from contextlib import contextmanager\n" +"\n" +"@contextmanager\n" +"def closing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" thing.close()" +msgstr "" + #: ../../library/contextlib.rst:173 msgid "And lets you write code like this::" msgstr "" +#: ../../library/contextlib.rst:175 +msgid "" +"from contextlib import closing\n" +"from urllib.request import urlopen\n" +"\n" +"with closing(urlopen('https://www.python.org')) as page:\n" +" for line in page:\n" +" print(line)" +msgstr "" + #: ../../library/contextlib.rst:182 msgid "" "without needing to explicitly close ``page``. Even if an error occurs, " @@ -202,6 +278,18 @@ msgid "" "*thing* upon completion of the block. This is basically equivalent to::" msgstr "" +#: ../../library/contextlib.rst:199 +msgid "" +"from contextlib import asynccontextmanager\n" +"\n" +"@asynccontextmanager\n" +"async def aclosing(thing):\n" +" try:\n" +" yield thing\n" +" finally:\n" +" await thing.aclose()" +msgstr "" + #: ../../library/contextlib.rst:208 msgid "" "Significantly, ``aclosing()`` supports deterministic cleanup of async " @@ -209,6 +297,16 @@ msgid "" "exception. For example::" msgstr "" +#: ../../library/contextlib.rst:212 +msgid "" +"from contextlib import aclosing\n" +"\n" +"async with aclosing(my_generator()) as values:\n" +" async for value in values:\n" +" if value == 42:\n" +" break" +msgstr "" + #: ../../library/contextlib.rst:219 msgid "" "This pattern ensures that the generator's async exit code is executed in the " @@ -224,16 +322,57 @@ msgid "" "optional context manager, for example::" msgstr "" +#: ../../library/contextlib.rst:235 +msgid "" +"def myfunction(arg, ignore_exceptions=False):\n" +" if ignore_exceptions:\n" +" # Use suppress to ignore all exceptions.\n" +" cm = contextlib.suppress(Exception)\n" +" else:\n" +" # Do not ignore any exceptions, cm has no effect.\n" +" cm = contextlib.nullcontext()\n" +" with cm:\n" +" # Do something" +msgstr "" + #: ../../library/contextlib.rst:245 msgid "An example using *enter_result*::" msgstr "" +#: ../../library/contextlib.rst:247 +msgid "" +"def process_file(file_or_path):\n" +" if isinstance(file_or_path, str):\n" +" # If string, open file\n" +" cm = open(file_or_path)\n" +" else:\n" +" # Caller is responsible for closing file\n" +" cm = nullcontext(file_or_path)\n" +"\n" +" with cm as file:\n" +" # Perform processing on the file" +msgstr "" + #: ../../library/contextlib.rst:258 msgid "" "It can also be used as a stand-in for :ref:`asynchronous context managers " "`::" msgstr "" +#: ../../library/contextlib.rst:261 +msgid "" +"async def send_http(session=None):\n" +" if not session:\n" +" # If no http session, create it with aiohttp\n" +" cm = aiohttp.ClientSession()\n" +" else:\n" +" # Caller is responsible for closing the session\n" +" cm = nullcontext(session)\n" +"\n" +" async with cm as session:\n" +" # Send http requests with session" +msgstr "" + #: ../../library/contextlib.rst:274 msgid ":term:`asynchronous context manager` support was added." msgstr "" @@ -258,42 +397,67 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../library/contextlib.rst:293 +msgid "" +"from contextlib import suppress\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('somefile.tmp')\n" +"\n" +"with suppress(FileNotFoundError):\n" +" os.remove('someotherfile.tmp')" +msgstr "" + #: ../../library/contextlib.rst:301 msgid "This code is equivalent to::" msgstr "" -#: ../../library/contextlib.rst:313 ../../library/contextlib.rst:360 -#: ../../library/contextlib.rst:370 ../../library/contextlib.rst:387 +#: ../../library/contextlib.rst:303 +msgid "" +"try:\n" +" os.remove('somefile.tmp')\n" +"except FileNotFoundError:\n" +" pass\n" +"\n" +"try:\n" +" os.remove('someotherfile.tmp')\n" +"except FileNotFoundError:\n" +" pass" +msgstr "" + +#: ../../library/contextlib.rst:313 ../../library/contextlib.rst:362 +#: ../../library/contextlib.rst:372 ../../library/contextlib.rst:389 msgid "This context manager is :ref:`reentrant `." msgstr "" #: ../../library/contextlib.rst:315 msgid "" "If the code within the :keyword:`!with` block raises a :exc:" -"`BaseExceptionGroup`, suppressed exceptions are removed from the group. If " -"any exceptions in the group are not suppressed, a group containing them is " -"re-raised." +"`BaseExceptionGroup`, suppressed exceptions are removed from the group. Any " +"exceptions of the group which are not suppressed are re-raised in a new " +"group which is created using the original group's :meth:`~BaseExceptionGroup." +"derive` method." msgstr "" -#: ../../library/contextlib.rst:321 +#: ../../library/contextlib.rst:323 msgid "" -"``suppress`` now supports suppressing exceptions raised as part of an :exc:" +"``suppress`` now supports suppressing exceptions raised as part of a :exc:" "`BaseExceptionGroup`." msgstr "" -#: ../../library/contextlib.rst:327 +#: ../../library/contextlib.rst:329 msgid "" "Context manager for temporarily redirecting :data:`sys.stdout` to another " "file or file-like object." msgstr "" -#: ../../library/contextlib.rst:330 +#: ../../library/contextlib.rst:332 msgid "" "This tool adds flexibility to existing functions or classes whose output is " "hardwired to stdout." msgstr "" -#: ../../library/contextlib.rst:333 +#: ../../library/contextlib.rst:335 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " "You can capture that output in a string by redirecting the output to an :" @@ -302,17 +466,37 @@ msgid "" "`with` statement::" msgstr "" -#: ../../library/contextlib.rst:343 +#: ../../library/contextlib.rst:341 +msgid "" +"with redirect_stdout(io.StringIO()) as f:\n" +" help(pow)\n" +"s = f.getvalue()" +msgstr "" + +#: ../../library/contextlib.rst:345 msgid "" "To send the output of :func:`help` to a file on disk, redirect the output to " "a regular file::" msgstr "" -#: ../../library/contextlib.rst:350 +#: ../../library/contextlib.rst:348 +msgid "" +"with open('help.txt', 'w') as f:\n" +" with redirect_stdout(f):\n" +" help(pow)" +msgstr "" + +#: ../../library/contextlib.rst:352 msgid "To send the output of :func:`help` to *sys.stderr*::" msgstr "" -#: ../../library/contextlib.rst:355 +#: ../../library/contextlib.rst:354 +msgid "" +"with redirect_stdout(sys.stderr):\n" +" help(pow)" +msgstr "" + +#: ../../library/contextlib.rst:357 msgid "" "Note that the global side effect on :data:`sys.stdout` means that this " "context manager is not suitable for use in library code and most threaded " @@ -320,13 +504,13 @@ msgid "" "it is still a useful approach for many utility scripts." msgstr "" -#: ../../library/contextlib.rst:367 +#: ../../library/contextlib.rst:369 msgid "" "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." "stderr` to another file or file-like object." msgstr "" -#: ../../library/contextlib.rst:377 +#: ../../library/contextlib.rst:379 msgid "" "Non parallel-safe context manager to change the current working directory. " "As this changes a global state, the working directory, it is not suitable " @@ -336,60 +520,119 @@ msgid "" "when this context manager is active." msgstr "" -#: ../../library/contextlib.rst:384 +#: ../../library/contextlib.rst:386 msgid "" "This is a simple wrapper around :func:`~os.chdir`, it changes the current " "working directory upon entering and restores the old one on exit." msgstr "" -#: ../../library/contextlib.rst:394 +#: ../../library/contextlib.rst:396 msgid "" "A base class that enables a context manager to also be used as a decorator." msgstr "" -#: ../../library/contextlib.rst:396 +#: ../../library/contextlib.rst:398 msgid "" "Context managers inheriting from ``ContextDecorator`` have to implement " "``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " "exception handling even when used as a decorator." msgstr "" -#: ../../library/contextlib.rst:400 +#: ../../library/contextlib.rst:402 msgid "" "``ContextDecorator`` is used by :func:`contextmanager`, so you get this " "functionality automatically." msgstr "" -#: ../../library/contextlib.rst:403 +#: ../../library/contextlib.rst:405 msgid "Example of ``ContextDecorator``::" msgstr "" -#: ../../library/contextlib.rst:416 ../../library/contextlib.rst:488 +#: ../../library/contextlib.rst:407 +msgid "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextDecorator):\n" +" def __enter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" print('Finishing')\n" +" return False" +msgstr "" + +#: ../../library/contextlib.rst:418 ../../library/contextlib.rst:490 msgid "The class can then be used like this::" msgstr "" -#: ../../library/contextlib.rst:434 +#: ../../library/contextlib.rst:420 +msgid "" +">>> @mycontext()\n" +"... def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> function()\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" +msgstr "" + +#: ../../library/contextlib.rst:436 msgid "" "This change is just syntactic sugar for any construct of the following form::" msgstr "" -#: ../../library/contextlib.rst:440 +#: ../../library/contextlib.rst:438 +msgid "" +"def f():\n" +" with cm():\n" +" # Do stuff" +msgstr "" + +#: ../../library/contextlib.rst:442 msgid "``ContextDecorator`` lets you instead write::" msgstr "" -#: ../../library/contextlib.rst:446 +#: ../../library/contextlib.rst:444 +msgid "" +"@cm()\n" +"def f():\n" +" # Do stuff" +msgstr "" + +#: ../../library/contextlib.rst:448 msgid "" "It makes it clear that the ``cm`` applies to the whole function, rather than " "just a piece of it (and saving an indentation level is nice, too)." msgstr "" -#: ../../library/contextlib.rst:449 +#: ../../library/contextlib.rst:451 msgid "" "Existing context managers that already have a base class can be extended by " "using ``ContextDecorator`` as a mixin class::" msgstr "" -#: ../../library/contextlib.rst:462 +#: ../../library/contextlib.rst:454 +msgid "" +"from contextlib import ContextDecorator\n" +"\n" +"class mycontext(ContextBaseClass, ContextDecorator):\n" +" def __enter__(self):\n" +" return self\n" +"\n" +" def __exit__(self, *exc):\n" +" return False" +msgstr "" + +#: ../../library/contextlib.rst:464 msgid "" "As the decorated function must be able to be called multiple times, the " "underlying context manager must support use in multiple :keyword:`with` " @@ -397,35 +640,80 @@ msgid "" "explicit :keyword:`!with` statement inside the function should be used." msgstr "" -#: ../../library/contextlib.rst:472 +#: ../../library/contextlib.rst:474 msgid "" "Similar to :class:`ContextDecorator` but only for asynchronous functions." msgstr "" -#: ../../library/contextlib.rst:474 +#: ../../library/contextlib.rst:476 msgid "Example of ``AsyncContextDecorator``::" msgstr "" -#: ../../library/contextlib.rst:513 +#: ../../library/contextlib.rst:478 +msgid "" +"from asyncio import run\n" +"from contextlib import AsyncContextDecorator\n" +"\n" +"class mycontext(AsyncContextDecorator):\n" +" async def __aenter__(self):\n" +" print('Starting')\n" +" return self\n" +"\n" +" async def __aexit__(self, *exc):\n" +" print('Finishing')\n" +" return False" +msgstr "" + +#: ../../library/contextlib.rst:492 +msgid "" +">>> @mycontext()\n" +"... async def function():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing\n" +"\n" +">>> async def function():\n" +"... async with mycontext():\n" +"... print('The bit in the middle')\n" +"...\n" +">>> run(function())\n" +"Starting\n" +"The bit in the middle\n" +"Finishing" +msgstr "" + +#: ../../library/contextlib.rst:515 msgid "" "A context manager that is designed to make it easy to programmatically " "combine other context managers and cleanup functions, especially those that " "are optional or otherwise driven by input data." msgstr "" -#: ../../library/contextlib.rst:517 +#: ../../library/contextlib.rst:519 msgid "" "For example, a set of files may easily be handled in a single with statement " "as follows::" msgstr "" -#: ../../library/contextlib.rst:526 +#: ../../library/contextlib.rst:522 +msgid "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # All opened files will automatically be closed at the end of\n" +" # the with statement, even if attempts to open files later\n" +" # in the list raise an exception" +msgstr "" + +#: ../../library/contextlib.rst:528 msgid "" "The :meth:`~object.__enter__` method returns the :class:`ExitStack` " "instance, and performs no additional operations." msgstr "" -#: ../../library/contextlib.rst:529 +#: ../../library/contextlib.rst:531 msgid "" "Each instance maintains a stack of registered callbacks that are called in " "reverse order when the instance is closed (either explicitly or implicitly " @@ -433,14 +721,14 @@ msgid "" "invoked implicitly when the context stack instance is garbage collected." msgstr "" -#: ../../library/contextlib.rst:534 +#: ../../library/contextlib.rst:536 msgid "" "This stack model is used so that context managers that acquire their " "resources in their ``__init__`` method (such as file objects) can be handled " "correctly." msgstr "" -#: ../../library/contextlib.rst:538 +#: ../../library/contextlib.rst:540 msgid "" "Since registered callbacks are invoked in the reverse order of registration, " "this ends up behaving as if multiple nested :keyword:`with` statements had " @@ -450,7 +738,7 @@ msgid "" "updated state." msgstr "" -#: ../../library/contextlib.rst:545 +#: ../../library/contextlib.rst:547 msgid "" "This is a relatively low level API that takes care of the details of " "correctly unwinding the stack of exit callbacks. It provides a suitable " @@ -458,76 +746,76 @@ msgid "" "in application specific ways." msgstr "" -#: ../../library/contextlib.rst:554 +#: ../../library/contextlib.rst:556 msgid "" "Enters a new context manager and adds its :meth:`~object.__exit__` method to " "the callback stack. The return value is the result of the context manager's " "own :meth:`~object.__enter__` method." msgstr "" -#: ../../library/contextlib.rst:558 +#: ../../library/contextlib.rst:560 msgid "" "These context managers may suppress exceptions just as they normally would " "if used directly as part of a :keyword:`with` statement." msgstr "" -#: ../../library/contextlib.rst:561 +#: ../../library/contextlib.rst:563 msgid "" "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not a " "context manager." msgstr "" -#: ../../library/contextlib.rst:567 +#: ../../library/contextlib.rst:569 msgid "" "Adds a context manager's :meth:`~object.__exit__` method to the callback " "stack." msgstr "" -#: ../../library/contextlib.rst:569 +#: ../../library/contextlib.rst:571 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " "an :meth:`~object.__enter__` implementation with a context manager's own :" "meth:`~object.__exit__` method." msgstr "" -#: ../../library/contextlib.rst:573 +#: ../../library/contextlib.rst:575 msgid "" "If passed an object that is not a context manager, this method assumes it is " "a callback with the same signature as a context manager's :meth:`~object." "__exit__` method and adds it directly to the callback stack." msgstr "" -#: ../../library/contextlib.rst:577 +#: ../../library/contextlib.rst:579 msgid "" "By returning true values, these callbacks can suppress exceptions the same " "way context manager :meth:`~object.__exit__` methods can." msgstr "" -#: ../../library/contextlib.rst:580 +#: ../../library/contextlib.rst:582 msgid "" "The passed in object is returned from the function, allowing this method to " "be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:585 +#: ../../library/contextlib.rst:587 msgid "" "Accepts an arbitrary callback function and arguments and adds it to the " "callback stack." msgstr "" -#: ../../library/contextlib.rst:588 +#: ../../library/contextlib.rst:590 msgid "" "Unlike the other methods, callbacks added this way cannot suppress " "exceptions (as they are never passed the exception details)." msgstr "" -#: ../../library/contextlib.rst:591 +#: ../../library/contextlib.rst:593 msgid "" "The passed in callback is returned from the function, allowing this method " "to be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:596 +#: ../../library/contextlib.rst:598 msgid "" "Transfers the callback stack to a fresh :class:`ExitStack` instance and " "returns it. No callbacks are invoked by this operation - instead, they will " @@ -535,77 +823,99 @@ msgid "" "at the end of a :keyword:`with` statement)." msgstr "" -#: ../../library/contextlib.rst:601 +#: ../../library/contextlib.rst:603 msgid "" "For example, a group of files can be opened as an \"all or nothing\" " "operation as follows::" msgstr "" -#: ../../library/contextlib.rst:615 +#: ../../library/contextlib.rst:606 +msgid "" +"with ExitStack() as stack:\n" +" files = [stack.enter_context(open(fname)) for fname in filenames]\n" +" # Hold onto the close method, but don't call it yet.\n" +" close_files = stack.pop_all().close\n" +" # If opening any file fails, all previously opened files will be\n" +" # closed automatically. If all files are opened successfully,\n" +" # they will remain open even after the with statement ends.\n" +" # close_files() can then be invoked explicitly to close them all." +msgstr "" + +#: ../../library/contextlib.rst:617 msgid "" "Immediately unwinds the callback stack, invoking callbacks in the reverse " "order of registration. For any context managers and exit callbacks " "registered, the arguments passed in will indicate that no exception occurred." msgstr "" -#: ../../library/contextlib.rst:622 +#: ../../library/contextlib.rst:624 msgid "" "An :ref:`asynchronous context manager `, similar to :" "class:`ExitStack`, that supports combining both synchronous and asynchronous " "context managers, as well as having coroutines for cleanup logic." msgstr "" -#: ../../library/contextlib.rst:627 +#: ../../library/contextlib.rst:629 msgid "" "The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must " "be used instead." msgstr "" -#: ../../library/contextlib.rst:632 +#: ../../library/contextlib.rst:634 msgid "" "Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " "context manager." msgstr "" -#: ../../library/contextlib.rst:635 +#: ../../library/contextlib.rst:637 msgid "" "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an " "asynchronous context manager." msgstr "" -#: ../../library/contextlib.rst:641 +#: ../../library/contextlib.rst:643 msgid "" "Similar to :meth:`ExitStack.push` but expects either an asynchronous context " "manager or a coroutine function." msgstr "" -#: ../../library/contextlib.rst:646 +#: ../../library/contextlib.rst:648 msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." msgstr "" -#: ../../library/contextlib.rst:650 +#: ../../library/contextlib.rst:652 msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." msgstr "" -#: ../../library/contextlib.rst:652 +#: ../../library/contextlib.rst:654 msgid "Continuing the example for :func:`asynccontextmanager`::" msgstr "" -#: ../../library/contextlib.rst:664 +#: ../../library/contextlib.rst:656 +msgid "" +"async with AsyncExitStack() as stack:\n" +" connections = [await stack.enter_async_context(get_connection())\n" +" for i in range(5)]\n" +" # All opened connections will automatically be released at the end of\n" +" # the async with statement, even if attempts to open a connection\n" +" # later in the list raise an exception." +msgstr "" + +#: ../../library/contextlib.rst:666 msgid "Examples and Recipes" msgstr "Exemplos e receitas" -#: ../../library/contextlib.rst:666 +#: ../../library/contextlib.rst:668 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`contextlib`." msgstr "" -#: ../../library/contextlib.rst:671 +#: ../../library/contextlib.rst:673 msgid "Supporting a variable number of context managers" msgstr "" -#: ../../library/contextlib.rst:673 +#: ../../library/contextlib.rst:675 msgid "" "The primary use case for :class:`ExitStack` is the one given in the class " "documentation: supporting a variable number of context managers and other " @@ -615,18 +925,29 @@ msgid "" "of the context managers being optional::" msgstr "" -#: ../../library/contextlib.rst:688 +#: ../../library/contextlib.rst:682 +msgid "" +"with ExitStack() as stack:\n" +" for resource in resources:\n" +" stack.enter_context(resource)\n" +" if need_special_resource():\n" +" special = acquire_special_resource()\n" +" stack.callback(release_special_resource, special)\n" +" # Perform operations that use the acquired resources" +msgstr "" + +#: ../../library/contextlib.rst:690 msgid "" "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " "statements to manage arbitrary resources that don't natively support the " "context management protocol." msgstr "" -#: ../../library/contextlib.rst:694 +#: ../../library/contextlib.rst:696 msgid "Catching exceptions from ``__enter__`` methods" msgstr "" -#: ../../library/contextlib.rst:696 +#: ../../library/contextlib.rst:698 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " "method implementation, *without* inadvertently catching exceptions from the :" @@ -635,7 +956,19 @@ msgid "" "be separated slightly in order to allow this::" msgstr "" -#: ../../library/contextlib.rst:711 +#: ../../library/contextlib.rst:704 +msgid "" +"stack = ExitStack()\n" +"try:\n" +" x = stack.enter_context(cm)\n" +"except Exception:\n" +" # handle __enter__ exception\n" +"else:\n" +" with stack:\n" +" # Handle normal case" +msgstr "" + +#: ../../library/contextlib.rst:713 msgid "" "Actually needing to do this is likely to indicate that the underlying API " "should be providing a direct resource management interface for use with :" @@ -646,29 +979,67 @@ msgid "" "`with` statement." msgstr "" -#: ../../library/contextlib.rst:721 +#: ../../library/contextlib.rst:723 msgid "Cleaning up in an ``__enter__`` implementation" msgstr "" -#: ../../library/contextlib.rst:723 +#: ../../library/contextlib.rst:725 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" "meth:`~object.__enter__` implementation fail." msgstr "" -#: ../../library/contextlib.rst:727 +#: ../../library/contextlib.rst:729 msgid "" "Here's an example of doing this for a context manager that accepts resource " "acquisition and release functions, along with an optional validation " "function, and maps them to the context management protocol::" msgstr "" -#: ../../library/contextlib.rst:767 -msgid "Replacing any use of ``try-finally`` and flag variables" +#: ../../library/contextlib.rst:733 +msgid "" +"from contextlib import contextmanager, AbstractContextManager, ExitStack\n" +"\n" +"class ResourceManager(AbstractContextManager):\n" +"\n" +" def __init__(self, acquire_resource, release_resource, " +"check_resource_ok=None):\n" +" self.acquire_resource = acquire_resource\n" +" self.release_resource = release_resource\n" +" if check_resource_ok is None:\n" +" def check_resource_ok(resource):\n" +" return True\n" +" self.check_resource_ok = check_resource_ok\n" +"\n" +" @contextmanager\n" +" def _cleanup_on_error(self):\n" +" with ExitStack() as stack:\n" +" stack.push(self)\n" +" yield\n" +" # The validation check passed and didn't raise an exception\n" +" # Accordingly, we want to keep the resource, and pass it\n" +" # back to our caller\n" +" stack.pop_all()\n" +"\n" +" def __enter__(self):\n" +" resource = self.acquire_resource()\n" +" with self._cleanup_on_error():\n" +" if not self.check_resource_ok(resource):\n" +" msg = \"Failed validation for {!r}\"\n" +" raise RuntimeError(msg.format(resource))\n" +" return resource\n" +"\n" +" def __exit__(self, *exc_details):\n" +" # We don't need to duplicate any of our resource release logic\n" +" self.release_resource()" msgstr "" #: ../../library/contextlib.rst:769 +msgid "Replacing any use of ``try-finally`` and flag variables" +msgstr "" + +#: ../../library/contextlib.rst:771 msgid "" "A pattern you will sometimes see is a ``try-finally`` statement with a flag " "variable to indicate whether or not the body of the ``finally`` clause " @@ -676,57 +1047,111 @@ msgid "" "by using an ``except`` clause instead), it looks something like this::" msgstr "" -#: ../../library/contextlib.rst:783 +#: ../../library/contextlib.rst:776 +msgid "" +"cleanup_needed = True\n" +"try:\n" +" result = perform_operation()\n" +" if result:\n" +" cleanup_needed = False\n" +"finally:\n" +" if cleanup_needed:\n" +" cleanup_resources()" +msgstr "" + +#: ../../library/contextlib.rst:785 msgid "" "As with any ``try`` statement based code, this can cause problems for " "development and review, because the setup code and the cleanup code can end " "up being separated by arbitrarily long sections of code." msgstr "" -#: ../../library/contextlib.rst:787 +#: ../../library/contextlib.rst:789 msgid "" ":class:`ExitStack` makes it possible to instead register a callback for " "execution at the end of a ``with`` statement, and then later decide to skip " "executing that callback::" msgstr "" -#: ../../library/contextlib.rst:799 +#: ../../library/contextlib.rst:793 msgid "" -"This allows the intended cleanup up behaviour to be made explicit up front, " +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" stack.callback(cleanup_resources)\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" +msgstr "" + +#: ../../library/contextlib.rst:801 +msgid "" +"This allows the intended cleanup behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" -#: ../../library/contextlib.rst:802 +#: ../../library/contextlib.rst:804 msgid "" "If a particular application uses this pattern a lot, it can be simplified " "even further by means of a small helper class::" msgstr "" -#: ../../library/contextlib.rst:820 +#: ../../library/contextlib.rst:807 +msgid "" +"from contextlib import ExitStack\n" +"\n" +"class Callback(ExitStack):\n" +" def __init__(self, callback, /, *args, **kwds):\n" +" super().__init__()\n" +" self.callback(callback, *args, **kwds)\n" +"\n" +" def cancel(self):\n" +" self.pop_all()\n" +"\n" +"with Callback(cleanup_resources) as cb:\n" +" result = perform_operation()\n" +" if result:\n" +" cb.cancel()" +msgstr "" + +#: ../../library/contextlib.rst:822 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " "function, then it is still possible to use the decorator form of :meth:" "`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" -#: ../../library/contextlib.rst:835 +#: ../../library/contextlib.rst:827 +msgid "" +"from contextlib import ExitStack\n" +"\n" +"with ExitStack() as stack:\n" +" @stack.callback\n" +" def cleanup_resources():\n" +" ...\n" +" result = perform_operation()\n" +" if result:\n" +" stack.pop_all()" +msgstr "" + +#: ../../library/contextlib.rst:837 msgid "" "Due to the way the decorator protocol works, a callback function declared " "this way cannot take any parameters. Instead, any resources to be released " "must be accessed as closure variables." msgstr "" -#: ../../library/contextlib.rst:841 +#: ../../library/contextlib.rst:843 msgid "Using a context manager as a function decorator" msgstr "" -#: ../../library/contextlib.rst:843 +#: ../../library/contextlib.rst:845 msgid "" ":class:`ContextDecorator` makes it possible to use a context manager in both " "an ordinary ``with`` statement and also as a function decorator." msgstr "" -#: ../../library/contextlib.rst:846 +#: ../../library/contextlib.rst:848 msgid "" "For example, it is sometimes useful to wrap functions or groups of " "statements with a logger that can track the time of entry and time of exit. " @@ -735,15 +1160,48 @@ msgid "" "in a single definition::" msgstr "" -#: ../../library/contextlib.rst:867 +#: ../../library/contextlib.rst:854 +msgid "" +"from contextlib import ContextDecorator\n" +"import logging\n" +"\n" +"logging.basicConfig(level=logging.INFO)\n" +"\n" +"class track_entry_and_exit(ContextDecorator):\n" +" def __init__(self, name):\n" +" self.name = name\n" +"\n" +" def __enter__(self):\n" +" logging.info('Entering: %s', self.name)\n" +"\n" +" def __exit__(self, exc_type, exc, exc_tb):\n" +" logging.info('Exiting: %s', self.name)" +msgstr "" + +#: ../../library/contextlib.rst:869 msgid "Instances of this class can be used as both a context manager::" msgstr "" -#: ../../library/contextlib.rst:873 +#: ../../library/contextlib.rst:871 +msgid "" +"with track_entry_and_exit('widget loader'):\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" +msgstr "" + +#: ../../library/contextlib.rst:875 msgid "And also as a function decorator::" msgstr "" -#: ../../library/contextlib.rst:880 +#: ../../library/contextlib.rst:877 +msgid "" +"@track_entry_and_exit('widget loader')\n" +"def activity():\n" +" print('Some time consuming activity goes here')\n" +" load_widget()" +msgstr "" + +#: ../../library/contextlib.rst:882 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" @@ -751,11 +1209,11 @@ msgid "" "use an explicit ``with`` statement." msgstr "" -#: ../../library/contextlib.rst:887 +#: ../../library/contextlib.rst:889 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - A instrução \"with\"" -#: ../../library/contextlib.rst:888 +#: ../../library/contextlib.rst:890 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." @@ -763,11 +1221,11 @@ msgstr "" "A especificação, o histórico e os exemplos para a instrução Python :keyword:" "`with`." -#: ../../library/contextlib.rst:894 +#: ../../library/contextlib.rst:896 msgid "Single use, reusable and reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:896 +#: ../../library/contextlib.rst:898 msgid "" "Most context managers are written in a way that means they can only be used " "effectively in a :keyword:`with` statement once. These single use context " @@ -775,32 +1233,55 @@ msgid "" "them a second time will trigger an exception or otherwise not work correctly." msgstr "" -#: ../../library/contextlib.rst:902 +#: ../../library/contextlib.rst:904 msgid "" "This common limitation means that it is generally advisable to create " "context managers directly in the header of the :keyword:`with` statement " "where they are used (as shown in all of the usage examples above)." msgstr "" -#: ../../library/contextlib.rst:906 +#: ../../library/contextlib.rst:908 msgid "" "Files are an example of effectively single use context managers, since the " "first :keyword:`with` statement will close the file, preventing any further " "IO operations using that file object." msgstr "" -#: ../../library/contextlib.rst:910 +#: ../../library/contextlib.rst:912 msgid "" "Context managers created using :func:`contextmanager` are also single use " "context managers, and will complain about the underlying generator failing " "to yield if an attempt is made to use them a second time::" msgstr "" -#: ../../library/contextlib.rst:938 -msgid "Reentrant context managers" +#: ../../library/contextlib.rst:916 +msgid "" +">>> from contextlib import contextmanager\n" +">>> @contextmanager\n" +"... def singleuse():\n" +"... print(\"Before\")\n" +"... yield\n" +"... print(\"After\")\n" +"...\n" +">>> cm = singleuse()\n" +">>> with cm:\n" +"... pass\n" +"...\n" +"Before\n" +"After\n" +">>> with cm:\n" +"... pass\n" +"...\n" +"Traceback (most recent call last):\n" +" ...\n" +"RuntimeError: generator didn't yield" msgstr "" #: ../../library/contextlib.rst:940 +msgid "Reentrant context managers" +msgstr "" + +#: ../../library/contextlib.rst:942 msgid "" "More sophisticated context managers may be \"reentrant\". These context " "managers can not only be used in multiple :keyword:`with` statements, but " @@ -808,21 +1289,39 @@ msgid "" "the same context manager." msgstr "" -#: ../../library/contextlib.rst:945 +#: ../../library/contextlib.rst:947 msgid "" ":class:`threading.RLock` is an example of a reentrant context manager, as " "are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a " "very simple example of reentrant use::" msgstr "" -#: ../../library/contextlib.rst:964 +#: ../../library/contextlib.rst:951 +msgid "" +">>> from contextlib import redirect_stdout\n" +">>> from io import StringIO\n" +">>> stream = StringIO()\n" +">>> write_to_stream = redirect_stdout(stream)\n" +">>> with write_to_stream:\n" +"... print(\"This is written to the stream rather than stdout\")\n" +"... with write_to_stream:\n" +"... print(\"This is also written to the stream\")\n" +"...\n" +">>> print(\"This is written directly to stdout\")\n" +"This is written directly to stdout\n" +">>> print(stream.getvalue())\n" +"This is written to the stream rather than stdout\n" +"This is also written to the stream" +msgstr "" + +#: ../../library/contextlib.rst:966 msgid "" "Real world examples of reentrancy are more likely to involve multiple " "functions calling each other and hence be far more complicated than this " "example." msgstr "" -#: ../../library/contextlib.rst:968 +#: ../../library/contextlib.rst:970 msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " @@ -830,11 +1329,11 @@ msgid "" "stdout` to a different stream." msgstr "" -#: ../../library/contextlib.rst:977 +#: ../../library/contextlib.rst:979 msgid "Reusable context managers" msgstr "Gerenciadores de contexto reutilizáveis" -#: ../../library/contextlib.rst:979 +#: ../../library/contextlib.rst:981 msgid "" "Distinct from both single use and reentrant context managers are " "\"reusable\" context managers (or, to be completely explicit, \"reusable, " @@ -844,21 +1343,50 @@ msgid "" "manager instance has already been used in a containing with statement." msgstr "" -#: ../../library/contextlib.rst:986 +#: ../../library/contextlib.rst:988 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " "context manager (for a reentrant lock, it is necessary to use :class:" "`threading.RLock` instead)." msgstr "" -#: ../../library/contextlib.rst:990 +#: ../../library/contextlib.rst:992 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "any with statement, regardless of where those callbacks were added::" msgstr "" -#: ../../library/contextlib.rst:1021 +#: ../../library/contextlib.rst:997 +msgid "" +">>> from contextlib import ExitStack\n" +">>> stack = ExitStack()\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from first context\")\n" +"... print(\"Leaving first context\")\n" +"...\n" +"Leaving first context\n" +"Callback: from first context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from second context\")\n" +"... print(\"Leaving second context\")\n" +"...\n" +"Leaving second context\n" +"Callback: from second context\n" +">>> with stack:\n" +"... stack.callback(print, \"Callback: from outer context\")\n" +"... with stack:\n" +"... stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Callback: from outer context\n" +"Leaving outer context" +msgstr "" + +#: ../../library/contextlib.rst:1023 msgid "" "As the output from the example shows, reusing a single stack object across " "multiple with statements works correctly, but attempting to nest them will " @@ -866,8 +1394,24 @@ msgid "" "which is unlikely to be desirable behaviour." msgstr "" -#: ../../library/contextlib.rst:1026 +#: ../../library/contextlib.rst:1028 msgid "" "Using separate :class:`ExitStack` instances instead of reusing a single " "instance avoids that problem::" msgstr "" + +#: ../../library/contextlib.rst:1031 +msgid "" +">>> from contextlib import ExitStack\n" +">>> with ExitStack() as outer_stack:\n" +"... outer_stack.callback(print, \"Callback: from outer context\")\n" +"... with ExitStack() as inner_stack:\n" +"... inner_stack.callback(print, \"Callback: from inner context\")\n" +"... print(\"Leaving inner context\")\n" +"... print(\"Leaving outer context\")\n" +"...\n" +"Leaving inner context\n" +"Callback: from inner context\n" +"Leaving outer context\n" +"Callback: from outer context" +msgstr "" diff --git a/library/contextvars.po b/library/contextvars.po index 951e29bd5..794d77c10 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2022 -# Adorilson Bezerra , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -47,12 +44,9 @@ msgstr "" #: ../../library/contextvars.rst:17 msgid "" "Context managers that have state should use Context Variables instead of :" -"func:`threading.local()` to prevent their state from bleeding to other code " +"func:`threading.local` to prevent their state from bleeding to other code " "unexpectedly, when used in concurrent code." msgstr "" -"Os gerenciadores de contexto que possuem estado devem usar Variáveis de " -"Contexto ao invés de :func:`threading.local()` para evitar que seu estado " -"vaze para outro código inesperadamente, quando usado em código concorrente." #: ../../library/contextvars.rst:21 msgid "See also :pep:`567` for additional details." @@ -68,6 +62,10 @@ msgstr "" "Esta classe é usada para declarar uma nova variável de contexto, como, por " "exemplo::" +#: ../../library/contextvars.rst:33 +msgid "var: ContextVar[int] = ContextVar('var', default=42)" +msgstr "" + #: ../../library/contextvars.rst:35 msgid "" "The required *name* parameter is used for introspection and debug purposes." @@ -161,6 +159,18 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../library/contextvars.rst:87 +msgid "" +"var = ContextVar('var')\n" +"\n" +"token = var.set('new value')\n" +"# code that uses 'var'; var.get() returns 'new value'.\n" +"var.reset(token)\n" +"\n" +"# After the reset call the var has no value again, so\n" +"# var.get() would raise a LookupError." +msgstr "" + #: ../../library/contextvars.rst:99 msgid "" "*Token* objects are returned by the :meth:`ContextVar.set` method. They can " @@ -209,6 +219,12 @@ msgstr "" "O trecho a seguir obtém uma cópia do contexto atual e imprime todas as " "variáveis e seus valores que são definidos nele::" +#: ../../library/contextvars.rst:131 +msgid "" +"ctx: Context = copy_context()\n" +"print(list(ctx.items()))" +msgstr "" + #: ../../library/contextvars.rst:134 msgid "" "The function has an *O*\\ (1) complexity, i.e. works equally fast for " @@ -235,13 +251,9 @@ msgstr "" msgid "" "Every thread will have a different top-level :class:`~contextvars.Context` " "object. This means that a :class:`ContextVar` object behaves in a similar " -"fashion to :func:`threading.local()` when values are assigned in different " +"fashion to :func:`threading.local` when values are assigned in different " "threads." msgstr "" -"Cada thread terá um objeto :class:`~contextvars.Context` de nível superior " -"diferente. Isso significa que um objeto :class:`ContextVar` se comporta de " -"maneira semelhante a :func:`threading.local()` quando valores são atribuídos " -"em diferentes threads." #: ../../library/contextvars.rst:152 msgid "Context implements the :class:`collections.abc.Mapping` interface." @@ -265,6 +277,35 @@ msgstr "" "Quaisquer mudanças em quaisquer variáveis de contexto que *callable* faça " "estarão contidas no objeto de contexto::" +#: ../../library/contextvars.rst:163 +msgid "" +"var = ContextVar('var')\n" +"var.set('spam')\n" +"\n" +"def main():\n" +" # 'var' was set to 'spam' before\n" +" # calling 'copy_context()' and 'ctx.run(main)', so:\n" +" # var.get() == ctx[var] == 'spam'\n" +"\n" +" var.set('ham')\n" +"\n" +" # Now, after setting 'var' to 'ham':\n" +" # var.get() == ctx[var] == 'ham'\n" +"\n" +"ctx = copy_context()\n" +"\n" +"# Any changes that the 'main' function makes to 'var'\n" +"# will be contained in 'ctx'.\n" +"ctx.run(main)\n" +"\n" +"# The 'main()' function was run in the 'ctx' context,\n" +"# so changes to 'var' are contained in it:\n" +"# ctx[var] == 'ham'\n" +"\n" +"# However, outside of 'ctx', 'var' is still set to 'spam':\n" +"# var.get() == 'spam'" +msgstr "" + #: ../../library/contextvars.rst:189 msgid "" "The method raises a :exc:`RuntimeError` when called on the same context " @@ -344,3 +385,47 @@ msgstr "" "está um servidor simples de eco, que usa uma variável de contexto para " "disponibilizar o endereço de um cliente remoto na Task que lida com esse " "cliente::" + +#: ../../library/contextvars.rst:247 +msgid "" +"import asyncio\n" +"import contextvars\n" +"\n" +"client_addr_var = contextvars.ContextVar('client_addr')\n" +"\n" +"def render_goodbye():\n" +" # The address of the currently handled client can be accessed\n" +" # without passing it explicitly to this function.\n" +"\n" +" client_addr = client_addr_var.get()\n" +" return f'Good bye, client @ {client_addr}\\n'.encode()\n" +"\n" +"async def handle_request(reader, writer):\n" +" addr = writer.transport.get_extra_info('socket').getpeername()\n" +" client_addr_var.set(addr)\n" +"\n" +" # In any code that we call is now possible to get\n" +" # client's address by calling 'client_addr_var.get()'.\n" +"\n" +" while True:\n" +" line = await reader.readline()\n" +" print(line)\n" +" if not line.strip():\n" +" break\n" +" writer.write(line)\n" +"\n" +" writer.write(render_goodbye())\n" +" writer.close()\n" +"\n" +"async def main():\n" +" srv = await asyncio.start_server(\n" +" handle_request, '127.0.0.1', 8081)\n" +"\n" +" async with srv:\n" +" await srv.serve_forever()\n" +"\n" +"asyncio.run(main())\n" +"\n" +"# To test it you can use telnet:\n" +"# telnet 127.0.0.1 8081" +msgstr "" diff --git a/library/copy.po b/library/copy.po index 5a39aaad0..e98fdf424 100644 --- a/library/copy.po +++ b/library/copy.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Marco Rougeth , 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -58,7 +55,7 @@ msgstr "Retorna uma cópia rasa de *x*." #: ../../library/copy.rst:27 msgid "Return a deep copy of *x*." -msgstr "Retorna uma cópia profunda de *x*." +msgstr "Retorna uma cópia profunda de *x*." #: ../../library/copy.rst:32 msgid "Raised for module specific errors." @@ -186,11 +183,11 @@ msgstr "" "definir métodos especiais :meth:`__copy__` e :meth:`__deepcopy__`. O " "primeiro é chamado para implementar a operação de cópia rasa; nenhum " "argumento adicional é passado. O último é chamado para implementar a " -"operação de cópia profunda; é passado um argumento, o dicionário ``memo``. " -"Se a implementação de :meth:`__deepcopy__` precisa fazer uma cópia profunda " -"de um componente, ela deve chamar a função :func:`deepcopy` com o componente " -"como primeiro argumento e o dicionário de memorando como segundo argumento. " -"O dicionário memo deve ser tratado como um objeto opaco." +"operação de cópia profunda; ele recebe um argumento, o dicionário ``memo``. " +"Se a implementação :meth:`__deepcopy__` precisar fazer uma cópia profunda de " +"um componente, ela deve chamar a função :func:`deepcopy` com o componente " +"como primeiro argumento e o dicionário memo como segundo argumento. O " +"dicionário memo deve ser tratado como um objeto opaco." #: ../../library/copy.rst:94 msgid "Module :mod:`pickle`" diff --git a/library/copyreg.po b/library/copyreg.po index d06e583e4..3367e9271 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# And Past , 2021 -# Marco Rougeth , 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/crypt.po b/library/crypt.po index 6d29fee27..f13a28eec 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -34,7 +31,7 @@ msgstr "" msgid "**Source code:** :source:`Lib/crypt.py`" msgstr "**Código-fonte:** :source:`Lib/crypt.py`" -#: ../../library/crypt.rst:24 +#: ../../library/crypt.rst:19 msgid "" "The :mod:`crypt` module is deprecated (see :pep:`PEP 594 <594#crypt>` for " "details and alternatives). The :mod:`hashlib` module is a potential " @@ -61,7 +58,7 @@ msgstr "" #: ../../library/crypt.rst:40 msgid ":ref:`Availability `: Unix, not VxWorks." -msgstr ":ref:`Disponibilidade `: Unix, not VxWorks." +msgstr ":ref:`Disponibilidade `: Unix, não VxWorks." #: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." @@ -215,12 +212,42 @@ msgid "" "compare_digest` is suitable for this purpose)::" msgstr "" +#: ../../library/crypt.rst:159 +msgid "" +"import pwd\n" +"import crypt\n" +"import getpass\n" +"from hmac import compare_digest as compare_hash\n" +"\n" +"def login():\n" +" username = input('Python login: ')\n" +" cryptedpasswd = pwd.getpwnam(username)[1]\n" +" if cryptedpasswd:\n" +" if cryptedpasswd == 'x' or cryptedpasswd == '*':\n" +" raise ValueError('no support for shadow passwords')\n" +" cleartext = getpass.getpass()\n" +" return compare_hash(crypt.crypt(cleartext, cryptedpasswd), " +"cryptedpasswd)\n" +" else:\n" +" return True" +msgstr "" + #: ../../library/crypt.rst:175 msgid "" "To generate a hash of a password using the strongest available method and " "check it against the original::" msgstr "" +#: ../../library/crypt.rst:178 +msgid "" +"import crypt\n" +"from hmac import compare_digest as compare_hash\n" +"\n" +"hashed = crypt.crypt(plaintext)\n" +"if not compare_hash(hashed, crypt.crypt(plaintext, hashed)):\n" +" raise ValueError(\"hashed version doesn't validate against original\")" +msgstr "" + #: ../../library/crypt.rst:15 ../../library/crypt.rst:33 #: ../../library/crypt.rst:119 msgid "crypt(3)" diff --git a/library/crypto.po b/library/crypto.po index da5b27b7a..d641c8e10 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/csv.po b/library/csv.po index 214673263..8e2b3b754 100644 --- a/library/csv.po +++ b/library/csv.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# i17obot , 2021 -# Adorilson Bezerra , 2024 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -146,6 +143,17 @@ msgstr "" msgid "A short usage example::" msgstr "Um pequeno exemplo de uso::" +#: ../../library/csv.rst:78 +msgid "" +">>> import csv\n" +">>> with open('eggs.csv', newline='') as csvfile:\n" +"... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')\n" +"... for row in spamreader:\n" +"... print(', '.join(row))\n" +"Spam, Spam, Spam, Spam, Spam, Baked Beans\n" +"Spam, Lovely Spam, Wonderful Spam" +msgstr "" + #: ../../library/csv.rst:89 msgid "" "Return a writer object responsible for converting the user's data into " @@ -183,6 +191,16 @@ msgstr "" "retornados de uma chamada ``cursor.fetch*``. Todos os outros dados que não " "são de strings são codificados com :func:`str` antes de serem escritos." +#: ../../library/csv.rst:108 +msgid "" +"import csv\n" +"with open('eggs.csv', 'w', newline='') as csvfile:\n" +" spamwriter = csv.writer(csvfile, delimiter=' ',\n" +" quotechar='|', quoting=csv.QUOTE_MINIMAL)\n" +" spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n" +" spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" +msgstr "" + #: ../../library/csv.rst:118 msgid "" "Associate *dialect* with *name*. *name* must be a string. The dialect can " @@ -295,6 +313,21 @@ msgstr "Linhas retornadas agora são do tipo :class:`OrderedDict`." msgid "Returned rows are now of type :class:`dict`." msgstr "As linhas retornadas agora são do tipo :class:`dict`." +#: ../../library/csv.rst:183 +msgid "" +">>> import csv\n" +">>> with open('names.csv', newline='') as csvfile:\n" +"... reader = csv.DictReader(csvfile)\n" +"... for row in reader:\n" +"... print(row['first_name'], row['last_name'])\n" +"...\n" +"Eric Idle\n" +"John Cleese\n" +"\n" +">>> print(row)\n" +"{'first_name': 'John', 'last_name': 'Cleese'}" +msgstr "" + #: ../../library/csv.rst:199 msgid "" "Create an object which operates like a regular writer but maps dictionaries " @@ -332,6 +365,20 @@ msgstr "" "Observe que, diferentemente da classe :class:`DictReader`, o parâmetro " "*fieldnames* da classe :class:`DictWriter` não é opcional." +#: ../../library/csv.rst:221 +msgid "" +"import csv\n" +"\n" +"with open('names.csv', 'w', newline='') as csvfile:\n" +" fieldnames = ['first_name', 'last_name']\n" +" writer = csv.DictWriter(csvfile, fieldnames=fieldnames)\n" +"\n" +" writer.writeheader()\n" +" writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})\n" +" writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" +" writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" +msgstr "" + #: ../../library/csv.rst:235 msgid "" "The :class:`Dialect` class is a container class whose attributes contain " @@ -358,6 +405,14 @@ msgstr "" "class:`writer` específicas através de suas funções inicializadoras " "(``__init__``) como esta::" +#: ../../library/csv.rst:245 +msgid "" +"import csv\n" +"\n" +"with open('students.csv', 'w', newline='') as csvfile:\n" +" writer = csv.writer(csvfile, dialect='unix')" +msgstr "" + #: ../../library/csv.rst:253 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " @@ -451,6 +506,15 @@ msgstr "" msgid "An example for :class:`Sniffer` use::" msgstr "Um exemplo para uso de :class:`Sniffer`::" +#: ../../library/csv.rst:307 +msgid "" +"with open('example.csv', newline='') as csvfile:\n" +" dialect = csv.Sniffer().sniff(csvfile.read(1024))\n" +" csvfile.seek(0)\n" +" reader = csv.reader(csvfile, dialect)\n" +" # ... process CSV file contents here ..." +msgstr "" + #: ../../library/csv.rst:316 msgid "The :mod:`csv` module defines the following constants:" msgstr "O módulo :mod:`csv` define as seguintes constantes:" @@ -821,14 +885,40 @@ msgstr "Exemplos" msgid "The simplest example of reading a CSV file::" msgstr "O exemplo mais simples de leitura de um arquivo CSV::" +#: ../../library/csv.rst:554 +msgid "" +"import csv\n" +"with open('some.csv', newline='') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" +msgstr "" + #: ../../library/csv.rst:560 msgid "Reading a file with an alternate format::" msgstr "Lendo um arquivo com um formato alternativo::" +#: ../../library/csv.rst:562 +msgid "" +"import csv\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, delimiter=':', quoting=csv.QUOTE_NONE)\n" +" for row in reader:\n" +" print(row)" +msgstr "" + #: ../../library/csv.rst:568 msgid "The corresponding simplest possible writing example is::" msgstr "O exemplo de escrita possível mais simples possível é::" +#: ../../library/csv.rst:570 +msgid "" +"import csv\n" +"with open('some.csv', 'w', newline='') as f:\n" +" writer = csv.writer(f)\n" +" writer.writerows(someiterable)" +msgstr "" + #: ../../library/csv.rst:575 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " @@ -841,6 +931,15 @@ msgstr "" "sistema (consulte :func:`locale.getencoding`). Para decodificar um arquivo " "usando uma codificação diferente, use o argumento ``encoding`` do open::" +#: ../../library/csv.rst:580 +msgid "" +"import csv\n" +"with open('some.csv', newline='', encoding='utf-8') as f:\n" +" reader = csv.reader(f)\n" +" for row in reader:\n" +" print(row)" +msgstr "" + #: ../../library/csv.rst:586 msgid "" "The same applies to writing in something other than the system default " @@ -853,6 +952,14 @@ msgstr "" msgid "Registering a new dialect::" msgstr "Registrando um novo dialeto::" +#: ../../library/csv.rst:591 +msgid "" +"import csv\n" +"csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" +"with open('passwd', newline='') as f:\n" +" reader = csv.reader(f, 'unixpwd')" +msgstr "" + #: ../../library/csv.rst:596 msgid "" "A slightly more advanced use of the reader --- catching and reporting " @@ -860,6 +967,19 @@ msgid "" msgstr "" "Um uso um pouco mais avançado do leitor --- capturando e relatando erros::" +#: ../../library/csv.rst:598 +msgid "" +"import csv, sys\n" +"filename = 'some.csv'\n" +"with open(filename, newline='') as f:\n" +" reader = csv.reader(f)\n" +" try:\n" +" for row in reader:\n" +" print(row)\n" +" except csv.Error as e:\n" +" sys.exit('file {}, line {}: {}'.format(filename, reader.line_num, e))" +msgstr "" + #: ../../library/csv.rst:608 msgid "" "And while the module doesn't directly support parsing strings, it can easily " @@ -868,6 +988,13 @@ msgstr "" "E embora o módulo não tenha suporte diretamente à análise sintática de " "strings, isso pode ser feito facilmente::" +#: ../../library/csv.rst:611 +msgid "" +"import csv\n" +"for row in csv.reader(['one,two,three']):\n" +" print(row)" +msgstr "" + #: ../../library/csv.rst:617 msgid "Footnotes" msgstr "Notas de rodapé" diff --git a/library/ctypes.po b/library/ctypes.po index bbc1874d6..d63b4a4a7 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Claudio Rogerio Carvalho Filho , 2023 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -102,6 +99,17 @@ msgid "" "convention::" msgstr "" +#: ../../library/ctypes.rst:57 +msgid "" +">>> from ctypes import *\n" +">>> print(windll.kernel32) \n" +"\n" +">>> print(cdll.msvcrt) \n" +"\n" +">>> libc = cdll.msvcrt \n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:65 msgid "Windows appends the usual ``.dll`` file suffix automatically." msgstr "" @@ -123,6 +131,16 @@ msgid "" "CDLL by calling the constructor::" msgstr "" +#: ../../library/ctypes.rst:79 +msgid "" +">>> cdll.LoadLibrary(\"libc.so.6\") \n" +"\n" +">>> libc = CDLL(\"libc.so.6\") \n" +">>> libc \n" +"\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:92 msgid "Accessing functions from loaded dlls" msgstr "" @@ -131,17 +149,40 @@ msgstr "" msgid "Functions are accessed as attributes of dll objects::" msgstr "Funções são acessadas como atributos de objetos dll::" +#: ../../library/ctypes.rst:96 +msgid "" +">>> libc.printf\n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.GetModuleHandleA) \n" +"<_FuncPtr object at 0x...>\n" +">>> print(windll.kernel32.MyOwnFunction) \n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 239, in __getattr__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function 'MyOwnFunction' not found\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:108 msgid "" "Note that win32 system dlls like ``kernel32`` and ``user32`` often export " "ANSI as well as UNICODE versions of a function. The UNICODE version is " -"exported with an ``W`` appended to the name, while the ANSI version is " +"exported with a ``W`` appended to the name, while the ANSI version is " "exported with an ``A`` appended to the name. The win32 ``GetModuleHandle`` " "function, which returns a *module handle* for a given module name, has the " "following C prototype, and a macro is used to expose one of them as " "``GetModuleHandle`` depending on whether UNICODE is defined or not::" msgstr "" +#: ../../library/ctypes.rst:116 +msgid "" +"/* ANSI version */\n" +"HMODULE GetModuleHandleA(LPCSTR lpModuleName);\n" +"/* UNICODE version */\n" +"HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" +msgstr "" + #: ../../library/ctypes.rst:121 msgid "" "*windll* does not try to select one of them by magic, you must access the " @@ -156,6 +197,13 @@ msgid "" "`getattr` to retrieve the function::" msgstr "" +#: ../../library/ctypes.rst:129 +msgid "" +">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\") \n" +"<_FuncPtr object at 0x...>\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:133 msgid "" "On Windows, some dlls export functions not by name but by ordinal. These " @@ -163,6 +211,19 @@ msgid "" "number::" msgstr "" +#: ../../library/ctypes.rst:136 +msgid "" +">>> cdll.kernel32[1] \n" +"<_FuncPtr object at 0x...>\n" +">>> cdll.kernel32[0] \n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"ctypes.py\", line 310, in __getitem__\n" +" func = _StdcallFuncPtr(name, self)\n" +"AttributeError: function ordinal 0 not found\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:150 msgid "Calling functions" msgstr "" @@ -174,6 +235,12 @@ msgid "" "random integer::" msgstr "" +#: ../../library/ctypes.rst:155 +msgid "" +">>> print(libc.rand()) \n" +"1804289383" +msgstr "" + #: ../../library/ctypes.rst:158 msgid "" "On Windows, you can call the ``GetModuleHandleA()`` function, which returns " @@ -181,12 +248,36 @@ msgid "" "``NULL`` pointer)::" msgstr "" +#: ../../library/ctypes.rst:161 +msgid "" +">>> print(hex(windll.kernel32.GetModuleHandleA(None))) \n" +"0x1d000000\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:165 msgid "" ":exc:`ValueError` is raised when you call an ``stdcall`` function with the " "``cdecl`` calling convention, or vice versa::" msgstr "" +#: ../../library/ctypes.rst:168 +msgid "" +">>> cdll.kernel32.GetModuleHandleA(None) \n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: Procedure probably called with not enough arguments (4 bytes " +"missing)\n" +">>>\n" +"\n" +">>> windll.msvcrt.printf(b\"spam\") \n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: Procedure probably called with too many arguments (4 bytes in " +"excess)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:180 msgid "" "To find out the correct calling convention you have to look into the C " @@ -200,6 +291,15 @@ msgid "" "with invalid argument values::" msgstr "" +#: ../../library/ctypes.rst:187 +msgid "" +">>> windll.kernel32.GetModuleHandleA(32) \n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"OSError: exception: access violation reading 0x00000020\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:193 msgid "" "There are, however, enough ways to crash Python with :mod:`ctypes`, so you " @@ -466,11 +566,35 @@ msgid "" "of the correct type and value::" msgstr "" +#: ../../library/ctypes.rst:272 +msgid "" +">>> c_int()\n" +"c_long(0)\n" +">>> c_wchar_p(\"Hello, World\")\n" +"c_wchar_p(140018365411392)\n" +">>> c_ushort(-3)\n" +"c_ushort(65533)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:280 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "" +#: ../../library/ctypes.rst:282 +msgid "" +">>> i = c_int(42)\n" +">>> print(i)\n" +"c_long(42)\n" +">>> print(i.value)\n" +"42\n" +">>> i.value = -99\n" +">>> print(i.value)\n" +"-99\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:292 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" @@ -479,6 +603,24 @@ msgid "" "Python bytes objects are immutable)::" msgstr "" +#: ../../library/ctypes.rst:297 +msgid "" +">>> s = \"Hello, World\"\n" +">>> c_s = c_wchar_p(s)\n" +">>> print(c_s)\n" +"c_wchar_p(139966785747344)\n" +">>> print(c_s.value)\n" +"Hello World\n" +">>> c_s.value = \"Hi, there\"\n" +">>> print(c_s) # the memory location has changed\n" +"c_wchar_p(139966783348904)\n" +">>> print(c_s.value)\n" +"Hi, there\n" +">>> print(s) # first object is unchanged\n" +"Hello, World\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:312 msgid "" "You should be careful, however, not to pass them to functions expecting " @@ -489,6 +631,28 @@ msgid "" "``value`` property::" msgstr "" +#: ../../library/ctypes.rst:319 +msgid "" +">>> from ctypes import *\n" +">>> p = create_string_buffer(3) # create a 3 byte buffer, " +"initialized to NUL bytes\n" +">>> print(sizeof(p), repr(p.raw))\n" +"3 b'\\x00\\x00\\x00'\n" +">>> p = create_string_buffer(b\"Hello\") # create a buffer containing a " +"NUL terminated string\n" +">>> print(sizeof(p), repr(p.raw))\n" +"6 b'Hello\\x00'\n" +">>> print(repr(p.value))\n" +"b'Hello'\n" +">>> p = create_string_buffer(b\"Hello\", 10) # create a 10 byte buffer\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hello\\x00\\x00\\x00\\x00\\x00'\n" +">>> p.value = b\"Hi\"\n" +">>> print(sizeof(p), repr(p.raw))\n" +"10 b'Hi\\x00lo\\x00\\x00\\x00\\x00\\x00'\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:336 msgid "" "The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` " @@ -508,6 +672,25 @@ msgid "" "from within *IDLE* or *PythonWin*::" msgstr "" +#: ../../library/ctypes.rst:351 +msgid "" +">>> printf = libc.printf\n" +">>> printf(b\"Hello, %s\\n\", b\"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"Hello, %S\\n\", \"World!\")\n" +"Hello, World!\n" +"14\n" +">>> printf(b\"%d bottles of beer\\n\", 42)\n" +"42 bottles of beer\n" +"19\n" +">>> printf(b\"%f bottles of beer\\n\", 42.5)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ArgumentError: argument 2: TypeError: Don't know how to convert parameter 2\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:367 msgid "" "As has been mentioned before, all Python types except integers, strings, and " @@ -515,6 +698,14 @@ msgid "" "so that they can be converted to the required C data type::" msgstr "" +#: ../../library/ctypes.rst:371 +msgid "" +">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" +"An int 1234, a double 3.140000\n" +"31\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:379 msgid "Calling variadic functions" msgstr "" @@ -534,6 +725,10 @@ msgid "" "attribute for the regular, non-variadic, function arguments:" msgstr "" +#: ../../library/ctypes.rst:389 +msgid "libc.printf.argtypes = [ctypes.c_char_p]" +msgstr "" + #: ../../library/ctypes.rst:393 msgid "" "Because specifying the attribute does not inhibit portability it is advised " @@ -553,6 +748,19 @@ msgid "" "or an object with an :attr:`!_as_parameter_` attribute::" msgstr "" +#: ../../library/ctypes.rst:408 +msgid "" +">>> class Bottles:\n" +"... def __init__(self, number):\n" +"... self._as_parameter_ = number\n" +"...\n" +">>> bottles = Bottles(42)\n" +">>> printf(b\"%d bottles of beer\\n\", bottles)\n" +"42 bottles of beer\n" +"19\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:418 msgid "" "If you don't want to store the instance's data in the :attr:`!" @@ -579,6 +787,15 @@ msgid "" "feature)::" msgstr "" +#: ../../library/ctypes.rst:436 +msgid "" +">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" +">>> printf(b\"String '%s', Int %d, Double %f\\n\", b\"Hi\", 10, 2.2)\n" +"String 'Hi', Int 10, Double 2.200000\n" +"37\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:442 msgid "" "Specifying a format protects against incompatible argument types (just as a " @@ -586,6 +803,18 @@ msgid "" "types::" msgstr "" +#: ../../library/ctypes.rst:445 +msgid "" +">>> printf(b\"%d %d %d\", 1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ArgumentError: argument 2: TypeError: wrong type\n" +">>> printf(b\"%s %d %f\\n\", b\"X\", 2, 3)\n" +"X 2 3.000000\n" +"13\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:454 msgid "" "If you have defined your own classes which you pass to function calls, you " @@ -618,22 +847,49 @@ msgid "" "expr:`int`, you should specify the :attr:`!restype` attribute::" msgstr "" +#: ../../library/ctypes.rst:486 +msgid ">>> libc.time.restype = c_time_t" +msgstr "" + #: ../../library/ctypes.rst:488 msgid "The argument types can be specified using :attr:`~_FuncPtr.argtypes`::" msgstr "" +#: ../../library/ctypes.rst:490 +msgid ">>> libc.time.argtypes = (POINTER(c_time_t),)" +msgstr "" + #: ../../library/ctypes.rst:492 msgid "" "To call the function with a ``NULL`` pointer as first argument, use " "``None``::" msgstr "" +#: ../../library/ctypes.rst:494 +msgid "" +">>> print(libc.time(None)) \n" +"1150640792" +msgstr "" + #: ../../library/ctypes.rst:497 msgid "" "Here is a more advanced example, it uses the :func:`!strchr` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" +#: ../../library/ctypes.rst:500 +msgid "" +">>> strchr = libc.strchr\n" +">>> strchr(b\"abcdef\", ord(\"d\")) \n" +"8059983\n" +">>> strchr.restype = c_char_p # c_char_p is a pointer to a string\n" +">>> strchr(b\"abcdef\", ord(\"d\"))\n" +"b'def'\n" +">>> print(strchr(b\"abcdef\", ord(\"x\")))\n" +"None\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:510 msgid "" "If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " @@ -641,6 +897,23 @@ msgid "" "converted from a single character Python bytes object into a C char:" msgstr "" +#: ../../library/ctypes.rst:514 +msgid "" +">>> strchr.restype = c_char_p\n" +">>> strchr.argtypes = [c_char_p, c_char]\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>> strchr(b\"abcdef\", b\"def\")\n" +"Traceback (most recent call last):\n" +"ctypes.ArgumentError: argument 2: TypeError: one character bytes, bytearray " +"or integer expected\n" +">>> print(strchr(b\"abcdef\", b\"x\"))\n" +"None\n" +">>> strchr(b\"abcdef\", b\"d\")\n" +"b'def'\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:529 msgid "" "You can also use a callable Python object (a function or a class for " @@ -651,6 +924,26 @@ msgid "" "automatically raise an exception::" msgstr "" +#: ../../library/ctypes.rst:535 +msgid "" +">>> GetModuleHandle = windll.kernel32.GetModuleHandleA \n" +">>> def ValidHandle(value):\n" +"... if value == 0:\n" +"... raise WinError()\n" +"... return value\n" +"...\n" +">>>\n" +">>> GetModuleHandle.restype = ValidHandle \n" +">>> GetModuleHandle(None) \n" +"486539264\n" +">>> GetModuleHandle(\"something silly\") \n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 3, in ValidHandle\n" +"OSError: [Errno 126] The specified module could not be found.\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:552 msgid "" "``WinError`` is a function which will call Windows ``FormatMessage()`` api " @@ -687,6 +980,21 @@ msgid "" "you don't need the pointer object in Python itself::" msgstr "" +#: ../../library/ctypes.rst:577 +msgid "" +">>> i = c_int()\n" +">>> f = c_float()\n" +">>> s = create_string_buffer(b'\\000' * 32)\n" +">>> print(i.value, f.value, repr(s.value))\n" +"0 0.0 b''\n" +">>> libc.sscanf(b\"1 3.14 Hello\", b\"%d %f %s\",\n" +"... byref(i), byref(f), s)\n" +"3\n" +">>> print(i.value, f.value, repr(s.value))\n" +"1 3.1400001049 b'Hello'\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:593 msgid "Structures and unions" msgstr "" @@ -713,6 +1021,26 @@ msgid "" "constructor::" msgstr "" +#: ../../library/ctypes.rst:606 +msgid "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = [(\"x\", c_int),\n" +"... (\"y\", c_int)]\n" +"...\n" +">>> point = POINT(10, 20)\n" +">>> print(point.x, point.y)\n" +"10 20\n" +">>> point = POINT(y=5)\n" +">>> print(point.x, point.y)\n" +"0 5\n" +">>> POINT(1, 2, 3)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: too many initializers\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:623 msgid "" "You can, however, build much more complicated structures. A structure can " @@ -725,18 +1053,47 @@ msgid "" "*lowerright*::" msgstr "" +#: ../../library/ctypes.rst:629 +msgid "" +">>> class RECT(Structure):\n" +"... _fields_ = [(\"upperleft\", POINT),\n" +"... (\"lowerright\", POINT)]\n" +"...\n" +">>> rc = RECT(point)\n" +">>> print(rc.upperleft.x, rc.upperleft.y)\n" +"0 5\n" +">>> print(rc.lowerright.x, rc.lowerright.y)\n" +"0 0\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:640 msgid "" "Nested structures can also be initialized in the constructor in several " "ways::" msgstr "" +#: ../../library/ctypes.rst:642 +msgid "" +">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" +">>> r = RECT((1, 2), (3, 4))" +msgstr "" + #: ../../library/ctypes.rst:645 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " "useful for debugging because they can provide useful information::" msgstr "" +#: ../../library/ctypes.rst:648 +msgid "" +">>> print(POINT.x)\n" +"\n" +">>> print(POINT.y)\n" +"\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:659 msgid "" ":mod:`ctypes` does not support passing unions or structures with bit-fields " @@ -778,6 +1135,19 @@ msgid "" "the third item in the :attr:`~Structure._fields_` tuples::" msgstr "" +#: ../../library/ctypes.rst:689 +msgid "" +">>> class Int(Structure):\n" +"... _fields_ = [(\"first_16\", c_int, 16),\n" +"... (\"second_16\", c_int, 16)]\n" +"...\n" +">>> print(Int.first_16)\n" +"\n" +">>> print(Int.second_16)\n" +"\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:703 msgid "Arrays" msgstr "Arrays" @@ -794,16 +1164,43 @@ msgid "" "a positive integer::" msgstr "" +#: ../../library/ctypes.rst:710 +msgid "TenPointsArrayType = POINT * 10" +msgstr "" + #: ../../library/ctypes.rst:712 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" +#: ../../library/ctypes.rst:715 +msgid "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class MyStruct(Structure):\n" +"... _fields_ = [(\"a\", c_int),\n" +"... (\"b\", c_float),\n" +"... (\"point_array\", POINT * 4)]\n" +">>>\n" +">>> print(len(MyStruct().point_array))\n" +"4\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:728 msgid "Instances are created in the usual way, by calling the class::" msgstr "" +#: ../../library/ctypes.rst:730 +msgid "" +"arr = TenPointsArrayType()\n" +"for pt in arr:\n" +" print(pt.x, pt.y)" +msgstr "" + #: ../../library/ctypes.rst:734 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " @@ -814,6 +1211,19 @@ msgstr "" msgid "Initializers of the correct type can also be specified::" msgstr "" +#: ../../library/ctypes.rst:739 +msgid "" +">>> from ctypes import *\n" +">>> TenIntegers = c_int * 10\n" +">>> ii = TenIntegers(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n" +">>> print(ii)\n" +"\n" +">>> for i in ii: print(i, end=\" \")\n" +"...\n" +"1 2 3 4 5 6 7 8 9 10\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:753 msgid "Pointers" msgstr "Ponteiros" @@ -824,18 +1234,42 @@ msgid "" "mod:`ctypes` type::" msgstr "" +#: ../../library/ctypes.rst:758 +msgid "" +">>> from ctypes import *\n" +">>> i = c_int(42)\n" +">>> pi = pointer(i)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:763 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" +#: ../../library/ctypes.rst:766 +msgid "" +">>> pi.contents\n" +"c_long(42)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:770 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" +#: ../../library/ctypes.rst:773 +msgid "" +">>> pi.contents is i\n" +"False\n" +">>> pi.contents is pi.contents\n" +"False\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:779 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " @@ -843,14 +1277,40 @@ msgid "" "is stored::" msgstr "" +#: ../../library/ctypes.rst:782 +msgid "" +">>> i = c_int(99)\n" +">>> pi.contents = i\n" +">>> pi.contents\n" +"c_long(99)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:791 msgid "Pointer instances can also be indexed with integers::" msgstr "" +#: ../../library/ctypes.rst:793 +msgid "" +">>> pi[0]\n" +"99\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:797 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" +#: ../../library/ctypes.rst:799 +msgid "" +">>> print(i)\n" +"c_long(99)\n" +">>> pi[0] = 22\n" +">>> print(i)\n" +"c_long(22)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:806 msgid "" "It is also possible to use indexes different from 0, but you must know what " @@ -868,18 +1328,55 @@ msgid "" "returns a new type::" msgstr "" +#: ../../library/ctypes.rst:817 +msgid "" +">>> PI = POINTER(c_int)\n" +">>> PI\n" +"\n" +">>> PI(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: expected c_long instead of int\n" +">>> PI(c_int(42))\n" +"\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:828 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" +#: ../../library/ctypes.rst:831 +msgid "" +">>> null_ptr = POINTER(c_int)()\n" +">>> print(bool(null_ptr))\n" +"False\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:836 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" +#: ../../library/ctypes.rst:839 +msgid "" +">>> null_ptr[0]\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>\n" +"\n" +">>> null_ptr[0] = 1234\n" +"Traceback (most recent call last):\n" +" ....\n" +"ValueError: NULL pointer access\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:855 msgid "Type conversions" msgstr "Conversão de Tipos" @@ -895,6 +1392,23 @@ msgid "" "ctypes accepts an array of c_int::" msgstr "" +#: ../../library/ctypes.rst:864 +msgid "" +">>> class Bar(Structure):\n" +"... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" +"...\n" +">>> bar = Bar()\n" +">>> bar.values = (c_int * 3)(1, 2, 3)\n" +">>> bar.count = 3\n" +">>> for i in range(bar.count):\n" +"... print(bar.values[i])\n" +"...\n" +"1\n" +"2\n" +"3\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:878 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " @@ -908,6 +1422,12 @@ msgstr "" msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" +#: ../../library/ctypes.rst:885 +msgid "" +">>> bar.values = None\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:890 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " @@ -917,6 +1437,16 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" +#: ../../library/ctypes.rst:896 +msgid "" +">>> bar.values = (c_byte * 4)()\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long " +"instance\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:902 msgid "For these cases, the :func:`cast` function is handy." msgstr "" @@ -930,12 +1460,29 @@ msgid "" "references the same memory block as the first argument::" msgstr "" +#: ../../library/ctypes.rst:910 +msgid "" +">>> a = (c_byte * 4)()\n" +">>> cast(a, POINTER(c_int))\n" +"\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:915 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" +#: ../../library/ctypes.rst:918 +msgid "" +">>> bar = Bar()\n" +">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" +">>> print(bar.values[0])\n" +"0\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:928 msgid "Incomplete Types" msgstr "Tipos Incompletos" @@ -947,12 +1494,35 @@ msgid "" "defined later::" msgstr "" +#: ../../library/ctypes.rst:934 +msgid "" +"struct cell; /* forward declaration */\n" +"\n" +"struct cell {\n" +" char *name;\n" +" struct cell *next;\n" +"};" +msgstr "" + #: ../../library/ctypes.rst:941 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" +#: ../../library/ctypes.rst:944 +msgid "" +">>> class cell(Structure):\n" +"... _fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +"...\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" File \"\", line 2, in cell\n" +"NameError: name 'cell' is not defined\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:954 msgid "" "because the new ``class cell`` is not available in the class statement " @@ -960,12 +1530,40 @@ msgid "" "`~Structure._fields_` attribute later, after the class statement::" msgstr "" +#: ../../library/ctypes.rst:958 +msgid "" +">>> from ctypes import *\n" +">>> class cell(Structure):\n" +"... pass\n" +"...\n" +">>> cell._fields_ = [(\"name\", c_char_p),\n" +"... (\"next\", POINTER(cell))]\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:966 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" +#: ../../library/ctypes.rst:969 +msgid "" +">>> c1 = cell()\n" +">>> c1.name = b\"foo\"\n" +">>> c2 = cell()\n" +">>> c2.name = b\"bar\"\n" +">>> c1.next = pointer(c2)\n" +">>> c2.next = pointer(c1)\n" +">>> p = c1\n" +">>> for i in range(8):\n" +"... print(p.name, end=\" \")\n" +"... p = p.next[0]\n" +"...\n" +"foo bar foo bar foo bar foo bar\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:987 msgid "Callback functions" msgstr "Funções Callbacks" @@ -1005,6 +1603,15 @@ msgid "" "function. :c:func:`!qsort` will be used to sort an array of integers::" msgstr "" +#: ../../library/ctypes.rst:1009 +msgid "" +">>> IntArray5 = c_int * 5\n" +">>> ia = IntArray5(5, 1, 7, 33, 99)\n" +">>> qsort = libc.qsort\n" +">>> qsort.restype = None\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1015 msgid "" ":func:`!qsort` must be called with a pointer to the data to sort, the number " @@ -1021,30 +1628,97 @@ msgid "" "integer. First we create the ``type`` for the callback function::" msgstr "" +#: ../../library/ctypes.rst:1024 +msgid "" +">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1027 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" +#: ../../library/ctypes.rst:1030 +msgid "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return 0\n" +"...\n" +">>> cmp_func = CMPFUNC(py_cmp_func)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1037 msgid "The result::" msgstr "O resultado::" +#: ../../library/ctypes.rst:1039 +msgid "" +">>> qsort(ia, len(ia), sizeof(c_int), cmp_func) \n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 5 7\n" +"py_cmp_func 1 7\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1047 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" +#: ../../library/ctypes.rst:1049 +msgid "" +">>> def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>>\n" +">>> qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func)) \n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1062 msgid "As we can easily check, our array is sorted now::" msgstr "" +#: ../../library/ctypes.rst:1064 +msgid "" +">>> for i in ia: print(i, end=\" \")\n" +"...\n" +"1 5 7 33 99\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1069 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" +#: ../../library/ctypes.rst:1072 +msgid "" +">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" +"... def py_cmp_func(a, b):\n" +"... print(\"py_cmp_func\", a[0], b[0])\n" +"... return a[0] - b[0]\n" +"...\n" +">>> qsort(ia, len(ia), sizeof(c_int), py_cmp_func)\n" +"py_cmp_func 5 1\n" +"py_cmp_func 33 99\n" +"py_cmp_func 7 33\n" +"py_cmp_func 1 7\n" +"py_cmp_func 5 7\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1087 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " @@ -1080,6 +1754,13 @@ msgid "" "to the Python C api::" msgstr "" +#: ../../library/ctypes.rst:1111 +msgid "" +">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" +">>> print(hex(version.value))\n" +"0x30c00a0" +msgstr "" + #: ../../library/ctypes.rst:1115 msgid "" "An extended example which also demonstrates the use of pointers accesses " @@ -1110,12 +1791,33 @@ msgid "" "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" +#: ../../library/ctypes.rst:1128 +msgid "" +">>> from ctypes import *\n" +">>>\n" +">>> class struct_frozen(Structure):\n" +"... _fields_ = [(\"name\", c_char_p),\n" +"... (\"code\", POINTER(c_ubyte)),\n" +"... (\"size\", c_int),\n" +"... (\"get_code\", POINTER(c_ubyte)), # Function pointer\n" +"... ]\n" +"...\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1139 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" +#: ../../library/ctypes.rst:1142 +msgid "" +">>> FrozenTable = POINTER(struct_frozen)\n" +">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1146 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " @@ -1125,6 +1827,19 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" +#: ../../library/ctypes.rst:1152 +msgid "" +">>> for item in table:\n" +"... if item.name is None:\n" +"... break\n" +"... print(item.name.decode(\"ascii\"), item.size)\n" +"...\n" +"_frozen_importlib 31764\n" +"_frozen_importlib_external 41499\n" +"zipimport 12345\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1162 msgid "" "The fact that standard Python has a frozen module and a frozen package " @@ -1146,12 +1861,41 @@ msgstr "" msgid "Consider the following example::" msgstr "" +#: ../../library/ctypes.rst:1177 +msgid "" +">>> from ctypes import *\n" +">>> class POINT(Structure):\n" +"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" +"...\n" +">>> class RECT(Structure):\n" +"... _fields_ = (\"a\", POINT), (\"b\", POINT)\n" +"...\n" +">>> p1 = POINT(1, 2)\n" +">>> p2 = POINT(3, 4)\n" +">>> rc = RECT(p1, p2)\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"1 2 3 4\n" +">>> # now swap the two points\n" +">>> rc.a, rc.b = rc.b, rc.a\n" +">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" +"3 4 3 4\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1195 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" +#: ../../library/ctypes.rst:1198 +msgid "" +">>> temp0, temp1 = rc.b, rc.a\n" +">>> rc.a = temp0\n" +">>> rc.b = temp1\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1203 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " @@ -1174,6 +1918,17 @@ msgid "" "this::" msgstr "" +#: ../../library/ctypes.rst:1215 +msgid "" +">>> s = c_char_p()\n" +">>> s.value = b\"abc def ghi\"\n" +">>> s.value\n" +"b'abc def ghi'\n" +">>> s.value is s.value\n" +"False\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1225 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " @@ -1207,6 +1962,23 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" +#: ../../library/ctypes.rst:1248 +msgid "" +">>> short_array = (c_short * 4)()\n" +">>> print(sizeof(short_array))\n" +"8\n" +">>> resize(short_array, 4)\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: minimum size is 8\n" +">>> resize(short_array, 32)\n" +">>> sizeof(short_array)\n" +"32\n" +">>> sizeof(type(short_array))\n" +"8\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1262 msgid "" "This is nice and fine, but how would one access the additional elements " @@ -1214,6 +1986,17 @@ msgid "" "we get errors accessing other elements::" msgstr "" +#: ../../library/ctypes.rst:1266 +msgid "" +">>> short_array[:]\n" +"[0, 0, 0, 0]\n" +">>> short_array[7]\n" +"Traceback (most recent call last):\n" +" ...\n" +"IndexError: invalid index\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1274 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " @@ -1280,6 +2063,18 @@ msgstr "" msgid "Here are some examples::" msgstr "Veja alguns exemplos::" +#: ../../library/ctypes.rst:1324 +msgid "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"m\")\n" +"'libm.so.6'\n" +">>> find_library(\"c\")\n" +"'libc.so.6'\n" +">>> find_library(\"bz2\")\n" +"'libbz2.so.1.0'\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1333 msgid "" "On macOS, :func:`~ctypes.util.find_library` tries several predefined naming " @@ -1287,6 +2082,20 @@ msgid "" "successful::" msgstr "" +#: ../../library/ctypes.rst:1336 +msgid "" +">>> from ctypes.util import find_library\n" +">>> find_library(\"c\")\n" +"'/usr/lib/libc.dylib'\n" +">>> find_library(\"m\")\n" +"'/usr/lib/libm.dylib'\n" +">>> find_library(\"bz2\")\n" +"'/usr/lib/libbz2.dylib'\n" +">>> find_library(\"AGL\")\n" +"'/System/Library/Frameworks/AGL.framework/AGL'\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1347 msgid "" "On Windows, :func:`~ctypes.util.find_library` searches along the system " @@ -1469,6 +2278,16 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" +#: ../../library/ctypes.rst:1502 +msgid "" +">>> from ctypes import CDLL\n" +">>> libc = CDLL(\"libc.so.6\") # On Linux\n" +">>> libc.time == libc.time\n" +"True\n" +">>> libc['time'] == libc['time']\n" +"False" +msgstr "" + #: ../../library/ctypes.rst:1509 msgid "" "The following public attributes are available, their name starts with an " @@ -1545,15 +2364,7 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1580 -msgid "" -"Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " -"``name``." -msgstr "" -"Levanta um :ref:`evento de auditoria ` ``ctypes.dlopen`` com o " -"argumento ``name``." - -#: ../../library/ctypes.rst:1582 +#: ../../library/ctypes.rst:1580 ../../library/ctypes.rst:1582 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " @@ -1563,26 +2374,14 @@ msgstr "" "ref:`evento de auditoria ` ``ctypes.dlopen`` com o argumento " "string ``name``, o nome usado para carregar a biblioteca." -#: ../../library/ctypes.rst:1586 -msgid "" -"Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " -"``library``, ``name``." -msgstr "" - -#: ../../library/ctypes.rst:1588 +#: ../../library/ctypes.rst:1586 ../../library/ctypes.rst:1588 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1592 -msgid "" -"Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " -"arguments ``handle``, ``name``." -msgstr "" - -#: ../../library/ctypes.rst:1594 +#: ../../library/ctypes.rst:1592 ../../library/ctypes.rst:1594 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " @@ -1698,13 +2497,7 @@ msgid "" "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1683 -msgid "" -"Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " -"argument ``code``." -msgstr "" - -#: ../../library/ctypes.rst:1685 +#: ../../library/ctypes.rst:1683 ../../library/ctypes.rst:1685 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -1713,13 +2506,7 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1691 -msgid "" -"Raises an :ref:`auditing event ` ``ctypes.call_function`` with " -"arguments ``func_pointer``, ``arguments``." -msgstr "" - -#: ../../library/ctypes.rst:1693 +#: ../../library/ctypes.rst:1691 ../../library/ctypes.rst:1693 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " @@ -1868,14 +2655,41 @@ msgid "" "declaration from the windows header file is this::" msgstr "" +#: ../../library/ctypes.rst:1803 +msgid "" +"WINUSERAPI int WINAPI\n" +"MessageBoxW(\n" +" HWND hWnd,\n" +" LPCWSTR lpText,\n" +" LPCWSTR lpCaption,\n" +" UINT uType);" +msgstr "" + #: ../../library/ctypes.rst:1810 ../../library/ctypes.rst:1833 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" +#: ../../library/ctypes.rst:1812 +msgid "" +">>> from ctypes import c_int, WINFUNCTYPE, windll\n" +">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" +">>> prototype = WINFUNCTYPE(c_int, HWND, LPCWSTR, LPCWSTR, UINT)\n" +">>> paramflags = (1, \"hwnd\", 0), (1, \"text\", \"Hi\"), (1, \"caption\", " +"\"Hello from ctypes\"), (1, \"flags\", 0)\n" +">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" +msgstr "" + #: ../../library/ctypes.rst:1818 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" +#: ../../library/ctypes.rst:1820 +msgid "" +">>> MessageBox()\n" +">>> MessageBox(text=\"Spam, spam, spam\")\n" +">>> MessageBox(flags=2, text=\"foo bar\")" +msgstr "" + #: ../../library/ctypes.rst:1824 msgid "" "A second example demonstrates output parameters. The win32 " @@ -1884,6 +2698,25 @@ msgid "" "the C declaration::" msgstr "" +#: ../../library/ctypes.rst:1828 +msgid "" +"WINUSERAPI BOOL WINAPI\n" +"GetWindowRect(\n" +" HWND hWnd,\n" +" LPRECT lpRect);" +msgstr "" + +#: ../../library/ctypes.rst:1835 +msgid "" +">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" +">>> from ctypes.wintypes import BOOL, HWND, RECT\n" +">>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))\n" +">>> paramflags = (1, \"hwnd\"), (2, \"lprect\")\n" +">>> GetWindowRect = prototype((\"GetWindowRect\", windll.user32), " +"paramflags)\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1842 msgid "" "Functions with output parameters will automatically return the output " @@ -1901,6 +2734,17 @@ msgid "" "exception when the api call failed::" msgstr "" +#: ../../library/ctypes.rst:1852 +msgid "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... return args\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1860 msgid "" "If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " @@ -1910,6 +2754,18 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" +#: ../../library/ctypes.rst:1866 +msgid "" +">>> def errcheck(result, func, args):\n" +"... if not result:\n" +"... raise WinError()\n" +"... rc = args[1]\n" +"... return rc.left, rc.top, rc.bottom, rc.right\n" +"...\n" +">>> GetWindowRect.errcheck = errcheck\n" +">>>" +msgstr "" + #: ../../library/ctypes.rst:1879 msgid "Utility functions" msgstr "Funções utilitárias" @@ -1945,6 +2801,10 @@ msgstr "" msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" +#: ../../library/ctypes.rst:1903 +msgid "(((char *)&obj) + offset)" +msgstr "" + #: ../../library/ctypes.rst:1905 msgid "" "The returned object can only be used as a foreign function call parameter. " @@ -2266,13 +3126,7 @@ msgid "" "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2150 -msgid "" -"Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " -"``address``." -msgstr "" - -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:2150 ../../library/ctypes.rst:2152 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." @@ -2654,6 +3508,15 @@ msgid "" "data types that directly or indirectly reference themselves::" msgstr "" +#: ../../library/ctypes.rst:2508 +msgid "" +"class List(Structure):\n" +" pass\n" +"List._fields_ = [(\"pnext\", POINTER(List)),\n" +" ...\n" +" ]" +msgstr "" + #: ../../library/ctypes.rst:2514 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " @@ -2696,6 +3559,19 @@ msgstr "" msgid "Here is an example type (Windows)::" msgstr "" +#: ../../library/ctypes.rst:2545 +msgid "" +"class _U(Union):\n" +" _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" +" (\"lpadesc\", POINTER(ARRAYDESC)),\n" +" (\"hreftype\", HREFTYPE)]\n" +"\n" +"class TYPEDESC(Structure):\n" +" _anonymous_ = (\"u\",)\n" +" _fields_ = [(\"u\", _U),\n" +" (\"vt\", VARTYPE)]" +msgstr "" + #: ../../library/ctypes.rst:2556 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " @@ -2706,6 +3582,14 @@ msgid "" "temporary union instance::" msgstr "" +#: ../../library/ctypes.rst:2563 +msgid "" +"td = TYPEDESC()\n" +"td.vt = VT_PTR\n" +"td.lptdesc = POINTER(some_type)\n" +"td.u.lptdesc = POINTER(some_type)" +msgstr "" + #: ../../library/ctypes.rst:2568 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 4fbe1c0ed..7e28e464e 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 -# Adorilson Bezerra , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Adorilson Bezerra , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/curses.panel.po b/library/curses.panel.po index ed786bbee..12d9b956b 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Cássio Nomura , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/curses.po b/library/curses.po index 69eef7d25..8864bcad7 100644 --- a/library/curses.po +++ b/library/curses.po @@ -4,30 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Danilo Lima , 2021 -# Risaffi , 2021 -# Welington Carlos , 2021 -# i17obot , 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# (Douglas da Silva) , 2021 -# Rafael Fontenelle , 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-16 14:48+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -1098,7 +1090,7 @@ msgid "Clear the window." msgstr "" #: ../../library/curses.rst:925 -msgid "Return a tuple ``(y, x)`` of co-ordinates of upper-left corner." +msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." msgstr "" #: ../../library/curses.rst:930 diff --git a/library/custominterp.po b/library/custominterp.po index 144458b8c..caf20a723 100644 --- a/library/custominterp.po +++ b/library/custominterp.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/dataclasses.po b/library/dataclasses.po index 09c99ec00..5be6a30cc 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -4,11 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Vinícius Muniz de Melo , 2021 -# i17obot , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -16,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -56,10 +51,34 @@ msgstr "" "Variáveis-membro a serem usadas nesses métodos gerados são definidas usando " "as anotações de tipo da :pep:`526`. Por exemplo, esse código::" +#: ../../library/dataclasses.rst:22 +msgid "" +"from dataclasses import dataclass\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" \"\"\"Class for keeping track of an item in inventory.\"\"\"\n" +" name: str\n" +" unit_price: float\n" +" quantity_on_hand: int = 0\n" +"\n" +" def total_cost(self) -> float:\n" +" return self.unit_price * self.quantity_on_hand" +msgstr "" + #: ../../library/dataclasses.rst:34 msgid "will add, among other things, a :meth:`!__init__` that looks like::" msgstr "adicionará, entre outras coisas, um :meth:`!__init__` como esse::" +#: ../../library/dataclasses.rst:36 +msgid "" +"def __init__(self, name: str, unit_price: float, quantity_on_hand: int = " +"0):\n" +" self.name = name\n" +" self.unit_price = unit_price\n" +" self.quantity_on_hand = quantity_on_hand" +msgstr "" + #: ../../library/dataclasses.rst:41 msgid "" "Note that this method is automatically added to the class: it is not " @@ -124,6 +143,23 @@ msgstr "" "parâmetros, ele age como se tivesse os valores padrão documentados nessa " "assinatura. Ou seja, esses três usos de ``@dataclass`` são equivalentes::" +#: ../../library/dataclasses.rst:74 +msgid "" +"@dataclass\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass()\n" +"class C:\n" +" ...\n" +"\n" +"@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, " +"frozen=False,\n" +" match_args=True, kw_only=False, slots=False, weakref_slot=False)\n" +"class C:\n" +" ..." +msgstr "" + #: ../../library/dataclasses.rst:87 msgid "The parameters to ``@dataclass`` are:" msgstr "Os parâmetros do ``@dataclass`` são:" @@ -339,10 +375,14 @@ msgid "" "*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " "attribute will be generated and new class will be returned instead of the " "original one. If :attr:`!__slots__` is already defined in the class, then :" -"exc:`TypeError` is raised." +"exc:`TypeError` is raised. Calling no-arg :func:`super` in dataclasses using " +"``slots=True`` will result in the following exception being raised: " +"``TypeError: super(type, obj): obj must be an instance or subtype of type``. " +"The two-arg :func:`super` is a valid workaround. See :gh:`90562` for full " +"details." msgstr "" -#: ../../library/dataclasses.rst:192 +#: ../../library/dataclasses.rst:195 msgid "" "If a field name is already included in the :attr:`!__slots__` of a base " "class, it will not be included in the generated :attr:`!__slots__` to " @@ -352,7 +392,7 @@ msgid "" "`!__slots__` may be any iterable, but *not* an iterator." msgstr "" -#: ../../library/dataclasses.rst:202 +#: ../../library/dataclasses.rst:205 msgid "" "*weakref_slot*: If true (the default is ``False``), add a slot named " "\"__weakref__\", which is required to make an instance weakref-able. It is " @@ -360,7 +400,7 @@ msgid "" "``slots=True``." msgstr "" -#: ../../library/dataclasses.rst:209 +#: ../../library/dataclasses.rst:212 msgid "" "``field``\\s may optionally specify a default value, using normal Python " "syntax::" @@ -368,13 +408,25 @@ msgstr "" "``field``\\s pode opcionalmente especificar um valor padrão, usando sintaxe " "Python normal::" -#: ../../library/dataclasses.rst:217 +#: ../../library/dataclasses.rst:215 +msgid "" +"@dataclass\n" +"class C:\n" +" a: int # 'a' has no default value\n" +" b: int = 0 # assign a default value for 'b'" +msgstr "" + +#: ../../library/dataclasses.rst:220 msgid "" "In this example, both :attr:`!a` and :attr:`!b` will be included in the " "added :meth:`~object.__init__` method, which will be defined as::" msgstr "" -#: ../../library/dataclasses.rst:222 +#: ../../library/dataclasses.rst:223 +msgid "def __init__(self, a: int, b: int = 0):" +msgstr "" + +#: ../../library/dataclasses.rst:225 msgid "" ":exc:`TypeError` will be raised if a field without a default value follows a " "field with a default value. This is true whether this occurs in a single " @@ -384,7 +436,7 @@ msgstr "" "após um campo com valor padrão. Isso é verdadeiro se ocorrer numa classe " "simples, ou como resultado de uma herança de classe." -#: ../../library/dataclasses.rst:228 +#: ../../library/dataclasses.rst:231 msgid "" "For common and simple use cases, no other functionality is required. There " "are, however, some dataclass features that require additional per-field " @@ -393,7 +445,17 @@ msgid "" "function. For example::" msgstr "" -#: ../../library/dataclasses.rst:241 +#: ../../library/dataclasses.rst:237 +msgid "" +"@dataclass\n" +"class C:\n" +" mylist: list[int] = field(default_factory=list)\n" +"\n" +"c = C()\n" +"c.mylist += [1, 2, 3]" +msgstr "" + +#: ../../library/dataclasses.rst:244 msgid "" "As shown above, the :const:`MISSING` value is a sentinel object used to " "detect if some parameters are provided by the user. This sentinel is used " @@ -406,18 +468,18 @@ msgstr "" "com um significado distinto. Nenhum código deve usar diretamente o valor :" "const:`MISSING`." -#: ../../library/dataclasses.rst:246 +#: ../../library/dataclasses.rst:249 msgid "The parameters to :func:`!field` are:" msgstr "" -#: ../../library/dataclasses.rst:248 +#: ../../library/dataclasses.rst:251 msgid "" "*default*: If provided, this will be the default value for this field. This " "is needed because the :func:`!field` call itself replaces the normal " "position of the default value." msgstr "" -#: ../../library/dataclasses.rst:252 +#: ../../library/dataclasses.rst:255 msgid "" "*default_factory*: If provided, it must be a zero-argument callable that " "will be called when a default value is needed for this field. Among other " @@ -426,19 +488,19 @@ msgid "" "*default_factory*." msgstr "" -#: ../../library/dataclasses.rst:258 +#: ../../library/dataclasses.rst:261 msgid "" "*init*: If true (the default), this field is included as a parameter to the " "generated :meth:`~object.__init__` method." msgstr "" -#: ../../library/dataclasses.rst:261 +#: ../../library/dataclasses.rst:264 msgid "" "*repr*: If true (the default), this field is included in the string returned " "by the generated :meth:`~object.__repr__` method." msgstr "" -#: ../../library/dataclasses.rst:264 +#: ../../library/dataclasses.rst:267 msgid "" "*hash*: This can be a bool or ``None``. If true, this field is included in " "the generated :meth:`~object.__hash__` method. If ``None`` (the default), " @@ -447,7 +509,7 @@ msgid "" "Setting this value to anything other than ``None`` is discouraged." msgstr "" -#: ../../library/dataclasses.rst:271 +#: ../../library/dataclasses.rst:274 msgid "" "One possible reason to set ``hash=False`` but ``compare=True`` would be if a " "field is expensive to compute a hash value for, that field is needed for " @@ -461,14 +523,14 @@ msgstr "" "de hash do tipo. Mesmo que um campo seja excluído do hash, ele ainda será " "usado para comparações." -#: ../../library/dataclasses.rst:277 +#: ../../library/dataclasses.rst:280 msgid "" "*compare*: If true (the default), this field is included in the generated " "equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." "__gt__`, et al.)." msgstr "" -#: ../../library/dataclasses.rst:281 +#: ../../library/dataclasses.rst:284 msgid "" "*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " "empty dict. This value is wrapped in :func:`~types.MappingProxyType` to " @@ -478,13 +540,13 @@ msgid "" "namespace in the metadata." msgstr "" -#: ../../library/dataclasses.rst:289 +#: ../../library/dataclasses.rst:292 msgid "" "*kw_only*: If true, this field will be marked as keyword-only. This is used " "when the generated :meth:`~object.__init__` method's parameters are computed." msgstr "" -#: ../../library/dataclasses.rst:295 +#: ../../library/dataclasses.rst:298 msgid "" "If the default value of a field is specified by a call to :func:`!field`, " "then the class attribute for this field will be replaced by the specified " @@ -495,14 +557,24 @@ msgid "" "specified. For example, after::" msgstr "" -#: ../../library/dataclasses.rst:311 +#: ../../library/dataclasses.rst:307 +msgid "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: int = field(repr=False)\n" +" z: int = field(repr=False, default=10)\n" +" t: int = 20" +msgstr "" + +#: ../../library/dataclasses.rst:314 msgid "" "The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!" "C.t` will be ``20``, and the class attributes :attr:`!C.x` and :attr:`!C.y` " "will not be set." msgstr "" -#: ../../library/dataclasses.rst:317 +#: ../../library/dataclasses.rst:320 msgid "" ":class:`!Field` objects describe each defined field. These objects are " "created internally, and are returned by the :func:`fields` module-level " @@ -510,22 +582,22 @@ msgid "" "directly. Its documented attributes are:" msgstr "" -#: ../../library/dataclasses.rst:322 +#: ../../library/dataclasses.rst:325 msgid ":attr:`!name`: The name of the field." msgstr "" -#: ../../library/dataclasses.rst:323 +#: ../../library/dataclasses.rst:326 msgid ":attr:`!type`: The type of the field." msgstr "" -#: ../../library/dataclasses.rst:324 +#: ../../library/dataclasses.rst:327 msgid "" ":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" "attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` have " "the identical meaning and values as they do in the :func:`field` function." msgstr "" -#: ../../library/dataclasses.rst:328 +#: ../../library/dataclasses.rst:331 msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." @@ -533,7 +605,7 @@ msgstr "" "Outros atributos podem existir, mas são privados e não devem ser " "inspecionados ou confiáveis." -#: ../../library/dataclasses.rst:333 +#: ../../library/dataclasses.rst:336 msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " "dataclass. Accepts either a dataclass, or an instance of a dataclass. " @@ -546,7 +618,7 @@ msgstr "" "instância de uma. Não retorna pseudocampos que são ``ClassVar`` ou " "``InitVar``." -#: ../../library/dataclasses.rst:340 +#: ../../library/dataclasses.rst:343 msgid "" "Converts the dataclass *obj* to a dict (by using the factory function " "*dict_factory*). Each dataclass is converted to a dict of its fields, as " @@ -554,21 +626,43 @@ msgid "" "into. Other objects are copied with :func:`copy.deepcopy`." msgstr "" -#: ../../library/dataclasses.rst:346 +#: ../../library/dataclasses.rst:349 msgid "Example of using :func:`!asdict` on nested dataclasses::" msgstr "" -#: ../../library/dataclasses.rst:363 ../../library/dataclasses.rst:383 +#: ../../library/dataclasses.rst:351 +msgid "" +"@dataclass\n" +"class Point:\n" +" x: int\n" +" y: int\n" +"\n" +"@dataclass\n" +"class C:\n" +" mylist: list[Point]\n" +"\n" +"p = Point(10, 20)\n" +"assert asdict(p) == {'x': 10, 'y': 20}\n" +"\n" +"c = C([Point(0, 0), Point(10, 4)])\n" +"assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" +msgstr "" + +#: ../../library/dataclasses.rst:366 ../../library/dataclasses.rst:386 msgid "To create a shallow copy, the following workaround may be used::" msgstr "" "Para criar uma cópia rasa, a seguinte solução alternativa pode ser usada::" -#: ../../library/dataclasses.rst:367 +#: ../../library/dataclasses.rst:368 +msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" +msgstr "" + +#: ../../library/dataclasses.rst:370 msgid "" ":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." msgstr "" -#: ../../library/dataclasses.rst:372 +#: ../../library/dataclasses.rst:375 msgid "" "Converts the dataclass *obj* to a tuple (by using the factory function " "*tuple_factory*). Each dataclass is converted to a tuple of its field " @@ -576,17 +670,27 @@ msgid "" "objects are copied with :func:`copy.deepcopy`." msgstr "" -#: ../../library/dataclasses.rst:378 +#: ../../library/dataclasses.rst:381 msgid "Continuing from the previous example::" msgstr "Continuando a partir do exemplo anterior::" -#: ../../library/dataclasses.rst:387 +#: ../../library/dataclasses.rst:383 +msgid "" +"assert astuple(p) == (10, 20)\n" +"assert astuple(c) == ([(0, 0), (10, 4)],)" +msgstr "" + +#: ../../library/dataclasses.rst:388 +msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" +msgstr "" + +#: ../../library/dataclasses.rst:390 msgid "" ":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " "instance." msgstr "" -#: ../../library/dataclasses.rst:392 +#: ../../library/dataclasses.rst:395 msgid "" "Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " "base classes as given in *bases*, and initialized with a namespace as given " @@ -598,13 +702,13 @@ msgid "" "`@dataclass `." msgstr "" -#: ../../library/dataclasses.rst:402 +#: ../../library/dataclasses.rst:405 msgid "" "If *module* is defined, the :attr:`!__module__` attribute of the dataclass " "is set to that value. By default, it is set to the module name of the caller." msgstr "" -#: ../../library/dataclasses.rst:406 +#: ../../library/dataclasses.rst:409 msgid "" "This function is not strictly required, because any Python mechanism for " "creating a new class with :attr:`!__annotations__` can then apply the :func:" @@ -612,11 +716,32 @@ msgid "" "This function is provided as a convenience. For example::" msgstr "" -#: ../../library/dataclasses.rst:418 +#: ../../library/dataclasses.rst:415 +msgid "" +"C = make_dataclass('C',\n" +" [('x', int),\n" +" 'y',\n" +" ('z', int, field(default=5))],\n" +" namespace={'add_one': lambda self: self.x + 1})" +msgstr "" + +#: ../../library/dataclasses.rst:421 msgid "Is equivalent to::" msgstr "É equivalente a::" -#: ../../library/dataclasses.rst:431 +#: ../../library/dataclasses.rst:423 +msgid "" +"@dataclass\n" +"class C:\n" +" x: int\n" +" y: 'typing.Any'\n" +" z: int = 5\n" +"\n" +" def add_one(self):\n" +" return self.x + 1" +msgstr "" + +#: ../../library/dataclasses.rst:434 msgid "" "Creates a new object of the same type as *obj*, replacing fields with values " "from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If " @@ -624,27 +749,27 @@ msgid "" "`TypeError`." msgstr "" -#: ../../library/dataclasses.rst:436 +#: ../../library/dataclasses.rst:439 msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " "method of the dataclass. This ensures that :meth:`__post_init__`, if " "present, is also called." msgstr "" -#: ../../library/dataclasses.rst:440 +#: ../../library/dataclasses.rst:443 msgid "" "Init-only variables without default values, if any exist, must be specified " "on the call to :func:`!replace` so that they can be passed to :meth:`!" "__init__` and :meth:`__post_init__`." msgstr "" -#: ../../library/dataclasses.rst:444 +#: ../../library/dataclasses.rst:447 msgid "" "It is an error for *changes* to contain any fields that are defined as " "having ``init=False``. A :exc:`ValueError` will be raised in this case." msgstr "" -#: ../../library/dataclasses.rst:448 +#: ../../library/dataclasses.rst:451 msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:`!" "replace`. They are not copied from the source object, but rather are " @@ -655,13 +780,13 @@ msgid "" "instance copying." msgstr "" -#: ../../library/dataclasses.rst:459 +#: ../../library/dataclasses.rst:462 msgid "" -"Return ``True`` if its parameter is a dataclass or an instance of one, " -"otherwise return ``False``." +"Return ``True`` if its parameter is a dataclass (including subclasses of a " +"dataclass) or an instance of one, otherwise return ``False``." msgstr "" -#: ../../library/dataclasses.rst:462 +#: ../../library/dataclasses.rst:465 msgid "" "If you need to know if a class is an instance of a dataclass (and not a " "dataclass itself), then add a further check for ``not isinstance(obj, " @@ -671,11 +796,17 @@ msgstr "" "dataclass de fato), então adicione uma verificação para ``not " "isinstance(obj, type)``::" -#: ../../library/dataclasses.rst:471 +#: ../../library/dataclasses.rst:469 +msgid "" +"def is_dataclass_instance(obj):\n" +" return is_dataclass(obj) and not isinstance(obj, type)" +msgstr "" + +#: ../../library/dataclasses.rst:474 msgid "A sentinel value signifying a missing default or default_factory." msgstr "" -#: ../../library/dataclasses.rst:475 +#: ../../library/dataclasses.rst:478 msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " "with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note " @@ -686,30 +817,42 @@ msgid "" "the class is instantiated." msgstr "" -#: ../../library/dataclasses.rst:484 +#: ../../library/dataclasses.rst:487 msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "" -#: ../../library/dataclasses.rst:495 +#: ../../library/dataclasses.rst:489 +msgid "" +"@dataclass\n" +"class Point:\n" +" x: float\n" +" _: KW_ONLY\n" +" y: float\n" +" z: float\n" +"\n" +"p = Point(0, y=1.5, z=2.0)" +msgstr "" + +#: ../../library/dataclasses.rst:498 msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`!KW_ONLY`." msgstr "" -#: ../../library/dataclasses.rst:502 +#: ../../library/dataclasses.rst:505 msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" "`~object.__delattr__` is called on a dataclass which was defined with " "``frozen=True``. It is a subclass of :exc:`AttributeError`." msgstr "" -#: ../../library/dataclasses.rst:509 +#: ../../library/dataclasses.rst:512 msgid "Post-init processing" msgstr "Processamento pós-inicialização" -#: ../../library/dataclasses.rst:513 +#: ../../library/dataclasses.rst:516 msgid "" "When defined on the class, it will be called by the generated :meth:`~object." "__init__`, normally as :meth:`!self.__post_init__`. However, if any " @@ -719,13 +862,25 @@ msgid "" "automatically be called." msgstr "" -#: ../../library/dataclasses.rst:520 +#: ../../library/dataclasses.rst:523 msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" msgstr "" -#: ../../library/dataclasses.rst:532 +#: ../../library/dataclasses.rst:526 +msgid "" +"@dataclass\n" +"class C:\n" +" a: float\n" +" b: float\n" +" c: float = field(init=False)\n" +"\n" +" def __post_init__(self):\n" +" self.c = self.a + self.b" +msgstr "" + +#: ../../library/dataclasses.rst:535 msgid "" "The :meth:`~object.__init__` method generated by :func:`@dataclass " "` does not call base class :meth:`!__init__` methods. If the base " @@ -733,25 +888,40 @@ msgid "" "call this method in a :meth:`__post_init__` method::" msgstr "" -#: ../../library/dataclasses.rst:549 +#: ../../library/dataclasses.rst:540 +msgid "" +"class Rectangle:\n" +" def __init__(self, height, width):\n" +" self.height = height\n" +" self.width = width\n" +"\n" +"@dataclass\n" +"class Square(Rectangle):\n" +" side: float\n" +"\n" +" def __post_init__(self):\n" +" super().__init__(self.side, self.side)" +msgstr "" + +#: ../../library/dataclasses.rst:552 msgid "" "Note, however, that in general the dataclass-generated :meth:`!__init__` " "methods don't need to be called, since the derived dataclass will take care " "of initializing all fields of any base class that is a dataclass itself." msgstr "" -#: ../../library/dataclasses.rst:553 +#: ../../library/dataclasses.rst:556 msgid "" "See the section below on init-only variables for ways to pass parameters to :" "meth:`!__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" -#: ../../library/dataclasses.rst:560 +#: ../../library/dataclasses.rst:563 msgid "Class variables" msgstr "Variáveis de classe" -#: ../../library/dataclasses.rst:562 +#: ../../library/dataclasses.rst:565 msgid "" "One of the few places where :func:`@dataclass ` actually inspects " "the type of a field is to determine if a field is a class variable as " @@ -762,11 +932,11 @@ msgid "" "`fields` function." msgstr "" -#: ../../library/dataclasses.rst:573 +#: ../../library/dataclasses.rst:576 msgid "Init-only variables" msgstr "Variáveis de inicialização apenas" -#: ../../library/dataclasses.rst:575 +#: ../../library/dataclasses.rst:578 msgid "" "Another place where :func:`@dataclass ` inspects a type " "annotation is to determine if a field is an init-only variable. It does " @@ -779,23 +949,38 @@ msgid "" "dataclasses." msgstr "" -#: ../../library/dataclasses.rst:585 +#: ../../library/dataclasses.rst:588 msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "" -#: ../../library/dataclasses.rst:600 +#: ../../library/dataclasses.rst:591 +msgid "" +"@dataclass\n" +"class C:\n" +" i: int\n" +" j: int | None = None\n" +" database: InitVar[DatabaseType | None] = None\n" +"\n" +" def __post_init__(self, database):\n" +" if self.j is None and database is not None:\n" +" self.j = database.lookup('j')\n" +"\n" +"c = C(10, database=my_database)" +msgstr "" + +#: ../../library/dataclasses.rst:603 msgid "" "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" "i` and :attr:`!j`, but not for :attr:`!database`." msgstr "" -#: ../../library/dataclasses.rst:606 +#: ../../library/dataclasses.rst:609 msgid "Frozen instances" msgstr "" -#: ../../library/dataclasses.rst:608 +#: ../../library/dataclasses.rst:611 msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :func:`@dataclass ` decorator you " @@ -804,18 +989,18 @@ msgid "" "methods will raise a :exc:`FrozenInstanceError` when invoked." msgstr "" -#: ../../library/dataclasses.rst:614 +#: ../../library/dataclasses.rst:617 msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`~object.__init__` cannot use simple assignment to initialize fields, and " -"must use :meth:`!__setattr__`." +"must use :meth:`!object.__setattr__`." msgstr "" -#: ../../library/dataclasses.rst:621 +#: ../../library/dataclasses.rst:626 msgid "Inheritance" msgstr "Herança" -#: ../../library/dataclasses.rst:623 +#: ../../library/dataclasses.rst:628 msgid "" "When the dataclass is being created by the :func:`@dataclass ` " "decorator, it looks through all of the class's base classes in reverse MRO " @@ -827,24 +1012,41 @@ msgid "" "order, derived classes override base classes. An example::" msgstr "" -#: ../../library/dataclasses.rst:643 +#: ../../library/dataclasses.rst:638 +msgid "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" y: int = 0\n" +"\n" +"@dataclass\n" +"class C(Base):\n" +" z: int = 10\n" +" x: int = 15" +msgstr "" + +#: ../../library/dataclasses.rst:648 msgid "" "The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " "The final type of :attr:`!x` is :class:`int`, as specified in class :class:`!" "C`." msgstr "" -#: ../../library/dataclasses.rst:646 +#: ../../library/dataclasses.rst:651 msgid "" "The generated :meth:`~object.__init__` method for :class:`!C` will look " "like::" msgstr "" -#: ../../library/dataclasses.rst:651 +#: ../../library/dataclasses.rst:653 +msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" +msgstr "" + +#: ../../library/dataclasses.rst:656 msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" msgstr "" -#: ../../library/dataclasses.rst:653 +#: ../../library/dataclasses.rst:658 msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " "keyword-only parameters are moved to come after all regular (non-keyword-" @@ -852,42 +1054,67 @@ msgid "" "implemented in Python: they must come after non-keyword-only parameters." msgstr "" -#: ../../library/dataclasses.rst:659 +#: ../../library/dataclasses.rst:664 msgid "" "In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " "keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular " "fields::" msgstr "" -#: ../../library/dataclasses.rst:674 +#: ../../library/dataclasses.rst:667 +msgid "" +"@dataclass\n" +"class Base:\n" +" x: Any = 15.0\n" +" _: KW_ONLY\n" +" y: int = 0\n" +" w: int = 1\n" +"\n" +"@dataclass\n" +"class D(Base):\n" +" z: int = 10\n" +" t: int = field(kw_only=True, default=0)" +msgstr "" + +#: ../../library/dataclasses.rst:679 msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" msgstr "" -#: ../../library/dataclasses.rst:678 +#: ../../library/dataclasses.rst:681 +msgid "" +"def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " +"int = 0):" +msgstr "" + +#: ../../library/dataclasses.rst:683 msgid "" "Note that the parameters have been re-ordered from how they appear in the " "list of fields: parameters derived from regular fields are followed by " "parameters derived from keyword-only fields." msgstr "" -#: ../../library/dataclasses.rst:682 +#: ../../library/dataclasses.rst:687 msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`!__init__` parameter list." msgstr "" -#: ../../library/dataclasses.rst:687 +#: ../../library/dataclasses.rst:692 msgid "Default factory functions" msgstr "Funções padrão de fábrica" -#: ../../library/dataclasses.rst:689 +#: ../../library/dataclasses.rst:694 msgid "" "If a :func:`field` specifies a *default_factory*, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" -#: ../../library/dataclasses.rst:695 +#: ../../library/dataclasses.rst:698 +msgid "mylist: list = field(default_factory=list)" +msgstr "" + +#: ../../library/dataclasses.rst:700 msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " "and the field also specifies *default_factory*, then the default factory " @@ -896,31 +1123,67 @@ msgid "" "initial value." msgstr "" -#: ../../library/dataclasses.rst:702 +#: ../../library/dataclasses.rst:707 msgid "Mutable default values" msgstr "Valores padrão mutáveis" -#: ../../library/dataclasses.rst:704 +#: ../../library/dataclasses.rst:709 msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "" -#: ../../library/dataclasses.rst:719 +#: ../../library/dataclasses.rst:712 +msgid "" +"class C:\n" +" x = []\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"o1 = C()\n" +"o2 = C()\n" +"o1.add(1)\n" +"o2.add(2)\n" +"assert o1.x == [1, 2]\n" +"assert o1.x is o2.x" +msgstr "" + +#: ../../library/dataclasses.rst:724 msgid "" "Note that the two instances of class :class:`!C` share the same class " "variable :attr:`!x`, as expected." msgstr "" -#: ../../library/dataclasses.rst:722 +#: ../../library/dataclasses.rst:727 msgid "Using dataclasses, *if* this code was valid::" msgstr "Usando dataclasses, *se* este código fosse válido::" -#: ../../library/dataclasses.rst:730 +#: ../../library/dataclasses.rst:729 +msgid "" +"@dataclass\n" +"class D:\n" +" x: list = [] # This code raises ValueError\n" +" def add(self, element):\n" +" self.x.append(element)" +msgstr "" + +#: ../../library/dataclasses.rst:735 msgid "it would generate code similar to::" msgstr "Geraria código similar a::" -#: ../../library/dataclasses.rst:741 +#: ../../library/dataclasses.rst:737 +msgid "" +"class D:\n" +" x = []\n" +" def __init__(self, x=x):\n" +" self.x = x\n" +" def add(self, element):\n" +" self.x.append(element)\n" +"\n" +"assert D().x is D().x" +msgstr "" + +#: ../../library/dataclasses.rst:746 msgid "" "This has the same issue as the original example using class :class:`!C`. " "That is, two instances of class :class:`!D` that do not specify a value for :" @@ -933,44 +1196,53 @@ msgid "" "partial solution, but it does protect against many common errors." msgstr "" -#: ../../library/dataclasses.rst:752 +#: ../../library/dataclasses.rst:757 msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "" -#: ../../library/dataclasses.rst:761 +#: ../../library/dataclasses.rst:760 +msgid "" +"@dataclass\n" +"class D:\n" +" x: list = field(default_factory=list)\n" +"\n" +"assert D().x is not D().x" +msgstr "" + +#: ../../library/dataclasses.rst:766 msgid "" "Instead of looking for and disallowing objects of type :class:`list`, :class:" "`dict`, or :class:`set`, unhashable objects are now not allowed as default " "values. Unhashability is used to approximate mutability." msgstr "" -#: ../../library/dataclasses.rst:768 +#: ../../library/dataclasses.rst:773 msgid "Descriptor-typed fields" msgstr "" -#: ../../library/dataclasses.rst:770 +#: ../../library/dataclasses.rst:775 msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " "default value have the following special behaviors:" msgstr "" -#: ../../library/dataclasses.rst:773 +#: ../../library/dataclasses.rst:778 msgid "" "The value for the field passed to the dataclass's :meth:`~object.__init__` " "method is passed to the descriptor's :meth:`~object.__set__` method rather " "than overwriting the descriptor object." msgstr "" -#: ../../library/dataclasses.rst:777 +#: ../../library/dataclasses.rst:782 msgid "" "Similarly, when getting or setting the field, the descriptor's :meth:" "`~object.__get__` or :meth:`!__set__` method is called rather than returning " "or overwriting the descriptor object." msgstr "" -#: ../../library/dataclasses.rst:781 +#: ../../library/dataclasses.rst:786 msgid "" "To determine whether a field contains a default value, :func:`@dataclass " "` will call the descriptor's :meth:`!__get__` method using its " @@ -980,7 +1252,36 @@ msgid "" "in this situation, no default value will be provided for the field." msgstr "" -#: ../../library/dataclasses.rst:816 +#: ../../library/dataclasses.rst:796 +msgid "" +"class IntConversionDescriptor:\n" +" def __init__(self, *, default):\n" +" self._default = default\n" +"\n" +" def __set_name__(self, owner, name):\n" +" self._name = \"_\" + name\n" +"\n" +" def __get__(self, obj, type):\n" +" if obj is None:\n" +" return self._default\n" +"\n" +" return getattr(obj, self._name, self._default)\n" +"\n" +" def __set__(self, obj, value):\n" +" setattr(obj, self._name, int(value))\n" +"\n" +"@dataclass\n" +"class InventoryItem:\n" +" quantity_on_hand: IntConversionDescriptor = " +"IntConversionDescriptor(default=100)\n" +"\n" +"i = InventoryItem()\n" +"print(i.quantity_on_hand) # 100\n" +"i.quantity_on_hand = 2.5 # calls __set__ with 2.5\n" +"print(i.quantity_on_hand) # 2" +msgstr "" + +#: ../../library/dataclasses.rst:821 msgid "" "Note that if a field is annotated with a descriptor type, but is not " "assigned a descriptor object as its default value, the field will act like a " diff --git a/library/datatypes.po b/library/datatypes.po index a2241f59a..dac1f8f15 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Raphael Mendonça, 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/datetime.po b/library/datetime.po index f4c303882..933a3d7c1 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -4,39 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# mvpetri , 2021 -# Danielle Farias , 2021 -# 2c4b5a73177ea5ea1d3324f10df471a7_b8aeba7 <7df8a60bac356f3b148ac94f3c2796f6_834576>, 2021 -# Welington Carlos , 2021 -# Julia Rizza , 2021 -# Marco Rougeth , 2021 -# Italo Penaforte , 2021 -# And Past , 2021 -# (Douglas da Silva) , 2021 -# Misael borges , 2021 -# Vinícius Muniz de Melo , 2021 -# Vinicius Gubiani Ferreira , 2021 -# i17obot , 2021 -# yyyyyyyan , 2021 -# Claudio Rogerio Carvalho Filho , 2024 # Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -125,7 +108,7 @@ msgstr "Objetos Conscientes e Ingênuos" #: ../../library/datetime.rst:50 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " -"on whether or not they include timezone information." +"on whether or not they include time zone information." msgstr "" "Objetos de data e hora podem ser categorizados como \"consciente\" ou " "\"ingênuo\" dependendo se eles incluem ou não informação sobre fuso horário." @@ -149,7 +132,7 @@ msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " "represents Coordinated Universal Time (UTC), local time, or time in some " -"other timezone is purely up to the program, just like it is up to the " +"other time zone is purely up to the program, just like it is up to the " "program whether a particular number represents metres, miles, or mass. Naive " "objects are easy to understand and to work with, at the cost of ignoring " "some aspects of reality." @@ -181,15 +164,15 @@ msgstr "" #: ../../library/datetime.rst:72 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " -"supplied by the :mod:`!datetime` module. The :class:`timezone` class can " -"represent simple timezones with fixed offsets from UTC, such as UTC itself " -"or North American EST and EDT timezones. Supporting timezones at deeper " +"supplied by the :mod:`!datetime` module. The :class:`!timezone` class can " +"represent simple time zones with fixed offsets from UTC, such as UTC itself " +"or North American EST and EDT time zones. Supporting time zones at deeper " "levels of detail is up to the application. The rules for time adjustment " "across the world are more political than rational, change frequently, and " "there is no standard suitable for every application aside from UTC." msgstr "" "Somente uma classe concreta :class:`tzinfo`, a classe :class:`timezone`, é " -"fornecida pelo módulo :mod:`!datetime`. A classe :class:`timezone` pode " +"fornecida pelo módulo :mod:`!datetime`. A classe :class:`!timezone` pode " "representar fusos horários simples com diferenças fixas do UTC, como o " "próprio UTC, ou os fusos horários norte-americanos EST e EDT. O suporte a " "fusos horários em níveis mais detalhados depende da aplicação. As regras " @@ -222,7 +205,7 @@ msgstr "" "datetime`. :const:`MAXYEAR` é 9999." #: ../../library/datetime.rst:98 -msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." +msgid "Alias for the UTC time zone singleton :attr:`datetime.timezone.utc`." msgstr "" "Apelido para o singleton de fuso horário UTC :attr:`datetime.timezone.utc`." @@ -298,6 +281,17 @@ msgstr "Objetos desse tipo são imutáveis." msgid "Subclass relationships::" msgstr "Relacionamentos de subclasse::" +#: ../../library/datetime.rst:157 +msgid "" +"object\n" +" timedelta\n" +" tzinfo\n" +" timezone\n" +" time\n" +" date\n" +" datetime" +msgstr "" + #: ../../library/datetime.rst:166 msgid "Common Properties" msgstr "Propriedades Comuns" @@ -459,6 +453,23 @@ msgstr "" "*seconds* e *microseconds* são \"mesclados\" e normalizados nos três " "atributos resultantes::" +#: ../../library/datetime.rst:232 +msgid "" +">>> from datetime import timedelta\n" +">>> delta = timedelta(\n" +"... days=50,\n" +"... seconds=27,\n" +"... microseconds=10,\n" +"... milliseconds=29000,\n" +"... minutes=5,\n" +"... hours=8,\n" +"... weeks=2\n" +"... )\n" +">>> # Only days, seconds, and microseconds remain\n" +">>> delta\n" +"datetime.timedelta(days=64, seconds=29156, microseconds=10)" +msgstr "" + #: ../../library/datetime.rst:246 msgid "" "If any argument is a float and there are fractional microseconds, the " @@ -490,6 +501,14 @@ msgstr "" "Observe que a normalização de valores negativos pode ser surpreendente a " "princípio. Por exemplo::" +#: ../../library/datetime.rst:259 +msgid "" +">>> from datetime import timedelta\n" +">>> d = timedelta(microseconds=-1)\n" +">>> (d.days, d.seconds, d.microseconds)\n" +"(-1, 86399, 999999)" +msgstr "" + #: ../../library/datetime.rst:265 ../../library/datetime.rst:546 #: ../../library/datetime.rst:1065 ../../library/datetime.rst:1696 #: ../../library/datetime.rst:2298 @@ -776,6 +795,14 @@ msgstr "" "de maneira semelhante à sua representação interna. Isso leva a resultados um " "tanto incomuns para timedeltas negativos. Por exemplo::" +#: ../../library/datetime.rst:383 +msgid "" +">>> timedelta(hours=-5)\n" +"datetime.timedelta(days=-1, seconds=68400)\n" +">>> print(_)\n" +"-1 day, 19:00:00" +msgstr "" + #: ../../library/datetime.rst:389 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" @@ -854,10 +881,40 @@ msgstr "Exemplos de uso: :class:`.timedelta`" msgid "An additional example of normalization::" msgstr "Um exemplo adicional de normalização::" +#: ../../library/datetime.rst:426 +msgid "" +">>> # Components of another_year add up to exactly 365 days\n" +">>> from datetime import timedelta\n" +">>> year = timedelta(days=365)\n" +">>> another_year = timedelta(weeks=40, days=84, hours=23,\n" +"... minutes=50, seconds=600)\n" +">>> year == another_year\n" +"True\n" +">>> year.total_seconds()\n" +"31536000.0" +msgstr "" + #: ../../library/datetime.rst:436 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "Exemplos de aritmética com :class:`timedelta`::" +#: ../../library/datetime.rst:438 +msgid "" +">>> from datetime import timedelta\n" +">>> year = timedelta(days=365)\n" +">>> ten_years = 10 * year\n" +">>> ten_years\n" +"datetime.timedelta(days=3650)\n" +">>> ten_years.days // 365\n" +"10\n" +">>> nine_years = ten_years - year\n" +">>> nine_years\n" +"datetime.timedelta(days=3285)\n" +">>> three_years = nine_years // 3\n" +">>> three_years, three_years.days // 365\n" +"(datetime.timedelta(days=1095), 3)" +msgstr "" + #: ../../library/datetime.rst:455 msgid ":class:`date` Objects" msgstr "Objetos :class:`date`" @@ -1005,6 +1062,17 @@ msgstr "Atualmente, as datas ordinais não são suportadas (``YYYY-OOO``)." msgid "Examples::" msgstr "Exemplos::" +#: ../../library/datetime.rst:526 +msgid "" +">>> from datetime import date\n" +">>> date.fromisoformat('2019-12-04')\n" +"datetime.date(2019, 12, 4)\n" +">>> date.fromisoformat('20191204')\n" +"datetime.date(2019, 12, 4)\n" +">>> date.fromisoformat('2021-W01-1')\n" +"datetime.date(2021, 1, 4)" +msgstr "" + #: ../../library/datetime.rst:535 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" @@ -1162,6 +1230,14 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../library/datetime.rst:638 +msgid "" +">>> from datetime import date\n" +">>> d = date(2002, 12, 31)\n" +">>> d.replace(day=26)\n" +"datetime.date(2002, 12, 26)" +msgstr "" + #: ../../library/datetime.rst:646 ../../library/datetime.rst:1337 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." @@ -1179,6 +1255,11 @@ msgstr "" msgid "``d.timetuple()`` is equivalent to::" msgstr "``d.timetuple()`` é equivalente a::" +#: ../../library/datetime.rst:652 +msgid "" +"time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" +msgstr "" + #: ../../library/datetime.rst:654 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " @@ -1255,6 +1336,15 @@ msgstr "" "ISO 2004 começa na segunda-feira, 29 de dezembro de 2003, e termina no " "domingo, 4 de janeiro de 2004::" +#: ../../library/datetime.rst:694 +msgid "" +">>> from datetime import date\n" +">>> date(2003, 12, 29).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=1)\n" +">>> date(2004, 1, 4).isocalendar()\n" +"datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" +msgstr "" + #: ../../library/datetime.rst:700 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" @@ -1266,6 +1356,13 @@ msgid "" msgstr "" "Retorna uma string representando a data no formato ISO 8601, ``YYYY-MM-DD``::" +#: ../../library/datetime.rst:707 +msgid "" +">>> from datetime import date\n" +">>> date(2002, 12, 4).isoformat()\n" +"'2002-12-04'" +msgstr "" + #: ../../library/datetime.rst:713 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "Para uma data *d*, ``str(d)`` é equivalente a ``d.isoformat()``." @@ -1274,10 +1371,21 @@ msgstr "Para uma data *d*, ``str(d)`` é equivalente a ``d.isoformat()``." msgid "Return a string representing the date::" msgstr "Retorna uma string representando a data::" +#: ../../library/datetime.rst:720 +msgid "" +">>> from datetime import date\n" +">>> date(2002, 12, 4).ctime()\n" +"'Wed Dec 4 00:00:00 2002'" +msgstr "" + #: ../../library/datetime.rst:724 ../../library/datetime.rst:1523 msgid "``d.ctime()`` is equivalent to::" msgstr "``d.ctime()`` é equivalente a::" +#: ../../library/datetime.rst:726 ../../library/datetime.rst:1525 +msgid "time.ctime(time.mktime(d.timetuple()))" +msgstr "" + #: ../../library/datetime.rst:728 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." @@ -1320,10 +1428,74 @@ msgstr "Exemplos de uso: :class:`.date`" msgid "Example of counting days to an event::" msgstr "Exemplo de contagem de dias para um evento::" +#: ../../library/datetime.rst:752 +msgid "" +">>> import time\n" +">>> from datetime import date\n" +">>> today = date.today()\n" +">>> today\n" +"datetime.date(2007, 12, 5)\n" +">>> today == date.fromtimestamp(time.time())\n" +"True\n" +">>> my_birthday = date(today.year, 6, 24)\n" +">>> if my_birthday < today:\n" +"... my_birthday = my_birthday.replace(year=today.year + 1)\n" +"...\n" +">>> my_birthday\n" +"datetime.date(2008, 6, 24)\n" +">>> time_to_birthday = abs(my_birthday - today)\n" +">>> time_to_birthday.days\n" +"202" +msgstr "" + #: ../../library/datetime.rst:769 msgid "More examples of working with :class:`date`:" msgstr "Mais exemplos de uso da classe :class:`.date`:" +#: ../../library/datetime.rst:771 +msgid "" +">>> from datetime import date\n" +">>> d = date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" +">>> d\n" +"datetime.date(2002, 3, 11)\n" +"\n" +">>> # Methods related to formatting string output\n" +">>> d.isoformat()\n" +"'2002-03-11'\n" +">>> d.strftime(\"%d/%m/%y\")\n" +"'11/03/02'\n" +">>> d.strftime(\"%A %d. %B %Y\")\n" +"'Monday 11. March 2002'\n" +">>> d.ctime()\n" +"'Mon Mar 11 00:00:00 2002'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}.'.format(d, \"day\", \"month\")\n" +"'The day is 11, the month is March.'\n" +"\n" +">>> # Methods for to extracting 'components' under different calendars\n" +">>> t = d.timetuple()\n" +">>> for i in t: \n" +"... print(i)\n" +"2002 # year\n" +"3 # month\n" +"11 # day\n" +"0\n" +"0\n" +"0\n" +"0 # weekday (0 = Monday)\n" +"70 # 70th day in the year\n" +"-1\n" +">>> ic = d.isocalendar()\n" +">>> for i in ic: \n" +"... print(i)\n" +"2002 # ISO year\n" +"11 # ISO week number\n" +"1 # ISO day number ( 1 = Monday )\n" +"\n" +">>> # A date object is immutable; all operations produce a new object\n" +">>> d.replace(year=2005)\n" +"datetime.date(2005, 3, 11)" +msgstr "" + #: ../../library/datetime.rst:818 msgid ":class:`.datetime` Objects" msgstr "Objetos :class:`.datetime`" @@ -1400,15 +1572,19 @@ msgid "Added the *fold* parameter." msgstr "Adicionado o parâmetro *fold*." #: ../../library/datetime.rst:853 -msgid "Return the current local datetime, with :attr:`.tzinfo` ``None``." +msgid "Return the current local date and time, with :attr:`.tzinfo` ``None``." msgstr "" -"Retorna o datetime local atual, com o atributo :attr:`.tzinfo` setado para " -"``None``." +"Retorna a data e hora local atual, com o atributo :attr:`.tzinfo` definido " +"para ``None``." #: ../../library/datetime.rst:855 msgid "Equivalent to::" msgstr "Equivalente a::" +#: ../../library/datetime.rst:857 +msgid "datetime.fromtimestamp(time.time())" +msgstr "" + #: ../../library/datetime.rst:859 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr "Veja também :meth:`now`, :meth:`fromtimestamp`." @@ -1572,6 +1748,10 @@ msgstr "" "Para conseguir um objeto :class:`.datetime` consciente, chame :meth:" "`fromtimestamp`::" +#: ../../library/datetime.rst:943 +msgid "datetime.fromtimestamp(timestamp, timezone.utc)" +msgstr "" + #: ../../library/datetime.rst:945 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " @@ -1579,6 +1759,11 @@ msgid "" msgstr "" "Nas plataformas compatíveis com POSIX, é equivalente à seguinte expressão::" +#: ../../library/datetime.rst:948 +msgid "" +"datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" +msgstr "" + #: ../../library/datetime.rst:950 msgid "" "except the latter formula always supports the full years range: between :" @@ -1683,6 +1868,31 @@ msgstr "" msgid "Fractional hours and minutes are not supported." msgstr "Horas e minutos fracionários não são suportados." +#: ../../library/datetime.rst:1013 +msgid "" +">>> from datetime import datetime\n" +">>> datetime.fromisoformat('2011-11-04')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> datetime.fromisoformat('20111104')\n" +"datetime.datetime(2011, 11, 4, 0, 0)\n" +">>> datetime.fromisoformat('2011-11-04T00:05:23')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> datetime.fromisoformat('2011-11-04T00:05:23Z')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, tzinfo=datetime.timezone.utc)\n" +">>> datetime.fromisoformat('20111104T000523')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" +">>> datetime.fromisoformat('2011-W01-2T00:05:23.283')\n" +"datetime.datetime(2011, 1, 4, 0, 5, 23, 283000)\n" +">>> datetime.fromisoformat('2011-11-04 00:05:23.283')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" +">>> datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" +"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone." +"utc)\n" +">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00') \n" +"datetime.datetime(2011, 11, 4, 0, 5, 23,\n" +" tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" +msgstr "" + #: ../../library/datetime.rst:1035 msgid "" "Previously, this method only supported formats that could be emitted by :" @@ -1713,12 +1923,16 @@ msgstr "" #: ../../library/datetime.rst:1054 msgid "" -"If *format* does not contain microseconds or timezone information, this is " +"If *format* does not contain microseconds or time zone information, this is " "equivalent to::" msgstr "" "Se *format* não contiver microssegundos ou informações de fuso horário, isso " "é equivalente a::" +#: ../../library/datetime.rst:1056 ../../library/datetime.rst:2509 +msgid "datetime(*(time.strptime(date_string, format)[0:6]))" +msgstr "" + #: ../../library/datetime.rst:1058 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " @@ -1920,9 +2134,6 @@ msgid "" "datetime` objects are never equal to :class:`date` objects that are not " "also :class:`!datetime` instances, even if they represent the same date." msgstr "" -"Objetos ingênuos e conscientes :class:`!datetime` nunca são iguais. Objetos :" -"class:`!datetime` nunca são iguais a objetos :class:`date` que também não " -"são instâncias de :class:`!datetime`, mesmo que representem a mesma data." #: ../../library/datetime.rst:1196 msgid "" @@ -2034,7 +2245,7 @@ msgstr "" msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " -"*self* is naive, it is presumed to represent time in the system timezone." +"*self* is naive, it is presumed to represent time in the system time zone." msgstr "" "Se fornecido, *tz* deve ser uma instância de uma subclasse :class:`tzinfo`, " "e seus métodos :meth:`utcoffset` e :meth:`dst` não devem retornar ``None``. " @@ -2043,13 +2254,13 @@ msgstr "" #: ../../library/datetime.rst:1272 msgid "" -"If called without arguments (or with ``tz=None``) the system local timezone " -"is assumed for the target timezone. The ``.tzinfo`` attribute of the " +"If called without arguments (or with ``tz=None``) the system local time zone " +"is assumed for the target time zone. The ``.tzinfo`` attribute of the " "converted datetime instance will be set to an instance of :class:`timezone` " "with the zone name and offset obtained from the OS." msgstr "" "Se for chamado sem argumentos (ou com ``tz=None``) o fuso horário do sistema " -"local é assumido como o fuso horário desejado. O atributo ``.tzinfo`` da " +"local é presumido como o fuso horário desejado. O atributo ``.tzinfo`` da " "instância datetime convertida será definido para uma instância de :class:" "`timezone` com o nome da zona e um deslocamento obtido a partir do sistema " "operacional." @@ -2058,7 +2269,7 @@ msgstr "" msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " -"in the timezone *tz*, representing the same UTC time as *self*: after " +"in the time zone *tz*, representing the same UTC time as *self*: after " "``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will have the same " "date and time data as ``dt - dt.utcoffset()``." msgstr "" @@ -2071,14 +2282,15 @@ msgstr "" #: ../../library/datetime.rst:1283 msgid "" -"If you merely want to attach a time zone object *tz* to a datetime *dt* " -"without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " -"you merely want to remove the time zone object from an aware datetime *dt* " -"without conversion of date and time data, use ``dt.replace(tzinfo=None)``." +"If you merely want to attach a :class:`timezone` object *tz* to a datetime " +"*dt* without adjustment of date and time data, use ``dt." +"replace(tzinfo=tz)``. If you merely want to remove the :class:`!timezone` " +"object from an aware datetime *dt* without conversion of date and time data, " +"use ``dt.replace(tzinfo=None)``." msgstr "" -"Se você quer meramente anexar um objeto de fuso horário *tz* a um datetime " +"Se você quer meramente anexar um objeto :class:`timezone` *tz* a um datetime " "*dt* sem ajustes de dados de data e hora, use ``dt.replace(tzinfo=tz)``. Se " -"você meramente quer remover o objeto de fuso horário de um datetime " +"você meramente quer remover o objeto :class:`!timezone` de um datetime " "consciente *dt* sem conversão de dados de data e hora, use ``dt." "replace(tzinfo=None)``." @@ -2093,6 +2305,17 @@ msgstr "" "`astimezone`. Ignorando erros de letras maiúsculas/minúsculas, :meth:" "`astimezone` funciona como::" +#: ../../library/datetime.rst:1292 +msgid "" +"def astimezone(self, tz):\n" +" if self.tzinfo is tz:\n" +" return self\n" +" # Convert self to UTC, and attach the new timezone object.\n" +" utc = (self - self.utcoffset()).replace(tzinfo=tz)\n" +" # Convert from UTC to tz's local time.\n" +" return tz.fromutc(utc)" +msgstr "" + #: ../../library/datetime.rst:1300 msgid "*tz* now can be omitted." msgstr "*tz* agora pode ser omitido." @@ -2149,6 +2372,13 @@ msgstr "" "``self.tzinfo.tzname(self)``, levanta uma exceção se o segundo não retornar " "``None`` ou um objeto string." +#: ../../library/datetime.rst:1341 +msgid "" +"time.struct_time((d.year, d.month, d.day,\n" +" d.hour, d.minute, d.second,\n" +" d.weekday(), yday, dst))" +msgstr "" + #: ../../library/datetime.rst:1345 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " @@ -2251,6 +2481,10 @@ msgstr "" "Para instâncias conscientes de :class:`.datetime`, o valor retornado é " "computado como::" +#: ../../library/datetime.rst:1397 +msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" +msgstr "" + #: ../../library/datetime.rst:1401 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " @@ -2263,7 +2497,7 @@ msgstr "" msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " -"this convention and your system timezone is not set to UTC, you can obtain " +"this convention and your system time zone is not set to UTC, you can obtain " "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" "Não existe método para obter o timestamp POSIX diretamente de uma instância :" @@ -2272,10 +2506,18 @@ msgstr "" "você pode obter o registro de data e hora POSIX fornecendo ``tzinfo=timezone." "utc``::" +#: ../../library/datetime.rst:1413 +msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" +msgstr "" + #: ../../library/datetime.rst:1415 msgid "or by calculating the timestamp directly::" msgstr "ou calculando o registro de data e hora diretamente::" +#: ../../library/datetime.rst:1417 +msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" +msgstr "" + #: ../../library/datetime.rst:1421 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " @@ -2336,6 +2578,15 @@ msgid "" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, se :attr:`microsecond` é 0" +#: ../../library/datetime.rst:1454 +msgid "" +">>> from datetime import datetime, timezone\n" +">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" +"'2019-05-18T15:17:08.132263'\n" +">>> datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc).isoformat()\n" +"'2019-05-18T15:17:00+00:00'" +msgstr "" + #: ../../library/datetime.rst:1460 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " @@ -2344,6 +2595,20 @@ msgstr "" "O argumento opcional *sep* (por padrão, ``'T'``) é um separador de caractere " "único, colocado entre as porções de data e tempo do resultado. Por exemplo::" +#: ../../library/datetime.rst:1463 +msgid "" +">>> from datetime import tzinfo, timedelta, datetime\n" +">>> class TZ(tzinfo):\n" +"... \"\"\"A time zone with an arbitrary, constant -06:39 offset.\"\"\"\n" +"... def utcoffset(self, dt):\n" +"... return timedelta(hours=-6, minutes=-39)\n" +"...\n" +">>> datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ')\n" +"'2002-12-25 00:00:00-06:39'\n" +">>> datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat()\n" +"'2009-11-27T00:00:00.000100-06:39'" +msgstr "" + #: ../../library/datetime.rst:1474 ../../library/datetime.rst:1846 msgid "" "The optional argument *timespec* specifies the number of additional " @@ -2406,6 +2671,16 @@ msgstr "" "A exceção :exc:`ValueError` vai ser levantada no caso de um argumento " "*timespec* inválido::" +#: ../../library/datetime.rst:1495 +msgid "" +">>> from datetime import datetime\n" +">>> datetime.now().isoformat(timespec='minutes') \n" +"'2002-12-25T00:00'\n" +">>> dt = datetime(2015, 1, 1, 12, 30, 59, 0)\n" +">>> dt.isoformat(timespec='microseconds')\n" +"'2015-01-01T12:30:59.000000'" +msgstr "" + #: ../../library/datetime.rst:1502 ../../library/datetime.rst:1877 msgid "Added the *timespec* parameter." msgstr "Adicionado o parâmetro *timespec*." @@ -2422,6 +2697,13 @@ msgstr "" msgid "Return a string representing the date and time::" msgstr "Retorna uma string representando a data e hora::" +#: ../../library/datetime.rst:1516 +msgid "" +">>> from datetime import datetime\n" +">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" +"'Wed Dec 4 20:30:40 2002'" +msgstr "" + #: ../../library/datetime.rst:1520 msgid "" "The output string will *not* include time zone information, regardless of " @@ -2470,6 +2752,60 @@ msgstr "Exemplos de uso: :class:`.datetime`" msgid "Examples of working with :class:`.datetime` objects:" msgstr "Exemplos para trabalhar com objetos :class:`.datetime`:" +#: ../../library/datetime.rst:1552 +msgid "" +">>> from datetime import datetime, date, time, timezone\n" +"\n" +">>> # Using datetime.combine()\n" +">>> d = date(2005, 7, 14)\n" +">>> t = time(12, 30)\n" +">>> datetime.combine(d, t)\n" +"datetime.datetime(2005, 7, 14, 12, 30)\n" +"\n" +">>> # Using datetime.now()\n" +">>> datetime.now() \n" +"datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" +">>> datetime.now(timezone.utc) \n" +"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone." +"utc)\n" +"\n" +">>> # Using datetime.strptime()\n" +">>> dt = datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:%M\")\n" +">>> dt\n" +"datetime.datetime(2006, 11, 21, 16, 30)\n" +"\n" +">>> # Using datetime.timetuple() to get tuple of all attributes\n" +">>> tt = dt.timetuple()\n" +">>> for it in tt: \n" +"... print(it)\n" +"...\n" +"2006 # year\n" +"11 # month\n" +"21 # day\n" +"16 # hour\n" +"30 # minute\n" +"0 # second\n" +"1 # weekday (0 = Monday)\n" +"325 # number of days since 1st January\n" +"-1 # dst - method tzinfo.dst() returned None\n" +"\n" +">>> # Date in ISO format\n" +">>> ic = dt.isocalendar()\n" +">>> for it in ic: \n" +"... print(it)\n" +"...\n" +"2006 # ISO year\n" +"47 # ISO week\n" +"2 # ISO weekday\n" +"\n" +">>> # Formatting a datetime\n" +">>> dt.strftime(\"%A, %d. %B %Y %I:%M%p\")\n" +"'Tuesday, 21. November 2006 04:30PM'\n" +">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'." +"format(dt, \"day\", \"month\", \"time\")\n" +"'The day is 21, the month is November, the time is 04:30PM.'" +msgstr "" + #: ../../library/datetime.rst:1603 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " @@ -2480,10 +2816,81 @@ msgstr "" "de fuso horário para Kabul, Afeganistão, o qual usou +4 UTC até 1945 e " "depois +4:30 UTC após esse período::" +#: ../../library/datetime.rst:1607 +msgid "" +"from datetime import timedelta, datetime, tzinfo, timezone\n" +"\n" +"class KabulTz(tzinfo):\n" +" # Kabul used +4 until 1945, when they moved to +4:30\n" +" UTC_MOVE_DATE = datetime(1944, 12, 31, 20, tzinfo=timezone.utc)\n" +"\n" +" def utcoffset(self, dt):\n" +" if dt.year < 1945:\n" +" return timedelta(hours=4)\n" +" elif (1945, 1, 1, 0, 0) <= dt.timetuple()[:5] < (1945, 1, 1, 0, " +"30):\n" +" # An ambiguous (\"imaginary\") half-hour range representing\n" +" # a 'fold' in time due to the shift from +4 to +4:30.\n" +" # If dt falls in the imaginary range, use fold to decide how\n" +" # to resolve. See PEP495.\n" +" return timedelta(hours=4, minutes=(30 if dt.fold else 0))\n" +" else:\n" +" return timedelta(hours=4, minutes=30)\n" +"\n" +" def fromutc(self, dt):\n" +" # Follow same validations as in datetime.tzinfo\n" +" if not isinstance(dt, datetime):\n" +" raise TypeError(\"fromutc() requires a datetime argument\")\n" +" if dt.tzinfo is not self:\n" +" raise ValueError(\"dt.tzinfo is not self\")\n" +"\n" +" # A custom implementation is required for fromutc as\n" +" # the input to this function is a datetime with utc values\n" +" # but with a tzinfo set to self.\n" +" # See datetime.astimezone or fromtimestamp.\n" +" if dt.replace(tzinfo=timezone.utc) >= self.UTC_MOVE_DATE:\n" +" return dt + timedelta(hours=4, minutes=30)\n" +" else:\n" +" return dt + timedelta(hours=4)\n" +"\n" +" def dst(self, dt):\n" +" # Kabul does not observe daylight saving time.\n" +" return timedelta(0)\n" +"\n" +" def tzname(self, dt):\n" +" if dt >= self.UTC_MOVE_DATE:\n" +" return \"+04:30\"\n" +" return \"+04\"" +msgstr "" + #: ../../library/datetime.rst:1650 msgid "Usage of ``KabulTz`` from above::" msgstr "Uso de ``KabulTz`` mostrado acima::" +#: ../../library/datetime.rst:1652 +msgid "" +">>> tz1 = KabulTz()\n" +"\n" +">>> # Datetime before the change\n" +">>> dt1 = datetime(1900, 11, 21, 16, 30, tzinfo=tz1)\n" +">>> print(dt1.utcoffset())\n" +"4:00:00\n" +"\n" +">>> # Datetime after the change\n" +">>> dt2 = datetime(2006, 6, 14, 13, 0, tzinfo=tz1)\n" +">>> print(dt2.utcoffset())\n" +"4:30:00\n" +"\n" +">>> # Convert datetime to another time zone\n" +">>> dt3 = dt2.astimezone(timezone.utc)\n" +">>> dt3\n" +"datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)\n" +">>> dt2\n" +"datetime.datetime(2006, 6, 14, 13, 0, tzinfo=KabulTz())\n" +">>> dt2 == dt3\n" +"True" +msgstr "" + #: ../../library/datetime.rst:1676 msgid ":class:`.time` Objects" msgstr "Objetos :class:`.time`" @@ -2635,6 +3042,28 @@ msgstr "" msgid "Examples:" msgstr "Exemplos:" +#: ../../library/datetime.rst:1796 +msgid "" +">>> from datetime import time\n" +">>> time.fromisoformat('04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('T04:23:01')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('T042301')\n" +"datetime.time(4, 23, 1)\n" +">>> time.fromisoformat('04:23:01.000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> time.fromisoformat('04:23:01,000384')\n" +"datetime.time(4, 23, 1, 384)\n" +">>> time.fromisoformat('04:23:01+04:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime." +"timedelta(seconds=14400)))\n" +">>> time.fromisoformat('04:23:01Z')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" +">>> time.fromisoformat('04:23:01+00:00')\n" +"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" +msgstr "" + #: ../../library/datetime.rst:1818 msgid "" "Previously, this method only supported formats that could be emitted by :" @@ -2689,6 +3118,19 @@ msgstr "" msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr ":exc:`ValueError` será levantado com um argumento *timespec* inválido." +#: ../../library/datetime.rst:1868 +msgid "" +">>> from datetime import time\n" +">>> time(hour=12, minute=34, second=56, microsecond=123456)." +"isoformat(timespec='minutes')\n" +"'12:34'\n" +">>> dt = time(hour=12, minute=34, second=56, microsecond=0)\n" +">>> dt.isoformat(timespec='microseconds')\n" +"'12:34:56.000000'\n" +">>> dt.isoformat(timespec='auto')\n" +"'12:34:56'" +msgstr "" + #: ../../library/datetime.rst:1883 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "Para um tempo *t*, ``str(t)`` é equivalente a ``t.isoformat()``." @@ -2754,6 +3196,34 @@ msgstr "Exemplos de uso: :class:`.time`" msgid "Examples of working with a :class:`.time` object::" msgstr "Exemplos para trabalhar com um objeto :class:`.time`::" +#: ../../library/datetime.rst:1930 +msgid "" +">>> from datetime import time, tzinfo, timedelta\n" +">>> class TZ1(tzinfo):\n" +"... def utcoffset(self, dt):\n" +"... return timedelta(hours=1)\n" +"... def dst(self, dt):\n" +"... return timedelta(0)\n" +"... def tzname(self,dt):\n" +"... return \"+01:00\"\n" +"... def __repr__(self):\n" +"... return f\"{self.__class__.__name__}()\"\n" +"...\n" +">>> t = time(12, 10, 30, tzinfo=TZ1())\n" +">>> t\n" +"datetime.time(12, 10, 30, tzinfo=TZ1())\n" +">>> t.isoformat()\n" +"'12:10:30+01:00'\n" +">>> t.dst()\n" +"datetime.timedelta(0)\n" +">>> t.tzname()\n" +"'+01:00'\n" +">>> t.strftime(\"%H:%M:%S %Z\")\n" +"'12:10:30 +01:00'\n" +">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" +"'The time is 12:10.'" +msgstr "" + #: ../../library/datetime.rst:1959 msgid ":class:`tzinfo` Objects" msgstr "Objetos :class:`tzinfo`" @@ -2790,9 +3260,17 @@ msgid "" "implementations of the standard :class:`tzinfo` methods needed by the :class:" "`.datetime` methods you use. The :mod:`!datetime` module provides :class:" "`timezone`, a simple concrete subclass of :class:`tzinfo` which can " -"represent timezones with fixed offset from UTC such as UTC itself or North " +"represent time zones with fixed offset from UTC such as UTC itself or North " "American EST and EDT." msgstr "" +"Você precisa derivar uma subclasse concreta, e (pelo menos) fornecer " +"implementações dos métodos padrões de :class:`tzinfo` necessários pelos " +"métodos :class:`.datetime` que você usa. O módulo :mod:`!datetime` fornece :" +"class:`timezone`, uma subclasse concreta simples de :class:`tzinfo`, que " +"pode representar fusos horários com diferença fixa a partir de UTC, tais " +"como o próprio UTC, ou EST (Eastern Standard Time ou Horário padrão " +"oriental) e EDT (Eastern Daylight Time ou Horário de verão oriental) na " +"América do Norte." #: ../../library/datetime.rst:1980 msgid "" @@ -2845,6 +3323,12 @@ msgstr "" "deve ser menor que um dia). A maior parte das implementações de :meth:" "`utcoffset` irá provavelmente parecer com um destes dois::" +#: ../../library/datetime.rst:2004 +msgid "" +"return CONSTANT # fixed-offset class\n" +"return CONSTANT + self.dst(dt) # daylight-aware class" +msgstr "" + #: ../../library/datetime.rst:2007 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " @@ -2916,10 +3400,30 @@ msgstr "" "Maior parte das implementações de :meth:`dst` provavelmente irá parecer com " "um destes dois::" +#: ../../library/datetime.rst:2049 +msgid "" +"def dst(self, dt):\n" +" # a fixed-offset class: doesn't account for DST\n" +" return timedelta(0)" +msgstr "" + #: ../../library/datetime.rst:2053 msgid "or::" msgstr "ou::" +#: ../../library/datetime.rst:2055 +msgid "" +"def dst(self, dt):\n" +" # Code to set dston and dstoff to the time zone's DST\n" +" # transition times based on the input dt.year, and expressed\n" +" # in standard local time.\n" +"\n" +" if dston <= dt.replace(tzinfo=None) < dstoff:\n" +" return timedelta(hours=1)\n" +" else:\n" +" return timedelta(0)" +msgstr "" + #: ../../library/datetime.rst:2065 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." @@ -2984,15 +3488,9 @@ msgid "" "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" "`tzinfo` methods can rely on this, unless user code calls :class:`tzinfo` " "methods directly. The intent is that the :class:`tzinfo` methods interpret " -"*dt* as being in local time, and not need worry about objects in other " -"timezones." +"*dt* as being in local time, and not need worry about objects in other time " +"zones." msgstr "" -"Quando um objeto :class:`.datetime` é passado na resposta ao método :class:`." -"datetime`, ``dt.tzinfo`` é o mesmo objeto que *self*. :class:`tzinfo` e os " -"métodos podem depender disso, a não ser que o código do usuário chame " -"métodos :class:`tzinfo` diretamente. A intenção é que os métodos :class:" -"`tzinfo` interpretem *dt* como estando em hora local, e não precisem se " -"preocupar com objetos em outros fusos horários." #: ../../library/datetime.rst:2104 msgid "" @@ -3004,17 +3502,12 @@ msgstr "" #: ../../library/datetime.rst:2109 msgid "" -"This is called from the default :class:`datetime.astimezone()` " -"implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s " -"date and time data are to be viewed as expressing a UTC time. The purpose " -"of :meth:`fromutc` is to adjust the date and time data, returning an " -"equivalent datetime in *self*'s local time." +"This is called from the default :meth:`datetime.astimezone` implementation. " +"When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " +"data are to be viewed as expressing a UTC time. The purpose of :meth:" +"`fromutc` is to adjust the date and time data, returning an equivalent " +"datetime in *self*'s local time." msgstr "" -"Chamado a partir da implementação padrão :class:`datetime.astimezone()`. " -"Quando chamado a partir dela, ``dt.tzinfo`` é *self*, e os dados de data e " -"hora de *dt* devem ser vistos como se expressassem um horário UTC. O " -"propósito de :meth:`fromutc` é ajustar os dados de data e hora, retornando " -"um datetime equivalente na hora local de *self*." #: ../../library/datetime.rst:2115 msgid "" @@ -3039,6 +3532,24 @@ msgstr "" "Ignorando o código para casos de erros, a implementação padrão :meth:" "`fromutc` funciona como::" +#: ../../library/datetime.rst:2129 +msgid "" +"def fromutc(self, dt):\n" +" # raise ValueError error if dt.tzinfo is not self\n" +" dtoff = dt.utcoffset()\n" +" dtdst = dt.dst()\n" +" # raise ValueError if dtoff is None or dtdst is None\n" +" delta = dtoff - dtdst # this is self's standard offset\n" +" if delta:\n" +" dt += delta # convert to standard local time\n" +" dtdst = dt.dst()\n" +" # raise ValueError if dtdst is None\n" +" if dtdst:\n" +" return dt + dtdst\n" +" else:\n" +" return dt" +msgstr "" + #: ../../library/datetime.rst:2144 msgid "" "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." @@ -3047,6 +3558,186 @@ msgstr "" "No seguinte arquivo :download:`tzinfo_examples.py <../includes/" "tzinfo_examples.py>` existem alguns exemplos de classes :class:`tzinfo`:" +#: ../../library/datetime.rst:2148 +msgid "" +"from datetime import tzinfo, timedelta, datetime\n" +"\n" +"ZERO = timedelta(0)\n" +"HOUR = timedelta(hours=1)\n" +"SECOND = timedelta(seconds=1)\n" +"\n" +"# A class capturing the platform's idea of local time.\n" +"# (May result in wrong values on historical times in\n" +"# timezones where UTC offset and/or the DST rules had\n" +"# changed in the past.)\n" +"import time as _time\n" +"\n" +"STDOFFSET = timedelta(seconds = -_time.timezone)\n" +"if _time.daylight:\n" +" DSTOFFSET = timedelta(seconds = -_time.altzone)\n" +"else:\n" +" DSTOFFSET = STDOFFSET\n" +"\n" +"DSTDIFF = DSTOFFSET - STDOFFSET\n" +"\n" +"class LocalTimezone(tzinfo):\n" +"\n" +" def fromutc(self, dt):\n" +" assert dt.tzinfo is self\n" +" stamp = (dt - datetime(1970, 1, 1, tzinfo=self)) // SECOND\n" +" args = _time.localtime(stamp)[:6]\n" +" dst_diff = DSTDIFF // SECOND\n" +" # Detect fold\n" +" fold = (args == _time.localtime(stamp - dst_diff))\n" +" return datetime(*args, microsecond=dt.microsecond,\n" +" tzinfo=self, fold=fold)\n" +"\n" +" def utcoffset(self, dt):\n" +" if self._isdst(dt):\n" +" return DSTOFFSET\n" +" else:\n" +" return STDOFFSET\n" +"\n" +" def dst(self, dt):\n" +" if self._isdst(dt):\n" +" return DSTDIFF\n" +" else:\n" +" return ZERO\n" +"\n" +" def tzname(self, dt):\n" +" return _time.tzname[self._isdst(dt)]\n" +"\n" +" def _isdst(self, dt):\n" +" tt = (dt.year, dt.month, dt.day,\n" +" dt.hour, dt.minute, dt.second,\n" +" dt.weekday(), 0, 0)\n" +" stamp = _time.mktime(tt)\n" +" tt = _time.localtime(stamp)\n" +" return tt.tm_isdst > 0\n" +"\n" +"Local = LocalTimezone()\n" +"\n" +"\n" +"# A complete implementation of current DST rules for major US time zones.\n" +"\n" +"def first_sunday_on_or_after(dt):\n" +" days_to_go = 6 - dt.weekday()\n" +" if days_to_go:\n" +" dt += timedelta(days_to_go)\n" +" return dt\n" +"\n" +"\n" +"# US DST Rules\n" +"#\n" +"# This is a simplified (i.e., wrong for a few cases) set of rules for US\n" +"# DST start and end times. For a complete and up-to-date set of DST rules\n" +"# and timezone definitions, visit the Olson Database (or try pytz):\n" +"# http://www.twinsun.com/tz/tz-link.htm\n" +"# https://sourceforge.net/projects/pytz/ (might not be up-to-date)\n" +"#\n" +"# In the US, since 2007, DST starts at 2am (standard time) on the second\n" +"# Sunday in March, which is the first Sunday on or after Mar 8.\n" +"DSTSTART_2007 = datetime(1, 3, 8, 2)\n" +"# and ends at 2am (DST time) on the first Sunday of Nov.\n" +"DSTEND_2007 = datetime(1, 11, 1, 2)\n" +"# From 1987 to 2006, DST used to start at 2am (standard time) on the first\n" +"# Sunday in April and to end at 2am (DST time) on the last\n" +"# Sunday of October, which is the first Sunday on or after Oct 25.\n" +"DSTSTART_1987_2006 = datetime(1, 4, 1, 2)\n" +"DSTEND_1987_2006 = datetime(1, 10, 25, 2)\n" +"# From 1967 to 1986, DST used to start at 2am (standard time) on the last\n" +"# Sunday in April (the one on or after April 24) and to end at 2am (DST " +"time)\n" +"# on the last Sunday of October, which is the first Sunday\n" +"# on or after Oct 25.\n" +"DSTSTART_1967_1986 = datetime(1, 4, 24, 2)\n" +"DSTEND_1967_1986 = DSTEND_1987_2006\n" +"\n" +"def us_dst_range(year):\n" +" # Find start and end times for US DST. For years before 1967, return\n" +" # start = end for no DST.\n" +" if 2006 < year:\n" +" dststart, dstend = DSTSTART_2007, DSTEND_2007\n" +" elif 1986 < year < 2007:\n" +" dststart, dstend = DSTSTART_1987_2006, DSTEND_1987_2006\n" +" elif 1966 < year < 1987:\n" +" dststart, dstend = DSTSTART_1967_1986, DSTEND_1967_1986\n" +" else:\n" +" return (datetime(year, 1, 1), ) * 2\n" +"\n" +" start = first_sunday_on_or_after(dststart.replace(year=year))\n" +" end = first_sunday_on_or_after(dstend.replace(year=year))\n" +" return start, end\n" +"\n" +"\n" +"class USTimeZone(tzinfo):\n" +"\n" +" def __init__(self, hours, reprname, stdname, dstname):\n" +" self.stdoffset = timedelta(hours=hours)\n" +" self.reprname = reprname\n" +" self.stdname = stdname\n" +" self.dstname = dstname\n" +"\n" +" def __repr__(self):\n" +" return self.reprname\n" +"\n" +" def tzname(self, dt):\n" +" if self.dst(dt):\n" +" return self.dstname\n" +" else:\n" +" return self.stdname\n" +"\n" +" def utcoffset(self, dt):\n" +" return self.stdoffset + self.dst(dt)\n" +"\n" +" def dst(self, dt):\n" +" if dt is None or dt.tzinfo is None:\n" +" # An exception may be sensible here, in one or both cases.\n" +" # It depends on how you want to treat them. The default\n" +" # fromutc() implementation (called by the default astimezone()\n" +" # implementation) passes a datetime with dt.tzinfo is self.\n" +" return ZERO\n" +" assert dt.tzinfo is self\n" +" start, end = us_dst_range(dt.year)\n" +" # Can't compare naive to aware objects, so strip the timezone from\n" +" # dt first.\n" +" dt = dt.replace(tzinfo=None)\n" +" if start + HOUR <= dt < end - HOUR:\n" +" # DST is in effect.\n" +" return HOUR\n" +" if end - HOUR <= dt < end:\n" +" # Fold (an ambiguous hour): use dt.fold to disambiguate.\n" +" return ZERO if dt.fold else HOUR\n" +" if start <= dt < start + HOUR:\n" +" # Gap (a non-existent hour): reverse the fold rule.\n" +" return HOUR if dt.fold else ZERO\n" +" # DST is off.\n" +" return ZERO\n" +"\n" +" def fromutc(self, dt):\n" +" assert dt.tzinfo is self\n" +" start, end = us_dst_range(dt.year)\n" +" start = start.replace(tzinfo=self)\n" +" end = end.replace(tzinfo=self)\n" +" std_time = dt + self.stdoffset\n" +" dst_time = std_time + HOUR\n" +" if end <= dst_time < end + HOUR:\n" +" # Repeated hour\n" +" return std_time.replace(fold=1)\n" +" if std_time < start or dst_time >= end:\n" +" # Standard time\n" +" return std_time\n" +" if start <= std_time < end - HOUR:\n" +" # Daylight saving time\n" +" return dst_time\n" +"\n" +"\n" +"Eastern = USTimeZone(-5, \"Eastern\", \"EST\", \"EDT\")\n" +"Central = USTimeZone(-6, \"Central\", \"CST\", \"CDT\")\n" +"Mountain = USTimeZone(-7, \"Mountain\", \"MST\", \"MDT\")\n" +"Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" +msgstr "" + #: ../../library/datetime.rst:2150 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" @@ -3063,6 +3754,17 @@ msgstr "" "termina no minuto posterior a 1:59 (EDT, horário de verão) no primeiro " "domingo de Novembro::" +#: ../../library/datetime.rst:2156 +msgid "" +" UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" +" EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" +" EDT 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM\n" +"\n" +"start 22:MM 23:MM 0:MM 1:MM 3:MM 4:MM\n" +"\n" +" end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" +msgstr "" + #: ../../library/datetime.rst:2164 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " @@ -3078,6 +3780,22 @@ msgstr "" "começar. Por exemplo, na primavera de transição para frente em 2016, nós " "tivemos::" +#: ../../library/datetime.rst:2169 +msgid "" +">>> from datetime import datetime, timezone\n" +">>> from tzinfo_examples import HOUR, Eastern\n" +">>> u0 = datetime(2016, 3, 13, 5, tzinfo=timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname())\n" +"...\n" +"05:00:00 UTC = 00:00:00 EST\n" +"06:00:00 UTC = 01:00:00 EST\n" +"07:00:00 UTC = 03:00:00 EDT\n" +"08:00:00 UTC = 04:00:00 EDT" +msgstr "" + #: ../../library/datetime.rst:2183 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " @@ -3093,6 +3811,20 @@ msgid "" "Fall back transition of 2016, we get::" msgstr "" +#: ../../library/datetime.rst:2194 +msgid "" +">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" +">>> for i in range(4):\n" +"... u = u0 + i*HOUR\n" +"... t = u.astimezone(Eastern)\n" +"... print(u.time(), 'UTC =', t.time(), t.tzname(), t.fold)\n" +"...\n" +"04:00:00 UTC = 00:00:00 EDT 0\n" +"05:00:00 UTC = 01:00:00 EDT 0\n" +"06:00:00 UTC = 01:00:00 EST 1\n" +"07:00:00 UTC = 02:00:00 EST 0" +msgstr "" + #: ../../library/datetime.rst:2205 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " @@ -3117,22 +3849,18 @@ msgstr ":mod:`zoneinfo`" msgid "" "The :mod:`!datetime` module has a basic :class:`timezone` class (for " "handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " -"attribute (a UTC timezone instance)." +"attribute (a UTC :class:`!timezone` instance)." msgstr "" #: ../../library/datetime.rst:2221 msgid "" -"``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " +"``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -"``zoneinfo`` traz a **base de dados de fusos horários IANA** (também " -"conhecida como a base de dados Olson) para o Python, e sua utilização é " -"recomendada." #: ../../library/datetime.rst:2224 -msgid "`IANA timezone database `_" +msgid "`IANA time zone database `_" msgstr "" -"`Base de dados de fusos horários IANA `_" #: ../../library/datetime.rst:2225 msgid "" @@ -3155,22 +3883,15 @@ msgstr "Objetos :class:`timezone`" #: ../../library/datetime.rst:2237 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " -"of which represents a timezone defined by a fixed offset from UTC." +"of which represents a time zone defined by a fixed offset from UTC." msgstr "" -"A classe :class:`timezone` é uma subclasse de :class:`tzinfo`, as instâncias " -"de cada uma representam um fuso horário definido por uma diferença " -"temporária fixa do UTC." #: ../../library/datetime.rst:2241 msgid "" -"Objects of this class cannot be used to represent timezone information in " +"Objects of this class cannot be used to represent time zone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -"Objetos dessa classe não podem ser usados para representar informações de " -"fuso horário nas localizações onde variadas diferenças de fuso horário são " -"utilizadas em diferentes dias do ano, ou onde mudanças históricas foram " -"feitas ao tempo civil." #: ../../library/datetime.rst:2248 msgid "" @@ -3243,8 +3964,8 @@ msgstr "" "datetime` consciente, com ``tzinfo`` definida para ``self``." #: ../../library/datetime.rst:2302 -msgid "The UTC timezone, ``timezone(timedelta(0))``." -msgstr "O fuso horário UTC, ``timezone(timedelta(0))``." +msgid "The UTC time zone, ``timezone(timedelta(0))``." +msgstr "" #: ../../library/datetime.rst:2311 msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" @@ -3348,6 +4069,15 @@ msgstr "" "Esses métodos aceitam códigos de formato que podem ser usados para analisar " "e formatar datas::" +#: ../../library/datetime.rst:2344 +msgid "" +">>> datetime.strptime('31/01/22 23:59:59.999999',\n" +"... '%d/%m/%y %H:%M:%S.%f')\n" +"datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)\n" +">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" +"'Mon 31 Jan 2022, 11:59PM'" +msgstr "" + #: ../../library/datetime.rst:2350 msgid "" "The following is a list of all the format codes that the 1989 C standard " @@ -3858,13 +4588,10 @@ msgstr "Usar ``datetime.strptime(date_string, format)`` é equivalente a::" #: ../../library/datetime.rst:2511 msgid "" -"except when the format includes sub-second components or timezone offset " +"except when the format includes sub-second components or time zone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -"exceto quando a formatação inclui componentes menores que 1 segundo, ou " -"informações de diferenças de fuso horário, as quais são suportadas em " -"``datetime.strptime``, mas são descartadas por ``time.strptime``." #: ../../library/datetime.rst:2515 msgid "" diff --git a/library/dbm.po b/library/dbm.po index 11ecfa9ae..02ae3d96b 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2022 -# i17obot , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: i17obot , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -184,6 +183,33 @@ msgid "" "then prints out the contents of the database::" msgstr "" +#: ../../library/dbm.rst:110 +msgid "" +"import dbm\n" +"\n" +"# Open database, creating it if necessary.\n" +"with dbm.open('cache', 'c') as db:\n" +"\n" +" # Record some values\n" +" db[b'hello'] = b'there'\n" +" db['www.python.org'] = 'Python Website'\n" +" db['www.cnn.com'] = 'Cable News Network'\n" +"\n" +" # Note that the keys are considered bytes now.\n" +" assert db[b'www.python.org'] == b'Python Website'\n" +" # Notice how the value is now in bytes.\n" +" assert db['www.cnn.com'] == b'Cable News Network'\n" +"\n" +" # Often-used methods of the dict interface work too.\n" +" print(db.get('python.org', b'not present'))\n" +"\n" +" # Storing a non-string key or value will raise an exception (most\n" +" # likely a TypeError).\n" +" db['www.yahoo.com'] = 4\n" +"\n" +"# db is automatically closed when leaving the with statement." +msgstr "" + #: ../../library/dbm.rst:137 msgid "Module :mod:`shelve`" msgstr "Módulo :mod:`shelve`" @@ -304,6 +330,14 @@ msgid "" "memory that contains them all::" msgstr "" +#: ../../library/dbm.rst:226 +msgid "" +"k = db.firstkey()\n" +"while k is not None:\n" +" print(k)\n" +" k = db.nextkey(k)" +msgstr "" + #: ../../library/dbm.rst:233 msgid "" "If you have carried out a lot of deletions and would like to shrink the " diff --git a/library/debug.po b/library/debug.po index 83f41d841..b3df74777 100644 --- a/library/debug.po +++ b/library/debug.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Hildeberto Abreu Magalhães , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Hildeberto Abreu Magalhães , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/decimal.po b/library/decimal.po index 242903990..4d2e4e1bd 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -4,10 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Adorilson Bezerra , 2022 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -15,21 +11,21 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../library/decimal.rst:2 -msgid ":mod:`!decimal` --- Decimal fixed point and floating point arithmetic" -msgstr "" +msgid ":mod:`!decimal` --- Decimal fixed-point and floating-point arithmetic" +msgstr ":mod:`!decimal` --- Aritmética de ponto fixo decimal e ponto flutuante" #: ../../library/decimal.rst:15 msgid "**Source code:** :source:`Lib/decimal.py`" @@ -38,9 +34,12 @@ msgstr "**Código-fonte:** :source:`Lib/decimal.py`" #: ../../library/decimal.rst:33 msgid "" "The :mod:`decimal` module provides support for fast correctly rounded " -"decimal floating point arithmetic. It offers several advantages over the :" +"decimal floating-point arithmetic. It offers several advantages over the :" "class:`float` datatype:" msgstr "" +"O módulo :mod:`decimal` fornece suporte a aritmética rápida de ponto " +"flutuante decimal corretamente arredondado. Oferece várias vantagens sobre o " +"tipo de dados :class:`float`:" #: ../../library/decimal.rst:37 msgid "" @@ -230,6 +229,17 @@ msgstr "" "atual com :func:`getcontext` e, se necessário, definir novos valores para " "precisão, arredondamento ou armadilhas ativados::" +#: ../../library/decimal.rst:131 +msgid "" +">>> from decimal import *\n" +">>> getcontext()\n" +"Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,\n" +" InvalidOperation])\n" +"\n" +">>> getcontext().prec = 7 # Set a new precision" +msgstr "" + #: ../../library/decimal.rst:139 msgid "" "Decimal instances can be constructed from integers, strings, floats, or " @@ -245,6 +255,27 @@ msgstr "" "como ``NaN``, que significa \"Não é um número\", ``Infinity`` positivo e " "negativo e ``-0``::" +#: ../../library/decimal.rst:145 +msgid "" +">>> getcontext().prec = 28\n" +">>> Decimal(10)\n" +"Decimal('10')\n" +">>> Decimal('3.14')\n" +"Decimal('3.14')\n" +">>> Decimal(3.14)\n" +"Decimal('3.140000000000000124344978758017532527446746826171875')\n" +">>> Decimal((0, (3, 1, 4), -2))\n" +"Decimal('3.14')\n" +">>> Decimal(str(2.0 ** 0.5))\n" +"Decimal('1.4142135623730951')\n" +">>> Decimal(2) ** Decimal('0.5')\n" +"Decimal('1.414213562373095048801688724')\n" +">>> Decimal('NaN')\n" +"Decimal('NaN')\n" +">>> Decimal('-Infinity')\n" +"Decimal('-Infinity')" +msgstr "" + #: ../../library/decimal.rst:163 msgid "" "If the :exc:`FloatOperation` signal is trapped, accidental mixing of " @@ -255,6 +286,22 @@ msgstr "" "acidental de decimais e pontos flutuantes em construtores ou comparações de " "ordenação levanta uma exceção::" +#: ../../library/decimal.rst:167 +msgid "" +">>> c = getcontext()\n" +">>> c.traps[FloatOperation] = True\n" +">>> Decimal(3.14)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') < 3.7\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.FloatOperation: []\n" +">>> Decimal('3.5') == 3.5\n" +"True" +msgstr "" + #: ../../library/decimal.rst:182 msgid "" "The significance of a new Decimal is determined solely by the number of " @@ -265,6 +312,20 @@ msgstr "" "inseridos. A precisão e o arredondamento do contexto só entram em jogo " "durante operações aritméticas." +#: ../../library/decimal.rst:186 +msgid "" +">>> getcontext().prec = 6\n" +">>> Decimal('3.0')\n" +"Decimal('3.0')\n" +">>> Decimal('3.1415926535')\n" +"Decimal('3.1415926535')\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85987')\n" +">>> getcontext().rounding = ROUND_UP\n" +">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" +"Decimal('5.85988')" +msgstr "" + #: ../../library/decimal.rst:199 msgid "" "If the internal limits of the C version are exceeded, constructing a decimal " @@ -273,14 +334,51 @@ msgstr "" "Se os limites internos da versão C forem excedidos, a construção de um " "decimal levanta :class:`InvalidOperation`::" +#: ../../library/decimal.rst:202 +msgid "" +">>> Decimal(\"1e9999999999999999999\")\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"decimal.InvalidOperation: []" +msgstr "" + #: ../../library/decimal.rst:209 msgid "" "Decimals interact well with much of the rest of Python. Here is a small " -"decimal floating point flying circus:" +"decimal floating-point flying circus:" msgstr "" "Os decimais interagem bem com grande parte do resto do Python. Aqui está um " "pequeno circo voador de ponto flutuante decimal:" +#: ../../library/decimal.rst:212 +msgid "" +">>> data = list(map(Decimal, '1.34 1.87 3.45 2.35 1.00 0.03 9.25'.split()))\n" +">>> max(data)\n" +"Decimal('9.25')\n" +">>> min(data)\n" +"Decimal('0.03')\n" +">>> sorted(data)\n" +"[Decimal('0.03'), Decimal('1.00'), Decimal('1.34'), Decimal('1.87'),\n" +" Decimal('2.35'), Decimal('3.45'), Decimal('9.25')]\n" +">>> sum(data)\n" +"Decimal('19.29')\n" +">>> a,b,c = data[:3]\n" +">>> str(a)\n" +"'1.34'\n" +">>> float(a)\n" +"1.34\n" +">>> round(a, 1)\n" +"Decimal('1.3')\n" +">>> int(a)\n" +"1\n" +">>> a * 5\n" +"Decimal('6.70')\n" +">>> a * b\n" +"Decimal('2.5058')\n" +">>> c % a\n" +"Decimal('0.77')" +msgstr "" + #: ../../library/decimal.rst:241 msgid "And some mathematical functions are also available to Decimal:" msgstr "E algumas funções matemáticas também estão disponíveis no Decimal:" @@ -327,6 +425,30 @@ msgstr "" "primeiro é especialmente útil para depuração porque muitas das armadilhas " "estão ativadas:" +#: ../../library/decimal.rst:275 +msgid "" +">>> myothercontext = Context(prec=60, rounding=ROUND_HALF_DOWN)\n" +">>> setcontext(myothercontext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857142857142857142857142857142857142857142857142857142857')\n" +"\n" +">>> ExtendedContext\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[], traps=[])\n" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(7)\n" +"Decimal('0.142857143')\n" +">>> Decimal(42) / Decimal(0)\n" +"Decimal('Infinity')\n" +"\n" +">>> setcontext(BasicContext)\n" +">>> Decimal(42) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(42) / Decimal(0)\n" +"DivisionByZero: x / 0" +msgstr "" + #: ../../library/decimal.rst:299 msgid "" "Contexts also have signal flags for monitoring exceptional conditions " @@ -340,6 +462,17 @@ msgstr "" "sinalizadores antes de cada conjunto de cálculos monitorados usando o " "método :meth:`~Context.clear_flags`. ::" +#: ../../library/decimal.rst:304 +msgid "" +">>> setcontext(ExtendedContext)\n" +">>> getcontext().clear_flags()\n" +">>> Decimal(355) / Decimal(113)\n" +"Decimal('3.14159292')\n" +">>> getcontext()\n" +"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" +" capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])" +msgstr "" + #: ../../library/decimal.rst:312 msgid "" "The *flags* entry shows that the rational approximation to pi was rounded " @@ -358,6 +491,19 @@ msgstr "" "As armadilhas individuais são definidas usando o dicionário no atributo :" "attr:`~Context.traps` de um contexto:" +#: ../../library/decimal.rst:319 +msgid "" +">>> setcontext(ExtendedContext)\n" +">>> Decimal(1) / Decimal(0)\n" +"Decimal('Infinity')\n" +">>> getcontext().traps[DivisionByZero] = 1\n" +">>> Decimal(1) / Decimal(0)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in -toplevel-\n" +" Decimal(1) / Decimal(0)\n" +"DivisionByZero: x / 0" +msgstr "" + #: ../../library/decimal.rst:331 msgid "" "Most programs adjust the current context only once, at the beginning of the " @@ -395,6 +541,21 @@ msgstr "" "espaço em branco à esquerda e à direita, bem como sublinhados em toda parte, " "serem removidos::" +#: ../../library/decimal.rst:355 +msgid "" +"sign ::= '+' | '-'\n" +"digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | " +"'9'\n" +"indicator ::= 'e' | 'E'\n" +"digits ::= digit [digit]...\n" +"decimal-part ::= digits '.' [digits] | ['.'] digits\n" +"exponent-part ::= indicator [sign] digits\n" +"infinity ::= 'Infinity' | 'Inf'\n" +"nan ::= 'NaN' [digits] | 'sNaN' [digits]\n" +"numeric-value ::= decimal-part [exponent-part] | infinity\n" +"numeric-string ::= [sign] numeric-value | [sign] nan" +msgstr "" + #: ../../library/decimal.rst:366 msgid "" "Other Unicode decimal digits are also permitted where ``digit`` appears " @@ -421,7 +582,7 @@ msgstr "" #: ../../library/decimal.rst:376 msgid "" -"If *value* is a :class:`float`, the binary floating point value is " +"If *value* is a :class:`float`, the binary floating-point value is " "losslessly converted to its exact decimal equivalent. This conversion can " "often require 53 or more digits of precision. For example, " "``Decimal(float('1.1'))`` converts to " @@ -486,7 +647,7 @@ msgstr "" #: ../../library/decimal.rst:406 msgid "" -"Decimal floating point objects share many properties with the other built-in " +"Decimal floating-point objects share many properties with the other built-in " "numeric types such as :class:`float` and :class:`int`. All of the usual " "math operations and special methods apply. Likewise, decimal objects can be " "copied, pickled, printed, used as dictionary keys, used as set elements, " @@ -498,7 +659,8 @@ msgstr "" "as operações matemáticas usuais e métodos especiais se aplicam. Da mesma " "forma, objetos decimais podem ser copiados, separados, impressos, usados " "como chaves de dicionário, usados como elementos de conjunto, comparados, " -"classificados e coagidos a outro tipo (como :class:`float` ou :class:`int`)." +"classificados e convertidos a outro tipo (como :class:`float` ou :class:" +"`int`)." #: ../../library/decimal.rst:413 msgid "" @@ -512,6 +674,14 @@ msgstr "" "``%`` é aplicado a objetos decimais, o sinal do resultado é o sinal do " "*dividend* em vez do sinal do divisor::" +#: ../../library/decimal.rst:418 +msgid "" +">>> (-7) % 4\n" +"1\n" +">>> Decimal(-7) % Decimal(4)\n" +"Decimal('-3')" +msgstr "" + #: ../../library/decimal.rst:423 msgid "" "The integer division operator ``//`` behaves analogously, returning the " @@ -523,6 +693,14 @@ msgstr "" "zero) em vez de seu resto, de modo a preservar a identidade usual ``x == " "(x // y) * y + x % y``::" +#: ../../library/decimal.rst:427 +msgid "" +">>> -7 // 4\n" +"-2\n" +">>> Decimal(-7) // Decimal(4)\n" +"Decimal('-1')" +msgstr "" + #: ../../library/decimal.rst:432 msgid "" "The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-" @@ -559,10 +737,10 @@ msgstr "" #: ../../library/decimal.rst:448 msgid "" -"In addition to the standard numeric properties, decimal floating point " +"In addition to the standard numeric properties, decimal floating-point " "objects also have a number of specialized methods:" msgstr "" -"Além das propriedades numéricas padrão, os objetos de ponto flutuante " +"Além das propriedades numéricas padrões, os objetos de ponto flutuante " "decimal também possuem vários métodos especializados:" #: ../../library/decimal.rst:454 @@ -587,6 +765,12 @@ msgstr "" "dada :class:`Decimal` como uma fração, nos termos mais baixos e com um " "denominador positivo::" +#: ../../library/decimal.rst:465 +msgid "" +">>> Decimal('-3.14').as_integer_ratio()\n" +"(-157, 50)" +msgstr "" + #: ../../library/decimal.rst:468 msgid "" "The conversion is exact. Raise OverflowError on infinities and ValueError " @@ -621,6 +805,14 @@ msgstr "" "instância decimal, e se qualquer operando for um NaN, o resultado será um " "NaN::" +#: ../../library/decimal.rst:491 +msgid "" +"a or b is a NaN ==> Decimal('NaN')\n" +"a < b ==> Decimal('-1')\n" +"a == b ==> Decimal('0')\n" +"a > b ==> Decimal('1')" +msgstr "" + #: ../../library/decimal.rst:498 msgid "" "This operation is identical to the :meth:`compare` method, except that all " @@ -759,6 +951,18 @@ msgstr "" "A partir do Python 3.2 em diante, uma instância de :class:`Decimal` também " "pode ser construída diretamente a partir de um :class:`float`." +#: ../../library/decimal.rst:588 +msgid "" +">>> Decimal.from_float(0.1)\n" +"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" +">>> Decimal.from_float(float('nan'))\n" +"Decimal('NaN')\n" +">>> Decimal.from_float(float('inf'))\n" +"Decimal('Infinity')\n" +">>> Decimal.from_float(float('-inf'))\n" +"Decimal('-Infinity')" +msgstr "" + #: ../../library/decimal.rst:603 msgid "" "Fused multiply-add. Return self*other+third with no rounding of the " @@ -1223,14 +1427,14 @@ msgstr "" msgid "Return the square root of the argument to full precision." msgstr "Retorna a raiz quadrada do argumento para a precisão total." -#: ../../library/decimal.rst:873 ../../library/decimal.rst:1468 +#: ../../library/decimal.rst:873 ../../library/decimal.rst:1510 msgid "" "Convert to a string, using engineering notation if an exponent is needed." msgstr "" "Converte em uma string, usando notação de engenharia, se for necessário um " "expoente." -#: ../../library/decimal.rst:875 ../../library/decimal.rst:1470 +#: ../../library/decimal.rst:875 ../../library/decimal.rst:1512 msgid "" "Engineering notation has an exponent which is a multiple of 3. This can " "leave up to 3 digits to the left of the decimal place and may require the " @@ -1277,11 +1481,92 @@ msgstr "" "ou :const:`Rounding`. Se fornecido, aplica *rounding*; caso contrário, usa o " "método de arredondamento no *context* especificado ou no contexto atual." -#: ../../library/decimal.rst:904 +#: ../../library/decimal.rst:900 +msgid "Decimal numbers can be rounded using the :func:`.round` function:" +msgstr "" +"Os números decimais podem ser arredondados usando a função :func:`.round`:" + +#: ../../library/decimal.rst:905 +msgid "" +"If *ndigits* is not given or ``None``, returns the nearest :class:`int` to " +"*number*, rounding ties to even, and ignoring the rounding mode of the :" +"class:`Decimal` context. Raises :exc:`OverflowError` if *number* is an " +"infinity or :exc:`ValueError` if it is a (quiet or signaling) NaN." +msgstr "" +"Se *ndigits* não for fornecido ou ``None``, retorna o :class:`int` de " +"*number* mais próximo, arredondando até chegar em par, e ignorando o modo de " +"arredondamento do contexto :class:`Decimal`. Levanta :exc:`OverflowError` se " +"*number* for um infinito ou :exc:`ValueError` se for um NaN (silencioso ou " +"de sinalização)." + +#: ../../library/decimal.rst:911 +msgid "" +"If *ndigits* is an :class:`int`, the context's rounding mode is respected " +"and a :class:`Decimal` representing *number* rounded to the nearest multiple " +"of ``Decimal('1E-ndigits')`` is returned; in this case, ``round(number, " +"ndigits)`` is equivalent to ``self.quantize(Decimal('1E-ndigits'))``. " +"Returns ``Decimal('NaN')`` if *number* is a quiet NaN. Raises :class:" +"`InvalidOperation` if *number* is an infinity, a signaling NaN, or if the " +"length of the coefficient after the quantize operation would be greater than " +"the current context's precision. In other words, for the non-corner cases:" +msgstr "" +"Se *ndigits* for um :class:`int`, o modo de arredondamento do contexto é " +"respeitado e um :class:`Decimal` representando *número* arredondado para o " +"múltiplo mais próximo de ``Decimal('1E-ndigits')`` é retornado; neste caso, " +"``round(number, ndigits)`` é equivalente a ``self.quantize(Decimal('1E-" +"ndigits'))``. Retorna ``Decimal('NaN')`` se *number* for um NaN silencioso. " +"Levanta :class:`InvalidOperation` se *number* for um infinito, uma " +"sinalização NaN, ou se o comprimento do coeficiente após a operação de " +"quantização for maior que a precisão do contexto atual. Em outras palavras, " +"para os situações comuns:" + +#: ../../library/decimal.rst:921 +msgid "" +"if *ndigits* is positive, return *number* rounded to *ndigits* decimal " +"places;" +msgstr "" +"se *ndigits* for positivo, retorna *number* arredondado para *ndigits* casas " +"decimais;" + +#: ../../library/decimal.rst:923 +msgid "if *ndigits* is zero, return *number* rounded to the nearest integer;" +msgstr "" +"se *ndigits* for zero, retorna *number* arredondado para o número inteiro " +"mais próximo;" + +#: ../../library/decimal.rst:924 +msgid "" +"if *ndigits* is negative, return *number* rounded to the nearest multiple of " +"``10**abs(ndigits)``." +msgstr "" +"se *ndigits* for negativo, retorna *number* arredondado para o múltiplo mais " +"próximo de ``10**abs(ndigits)``." + +#: ../../library/decimal.rst:927 +msgid "For example::" +msgstr "Por exemplo::" + +#: ../../library/decimal.rst:929 +msgid "" +">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" +">>> getcontext().rounding = ROUND_DOWN\n" +">>> round(Decimal('3.75')) # context rounding ignored\n" +"4\n" +">>> round(Decimal('3.5')) # round-ties-to-even\n" +"4\n" +">>> round(Decimal('3.75'), 0) # uses the context rounding\n" +"Decimal('3')\n" +">>> round(Decimal('3.75'), 1)\n" +"Decimal('3.7')\n" +">>> round(Decimal('3.75'), -1)\n" +"Decimal('0E+1')" +msgstr "" + +#: ../../library/decimal.rst:946 msgid "Logical operands" msgstr "Operandos lógicos" -#: ../../library/decimal.rst:906 +#: ../../library/decimal.rst:948 msgid "" "The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" "`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their " @@ -1295,11 +1580,11 @@ msgstr "" "de :class:`Decimal` cujo expoente e sinal são zero e cujos dígitos são todos " "``0`` ou ``1``." -#: ../../library/decimal.rst:918 +#: ../../library/decimal.rst:960 msgid "Context objects" msgstr "Objetos de contexto" -#: ../../library/decimal.rst:920 +#: ../../library/decimal.rst:962 msgid "" "Contexts are environments for arithmetic operations. They govern precision, " "set rules for rounding, determine which signals are treated as exceptions, " @@ -1309,7 +1594,7 @@ msgstr "" "precisão, estabelecem regras para arredondamento, determinam quais sinais " "são tratados como exceções e limitam o intervalo dos expoentes." -#: ../../library/decimal.rst:924 +#: ../../library/decimal.rst:966 msgid "" "Each thread has its own current context which is accessed or changed using " "the :func:`getcontext` and :func:`setcontext` functions:" @@ -1317,15 +1602,15 @@ msgstr "" "Cada thread possui seu próprio contexto atual que é acessado ou alterado " "usando as funções :func:`getcontext` e :func:`setcontext`:" -#: ../../library/decimal.rst:930 +#: ../../library/decimal.rst:972 msgid "Return the current context for the active thread." msgstr "Retorna o contexto atual para a thread ativa." -#: ../../library/decimal.rst:935 +#: ../../library/decimal.rst:977 msgid "Set the current context for the active thread to *c*." msgstr "Define o contexto atual para a thread ativa como *C*." -#: ../../library/decimal.rst:937 +#: ../../library/decimal.rst:979 msgid "" "You can also use the :keyword:`with` statement and the :func:`localcontext` " "function to temporarily change the active context." @@ -1333,7 +1618,7 @@ msgstr "" "Você também pode usar a instrução :keyword:`with` e a função :func:" "`localcontext` para alterar temporariamente o contexto ativo." -#: ../../library/decimal.rst:942 +#: ../../library/decimal.rst:984 msgid "" "Return a context manager that will set the current context for the active " "thread to a copy of *ctx* on entry to the with-statement and restore the " @@ -1347,7 +1632,7 @@ msgstr "" "contexto for especificado, uma cópia do contexto atual será usada. O " "argumento *kwargs* é usado para definir os atributos do novo contexto." -#: ../../library/decimal.rst:948 +#: ../../library/decimal.rst:990 msgid "" "For example, the following code sets the current decimal precision to 42 " "places, performs a calculation, and then automatically restores the previous " @@ -1356,11 +1641,30 @@ msgstr "" "Por exemplo, o código a seguir define a precisão decimal atual para 42 " "casas, executa um cálculo e restaura automaticamente o contexto anterior::" -#: ../../library/decimal.rst:958 +#: ../../library/decimal.rst:993 +msgid "" +"from decimal import localcontext\n" +"\n" +"with localcontext() as ctx:\n" +" ctx.prec = 42 # Perform a high precision calculation\n" +" s = calculate_something()\n" +"s = +s # Round the final result back to the default precision" +msgstr "" + +#: ../../library/decimal.rst:1000 msgid "Using keyword arguments, the code would be the following::" msgstr "Usando argumentos nomeados, o código seria o seguinte::" -#: ../../library/decimal.rst:966 +#: ../../library/decimal.rst:1002 +msgid "" +"from decimal import localcontext\n" +"\n" +"with localcontext(prec=42) as ctx:\n" +" s = calculate_something()\n" +"s = +s" +msgstr "" + +#: ../../library/decimal.rst:1008 msgid "" "Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:" "`Context` doesn't support. Raises either :exc:`TypeError` or :exc:" @@ -1370,7 +1674,7 @@ msgstr "" "`Context` não oferecer suporte. Levanta :exc:`TypeError` ou :exc:" "`ValueError` se *kwargs* fornecer um valor inválido para um atributo." -#: ../../library/decimal.rst:970 +#: ../../library/decimal.rst:1012 msgid "" ":meth:`localcontext` now supports setting context attributes through the use " "of keyword arguments." @@ -1378,7 +1682,7 @@ msgstr "" ":meth:`localcontext` agora tem suporte à configuração de atributos de " "contexto através do uso de argumentos nomeados." -#: ../../library/decimal.rst:973 +#: ../../library/decimal.rst:1015 msgid "" "New contexts can also be created using the :class:`Context` constructor " "described below. In addition, the module provides three pre-made contexts:" @@ -1387,7 +1691,7 @@ msgstr "" "`Context` descrito abaixo. Além disso, o módulo fornece três contextos pré-" "criados::" -#: ../../library/decimal.rst:979 +#: ../../library/decimal.rst:1021 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -1401,14 +1705,14 @@ msgstr "" "armadilhas estão ativadas (tratadas como exceções), exceto por :const:" "`Inexact`, :const:`Rounded` e :const:`Subnormal`." -#: ../../library/decimal.rst:985 +#: ../../library/decimal.rst:1027 msgid "" "Because many of the traps are enabled, this context is useful for debugging." msgstr "" "Como muitas das armadilhas estão ativadas, esse contexto é útil para " "depuração." -#: ../../library/decimal.rst:990 +#: ../../library/decimal.rst:1032 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -1421,7 +1725,7 @@ msgstr "" "armadilha está ativada (de forma que exceções não são levantadas durante os " "cálculos)." -#: ../../library/decimal.rst:995 +#: ../../library/decimal.rst:1037 msgid "" "Because the traps are disabled, this context is useful for applications that " "prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " @@ -1433,7 +1737,7 @@ msgstr "" "levantar exceções. Isso permite que uma aplicação conclua uma execução na " "presença de condições que interromperiam o programa." -#: ../../library/decimal.rst:1003 +#: ../../library/decimal.rst:1045 msgid "" "This context is used by the :class:`Context` constructor as a prototype for " "new contexts. Changing a field (such a precision) has the effect of " @@ -1445,7 +1749,7 @@ msgstr "" "alterar o padrão para novos contextos criados pelo construtor :class:" "`Context`." -#: ../../library/decimal.rst:1007 +#: ../../library/decimal.rst:1049 msgid "" "This context is most useful in multi-threaded environments. Changing one of " "the fields before threads are started has the effect of setting system-wide " @@ -1458,7 +1762,7 @@ msgstr "" "threads, pois exigiria sincronização de threads para evitar condições de " "corrida." -#: ../../library/decimal.rst:1012 +#: ../../library/decimal.rst:1054 msgid "" "In single threaded environments, it is preferable to not use this context at " "all. Instead, simply create contexts explicitly as described below." @@ -1466,7 +1770,7 @@ msgstr "" "Em ambientes de thread única, é preferível não usar esse contexto. Em vez " "disso, basta criar contextos explicitamente, conforme descrito abaixo." -#: ../../library/decimal.rst:1015 +#: ../../library/decimal.rst:1057 msgid "" "The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." "rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" @@ -1476,7 +1780,7 @@ msgstr "" "rounding`\\ =\\ :const:`ROUND_HALF_EVEN` e armadilhas ativadas para :class:" "`Overflow`, :class:`InvalidOperation` e :class:`DivisionByZero`." -#: ../../library/decimal.rst:1020 +#: ../../library/decimal.rst:1062 msgid "" "In addition to the three supplied contexts, new contexts can be created with " "the :class:`Context` constructor." @@ -1484,7 +1788,7 @@ msgstr "" "Além dos três contextos fornecidos, novos contextos podem ser criados com o " "construtor :class:`Context`." -#: ../../library/decimal.rst:1026 +#: ../../library/decimal.rst:1068 msgid "" "Creates a new context. If a field is not specified or is :const:`None`, the " "default values are copied from the :const:`DefaultContext`. If the *flags* " @@ -1495,7 +1799,7 @@ msgstr "" "campo *flags* não for especificado ou for :const:`None`, todos os " "sinalizadores serão limpados." -#: ../../library/decimal.rst:1030 +#: ../../library/decimal.rst:1072 msgid "" "*prec* is an integer in the range [``1``, :const:`MAX_PREC`] that sets the " "precision for arithmetic operations in the context." @@ -1503,7 +1807,7 @@ msgstr "" "*prec* é um número inteiro no intervalo [``1``, :const:`MAX_PREC`] que " "define a precisão das operações aritméticas no contexto." -#: ../../library/decimal.rst:1033 +#: ../../library/decimal.rst:1075 msgid "" "The *rounding* option is one of the constants listed in the section " "`Rounding Modes`_." @@ -1511,7 +1815,7 @@ msgstr "" "A opção *rounding* é uma das constantes listadas na seção `Modos de " "arredondamento`_." -#: ../../library/decimal.rst:1036 +#: ../../library/decimal.rst:1078 msgid "" "The *traps* and *flags* fields list any signals to be set. Generally, new " "contexts should only set traps and leave the flags clear." @@ -1520,7 +1824,7 @@ msgstr "" "Geralmente, novos contextos devem apenas definir armadilhas e deixar os " "sinalizadores limpos." -#: ../../library/decimal.rst:1039 +#: ../../library/decimal.rst:1081 msgid "" "The *Emin* and *Emax* fields are integers specifying the outer limits " "allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, " @@ -1530,7 +1834,7 @@ msgstr "" "externos permitidos para expoentes. *Emin* deve estar no intervalo [:const:" "`MIN_EMIN`, ``0``], *Emax* no intervalo [``0``, :const:`MAX_EMAX`]." -#: ../../library/decimal.rst:1043 +#: ../../library/decimal.rst:1085 msgid "" "The *capitals* field is either ``0`` or ``1`` (the default). If set to " "``1``, exponents are printed with a capital ``E``; otherwise, a lowercase " @@ -1540,7 +1844,7 @@ msgstr "" "expoentes serão impressos com um ``E`` maiúsculo; caso contrário, um ``e`` " "minúscula é usado: ``Decimal('6.02e+23')``." -#: ../../library/decimal.rst:1047 +#: ../../library/decimal.rst:1089 msgid "" "The *clamp* field is either ``0`` (the default) or ``1``. If set to ``1``, " "the exponent ``e`` of a :class:`Decimal` instance representable in this " @@ -1564,7 +1868,13 @@ msgstr "" "isso preserva o valor do número, mas perde informações sobre zeros à direita " "significativos. Por exemplo::" -#: ../../library/decimal.rst:1062 +#: ../../library/decimal.rst:1101 +msgid "" +">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" +"Decimal('1.23000E+999')" +msgstr "" + +#: ../../library/decimal.rst:1104 msgid "" "A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " "interchange formats specified in IEEE 754." @@ -1572,7 +1882,7 @@ msgstr "" "Um valor de *clamp* de ``1`` permite compatibilidade com os formatos de " "intercâmbio decimal de largura fixa especificados na IEEE 754." -#: ../../library/decimal.rst:1065 +#: ../../library/decimal.rst:1107 msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " @@ -1594,23 +1904,23 @@ msgstr "" "de :class:`Context` aceita um número inteiro do Python (uma instância de :" "class:`int`) em qualquer lugar em que uma instância de Decimal seja aceita." -#: ../../library/decimal.rst:1078 +#: ../../library/decimal.rst:1120 msgid "Resets all of the flags to ``0``." msgstr "Redefine todos os sinalizadores para ``0``." -#: ../../library/decimal.rst:1082 +#: ../../library/decimal.rst:1124 msgid "Resets all of the traps to ``0``." msgstr "Redefine todas as armadilhas para ``0``." -#: ../../library/decimal.rst:1088 +#: ../../library/decimal.rst:1130 msgid "Return a duplicate of the context." msgstr "Retorna uma duplicata do contexto." -#: ../../library/decimal.rst:1092 +#: ../../library/decimal.rst:1134 msgid "Return a copy of the Decimal instance num." msgstr "Retorna uma cópia da instância de Decimal *num*." -#: ../../library/decimal.rst:1096 +#: ../../library/decimal.rst:1138 msgid "" "Creates a new Decimal instance from *num* but using *self* as context. " "Unlike the :class:`Decimal` constructor, the context precision, rounding " @@ -1621,7 +1931,7 @@ msgstr "" "contexto, o método de arredondamento, os sinalizadores e as armadilhas são " "aplicadas à conversão." -#: ../../library/decimal.rst:1100 +#: ../../library/decimal.rst:1142 msgid "" "This is useful because constants are often given to a greater precision than " "is needed by the application. Another benefit is that rounding immediately " @@ -1635,7 +1945,16 @@ msgstr "" "da precisão atual. No exemplo a seguir, o uso de entradas não arredondadas " "significa que adicionar zero a uma soma pode alterar o resultado:" -#: ../../library/decimal.rst:1114 +#: ../../library/decimal.rst:1148 +msgid "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.4445') + Decimal('1.0023')\n" +"Decimal('4.45')\n" +">>> Decimal('3.4445') + Decimal(0) + Decimal('1.0023')\n" +"Decimal('4.44')" +msgstr "" + +#: ../../library/decimal.rst:1156 msgid "" "This method implements the to-number operation of the IBM specification. If " "the argument is a string, no leading or trailing whitespace or underscores " @@ -1645,7 +1964,7 @@ msgstr "" "argumento for uma string, nenhum espaço em branco à esquerda ou à direita ou " "sublinhado serão permitidos." -#: ../../library/decimal.rst:1120 +#: ../../library/decimal.rst:1162 msgid "" "Creates a new Decimal instance from a float *f* but rounding using *self* as " "the context. Unlike the :meth:`Decimal.from_float` class method, the " @@ -1657,7 +1976,19 @@ msgstr "" "classe :meth:`Decimal.from_float`, a precisão do contexto, o método de " "arredondamento, os sinalizadores e as armadilhas são aplicados à conversão." -#: ../../library/decimal.rst:1140 +#: ../../library/decimal.rst:1167 +msgid "" +">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Decimal('3.1415')\n" +">>> context = Context(prec=5, traps=[Inexact])\n" +">>> context.create_decimal_from_float(math.pi)\n" +"Traceback (most recent call last):\n" +" ...\n" +"decimal.Inexact: None" +msgstr "" + +#: ../../library/decimal.rst:1182 msgid "" "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " "value for subnormal results. When underflow occurs, the exponent is set to :" @@ -1667,11 +1998,11 @@ msgstr "" "expoente para resultados subnormais. Quando ocorre o estouro negativo, o " "expoente é definido como :const:`Etiny`." -#: ../../library/decimal.rst:1146 +#: ../../library/decimal.rst:1188 msgid "Returns a value equal to ``Emax - prec + 1``." msgstr "Retorna um valor igual a ``Emax - prec + 1``." -#: ../../library/decimal.rst:1148 +#: ../../library/decimal.rst:1190 msgid "" "The usual approach to working with decimals is to create :class:`Decimal` " "instances and then apply arithmetic operations which take place within the " @@ -1686,191 +2017,191 @@ msgstr "" "para calcular dentro de um contexto específico. Os métodos são semelhantes " "aos da classe :class:`Decimal` e são contados apenas brevemente aqui." -#: ../../library/decimal.rst:1158 +#: ../../library/decimal.rst:1200 msgid "Returns the absolute value of *x*." msgstr "Retorna o valor absoluto de *x*." -#: ../../library/decimal.rst:1163 +#: ../../library/decimal.rst:1205 msgid "Return the sum of *x* and *y*." msgstr "Retorna a soma de *x* e *y*." -#: ../../library/decimal.rst:1168 +#: ../../library/decimal.rst:1210 msgid "Returns the same Decimal object *x*." msgstr "Retorna o mesmo objeto de Decimal *x*." -#: ../../library/decimal.rst:1173 +#: ../../library/decimal.rst:1215 msgid "Compares *x* and *y* numerically." msgstr "Compara *x* e *y* numericamente." -#: ../../library/decimal.rst:1178 +#: ../../library/decimal.rst:1220 msgid "Compares the values of the two operands numerically." msgstr "Compara os valores dos dois operandos numericamente." -#: ../../library/decimal.rst:1183 +#: ../../library/decimal.rst:1225 msgid "Compares two operands using their abstract representation." msgstr "Compara dois operandos usando sua representação abstrata." -#: ../../library/decimal.rst:1188 +#: ../../library/decimal.rst:1230 msgid "" "Compares two operands using their abstract representation, ignoring sign." msgstr "" "Compara dois operandos usando sua representação abstrata, ignorando o sinal." -#: ../../library/decimal.rst:1193 +#: ../../library/decimal.rst:1235 msgid "Returns a copy of *x* with the sign set to 0." msgstr "Retorna uma cópia de *x* com o sinal definido para 0." -#: ../../library/decimal.rst:1198 +#: ../../library/decimal.rst:1240 msgid "Returns a copy of *x* with the sign inverted." msgstr "Retorna uma cópia de *x* com o sinal invertido." -#: ../../library/decimal.rst:1203 +#: ../../library/decimal.rst:1245 msgid "Copies the sign from *y* to *x*." msgstr "Copia o sinal de *y* para *x*." -#: ../../library/decimal.rst:1208 +#: ../../library/decimal.rst:1250 msgid "Return *x* divided by *y*." msgstr "Retorna *x* dividido por *y*." -#: ../../library/decimal.rst:1213 +#: ../../library/decimal.rst:1255 msgid "Return *x* divided by *y*, truncated to an integer." msgstr "Retorna *x* dividido por *y*, truncado para um inteiro." -#: ../../library/decimal.rst:1218 +#: ../../library/decimal.rst:1260 msgid "Divides two numbers and returns the integer part of the result." msgstr "Divide dois números e retorna a parte inteira do resultado." -#: ../../library/decimal.rst:1223 +#: ../../library/decimal.rst:1265 msgid "Returns ``e ** x``." msgstr "Retorna ``e ** x``." -#: ../../library/decimal.rst:1228 +#: ../../library/decimal.rst:1270 msgid "Returns *x* multiplied by *y*, plus *z*." msgstr "Retorna *x* multiplicado por *y*, mais *z*." -#: ../../library/decimal.rst:1233 +#: ../../library/decimal.rst:1275 msgid "Returns ``True`` if *x* is canonical; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for canonical; caso contrário, retorna ``False``." -#: ../../library/decimal.rst:1238 +#: ../../library/decimal.rst:1280 msgid "Returns ``True`` if *x* is finite; otherwise returns ``False``." msgstr "Retorna ``True`` se *x* for finito; caso contrário, retorna ``False``." -#: ../../library/decimal.rst:1243 +#: ../../library/decimal.rst:1285 msgid "Returns ``True`` if *x* is infinite; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for infinito; caso contrário, retorna ``False``." -#: ../../library/decimal.rst:1248 +#: ../../library/decimal.rst:1290 msgid "Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for qNaN ou sNaN; caso contrário, retorna ``False``." -#: ../../library/decimal.rst:1253 +#: ../../library/decimal.rst:1295 msgid "" "Returns ``True`` if *x* is a normal number; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for um número normal; caso contrário, retorna " "``False``." -#: ../../library/decimal.rst:1258 +#: ../../library/decimal.rst:1300 msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for um NaN silencioso; caso contrário, retorna " "``False``." -#: ../../library/decimal.rst:1263 +#: ../../library/decimal.rst:1305 msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for negativo; caso contrário, retorna ``False``." -#: ../../library/decimal.rst:1268 +#: ../../library/decimal.rst:1310 msgid "" "Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for um NaN sinalizador; caso contrário, retorna " "``False``." -#: ../../library/decimal.rst:1273 +#: ../../library/decimal.rst:1315 msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." msgstr "" "Retorna ``True`` se *x* for subnormal; caso contrário, retorna ``False``." -#: ../../library/decimal.rst:1278 +#: ../../library/decimal.rst:1320 msgid "Returns ``True`` if *x* is a zero; otherwise returns ``False``." msgstr "Retorna ``True`` se *x* for zero; caso contrário, retorna ``False``." -#: ../../library/decimal.rst:1283 +#: ../../library/decimal.rst:1325 msgid "Returns the natural (base e) logarithm of *x*." msgstr "Retorna o logaritmo natural (base e) de *x*." -#: ../../library/decimal.rst:1288 +#: ../../library/decimal.rst:1330 msgid "Returns the base 10 logarithm of *x*." msgstr "Retorna o logaritmo de base 10 de *x*." -#: ../../library/decimal.rst:1293 +#: ../../library/decimal.rst:1335 msgid "Returns the exponent of the magnitude of the operand's MSD." msgstr "Retorna o expoente da magnitude do MSD do operando." -#: ../../library/decimal.rst:1298 +#: ../../library/decimal.rst:1340 msgid "Applies the logical operation *and* between each operand's digits." msgstr "Aplica a operação lógica *e* entre cada dígito do operando." -#: ../../library/decimal.rst:1303 +#: ../../library/decimal.rst:1345 msgid "Invert all the digits in *x*." msgstr "Inverte todos os dígitos em *x*." -#: ../../library/decimal.rst:1308 +#: ../../library/decimal.rst:1350 msgid "Applies the logical operation *or* between each operand's digits." msgstr "Aplica a operação lógica *ou* entre cada dígito do operando." -#: ../../library/decimal.rst:1313 +#: ../../library/decimal.rst:1355 msgid "Applies the logical operation *xor* between each operand's digits." msgstr "Aplica a operação lógica *ou exclusivo* entre cada dígito do operando." -#: ../../library/decimal.rst:1318 +#: ../../library/decimal.rst:1360 msgid "Compares two values numerically and returns the maximum." msgstr "Compara dois valores numericamente e retorna o máximo." -#: ../../library/decimal.rst:1323 ../../library/decimal.rst:1333 +#: ../../library/decimal.rst:1365 ../../library/decimal.rst:1375 msgid "Compares the values numerically with their sign ignored." msgstr "Compara dois valores numericamente com seu sinal ignorado." -#: ../../library/decimal.rst:1328 +#: ../../library/decimal.rst:1370 msgid "Compares two values numerically and returns the minimum." msgstr "Compara dois valores numericamente e retorna o mínimo." -#: ../../library/decimal.rst:1338 +#: ../../library/decimal.rst:1380 msgid "Minus corresponds to the unary prefix minus operator in Python." msgstr "" "Minus corresponde ao operador de subtração de prefixo unário no Python." -#: ../../library/decimal.rst:1343 +#: ../../library/decimal.rst:1385 msgid "Return the product of *x* and *y*." msgstr "Retorna o produto de *x* e *y*." -#: ../../library/decimal.rst:1348 +#: ../../library/decimal.rst:1390 msgid "Returns the largest representable number smaller than *x*." msgstr "Retorna o maior número representável menor que *x*." -#: ../../library/decimal.rst:1353 +#: ../../library/decimal.rst:1395 msgid "Returns the smallest representable number larger than *x*." msgstr "Retorna o menor número representável maior que *x*." -#: ../../library/decimal.rst:1358 +#: ../../library/decimal.rst:1400 msgid "Returns the number closest to *x*, in direction towards *y*." msgstr "Retorna o número mais próximo a *x*, em direção a *y*." -#: ../../library/decimal.rst:1363 +#: ../../library/decimal.rst:1405 msgid "Reduces *x* to its simplest form." msgstr "Reduz *x* para sua forma mais simples." -#: ../../library/decimal.rst:1368 +#: ../../library/decimal.rst:1410 msgid "Returns an indication of the class of *x*." msgstr "Retorna uma indicação da classe de *x*." -#: ../../library/decimal.rst:1373 +#: ../../library/decimal.rst:1415 msgid "" "Plus corresponds to the unary prefix plus operator in Python. This " "operation applies the context precision and rounding, so it is *not* an " @@ -1880,13 +2211,13 @@ msgstr "" "operação aplica a precisão e o arredondamento do contexto, portanto *não* é " "uma operação de identidade." -#: ../../library/decimal.rst:1380 +#: ../../library/decimal.rst:1422 msgid "Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given." msgstr "" "Retorna ``x`` à potência de ``y``, com a redução de módulo ``modulo`` se " "fornecido." -#: ../../library/decimal.rst:1382 +#: ../../library/decimal.rst:1424 msgid "" "With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must " "be integral. The result will be inexact unless ``y`` is integral and the " @@ -1900,7 +2231,7 @@ msgstr "" "dígitos. O modo de arredondamento do contexto é usado. Os resultados são " "sempre arredondados corretamente na versão Python." -#: ../../library/decimal.rst:1388 +#: ../../library/decimal.rst:1430 msgid "" "``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " "``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." @@ -1908,7 +2239,7 @@ msgstr "" "``Decimal(0) ** Decimal(0)`` resulta em ``InvalidOperation``, e se " "``InvalidOperation`` não for capturado, resulta em ``Decimal('NaN')``." -#: ../../library/decimal.rst:1391 +#: ../../library/decimal.rst:1433 msgid "" "The C module computes :meth:`power` in terms of the correctly rounded :meth:" "`exp` and :meth:`ln` functions. The result is well-defined but only \"almost " @@ -1918,7 +2249,7 @@ msgstr "" "arredondadas :meth:`exp` e :meth:`ln`. O resultado é bem definido, mas " "apenas \"quase sempre corretamente arredondado\"." -#: ../../library/decimal.rst:1396 +#: ../../library/decimal.rst:1438 msgid "" "With three arguments, compute ``(x**y) % modulo``. For the three argument " "form, the following restrictions on the arguments hold:" @@ -1926,24 +2257,24 @@ msgstr "" "Com três argumentos, calcula ``(x**y) % modulo``. Para o formulário de três " "argumentos, as seguintes restrições nos argumentos são válidas:" -#: ../../library/decimal.rst:1399 +#: ../../library/decimal.rst:1441 msgid "all three arguments must be integral" msgstr "todos os três argumentos devem ser inteiros" -#: ../../library/decimal.rst:1400 +#: ../../library/decimal.rst:1442 msgid "``y`` must be nonnegative" msgstr "``y`` não pode ser negativo" -#: ../../library/decimal.rst:1401 +#: ../../library/decimal.rst:1443 msgid "at least one of ``x`` or ``y`` must be nonzero" msgstr "pelo menos um de ``x`` ou ``y`` não pode ser negativo" -#: ../../library/decimal.rst:1402 +#: ../../library/decimal.rst:1444 msgid "``modulo`` must be nonzero and have at most 'precision' digits" msgstr "" "``modulo`` não pode ser zero e deve ter pelo menos \"precisão\" dígitos" -#: ../../library/decimal.rst:1404 +#: ../../library/decimal.rst:1446 msgid "" "The value resulting from ``Context.power(x, y, modulo)`` is equal to the " "value that would be obtained by computing ``(x**y) % modulo`` with unbounded " @@ -1957,19 +2288,19 @@ msgstr "" "independentemente dos expoentes de ``x``, ``y`` e ``modulo``. O resultado é " "sempre exato." -#: ../../library/decimal.rst:1414 +#: ../../library/decimal.rst:1456 msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." msgstr "Retorna um valor igual a *x* (arredondado), com o expoente de *y*." -#: ../../library/decimal.rst:1419 +#: ../../library/decimal.rst:1461 msgid "Just returns 10, as this is Decimal, :)" msgstr "Só retorna 10, já que isso é Decimal, :)" -#: ../../library/decimal.rst:1424 +#: ../../library/decimal.rst:1466 msgid "Returns the remainder from integer division." msgstr "Retorna o resto da divisão inteira." -#: ../../library/decimal.rst:1426 +#: ../../library/decimal.rst:1468 msgid "" "The sign of the result, if non-zero, is the same as that of the original " "dividend." @@ -1977,7 +2308,7 @@ msgstr "" "O sinal do resultado, se diferente de zero, é o mesmo que o do dividendo " "original." -#: ../../library/decimal.rst:1432 +#: ../../library/decimal.rst:1474 msgid "" "Returns ``x - y * n``, where *n* is the integer nearest the exact value of " "``x / y`` (if the result is 0 then its sign will be the sign of *x*)." @@ -1985,43 +2316,43 @@ msgstr "" "Retorna ``x - y * n``, onde *n* é o número inteiro mais próximo do valor " "exato de ``x / y`` (se o resultado for 0, seu sinal será o sinal de *x*)." -#: ../../library/decimal.rst:1438 +#: ../../library/decimal.rst:1480 msgid "Returns a rotated copy of *x*, *y* times." msgstr "Retorna uma cópia re de *x*, *y* vezes." -#: ../../library/decimal.rst:1443 +#: ../../library/decimal.rst:1485 msgid "Returns ``True`` if the two operands have the same exponent." msgstr "Retorna ``True`` se os dois operandos tiverem o mesmo expoente." -#: ../../library/decimal.rst:1448 +#: ../../library/decimal.rst:1490 msgid "Returns the first operand after adding the second value its exp." msgstr "Retorna o primeiro operando após adicionar o segundo valor seu exp." -#: ../../library/decimal.rst:1453 +#: ../../library/decimal.rst:1495 msgid "Returns a shifted copy of *x*, *y* times." msgstr "Retorna uma cópia deslocada de *x*, *y* vezes." -#: ../../library/decimal.rst:1458 +#: ../../library/decimal.rst:1500 msgid "Square root of a non-negative number to context precision." msgstr "Raiz quadrada de um número não negativo para precisão do contexto." -#: ../../library/decimal.rst:1463 +#: ../../library/decimal.rst:1505 msgid "Return the difference between *x* and *y*." msgstr "Retorna a diferença entre *x* e *y*." -#: ../../library/decimal.rst:1477 +#: ../../library/decimal.rst:1519 msgid "Rounds to an integer." msgstr "Arredonda para um número inteiro." -#: ../../library/decimal.rst:1482 +#: ../../library/decimal.rst:1524 msgid "Converts a number to a string using scientific notation." msgstr "Converte um número em uma string usando notação científica." -#: ../../library/decimal.rst:1489 +#: ../../library/decimal.rst:1531 msgid "Constants" msgstr "Constantes" -#: ../../library/decimal.rst:1491 +#: ../../library/decimal.rst:1533 msgid "" "The constants in this section are only relevant for the C module. They are " "also included in the pure Python version for compatibility." @@ -2029,45 +2360,45 @@ msgstr "" "As constantes nesta seção são relevantes apenas para o módulo C. Eles também " "estão incluídos na versão pura do Python para compatibilidade." -#: ../../library/decimal.rst:1495 +#: ../../library/decimal.rst:1537 msgid "32-bit" msgstr "32 bits" -#: ../../library/decimal.rst:1495 +#: ../../library/decimal.rst:1537 msgid "64-bit" msgstr "64 bits" -#: ../../library/decimal.rst:1497 ../../library/decimal.rst:1499 +#: ../../library/decimal.rst:1539 ../../library/decimal.rst:1541 msgid "``425000000``" msgstr "``425000000``" -#: ../../library/decimal.rst:1497 ../../library/decimal.rst:1499 +#: ../../library/decimal.rst:1539 ../../library/decimal.rst:1541 msgid "``999999999999999999``" msgstr "``999999999999999999``" -#: ../../library/decimal.rst:1501 +#: ../../library/decimal.rst:1543 msgid "``-425000000``" msgstr "``-425000000``" -#: ../../library/decimal.rst:1501 +#: ../../library/decimal.rst:1543 msgid "``-999999999999999999``" msgstr "``-999999999999999999``" -#: ../../library/decimal.rst:1503 +#: ../../library/decimal.rst:1545 msgid "``-849999999``" msgstr "``-849999999``" -#: ../../library/decimal.rst:1503 +#: ../../library/decimal.rst:1545 msgid "``-1999999999999999997``" msgstr "``-1999999999999999997``" -#: ../../library/decimal.rst:1509 +#: ../../library/decimal.rst:1551 msgid "" "The value is ``True``. Deprecated, because Python now always has threads." msgstr "" "O valor é ``True``. Descontinuado porque o Python agora sempre tem threads." -#: ../../library/decimal.rst:1515 +#: ../../library/decimal.rst:1557 msgid "" "The default value is ``True``. If Python is :option:`configured using the --" "without-decimal-contextvar option <--without-decimal-contextvar>`, the C " @@ -2081,41 +2412,41 @@ msgstr "" "será ``False``. Isso é um pouco mais rápido em alguns cenários de contexto " "aninhados." -#: ../../library/decimal.rst:1524 +#: ../../library/decimal.rst:1566 msgid "Rounding modes" msgstr "Modos de arredondamento" -#: ../../library/decimal.rst:1528 +#: ../../library/decimal.rst:1570 msgid "Round towards ``Infinity``." msgstr "Arredonda para ``Infinity``." -#: ../../library/decimal.rst:1532 +#: ../../library/decimal.rst:1574 msgid "Round towards zero." msgstr "Arredonda para zero." -#: ../../library/decimal.rst:1536 +#: ../../library/decimal.rst:1578 msgid "Round towards ``-Infinity``." msgstr "Arredonda para ``-Infinity``." -#: ../../library/decimal.rst:1540 +#: ../../library/decimal.rst:1582 msgid "Round to nearest with ties going towards zero." msgstr "Arrendonda para o mais próximo com empates tendendo a zero." -#: ../../library/decimal.rst:1544 +#: ../../library/decimal.rst:1586 msgid "Round to nearest with ties going to nearest even integer." msgstr "" "Arredonda para o mais próximo com empates indo para o mais próximo inteiro " "par." -#: ../../library/decimal.rst:1548 +#: ../../library/decimal.rst:1590 msgid "Round to nearest with ties going away from zero." msgstr "Arrendonda para o mais próximo com empates se afastando de zero." -#: ../../library/decimal.rst:1552 +#: ../../library/decimal.rst:1594 msgid "Round away from zero." msgstr "Arredonda se afastando de zero." -#: ../../library/decimal.rst:1556 +#: ../../library/decimal.rst:1598 msgid "" "Round away from zero if last digit after rounding towards zero would have " "been 0 or 5; otherwise round towards zero." @@ -2123,11 +2454,11 @@ msgstr "" "Arredonda se afastando de zero se o último dígito após o arredondamento para " "zero fosse 0 ou 5; caso contrário, arredonda para zero." -#: ../../library/decimal.rst:1563 +#: ../../library/decimal.rst:1605 msgid "Signals" msgstr "Sinais" -#: ../../library/decimal.rst:1565 +#: ../../library/decimal.rst:1607 msgid "" "Signals represent conditions that arise during computation. Each corresponds " "to one context flag and one context trap enabler." @@ -2136,7 +2467,7 @@ msgstr "" "corresponde a um sinalizador de contexto e um ativador de armadilha de " "contexto." -#: ../../library/decimal.rst:1568 +#: ../../library/decimal.rst:1610 msgid "" "The context flag is set whenever the condition is encountered. After the " "computation, flags may be checked for informational purposes (for instance, " @@ -2149,7 +2480,7 @@ msgstr "" "de verificar os sinalizadores, certifique-se de limpar todos os " "sinalizadores antes de iniciar o próximo cálculo." -#: ../../library/decimal.rst:1573 +#: ../../library/decimal.rst:1615 msgid "" "If the context's trap enabler is set for the signal, then the condition " "causes a Python exception to be raised. For example, if the :class:" @@ -2161,11 +2492,11 @@ msgstr "" "armadilha :class:`DivisionByZero` for configurada, uma exceção :exc:" "`DivisionByZero` será levantada ao encontrar a condição." -#: ../../library/decimal.rst:1581 +#: ../../library/decimal.rst:1623 msgid "Altered an exponent to fit representation constraints." msgstr "Altera um expoente para ajustar as restrições de representação." -#: ../../library/decimal.rst:1583 +#: ../../library/decimal.rst:1625 msgid "" "Typically, clamping occurs when an exponent falls outside the context's :" "attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " @@ -2175,16 +2506,16 @@ msgstr "" "contexto :attr:`~Context.Emin` e :attr:`~Context.Emax`. Se possível, o " "expoente é reduzido para caber adicionando zeros ao coeficiente." -#: ../../library/decimal.rst:1590 +#: ../../library/decimal.rst:1632 msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." msgstr "" "Classe base para outros sinais e uma subclasse de :exc:`ArithmeticError`." -#: ../../library/decimal.rst:1595 +#: ../../library/decimal.rst:1637 msgid "Signals the division of a non-infinite number by zero." msgstr "Sinaliza a divisão de um número não infinito por zero." -#: ../../library/decimal.rst:1597 +#: ../../library/decimal.rst:1639 msgid "" "Can occur with division, modulo division, or when raising a number to a " "negative power. If this signal is not trapped, returns ``Infinity`` or ``-" @@ -2194,11 +2525,11 @@ msgstr "" "potência negativa. Se este sinal não for capturado, retornará ``Infinity`` " "ou ``-Infinity`` com o sinal determinado pelas entradas do cálculo." -#: ../../library/decimal.rst:1604 +#: ../../library/decimal.rst:1646 msgid "Indicates that rounding occurred and the result is not exact." msgstr "Indica que o arredondamento ocorreu e o resultado não é exato." -#: ../../library/decimal.rst:1606 +#: ../../library/decimal.rst:1648 msgid "" "Signals when non-zero digits were discarded during rounding. The rounded " "result is returned. The signal flag or trap is used to detect when results " @@ -2208,11 +2539,11 @@ msgstr "" "arredondamento. O resultado arredondado é retornado. O sinalizador ou " "armadilha de sinal é usado para detectar quando os resultados são inexatos." -#: ../../library/decimal.rst:1613 +#: ../../library/decimal.rst:1655 msgid "An invalid operation was performed." msgstr "Uma operação inválida foi realizada." -#: ../../library/decimal.rst:1615 +#: ../../library/decimal.rst:1657 msgid "" "Indicates that an operation was requested that does not make sense. If not " "trapped, returns ``NaN``. Possible causes include::" @@ -2220,11 +2551,24 @@ msgstr "" "Indica que uma operação foi solicitada que não faz sentido. Se não for " "capturado, retorna ``NaN``. As possíveis causas incluem::" -#: ../../library/decimal.rst:1631 +#: ../../library/decimal.rst:1660 +msgid "" +"Infinity - Infinity\n" +"0 * Infinity\n" +"Infinity / Infinity\n" +"x % 0\n" +"Infinity % x\n" +"sqrt(-x) and x > 0\n" +"0 ** 0\n" +"x ** (non-integer)\n" +"x ** Infinity" +msgstr "" + +#: ../../library/decimal.rst:1673 msgid "Numerical overflow." msgstr "Estouro numérico." -#: ../../library/decimal.rst:1633 +#: ../../library/decimal.rst:1675 msgid "" "Indicates the exponent is larger than :attr:`Context.Emax` after rounding " "has occurred. If not trapped, the result depends on the rounding mode, " @@ -2238,13 +2582,13 @@ msgstr "" "ou arredondando para fora para ``Infinity``. Nos dois casos, :class:" "`Inexact` e :class:`Rounded` também são sinalizados." -#: ../../library/decimal.rst:1642 +#: ../../library/decimal.rst:1684 msgid "Rounding occurred though possibly no information was lost." msgstr "" "O arredondamento ocorreu, embora possivelmente nenhuma informação tenha sido " "perdida." -#: ../../library/decimal.rst:1644 +#: ../../library/decimal.rst:1686 msgid "" "Signaled whenever rounding discards digits; even if those digits are zero " "(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " @@ -2255,12 +2599,12 @@ msgstr "" "capturado, retorna o resultado inalterado. Este sinal é usado para detectar " "a perda de dígitos significativos." -#: ../../library/decimal.rst:1652 +#: ../../library/decimal.rst:1694 msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." msgstr "" "O expoente foi menor que :attr:`~Context.Emin` antes do arredondamento." -#: ../../library/decimal.rst:1654 +#: ../../library/decimal.rst:1696 msgid "" "Occurs when an operation result is subnormal (the exponent is too small). If " "not trapped, returns the result unchanged." @@ -2268,11 +2612,11 @@ msgstr "" "Ocorre quando um resultado da operação é subnormal (o expoente é muito " "pequeno). Se não for capturado, retorna o resultado inalterado." -#: ../../library/decimal.rst:1660 +#: ../../library/decimal.rst:1702 msgid "Numerical underflow with result rounded to zero." msgstr "Estouro negativo numérico com resultado arredondado para zero." -#: ../../library/decimal.rst:1662 +#: ../../library/decimal.rst:1704 msgid "" "Occurs when a subnormal result is pushed to zero by rounding. :class:" "`Inexact` and :class:`Subnormal` are also signaled." @@ -2280,13 +2624,13 @@ msgstr "" "Ocorre quando um resultado subnormal é empurrado para zero arredondando. :" "class:`Inexact` e :class:`Subnormal` também são sinalizados." -#: ../../library/decimal.rst:1668 +#: ../../library/decimal.rst:1710 msgid "Enable stricter semantics for mixing floats and Decimals." msgstr "" "Ativa semânticas mais rigorosas para misturar objetos de float com de " "Decimal." -#: ../../library/decimal.rst:1670 +#: ../../library/decimal.rst:1712 msgid "" "If the signal is not trapped (default), mixing floats and Decimals is " "permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal." @@ -2305,7 +2649,7 @@ msgstr "" "meth:`~decimal.Decimal.from_float` ou :meth:`~decimal.Context." "create_decimal_from_float` não definem o sinalizador." -#: ../../library/decimal.rst:1678 +#: ../../library/decimal.rst:1720 msgid "" "Otherwise (the signal is trapped), only equality comparisons and explicit " "conversions are silent. All other mixed operations raise :exc:" @@ -2315,19 +2659,34 @@ msgstr "" "conversões explícitas são silenciosas. Todas as outras operações mistas " "levantam :exc:`FloatOperation`." -#: ../../library/decimal.rst:1682 +#: ../../library/decimal.rst:1724 msgid "The following table summarizes the hierarchy of signals::" msgstr "A tabela a seguir resume a hierarquia de sinais::" -#: ../../library/decimal.rst:1703 -msgid "Floating Point Notes" +#: ../../library/decimal.rst:1726 +msgid "" +"exceptions.ArithmeticError(exceptions.Exception)\n" +" DecimalException\n" +" Clamped\n" +" DivisionByZero(DecimalException, exceptions.ZeroDivisionError)\n" +" Inexact\n" +" Overflow(Inexact, Rounded)\n" +" Underflow(Inexact, Rounded, Subnormal)\n" +" InvalidOperation\n" +" Rounded\n" +" Subnormal\n" +" FloatOperation(DecimalException, exceptions.TypeError)" +msgstr "" + +#: ../../library/decimal.rst:1745 +msgid "Floating-Point Notes" msgstr "Observações sobre ponto flutuante" -#: ../../library/decimal.rst:1707 +#: ../../library/decimal.rst:1749 msgid "Mitigating round-off error with increased precision" msgstr "Atenuando o erro de arredondamento com maior precisão" -#: ../../library/decimal.rst:1709 +#: ../../library/decimal.rst:1751 msgid "" "The use of decimal floating point eliminates decimal representation error " "(making it possible to represent ``0.1`` exactly); however, some operations " @@ -2339,12 +2698,12 @@ msgstr "" "operações ainda podem sofrer erros de arredondamento quando dígitos " "diferentes de zero excederem a precisão fixa." -#: ../../library/decimal.rst:1713 +#: ../../library/decimal.rst:1755 msgid "" "The effects of round-off error can be amplified by the addition or " "subtraction of nearly offsetting quantities resulting in loss of " "significance. Knuth provides two instructive examples where rounded " -"floating point arithmetic with insufficient precision causes the breakdown " +"floating-point arithmetic with insufficient precision causes the breakdown " "of the associative and distributive properties of addition:" msgstr "" "Os efeitos do erro de arredondamento podem ser amplificados pela adição ou " @@ -2353,7 +2712,26 @@ msgstr "" "de ponto flutuante arredondado com precisão insuficiente causa a quebra das " "propriedades associativas e distributivas da adição:" -#: ../../library/decimal.rst:1737 +#: ../../library/decimal.rst:1761 +msgid "" +"# Examples from Seminumerical Algorithms, Section 4.2.2.\n" +">>> from decimal import Decimal, getcontext\n" +">>> getcontext().prec = 8\n" +"\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.5111111')\n" +">>> u + (v + w)\n" +"Decimal('10')\n" +"\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.01')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" +msgstr "" + +#: ../../library/decimal.rst:1779 msgid "" "The :mod:`decimal` module makes it possible to restore the identities by " "expanding the precision sufficiently to avoid loss of significance:" @@ -2361,11 +2739,27 @@ msgstr "" "O módulo :mod:`decimal` permite restaurar as identidades expandindo a " "precisão o suficiente para evitar perda de significância:" -#: ../../library/decimal.rst:1757 +#: ../../library/decimal.rst:1782 +msgid "" +">>> getcontext().prec = 20\n" +">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" +">>> (u + v) + w\n" +"Decimal('9.51111111')\n" +">>> u + (v + w)\n" +"Decimal('9.51111111')\n" +">>>\n" +">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" +">>> (u*v) + (u*w)\n" +"Decimal('0.0060000')\n" +">>> u * (v+w)\n" +"Decimal('0.0060000')" +msgstr "" + +#: ../../library/decimal.rst:1799 msgid "Special values" msgstr "Valores especiais" -#: ../../library/decimal.rst:1759 +#: ../../library/decimal.rst:1801 msgid "" "The number system for the :mod:`decimal` module provides special values " "including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " @@ -2375,7 +2769,7 @@ msgstr "" "incluindo ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, e dois zeros, " "``+0`` e ``-0``." -#: ../../library/decimal.rst:1763 +#: ../../library/decimal.rst:1805 msgid "" "Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " "they can arise from dividing by zero when the :exc:`DivisionByZero` signal " @@ -2389,7 +2783,7 @@ msgstr "" "`Overflow` não é capturado, o infinito pode resultar do arredondamento além " "dos limites do maior número representável." -#: ../../library/decimal.rst:1768 +#: ../../library/decimal.rst:1810 msgid "" "The infinities are signed (affine) and can be used in arithmetic operations " "where they get treated as very large, indeterminate numbers. For instance, " @@ -2400,7 +2794,7 @@ msgstr "" "Por exemplo, adicionar uma constante ao infinito fornece outro resultado " "infinito." -#: ../../library/decimal.rst:1772 +#: ../../library/decimal.rst:1814 msgid "" "Some operations are indeterminate and return ``NaN``, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " @@ -2419,7 +2813,7 @@ msgstr "" "permite que o cálculo continue enquanto sinaliza resultados específicos como " "inválidos." -#: ../../library/decimal.rst:1780 +#: ../../library/decimal.rst:1822 msgid "" "A variant is ``sNaN`` which signals rather than remaining quiet after every " "operation. This is a useful return value when an invalid result needs to " @@ -2429,7 +2823,7 @@ msgstr "" "cada operação. Esse é um valor de retorno útil quando um resultado inválido " "precisa interromper um cálculo para tratamento especial." -#: ../../library/decimal.rst:1784 +#: ../../library/decimal.rst:1826 msgid "" "The behavior of Python's comparison operators can be a little surprising " "where a ``NaN`` is involved. A test for equality where one of the operands " @@ -2460,7 +2854,7 @@ msgstr "" "com os padrões, use os métodos :meth:`~Decimal.compare` e :meth:`~Decimal." "compare_signal`." -#: ../../library/decimal.rst:1797 +#: ../../library/decimal.rst:1839 msgid "" "The signed zeros can result from calculations that underflow. They keep the " "sign that would have resulted if the calculation had been carried out to " @@ -2472,12 +2866,12 @@ msgstr "" "precisão. Como sua magnitude é zero, os zeros positivos e negativos são " "tratados como iguais e seu sinal é informacional." -#: ../../library/decimal.rst:1802 +#: ../../library/decimal.rst:1844 msgid "" "In addition to the two signed zeros which are distinct yet equal, there are " "various representations of zero with differing precisions yet equivalent in " "value. This takes a bit of getting used to. For an eye accustomed to " -"normalized floating point representations, it is not immediately obvious " +"normalized floating-point representations, it is not immediately obvious " "that the following calculation returns a value equal to zero:" msgstr "" "Além dos dois zeros com sinais que são distintos e iguais, existem várias " @@ -2486,11 +2880,11 @@ msgstr "" "acostumado a representações de ponto flutuante normalizadas, não é " "imediatamente óbvio que o seguinte cálculo retorne um valor igual a zero:" -#: ../../library/decimal.rst:1817 +#: ../../library/decimal.rst:1859 msgid "Working with threads" msgstr "Trabalhando com threads" -#: ../../library/decimal.rst:1819 +#: ../../library/decimal.rst:1861 msgid "" "The :func:`getcontext` function accesses a different :class:`Context` object " "for each thread. Having separate thread contexts means that threads may " @@ -2502,7 +2896,7 @@ msgstr "" "podem fazer alterações (como ``getcontext().prec=10``) sem interferir em " "outras threads." -#: ../../library/decimal.rst:1823 +#: ../../library/decimal.rst:1865 msgid "" "Likewise, the :func:`setcontext` function automatically assigns its target " "to the current thread." @@ -2510,7 +2904,7 @@ msgstr "" "Da mesma forma, a função :func:`setcontext` atribui automaticamente seu alvo " "à thread atual." -#: ../../library/decimal.rst:1826 +#: ../../library/decimal.rst:1868 msgid "" "If :func:`setcontext` has not been called before :func:`getcontext`, then :" "func:`getcontext` will automatically create a new context for use in the " @@ -2520,7 +2914,7 @@ msgstr "" "então :func:`getcontext` criará automaticamente um novo contexto para uso na " "thread atual." -#: ../../library/decimal.rst:1830 +#: ../../library/decimal.rst:1872 msgid "" "The new context is copied from a prototype context called *DefaultContext*. " "To control the defaults so that each thread will use the same values " @@ -2535,11 +2929,27 @@ msgstr "" "condição de corrida entre as threads chamando :func:`getcontext`. Por " "exemplo::" -#: ../../library/decimal.rst:1855 +#: ../../library/decimal.rst:1878 +msgid "" +"# Set applicationwide defaults for all threads about to be launched\n" +"DefaultContext.prec = 12\n" +"DefaultContext.rounding = ROUND_DOWN\n" +"DefaultContext.traps = ExtendedContext.traps.copy()\n" +"DefaultContext.traps[InvalidOperation] = 1\n" +"setcontext(DefaultContext)\n" +"\n" +"# Afterwards, the threads can be started\n" +"t1.start()\n" +"t2.start()\n" +"t3.start()\n" +" . . ." +msgstr "" + +#: ../../library/decimal.rst:1897 msgid "Recipes" msgstr "Receitas" -#: ../../library/decimal.rst:1857 +#: ../../library/decimal.rst:1899 msgid "" "Here are a few recipes that serve as utility functions and that demonstrate " "ways to work with the :class:`Decimal` class::" @@ -2547,11 +2957,160 @@ msgstr "" "Aqui estão algumas receitas que servem como funções utilitárias e que " "demonstram maneiras de trabalhar com a classe :class:`Decimal`::" -#: ../../library/decimal.rst:2012 +#: ../../library/decimal.rst:1902 +msgid "" +"def moneyfmt(value, places=2, curr='', sep=',', dp='.',\n" +" pos='', neg='-', trailneg=''):\n" +" \"\"\"Convert Decimal to a money formatted string.\n" +"\n" +" places: required number of places after the decimal point\n" +" curr: optional currency symbol before the sign (may be blank)\n" +" sep: optional grouping separator (comma, period, space, or blank)\n" +" dp: decimal point indicator (comma or period)\n" +" only specify as blank when places is zero\n" +" pos: optional sign for positive numbers: '+', space or blank\n" +" neg: optional sign for negative numbers: '-', '(', space or blank\n" +" trailneg:optional trailing minus indicator: '-', ')', space or blank\n" +"\n" +" >>> d = Decimal('-1234567.8901')\n" +" >>> moneyfmt(d, curr='$')\n" +" '-$1,234,567.89'\n" +" >>> moneyfmt(d, places=0, sep='.', dp='', neg='', trailneg='-')\n" +" '1.234.568-'\n" +" >>> moneyfmt(d, curr='$', neg='(', trailneg=')')\n" +" '($1,234,567.89)'\n" +" >>> moneyfmt(Decimal(123456789), sep=' ')\n" +" '123 456 789.00'\n" +" >>> moneyfmt(Decimal('-0.02'), neg='<', trailneg='>')\n" +" '<0.02>'\n" +"\n" +" \"\"\"\n" +" q = Decimal(10) ** -places # 2 places --> '0.01'\n" +" sign, digits, exp = value.quantize(q).as_tuple()\n" +" result = []\n" +" digits = list(map(str, digits))\n" +" build, next = result.append, digits.pop\n" +" if sign:\n" +" build(trailneg)\n" +" for i in range(places):\n" +" build(next() if digits else '0')\n" +" if places:\n" +" build(dp)\n" +" if not digits:\n" +" build('0')\n" +" i = 0\n" +" while digits:\n" +" build(next())\n" +" i += 1\n" +" if i == 3 and digits:\n" +" i = 0\n" +" build(sep)\n" +" build(curr)\n" +" build(neg if sign else pos)\n" +" return ''.join(reversed(result))\n" +"\n" +"def pi():\n" +" \"\"\"Compute Pi to the current precision.\n" +"\n" +" >>> print(pi())\n" +" 3.141592653589793238462643383\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2 # extra digits for intermediate steps\n" +" three = Decimal(3) # substitute \"three=3.0\" for regular floats\n" +" lasts, t, s, n, na, d, da = 0, three, 3, 1, 0, 0, 24\n" +" while s != lasts:\n" +" lasts = s\n" +" n, na = n+na, na+8\n" +" d, da = d+da, da+32\n" +" t = (t * n) / d\n" +" s += t\n" +" getcontext().prec -= 2\n" +" return +s # unary plus applies the new precision\n" +"\n" +"def exp(x):\n" +" \"\"\"Return e raised to the power of x. Result type matches input " +"type.\n" +"\n" +" >>> print(exp(Decimal(1)))\n" +" 2.718281828459045235360287471\n" +" >>> print(exp(Decimal(2)))\n" +" 7.389056098930650227230427461\n" +" >>> print(exp(2.0))\n" +" 7.38905609893\n" +" >>> print(exp(2+0j))\n" +" (7.38905609893+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num = 0, 0, 1, 1, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 1\n" +" fact *= i\n" +" num *= x\n" +" s += num / fact\n" +" getcontext().prec -= 2\n" +" return +s\n" +"\n" +"def cos(x):\n" +" \"\"\"Return the cosine of x as measured in radians.\n" +"\n" +" The Taylor series approximation works best for a small value of x.\n" +" For larger values, first compute x = x % (2 * pi).\n" +"\n" +" >>> print(cos(Decimal('0.5')))\n" +" 0.8775825618903727161162815826\n" +" >>> print(cos(0.5))\n" +" 0.87758256189\n" +" >>> print(cos(0.5+0j))\n" +" (0.87758256189+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 2\n" +" fact *= i * (i-1)\n" +" num *= x * x\n" +" sign *= -1\n" +" s += num / fact * sign\n" +" getcontext().prec -= 2\n" +" return +s\n" +"\n" +"def sin(x):\n" +" \"\"\"Return the sine of x as measured in radians.\n" +"\n" +" The Taylor series approximation works best for a small value of x.\n" +" For larger values, first compute x = x % (2 * pi).\n" +"\n" +" >>> print(sin(Decimal('0.5')))\n" +" 0.4794255386042030002732879352\n" +" >>> print(sin(0.5))\n" +" 0.479425538604\n" +" >>> print(sin(0.5+0j))\n" +" (0.479425538604+0j)\n" +"\n" +" \"\"\"\n" +" getcontext().prec += 2\n" +" i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1\n" +" while s != lasts:\n" +" lasts = s\n" +" i += 2\n" +" fact *= i * (i-1)\n" +" num *= x * x\n" +" sign *= -1\n" +" s += num / fact * sign\n" +" getcontext().prec -= 2\n" +" return +s" +msgstr "" + +#: ../../library/decimal.rst:2054 msgid "Decimal FAQ" msgstr "Perguntas frequentes sobre Decimal" -#: ../../library/decimal.rst:2014 +#: ../../library/decimal.rst:2056 msgid "" "Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " "to minimize typing when using the interactive interpreter?" @@ -2559,11 +3118,11 @@ msgstr "" "P. É complicado digitar ``decimal.Decimal('1234.5')``. Existe uma maneira de " "minimizar a digitação ao usar o interpretador interativo?" -#: ../../library/decimal.rst:2017 +#: ../../library/decimal.rst:2059 msgid "A. Some users abbreviate the constructor to just a single letter:" msgstr "R. Alguns usuários abreviam o construtor para apenas uma única letra:" -#: ../../library/decimal.rst:2023 +#: ../../library/decimal.rst:2065 msgid "" "Q. In a fixed-point application with two decimal places, some inputs have " "many places and need to be rounded. Others are not supposed to have excess " @@ -2573,7 +3132,7 @@ msgstr "" "têm muitas casas e precisam ser arredondadas. Outros não devem ter dígitos " "em excesso e precisam ser validados. Quais métodos devem ser usados?" -#: ../../library/decimal.rst:2027 +#: ../../library/decimal.rst:2069 msgid "" "A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " "places. If the :const:`Inexact` trap is set, it is also useful for " @@ -2583,7 +3142,7 @@ msgstr "" "decimais. Se a armadilha :const:`Inexact` estiver configurada, também será " "útil para validação:" -#: ../../library/decimal.rst:2045 +#: ../../library/decimal.rst:2087 msgid "" "Q. Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" @@ -2591,7 +3150,7 @@ msgstr "" "P. Assim que eu tiver entradas de duas casas válidas, como mantenho essa " "invariante em uma aplicação?" -#: ../../library/decimal.rst:2048 +#: ../../library/decimal.rst:2090 msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " @@ -2603,7 +3162,7 @@ msgstr "" "divisão e multiplicação não inteira, alteram o número de casas decimais e " "precisam ser seguidas com uma etapa :meth:`~Decimal.quantize`:" -#: ../../library/decimal.rst:2066 +#: ../../library/decimal.rst:2108 msgid "" "In developing fixed-point applications, it is convenient to define functions " "to handle the :meth:`~Decimal.quantize` step:" @@ -2611,7 +3170,7 @@ msgstr "" "No desenvolvimento de aplicações de ponto fixo, é conveniente definir " "funções para manipular a etapa :meth:`~Decimal.quantize`:" -#: ../../library/decimal.rst:2080 +#: ../../library/decimal.rst:2122 msgid "" "Q. There are many ways to express the same value. The numbers ``200``, " "``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " @@ -2623,7 +3182,7 @@ msgstr "" "precisões. Existe uma maneira de transformá-los em um único valor canônico " "reconhecível?" -#: ../../library/decimal.rst:2085 +#: ../../library/decimal.rst:2127 msgid "" "A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " "single representative:" @@ -2631,11 +3190,11 @@ msgstr "" "R. O método :meth:`~Decimal.normalize` mapeia todos os valores equivalentes " "para um único representativo:" -#: ../../library/decimal.rst:2092 +#: ../../library/decimal.rst:2134 msgid "Q. When does rounding occur in a computation?" msgstr "P. Quando ocorre o arredondamento em um cálculo?" -#: ../../library/decimal.rst:2094 +#: ../../library/decimal.rst:2136 msgid "" "A. It occurs *after* the computation. The philosophy of the decimal " "specification is that numbers are considered exact and are created " @@ -2650,7 +3209,21 @@ msgstr "" "de cálculo com essas entradas exatas e, em seguida, o arredondamento (ou " "outras operações de contexto) é aplicado ao *resultado* do cálculo::" -#: ../../library/decimal.rst:2112 +#: ../../library/decimal.rst:2143 +msgid "" +">>> getcontext().prec = 5\n" +">>> pi = Decimal('3.1415926535') # More than 5 digits\n" +">>> pi # All digits are retained\n" +"Decimal('3.1415926535')\n" +">>> pi + 0 # Rounded after an addition\n" +"Decimal('3.1416')\n" +">>> pi - Decimal('0.00005') # Subtract unrounded numbers, then round\n" +"Decimal('3.1415')\n" +">>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded\n" +"Decimal('3.1416')" +msgstr "" + +#: ../../library/decimal.rst:2154 msgid "" "Q. Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" @@ -2658,7 +3231,7 @@ msgstr "" "P. Alguns valores decimais sempre são exibidas com notação exponencial. " "Existe uma maneira de obter uma representação não exponencial?" -#: ../../library/decimal.rst:2115 +#: ../../library/decimal.rst:2157 msgid "" "A. For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing " @@ -2670,7 +3243,7 @@ msgstr "" "``5.0E+3`` como ``5000`` mantém o valor constante, mas não pode mostrar a " "significância de duas casa do original." -#: ../../library/decimal.rst:2120 +#: ../../library/decimal.rst:2162 msgid "" "If an application does not care about tracking significance, it is easy to " "remove the exponent and trailing zeroes, losing significance, but keeping " @@ -2680,14 +3253,14 @@ msgstr "" "remover o expoente e os zeros à direita, perdendo a significância, mas " "mantendo o valor inalterado:" -#: ../../library/decimal.rst:2130 +#: ../../library/decimal.rst:2172 msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" "P. Existe uma maneira de converter um float comum em um :class:`Decimal`?" -#: ../../library/decimal.rst:2132 +#: ../../library/decimal.rst:2174 msgid "" -"A. Yes, any binary floating point number can be exactly expressed as a " +"A. Yes, any binary floating-point number can be exactly expressed as a " "Decimal though an exact conversion may take more precision than intuition " "would suggest:" msgstr "" @@ -2695,7 +3268,13 @@ msgstr "" "exatamente como um Decimal, embora uma conversão exata possa exigir mais " "precisão do que a intuição sugere:" -#: ../../library/decimal.rst:2141 +#: ../../library/decimal.rst:2178 +msgid "" +">>> Decimal(math.pi)\n" +"Decimal('3.141592653589793115997963468544185161590576171875')" +msgstr "" + +#: ../../library/decimal.rst:2183 msgid "" "Q. Within a complex calculation, how can I make sure that I haven't gotten a " "spurious result because of insufficient precision or rounding anomalies." @@ -2704,7 +3283,7 @@ msgstr "" "resultado falso devido à precisão insuficiente ou a anomalias de " "arredondamento." -#: ../../library/decimal.rst:2144 +#: ../../library/decimal.rst:2186 msgid "" "A. The decimal module makes it easy to test results. A best practice is to " "re-run calculations using greater precision and with various rounding modes. " @@ -2717,7 +3296,7 @@ msgstr "" "insuficiente, problemas no modo de arredondamento, entradas mal " "condicionadas ou um algoritmo numericamente instável." -#: ../../library/decimal.rst:2149 +#: ../../library/decimal.rst:2191 msgid "" "Q. I noticed that context precision is applied to the results of operations " "but not to the inputs. Is there anything to watch out for when mixing " @@ -2727,7 +3306,7 @@ msgstr "" "mas não às entradas. Há algo a observar ao misturar valores de diferentes " "precisões?" -#: ../../library/decimal.rst:2153 +#: ../../library/decimal.rst:2195 msgid "" "A. Yes. The principle is that all values are considered to be exact and so " "is the arithmetic on those values. Only the results are rounded. The " @@ -2741,7 +3320,16 @@ msgstr "" "desvantagem é que os resultados podem parecer estranhos se você esquecer que " "as entradas não foram arredondadas:" -#: ../../library/decimal.rst:2166 +#: ../../library/decimal.rst:2200 +msgid "" +">>> getcontext().prec = 3\n" +">>> Decimal('3.104') + Decimal('2.104')\n" +"Decimal('5.21')\n" +">>> Decimal('3.104') + Decimal('0.000') + Decimal('2.104')\n" +"Decimal('5.20')" +msgstr "" + +#: ../../library/decimal.rst:2208 msgid "" "The solution is either to increase precision or to force rounding of inputs " "using the unary plus operation:" @@ -2749,7 +3337,14 @@ msgstr "" "A solução é aumentar a precisão ou forçar o arredondamento das entradas " "usando a operação unária de mais:" -#: ../../library/decimal.rst:2175 +#: ../../library/decimal.rst:2211 +msgid "" +">>> getcontext().prec = 3\n" +">>> +Decimal('1.23456789') # unary plus triggers rounding\n" +"Decimal('1.23')" +msgstr "" + +#: ../../library/decimal.rst:2217 msgid "" "Alternatively, inputs can be rounded upon creation using the :meth:`Context." "create_decimal` method:" @@ -2757,24 +3352,33 @@ msgstr "" "Como alternativa, as entradas podem ser arredondadas na criação usando o " "método :meth:`Context.create_decimal`:" -#: ../../library/decimal.rst:2181 +#: ../../library/decimal.rst:2223 msgid "Q. Is the CPython implementation fast for large numbers?" msgstr "P. A implementação do CPython é rápida para números grandes?" -#: ../../library/decimal.rst:2183 +#: ../../library/decimal.rst:2225 msgid "" "A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " "the decimal module integrate the high speed `libmpdec `_ library for arbitrary precision " -"correctly rounded decimal floating point arithmetic [#]_. ``libmpdec`` uses " +"correctly rounded decimal floating-point arithmetic [#]_. ``libmpdec`` uses " "`Karatsuba multiplication `_ for medium-sized numbers and the `Number Theoretic " "Transform `_ for very " "large numbers." msgstr "" +"A. Sim. Nas implementações CPython e PyPy3, as versões C/CFFI do módulo " +"decimal integram a biblioteca de alta velocidade `libmpdec `_ para precisão arbitrária " +"de aritmética de ponto flutuante decimal corretamente arredondado [#]_. " +"``libmpdec`` usa a `multiplicação de Karatsuba `_ para números com tamanho médio e a " +"`Transformada Numérica de Fourier `_ para " +"números muito grandes." -#: ../../library/decimal.rst:2193 +#: ../../library/decimal.rst:2235 msgid "" "The context must be adapted for exact arbitrary precision arithmetic. :attr:" "`~Context.Emin` and :attr:`~Context.Emax` should always be set to the " @@ -2786,7 +3390,7 @@ msgstr "" "configurados com os valores máximos, :attr:`~Context.clamp` deve sempre ser " "0 (o padrão). A configuração de :attr:`~Context.prec` requer alguns cuidados." -#: ../../library/decimal.rst:2197 +#: ../../library/decimal.rst:2239 msgid "" "The easiest approach for trying out bignum arithmetic is to use the maximum " "value for :attr:`~Context.prec` as well [#]_::" @@ -2794,7 +3398,15 @@ msgstr "" "A abordagem mais fácil para testar a aritmética do bignum é usar o valor " "máximo para :attr:`~Context.prec` também [#]_::" -#: ../../library/decimal.rst:2206 +#: ../../library/decimal.rst:2242 +msgid "" +">>> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" +">>> x = Decimal(2) ** 256\n" +">>> x / 128\n" +"Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" +msgstr "" + +#: ../../library/decimal.rst:2248 msgid "" "For inexact results, :attr:`MAX_PREC` is far too large on 64-bit platforms " "and the available memory will be insufficient::" @@ -2802,7 +3414,15 @@ msgstr "" "Para resultados inexatos, :attr:`MAX_PREC` é muito grande em plataformas de " "64 bits e a memória disponível será insuficiente::" -#: ../../library/decimal.rst:2214 +#: ../../library/decimal.rst:2251 +msgid "" +">>> Decimal(1) / 3\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"MemoryError" +msgstr "" + +#: ../../library/decimal.rst:2256 msgid "" "On systems with overallocation (e.g. Linux), a more sophisticated approach " "is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose " @@ -2814,7 +3434,31 @@ msgstr "" "Suponha que você tenha 8 GB de RAM e espere 10 operandos simultâneos usando " "no máximo 500 MB cada::" -#: ../../library/decimal.rst:2238 +#: ../../library/decimal.rst:2260 +msgid "" +">>> import sys\n" +">>>\n" +">>> # Maximum number of digits for a single operand using 500MB in 8-byte " +"words\n" +">>> # with 19 digits per word (4-byte and 9 digits for the 32-bit build):\n" +">>> maxdigits = 19 * ((500 * 1024**2) // 8)\n" +">>>\n" +">>> # Check that this works:\n" +">>> c = Context(prec=maxdigits, Emax=MAX_EMAX, Emin=MIN_EMIN)\n" +">>> c.traps[Inexact] = True\n" +">>> setcontext(c)\n" +">>>\n" +">>> # Fill the available precision with nines:\n" +">>> x = Decimal(0).logical_invert() * 9\n" +">>> sys.getsizeof(x)\n" +"524288112\n" +">>> x + 2\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +" decimal.Inexact: []" +msgstr "" + +#: ../../library/decimal.rst:2280 msgid "" "In general (and especially on systems without overallocation), it is " "recommended to estimate even tighter bounds and set the :attr:`Inexact` trap " @@ -2824,7 +3468,7 @@ msgstr "" "estimar limites ainda mais apertados e definir a armadilha :attr:`Inexact` " "se for esperado que todos os cálculos sejam mais precisos." -#: ../../library/decimal.rst:2247 +#: ../../library/decimal.rst:2289 msgid "" "This approach now works for all exact results except for non-integer powers." msgstr "" diff --git a/library/development.po b/library/development.po index 891c2c472..0fd33a9c6 100644 --- a/library/development.po +++ b/library/development.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Raphael Mendonça, 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/devmode.po b/library/devmode.po index 276f41b26..28e5baca9 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# a76d6fb6142d7607ab0526dcbddb02d7_7bf0da0 <3b5fb0f281c8dfb4c0170f2ee2a6cfcf_843623>, 2021 -# Rafael Fontenelle , 2023 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -66,6 +64,11 @@ msgstr "" "A ativação do Modo de Desenvolvimento do Python é semelhante ao comando a " "seguir, mas com efeitos adicionais descritos abaixo::" +#: ../../library/devmode.rst:24 +msgid "" +"PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" +msgstr "" + #: ../../library/devmode.rst:26 msgid "Effects of the Python Development Mode:" msgstr "Efeitos do Modo de Desenvolvimento do Python:" @@ -294,6 +297,20 @@ msgstr "" "Exemplo de um script que conta o número de linhas do arquivo texto " "especificado na linha de comando::" +#: ../../library/devmode.rst:116 +msgid "" +"import sys\n" +"\n" +"def main():\n" +" fp = open(sys.argv[1])\n" +" nlines = len(fp.readlines())\n" +" print(nlines)\n" +" # The file is closed implicitly\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" +msgstr "" + #: ../../library/devmode.rst:127 msgid "" "The script does not close the file explicitly. By default, Python does not " @@ -302,6 +319,12 @@ msgstr "" "O script não fecha o arquivo explicitamente. Por padrão, o Python não emite " "nenhum aviso. Exemplo usando README.txt, que possui 269 linhas:" +#: ../../library/devmode.rst:130 +msgid "" +"$ python script.py README.txt\n" +"269" +msgstr "" + #: ../../library/devmode.rst:135 msgid "" "Enabling the Python Development Mode displays a :exc:`ResourceWarning` " @@ -310,6 +333,16 @@ msgstr "" "A ativação do Modo de Desenvolvimento do Python exibe um aviso :exc:" "`ResourceWarning`:" +#: ../../library/devmode.rst:137 +msgid "" +"$ python -X dev script.py README.txt\n" +"269\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README." +"rst' mode='r' encoding='UTF-8'>\n" +" main()\n" +"ResourceWarning: Enable tracemalloc to get the object allocation traceback" +msgstr "" + #: ../../library/devmode.rst:145 msgid "" "In addition, enabling :mod:`tracemalloc` shows the line where the file was " @@ -318,6 +351,20 @@ msgstr "" "Além disso, ativar :mod:`tracemalloc` mostra a linha em que o arquivo foi " "aberto:" +#: ../../library/devmode.rst:148 +msgid "" +"$ python -X dev -X tracemalloc=5 script.py README.rst\n" +"269\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README." +"rst' mode='r' encoding='UTF-8'>\n" +" main()\n" +"Object allocated at (most recent call last):\n" +" File \"script.py\", lineno 10\n" +" main()\n" +" File \"script.py\", lineno 4\n" +" fp = open(sys.argv[1])" +msgstr "" + #: ../../library/devmode.rst:160 msgid "" "The fix is to close explicitly the file. Example using a context manager::" @@ -325,6 +372,15 @@ msgstr "" "A correção é fechar explicitamente o arquivo. Exemplo usando um gerenciador " "de contexto::" +#: ../../library/devmode.rst:162 +msgid "" +"def main():\n" +" # Close the file explicitly when exiting the with block\n" +" with open(sys.argv[1]) as fp:\n" +" nlines = len(fp.readlines())\n" +" print(nlines)" +msgstr "" + #: ../../library/devmode.rst:168 msgid "" "Not closing a resource explicitly can leave a resource open for way longer " @@ -345,10 +401,30 @@ msgstr "Exemplo de erro de descritor de arquivo inválido" msgid "Script displaying the first line of itself::" msgstr "Script exibindo sua própria primeira linha::" +#: ../../library/devmode.rst:179 +msgid "" +"import os\n" +"\n" +"def main():\n" +" fp = open(__file__)\n" +" firstline = fp.readline()\n" +" print(firstline.rstrip())\n" +" os.close(fp.fileno())\n" +" # The file is closed implicitly\n" +"\n" +"main()" +msgstr "" + #: ../../library/devmode.rst:190 msgid "By default, Python does not emit any warning:" msgstr "Por padrão, o Python não emite qualquer aviso:" +#: ../../library/devmode.rst:192 +msgid "" +"$ python script.py\n" +"import os" +msgstr "" + #: ../../library/devmode.rst:197 msgid "" "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " @@ -357,6 +433,22 @@ msgstr "" "O Modo de Desenvolvimento do Python mostra uma :exc:`ResourceWarning` e " "registra um erro \"Bad file descriptor\" ao finalizar o objeto arquivo:" +#: ../../library/devmode.rst:200 +msgid "" +"$ python -X dev script.py\n" +"import os\n" +"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script." +"py' mode='r' encoding='UTF-8'>\n" +" main()\n" +"ResourceWarning: Enable tracemalloc to get the object allocation traceback\n" +"Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' " +"encoding='UTF-8'>\n" +"Traceback (most recent call last):\n" +" File \"script.py\", line 10, in \n" +" main()\n" +"OSError: [Errno 9] Bad file descriptor" +msgstr "" + #: ../../library/devmode.rst:213 msgid "" "``os.close(fp.fileno())`` closes the file descriptor. When the file object " diff --git a/library/dialog.po b/library/dialog.po index 79688ca04..594507d2d 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# João Porfirio, 2021 -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/difflib.po b/library/difflib.po index b470b2a81..a459b7328 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Marco Rougeth , 2021 -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Marcos Wenneton Araújo , 2021 -# i17obot , 2021 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -444,6 +438,10 @@ msgid "" "ignored. For example, pass::" msgstr "" +#: ../../library/difflib.rst:375 +msgid "lambda x: x in \" \\t\"" +msgstr "" + #: ../../library/difflib.rst:377 msgid "" "if you're comparing lines as sequences of characters, and don't want to " @@ -566,6 +564,13 @@ msgid "" "triples always describe non-adjacent equal blocks." msgstr "" +#: ../../library/difflib.rst:479 +msgid "" +">>> s = SequenceMatcher(None, \"abxcd\", \"abcd\")\n" +">>> s.get_matching_blocks()\n" +"[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" +msgstr "" + #: ../../library/difflib.rst:488 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " @@ -620,6 +625,21 @@ msgstr "" msgid "For example::" msgstr "Por exemplo::" +#: ../../library/difflib.rst:514 +msgid "" +">>> a = \"qabxcd\"\n" +">>> b = \"abycdf\"\n" +">>> s = SequenceMatcher(None, a, b)\n" +">>> for tag, i1, i2, j1, j2 in s.get_opcodes():\n" +"... print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format(\n" +"... tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2]))\n" +"delete a[0:1] --> b[0:0] 'q' --> ''\n" +"equal a[1:3] --> b[0:2] 'ab' --> 'ab'\n" +"replace a[3:4] --> b[2:3] 'x' --> 'y'\n" +"equal a[4:6] --> b[3:5] 'cd' --> 'cd'\n" +"insert a[6:6] --> b[5:6] '' --> 'f'" +msgstr "" + #: ../../library/difflib.rst:529 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" @@ -660,6 +680,14 @@ msgid "" "arguments. For instance::" msgstr "" +#: ../../library/difflib.rst:557 +msgid "" +">>> SequenceMatcher(None, 'tide', 'diet').ratio()\n" +"0.25\n" +">>> SequenceMatcher(None, 'diet', 'tide').ratio()\n" +"0.5" +msgstr "" + #: ../../library/difflib.rst:565 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr "" @@ -834,6 +862,73 @@ msgid "" "This example shows how to use difflib to create a ``diff``-like utility." msgstr "" +#: ../../library/difflib.rst:761 +msgid "" +"\"\"\" Command line interface to difflib.py providing diffs in four " +"formats:\n" +"\n" +"* ndiff: lists every line and highlights interline changes.\n" +"* context: highlights clusters of changes in a before/after format.\n" +"* unified: highlights clusters of changes in an inline format.\n" +"* html: generates side by side comparison with change highlights.\n" +"\n" +"\"\"\"\n" +"\n" +"import sys, os, difflib, argparse\n" +"from datetime import datetime, timezone\n" +"\n" +"def file_mtime(path):\n" +" t = datetime.fromtimestamp(os.stat(path).st_mtime,\n" +" timezone.utc)\n" +" return t.astimezone().isoformat()\n" +"\n" +"def main():\n" +"\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-c', action='store_true', default=False,\n" +" help='Produce a context format diff (default)')\n" +" parser.add_argument('-u', action='store_true', default=False,\n" +" help='Produce a unified format diff')\n" +" parser.add_argument('-m', action='store_true', default=False,\n" +" help='Produce HTML side by side diff '\n" +" '(can use -c and -l in conjunction)')\n" +" parser.add_argument('-n', action='store_true', default=False,\n" +" help='Produce a ndiff format diff')\n" +" parser.add_argument('-l', '--lines', type=int, default=3,\n" +" help='Set number of context lines (default 3)')\n" +" parser.add_argument('fromfile')\n" +" parser.add_argument('tofile')\n" +" options = parser.parse_args()\n" +"\n" +" n = options.lines\n" +" fromfile = options.fromfile\n" +" tofile = options.tofile\n" +"\n" +" fromdate = file_mtime(fromfile)\n" +" todate = file_mtime(tofile)\n" +" with open(fromfile) as ff:\n" +" fromlines = ff.readlines()\n" +" with open(tofile) as tf:\n" +" tolines = tf.readlines()\n" +"\n" +" if options.u:\n" +" diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +" elif options.n:\n" +" diff = difflib.ndiff(fromlines, tolines)\n" +" elif options.m:\n" +" diff = difflib.HtmlDiff().make_file(fromlines,tolines,fromfile," +"tofile,context=options.c,numlines=n)\n" +" else:\n" +" diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, " +"fromdate, todate, n=n)\n" +"\n" +" sys.stdout.writelines(diff)\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" +msgstr "" + #: ../../library/difflib.rst:764 msgid "ndiff example" msgstr "" @@ -841,3 +936,120 @@ msgstr "" #: ../../library/difflib.rst:766 msgid "This example shows how to use :func:`difflib.ndiff`." msgstr "" + +#: ../../library/difflib.rst:768 +msgid "" +"\"\"\"ndiff [-q] file1 file2\n" +" or\n" +"ndiff (-r1 | -r2) < ndiff_output > file1_or_file2\n" +"\n" +"Print a human-friendly file difference report to stdout. Both inter-\n" +"and intra-line differences are noted. In the second form, recreate file1\n" +"(-r1) or file2 (-r2) on stdout, from an ndiff report on stdin.\n" +"\n" +"In the first form, if -q (\"quiet\") is not specified, the first two lines\n" +"of output are\n" +"\n" +"-: file1\n" +"+: file2\n" +"\n" +"Each remaining line begins with a two-letter code:\n" +"\n" +" \"- \" line unique to file1\n" +" \"+ \" line unique to file2\n" +" \" \" line common to both files\n" +" \"? \" line not present in either input file\n" +"\n" +"Lines beginning with \"? \" attempt to guide the eye to intraline\n" +"differences, and were not present in either input file. These lines can be\n" +"confusing if the source files contain tab characters.\n" +"\n" +"The first file can be recovered by retaining only lines that begin with\n" +"\" \" or \"- \", and deleting those 2-character prefixes; use ndiff with -" +"r1.\n" +"\n" +"The second file can be recovered similarly, but by retaining only \" \" " +"and\n" +"\"+ \" lines; use ndiff with -r2; or, on Unix, the second file can be\n" +"recovered by piping the output through\n" +"\n" +" sed -n '/^[+ ] /s/^..//p'\n" +"\"\"\"\n" +"\n" +"__version__ = 1, 7, 0\n" +"\n" +"import difflib, sys\n" +"\n" +"def fail(msg):\n" +" out = sys.stderr.write\n" +" out(msg + \"\\n\\n\")\n" +" out(__doc__)\n" +" return 0\n" +"\n" +"# open a file & return the file object; gripe and return 0 if it\n" +"# couldn't be opened\n" +"def fopen(fname):\n" +" try:\n" +" return open(fname)\n" +" except IOError as detail:\n" +" return fail(\"couldn't open \" + fname + \": \" + str(detail))\n" +"\n" +"# open two files & spray the diff to stdout; return false iff a problem\n" +"def fcompare(f1name, f2name):\n" +" f1 = fopen(f1name)\n" +" f2 = fopen(f2name)\n" +" if not f1 or not f2:\n" +" return 0\n" +"\n" +" a = f1.readlines(); f1.close()\n" +" b = f2.readlines(); f2.close()\n" +" for line in difflib.ndiff(a, b):\n" +" print(line, end=' ')\n" +"\n" +" return 1\n" +"\n" +"# crack args (sys.argv[1:] is normal) & compare;\n" +"# return false iff a problem\n" +"\n" +"def main(args):\n" +" import getopt\n" +" try:\n" +" opts, args = getopt.getopt(args, \"qr:\")\n" +" except getopt.error as detail:\n" +" return fail(str(detail))\n" +" noisy = 1\n" +" qseen = rseen = 0\n" +" for opt, val in opts:\n" +" if opt == \"-q\":\n" +" qseen = 1\n" +" noisy = 0\n" +" elif opt == \"-r\":\n" +" rseen = 1\n" +" whichfile = val\n" +" if qseen and rseen:\n" +" return fail(\"can't specify both -q and -r\")\n" +" if rseen:\n" +" if args:\n" +" return fail(\"no args allowed with -r option\")\n" +" if whichfile in (\"1\", \"2\"):\n" +" restore(whichfile)\n" +" return 1\n" +" return fail(\"-r value must be 1 or 2\")\n" +" if len(args) != 2:\n" +" return fail(\"need 2 filename args\")\n" +" f1name, f2name = args\n" +" if noisy:\n" +" print('-:', f1name)\n" +" print('+:', f2name)\n" +" return fcompare(f1name, f2name)\n" +"\n" +"# read ndiff output from stdin, and print file1 (which=='1') or\n" +"# file2 (which=='2') to stdout\n" +"\n" +"def restore(which):\n" +" restored = difflib.restore(sys.stdin.readlines(), which)\n" +" sys.stdout.writelines(restored)\n" +"\n" +"if __name__ == '__main__':\n" +" main(sys.argv[1:])\n" +msgstr "" diff --git a/library/dis.po b/library/dis.po index 3a3bdc626..076a75e25 100644 --- a/library/dis.po +++ b/library/dis.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Julia Rizza , 2022 -# Marco Rougeth , 2022 -# Danilo Lima , 2023 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -117,6 +111,12 @@ msgstr "" msgid "Example: Given the function :func:`!myfunc`::" msgstr "Exemplo: Dada a função :func:`!myfunc`::" +#: ../../library/dis.rst:56 +msgid "" +"def myfunc(alist):\n" +" return len(alist)" +msgstr "" + #: ../../library/dis.rst:59 msgid "" "the following command can be used to display the disassembly of :func:`!" @@ -125,6 +125,17 @@ msgstr "" "o comando a seguir pode ser usado para mostrar a desconstrução de :func:`!" "myfunc`:" +#: ../../library/dis.rst:62 +msgid "" +">>> dis.dis(myfunc)\n" +" 2 0 RESUME 0\n" +"\n" +" 3 2 LOAD_GLOBAL 1 (NULL + len)\n" +" 12 LOAD_FAST 0 (alist)\n" +" 14 CALL 1\n" +" 22 RETURN_VALUE" +msgstr "" + #: ../../library/dis.rst:72 msgid "(The \"2\" is a line number)." msgstr "(O \"2\" é o número da linha)." @@ -138,6 +149,10 @@ msgid "The :mod:`dis` module can be invoked as a script from the command line:" msgstr "" "O módulo :mod:`dis` pode ser invocado como um script na linha de comando:" +#: ../../library/dis.rst:81 +msgid "python -m dis [-h] [infile]" +msgstr "" + #: ../../library/dis.rst:85 msgid "The following options are accepted:" msgstr "As seguintes opções são aceitas:" @@ -277,6 +292,19 @@ msgstr "Adicionados os parâmetros *show_caches* e *adaptive*." msgid "Example:" msgstr "Exemplo:" +#: ../../library/dis.rst:162 +msgid "" +">>> bytecode = dis.Bytecode(myfunc)\n" +">>> for instr in bytecode:\n" +"... print(instr.opname)\n" +"...\n" +"RESUME\n" +"LOAD_GLOBAL\n" +"LOAD_FAST\n" +"CALL\n" +"RETURN_VALUE" +msgstr "" + #: ../../library/dis.rst:176 msgid "Analysis functions" msgstr "Funções de análise" @@ -642,6 +670,10 @@ msgstr "" msgid "Removes the top-of-stack item::" msgstr "Remove o item no topo da pilha::" +#: ../../library/dis.rst:451 +msgid "STACK.pop()" +msgstr "" + #: ../../library/dis.rst:456 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " @@ -661,10 +693,20 @@ msgstr "" "Coloca o i-ésimo item no topo da pilha sem removê-lo da sua posição " "original::" +#: ../../library/dis.rst:476 +msgid "" +"assert i > 0\n" +"STACK.append(STACK[-i])" +msgstr "" + #: ../../library/dis.rst:484 msgid "Swap the top of the stack with the i-th element::" msgstr "Troca o topo da pilha de lugar com o i-ésimo elemento." +#: ../../library/dis.rst:486 +msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" +msgstr "" + #: ../../library/dis.rst:493 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " @@ -765,16 +807,62 @@ msgid "" msgstr "" "Implementa os operadores binários e locais (depende do valor de *op*)::" +#: ../../library/dis.rst:558 +msgid "" +"rhs = STACK.pop()\n" +"lhs = STACK.pop()\n" +"STACK.append(lhs op rhs)" +msgstr "" + #: ../../library/dis.rst:567 ../../library/dis.rst:576 #: ../../library/dis.rst:586 ../../library/dis.rst:594 #: ../../library/dis.rst:606 ../../library/dis.rst:694 #: ../../library/dis.rst:704 ../../library/dis.rst:714 #: ../../library/dis.rst:934 ../../library/dis.rst:945 -#: ../../library/dis.rst:1045 ../../library/dis.rst:1057 -#: ../../library/dis.rst:1069 +#: ../../library/dis.rst:1049 ../../library/dis.rst:1061 +#: ../../library/dis.rst:1073 msgid "Implements::" msgstr "Implementa::" +#: ../../library/dis.rst:569 +msgid "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"STACK.append(container[key])" +msgstr "" + +#: ../../library/dis.rst:578 +msgid "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"value = STACK.pop()\n" +"container[key] = value" +msgstr "" + +#: ../../library/dis.rst:588 +msgid "" +"key = STACK.pop()\n" +"container = STACK.pop()\n" +"del container[key]" +msgstr "" + +#: ../../library/dis.rst:596 +msgid "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"STACK.append(container[start:end])" +msgstr "" + +#: ../../library/dis.rst:608 +msgid "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"container = STACK.pop()\n" +"values = STACK.pop()\n" +"container[start:end] = value" +msgstr "" + #: ../../library/dis.rst:617 msgid "**Coroutine opcodes**" msgstr "**Opcodes para corrotinas**" @@ -866,18 +954,41 @@ msgstr "" "Resolve os métodos especiais ``__aenter__`` e ``__aexit__`` de " "``STACK[-1]``. Põe na pilha ``__aexit__`` e o resultado de ``__aenter__()``::" +#: ../../library/dis.rst:684 +msgid "STACK.extend((__aexit__, __aenter__())" +msgstr "" + #: ../../library/dis.rst:690 msgid "**Miscellaneous opcodes**" msgstr "**Opcodes genéricos**" +#: ../../library/dis.rst:696 +msgid "" +"item = STACK.pop()\n" +"set.add(STACK[-i], item)" +msgstr "" + #: ../../library/dis.rst:699 msgid "Used to implement set comprehensions." msgstr "Usado para implementar compreensões de conjuntos." +#: ../../library/dis.rst:706 +msgid "" +"item = STACK.pop()\n" +"list.append(STACK[-i], item)" +msgstr "" + #: ../../library/dis.rst:709 msgid "Used to implement list comprehensions." msgstr "Usado para implementar compreensões de lista." +#: ../../library/dis.rst:716 +msgid "" +"value = STACK.pop()\n" +"key = STACK.pop()\n" +"dict.__setitem__(STACK[-i], key, value)" +msgstr "" + #: ../../library/dis.rst:720 msgid "Used to implement dict comprehensions." msgstr "Usado para implementar compreensões de dicionário." @@ -1087,7 +1198,7 @@ msgstr "" "``STACK[-1]``, põe no topo da pilha um :class:`tuple` contendo os valores " "correspondentes. Caso contrário, põe ``None``." -#: ../../library/dis.rst:886 ../../library/dis.rst:1513 +#: ../../library/dis.rst:886 ../../library/dis.rst:1520 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -1124,6 +1235,12 @@ msgstr "" "postos na pilha da direita para a esquerda. Requer que haja exatamente " "*count* valores::" +#: ../../library/dis.rst:909 +msgid "" +"assert(len(STACK[-1]) == count)\n" +"STACK.extend(STACK.pop()[:-count-1:-1])" +msgstr "" + #: ../../library/dis.rst:915 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " @@ -1166,6 +1283,13 @@ msgstr "" "seja, após executar ``a, *b, c = d`` os valores serão armazenados como " "``STACK.extend((a, b, c))``." +#: ../../library/dis.rst:936 +msgid "" +"obj = STACK.pop()\n" +"value = STACK.pop()\n" +"obj.name = value" +msgstr "" + #: ../../library/dis.rst:940 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" @@ -1174,6 +1298,12 @@ msgstr "" "onde *namei* é o índice do nome no :attr:`~codeobject.co_names` do :ref:" "`objeto de código `." +#: ../../library/dis.rst:947 +msgid "" +"obj = STACK.pop()\n" +"del obj.name" +msgstr "" + #: ../../library/dis.rst:950 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" @@ -1223,66 +1353,95 @@ msgstr "" #: ../../library/dis.rst:997 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " -"resulting tuple onto the stack.::" +"resulting tuple onto the stack::" msgstr "" -#: ../../library/dis.rst:1007 +#: ../../library/dis.rst:1000 +msgid "" +"if count == 0:\n" +" value = ()\n" +"else:\n" +" STACK = STACK[:-count]\n" +" value = tuple(STACK[-count:])\n" +"\n" +"STACK.append(value)" +msgstr "" + +#: ../../library/dis.rst:1011 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:1012 +#: ../../library/dis.rst:1016 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:1017 +#: ../../library/dis.rst:1021 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1021 +#: ../../library/dis.rst:1025 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1028 +#: ../../library/dis.rst:1032 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1037 +#: ../../library/dis.rst:1041 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1050 +#: ../../library/dis.rst:1051 +msgid "" +"seq = STACK.pop()\n" +"list.extend(STACK[-i], seq)" +msgstr "" + +#: ../../library/dis.rst:1054 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1062 +#: ../../library/dis.rst:1063 +msgid "" +"seq = STACK.pop()\n" +"set.update(STACK[-i], seq)" +msgstr "" + +#: ../../library/dis.rst:1066 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1074 +#: ../../library/dis.rst:1075 +msgid "" +"map = STACK.pop()\n" +"dict.update(STACK[-i], map)" +msgstr "" + +#: ../../library/dis.rst:1078 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1081 +#: ../../library/dis.rst:1085 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1088 +#: ../../library/dis.rst:1092 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1091 +#: ../../library/dis.rst:1095 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -1293,60 +1452,66 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1099 +#: ../../library/dis.rst:1103 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1106 +#: ../../library/dis.rst:1110 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" -#: ../../library/dis.rst:1110 +#: ../../library/dis.rst:1114 msgid "" "It pops three values from the stack (from top of stack down): - ``self``: " "the first argument to the current method - ``cls``: the class within which " "the current method was defined - the global ``super``" msgstr "" -#: ../../library/dis.rst:1115 +#: ../../library/dis.rst:1119 msgid "" "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " "except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1118 +#: ../../library/dis.rst:1122 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " "it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1122 +#: ../../library/dis.rst:1126 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1130 +#: ../../library/dis.rst:1134 msgid "" "Performs a Boolean operation. The operation name can be found in " -"``cmp_op[opname]``." +"``cmp_op[opname >> 4]``." msgstr "" -#: ../../library/dis.rst:1136 -msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." +#: ../../library/dis.rst:1137 +msgid "" +"The cmp_op index is now stored in the four-highest bits of oparg instead of " +"the four-lowest bits of oparg." msgstr "" #: ../../library/dis.rst:1143 -msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." +msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" #: ../../library/dis.rst:1150 +msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." +msgstr "" + +#: ../../library/dis.rst:1157 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1355,68 +1520,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1158 +#: ../../library/dis.rst:1165 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1165 +#: ../../library/dis.rst:1172 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1170 +#: ../../library/dis.rst:1177 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1177 +#: ../../library/dis.rst:1184 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1184 +#: ../../library/dis.rst:1191 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1187 ../../library/dis.rst:1200 +#: ../../library/dis.rst:1194 ../../library/dis.rst:1207 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1192 ../../library/dis.rst:1205 -#: ../../library/dis.rst:1218 ../../library/dis.rst:1232 +#: ../../library/dis.rst:1199 ../../library/dis.rst:1212 +#: ../../library/dis.rst:1225 ../../library/dis.rst:1239 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1197 +#: ../../library/dis.rst:1204 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1210 +#: ../../library/dis.rst:1217 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1213 ../../library/dis.rst:1227 +#: ../../library/dis.rst:1220 ../../library/dis.rst:1234 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1224 +#: ../../library/dis.rst:1231 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1237 +#: ../../library/dis.rst:1244 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1424,88 +1589,88 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1242 +#: ../../library/dis.rst:1249 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1254 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1249 +#: ../../library/dis.rst:1256 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1255 +#: ../../library/dis.rst:1262 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1257 +#: ../../library/dis.rst:1264 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1263 +#: ../../library/dis.rst:1270 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1271 +#: ../../library/dis.rst:1278 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1279 +#: ../../library/dis.rst:1286 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1284 +#: ../../library/dis.rst:1291 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1289 +#: ../../library/dis.rst:1296 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1297 +#: ../../library/dis.rst:1304 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1300 +#: ../../library/dis.rst:1307 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:1310 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1309 +#: ../../library/dis.rst:1316 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1312 ../../library/dis.rst:1334 -#: ../../library/dis.rst:1345 +#: ../../library/dis.rst:1319 ../../library/dis.rst:1341 +#: ../../library/dis.rst:1352 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: ../../library/dis.rst:1318 +#: ../../library/dis.rst:1325 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1515,94 +1680,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1331 +#: ../../library/dis.rst:1338 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1340 +#: ../../library/dis.rst:1347 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1351 +#: ../../library/dis.rst:1358 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1360 +#: ../../library/dis.rst:1367 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1363 +#: ../../library/dis.rst:1370 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1364 +#: ../../library/dis.rst:1371 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1365 +#: ../../library/dis.rst:1372 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1371 +#: ../../library/dis.rst:1378 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1383 msgid "NULL" msgstr "NULL" -#: ../../library/dis.rst:1377 ../../library/dis.rst:1383 +#: ../../library/dis.rst:1384 ../../library/dis.rst:1390 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1378 +#: ../../library/dis.rst:1385 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1379 ../../library/dis.rst:1386 +#: ../../library/dis.rst:1386 ../../library/dis.rst:1393 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1381 +#: ../../library/dis.rst:1388 msgid "or:" msgstr "" -#: ../../library/dis.rst:1384 +#: ../../library/dis.rst:1391 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1385 +#: ../../library/dis.rst:1392 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1388 +#: ../../library/dis.rst:1395 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1398 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1407 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1614,70 +1779,85 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1415 +#: ../../library/dis.rst:1422 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1424 +#: ../../library/dis.rst:1431 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1433 +#: ../../library/dis.rst:1440 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1443 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1445 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1446 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1440 +#: ../../library/dis.rst:1447 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1448 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1450 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1446 +#: ../../library/dis.rst:1453 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1454 +#: ../../library/dis.rst:1461 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1460 -msgid "if it is 3, implements::" +#: ../../library/dis.rst:1463 +msgid "" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end))" msgstr "" #: ../../library/dis.rst:1467 +msgid "if it is 3, implements::" +msgstr "" + +#: ../../library/dis.rst:1469 +msgid "" +"step = STACK.pop()\n" +"end = STACK.pop()\n" +"start = STACK.pop()\n" +"STACK.append(slice(start, end, step))" +msgstr "" + +#: ../../library/dis.rst:1474 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1472 +#: ../../library/dis.rst:1479 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1685,54 +1865,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1480 +#: ../../library/dis.rst:1487 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1484 +#: ../../library/dis.rst:1491 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1485 +#: ../../library/dis.rst:1492 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1487 +#: ../../library/dis.rst:1494 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1489 +#: ../../library/dis.rst:1496 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1491 +#: ../../library/dis.rst:1498 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1494 +#: ../../library/dis.rst:1501 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1502 +#: ../../library/dis.rst:1509 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1506 +#: ../../library/dis.rst:1513 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1740,257 +1920,265 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1520 +#: ../../library/dis.rst:1527 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1522 +#: ../../library/dis.rst:1529 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1524 +#: ../../library/dis.rst:1531 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1526 +#: ../../library/dis.rst:1533 msgid "``1`` After a ``yield`` expression" msgstr "``1`` Depois de uma expressão ``yield``" -#: ../../library/dis.rst:1527 +#: ../../library/dis.rst:1534 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1528 +#: ../../library/dis.rst:1535 msgid "``3`` After an ``await`` expression" msgstr "``3`` Depois de uma expressão ``await``" -#: ../../library/dis.rst:1535 +#: ../../library/dis.rst:1542 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1551 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1547 +#: ../../library/dis.rst:1554 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1563 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1560 +#: ../../library/dis.rst:1567 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1563 +#: ../../library/dis.rst:1570 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1574 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1575 +#: ../../library/dis.rst:1582 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1579 ../../library/dis.rst:1633 +#: ../../library/dis.rst:1586 ../../library/dis.rst:1640 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 +#: ../../library/dis.rst:1589 ../../library/dis.rst:1643 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 +#: ../../library/dis.rst:1589 ../../library/dis.rst:1643 msgid "Description" msgstr "Descrição" -#: ../../library/dis.rst:1584 +#: ../../library/dis.rst:1591 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1584 ../../library/dis.rst:1638 +#: ../../library/dis.rst:1591 ../../library/dis.rst:1645 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1593 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1593 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1596 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1596 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1599 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1599 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1602 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1595 -msgid "Wraps an aync generator value" +#: ../../library/dis.rst:1602 +msgid "Wraps an async generator value" msgstr "" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1604 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1604 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1600 +#: ../../library/dis.rst:1607 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1600 +#: ../../library/dis.rst:1607 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1609 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1609 msgid "Creates a :class:`typing.TypeVar`" msgstr "Cria um :class:`typing.TypeVar`" -#: ../../library/dis.rst:1604 +#: ../../library/dis.rst:1611 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1604 +#: ../../library/dis.rst:1611 msgid "Creates a :class:`typing.ParamSpec`" msgstr "Cria um :class:`typing.ParamSpec`" -#: ../../library/dis.rst:1607 +#: ../../library/dis.rst:1614 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1607 +#: ../../library/dis.rst:1614 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "Cria um :class:`typing.TypeVarTuple`" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1617 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1617 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1613 +#: ../../library/dis.rst:1620 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1613 +#: ../../library/dis.rst:1620 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1625 +#: ../../library/dis.rst:1632 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1638 +#: ../../library/dis.rst:1635 +msgid "" +"arg2 = STACK.pop()\n" +"arg1 = STACK.pop()\n" +"result = intrinsic2(arg1, arg2)\n" +"STACK.push(result)" +msgstr "" + +#: ../../library/dis.rst:1645 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1640 +#: ../../library/dis.rst:1647 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1640 +#: ../../library/dis.rst:1647 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1644 +#: ../../library/dis.rst:1651 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1644 +#: ../../library/dis.rst:1651 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1647 +#: ../../library/dis.rst:1654 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1647 +#: ../../library/dis.rst:1654 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1651 +#: ../../library/dis.rst:1658 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1651 +#: ../../library/dis.rst:1658 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1658 +#: ../../library/dis.rst:1665 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1667 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1665 +#: ../../library/dis.rst:1672 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1672 +#: ../../library/dis.rst:1679 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1999,76 +2187,76 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1681 +#: ../../library/dis.rst:1688 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1685 +#: ../../library/dis.rst:1692 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1692 +#: ../../library/dis.rst:1699 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1705 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1703 +#: ../../library/dis.rst:1710 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1710 +#: ../../library/dis.rst:1717 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1712 +#: ../../library/dis.rst:1719 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1715 +#: ../../library/dis.rst:1722 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1722 +#: ../../library/dis.rst:1729 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1727 +#: ../../library/dis.rst:1734 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1732 +#: ../../library/dis.rst:1739 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1737 +#: ../../library/dis.rst:1744 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1744 +#: ../../library/dis.rst:1751 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1749 +#: ../../library/dis.rst:1756 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -2076,34 +2264,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1757 +#: ../../library/dis.rst:1764 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1762 +#: ../../library/dis.rst:1769 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1767 +#: ../../library/dis.rst:1774 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1772 +#: ../../library/dis.rst:1779 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1777 +#: ../../library/dis.rst:1784 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1781 +#: ../../library/dis.rst:1788 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1452 +#: ../../library/dis.rst:1459 msgid "built-in function" msgstr "função embutida" -#: ../../library/dis.rst:1452 +#: ../../library/dis.rst:1459 msgid "slice" msgstr "fatia" diff --git a/library/distribution.po b/library/distribution.po index dbb3144e2..55f69f693 100644 --- a/library/distribution.po +++ b/library/distribution.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/doctest.po b/library/doctest.po index f7b8b93c7..bbaa56617 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -4,12 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Marques , 2021 -# Raphael Mendonça, 2023 -# Vitor Buxbaum Orlandi, 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -17,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -80,6 +74,64 @@ msgstr "" msgid "Here's a complete but small example module::" msgstr "Aqui temos um pequeno exemplo, porém, completo::" +#: ../../library/doctest.rst:33 +msgid "" +"\"\"\"\n" +"This is the \"example\" module.\n" +"\n" +"The example module supplies one function, factorial(). For example,\n" +"\n" +">>> factorial(5)\n" +"120\n" +"\"\"\"\n" +"\n" +"def factorial(n):\n" +" \"\"\"Return the factorial of n, an exact integer >= 0.\n" +"\n" +" >>> [factorial(n) for n in range(6)]\n" +" [1, 1, 2, 6, 24, 120]\n" +" >>> factorial(30)\n" +" 265252859812191058636308480000000\n" +" >>> factorial(-1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be >= 0\n" +"\n" +" Factorials of floats are OK, but the float must be an exact integer:\n" +" >>> factorial(30.1)\n" +" Traceback (most recent call last):\n" +" ...\n" +" ValueError: n must be exact integer\n" +" >>> factorial(30.0)\n" +" 265252859812191058636308480000000\n" +"\n" +" It must also not be ridiculously large:\n" +" >>> factorial(1e100)\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +" \"\"\"\n" +"\n" +" import math\n" +" if not n >= 0:\n" +" raise ValueError(\"n must be >= 0\")\n" +" if math.floor(n) != n:\n" +" raise ValueError(\"n must be exact integer\")\n" +" if n+1 == n: # catch a value like 1e300\n" +" raise OverflowError(\"n too large\")\n" +" result = 1\n" +" factor = 2\n" +" while factor <= n:\n" +" result *= factor\n" +" factor += 1\n" +" return result\n" +"\n" +"\n" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" +msgstr "" + #: ../../library/doctest.rst:88 msgid "" "If you run :file:`example.py` directly from the command line, :mod:`doctest` " @@ -88,6 +140,12 @@ msgstr "" "Se executar diretamente :file:`example.py` desde a linha de comando, :mod:" "`doctest` a mágica funcionará:" +#: ../../library/doctest.rst:91 +msgid "" +"$ python example.py\n" +"$" +msgstr "" + #: ../../library/doctest.rst:96 msgid "" "There's no output! That's normal, and it means all the examples worked. " @@ -99,10 +157,43 @@ msgstr "" "mod:`doctest` imprimirá um registro detalhado do que está sendo testando " "imprimindo ainda um resumo no final:" +#: ../../library/doctest.rst:100 +msgid "" +"$ python example.py -v\n" +"Trying:\n" +" factorial(5)\n" +"Expecting:\n" +" 120\n" +"ok\n" +"Trying:\n" +" [factorial(n) for n in range(6)]\n" +"Expecting:\n" +" [1, 1, 2, 6, 24, 120]\n" +"ok" +msgstr "" + #: ../../library/doctest.rst:114 msgid "And so on, eventually ending with:" msgstr "E assim por diante, eventualmente terminando com:" +#: ../../library/doctest.rst:116 +msgid "" +"Trying:\n" +" factorial(1e100)\n" +"Expecting:\n" +" Traceback (most recent call last):\n" +" ...\n" +" OverflowError: n too large\n" +"ok\n" +"2 items passed all tests:\n" +" 1 tests in __main__\n" +" 8 tests in __main__.factorial\n" +"9 tests in 2 items.\n" +"9 passed and 0 failed.\n" +"Test passed.\n" +"$" +msgstr "" + #: ../../library/doctest.rst:133 msgid "" "That's all you need to know to start making productive use of :mod:" @@ -130,6 +221,13 @@ msgstr "" "a maneira como você continuará fazendo isso) é encerrar cada módulo :mod:`!" "M` com::" +#: ../../library/doctest.rst:148 +msgid "" +"if __name__ == \"__main__\":\n" +" import doctest\n" +" doctest.testmod()" +msgstr "" + #: ../../library/doctest.rst:152 msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`." msgstr ":mod:`!doctest` e então examine a docstrings no módulo :mod:`!M`." @@ -142,6 +240,10 @@ msgstr "" "Executar o módulo como um script faz com que os exemplos nas docstrings " "sejam executados e verificados::" +#: ../../library/doctest.rst:157 +msgid "python M.py" +msgstr "" + #: ../../library/doctest.rst:159 msgid "" "This won't display anything unless an example fails, in which case the " @@ -158,6 +260,10 @@ msgstr "" msgid "Run it with the ``-v`` switch instead::" msgstr "Ao invés disso, execute agora com a opção ``-v``::" +#: ../../library/doctest.rst:166 +msgid "python M.py -v" +msgstr "" + #: ../../library/doctest.rst:168 msgid "" "and a detailed report of all examples tried is printed to standard output, " @@ -188,6 +294,10 @@ msgstr "" "pode instruir o interpretador Python a executar o módulo doctest diretamente " "da biblioteca padrão e passar o(s) nome(s) do módulo na linha de comando:" +#: ../../library/doctest.rst:180 +msgid "python -m doctest -v example.py" +msgstr "" + #: ../../library/doctest.rst:182 msgid "" "This will import :file:`example.py` as a standalone module and run :func:" @@ -218,6 +328,12 @@ msgstr "" "Outra aplicação simples do doctest é testar exemplos interativos em um " "arquivo texto. Isso pode ser feito com a função :func:`testfile`::" +#: ../../library/doctest.rst:197 +msgid "" +"import doctest\n" +"doctest.testfile(\"example.txt\")" +msgstr "" + #: ../../library/doctest.rst:200 msgid "" "That short script executes and verifies any interactive Python examples " @@ -231,6 +347,25 @@ msgstr "" "conter um programa Python! Por exemplo, talvez :file:`example.txt` contenha " "isto:" +#: ../../library/doctest.rst:205 +msgid "" +"The ``example`` module\n" +"======================\n" +"\n" +"Using ``factorial``\n" +"-------------------\n" +"\n" +"This is an example text file in reStructuredText format. First import\n" +"``factorial`` from the ``example`` module:\n" +"\n" +" >>> from example import factorial\n" +"\n" +"Now use it:\n" +"\n" +" >>> factorial(6)\n" +" 120" +msgstr "" + #: ../../library/doctest.rst:223 msgid "" "Running ``doctest.testfile(\"example.txt\")`` then finds the error in this " @@ -239,6 +374,17 @@ msgstr "" "Executar ``doctest.testfile(\"example.txt\")`` então encontra o erro nesta " "documentação::" +#: ../../library/doctest.rst:226 +msgid "" +"File \"./example.txt\", line 14, in example.txt\n" +"Failed example:\n" +" factorial(6)\n" +"Expected:\n" +" 120\n" +"Got:\n" +" 720" +msgstr "" + #: ../../library/doctest.rst:234 msgid "" "As with :func:`testmod`, :func:`testfile` won't display anything unless an " @@ -283,6 +429,10 @@ msgstr "" "da biblioteca padrão e passar o(s) nome(s) do(s) arquivo(s) na linha de " "comando::" +#: ../../library/doctest.rst:251 +msgid "python -m doctest -v example.txt" +msgstr "" + #: ../../library/doctest.rst:253 msgid "" "Because the file name does not end with :file:`.py`, :mod:`doctest` infers " @@ -359,6 +509,19 @@ msgid "For example, place this block of code at the top of :file:`example.py`:" msgstr "" "Por exemplo, coloque este bloco de código no topo de :file:`example.py`:" +#: ../../library/doctest.rst:291 +msgid "" +"__test__ = {\n" +" 'numbers': \"\"\"\n" +">>> factorial(6)\n" +"720\n" +"\n" +">>> [factorial(n) for n in range(6)]\n" +"[1, 1, 2, 6, 24, 120]\n" +"\"\"\"\n" +"}" +msgstr "" + #: ../../library/doctest.rst:303 msgid "" "The value of ``example.__test__[\"numbers\"]`` will be treated as a " @@ -396,6 +559,25 @@ msgstr "" "funciona bem, mas o doctest não está tentando fazer uma emulação exata de " "qualquer shell Python específico." +#: ../../library/doctest.rst:323 +msgid "" +">>> # comments are ignored\n" +">>> x = 12\n" +">>> x\n" +"12\n" +">>> if x == 13:\n" +"... print(\"yes\")\n" +"... else:\n" +"... print(\"no\")\n" +"... print(\"NO\")\n" +"... print(\"NO!!!\")\n" +"...\n" +"no\n" +"NO\n" +"NO!!!\n" +">>>" +msgstr "" + #: ../../library/doctest.rst:343 msgid "" "Any expected output must immediately follow the final ``'>>> '`` or ``'... " @@ -468,6 +650,15 @@ msgstr "" "deverá usar uma docstring bruta, que preservará suas barras invertidas " "exatamente como você as digita::" +#: ../../library/doctest.rst:373 +msgid "" +">>> def f(x):\n" +"... r'''Backslashes in a raw docstring: m\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" +msgstr "" + #: ../../library/doctest.rst:379 msgid "" "Otherwise, the backslash will be interpreted as part of the string. For " @@ -480,10 +671,27 @@ msgstr "" "linha. Alternativamente, você pode duplicar cada barra invertida na versão " "doctest (e não usar uma string bruta)::" +#: ../../library/doctest.rst:383 +msgid "" +">>> def f(x):\n" +"... '''Backslashes in a raw docstring: m\\\\n'''\n" +"...\n" +">>> print(f.__doc__)\n" +"Backslashes in a raw docstring: m\\n" +msgstr "" + #: ../../library/doctest.rst:389 msgid "The starting column doesn't matter::" msgstr "A coluna inicial não importa::" +#: ../../library/doctest.rst:391 +msgid "" +">>> assert \"Easy!\"\n" +" >>> import math\n" +" >>> math.floor(1.9)\n" +" 1" +msgstr "" + #: ../../library/doctest.rst:396 msgid "" "and as many leading whitespace characters are stripped from the expected " @@ -546,6 +754,14 @@ msgstr "" msgid "Simple example::" msgstr "Exemplo simples::" +#: ../../library/doctest.rst:430 +msgid "" +">>> [1, 2, 3].remove(42)\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: list.remove(x): x not in list" +msgstr "" + #: ../../library/doctest.rst:435 msgid "" "That doctest succeeds if :exc:`ValueError` is raised, with the ``list." @@ -559,6 +775,12 @@ msgid "" "first line of the example::" msgstr "" +#: ../../library/doctest.rst:442 +msgid "" +"Traceback (most recent call last):\n" +"Traceback (innermost last):" +msgstr "" + #: ../../library/doctest.rst:445 msgid "" "The traceback header is followed by an optional traceback stack, whose " @@ -574,6 +796,16 @@ msgid "" "multi-line detail::" msgstr "" +#: ../../library/doctest.rst:454 +msgid "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" File \"\", line 1, in \n" +"ValueError: multi\n" +" line\n" +"detail" +msgstr "" + #: ../../library/doctest.rst:461 msgid "" "The last three lines (starting with :exc:`ValueError`) are compared against " @@ -587,6 +819,16 @@ msgid "" "as::" msgstr "" +#: ../../library/doctest.rst:467 +msgid "" +">>> raise ValueError('multi\\n line\\ndetail')\n" +"Traceback (most recent call last):\n" +" ...\n" +"ValueError: multi\n" +" line\n" +"detail" +msgstr "" + #: ../../library/doctest.rst:474 msgid "" "Note that tracebacks are treated very specially. In particular, in the " @@ -641,6 +883,15 @@ msgid "" "markers and tildes::" msgstr "" +#: ../../library/doctest.rst:510 +msgid "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ~~^~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" +msgstr "" + #: ../../library/doctest.rst:516 msgid "" "Since the lines showing the position of the error come before the exception " @@ -649,6 +900,15 @@ msgid "" "location::" msgstr "" +#: ../../library/doctest.rst:520 +msgid "" +">>> 1 + None\n" +" File \"\", line 1\n" +" 1 + None\n" +" ^~~~~~~~\n" +"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" +msgstr "" + #: ../../library/doctest.rst:531 msgid "Option Flags" msgstr "Flags opcionais" @@ -730,6 +990,21 @@ msgid "" "these variations will work with the flag specified:" msgstr "" +#: ../../library/doctest.rst:601 +msgid "" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"builtins.Exception: message\n" +"\n" +">>> raise Exception('message')\n" +"Traceback (most recent call last):\n" +"__main__.Exception: message" +msgstr "" + #: ../../library/doctest.rst:615 msgid "" "Note that :const:`ELLIPSIS` can also be used to ignore the details of the " @@ -831,6 +1106,10 @@ msgid "" "be called using the following idiom::" msgstr "" +#: ../../library/doctest.rst:704 +msgid "MY_FLAG = register_optionflag('MY_FLAG')" +msgstr "" + #: ../../library/doctest.rst:714 msgid "Directives" msgstr "" @@ -859,6 +1138,13 @@ msgstr "" msgid "For example, this test passes:" msgstr "Por exemplo, este teste é aprovado:" +#: ../../library/doctest.rst:736 +msgid "" +">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n" +"10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" +msgstr "" + #: ../../library/doctest.rst:743 msgid "" "Without the directive it would fail, both because the actual output doesn't " @@ -867,18 +1153,37 @@ msgid "" "a directive to do so:" msgstr "" +#: ../../library/doctest.rst:748 +msgid "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"[0, 1, ..., 18, 19]" +msgstr "" + #: ../../library/doctest.rst:754 msgid "" "Multiple directives can be used on a single physical line, separated by " "commas:" msgstr "" +#: ../../library/doctest.rst:757 +msgid "" +">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" +msgstr "" + #: ../../library/doctest.rst:763 msgid "" "If multiple directive comments are used for a single example, then they are " "combined:" msgstr "" +#: ../../library/doctest.rst:766 +msgid "" +">>> print(list(range(20))) # doctest: +ELLIPSIS\n" +"... # doctest: +NORMALIZE_WHITESPACE\n" +"[0, 1, ..., 18, 19]" +msgstr "" + #: ../../library/doctest.rst:773 msgid "" "As the previous example shows, you can add ``...`` lines to your example " @@ -886,6 +1191,13 @@ msgid "" "for a directive to comfortably fit on the same line:" msgstr "" +#: ../../library/doctest.rst:777 +msgid "" +">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n" +"... # doctest: +ELLIPSIS\n" +"[0, ..., 4, 10, ..., 19, 30, ..., 39]" +msgstr "" + #: ../../library/doctest.rst:784 msgid "" "Note that since all options are disabled by default, and directives apply " @@ -910,14 +1222,33 @@ msgid "" "test like ::" msgstr "" +#: ../../library/doctest.rst:802 +msgid "" +">>> foo()\n" +"{\"spam\", \"eggs\"}" +msgstr "" + #: ../../library/doctest.rst:805 msgid "is vulnerable! One workaround is to do ::" msgstr "" +#: ../../library/doctest.rst:807 +msgid "" +">>> foo() == {\"spam\", \"eggs\"}\n" +"True" +msgstr "" + #: ../../library/doctest.rst:810 msgid "instead. Another is to do ::" msgstr "" +#: ../../library/doctest.rst:812 +msgid "" +">>> d = sorted(foo())\n" +">>> d\n" +"['eggs', 'spam']" +msgstr "" + #: ../../library/doctest.rst:816 msgid "There are others, but you get the idea." msgstr "" @@ -926,11 +1257,26 @@ msgstr "" msgid "Another bad idea is to print things that embed an object address, like" msgstr "" +#: ../../library/doctest.rst:820 +msgid "" +">>> id(1.0) # certain to fail some of the time \n" +"7948648\n" +">>> class C: pass\n" +">>> C() # the default repr() for instances embeds an address \n" +"" +msgstr "" + #: ../../library/doctest.rst:828 msgid "" "The :const:`ELLIPSIS` directive gives a nice approach for the last example:" msgstr "" +#: ../../library/doctest.rst:830 +msgid "" +">>> C() # doctest: +ELLIPSIS\n" +"" +msgstr "" + #: ../../library/doctest.rst:836 msgid "" "Floating-point numbers are also subject to small output variations across " @@ -938,12 +1284,28 @@ msgid "" "formatting, and C libraries vary widely in quality here. ::" msgstr "" +#: ../../library/doctest.rst:840 +msgid "" +">>> 1./7 # risky\n" +"0.14285714285714285\n" +">>> print(1./7) # safer\n" +"0.142857142857\n" +">>> print(round(1./7, 6)) # much safer\n" +"0.142857" +msgstr "" + #: ../../library/doctest.rst:847 msgid "" "Numbers of the form ``I/2.**J`` are safe across all platforms, and I often " "contrive doctest examples to produce numbers of that form::" msgstr "" +#: ../../library/doctest.rst:850 +msgid "" +">>> 3./4 # utterly safe\n" +"0.75" +msgstr "" + #: ../../library/doctest.rst:853 msgid "" "Simple fractions are also easier for people to understand, and that makes " @@ -1180,6 +1542,17 @@ msgid "" "your test module::" msgstr "" +#: ../../library/doctest.rst:1003 +msgid "" +"import unittest\n" +"import doctest\n" +"import my_module_with_doctests\n" +"\n" +"def load_tests(loader, tests, ignore):\n" +" tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n" +" return tests" +msgstr "" + #: ../../library/doctest.rst:1011 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " @@ -1468,6 +1841,18 @@ msgid "" "following diagram::" msgstr "" +#: ../../library/doctest.rst:1205 +msgid "" +" list of:\n" +"+------+ +---------+\n" +"|module| --DocTestFinder-> | DocTest | --DocTestRunner-> results\n" +"+------+ | ^ +---------+ | ^ (printed)\n" +" | | | Example | | |\n" +" v | | ... | v |\n" +" DocTestParser | Example | OutputChecker\n" +" +---------+" +msgstr "" + #: ../../library/doctest.rst:1218 msgid "DocTest Objects" msgstr "" @@ -1949,10 +2334,56 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" +#: ../../library/doctest.rst:1612 +msgid "" +"\"\"\"\n" +">>> def f(x):\n" +"... g(x*2)\n" +">>> def g(x):\n" +"... print(x+3)\n" +"... import pdb; pdb.set_trace()\n" +">>> f(3)\n" +"9\n" +"\"\"\"" +msgstr "" + #: ../../library/doctest.rst:1622 msgid "Then an interactive Python session may look like this::" msgstr "" +#: ../../library/doctest.rst:1624 +msgid "" +">>> import a, doctest\n" +">>> doctest.testmod(a)\n" +"--Return--\n" +"> (3)g()->None\n" +"-> import pdb; pdb.set_trace()\n" +"(Pdb) list\n" +" 1 def g(x):\n" +" 2 print(x+3)\n" +" 3 -> import pdb; pdb.set_trace()\n" +"[EOF]\n" +"(Pdb) p x\n" +"6\n" +"(Pdb) step\n" +"--Return--\n" +"> (2)f()->None\n" +"-> g(x*2)\n" +"(Pdb) list\n" +" 1 def f(x):\n" +" 2 -> g(x*2)\n" +"[EOF]\n" +"(Pdb) p x\n" +"3\n" +"(Pdb) step\n" +"--Return--\n" +"> (1)?()->None\n" +"-> f(3)\n" +"(Pdb) cont\n" +"(0, 3)\n" +">>>" +msgstr "" + #: ../../library/doctest.rst:1655 msgid "" "Functions that convert doctests to Python code, and possibly run the " @@ -1971,10 +2402,34 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" +#: ../../library/doctest.rst:1668 +msgid "" +"import doctest\n" +"print(doctest.script_from_examples(r\"\"\"\n" +" Set x and y to 1 and 2.\n" +" >>> x, y = 1, 2\n" +"\n" +" Print their sum:\n" +" >>> print(x+y)\n" +" 3\n" +"\"\"\"))" +msgstr "" + #: ../../library/doctest.rst:1678 msgid "displays::" msgstr "" +#: ../../library/doctest.rst:1680 +msgid "" +"# Set x and y to 1 and 2.\n" +"x, y = 1, 2\n" +"#\n" +"# Print their sum:\n" +"print(x+y)\n" +"# Expected:\n" +"## 3" +msgstr "" + #: ../../library/doctest.rst:1688 msgid "" "This function is used internally by other functions (see below), but can " @@ -1996,6 +2451,12 @@ msgid "" "module :file:`a.py` contains a top-level function :func:`!f`, then ::" msgstr "" +#: ../../library/doctest.rst:1704 +msgid "" +"import a, doctest\n" +"print(doctest.testsource(a, \"a.f\"))" +msgstr "" + #: ../../library/doctest.rst:1707 msgid "" "prints a script version of function :func:`!f`'s docstring, with doctests " @@ -2224,6 +2685,24 @@ msgid "" "example of such a test runner::" msgstr "" +#: ../../library/doctest.rst:1880 +msgid "" +"if __name__ == '__main__':\n" +" import doctest\n" +" flags = doctest.REPORT_NDIFF|doctest.FAIL_FAST\n" +" if len(sys.argv) > 1:\n" +" name = sys.argv[1]\n" +" if name in globals():\n" +" obj = globals()[name]\n" +" else:\n" +" obj = __test__[name]\n" +" doctest.run_docstring_examples(obj, globals(), name=name,\n" +" optionflags=flags)\n" +" else:\n" +" fail, total = doctest.testmod(optionflags=flags)\n" +" print(\"{} failures out of {} tests\".format(fail, total))" +msgstr "" + #: ../../library/doctest.rst:1897 msgid "Footnotes" msgstr "Notas de rodapé" diff --git a/library/email.charset.po b/library/email.charset.po index ae3145e3b..5b4dc9e45 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 1c22ad9e9..e0b36150c 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-05 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -31,7 +29,7 @@ msgid "" "`~email.policy.compat32` API" msgstr "" -#: ../../library/email.compat32-message.rst:12 +#: ../../library/email.compat32-message.rst:13 msgid "" "The :class:`Message` class is very similar to the :class:`~email.message." "EmailMessage` class, without the methods added by that class, and with the " @@ -41,11 +39,11 @@ msgid "" "legacy code." msgstr "" -#: ../../library/email.compat32-message.rst:19 +#: ../../library/email.compat32-message.rst:20 msgid "The philosophy and structure of the two classes is otherwise the same." msgstr "" -#: ../../library/email.compat32-message.rst:21 +#: ../../library/email.compat32-message.rst:22 msgid "" "This document describes the behavior under the default (for :class:" "`Message`) policy :attr:`~email.policy.Compat32`. If you are going to use " @@ -53,7 +51,7 @@ msgid "" "class instead." msgstr "" -#: ../../library/email.compat32-message.rst:25 +#: ../../library/email.compat32-message.rst:26 msgid "" "An email message consists of *headers* and a *payload*. Headers must be :" "rfc:`5322` style names and values, where the field name and value are " @@ -65,7 +63,7 @@ msgid "" "`message/rfc822`." msgstr "" -#: ../../library/email.compat32-message.rst:34 +#: ../../library/email.compat32-message.rst:35 msgid "" "The conceptual model provided by a :class:`Message` object is that of an " "ordered dictionary of headers with additional methods for accessing both " @@ -75,7 +73,7 @@ msgid "" "methods must be used to access them." msgstr "" -#: ../../library/email.compat32-message.rst:41 +#: ../../library/email.compat32-message.rst:42 msgid "" "The :class:`Message` pseudo-dictionary is indexed by the header names, which " "must be ASCII values. The values of the dictionary are strings that are " @@ -89,11 +87,11 @@ msgid "" "mimetype:`multipart/\\*` and :mimetype:`message/rfc822`)." msgstr "" -#: ../../library/email.compat32-message.rst:52 +#: ../../library/email.compat32-message.rst:53 msgid "Here are the methods of the :class:`Message` class:" msgstr "" -#: ../../library/email.compat32-message.rst:57 +#: ../../library/email.compat32-message.rst:58 msgid "" "If *policy* is specified (it must be an instance of a :mod:`~email.policy` " "class) use the rules it specifies to update and serialize the representation " @@ -103,11 +101,11 @@ msgid "" "`~email.policy` documentation." msgstr "" -#: ../../library/email.compat32-message.rst:64 +#: ../../library/email.compat32-message.rst:65 msgid "The *policy* keyword argument was added." msgstr "" -#: ../../library/email.compat32-message.rst:69 +#: ../../library/email.compat32-message.rst:70 msgid "" "Return the entire message flattened as a string. When optional *unixfrom* " "is true, the envelope header is included in the returned string. *unixfrom* " @@ -120,15 +118,15 @@ msgid "" "*policy* will be passed to the ``Generator``." msgstr "" -#: ../../library/email.compat32-message.rst:79 -#: ../../library/email.compat32-message.rst:121 +#: ../../library/email.compat32-message.rst:80 +#: ../../library/email.compat32-message.rst:122 msgid "" "Flattening the message may trigger changes to the :class:`Message` if " "defaults need to be filled in to complete the transformation to a string " "(for example, MIME boundaries may be generated or modified)." msgstr "" -#: ../../library/email.compat32-message.rst:83 +#: ../../library/email.compat32-message.rst:84 msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " @@ -138,7 +136,17 @@ msgid "" "method directly. For example::" msgstr "" -#: ../../library/email.compat32-message.rst:97 +#: ../../library/email.compat32-message.rst:91 +msgid "" +"from io import StringIO\n" +"from email.generator import Generator\n" +"fp = StringIO()\n" +"g = Generator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" +msgstr "" + +#: ../../library/email.compat32-message.rst:98 msgid "" "If the message object contains binary data that is not encoded according to " "RFC standards, the non-compliant data will be replaced by unicode \"unknown " @@ -146,17 +154,17 @@ msgid "" "generator.BytesGenerator`.)" msgstr "" -#: ../../library/email.compat32-message.rst:102 +#: ../../library/email.compat32-message.rst:103 msgid "the *policy* keyword argument was added." msgstr "" -#: ../../library/email.compat32-message.rst:107 +#: ../../library/email.compat32-message.rst:108 msgid "" "Equivalent to :meth:`.as_string()`. Allows ``str(msg)`` to produce a string " "containing the formatted message." msgstr "" -#: ../../library/email.compat32-message.rst:113 +#: ../../library/email.compat32-message.rst:114 msgid "" "Return the entire message flattened as a bytes object. When optional " "*unixfrom* is true, the envelope header is included in the returned string. " @@ -166,7 +174,7 @@ msgid "" "specified *policy* will be passed to the ``BytesGenerator``." msgstr "" -#: ../../library/email.compat32-message.rst:125 +#: ../../library/email.compat32-message.rst:126 msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " @@ -176,13 +184,23 @@ msgid "" "flatten` method directly. For example::" msgstr "" -#: ../../library/email.compat32-message.rst:145 +#: ../../library/email.compat32-message.rst:134 +msgid "" +"from io import BytesIO\n" +"from email.generator import BytesGenerator\n" +"fp = BytesIO()\n" +"g = BytesGenerator(fp, mangle_from_=True, maxheaderlen=60)\n" +"g.flatten(msg)\n" +"text = fp.getvalue()" +msgstr "" + +#: ../../library/email.compat32-message.rst:146 msgid "" "Equivalent to :meth:`.as_bytes()`. Allows ``bytes(msg)`` to produce a bytes " "object containing the formatted message." msgstr "" -#: ../../library/email.compat32-message.rst:153 +#: ../../library/email.compat32-message.rst:154 msgid "" "Return ``True`` if the message's payload is a list of sub-\\ :class:" "`Message` objects, otherwise return ``False``. When :meth:`is_multipart` " @@ -193,18 +211,18 @@ msgid "" "return ``True`` when the :class:`Message` is of type ``message/rfc822``.)" msgstr "" -#: ../../library/email.compat32-message.rst:165 +#: ../../library/email.compat32-message.rst:166 msgid "" "Set the message's envelope header to *unixfrom*, which should be a string." msgstr "" -#: ../../library/email.compat32-message.rst:170 +#: ../../library/email.compat32-message.rst:171 msgid "" "Return the message's envelope header. Defaults to ``None`` if the envelope " "header was never set." msgstr "" -#: ../../library/email.compat32-message.rst:176 +#: ../../library/email.compat32-message.rst:177 msgid "" "Add the given *payload* to the current payload, which must be ``None`` or a " "list of :class:`Message` objects before the call. After the call, the " @@ -213,14 +231,14 @@ msgid "" "instead." msgstr "" -#: ../../library/email.compat32-message.rst:182 +#: ../../library/email.compat32-message.rst:183 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content` and the related ``make`` and ``add`` methods." msgstr "" -#: ../../library/email.compat32-message.rst:190 +#: ../../library/email.compat32-message.rst:191 msgid "" "Return the current payload, which will be a list of :class:`Message` objects " "when :meth:`is_multipart` is ``True``, or a string when :meth:`is_multipart` " @@ -228,7 +246,7 @@ msgid "" "modify the message's payload in place." msgstr "" -#: ../../library/email.compat32-message.rst:195 +#: ../../library/email.compat32-message.rst:196 msgid "" "With optional argument *i*, :meth:`get_payload` will return the *i*-th " "element of the payload, counting from zero, if :meth:`is_multipart` is " @@ -238,7 +256,7 @@ msgid "" "exc:`TypeError` is raised." msgstr "" -#: ../../library/email.compat32-message.rst:202 +#: ../../library/email.compat32-message.rst:203 msgid "" "Optional *decode* is a flag indicating whether the payload should be decoded " "or not, according to the :mailheader:`Content-Transfer-Encoding` header. " @@ -254,7 +272,7 @@ msgid "" "or :class:`~email.errors.InvalidBase64CharactersDefect`, respectively)." msgstr "" -#: ../../library/email.compat32-message.rst:216 +#: ../../library/email.compat32-message.rst:217 msgid "" "When *decode* is ``False`` (the default) the body is returned as a string " "without decoding the :mailheader:`Content-Transfer-Encoding`. However, for " @@ -265,7 +283,7 @@ msgid "" "the email package, the body is decoded using the default ASCII charset." msgstr "" -#: ../../library/email.compat32-message.rst:225 +#: ../../library/email.compat32-message.rst:226 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by :meth:`~email.message.EmailMessage." @@ -275,21 +293,21 @@ msgstr "" "sua funcionalidade é substituída por :meth:`~email.message.EmailMessage." "get_content` e :meth:`~email.message.EmailMessage.iter_parts`." -#: ../../library/email.compat32-message.rst:233 +#: ../../library/email.compat32-message.rst:234 msgid "" "Set the entire message object's payload to *payload*. It is the client's " "responsibility to ensure the payload invariants. Optional *charset* sets " "the message's default character set; see :meth:`set_charset` for details." msgstr "" -#: ../../library/email.compat32-message.rst:237 +#: ../../library/email.compat32-message.rst:238 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content`." msgstr "" -#: ../../library/email.compat32-message.rst:244 +#: ../../library/email.compat32-message.rst:245 msgid "" "Set the character set of the payload to *charset*, which can either be a :" "class:`~email.charset.Charset` instance (see :mod:`email.charset`), a string " @@ -300,7 +318,7 @@ msgid "" "Anything else will generate a :exc:`TypeError`." msgstr "" -#: ../../library/email.compat32-message.rst:252 +#: ../../library/email.compat32-message.rst:253 msgid "" "If there is no existing :mailheader:`MIME-Version` header one will be " "added. If there is no existing :mailheader:`Content-Type` header, one will " @@ -317,26 +335,26 @@ msgid "" "not modified." msgstr "" -#: ../../library/email.compat32-message.rst:266 +#: ../../library/email.compat32-message.rst:267 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by the *charset* parameter of the :meth:" "`email.emailmessage.EmailMessage.set_content` method." msgstr "" -#: ../../library/email.compat32-message.rst:274 +#: ../../library/email.compat32-message.rst:275 msgid "" "Return the :class:`~email.charset.Charset` instance associated with the " "message's payload." msgstr "" -#: ../../library/email.compat32-message.rst:277 +#: ../../library/email.compat32-message.rst:278 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class it always returns ``None``." msgstr "" -#: ../../library/email.compat32-message.rst:282 +#: ../../library/email.compat32-message.rst:283 msgid "" "The following methods implement a mapping-like interface for accessing the " "message's :rfc:`2822` headers. Note that there are some semantic " @@ -349,19 +367,19 @@ msgid "" "deleted and then re-added are always appended to the end of the header list." msgstr "" -#: ../../library/email.compat32-message.rst:292 +#: ../../library/email.compat32-message.rst:293 msgid "" "These semantic differences are intentional and are biased toward maximal " "convenience." msgstr "" -#: ../../library/email.compat32-message.rst:295 +#: ../../library/email.compat32-message.rst:296 msgid "" "Note that in all cases, any envelope header present in the message is not " "included in the mapping interface." msgstr "" -#: ../../library/email.compat32-message.rst:298 +#: ../../library/email.compat32-message.rst:299 msgid "" "In a model generated from bytes, any header values that (in contravention of " "the RFCs) contain non-ASCII bytes will, when retrieved through this " @@ -369,25 +387,31 @@ msgid "" "charset of ``unknown-8bit``." msgstr "" -#: ../../library/email.compat32-message.rst:306 +#: ../../library/email.compat32-message.rst:307 msgid "Return the total number of headers, including duplicates." msgstr "" -#: ../../library/email.compat32-message.rst:311 +#: ../../library/email.compat32-message.rst:312 msgid "" "Return ``True`` if the message object has a field named *name*. Matching is " "done case-insensitively and *name* should not include the trailing colon. " "Used for the ``in`` operator, e.g.::" msgstr "" -#: ../../library/email.compat32-message.rst:321 +#: ../../library/email.compat32-message.rst:316 +msgid "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" +msgstr "" + +#: ../../library/email.compat32-message.rst:322 msgid "" "Return the value of the named header field. *name* should not include the " "colon field separator. If the header is missing, ``None`` is returned; a :" "exc:`KeyError` is never raised." msgstr "" -#: ../../library/email.compat32-message.rst:325 +#: ../../library/email.compat32-message.rst:326 msgid "" "Note that if the named field appears more than once in the message's " "headers, exactly which of those field values will be returned is undefined. " @@ -395,59 +419,65 @@ msgid "" "headers." msgstr "" -#: ../../library/email.compat32-message.rst:333 +#: ../../library/email.compat32-message.rst:334 msgid "" "Add a header to the message with field name *name* and value *val*. The " "field is appended to the end of the message's existing fields." msgstr "" -#: ../../library/email.compat32-message.rst:336 +#: ../../library/email.compat32-message.rst:337 msgid "" "Note that this does *not* overwrite or delete any existing header with the " "same name. If you want to ensure that the new header is the only one " "present in the message with field name *name*, delete the field first, e.g.::" msgstr "" -#: ../../library/email.compat32-message.rst:346 +#: ../../library/email.compat32-message.rst:341 +msgid "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" +msgstr "" + +#: ../../library/email.compat32-message.rst:347 msgid "" "Delete all occurrences of the field with name *name* from the message's " "headers. No exception is raised if the named field isn't present in the " "headers." msgstr "" -#: ../../library/email.compat32-message.rst:353 +#: ../../library/email.compat32-message.rst:354 msgid "Return a list of all the message's header field names." msgstr "" -#: ../../library/email.compat32-message.rst:358 +#: ../../library/email.compat32-message.rst:359 msgid "Return a list of all the message's field values." msgstr "" -#: ../../library/email.compat32-message.rst:363 +#: ../../library/email.compat32-message.rst:364 msgid "" "Return a list of 2-tuples containing all the message's field headers and " "values." msgstr "" -#: ../../library/email.compat32-message.rst:369 +#: ../../library/email.compat32-message.rst:370 msgid "" "Return the value of the named header field. This is identical to :meth:" "`~object.__getitem__` except that optional *failobj* is returned if the " "named header is missing (defaults to ``None``)." msgstr "" -#: ../../library/email.compat32-message.rst:373 +#: ../../library/email.compat32-message.rst:374 msgid "Here are some additional useful methods:" msgstr "" -#: ../../library/email.compat32-message.rst:378 +#: ../../library/email.compat32-message.rst:379 msgid "" "Return a list of all the values for the field named *name*. If there are no " "such named headers in the message, *failobj* is returned (defaults to " "``None``)." msgstr "" -#: ../../library/email.compat32-message.rst:385 +#: ../../library/email.compat32-message.rst:386 msgid "" "Extended header setting. This method is similar to :meth:`__setitem__` " "except that additional header parameters can be provided as keyword " @@ -455,7 +485,7 @@ msgid "" "value for the header." msgstr "" -#: ../../library/email.compat32-message.rst:390 +#: ../../library/email.compat32-message.rst:391 msgid "" "For each item in the keyword argument dictionary *_params*, the key is taken " "as the parameter name, with underscores converted to dashes (since dashes " @@ -472,30 +502,49 @@ msgid "" "``None``." msgstr "" -#: ../../library/email.compat32-message.rst:404 +#: ../../library/email.compat32-message.rst:405 msgid "Here's an example::" msgstr "Aqui está um exemplo::" -#: ../../library/email.compat32-message.rst:408 +#: ../../library/email.compat32-message.rst:407 +msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" +msgstr "" + +#: ../../library/email.compat32-message.rst:409 msgid "This will add a header that looks like ::" msgstr "" -#: ../../library/email.compat32-message.rst:412 +#: ../../library/email.compat32-message.rst:411 +msgid "Content-Disposition: attachment; filename=\"bud.gif\"" +msgstr "" + +#: ../../library/email.compat32-message.rst:413 msgid "An example with non-ASCII characters::" msgstr "Um exemplo com caracteres não-ASCII::" -#: ../../library/email.compat32-message.rst:417 +#: ../../library/email.compat32-message.rst:415 +msgid "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" +msgstr "" + +#: ../../library/email.compat32-message.rst:418 msgid "Which produces ::" msgstr "Que produz ::" -#: ../../library/email.compat32-message.rst:424 +#: ../../library/email.compat32-message.rst:420 +msgid "" +"Content-Disposition: attachment; filename*=\"iso-8859-1''Fu%DFballer.ppt\"" +msgstr "" + +#: ../../library/email.compat32-message.rst:425 msgid "" "Replace a header. Replace the first header found in the message that " "matches *_name*, retaining header order and field name case. If no matching " "header was found, a :exc:`KeyError` is raised." msgstr "" -#: ../../library/email.compat32-message.rst:431 +#: ../../library/email.compat32-message.rst:432 msgid "" "Return the message's content type. The returned string is coerced to lower " "case of the form :mimetype:`maintype/subtype`. If there was no :mailheader:" @@ -505,7 +554,7 @@ msgid "" "return a value." msgstr "" -#: ../../library/email.compat32-message.rst:438 +#: ../../library/email.compat32-message.rst:439 msgid "" ":rfc:`2045` defines a message's default type to be :mimetype:`text/plain` " "unless it appears inside a :mimetype:`multipart/digest` container, in which " @@ -514,19 +563,19 @@ msgid "" "the default type be :mimetype:`text/plain`." msgstr "" -#: ../../library/email.compat32-message.rst:447 +#: ../../library/email.compat32-message.rst:448 msgid "" "Return the message's main content type. This is the :mimetype:`maintype` " "part of the string returned by :meth:`get_content_type`." msgstr "" -#: ../../library/email.compat32-message.rst:453 +#: ../../library/email.compat32-message.rst:454 msgid "" "Return the message's sub-content type. This is the :mimetype:`subtype` part " "of the string returned by :meth:`get_content_type`." msgstr "" -#: ../../library/email.compat32-message.rst:459 +#: ../../library/email.compat32-message.rst:460 msgid "" "Return the default content type. Most messages have a default content type " "of :mimetype:`text/plain`, except for messages that are subparts of :" @@ -534,14 +583,14 @@ msgid "" "content type of :mimetype:`message/rfc822`." msgstr "" -#: ../../library/email.compat32-message.rst:467 +#: ../../library/email.compat32-message.rst:468 msgid "" "Set the default content type. *ctype* should either be :mimetype:`text/" "plain` or :mimetype:`message/rfc822`, although this is not enforced. The " "default content type is not stored in the :mailheader:`Content-Type` header." msgstr "" -#: ../../library/email.compat32-message.rst:475 +#: ../../library/email.compat32-message.rst:476 msgid "" "Return the message's :mailheader:`Content-Type` parameters, as a list. The " "elements of the returned list are 2-tuples of key/value pairs, as split on " @@ -551,22 +600,22 @@ msgid "" "`get_param` and is unquoted if optional *unquote* is ``True`` (the default)." msgstr "" -#: ../../library/email.compat32-message.rst:483 +#: ../../library/email.compat32-message.rst:484 msgid "" "Optional *failobj* is the object to return if there is no :mailheader:" "`Content-Type` header. Optional *header* is the header to search instead " "of :mailheader:`Content-Type`." msgstr "" -#: ../../library/email.compat32-message.rst:487 -#: ../../library/email.compat32-message.rst:525 +#: ../../library/email.compat32-message.rst:488 +#: ../../library/email.compat32-message.rst:526 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by the *params* property of the " "individual header objects returned by the header access methods." msgstr "" -#: ../../library/email.compat32-message.rst:495 +#: ../../library/email.compat32-message.rst:496 msgid "" "Return the value of the :mailheader:`Content-Type` header's parameter " "*param* as a string. If the message has no :mailheader:`Content-Type` " @@ -574,13 +623,13 @@ msgid "" "(defaults to ``None``)." msgstr "" -#: ../../library/email.compat32-message.rst:500 +#: ../../library/email.compat32-message.rst:501 msgid "" "Optional *header* if given, specifies the message header to use instead of :" "mailheader:`Content-Type`." msgstr "" -#: ../../library/email.compat32-message.rst:503 +#: ../../library/email.compat32-message.rst:504 msgid "" "Parameter keys are always compared case insensitively. The return value can " "either be a string, or a 3-tuple if the parameter was :rfc:`2231` encoded. " @@ -590,7 +639,7 @@ msgid "" "``us-ascii`` charset. You can usually ignore ``LANGUAGE``." msgstr "" -#: ../../library/email.compat32-message.rst:511 +#: ../../library/email.compat32-message.rst:512 msgid "" "If your application doesn't care whether the parameter was encoded as in :" "rfc:`2231`, you can collapse the parameter value by calling :func:`email." @@ -599,14 +648,20 @@ msgid "" "value is a tuple, or the original string unquoted if it isn't. For example::" msgstr "" -#: ../../library/email.compat32-message.rst:521 +#: ../../library/email.compat32-message.rst:519 +msgid "" +"rawparam = msg.get_param('foo')\n" +"param = email.utils.collapse_rfc2231_value(rawparam)" +msgstr "" + +#: ../../library/email.compat32-message.rst:522 msgid "" "In any case, the parameter value (either the returned string, or the " "``VALUE`` item in the 3-tuple) is always unquoted, unless *unquote* is set " "to ``False``." msgstr "" -#: ../../library/email.compat32-message.rst:534 +#: ../../library/email.compat32-message.rst:535 msgid "" "Set a parameter in the :mailheader:`Content-Type` header. If the parameter " "already exists in the header, its value will be replaced with *value*. If " @@ -615,14 +670,14 @@ msgid "" "value will be appended as per :rfc:`2045`." msgstr "" -#: ../../library/email.compat32-message.rst:540 +#: ../../library/email.compat32-message.rst:541 msgid "" "Optional *header* specifies an alternative header to :mailheader:`Content-" "Type`, and all parameters will be quoted as necessary unless optional " "*requote* is ``False`` (the default is ``True``)." msgstr "" -#: ../../library/email.compat32-message.rst:544 +#: ../../library/email.compat32-message.rst:545 msgid "" "If optional *charset* is specified, the parameter will be encoded according " "to :rfc:`2231`. Optional *language* specifies the RFC 2231 language, " @@ -630,18 +685,18 @@ msgid "" "strings." msgstr "" -#: ../../library/email.compat32-message.rst:549 +#: ../../library/email.compat32-message.rst:550 msgid "" "If *replace* is ``False`` (the default) the header is moved to the end of " "the list of headers. If *replace* is ``True``, the header will be updated " "in place." msgstr "" -#: ../../library/email.compat32-message.rst:553 +#: ../../library/email.compat32-message.rst:554 msgid "``replace`` keyword was added." msgstr "Palavra-chave ``replace`` foi adicionada." -#: ../../library/email.compat32-message.rst:558 +#: ../../library/email.compat32-message.rst:559 msgid "" "Remove the given parameter completely from the :mailheader:`Content-Type` " "header. The header will be re-written in place without the parameter or its " @@ -650,14 +705,14 @@ msgid "" "mailheader:`Content-Type`." msgstr "" -#: ../../library/email.compat32-message.rst:567 +#: ../../library/email.compat32-message.rst:568 msgid "" "Set the main type and subtype for the :mailheader:`Content-Type` header. " "*type* must be a string in the form :mimetype:`maintype/subtype`, otherwise " "a :exc:`ValueError` is raised." msgstr "" -#: ../../library/email.compat32-message.rst:571 +#: ../../library/email.compat32-message.rst:572 msgid "" "This method replaces the :mailheader:`Content-Type` header, keeping all the " "parameters in place. If *requote* is ``False``, this leaves the existing " @@ -665,20 +720,20 @@ msgid "" "default)." msgstr "" -#: ../../library/email.compat32-message.rst:576 +#: ../../library/email.compat32-message.rst:577 msgid "" "An alternative header can be specified in the *header* argument. When the :" "mailheader:`Content-Type` header is set a :mailheader:`MIME-Version` header " "is also added." msgstr "" -#: ../../library/email.compat32-message.rst:580 +#: ../../library/email.compat32-message.rst:581 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by the ``make_`` and ``add_`` methods." msgstr "" -#: ../../library/email.compat32-message.rst:587 +#: ../../library/email.compat32-message.rst:588 msgid "" "Return the value of the ``filename`` parameter of the :mailheader:`Content-" "Disposition` header of the message. If the header does not have a " @@ -688,7 +743,7 @@ msgid "" "always be unquoted as per :func:`email.utils.unquote`." msgstr "" -#: ../../library/email.compat32-message.rst:598 +#: ../../library/email.compat32-message.rst:599 msgid "" "Return the value of the ``boundary`` parameter of the :mailheader:`Content-" "Type` header of the message, or *failobj* if either the header is missing, " @@ -696,7 +751,7 @@ msgid "" "unquoted as per :func:`email.utils.unquote`." msgstr "" -#: ../../library/email.compat32-message.rst:606 +#: ../../library/email.compat32-message.rst:607 msgid "" "Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to " "*boundary*. :meth:`set_boundary` will always quote *boundary* if " @@ -704,7 +759,7 @@ msgid "" "object has no :mailheader:`Content-Type` header." msgstr "" -#: ../../library/email.compat32-message.rst:611 +#: ../../library/email.compat32-message.rst:612 msgid "" "Note that using this method is subtly different than deleting the old :" "mailheader:`Content-Type` header and adding a new one with the new boundary " @@ -714,28 +769,28 @@ msgid "" "the original :mailheader:`Content-Type` header." msgstr "" -#: ../../library/email.compat32-message.rst:621 +#: ../../library/email.compat32-message.rst:622 msgid "" "Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " "coerced to lower case. If there is no :mailheader:`Content-Type` header, or " "if that header has no ``charset`` parameter, *failobj* is returned." msgstr "" -#: ../../library/email.compat32-message.rst:625 +#: ../../library/email.compat32-message.rst:626 msgid "" "Note that this method differs from :meth:`get_charset` which returns the :" "class:`~email.charset.Charset` instance for the default encoding of the " "message body." msgstr "" -#: ../../library/email.compat32-message.rst:631 +#: ../../library/email.compat32-message.rst:632 msgid "" "Return a list containing the character set names in the message. If the " "message is a :mimetype:`multipart`, then the list will contain one element " "for each subpart in the payload, otherwise, it will be a list of length 1." msgstr "" -#: ../../library/email.compat32-message.rst:635 +#: ../../library/email.compat32-message.rst:636 msgid "" "Each item in the list will be a string which is the value of the ``charset`` " "parameter in the :mailheader:`Content-Type` header for the represented " @@ -744,7 +799,7 @@ msgid "" "then that item in the returned list will be *failobj*." msgstr "" -#: ../../library/email.compat32-message.rst:645 +#: ../../library/email.compat32-message.rst:646 msgid "" "Return the lowercased value (without parameters) of the message's :" "mailheader:`Content-Disposition` header if it has one, or ``None``. The " @@ -752,7 +807,7 @@ msgid "" "the message follows :rfc:`2183`." msgstr "" -#: ../../library/email.compat32-message.rst:654 +#: ../../library/email.compat32-message.rst:655 msgid "" "The :meth:`walk` method is an all-purpose generator which can be used to " "iterate over all the parts and subparts of a message object tree, in depth-" @@ -760,13 +815,26 @@ msgid "" "in a ``for`` loop; each iteration returns the next subpart." msgstr "" -#: ../../library/email.compat32-message.rst:659 +#: ../../library/email.compat32-message.rst:660 msgid "" "Here's an example that prints the MIME type of every part of a multipart " "message structure:" msgstr "" -#: ../../library/email.compat32-message.rst:685 +#: ../../library/email.compat32-message.rst:674 +msgid "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" +msgstr "" + +#: ../../library/email.compat32-message.rst:686 msgid "" "``walk`` iterates over the subparts of any part where :meth:`is_multipart` " "returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " @@ -774,21 +842,43 @@ msgid "" "``_structure`` debug helper function:" msgstr "" -#: ../../library/email.compat32-message.rst:712 +#: ../../library/email.compat32-message.rst:692 +msgid "" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" +msgstr "" + +#: ../../library/email.compat32-message.rst:713 msgid "" "Here the ``message`` parts are not ``multiparts``, but they do contain " "subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the " "subparts." msgstr "" -#: ../../library/email.compat32-message.rst:717 +#: ../../library/email.compat32-message.rst:718 msgid "" ":class:`Message` objects can also optionally contain two instance " "attributes, which can be used when generating the plain text of a MIME " "message." msgstr "" -#: ../../library/email.compat32-message.rst:723 +#: ../../library/email.compat32-message.rst:724 msgid "" "The format of a MIME document allows for some text between the blank line " "following the headers, and the first multipart boundary string. Normally, " @@ -798,7 +888,7 @@ msgid "" "can become visible." msgstr "" -#: ../../library/email.compat32-message.rst:730 +#: ../../library/email.compat32-message.rst:731 msgid "" "The *preamble* attribute contains this leading extra-armor text for MIME " "documents. When the :class:`~email.parser.Parser` discovers some text after " @@ -810,26 +900,26 @@ msgid "" "parser` and :mod:`email.generator` for details." msgstr "" -#: ../../library/email.compat32-message.rst:740 +#: ../../library/email.compat32-message.rst:741 msgid "" "Note that if the message object has no preamble, the *preamble* attribute " "will be ``None``." msgstr "" -#: ../../library/email.compat32-message.rst:746 +#: ../../library/email.compat32-message.rst:747 msgid "" "The *epilogue* attribute acts the same way as the *preamble* attribute, " "except that it contains text that appears between the last boundary and the " "end of the message." msgstr "" -#: ../../library/email.compat32-message.rst:750 +#: ../../library/email.compat32-message.rst:751 msgid "" "You do not need to set the epilogue to the empty string in order for the :" "class:`~email.generator.Generator` to print a newline at the end of the file." msgstr "" -#: ../../library/email.compat32-message.rst:757 +#: ../../library/email.compat32-message.rst:758 msgid "" "The *defects* attribute contains a list of all the problems found when " "parsing this message. See :mod:`email.errors` for a detailed description of " diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index 0222d7f9d..17ac513be 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.encoders.po b/library/email.encoders.po index 9653861d0..d6c3ddd1e 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.errors.po b/library/email.errors.po index 90454f6ca..7c080754f 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Flávio Neves, 2022 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -93,19 +92,24 @@ msgid "" "`~email.mime.image.MIMEImage`)." msgstr "" -#: ../../library/email.errors.rst:63 +#: ../../library/email.errors.rst:64 +msgid "" +"Raised when an error occurs when the :mod:`~email.generator` outputs headers." +msgstr "" + +#: ../../library/email.errors.rst:70 msgid "" "This is the base class for all defects found when parsing email messages. It " "is derived from :exc:`ValueError`." msgstr "" -#: ../../library/email.errors.rst:68 +#: ../../library/email.errors.rst:75 msgid "" "This is the base class for all defects found when parsing email headers. It " "is derived from :exc:`MessageDefect`." msgstr "" -#: ../../library/email.errors.rst:71 +#: ../../library/email.errors.rst:78 msgid "" "Here is the list of the defects that the :class:`~email.parser.FeedParser` " "can find while parsing messages. Note that the defects are added to the " @@ -115,59 +119,59 @@ msgid "" "not." msgstr "" -#: ../../library/email.errors.rst:77 +#: ../../library/email.errors.rst:84 msgid "" "All defect classes are subclassed from :class:`email.errors.MessageDefect`." msgstr "" -#: ../../library/email.errors.rst:79 +#: ../../library/email.errors.rst:86 msgid "" ":class:`NoBoundaryInMultipartDefect` -- A message claimed to be a multipart, " "but had no :mimetype:`boundary` parameter." msgstr "" -#: ../../library/email.errors.rst:82 +#: ../../library/email.errors.rst:89 msgid "" ":class:`StartBoundaryNotFoundDefect` -- The start boundary claimed in the :" "mailheader:`Content-Type` header was never found." msgstr "" -#: ../../library/email.errors.rst:85 +#: ../../library/email.errors.rst:92 msgid "" ":class:`CloseBoundaryNotFoundDefect` -- A start boundary was found, but no " "corresponding close boundary was ever found." msgstr "" -#: ../../library/email.errors.rst:90 +#: ../../library/email.errors.rst:97 msgid "" ":class:`FirstHeaderLineIsContinuationDefect` -- The message had a " "continuation line as its first header line." msgstr "" -#: ../../library/email.errors.rst:93 +#: ../../library/email.errors.rst:100 msgid "" ":class:`MisplacedEnvelopeHeaderDefect` - A \"Unix From\" header was found in " "the middle of a header block." msgstr "" -#: ../../library/email.errors.rst:96 +#: ../../library/email.errors.rst:103 msgid "" ":class:`MissingHeaderBodySeparatorDefect` - A line was found while parsing " "headers that had no leading white space but contained no ':'. Parsing " "continues assuming that the line represents the first line of the body." msgstr "" -#: ../../library/email.errors.rst:102 +#: ../../library/email.errors.rst:109 msgid "" ":class:`MalformedHeaderDefect` -- A header was found that was missing a " "colon, or was otherwise malformed." msgstr "" -#: ../../library/email.errors.rst:105 +#: ../../library/email.errors.rst:112 msgid "This defect has not been used for several Python versions." msgstr "" -#: ../../library/email.errors.rst:108 +#: ../../library/email.errors.rst:115 msgid "" ":class:`MultipartInvariantViolationDefect` -- A message claimed to be a :" "mimetype:`multipart`, but no subparts were found. Note that when a message " @@ -176,28 +180,28 @@ msgid "" "`multipart`." msgstr "" -#: ../../library/email.errors.rst:113 +#: ../../library/email.errors.rst:120 msgid "" ":class:`InvalidBase64PaddingDefect` -- When decoding a block of base64 " "encoded bytes, the padding was not correct. Enough padding is added to " "perform the decode, but the resulting decoded bytes may be invalid." msgstr "" -#: ../../library/email.errors.rst:117 +#: ../../library/email.errors.rst:124 msgid "" ":class:`InvalidBase64CharactersDefect` -- When decoding a block of base64 " "encoded bytes, characters outside the base64 alphabet were encountered. The " "characters are ignored, but the resulting decoded bytes may be invalid." msgstr "" -#: ../../library/email.errors.rst:121 +#: ../../library/email.errors.rst:128 msgid "" ":class:`InvalidBase64LengthDefect` -- When decoding a block of base64 " "encoded bytes, the number of non-padding base64 characters was invalid (1 " "more than a multiple of 4). The encoded block was kept as-is." msgstr "" -#: ../../library/email.errors.rst:125 +#: ../../library/email.errors.rst:132 msgid "" ":class:`InvalidDateDefect` -- When decoding an invalid or unparsable date " "field. The original value is kept as-is." diff --git a/library/email.examples.po b/library/email.examples.po index 2ee65bd4b..b8e4b39c7 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -45,6 +44,32 @@ msgstr "" "Primeiro, vamos ver como criar e enviar uma mensagem de texto simples (tanto " "o conteúdo do texto quanto os endereços podem conter caracteres Unicode):" +#: ../../library/email.examples.rst:12 +msgid "" +"# Import smtplib for the actual sending function\n" +"import smtplib\n" +"\n" +"# Import the email modules we'll need\n" +"from email.message import EmailMessage\n" +"\n" +"# Open the plain text file whose name is in textfile for reading.\n" +"with open(textfile) as fp:\n" +" # Create a text/plain message\n" +" msg = EmailMessage()\n" +" msg.set_content(fp.read())\n" +"\n" +"# me == the sender's email address\n" +"# you == the recipient's email address\n" +"msg['Subject'] = f'The contents of {textfile}'\n" +"msg['From'] = me\n" +"msg['To'] = you\n" +"\n" +"# Send the message via our own SMTP server.\n" +"s = smtplib.SMTP('localhost')\n" +"s.send_message(msg)\n" +"s.quit()\n" +msgstr "" + #: ../../library/email.examples.rst:15 msgid "" "Parsing :rfc:`822` headers can easily be done by the using the classes from " @@ -53,6 +78,35 @@ msgstr "" "A análise dos cabeçalhos :rfc:`822` pode ser feita facilmente usando as " "classes do módulo :mod:`~email.parser`:" +#: ../../library/email.examples.rst:18 +msgid "" +"# Import the email modules we'll need\n" +"#from email.parser import BytesParser\n" +"from email.parser import Parser\n" +"from email.policy import default\n" +"\n" +"# If the e-mail headers are in a file, uncomment these two lines:\n" +"# with open(messagefile, 'rb') as fp:\n" +"# headers = BytesParser(policy=default).parse(fp)\n" +"\n" +"# Or for parsing headers in a string (this is an uncommon operation), use:\n" +"headers = Parser(policy=default).parsestr(\n" +" 'From: Foo Bar \\n'\n" +" 'To: \\n'\n" +" 'Subject: Test message\\n'\n" +" '\\n'\n" +" 'Body would go here\\n')\n" +"\n" +"# Now the header items can be accessed as a dictionary:\n" +"print('To: {}'.format(headers['to']))\n" +"print('From: {}'.format(headers['from']))\n" +"print('Subject: {}'.format(headers['subject']))\n" +"\n" +"# You can also access the parts of the addresses:\n" +"print('Recipient username: {}'.format(headers['to'].addresses[0].username))\n" +"print('Sender name: {}'.format(headers['from'].addresses[0].display_name))\n" +msgstr "" + #: ../../library/email.examples.rst:21 msgid "" "Here's an example of how to send a MIME message containing a bunch of family " @@ -61,6 +115,36 @@ msgstr "" "Aqui está um exemplo de como enviar uma mensagem MIME contendo várias fotos " "de família que podem estar em um diretório:" +#: ../../library/email.examples.rst:24 +msgid "" +"# Import smtplib for the actual sending function.\n" +"import smtplib\n" +"\n" +"# Here are the email package modules we'll need.\n" +"from email.message import EmailMessage\n" +"\n" +"# Create the container email message.\n" +"msg = EmailMessage()\n" +"msg['Subject'] = 'Our family reunion'\n" +"# me == the sender's email address\n" +"# family = the list of all recipients' email addresses\n" +"msg['From'] = me\n" +"msg['To'] = ', '.join(family)\n" +"msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" +"\n" +"# Open the files in binary mode. You can also omit the subtype\n" +"# if you want MIMEImage to guess it.\n" +"for file in pngfiles:\n" +" with open(file, 'rb') as fp:\n" +" img_data = fp.read()\n" +" msg.add_attachment(img_data, maintype='image',\n" +" subtype='png')\n" +"\n" +"# Send the email via our own SMTP server.\n" +"with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +msgstr "" + #: ../../library/email.examples.rst:27 msgid "" "Here's an example of how to send the entire contents of a directory as an " @@ -69,6 +153,94 @@ msgstr "" "Aqui está um exemplo de como enviar todo o conteúdo de um diretório como uma " "mensagem de e-mail: [1]_" +#: ../../library/email.examples.rst:30 +msgid "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"Send the contents of a directory as a MIME message.\"\"\"\n" +"\n" +"import os\n" +"import smtplib\n" +"# For guessing MIME type based on file name extension\n" +"import mimetypes\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"from email.message import EmailMessage\n" +"from email.policy import SMTP\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Send the contents of a directory as a MIME message.\n" +"Unless the -o option is given, the email is sent by forwarding to your " +"local\n" +"SMTP server, which then does the normal delivery process. Your local " +"machine\n" +"must be running an SMTP server.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory',\n" +" help=\"\"\"Mail the contents of the specified " +"directory,\n" +" otherwise use the current directory. Only the " +"regular\n" +" files in the directory are sent, and we don't " +"recurse to\n" +" subdirectories.\"\"\")\n" +" parser.add_argument('-o', '--output',\n" +" metavar='FILE',\n" +" help=\"\"\"Print the composed message to FILE " +"instead of\n" +" sending the message to the SMTP server.\"\"\")\n" +" parser.add_argument('-s', '--sender', required=True,\n" +" help='The value of the From: header (required)')\n" +" parser.add_argument('-r', '--recipient', required=True,\n" +" action='append', metavar='RECIPIENT',\n" +" default=[], dest='recipients',\n" +" help='A To: header value (at least one required)')\n" +" args = parser.parse_args()\n" +" directory = args.directory\n" +" if not directory:\n" +" directory = '.'\n" +" # Create the message\n" +" msg = EmailMessage()\n" +" msg['Subject'] = f'Contents of directory {os.path.abspath(directory)}'\n" +" msg['To'] = ', '.join(args.recipients)\n" +" msg['From'] = args.sender\n" +" msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" +"\n" +" for filename in os.listdir(directory):\n" +" path = os.path.join(directory, filename)\n" +" if not os.path.isfile(path):\n" +" continue\n" +" # Guess the content type based on the file's extension. Encoding\n" +" # will be ignored, although we should check for simple things like\n" +" # gzip'd or compressed files.\n" +" ctype, encoding = mimetypes.guess_type(path)\n" +" if ctype is None or encoding is not None:\n" +" # No guess could be made, or the file is encoded (compressed), " +"so\n" +" # use a generic bag-of-bits type.\n" +" ctype = 'application/octet-stream'\n" +" maintype, subtype = ctype.split('/', 1)\n" +" with open(path, 'rb') as fp:\n" +" msg.add_attachment(fp.read(),\n" +" maintype=maintype,\n" +" subtype=subtype,\n" +" filename=filename)\n" +" # Now send or store the message\n" +" if args.output:\n" +" with open(args.output, 'wb') as fp:\n" +" fp.write(msg.as_bytes(policy=SMTP))\n" +" else:\n" +" with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" +msgstr "" + #: ../../library/email.examples.rst:33 msgid "" "Here's an example of how to unpack a MIME message like the one above, into a " @@ -77,6 +249,64 @@ msgstr "" "Aqui está um exemplo de como desempacotar uma mensagem MIME, como a acima, " "para um diretório de arquivos:" +#: ../../library/email.examples.rst:36 +msgid "" +"#!/usr/bin/env python3\n" +"\n" +"\"\"\"Unpack a MIME message into a directory of files.\"\"\"\n" +"\n" +"import os\n" +"import email\n" +"import mimetypes\n" +"\n" +"from email.policy import default\n" +"\n" +"from argparse import ArgumentParser\n" +"\n" +"\n" +"def main():\n" +" parser = ArgumentParser(description=\"\"\"\\\n" +"Unpack a MIME message into a directory of files.\n" +"\"\"\")\n" +" parser.add_argument('-d', '--directory', required=True,\n" +" help=\"\"\"Unpack the MIME message into the named\n" +" directory, which will be created if it doesn't " +"already\n" +" exist.\"\"\")\n" +" parser.add_argument('msgfile')\n" +" args = parser.parse_args()\n" +"\n" +" with open(args.msgfile, 'rb') as fp:\n" +" msg = email.message_from_binary_file(fp, policy=default)\n" +"\n" +" try:\n" +" os.mkdir(args.directory)\n" +" except FileExistsError:\n" +" pass\n" +"\n" +" counter = 1\n" +" for part in msg.walk():\n" +" # multipart/* are just containers\n" +" if part.get_content_maintype() == 'multipart':\n" +" continue\n" +" # Applications should really sanitize the given filename so that an\n" +" # email message can't be used to overwrite important files\n" +" filename = part.get_filename()\n" +" if not filename:\n" +" ext = mimetypes.guess_extension(part.get_content_type())\n" +" if not ext:\n" +" # Use a generic bag-of-bits extension\n" +" ext = '.bin'\n" +" filename = f'part-{counter:03d}{ext}'\n" +" counter += 1\n" +" with open(os.path.join(args.directory, filename), 'wb') as fp:\n" +" fp.write(part.get_payload(decode=True))\n" +"\n" +"\n" +"if __name__ == '__main__':\n" +" main()\n" +msgstr "" + #: ../../library/email.examples.rst:39 msgid "" "Here's an example of how to create an HTML message with an alternative plain " @@ -89,6 +319,69 @@ msgstr "" "interessantes, incluímos uma imagem relacionada na parte html e salvamos uma " "cópia do que vamos enviar para o disco, assim como enviamos." +#: ../../library/email.examples.rst:44 +msgid "" +"#!/usr/bin/env python3\n" +"\n" +"import smtplib\n" +"\n" +"from email.message import EmailMessage\n" +"from email.headerregistry import Address\n" +"from email.utils import make_msgid\n" +"\n" +"# Create the base text message.\n" +"msg = EmailMessage()\n" +"msg['Subject'] = \"Ayons asperges pour le déjeuner\"\n" +"msg['From'] = Address(\"Pepé Le Pew\", \"pepe\", \"example.com\")\n" +"msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", \"example.com\"),\n" +" Address(\"Fabrette Pussycat\", \"fabrette\", \"example.com\"))\n" +"msg.set_content(\"\"\"\\\n" +"Salut!\n" +"\n" +"Cela ressemble à un excellent recipie[1] déjeuner.\n" +"\n" +"[1] http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718\n" +"\n" +"--Pepé\n" +"\"\"\")\n" +"\n" +"# Add the html version. This converts the message into a multipart/" +"alternative\n" +"# container, with the original text message as the first part and the new " +"html\n" +"# message as the second part.\n" +"asparagus_cid = make_msgid()\n" +"msg.add_alternative(\"\"\"\\\n" +"\n" +" \n" +" \n" +"

Salut!

\n" +"

Cela ressemble à un excellent\n" +" \n" +" recipie\n" +" déjeuner.\n" +"

\n" +" \n" +" \n" +"\n" +"\"\"\".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')\n" +"# note that we needed to peel the <> off the msgid for use in the html.\n" +"\n" +"# Now add the related image to the html part.\n" +"with open(\"roasted-asparagus.jpg\", 'rb') as img:\n" +" msg.get_payload()[1].add_related(img.read(), 'image', 'jpeg',\n" +" cid=asparagus_cid)\n" +"\n" +"# Make a local copy of what we are going to send.\n" +"with open('outgoing.msg', 'wb') as f:\n" +" f.write(bytes(msg))\n" +"\n" +"# Send the message via local SMTP server.\n" +"with smtplib.SMTP('localhost') as s:\n" +" s.send_message(msg)\n" +msgstr "" + #: ../../library/email.examples.rst:47 msgid "" "If we were sent the message from the last example, here is one way we could " @@ -97,10 +390,113 @@ msgstr "" "Se nos fosse enviada a mensagem do último exemplo, aqui está uma maneira de " "processá-la:" +#: ../../library/email.examples.rst:50 +msgid "" +"import os\n" +"import sys\n" +"import tempfile\n" +"import mimetypes\n" +"import webbrowser\n" +"\n" +"# Import the email modules we'll need\n" +"from email import policy\n" +"from email.parser import BytesParser\n" +"\n" +"\n" +"def magic_html_parser(html_text, partfiles):\n" +" \"\"\"Return safety-sanitized html linked to partfiles.\n" +"\n" +" Rewrite the href=\"cid:....\" attributes to point to the filenames in " +"partfiles.\n" +" Though not trivial, this should be possible using html.parser.\n" +" \"\"\"\n" +" raise NotImplementedError(\"Add the magic needed\")\n" +"\n" +"\n" +"# In a real program you'd get the filename from the arguments.\n" +"with open('outgoing.msg', 'rb') as fp:\n" +" msg = BytesParser(policy=policy.default).parse(fp)\n" +"\n" +"# Now the header items can be accessed as a dictionary, and any non-ASCII " +"will\n" +"# be converted to unicode:\n" +"print('To:', msg['to'])\n" +"print('From:', msg['from'])\n" +"print('Subject:', msg['subject'])\n" +"\n" +"# If we want to print a preview of the message content, we can extract " +"whatever\n" +"# the least formatted payload is and print the first three lines. Of " +"course,\n" +"# if the message has no plain text part printing the first three lines of " +"html\n" +"# is probably useless, but this is just a conceptual example.\n" +"simplest = msg.get_body(preferencelist=('plain', 'html'))\n" +"print()\n" +"print(''.join(simplest.get_content().splitlines(keepends=True)[:3]))\n" +"\n" +"ans = input(\"View full message?\")\n" +"if ans.lower()[0] == 'n':\n" +" sys.exit()\n" +"\n" +"# We can extract the richest alternative in order to display it:\n" +"richest = msg.get_body()\n" +"partfiles = {}\n" +"if richest['content-type'].maintype == 'text':\n" +" if richest['content-type'].subtype == 'plain':\n" +" for line in richest.get_content().splitlines():\n" +" print(line)\n" +" sys.exit()\n" +" elif richest['content-type'].subtype == 'html':\n" +" body = richest\n" +" else:\n" +" print(\"Don't know how to display {}\".format(richest." +"get_content_type()))\n" +" sys.exit()\n" +"elif richest['content-type'].content_type == 'multipart/related':\n" +" body = richest.get_body(preferencelist=('html'))\n" +" for part in richest.iter_attachments():\n" +" fn = part.get_filename()\n" +" if fn:\n" +" extension = os.path.splitext(part.get_filename())[1]\n" +" else:\n" +" extension = mimetypes.guess_extension(part.get_content_type())\n" +" with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as " +"f:\n" +" f.write(part.get_content())\n" +" # again strip the <> to go from email form of cid to html form.\n" +" partfiles[part['content-id'][1:-1]] = f.name\n" +"else:\n" +" print(\"Don't know how to display {}\".format(richest." +"get_content_type()))\n" +" sys.exit()\n" +"with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:\n" +" f.write(magic_html_parser(body.get_content(), partfiles))\n" +"webbrowser.open(f.name)\n" +"os.remove(f.name)\n" +"for fn in partfiles.values():\n" +" os.remove(fn)\n" +"\n" +"# Of course, there are lots of email messages that could break this simple\n" +"# minded program, but it will handle the most common ones.\n" +msgstr "" + #: ../../library/email.examples.rst:52 msgid "Up to the prompt, the output from the above is:" msgstr "Até o prompt, a saída do comando acima é:" +#: ../../library/email.examples.rst:54 +msgid "" +"To: Penelope Pussycat , Fabrette Pussycat " +"\n" +"From: Pepé Le Pew \n" +"Subject: Ayons asperges pour le déjeuner\n" +"\n" +"Salut!\n" +"\n" +"Cela ressemble à un excellent recipie[1] déjeuner." +msgstr "" + #: ../../library/email.examples.rst:66 msgid "Footnotes" msgstr "Notas de rodapé" diff --git a/library/email.generator.po b/library/email.generator.po index db3fc5954..adffcd9f8 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.header.po b/library/email.header.po index f2fd112ce..422255d22 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -79,6 +78,17 @@ msgid "" "header` module. For example::" msgstr "" +#: ../../library/email.header.rst:40 +msgid "" +">>> from email.message import Message\n" +">>> from email.header import Header\n" +">>> msg = Message()\n" +">>> h = Header('p\\xf6stal', 'iso-8859-1')\n" +">>> msg['Subject'] = h\n" +">>> msg.as_string()\n" +"'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'" +msgstr "" + #: ../../library/email.header.rst:50 msgid "" "Notice here how we wanted the :mailheader:`Subject` field to contain a non-" @@ -122,7 +132,7 @@ msgid "" "The maximum line length can be specified explicitly via *maxlinelen*. For " "splitting the first line to a shorter value (to account for the field header " "which isn't included in *s*, e.g. :mailheader:`Subject`) pass in the name of " -"the field in *header_name*. The default *maxlinelen* is 76, and the default " +"the field in *header_name*. The default *maxlinelen* is 78, and the default " "value for *header_name* is ``None``, meaning it is not taken into account " "for the first line of a long, split header." msgstr "" @@ -273,6 +283,13 @@ msgstr "" msgid "Here's an example::" msgstr "Aqui está um exemplo::" +#: ../../library/email.header.rst:188 +msgid "" +">>> from email.header import decode_header\n" +">>> decode_header('=?iso-8859-1?q?p=F6stal?=')\n" +"[(b'p\\xf6stal', 'iso-8859-1')]" +msgstr "" + #: ../../library/email.header.rst:195 msgid "" "Create a :class:`Header` instance from a sequence of pairs as returned by :" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index 67e88faa5..79db6573e 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -131,6 +129,10 @@ msgid "" "method is called as follows::" msgstr "" +#: ../../library/email.headerregistry.rst:94 +msgid "parse(string, kwds)" +msgstr "" + #: ../../library/email.headerregistry.rst:96 msgid "" "``kwds`` is a dictionary containing one pre-initialized key, ``defects``. " @@ -152,6 +154,13 @@ msgid "" "``BaseHeader`` itself. Such an ``init`` method should look like this::" msgstr "" +#: ../../library/email.headerregistry.rst:110 +msgid "" +"def init(self, /, *args, **kw):\n" +" self._myattr = kw.pop('myattr')\n" +" super().init(*args, **kw)" +msgstr "" + #: ../../library/email.headerregistry.rst:114 msgid "" "That is, anything extra that the specialized class puts in to the ``kwds`` " @@ -215,6 +224,10 @@ msgid "" "``datetime`` according to the :rfc:`5322` rules; that is, it is set to::" msgstr "" +#: ../../library/email.headerregistry.rst:163 +msgid "email.utils.format_datetime(self.datetime)" +msgstr "" + #: ../../library/email.headerregistry.rst:165 msgid "" "When creating a ``DateHeader``, *value* may be :class:`~datetime.datetime` " @@ -222,6 +235,10 @@ msgid "" "does what one would expect::" msgstr "" +#: ../../library/email.headerregistry.rst:169 +msgid "msg['Date'] = datetime(2011, 7, 15, 21)" +msgstr "" + #: ../../library/email.headerregistry.rst:171 msgid "" "Because this is a naive ``datetime`` it will be interpreted as a UTC " @@ -230,6 +247,10 @@ msgid "" "mod:`~email.utils` module::" msgstr "" +#: ../../library/email.headerregistry.rst:176 +msgid "msg['Date'] = utils.localtime()" +msgstr "" + #: ../../library/email.headerregistry.rst:178 msgid "" "This example sets the date header to the current time and date using the " @@ -555,10 +576,18 @@ msgid "" "address is::" msgstr "" +#: ../../library/email.headerregistry.rst:380 +msgid "[display_name] " +msgstr "" + #: ../../library/email.headerregistry.rst:382 msgid "or::" msgstr "ou::" +#: ../../library/email.headerregistry.rst:384 +msgid "username@domain" +msgstr "" + #: ../../library/email.headerregistry.rst:386 msgid "" "where each part must conform to specific syntax rules spelled out in :rfc:" @@ -616,6 +645,10 @@ msgid "" "address group is::" msgstr "" +#: ../../library/email.headerregistry.rst:432 +msgid "display_name: [address-list];" +msgstr "" + #: ../../library/email.headerregistry.rst:434 msgid "" "As a convenience for processing lists of addresses that consist of a mixture " diff --git a/library/email.iterators.po b/library/email.iterators.po index f6b999f68..c3e157549 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -110,6 +110,27 @@ msgstr "" "Imprime uma representação recuada dos tipos de conteúdo da estrutura do " "objeto de mensagem. Por exemplo:" +#: ../../library/email.iterators.rst:57 +msgid "" +">>> msg = email.message_from_file(somefile)\n" +">>> _structure(msg)\n" +"multipart/mixed\n" +" text/plain\n" +" text/plain\n" +" multipart/digest\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" message/rfc822\n" +" text/plain\n" +" text/plain" +msgstr "" + #: ../../library/email.iterators.rst:81 msgid "" "Optional *fp* is a file-like object to print the output to. It must be " diff --git a/library/email.message.po b/library/email.message.po index eba701ae1..6b08e4cfe 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -236,6 +235,12 @@ msgid "" "Used for the ``in`` operator. For example::" msgstr "" +#: ../../library/email.message.rst:185 +msgid "" +"if 'message-id' in myMessage:\n" +" print('Message-ID:', myMessage['message-id'])" +msgstr "" + #: ../../library/email.message.rst:191 msgid "" "Return the value of the named header field. *name* does not include the " @@ -270,6 +275,12 @@ msgid "" "present in the message with field name *name*, delete the field first, e.g.::" msgstr "" +#: ../../library/email.message.rst:213 +msgid "" +"del msg['subject']\n" +"msg['subject'] = 'Python roolz!'" +msgstr "" + #: ../../library/email.message.rst:216 msgid "" "If the :mod:`policy ` defines certain headers to be unique (as " @@ -353,14 +364,28 @@ msgstr "" msgid "Here is an example::" msgstr "Aqui está um exemplo::" +#: ../../library/email.message.rst:289 +msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" +msgstr "" + #: ../../library/email.message.rst:291 msgid "This will add a header that looks like ::" msgstr "" +#: ../../library/email.message.rst:293 +msgid "Content-Disposition: attachment; filename=\"bud.gif\"" +msgstr "" + #: ../../library/email.message.rst:295 msgid "An example of the extended interface with non-ASCII characters::" msgstr "" +#: ../../library/email.message.rst:297 +msgid "" +"msg.add_header('Content-Disposition', 'attachment',\n" +" filename=('iso-8859-1', '', 'Fußballer.ppt'))" +msgstr "" + #: ../../library/email.message.rst:303 msgid "" "Replace a header. Replace the first header found in the message that " @@ -568,6 +593,19 @@ msgid "" "message structure:" msgstr "" +#: ../../library/email.message.rst:491 +msgid "" +">>> for part in msg.walk():\n" +"... print(part.get_content_type())\n" +"multipart/report\n" +"text/plain\n" +"message/delivery-status\n" +"text/plain\n" +"text/plain\n" +"message/rfc822\n" +"text/plain" +msgstr "" + #: ../../library/email.message.rst:503 msgid "" "``walk`` iterates over the subparts of any part where :meth:`is_multipart` " @@ -576,6 +614,29 @@ msgid "" "``_structure`` debug helper function:" msgstr "" +#: ../../library/email.message.rst:509 +msgid "" +">>> from email.iterators import _structure\n" +">>> for part in msg.walk():\n" +"... print(part.get_content_maintype() == 'multipart',\n" +"... part.is_multipart())\n" +"True True\n" +"False False\n" +"False True\n" +"False False\n" +"False False\n" +"False True\n" +"False False\n" +">>> _structure(msg)\n" +"multipart/report\n" +" text/plain\n" +" message/delivery-status\n" +" text/plain\n" +" text/plain\n" +" message/rfc822\n" +" text/plain" +msgstr "" + #: ../../library/email.message.rst:531 msgid "" "Here the ``message`` parts are not ``multiparts``, but they do contain " diff --git a/library/email.mime.po b/library/email.mime.po index 1b81f7a24..85d5a44a7 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.parser.po b/library/email.parser.po index 69cfd2714..9797a2c68 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -333,6 +332,12 @@ msgid "" "interactive Python prompt::" msgstr "" +#: ../../library/email.parser.rst:286 +msgid "" +">>> import email\n" +">>> msg = email.message_from_bytes(myBytes) " +msgstr "" + #: ../../library/email.parser.rst:291 msgid "Additional notes" msgstr "" diff --git a/library/email.po b/library/email.po index bb804f62f..17b449305 100644 --- a/library/email.po +++ b/library/email.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Biagioni de Fazio , 2021 -# Rodrigo Neres , 2021 -# Rafael Fontenelle , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/email.policy.po b/library/email.policy.po index 577802e0b..eeb682bb9 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -130,6 +127,22 @@ msgid "" "system:" msgstr "" +#: ../../library/email.policy.rst:92 +msgid "" +">>> from email import message_from_binary_file\n" +">>> from email.generator import BytesGenerator\n" +">>> from email import policy\n" +">>> from subprocess import Popen, PIPE\n" +">>> with open('mymsg.txt', 'rb') as f:\n" +"... msg = message_from_binary_file(f, policy=policy.default)\n" +"...\n" +">>> p = Popen(['sendmail', msg['To'].addresses[0]], stdin=PIPE)\n" +">>> g = BytesGenerator(p.stdin, policy=msg.policy.clone(linesep='\\r\\n'))\n" +">>> g.flatten(msg)\n" +">>> p.stdin.close()\n" +">>> rc = p.wait()" +msgstr "" + #: ../../library/email.policy.rst:114 msgid "" "Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC " @@ -147,6 +160,14 @@ msgid "" "line separators for the platform on which it is running::" msgstr "" +#: ../../library/email.policy.rst:125 +msgid "" +">>> import os\n" +">>> with open('converted.txt', 'wb') as f:\n" +"... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))\n" +"17" +msgstr "" + #: ../../library/email.policy.rst:130 msgid "" "Policy objects can also be combined using the addition operator, producing a " @@ -154,12 +175,31 @@ msgid "" "the summed objects::" msgstr "" +#: ../../library/email.policy.rst:134 +msgid "" +">>> compat_SMTP = policy.compat32.clone(linesep='\\r\\n')\n" +">>> compat_strict = policy.compat32.clone(raise_on_defect=True)\n" +">>> compat_strict_SMTP = compat_SMTP + compat_strict" +msgstr "" + #: ../../library/email.policy.rst:138 msgid "" "This operation is not commutative; that is, the order in which the objects " "are added matters. To illustrate::" msgstr "" +#: ../../library/email.policy.rst:141 +msgid "" +">>> policy100 = policy.compat32.clone(max_line_length=100)\n" +">>> policy80 = policy.compat32.clone(max_line_length=80)\n" +">>> apolicy = policy100 + policy80\n" +">>> apolicy.max_line_length\n" +"80\n" +">>> apolicy = policy80 + policy100\n" +">>> apolicy.max_line_length\n" +"100" +msgstr "" + #: ../../library/email.policy.rst:153 msgid "" "This is the :term:`abstract base class` for all policy classes. It provides " @@ -255,46 +295,62 @@ msgid "" "`~email.message.Message` is used." msgstr "" -#: ../../library/email.policy.rst:232 +#: ../../library/email.policy.rst:235 +msgid "" +"If ``True`` (the default), the generator will raise :exc:`~email.errors." +"HeaderWriteError` instead of writing a header that is improperly folded or " +"delimited, such that it would be parsed as multiple headers or joined with " +"adjacent data. Such headers can be generated by custom header classes or " +"bugs in the ``email`` module." +msgstr "" + +#: ../../library/email.policy.rst:242 +msgid "" +"As it's a security feature, this defaults to ``True`` even in the :class:" +"`~email.policy.Compat32` policy. For backwards compatible, but unsafe, " +"behavior, it must be set to ``False`` explicitly." +msgstr "" + +#: ../../library/email.policy.rst:250 msgid "" "The following :class:`Policy` method is intended to be called by code using " "the email library to create policy instances with custom settings:" msgstr "" -#: ../../library/email.policy.rst:238 +#: ../../library/email.policy.rst:256 msgid "" "Return a new :class:`Policy` instance whose attributes have the same values " "as the current instance, except where those attributes are given new values " "by the keyword arguments." msgstr "" -#: ../../library/email.policy.rst:243 +#: ../../library/email.policy.rst:261 msgid "" "The remaining :class:`Policy` methods are called by the email package code, " "and are not intended to be called by an application using the email package. " "A custom policy must implement all of these methods." msgstr "" -#: ../../library/email.policy.rst:250 +#: ../../library/email.policy.rst:268 msgid "" "Handle a *defect* found on *obj*. When the email package calls this method, " "*defect* will always be a subclass of :class:`~email.errors.Defect`." msgstr "" -#: ../../library/email.policy.rst:254 +#: ../../library/email.policy.rst:272 msgid "" "The default implementation checks the :attr:`raise_on_defect` flag. If it " "is ``True``, *defect* is raised as an exception. If it is ``False`` (the " "default), *obj* and *defect* are passed to :meth:`register_defect`." msgstr "" -#: ../../library/email.policy.rst:261 +#: ../../library/email.policy.rst:279 msgid "" "Register a *defect* on *obj*. In the email package, *defect* will always be " "a subclass of :class:`~email.errors.Defect`." msgstr "" -#: ../../library/email.policy.rst:264 +#: ../../library/email.policy.rst:282 msgid "" "The default implementation calls the ``append`` method of the ``defects`` " "attribute of *obj*. When the email package calls :attr:`handle_defect`, " @@ -304,11 +360,11 @@ msgid "" "defects in parsed messages will raise unexpected errors." msgstr "" -#: ../../library/email.policy.rst:274 +#: ../../library/email.policy.rst:292 msgid "Return the maximum allowed number of headers named *name*." msgstr "" -#: ../../library/email.policy.rst:276 +#: ../../library/email.policy.rst:294 msgid "" "Called when a header is added to an :class:`~email.message.EmailMessage` or :" "class:`~email.message.Message` object. If the returned value is not ``0`` " @@ -316,7 +372,7 @@ msgid "" "greater than or equal to the value returned, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/email.policy.rst:282 +#: ../../library/email.policy.rst:300 msgid "" "Because the default behavior of ``Message.__setitem__`` is to append the " "value to the list of headers, it is easy to create duplicate headers without " @@ -326,11 +382,11 @@ msgid "" "faithfully produce as many headers as exist in the message being parsed.)" msgstr "" -#: ../../library/email.policy.rst:290 +#: ../../library/email.policy.rst:308 msgid "The default implementation returns ``None`` for all header names." msgstr "" -#: ../../library/email.policy.rst:295 +#: ../../library/email.policy.rst:313 msgid "" "The email package calls this method with a list of strings, each string " "ending with the line separation characters found in the source being " @@ -340,7 +396,7 @@ msgid "" "the parsed header." msgstr "" -#: ../../library/email.policy.rst:302 +#: ../../library/email.policy.rst:320 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, *name* should be the case preserved name (all characters " @@ -349,16 +405,16 @@ msgid "" "stripped of leading whitespace." msgstr "" -#: ../../library/email.policy.rst:308 +#: ../../library/email.policy.rst:326 msgid "*sourcelines* may contain surrogateescaped binary data." msgstr "" -#: ../../library/email.policy.rst:310 ../../library/email.policy.rst:326 -#: ../../library/email.policy.rst:342 +#: ../../library/email.policy.rst:328 ../../library/email.policy.rst:344 +#: ../../library/email.policy.rst:360 msgid "There is no default implementation" msgstr "" -#: ../../library/email.policy.rst:315 +#: ../../library/email.policy.rst:333 msgid "" "The email package calls this method with the name and value provided by the " "application program when the application program is modifying a ``Message`` " @@ -367,14 +423,14 @@ msgid "" "``Message`` to represent the header." msgstr "" -#: ../../library/email.policy.rst:321 +#: ../../library/email.policy.rst:339 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, the *name* and *value* should be strings or string " "subclasses that do not change the content of the passed in arguments." msgstr "" -#: ../../library/email.policy.rst:331 +#: ../../library/email.policy.rst:349 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` when that header is requested by the application " @@ -385,13 +441,13 @@ msgid "" "returned to the application." msgstr "" -#: ../../library/email.policy.rst:339 +#: ../../library/email.policy.rst:357 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the value returned by the method." msgstr "" -#: ../../library/email.policy.rst:347 +#: ../../library/email.policy.rst:365 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` for a given header. The method should return a " @@ -401,32 +457,32 @@ msgid "" "discussion of the rules for folding email headers." msgstr "" -#: ../../library/email.policy.rst:354 +#: ../../library/email.policy.rst:372 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the string returned by the method." msgstr "" -#: ../../library/email.policy.rst:360 +#: ../../library/email.policy.rst:378 msgid "" "The same as :meth:`fold`, except that the returned value should be a bytes " "object rather than a string." msgstr "" -#: ../../library/email.policy.rst:363 +#: ../../library/email.policy.rst:381 msgid "" "*value* may contain surrogateescaped binary data. These could be converted " "back into binary data in the returned bytes object." msgstr "" -#: ../../library/email.policy.rst:370 +#: ../../library/email.policy.rst:388 msgid "" "This concrete :class:`Policy` provides behavior that is intended to be fully " "compliant with the current email RFCs. These include (but are not limited " "to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." msgstr "" -#: ../../library/email.policy.rst:374 +#: ../../library/email.policy.rst:392 msgid "" "This policy adds new header parsing and folding algorithms. Instead of " "simple strings, headers are ``str`` subclasses with attributes that depend " @@ -434,23 +490,23 @@ msgid "" "implement :rfc:`2047` and :rfc:`5322`." msgstr "" -#: ../../library/email.policy.rst:379 +#: ../../library/email.policy.rst:397 msgid "" "The default value for the :attr:`~email.policy.Policy.message_factory` " "attribute is :class:`~email.message.EmailMessage`." msgstr "" -#: ../../library/email.policy.rst:382 +#: ../../library/email.policy.rst:400 msgid "" "In addition to the settable attributes listed above that apply to all " "policies, this policy adds the following additional attributes:" msgstr "" -#: ../../library/email.policy.rst:385 +#: ../../library/email.policy.rst:403 msgid "[1]_" msgstr "[1]_" -#: ../../library/email.policy.rst:390 +#: ../../library/email.policy.rst:408 msgid "" "If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers " "by encoding them as \"encoded words\". If ``True``, follow :rfc:`6532` and " @@ -458,7 +514,7 @@ msgid "" "passed to SMTP servers that support the ``SMTPUTF8`` extension (:rfc:`6531`)." msgstr "" -#: ../../library/email.policy.rst:399 +#: ../../library/email.policy.rst:417 msgid "" "If the value for a header in the ``Message`` object originated from a :mod:" "`~email.parser` (as opposed to being set by a program), this attribute " @@ -466,37 +522,37 @@ msgid "" "transforming the message back into serialized form. The possible values are:" msgstr "" -#: ../../library/email.policy.rst:406 +#: ../../library/email.policy.rst:424 msgid "``none``" msgstr "``none``" -#: ../../library/email.policy.rst:406 +#: ../../library/email.policy.rst:424 msgid "all source values use original folding" msgstr "" -#: ../../library/email.policy.rst:408 +#: ../../library/email.policy.rst:426 msgid "``long``" msgstr "``long``" -#: ../../library/email.policy.rst:408 +#: ../../library/email.policy.rst:426 msgid "" "source values that have any line that is longer than ``max_line_length`` " "will be refolded" msgstr "" -#: ../../library/email.policy.rst:411 +#: ../../library/email.policy.rst:429 msgid "``all``" msgstr "``all``" -#: ../../library/email.policy.rst:411 +#: ../../library/email.policy.rst:429 msgid "all values are refolded." msgstr "todos os valores são redobrados." -#: ../../library/email.policy.rst:414 +#: ../../library/email.policy.rst:432 msgid "The default is ``long``." msgstr "O padrão é ``long``." -#: ../../library/email.policy.rst:419 +#: ../../library/email.policy.rst:437 msgid "" "A callable that takes two arguments, ``name`` and ``value``, where ``name`` " "is a header field name and ``value`` is an unfolded header field value, and " @@ -507,7 +563,7 @@ msgid "" "custom parsing will be added in the future." msgstr "" -#: ../../library/email.policy.rst:430 +#: ../../library/email.policy.rst:448 msgid "" "An object with at least two methods: get_content and set_content. When the :" "meth:`~email.message.EmailMessage.get_content` or :meth:`~email.message." @@ -518,20 +574,20 @@ msgid "" "``content_manager`` is set to :data:`~email.contentmanager.raw_data_manager`." msgstr "" -#: ../../library/email.policy.rst:442 ../../library/email.policy.rst:600 +#: ../../library/email.policy.rst:460 ../../library/email.policy.rst:618 msgid "" "The class provides the following concrete implementations of the abstract " "methods of :class:`Policy`:" msgstr "" -#: ../../library/email.policy.rst:448 +#: ../../library/email.policy.rst:466 msgid "" "Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` " "attribute of the specialized class used to represent the header with the " "given name." msgstr "" -#: ../../library/email.policy.rst:456 ../../library/email.policy.rst:606 +#: ../../library/email.policy.rst:474 ../../library/email.policy.rst:624 msgid "" "The name is parsed as everything up to the '``:``' and returned unmodified. " "The value is determined by stripping leading whitespace off the remainder of " @@ -539,7 +595,7 @@ msgid "" "trailing carriage return or linefeed characters." msgstr "" -#: ../../library/email.policy.rst:464 +#: ../../library/email.policy.rst:482 msgid "" "The name is returned unchanged. If the input value has a ``name`` attribute " "and it matches *name* ignoring case, the value is returned unchanged. " @@ -548,7 +604,7 @@ msgid "" "``ValueError`` is raised if the input value contains CR or LF characters." msgstr "" -#: ../../library/email.policy.rst:474 +#: ../../library/email.policy.rst:492 msgid "" "If the value has a ``name`` attribute, it is returned to unmodified. " "Otherwise the *name*, and the *value* with any CR or LF characters removed, " @@ -557,7 +613,7 @@ msgid "" "character glyph." msgstr "" -#: ../../library/email.policy.rst:483 +#: ../../library/email.policy.rst:501 msgid "" "Header folding is controlled by the :attr:`refold_source` policy setting. A " "value is considered to be a 'source value' if and only if it does not have a " @@ -569,7 +625,7 @@ msgid "" "current policy." msgstr "" -#: ../../library/email.policy.rst:492 +#: ../../library/email.policy.rst:510 msgid "" "Source values are split into lines using :meth:`~str.splitlines`. If the " "value is not to be refolded, the lines are rejoined using the ``linesep`` " @@ -579,13 +635,13 @@ msgid "" "using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:502 +#: ../../library/email.policy.rst:520 msgid "" "The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except " "that the returned value is bytes." msgstr "" -#: ../../library/email.policy.rst:505 +#: ../../library/email.policy.rst:523 msgid "" "If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted " "back into bytes. Headers with binary data are not refolded, regardless of " @@ -593,7 +649,7 @@ msgid "" "binary data consists of single byte characters or multibyte characters." msgstr "" -#: ../../library/email.policy.rst:512 +#: ../../library/email.policy.rst:530 msgid "" "The following instances of :class:`EmailPolicy` provide defaults suitable " "for specific application domains. Note that in the future the behavior of " @@ -601,20 +657,20 @@ msgid "" "conform even more closely to the RFCs relevant to their domains." msgstr "" -#: ../../library/email.policy.rst:520 +#: ../../library/email.policy.rst:538 msgid "" "An instance of ``EmailPolicy`` with all defaults unchanged. This policy " "uses the standard Python ``\\n`` line endings rather than the RFC-correct " "``\\r\\n``." msgstr "" -#: ../../library/email.policy.rst:527 +#: ../../library/email.policy.rst:545 msgid "" "Suitable for serializing messages in conformance with the email RFCs. Like " "``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." msgstr "" -#: ../../library/email.policy.rst:534 +#: ../../library/email.policy.rst:552 msgid "" "The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. " "Useful for serializing messages to a message store without using encoded " @@ -623,46 +679,50 @@ msgid "" "SMTP.send_message` method handles this automatically)." msgstr "" -#: ../../library/email.policy.rst:543 +#: ../../library/email.policy.rst:561 msgid "" "Suitable for serializing headers with for use in HTTP traffic. Like " "``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." msgstr "" -#: ../../library/email.policy.rst:549 +#: ../../library/email.policy.rst:567 msgid "" "Convenience instance. The same as ``default`` except that " "``raise_on_defect`` is set to ``True``. This allows any policy to be made " "strict by writing::" msgstr "" -#: ../../library/email.policy.rst:556 +#: ../../library/email.policy.rst:571 +msgid "somepolicy + policy.strict" +msgstr "" + +#: ../../library/email.policy.rst:574 msgid "" "With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API " "of the email package is changed from the Python 3.2 API in the following " "ways:" msgstr "" -#: ../../library/email.policy.rst:559 +#: ../../library/email.policy.rst:577 msgid "" "Setting a header on a :class:`~email.message.Message` results in that header " "being parsed and a header object created." msgstr "" -#: ../../library/email.policy.rst:562 +#: ../../library/email.policy.rst:580 msgid "" "Fetching a header value from a :class:`~email.message.Message` results in " "that header being parsed and a header object created and returned." msgstr "" -#: ../../library/email.policy.rst:566 +#: ../../library/email.policy.rst:584 msgid "" "Any header object, or any header that is refolded due to the policy " "settings, is folded using an algorithm that fully implements the RFC folding " "algorithms, including knowing where encoded words are required and allowed." msgstr "" -#: ../../library/email.policy.rst:571 +#: ../../library/email.policy.rst:589 msgid "" "From the application view, this means that any header obtained through the :" "class:`~email.message.EmailMessage` is a header object with extra " @@ -672,13 +732,13 @@ msgid "" "the unicode string into the correct RFC encoded form." msgstr "" -#: ../../library/email.policy.rst:578 +#: ../../library/email.policy.rst:596 msgid "" "The header objects and their attributes are described in :mod:`~email." "headerregistry`." msgstr "" -#: ../../library/email.policy.rst:585 +#: ../../library/email.policy.rst:603 msgid "" "This concrete :class:`Policy` is the backward compatibility policy. It " "replicates the behavior of the email package in Python 3.2. The :mod:" @@ -687,28 +747,28 @@ msgid "" "of the email package is to maintain compatibility with Python 3.2." msgstr "" -#: ../../library/email.policy.rst:591 +#: ../../library/email.policy.rst:609 msgid "" "The following attributes have values that are different from the :class:" "`Policy` default:" msgstr "" -#: ../../library/email.policy.rst:597 +#: ../../library/email.policy.rst:615 msgid "The default is ``True``." msgstr "O padrão é ``True``." -#: ../../library/email.policy.rst:614 +#: ../../library/email.policy.rst:632 msgid "The name and value are returned unmodified." msgstr "" -#: ../../library/email.policy.rst:619 +#: ../../library/email.policy.rst:637 msgid "" "If the value contains binary data, it is converted into a :class:`~email." "header.Header` object using the ``unknown-8bit`` charset. Otherwise it is " "returned unmodified." msgstr "" -#: ../../library/email.policy.rst:626 +#: ../../library/email.policy.rst:644 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -716,7 +776,7 @@ msgid "" "encoded using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:634 +#: ../../library/email.policy.rst:652 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -726,17 +786,17 @@ msgid "" "and any (RFC invalid) binary data it may contain." msgstr "" -#: ../../library/email.policy.rst:644 +#: ../../library/email.policy.rst:662 msgid "" "An instance of :class:`Compat32`, providing backward compatibility with the " "behavior of the email package in Python 3.2." msgstr "" -#: ../../library/email.policy.rst:649 +#: ../../library/email.policy.rst:667 msgid "Footnotes" msgstr "Notas de rodapé" -#: ../../library/email.policy.rst:650 +#: ../../library/email.policy.rst:668 msgid "" "Originally added in 3.3 as a :term:`provisional feature `." diff --git a/library/email.utils.po b/library/email.utils.po index 153bead27..4a405ff89 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Sheila Gomes , 2021 -# Italo Penaforte , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -56,7 +54,7 @@ msgstr "" "ingênuo (ou seja, ``dt.tzinfo`` for ``None``), será presumido como estando " "no horário local. O parâmetro *isdst* é ignorado." -#: ../../library/email.utils.rst:26 +#: ../../library/email.utils.rst:25 msgid "The *isdst* parameter." msgstr "O parâmetro *isdst*." @@ -159,12 +157,23 @@ msgid "" "be returned by :meth:`Message.get_all `. " "Here's a simple example that gets all the recipients of a message::" msgstr "" -"Este método retorna uma lista de tuplas 2 do formulário retornado por " -"``parseaddr()``. *fieldvalues* é uma sequência de valores do campo de " -"cabeçalho que pode ser retornada por :meth:`Message.get_all `. Aqui está um exemplo simples que recebe todos os " +"Este método retorna uma lista de tuplas de 2 elementos do formato retornado " +"por ``parseaddr()``. *fieldvalues* é uma sequência de valores de campos de " +"cabeçalho como pode ser retornado por :meth:`Message.get_all `. Aqui está um exemplo simples que obtém todos os " "destinatários de uma mensagem::" +#: ../../library/email.utils.rst:92 +msgid "" +"from email.utils import getaddresses\n" +"\n" +"tos = msg.get_all('to', [])\n" +"ccs = msg.get_all('cc', [])\n" +"resent_tos = msg.get_all('resent-to', [])\n" +"resent_ccs = msg.get_all('resent-cc', [])\n" +"all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" +msgstr "" + #: ../../library/email.utils.rst:103 msgid "" "Attempts to parse a date according to the rules in :rfc:`2822`. however, " @@ -241,9 +250,13 @@ msgstr "" msgid "Returns a date string as per :rfc:`2822`, e.g.::" msgstr "Retorna uma string de data conforme :rfc:`2822`. Por exemplo::" +#: ../../library/email.utils.rst:149 +msgid "Fri, 09 Nov 2001 01:08:47 -0000" +msgstr "" + #: ../../library/email.utils.rst:151 msgid "" -"Optional *timeval* if given is a floating point time value as accepted by :" +"Optional *timeval* if given is a floating-point time value as accepted by :" "func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is " "used." msgstr "" diff --git a/library/ensurepip.po b/library/ensurepip.po index 2cce2d270..ad38f58e4 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -113,6 +112,10 @@ msgstr "" msgid "The simplest possible invocation is::" msgstr "A invocação mais simples possível é::" +#: ../../library/ensurepip.rst:50 +msgid "python -m ensurepip" +msgstr "" + #: ../../library/ensurepip.rst:52 msgid "" "This invocation will install ``pip`` if it is not already installed, but " @@ -125,6 +128,10 @@ msgstr "" "seja pelo menos tão recente quanto a disponível do ``ensurepip``, passe a " "opção ``--upgrade``::" +#: ../../library/ensurepip.rst:57 +msgid "python -m ensurepip --upgrade" +msgstr "" + #: ../../library/ensurepip.rst:59 msgid "" "By default, ``pip`` is installed into the current virtual environment (if " @@ -268,7 +275,7 @@ msgstr "" "*verbosity* controla o nível de saída para :data:`sys.stdout` da operação de " "inicialização." -#: ../../library/ensurepip.rst:136 +#: ../../library/ensurepip.rst:125 msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." diff --git a/library/enum.po b/library/enum.po index 8ed5b6d52..01584e766 100644 --- a/library/enum.po +++ b/library/enum.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Marco Rougeth , 2021 -# Hildeberto Abreu Magalhães , 2022 -# Raphael Mendonça, 2022 -# Misael borges , 2022 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -83,6 +79,20 @@ msgid "" "using function-call syntax::" msgstr "" +#: ../../library/enum.rst:38 +msgid "" +">>> from enum import Enum\n" +"\n" +">>> # class syntax\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"\n" +">>> # functional syntax\n" +">>> Color = Enum('Color', ['RED', 'GREEN', 'BLUE'])" +msgstr "" + #: ../../library/enum.rst:49 msgid "" "Even though we can use :keyword:`class` syntax to create Enums, Enums are " @@ -395,6 +405,15 @@ msgstr "" msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "" +#: ../../library/enum.rst:198 +msgid "" +">>> some_var = Color.RED\n" +">>> some_var in Color\n" +"True\n" +">>> Color.RED.value in Color\n" +"True" +msgstr "" + #: ../../library/enum.rst:206 msgid "" "Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " @@ -407,20 +426,46 @@ msgid "" "names of the members in *cls*::" msgstr "" +#: ../../library/enum.rst:214 +msgid "" +">>> dir(Color)\n" +"['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " +"'__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', " +"'__module__', '__name__', '__qualname__']" +msgstr "" + #: ../../library/enum.rst:219 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "" +#: ../../library/enum.rst:221 +msgid "" +">>> Color['BLUE']\n" +"" +msgstr "" + #: ../../library/enum.rst:226 msgid "Returns each member in *cls* in definition order::" msgstr "" +#: ../../library/enum.rst:228 +msgid "" +">>> list(Color)\n" +"[, , ]" +msgstr "" + #: ../../library/enum.rst:233 msgid "Returns the number of member in *cls*::" msgstr "" +#: ../../library/enum.rst:235 +msgid "" +">>> len(Color)\n" +"3" +msgstr "" + #: ../../library/enum.rst:240 msgid "Returns a mapping of every enum name to its member, including aliases" msgstr "" @@ -429,6 +474,12 @@ msgstr "" msgid "Returns each member in *cls* in reverse definition order::" msgstr "" +#: ../../library/enum.rst:246 +msgid "" +">>> list(reversed(Color))\n" +"[, , ]" +msgstr "" + #: ../../library/enum.rst:251 msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" @@ -441,10 +492,22 @@ msgstr "" msgid "The name used to define the ``Enum`` member::" msgstr "" +#: ../../library/enum.rst:262 +msgid "" +">>> Color.BLUE.name\n" +"'BLUE'" +msgstr "" + #: ../../library/enum.rst:267 msgid "The value given to the ``Enum`` member::" msgstr "" +#: ../../library/enum.rst:269 +msgid "" +">>> Color.RED.value\n" +"1" +msgstr "" + #: ../../library/enum.rst:272 ../../library/enum.rst:292 msgid "Value of the member, can be set in :meth:`~Enum.__new__`." msgstr "" @@ -497,6 +560,26 @@ msgid "" "public methods defined on *self.__class__*::" msgstr "" +#: ../../library/enum.rst:313 +msgid "" +">>> from datetime import date\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7\n" +"... @classmethod\n" +"... def today(cls):\n" +"... print('today is %s' % cls(date.today().isoweekday()).name)\n" +"...\n" +">>> dir(Weekday.SATURDAY)\n" +"['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', " +"'today', 'value']" +msgstr "" + #: ../../library/enum.rst:0 msgid "name" msgstr "nome" @@ -531,6 +614,20 @@ msgid "" "`auto`::" msgstr "" +#: ../../library/enum.rst:339 +msgid "" +">>> from enum import auto\n" +">>> class PowersOfThree(Enum):\n" +"... @staticmethod\n" +"... def _generate_next_value_(name, start, count, last_values):\n" +"... return 3 ** (count + 1)\n" +"... FIRST = auto()\n" +"... SECOND = auto()\n" +"...\n" +">>> PowersOfThree.SECOND.value\n" +"9" +msgstr "" + #: ../../library/enum.rst:352 msgid "" "By default, does nothing. If multiple values are given in the member " @@ -555,6 +652,26 @@ msgid "" "does nothing, but can be overridden to implement custom search behavior::" msgstr "" +#: ../../library/enum.rst:371 +msgid "" +">>> from enum import StrEnum\n" +">>> class Build(StrEnum):\n" +"... DEBUG = auto()\n" +"... OPTIMIZED = auto()\n" +"... @classmethod\n" +"... def _missing_(cls, value):\n" +"... value = value.lower()\n" +"... for member in cls:\n" +"... if member.value == value:\n" +"... return member\n" +"... return None\n" +"...\n" +">>> Build.DEBUG.value\n" +"'debug'\n" +">>> Build('deBUG')\n" +"" +msgstr "" + #: ../../library/enum.rst:390 msgid "" "By default, doesn't exist. If specified, either in the enum class " @@ -579,18 +696,61 @@ msgid "" "name, member name, and value, but can be overridden::" msgstr "" +#: ../../library/enum.rst:410 +msgid "" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __repr__(self):\n" +"... cls_name = self.__class__.__name__\n" +"... return f'{cls_name}.{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" +msgstr "" + #: ../../library/enum.rst:423 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" +#: ../../library/enum.rst:426 +msgid "" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __str__(self):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(, 'ALTERNATE', 'ALTERNATE')" +msgstr "" + #: ../../library/enum.rst:438 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" msgstr "" +#: ../../library/enum.rst:441 +msgid "" +">>> class OtherStyle(Enum):\n" +"... ALTERNATE = auto()\n" +"... OTHER = auto()\n" +"... SOMETHING_ELSE = auto()\n" +"... def __format__(self, spec):\n" +"... return f'{self.name}'\n" +"...\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" +"(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" +msgstr "" + #: ../../library/enum.rst:453 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " @@ -655,239 +815,407 @@ msgstr "" msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " "operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " -"the results of those operators are members of the enumeration." +"the results of those operations are (aliases of) members of the enumeration." msgstr "" #: ../../library/enum.rst:524 msgid "Returns *True* if value is in self::" msgstr "" +#: ../../library/enum.rst:526 +msgid "" +">>> from enum import Flag, auto\n" +">>> class Color(Flag):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> purple = Color.RED | Color.BLUE\n" +">>> white = Color.RED | Color.GREEN | Color.BLUE\n" +">>> Color.GREEN in purple\n" +"False\n" +">>> Color.GREEN in white\n" +"True\n" +">>> purple in white\n" +"True\n" +">>> white in purple\n" +"False" +msgstr "" + #: ../../library/enum.rst:545 msgid "Returns all contained non-alias members::" msgstr "" +#: ../../library/enum.rst:547 +msgid "" +">>> list(Color.RED)\n" +"[]\n" +">>> list(purple)\n" +"[, ]" +msgstr "" + #: ../../library/enum.rst:556 msgid "Returns number of members in flag::" msgstr "" -#: ../../library/enum.rst:565 +#: ../../library/enum.rst:558 +msgid "" +">>> len(Color.GREEN)\n" +"1\n" +">>> len(white)\n" +"3" +msgstr "" + +#: ../../library/enum.rst:567 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "" -#: ../../library/enum.rst:577 +#: ../../library/enum.rst:569 +msgid "" +">>> bool(Color.GREEN)\n" +"True\n" +">>> bool(white)\n" +"True\n" +">>> black = Color(0)\n" +">>> bool(black)\n" +"False" +msgstr "" + +#: ../../library/enum.rst:579 msgid "Returns current flag binary or'ed with other::" msgstr "" -#: ../../library/enum.rst:584 +#: ../../library/enum.rst:581 +msgid "" +">>> Color.RED | Color.GREEN\n" +"" +msgstr "" + +#: ../../library/enum.rst:586 msgid "Returns current flag binary and'ed with other::" msgstr "" -#: ../../library/enum.rst:593 +#: ../../library/enum.rst:588 +msgid "" +">>> purple & white\n" +"\n" +">>> purple & Color.GREEN\n" +"" +msgstr "" + +#: ../../library/enum.rst:595 msgid "Returns current flag binary xor'ed with other::" msgstr "" -#: ../../library/enum.rst:602 +#: ../../library/enum.rst:597 +msgid "" +">>> purple ^ white\n" +"\n" +">>> purple ^ Color.GREEN\n" +"" +msgstr "" + +#: ../../library/enum.rst:604 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "" -#: ../../library/enum.rst:613 +#: ../../library/enum.rst:606 +msgid "" +">>> ~white\n" +"\n" +">>> ~purple\n" +"\n" +">>> ~Color.RED\n" +"" +msgstr "" + +#: ../../library/enum.rst:615 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" -#: ../../library/enum.rst:618 +#: ../../library/enum.rst:620 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:621 +#: ../../library/enum.rst:623 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "" -#: ../../library/enum.rst:629 +#: ../../library/enum.rst:631 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" -#: ../../library/enum.rst:643 +#: ../../library/enum.rst:645 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "" -#: ../../library/enum.rst:649 -msgid "If a *Flag* operation is performed with an *IntFlag* member and:" +#: ../../library/enum.rst:648 +msgid "" +">>> Color.RED + 2\n" +"3" msgstr "" #: ../../library/enum.rst:651 +msgid "If a *Flag* operation is performed with an *IntFlag* member and:" +msgstr "" + +#: ../../library/enum.rst:653 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "" -#: ../../library/enum.rst:652 +#: ../../library/enum.rst:654 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "" -#: ../../library/enum.rst:654 +#: ../../library/enum.rst:656 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "" -#: ../../library/enum.rst:661 +#: ../../library/enum.rst:663 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:666 +#: ../../library/enum.rst:668 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:670 +#: ../../library/enum.rst:672 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" -#: ../../library/enum.rst:676 +#: ../../library/enum.rst:678 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" -#: ../../library/enum.rst:679 +#: ../../library/enum.rst:681 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:680 +#: ../../library/enum.rst:682 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "" -#: ../../library/enum.rst:682 +#: ../../library/enum.rst:684 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" -#: ../../library/enum.rst:691 +#: ../../library/enum.rst:693 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -#: ../../library/enum.rst:696 +#: ../../library/enum.rst:698 msgid "Ensure that each value has only one name::" msgstr "" -#: ../../library/enum.rst:712 +#: ../../library/enum.rst:700 +msgid "" +">>> from enum import Enum, verify, UNIQUE\n" +">>> @verify(UNIQUE)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3\n" +"... CRIMSON = 1\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: aliases found in : CRIMSON -> RED" +msgstr "" + +#: ../../library/enum.rst:714 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "" -#: ../../library/enum.rst:727 +#: ../../library/enum.rst:717 +msgid "" +">>> from enum import Enum, verify, CONTINUOUS\n" +">>> @verify(CONTINUOUS)\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 5\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid enum 'Color': missing values 3, 4" +msgstr "" + +#: ../../library/enum.rst:729 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" -#: ../../library/enum.rst:744 +#: ../../library/enum.rst:732 +msgid "" +">>> from enum import Flag, verify, NAMED_FLAGS\n" +">>> @verify(NAMED_FLAGS)\n" +"... class Color(Flag):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 4\n" +"... WHITE = 15\n" +"... NEON = 31\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " +"combined values of 0x18 [use enum.show_flag_values(value) for details]" +msgstr "" + +#: ../../library/enum.rst:746 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "" -#: ../../library/enum.rst:750 +#: ../../library/enum.rst:752 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "" -#: ../../library/enum.rst:755 +#: ../../library/enum.rst:757 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:773 +#: ../../library/enum.rst:760 +msgid "" +">>> from enum import Flag, STRICT, auto\n" +">>> class StrictFlag(Flag, boundary=STRICT):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> StrictFlag(2**2 + 2**4)\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: invalid value 20\n" +" given 0b0 10100\n" +" allowed 0b0 00111" +msgstr "" + +#: ../../library/enum.rst:775 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:778 +msgid "" +">>> from enum import Flag, CONFORM, auto\n" +">>> class ConformFlag(Flag, boundary=CONFORM):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> ConformFlag(2**2 + 2**4)\n" +"" +msgstr "" + +#: ../../library/enum.rst:789 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:800 +#: ../../library/enum.rst:802 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:817 +#: ../../library/enum.rst:805 +msgid "" +">>> from enum import Flag, KEEP, auto\n" +">>> class KeepFlag(Flag, boundary=KEEP):\n" +"... RED = auto()\n" +"... GREEN = auto()\n" +"... BLUE = auto()\n" +"...\n" +">>> KeepFlag(2**2 + 2**4)\n" +"" +msgstr "" + +#: ../../library/enum.rst:819 msgid "Supported ``__dunder__`` names" msgstr "Nomes ``__dunder__`` suportados" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:821 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:824 msgid "" ":meth:`~Enum.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:830 msgid "Supported ``_sunder_`` names" msgstr "Nomes ``_sunder_`` suportados" -#: ../../library/enum.rst:830 +#: ../../library/enum.rst:832 msgid ":attr:`~Enum._name_` -- name of the member" msgstr "" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:833 msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "" -#: ../../library/enum.rst:832 +#: ../../library/enum.rst:834 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" -#: ../../library/enum.rst:834 +#: ../../library/enum.rst:836 msgid "" ":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" "class:`str`, that will not be transformed into members, and will be removed " "from the final class" msgstr "" -#: ../../library/enum.rst:837 +#: ../../library/enum.rst:839 msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:839 +#: ../../library/enum.rst:841 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" -#: ../../library/enum.rst:844 +#: ../../library/enum.rst:846 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." @@ -895,7 +1223,7 @@ msgstr "" "Para classes :class:`Enum` padrão, o próximo valor escolhido é o último " "valor visto incrementado em um." -#: ../../library/enum.rst:847 +#: ../../library/enum.rst:849 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -903,19 +1231,19 @@ msgstr "" "Para as classes :class:`Flag` o próximo valor escolhido será a próxima " "potência de dois mais alta, independentemente do último valor visto." -#: ../../library/enum.rst:850 +#: ../../library/enum.rst:852 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``, ``_order_``, ``_generate_next_value_``" -#: ../../library/enum.rst:851 +#: ../../library/enum.rst:853 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:856 +#: ../../library/enum.rst:858 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:860 +#: ../../library/enum.rst:862 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -926,54 +1254,54 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:868 +#: ../../library/enum.rst:870 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:870 +#: ../../library/enum.rst:872 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:873 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:873 +#: ../../library/enum.rst:875 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:878 +#: ../../library/enum.rst:880 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:881 +#: ../../library/enum.rst:883 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:884 +#: ../../library/enum.rst:886 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:890 +#: ../../library/enum.rst:892 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:894 +#: ../../library/enum.rst:896 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -981,29 +1309,44 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:905 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:921 +#: ../../library/enum.rst:909 +msgid "" +">>> from enum import Enum, unique\n" +">>> @unique\n" +"... class Mistake(Enum):\n" +"... ONE = 1\n" +"... TWO = 2\n" +"... THREE = 3\n" +"... FOUR = 3\n" +"...\n" +"Traceback (most recent call last):\n" +"...\n" +"ValueError: duplicate values found in : FOUR -> THREE" +msgstr "" + +#: ../../library/enum.rst:923 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:929 +#: ../../library/enum.rst:931 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:935 +#: ../../library/enum.rst:937 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:941 +#: ../../library/enum.rst:943 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1011,40 +1354,54 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:951 +#: ../../library/enum.rst:953 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:958 +#: ../../library/enum.rst:960 msgid "Notes" msgstr "Notas" -#: ../../library/enum.rst:960 +#: ../../library/enum.rst:962 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:962 +#: ../../library/enum.rst:964 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:965 +#: ../../library/enum.rst:967 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:967 +#: ../../library/enum.rst:969 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:970 +#: ../../library/enum.rst:972 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:977 +#: ../../library/enum.rst:975 +msgid "" +">>> from enum import Enum\n" +">>> class MyIntEnum(int, Enum):\n" +"... pass" +msgstr "" + +#: ../../library/enum.rst:979 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" + +#: ../../library/enum.rst:981 +msgid "" +">>> from enum import Enum, IntEnum\n" +">>> class MyIntEnum(IntEnum):\n" +"... __str__ = Enum.__str__" +msgstr "" diff --git a/library/errno.po b/library/errno.po index ea1ac6fbc..d23edc298 100644 --- a/library/errno.po +++ b/library/errno.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2022 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2022\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/exceptions.po b/library/exceptions.po index 6a93f41ca..cc4353bce 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -4,28 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# guilhermegouw , 2021 -# Vinicius Gubiani Ferreira , 2023 -# Marco Rougeth , 2023 -# Patricia Mortada, 2023 # Rafael Fontenelle , 2024 -# Adorilson Bezerra , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-08 21:29+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Adorilson Bezerra , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -128,6 +122,10 @@ msgstr "" "Esse contexto implícito da exceção pode ser complementado com uma causa " "explícita usando :keyword:`!from` com :keyword:`raise`::" +#: ../../library/exceptions.rst:63 +msgid "raise new_exc from original_exc" +msgstr "" + #: ../../library/exceptions.rst:65 msgid "" "The expression following :keyword:`from` must be an exception or " @@ -265,6 +263,15 @@ msgstr "" "traceback de ``SomeException`` original se tivéssemos permitido que ele se " "propagasse para o chamador. ::" +#: ../../library/exceptions.rst:135 +msgid "" +"try:\n" +" ...\n" +"except SomeException:\n" +" tb = sys.exception().__traceback__\n" +" raise OtherException(...).with_traceback(tb)" +msgstr "" + #: ../../library/exceptions.rst:143 msgid "" "A writable field that holds the :ref:`traceback object ` " @@ -672,8 +679,8 @@ msgid "" "represented. This cannot occur for integers (which would rather raise :exc:" "`MemoryError` than give up). However, for historical reasons, OverflowError " "is sometimes raised for integers that are outside a required range. " -"Because of the lack of standardization of floating point exception handling " -"in C, most floating point operations are not checked." +"Because of the lack of standardization of floating-point exception handling " +"in C, most floating-point operations are not checked." msgstr "" "Levantada quando o resultado de uma operação aritmética é muito grande para " "ser representada. Isso não pode ocorrer para inteiros (que prefere levantar :" @@ -1496,11 +1503,10 @@ msgid "" "type or a tuple of exception types, which is used to check for a match using " "the same check that is used in an ``except`` clause." msgstr "" -"A condição pode ser uma função que aceita uma exceção e retorna true para " -"aquelas que deveriam estar no subgrupo, ou pode ser um tipo de exceção ou " -"uma tupla de tipos de exceção, que é usada para verificar uma " -"correspondência usando a mesma verificação que é usado em uma cláusula " -"``except``." +"A condição pode ser uma função que aceita uma exceção e retorna verdadeiro " +"para aquelas que deveriam estar no subgrupo, ou pode ser um tipo de exceção " +"ou uma tupla de tipos de exceção, que é usada para verificar uma " +"correspondência usando a mesma verificação usada em uma cláusula ``except``." #: ../../library/exceptions.rst:948 msgid "" @@ -1546,15 +1552,17 @@ msgstr "" #: ../../library/exceptions.rst:970 msgid "" -"This method is used by :meth:`subgroup` and :meth:`split`. A subclass needs " -"to override it in order to make :meth:`subgroup` and :meth:`split` return " +"This method is used by :meth:`subgroup` and :meth:`split`, which are used in " +"various contexts to break up an exception group. A subclass needs to " +"override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -"Este método é usado por :meth:`subgroup` e :meth:`split`. Uma subclasse " -"precisa substituí-la para fazer com que :meth:`subgroup` e :meth:`split` " -"retorne instâncias da subclasse em vez de :exc:`ExceptionGroup`." +"Este método é usado por :meth:`subgroup` e :meth:`split`, que são usados em " +"vários contextos para dividir um grupo de exceções. Uma subclasse precisa " +"substituí-la para fazer com que :meth:`subgroup` e :meth:`split` retorne " +"instâncias da subclasse em vez de :exc:`ExceptionGroup`." -#: ../../library/exceptions.rst:975 +#: ../../library/exceptions.rst:976 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." "__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." @@ -1568,7 +1576,36 @@ msgstr "" "original para o retornado por :meth:`derive`, então esses campos não " "precisam ser atualizados por :meth:`derive`. ::" -#: ../../library/exceptions.rst:1008 +#: ../../library/exceptions.rst:983 +msgid "" +">>> class MyGroup(ExceptionGroup):\n" +"... def derive(self, excs):\n" +"... return MyGroup(self.message, excs)\n" +"...\n" +">>> e = MyGroup(\"eg\", [ValueError(1), TypeError(2)])\n" +">>> e.add_note(\"a note\")\n" +">>> e.__context__ = Exception(\"context\")\n" +">>> e.__cause__ = Exception(\"cause\")\n" +">>> try:\n" +"... raise e\n" +"... except Exception as e:\n" +"... exc = e\n" +"...\n" +">>> match, rest = exc.split(ValueError)\n" +">>> exc, exc.__context__, exc.__cause__, exc.__notes__\n" +"(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), " +"Exception('cause'), ['a note'])\n" +">>> match, match.__context__, match.__cause__, match.__notes__\n" +"(MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> rest, rest.__context__, rest.__cause__, rest.__notes__\n" +"(MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), " +"['a note'])\n" +">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" +"True" +msgstr "" + +#: ../../library/exceptions.rst:1009 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1582,7 +1619,19 @@ msgstr "" "seguinte define uma subclasse de grupo de exceções que aceita um exit_code e " "constrói a mensagem do grupo a partir dele. ::" -#: ../../library/exceptions.rst:1023 +#: ../../library/exceptions.rst:1015 +msgid "" +"class Errors(ExceptionGroup):\n" +" def __new__(cls, errors, exit_code):\n" +" self = super().__new__(Errors, f\"exit code: {exit_code}\", errors)\n" +" self.exit_code = exit_code\n" +" return self\n" +"\n" +" def derive(self, excs):\n" +" return Errors(excs, self.exit_code)" +msgstr "" + +#: ../../library/exceptions.rst:1024 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" @@ -1592,14 +1641,85 @@ msgstr "" "que também é uma subclasse de :exc:`Exception` só pode agrupar instâncias " "de :exc:`Exception`." -#: ../../library/exceptions.rst:1031 +#: ../../library/exceptions.rst:1032 msgid "Exception hierarchy" msgstr "Hierarquia das exceções" -#: ../../library/exceptions.rst:1033 +#: ../../library/exceptions.rst:1034 msgid "The class hierarchy for built-in exceptions is:" msgstr "A hierarquia de classes para exceções embutidas é:" +#: ../../library/exceptions.rst:1036 +msgid "" +"BaseException\n" +" ├── BaseExceptionGroup\n" +" ├── GeneratorExit\n" +" ├── KeyboardInterrupt\n" +" ├── SystemExit\n" +" └── Exception\n" +" ├── ArithmeticError\n" +" │ ├── FloatingPointError\n" +" │ ├── OverflowError\n" +" │ └── ZeroDivisionError\n" +" ├── AssertionError\n" +" ├── AttributeError\n" +" ├── BufferError\n" +" ├── EOFError\n" +" ├── ExceptionGroup [BaseExceptionGroup]\n" +" ├── ImportError\n" +" │ └── ModuleNotFoundError\n" +" ├── LookupError\n" +" │ ├── IndexError\n" +" │ └── KeyError\n" +" ├── MemoryError\n" +" ├── NameError\n" +" │ └── UnboundLocalError\n" +" ├── OSError\n" +" │ ├── BlockingIOError\n" +" │ ├── ChildProcessError\n" +" │ ├── ConnectionError\n" +" │ │ ├── BrokenPipeError\n" +" │ │ ├── ConnectionAbortedError\n" +" │ │ ├── ConnectionRefusedError\n" +" │ │ └── ConnectionResetError\n" +" │ ├── FileExistsError\n" +" │ ├── FileNotFoundError\n" +" │ ├── InterruptedError\n" +" │ ├── IsADirectoryError\n" +" │ ├── NotADirectoryError\n" +" │ ├── PermissionError\n" +" │ ├── ProcessLookupError\n" +" │ └── TimeoutError\n" +" ├── ReferenceError\n" +" ├── RuntimeError\n" +" │ ├── NotImplementedError\n" +" │ └── RecursionError\n" +" ├── StopAsyncIteration\n" +" ├── StopIteration\n" +" ├── SyntaxError\n" +" │ └── IndentationError\n" +" │ └── TabError\n" +" ├── SystemError\n" +" ├── TypeError\n" +" ├── ValueError\n" +" │ └── UnicodeError\n" +" │ ├── UnicodeDecodeError\n" +" │ ├── UnicodeEncodeError\n" +" │ └── UnicodeTranslateError\n" +" └── Warning\n" +" ├── BytesWarning\n" +" ├── DeprecationWarning\n" +" ├── EncodingWarning\n" +" ├── FutureWarning\n" +" ├── ImportWarning\n" +" ├── PendingDeprecationWarning\n" +" ├── ResourceWarning\n" +" ├── RuntimeWarning\n" +" ├── SyntaxWarning\n" +" ├── UnicodeWarning\n" +" └── UserWarning\n" +msgstr "" + #: ../../library/exceptions.rst:6 ../../library/exceptions.rst:17 #: ../../library/exceptions.rst:196 msgid "statement" diff --git a/library/faulthandler.po b/library/faulthandler.po index f56d42032..1c80a30f7 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# And Past , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -262,3 +260,20 @@ msgid "" "Example of a segmentation fault on Linux with and without enabling the fault " "handler:" msgstr "" + +#: ../../library/faulthandler.rst:178 +msgid "" +"$ python -c \"import ctypes; ctypes.string_at(0)\"\n" +"Segmentation fault\n" +"\n" +"$ python -q -X faulthandler\n" +">>> import ctypes\n" +">>> ctypes.string_at(0)\n" +"Fatal Python error: Segmentation fault\n" +"\n" +"Current thread 0x00007fb899f39700 (most recent call first):\n" +" File \"/home/python/cpython/Lib/ctypes/__init__.py\", line 486 in " +"string_at\n" +" File \"\", line 1 in \n" +"Segmentation fault" +msgstr "" diff --git a/library/fcntl.po b/library/fcntl.po index ed184dc79..3bec74210 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -188,6 +187,20 @@ msgstr "" msgid "An example::" msgstr "Um exemplo::" +#: ../../library/fcntl.rst:125 +msgid "" +">>> import array, fcntl, struct, termios, os\n" +">>> os.getpgrp()\n" +"13341\n" +">>> struct.unpack('h', fcntl.ioctl(0, termios.TIOCGPGRP, \" \"))[0]\n" +"13341\n" +">>> buf = array.array('h', [0])\n" +">>> fcntl.ioctl(0, termios.TIOCGPGRP, buf, 1)\n" +"0\n" +">>> buf\n" +"array('h', [13341])" +msgstr "" + #: ../../library/fcntl.rst:136 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " @@ -291,6 +304,17 @@ msgstr "" msgid "Examples (all on a SVR4 compliant system)::" msgstr "" +#: ../../library/fcntl.rst:198 +msgid "" +"import struct, fcntl, os\n" +"\n" +"f = open(...)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)\n" +"\n" +"lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)\n" +"rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" +msgstr "" + #: ../../library/fcntl.rst:206 msgid "" "Note that in the first example the return value variable *rv* will hold an " diff --git a/library/filecmp.po b/library/filecmp.po index c575b775a..9eff5e77c 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -242,3 +241,17 @@ msgid "" "Here is a simplified example of using the ``subdirs`` attribute to search " "recursively through two directories to show common different files::" msgstr "" + +#: ../../library/filecmp.rst:197 +msgid "" +">>> from filecmp import dircmp\n" +">>> def print_diff_files(dcmp):\n" +"... for name in dcmp.diff_files:\n" +"... print(\"diff_file %s found in %s and %s\" % (name, dcmp.left,\n" +"... dcmp.right))\n" +"... for sub_dcmp in dcmp.subdirs.values():\n" +"... print_diff_files(sub_dcmp)\n" +"...\n" +">>> dcmp = dircmp('dir1', 'dir2') \n" +">>> print_diff_files(dcmp) " +msgstr "" diff --git a/library/fileformats.po b/library/fileformats.po index 8a5d2e9d4..35a7f3368 100644 --- a/library/fileformats.po +++ b/library/fileformats.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Claudio Rogerio Carvalho Filho , 2021 -# Erick Simões , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Erick Simões , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/fileinput.po b/library/fileinput.po index 0c61752a4..f27427f34 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -47,6 +46,13 @@ msgstr "" msgid "The typical use is::" msgstr "O uso típico é::" +#: ../../library/fileinput.rst:20 +msgid "" +"import fileinput\n" +"for line in fileinput.input(encoding=\"utf-8\"):\n" +" process(line)" +msgstr "" + #: ../../library/fileinput.rst:24 msgid "" "This iterates over the lines of all files listed in ``sys.argv[1:]``, " @@ -112,13 +118,20 @@ msgstr "" #: ../../library/fileinput.rst:49 msgid "" "You can control how files are opened by providing an opening hook via the " -"*openhook* parameter to :func:`fileinput.input` or :class:`FileInput()`. The " +"*openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The " "hook must be a function that takes two arguments, *filename* and *mode*, and " "returns an accordingly opened file-like object. If *encoding* and/or " "*errors* are specified, they will be passed to the hook as additional " "keyword arguments. This module provides a :func:`hook_compressed` to support " "compressed files." msgstr "" +"Você pode controlar como os arquivos são abertos fornecendo um gancho de " +"abertura através do parâmetro *openhook* para :func:`fileinput.input` ou :" +"func:`FileInput`. O gancho deve ser uma função que recebe dois argumentos, " +"*filename* e *mode*, e retorna um objeto arquivo ou similar aberto de " +"acordo. Se *encoding* e/ou *errors* forem especificados, eles serão passados ​​" +"para o gancho como argumentos nomeados adicionais. Este módulo fornece um :" +"func:`hook_compressed` para oferece suporte a arquivos compactados." #: ../../library/fileinput.rst:56 msgid "The following function is the primary interface of this module:" @@ -146,6 +159,14 @@ msgstr "" "contexto na instrução :keyword:`with`. Neste exemplo, *input* é fechado após " "a saída da instrução :keyword:`!with`, mesmo se ocorrer uma exceção::" +#: ../../library/fileinput.rst:70 +msgid "" +"with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as " +"f:\n" +" for line in f:\n" +" process(line)" +msgstr "" + #: ../../library/fileinput.rst:74 ../../library/fileinput.rst:170 msgid "Can be used as a context manager." msgstr "Pode ser usado como gerenciador de contexto." @@ -307,6 +328,12 @@ msgstr "" "contexto na instrução :keyword:`with`. Neste exemplo, *input* é fechado após " "a saída da instrução :keyword:`!with`, mesmo se ocorrer uma exceção::" +#: ../../library/fileinput.rst:167 +msgid "" +"with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n" +" process(input)" +msgstr "" + #: ../../library/fileinput.rst:173 msgid "The keyword parameter *mode* and *openhook* are now keyword-only." msgstr "Os parâmetros nomeados *mode* e *openhook* agora são somente-nomeados." diff --git a/library/filesys.po b/library/filesys.po index 467b78f07..8bd981b25 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-03 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/fnmatch.po b/library/fnmatch.po index 848cc1a40..acc36aabf 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -4,11 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Welington Carlos , 2021 -# i17obot , 2021 -# Claudio Rogerio Carvalho Filho , 2023 -# Marco Rougeth , 2023 -# Adorilson Bezerra , 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -16,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -142,6 +137,16 @@ msgstr "" "Este exemplo vai exibir todos os nomes de arquivos no diretório atual com a " "extensão ``.txt``::" +#: ../../library/fnmatch.rst:64 +msgid "" +"import fnmatch\n" +"import os\n" +"\n" +"for file in os.listdir('.'):\n" +" if fnmatch.fnmatch(file, '*.txt'):\n" +" print(file)" +msgstr "" + #: ../../library/fnmatch.rst:74 msgid "" "Test whether the filename string *name* matches the pattern string *pat*, " diff --git a/library/fractions.po b/library/fractions.po index 5e49beb99..619e2754d 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -58,13 +56,31 @@ msgid "" "class:`Fraction` instance with the same value. The next two versions accept " "either a :class:`float` or a :class:`decimal.Decimal` instance, and return " "a :class:`Fraction` instance with exactly the same value. Note that due to " -"the usual issues with binary floating-point (see :ref:`tut-fp-issues`), the " +"the usual issues with binary floating point (see :ref:`tut-fp-issues`), the " "argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so " "``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might " "expect. (But see the documentation for the :meth:`limit_denominator` method " "below.) The last version of the constructor expects a string or unicode " "instance. The usual form for this instance is::" msgstr "" +"A primeira versão requer que *numerator* e *denominator* sejam instâncias " +"de :class:`numbers.Rational` e retorna uma nova instância de :class:" +"`Fraction` com o valor ``numerator/denominator``. Se *denominator* for " +"``0``, ele levanta uma :exc:`ZeroDivisionError`. A segunda versão requer que " +"*other_fraction* seja uma instância de :class:`numbers.Rational` e retorna " +"uma instância de :class:`Fraction` com o mesmo valor. As próximas duas " +"versões aceitam uma instância de :class:`float` ou :class:`decimal.Decimal` " +"e retornam uma instância de :class:`Fraction` com exatamente o mesmo valor. " +"Note que devido aos problemas usuais com ponto flutuante binário (veja :ref:" +"`tut-fp-issues`), o argumento para ``Fraction(1.1)`` não é exatamente igual " +"a 11/10, e então ``Fraction(1.1)`` *não* retorna ``Fraction(11, 10)`` como " +"seria de se esperar. (Mas veja a documentação para o método :meth:" +"`limit_denominator` abaixo.) A última versão do construtor espera uma " +"instância de string ou unicode. A forma usual para esta instância é::" + +#: ../../library/fractions.rst:41 +msgid "[sign] numerator ['/' denominator]" +msgstr "" #: ../../library/fractions.rst:43 msgid "" @@ -84,6 +100,34 @@ msgstr "" "`Fraction`. Em qualquer forma, a string de entrada também pode ter espaços " "em branco à esquerda e/ou à direita. Aqui estão alguns exemplos::" +#: ../../library/fractions.rst:52 +msgid "" +">>> from fractions import Fraction\n" +">>> Fraction(16, -10)\n" +"Fraction(-8, 5)\n" +">>> Fraction(123)\n" +"Fraction(123, 1)\n" +">>> Fraction()\n" +"Fraction(0, 1)\n" +">>> Fraction('3/7')\n" +"Fraction(3, 7)\n" +">>> Fraction(' -3/7 ')\n" +"Fraction(-3, 7)\n" +">>> Fraction('1.414213 \\t\\n')\n" +"Fraction(1414213, 1000000)\n" +">>> Fraction('-.125')\n" +"Fraction(-1, 8)\n" +">>> Fraction('7e-6')\n" +"Fraction(7, 1000000)\n" +">>> Fraction(2.25)\n" +"Fraction(9, 4)\n" +">>> Fraction(1.1)\n" +"Fraction(2476979795053773, 2251799813685248)\n" +">>> from decimal import Decimal\n" +">>> Fraction(Decimal('1.1'))\n" +"Fraction(11, 10)" +msgstr "" + #: ../../library/fractions.rst:78 msgid "" "The :class:`Fraction` class inherits from the abstract base class :class:" @@ -109,9 +153,12 @@ msgstr "" #: ../../library/fractions.rst:88 msgid "" "The :func:`math.gcd` function is now used to normalize the *numerator* and " -"*denominator*. :func:`math.gcd` always return a :class:`int` type. " +"*denominator*. :func:`math.gcd` always returns an :class:`int` type. " "Previously, the GCD type depended on *numerator* and *denominator*." msgstr "" +"A função :func:`math.gcd` agora é usada para normalizar o *numerator* e o " +"*denominator*. :func:`math.gcd` sempre retorna um tipo :class:`int`. " +"Anteriormente, o tipo GCD dependia do *numerator* e do *denominator*." #: ../../library/fractions.rst:93 msgid "" @@ -256,11 +303,32 @@ msgid "" "`Fraction` object ``x`` follows the rules outlined for the :class:`float` " "type in the :ref:`formatspec` section." msgstr "" +"Fornece suporte para formatação em estilo float de instâncias :class:" +"`Fraction` por meio do método :meth:`str.format`, da função embutida :func:" +"`format` ou :ref:`literais de strings formatadas `. Os tipos de " +"apresentação ``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, " +"``\"G\"`` e ``\"%\"`` são suportados. Para esses tipos de apresentação, a " +"formatação para um objeto :class:`Fraction` ``x`` segue as regras descritas " +"para o tipo :class:`float` na seção :ref:`formatspec`." #: ../../library/fractions.rst:212 msgid "Here are some examples::" msgstr "Veja alguns exemplos::" +#: ../../library/fractions.rst:214 +msgid "" +">>> from fractions import Fraction\n" +">>> format(Fraction(1, 7), '.40g')\n" +"'0.1428571428571428571428571428571428571429'\n" +">>> format(Fraction('1234567.855'), '_.2f')\n" +"'1_234_567.86'\n" +">>> f\"{Fraction(355, 113):*>20.6e}\"\n" +"'********3.141593e+00'\n" +">>> old_price, new_price = 499, 672\n" +">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" +"'34.67% price increase'" +msgstr "" + #: ../../library/fractions.rst:228 msgid "Module :mod:`numbers`" msgstr "Módulo :mod:`numbers`" diff --git a/library/frameworks.po b/library/frameworks.po index 4dba43e4a..f392c1d18 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-19 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/ftplib.po b/library/ftplib.po index e9a45967c..6537d5698 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 -# i17obot , 2024 -# Claudio Rogerio Carvalho Filho , 2024 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Claudio Rogerio Carvalho Filho , " -"2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -66,6 +63,28 @@ msgstr "" msgid "Here's a sample session using the :mod:`ftplib` module::" msgstr "" +#: ../../library/ftplib.rst:28 +msgid "" +">>> from ftplib import FTP\n" +">>> ftp = FTP('ftp.us.debian.org') # connect to host, default port\n" +">>> ftp.login() # user anonymous, passwd anonymous@\n" +"'230 Login successful.'\n" +">>> ftp.cwd('debian') # change into \"debian\" directory\n" +"'250 Directory successfully changed.'\n" +">>> ftp.retrlines('LIST') # list directory contents\n" +"-rw-rw-r-- 1 1176 1176 1063 Jun 15 10:18 README\n" +"...\n" +"drwxr-sr-x 5 1176 1176 4096 Dec 19 2000 pool\n" +"drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project\n" +"drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools\n" +"'226 Directory send OK.'\n" +">>> with open('README', 'wb') as fp:\n" +">>> ftp.retrbinary('RETR README', fp.write)\n" +"'226 Transfer complete.'\n" +">>> ftp.quit()\n" +"'221 Goodbye.'" +msgstr "" + #: ../../library/ftplib.rst:51 msgid "Reference" msgstr "Referência" @@ -198,7 +217,7 @@ msgid "" "timeout setting)." msgstr "" -#: ../../library/ftplib.rst:198 +#: ../../library/ftplib.rst:187 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." @@ -237,7 +256,7 @@ msgid "" "Send a simple command string to the server and return the response string." msgstr "" -#: ../../library/ftplib.rst:240 ../../library/ftplib.rst:249 +#: ../../library/ftplib.rst:229 ../../library/ftplib.rst:238 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." @@ -256,8 +275,8 @@ msgstr "" msgid "Retrieve a file in binary transfer mode." msgstr "" -#: ../../library/ftplib.rst:245 ../../library/ftplib.rst:289 -msgid "An appropriate ``STOR`` command: :samp:`\"STOR {filename}\"`." +#: ../../library/ftplib.rst:245 +msgid "An appropriate ``RETR`` command: :samp:`\"RETR {filename}\"`." msgstr "" #: ../../library/ftplib.rst:248 @@ -301,6 +320,10 @@ msgstr "" msgid "Store a file in binary transfer mode." msgstr "" +#: ../../library/ftplib.rst:289 +msgid "An appropriate ``STOR`` command: :samp:`\"STOR {filename}\"`." +msgstr "" + #: ../../library/ftplib.rst:292 msgid "" "A file object (opened in binary mode) which is read until EOF, using its :" @@ -496,6 +519,23 @@ msgstr "" msgid "Here's a sample session using the :class:`FTP_TLS` class::" msgstr "" +#: ../../library/ftplib.rst:516 +msgid "" +">>> ftps = FTP_TLS('ftp.pureftpd.org')\n" +">>> ftps.login()\n" +"'230 Anonymous user logged in'\n" +">>> ftps.prot_p()\n" +"'200 Data protection level set to \"private\"'\n" +">>> ftps.nlst()\n" +"['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', " +"'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', " +"'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-" +"global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', " +"'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', " +"'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', " +"'sound', 'tmp', 'ucarp']" +msgstr "" + #: ../../library/ftplib.rst:524 msgid "" ":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these " diff --git a/library/functional.po b/library/functional.po index eefee8ae5..7a885a44c 100644 --- a/library/functional.po +++ b/library/functional.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-12 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/functions.po b/library/functions.po index 0e7c2bcef..00341edd5 100644 --- a/library/functions.po +++ b/library/functions.po @@ -4,37 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Raphael Mendonça, 2021 -# Sheila Gomes , 2021 -# Misael borges , 2021 -# Welington Carlos , 2021 -# Italo Penaforte , 2021 -# VERUSKA RODRIGUES DA SILVA , 2021 -# felipe caridade fernandes , 2021 -# (Douglas da Silva) , 2021 -# Katyanna Moura , 2021 -# João Porfirio, 2021 -# Vinicius Gubiani Ferreira , 2023 -# Claudio Rogerio Carvalho Filho , 2023 -# Adorilson Bezerra , 2024 # Rafael Fontenelle , 2024 -# i17obot , 2024 -# Marco Rougeth , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Marco Rougeth , 2024\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -417,7 +402,7 @@ msgstr ":func:`__import__`" #: ../../library/functions.rst:59 msgid "" "Return the absolute value of a number. The argument may be an integer, a " -"floating point number, or an object implementing :meth:`~object.__abs__`. If " +"floating-point number, or an object implementing :meth:`~object.__abs__`. If " "the argument is a complex number, its magnitude is returned." msgstr "" "Retorna o valor absoluto de um número. O argumento pode ser um inteiro, um " @@ -447,6 +432,15 @@ msgstr "" "Retorna ``True`` se todos os elementos de *iterable* são verdadeiros (ou se " "*iterable* estiver vazio). Equivalente a::" +#: ../../library/functions.rst:79 +msgid "" +"def all(iterable):\n" +" for element in iterable:\n" +" if not element:\n" +" return False\n" +" return True" +msgstr "" + #: ../../library/functions.rst:89 msgid "" "When awaited, return the next item from the given :term:`asynchronous " @@ -483,6 +477,15 @@ msgstr "" "Retorna ``True`` se algum elemento de *iterable* for verdadeiro. Se " "*iterable* estiver vazio, retorna ``False``. Equivalente a::" +#: ../../library/functions.rst:107 +msgid "" +"def any(iterable):\n" +" for element in iterable:\n" +" if element:\n" +" return True\n" +" return False" +msgstr "" + #: ../../library/functions.rst:116 msgid "" "As :func:`repr`, return a string containing a printable representation of an " @@ -515,37 +518,36 @@ msgstr "" "Se o prefixo \"0b\" é desejado ou não, você pode usar uma das seguintes " "maneiras." -#: ../../library/functions.rst:141 ../../library/functions.rst:855 -#: ../../library/functions.rst:1173 +#: ../../library/functions.rst:141 ../../library/functions.rst:909 +#: ../../library/functions.rst:1246 msgid "See also :func:`format` for more information." msgstr "Veja também :func:`format` para mais informações." #: ../../library/functions.rst:146 msgid "" -"Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted " -"using the standard :ref:`truth testing procedure `. If *x* is false " -"or omitted, this returns ``False``; otherwise, it returns ``True``. The :" -"class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`). " -"It cannot be subclassed further. Its only instances are ``False`` and " -"``True`` (see :ref:`typebool`)." +"Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is " +"converted using the standard :ref:`truth testing procedure `. If the " +"argument is false or omitted, this returns ``False``; otherwise, it returns " +"``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:" +"`typesnumeric`). It cannot be subclassed further. Its only instances are " +"``False`` and ``True`` (see :ref:`typebool`)." msgstr "" -"Retorna um valor Booleano, isto é, ``True`` ou ``False``. *x* é convertida " -"usando o :ref:`procedimento de teste de verdade ` padrão. Se *x* é " -"falso ou foi omitido, isso retorna ``False``; senão ``True``. A classe :" -"class:`bool` é uma subclasse de :class:`int` (veja :ref:`typesnumeric`). Ela " -"não pode ser usada para criar outra subclasse. Suas únicas instâncias são " -"``False`` e ``True`` (veja :ref:`typebool`)." +"Retorna um valor Booleano, isto é, ``True`` ou ``False``. O argumento é " +"convertido usando o :ref:`procedimento de teste de verdade ` padrão. " +"Se o argumento for falso ou foi omitido, isso retorna ``False``; senão " +"``True``. A classe :class:`bool` é uma subclasse de :class:`int` (veja :ref:" +"`typesnumeric`). Ela não pode ser usada para criar outra subclasse. Suas " +"únicas instâncias são ``False`` e ``True`` (veja :ref:`typebool`)." -#: ../../library/functions.rst:155 ../../library/functions.rst:720 -#: ../../library/functions.rst:944 -msgid "*x* is now a positional-only parameter." -msgstr "*x* é agora um parâmetro somente posicional." +#: ../../library/functions.rst:156 ../../library/functions.rst:774 +msgid "The parameter is now positional-only." +msgstr "O parâmetro agora é somente-posicional" -#: ../../library/functions.rst:160 +#: ../../library/functions.rst:161 msgid "" "This function drops you into the debugger at the call site. Specifically, " "it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight " -"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace()` " +"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` " "expecting no arguments. In this case, it is purely a convenience function " "so you don't have to explicitly import :mod:`pdb` or type as much code to " "enter the debugger. However, :func:`sys.breakpointhook` can be set to some " @@ -553,18 +555,8 @@ msgid "" "you to drop into the debugger of choice. If :func:`sys.breakpointhook` is " "not accessible, this function will raise :exc:`RuntimeError`." msgstr "" -"Esta função coloca você no depurador no local da chamada. Especificamente, " -"ela chama :func:`sys.breakpointhook`, passando ``args`` e ``kws`` " -"diretamente. Por padrão, ``sys.breakpointhook()`` chama :func:`pdb." -"set_trace()` não esperando nenhum argumento. Neste caso, isso é puramente " -"uma função de conveniência para você não precisar importar :mod:`pdb` " -"explicitamente ou digitar mais código para entrar no depurador. Contudo, :" -"func:`sys.breakpointhook` pode ser configurado para alguma outra função e :" -"func:`breakpoint` irá automaticamente chamá-la, permitindo você ir para o " -"depurador de sua escolha. Se :func:`sys.breakpointhook` não estiver " -"acessível, esta função vai levantar :exc:`RuntimeError`." -#: ../../library/functions.rst:172 +#: ../../library/functions.rst:173 msgid "" "By default, the behavior of :func:`breakpoint` can be changed with the :" "envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys." @@ -574,7 +566,7 @@ msgstr "" "variável de ambiente :envvar:`PYTHONBREAKPOINT`. Veja :func:`sys." "breakpointhook` para detalhes de uso." -#: ../../library/functions.rst:176 +#: ../../library/functions.rst:177 msgid "" "Note that this is not guaranteed if :func:`sys.breakpointhook` has been " "replaced." @@ -582,7 +574,7 @@ msgstr "" "Observe que isso não é garantido se :func:`sys.breakpointhook` tiver sido " "substituído." -#: ../../library/functions.rst:179 +#: ../../library/functions.rst:180 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." @@ -590,7 +582,7 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.breakpoint`` com " "o argumento ``breakpointhook``." -#: ../../library/functions.rst:189 +#: ../../library/functions.rst:190 msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " @@ -603,7 +595,7 @@ msgstr "" "mutable`, assim como a maior parte dos métodos que o tipo :class:`bytes` " "tem, veja :ref:`bytes-methods`." -#: ../../library/functions.rst:194 +#: ../../library/functions.rst:195 msgid "" "The optional *source* parameter can be used to initialize the array in a few " "different ways:" @@ -611,7 +603,7 @@ msgstr "" "O parâmetro opcional *source* pode ser usado para inicializar o vetor de " "algumas maneiras diferentes:" -#: ../../library/functions.rst:197 +#: ../../library/functions.rst:198 msgid "" "If it is a *string*, you must also give the *encoding* (and optionally, " "*errors*) parameters; :func:`bytearray` then converts the string to bytes " @@ -621,7 +613,7 @@ msgstr "" "opcionalmente, *errors*); :func:`bytearray` então converte a string para " "bytes usando :meth:`str.encode`." -#: ../../library/functions.rst:201 +#: ../../library/functions.rst:202 msgid "" "If it is an *integer*, the array will have that size and will be initialized " "with null bytes." @@ -629,7 +621,7 @@ msgstr "" "Se é um *inteiro*, o vetor terá esse tamanho e será inicializado com bytes " "nulos." -#: ../../library/functions.rst:204 +#: ../../library/functions.rst:205 msgid "" "If it is an object conforming to the :ref:`buffer interface " "`, a read-only buffer of the object will be used to " @@ -639,7 +631,7 @@ msgstr "" "`, um buffer somente leitura do objeto será usado para " "inicializar o vetor de bytes." -#: ../../library/functions.rst:207 +#: ../../library/functions.rst:208 msgid "" "If it is an *iterable*, it must be an iterable of integers in the range ``0 " "<= x < 256``, which are used as the initial contents of the array." @@ -647,15 +639,15 @@ msgstr "" "Se é um *iterável*, deve ser um iterável de inteiros no intervalo ``0 <= x < " "256``, que serão usados como o conteúdo inicial do vetor." -#: ../../library/functions.rst:210 +#: ../../library/functions.rst:211 msgid "Without an argument, an array of size 0 is created." msgstr "Sem nenhum argumento, um vetor de tamanho 0 é criado." -#: ../../library/functions.rst:212 +#: ../../library/functions.rst:213 msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." msgstr "Veja também :ref:`binaryseq` e :ref:`typebytearray`." -#: ../../library/functions.rst:221 +#: ../../library/functions.rst:222 msgid "" "Return a new \"bytes\" object which is an immutable sequence of integers in " "the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :" @@ -667,24 +659,24 @@ msgstr "" "`bytearray` -- tem os mesmos métodos de objetos imutáveis e o mesmo " "comportamento de índices e fatiamento." -#: ../../library/functions.rst:226 +#: ../../library/functions.rst:227 msgid "" "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." msgstr "" "Consequentemente, argumentos do construtor são interpretados como os de :" "func:`bytearray`." -#: ../../library/functions.rst:228 +#: ../../library/functions.rst:229 msgid "Bytes objects can also be created with literals, see :ref:`strings`." msgstr "" "Objetos bytes também podem ser criados com literais, veja :ref:`strings`." -#: ../../library/functions.rst:230 +#: ../../library/functions.rst:231 msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "" "Veja também :ref:`binaryseq`, :ref:`typebytes`, e :ref:`bytes-methods`." -#: ../../library/functions.rst:235 +#: ../../library/functions.rst:236 msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " @@ -699,13 +691,13 @@ msgstr "" "instâncias são chamáveis se suas classes possuem um método :meth:`~object." "__call__`." -#: ../../library/functions.rst:241 +#: ../../library/functions.rst:242 msgid "" "This function was first removed in Python 3.0 and then brought back in " "Python 3.2." msgstr "Esta função foi removida na versão 3.0, mas retornou no Python 3.2." -#: ../../library/functions.rst:248 +#: ../../library/functions.rst:249 msgid "" "Return the string representing a character whose Unicode code point is the " "integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " @@ -715,7 +707,7 @@ msgstr "" "exemplo, ``chr(97)`` retorna a string ``'a'``, enquanto ``chr(8364)`` " "retorna a string ``'€'``. É o inverso de :func:`ord`." -#: ../../library/functions.rst:252 +#: ../../library/functions.rst:253 msgid "" "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in " "base 16). :exc:`ValueError` will be raised if *i* is outside that range." @@ -724,11 +716,11 @@ msgstr "" "16). Será lançada uma exceção :exc:`ValueError` se *i* estiver fora desse " "intervalo." -#: ../../library/functions.rst:258 +#: ../../library/functions.rst:259 msgid "Transform a method into a class method." msgstr "Transforma um método em um método de classe." -#: ../../library/functions.rst:260 +#: ../../library/functions.rst:261 msgid "" "A class method receives the class as an implicit first argument, just like " "an instance method receives the instance. To declare a class method, use " @@ -738,7 +730,14 @@ msgstr "" "exatamente como um método de instância recebe a instância. Para declarar um " "método de classe, faça dessa forma::" -#: ../../library/functions.rst:268 +#: ../../library/functions.rst:265 +msgid "" +"class C:\n" +" @classmethod\n" +" def f(cls, arg1, arg2): ..." +msgstr "" + +#: ../../library/functions.rst:269 msgid "" "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -746,7 +745,7 @@ msgstr "" "O termo ``@classmethod`` é uma função :term:`decoradora ` -- " "veja :ref:`function` para detalhes." -#: ../../library/functions.rst:271 +#: ../../library/functions.rst:272 msgid "" "A class method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). The instance is ignored except for its " @@ -758,7 +757,7 @@ msgstr "" "por sua classe. Se um método de classe é chamado por uma classe derivada, o " "objeto da classe derivada é passado como primeiro argumento implícito." -#: ../../library/functions.rst:276 +#: ../../library/functions.rst:277 msgid "" "Class methods are different than C++ or Java static methods. If you want " "those, see :func:`staticmethod` in this section. For more information on " @@ -768,7 +767,7 @@ msgstr "" "você quer saber desses, veja :func:`staticmethod` nesta seção. Para mais " "informações sobre métodos de classe, consulte :ref:`types`." -#: ../../library/functions.rst:280 +#: ../../library/functions.rst:281 msgid "" "Class methods can now wrap other :term:`descriptors ` such as :" "func:`property`." @@ -776,7 +775,7 @@ msgstr "" "Métodos de classe agora podem envolver outros :term:`descritores " "` tal como :func:`property`." -#: ../../library/functions.rst:284 +#: ../../library/functions.rst:285 msgid "" "Class methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``) and " @@ -786,7 +785,7 @@ msgstr "" "``__name__``, ``__qualname__``, ``__doc__`` e ``__annotations__``) e têm um " "novo atributo ``__wrapped__``." -#: ../../library/functions.rst:289 +#: ../../library/functions.rst:290 msgid "" "Class methods can no longer wrap other :term:`descriptors ` such " "as :func:`property`." @@ -794,7 +793,7 @@ msgstr "" "Métodos de classe não podem mais envolver outros :term:`descritores " "` tal como :func:`property`." -#: ../../library/functions.rst:296 +#: ../../library/functions.rst:297 msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " @@ -806,7 +805,7 @@ msgstr "" "string normal, uma string byte, ou um objeto AST. Consulte a documentação do " "módulo :mod:`ast` para saber como trabalhar com objetos AST." -#: ../../library/functions.rst:301 +#: ../../library/functions.rst:302 msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " @@ -816,7 +815,7 @@ msgstr "" "algum valor reconhecível se isso não foi lido de um arquivo (``''`` " "é comumente usado)." -#: ../../library/functions.rst:305 +#: ../../library/functions.rst:306 msgid "" "The *mode* argument specifies what kind of code must be compiled; it can be " "``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if " @@ -830,7 +829,7 @@ msgstr "" "de uma única instrução interativa (neste último caso, instruções que são " "avaliadas para alguma coisa diferente de ``None`` serão exibidas)." -#: ../../library/functions.rst:311 +#: ../../library/functions.rst:312 msgid "" "The optional arguments *flags* and *dont_inherit* control which :ref:" "`compiler options ` should be activated and which :ref:" @@ -855,7 +854,7 @@ msgstr "" "-- os sinalizadores (recursos futuros e opções do compilador) no código " "circundante são ignorados." -#: ../../library/functions.rst:322 +#: ../../library/functions.rst:323 msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " @@ -872,7 +871,7 @@ msgstr "" "`Sinalizadores de compilador ` podem ser encontrados no " "módulo :mod:`ast`, com o prefixo ``PyCF_``." -#: ../../library/functions.rst:330 +#: ../../library/functions.rst:331 msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -887,7 +886,7 @@ msgstr "" "``__debug__`` é falso) ou ``2`` (strings de documentação também são " "removidas)." -#: ../../library/functions.rst:336 +#: ../../library/functions.rst:337 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "and :exc:`ValueError` if the source contains null bytes." @@ -895,7 +894,7 @@ msgstr "" "Essa função levanta :exc:`SyntaxError` se o código para compilar é inválido, " "e :exc:`ValueError` se o código contém bytes nulos." -#: ../../library/functions.rst:339 +#: ../../library/functions.rst:340 msgid "" "If you want to parse Python code into its AST representation, see :func:`ast." "parse`." @@ -903,15 +902,7 @@ msgstr "" "Se você quer analisar código Python em sua representação AST, veja :func:" "`ast.parse`." -#: ../../library/functions.rst:342 -msgid "" -"Raises an :ref:`auditing event ` ``compile`` with arguments " -"``source``, ``filename``." -msgstr "" -"Levanta um :ref:`evento de auditoria ` ``compile`` com argumentos " -"``source``, ``filename``." - -#: ../../library/functions.rst:344 +#: ../../library/functions.rst:343 ../../library/functions.rst:345 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source`` and ``filename``. This event may also be raised by implicit " @@ -921,7 +912,7 @@ msgstr "" "argumentos ``source``, ``filename``. Esse evento pode também ser levantando " "por uma compilação implícita." -#: ../../library/functions.rst:350 +#: ../../library/functions.rst:351 msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " "mode, input must be terminated by at least one newline character. This is " @@ -933,7 +924,7 @@ msgstr "" "linhas. Isso é para facilitar a detecção de instruções completas e " "incompletas no módulo :mod:`code`." -#: ../../library/functions.rst:357 +#: ../../library/functions.rst:358 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string when compiling to an AST object due to stack depth " @@ -943,7 +934,7 @@ msgstr "" "grande/complexa ao compilar para um objeto AST, devido limitações do tamanho " "da pilha no compilador AST do Python." -#: ../../library/functions.rst:361 +#: ../../library/functions.rst:362 msgid "" "Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode " "does not have to end in a newline anymore. Added the *optimize* parameter." @@ -952,7 +943,7 @@ msgstr "" "disso, em modo ``'exec'`` a entrada não precisa mais terminar com uma nova " "linha. Também foi adicionado o parâmetro *optimize*." -#: ../../library/functions.rst:365 +#: ../../library/functions.rst:366 msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." @@ -960,7 +951,7 @@ msgstr "" "Anteriormente, :exc:`TypeError` era levantada quando havia bytes nulos em " "*source*." -#: ../../library/functions.rst:369 +#: ../../library/functions.rst:370 msgid "" "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable " "support for top-level ``await``, ``async for``, and ``async with``." @@ -969,61 +960,116 @@ msgstr "" "habilitar o suporte em nível superior a ``await``, ``async for``, e ``async " "with``." -#: ../../library/functions.rst:377 -msgid "" -"Return a complex number with the value *real* + *imag*\\*1j or convert a " -"string or number to a complex number. If the first parameter is a string, " -"it will be interpreted as a complex number and the function must be called " -"without a second parameter. The second parameter can never be a string. " -"Each argument may be any numeric type (including complex). If *imag* is " -"omitted, it defaults to zero and the constructor serves as a numeric " -"conversion like :class:`int` and :class:`float`. If both arguments are " -"omitted, returns ``0j``." -msgstr "" -"Retorna um número completo com o valor *real* + *imag*\\*1j ou converte uma " -"string ou número para um número complexo. Se o primeiro parâmetro é uma " -"string, ele será interpretado como um número complexo e a função deve ser " -"chamada sem um segundo parâmetro. O segundo parâmetro nunca deve ser uma " -"string. Cada argumento pode ser qualquer tipo numérico (incluindo complexo). " -"Se *imag* é omitido, seu valor padrão é zero e a construção funciona como " -"uma conversão numérica, similar a :class:`int` e :class:`float`. Se os dois " -"argumentos são omitidos, retorna ``0j``." - -#: ../../library/functions.rst:386 -msgid "" -"For a general Python object ``x``, ``complex(x)`` delegates to ``x." -"__complex__()``. If :meth:`~object.__complex__` is not defined then it " -"falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not " -"defined then it falls back to :meth:`~object.__index__`." -msgstr "" -"Para um objeto Python ``x`` qualquer, ``complex(x)`` delega para ``x." -"__complex__()``. Se :meth:`~object.__complex__` não está definido então a " -"chamada é repassada para :meth:`~object.__float__`. Se :meth:`!__float__` " -"não está definido então a chamada é, novamente, repassada para :meth:" -"`~object.__index__`." - -#: ../../library/functions.rst:393 -msgid "" -"When converting from a string, the string must not contain whitespace around " -"the central ``+`` or ``-`` operator. For example, ``complex('1+2j')`` is " -"fine, but ``complex('1 + 2j')`` raises :exc:`ValueError`." -msgstr "" -"Quando convertendo a partir de uma string, a string não pode conter espaços " -"em branco em torno ``+`` central ou do operador ``-``. Por exemplo, " -"``complex('1+2j')`` funciona, mas ``complex('1 + 2j')`` levanta :exc:" -"`ValueError`." - -#: ../../library/functions.rst:398 +#: ../../library/functions.rst:379 +msgid "" +"Convert a single string or number to a complex number, or create a complex " +"number from real and imaginary parts." +msgstr "" +"Converte uma única string ou número para um número complexo, ou cria um " +"número complexo a partir de partes real e imaginária." + +#: ../../library/functions.rst:382 ../../library/functions.rst:719 +#: ../../library/functions.rst:965 +msgid "Examples:" +msgstr "Exemplos:" + +#: ../../library/functions.rst:384 +msgid "" +">>> complex('+1.23')\n" +"(1.23+0j)\n" +">>> complex('-4.5j')\n" +"-4.5j\n" +">>> complex('-1.23+4.5j')\n" +"(-1.23+4.5j)\n" +">>> complex('\\t( -1.23+4.5J )\\n')\n" +"(-1.23+4.5j)\n" +">>> complex('-Infinity+NaNj')\n" +"(-inf+nanj)\n" +">>> complex(1.23)\n" +"(1.23+0j)\n" +">>> complex(imag=-4.5)\n" +"-4.5j\n" +">>> complex(-1.23, 4.5)\n" +"(-1.23+4.5j)" +msgstr "" + +#: ../../library/functions.rst:403 +msgid "" +"If the argument is a string, it must contain either a real part (in the same " +"format as for :func:`float`) or an imaginary part (in the same format but " +"with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the " +"sign of the imaginary part is mandatory in this case). The string can " +"optionally be surrounded by whitespaces and the round parentheses ``'('`` " +"and ``')'``, which are ignored. The string must not contain whitespace " +"between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal " +"number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` " +"raises :exc:`ValueError`. More precisely, the input must conform to the :" +"token:`~float:complexvalue` production rule in the following grammar, after " +"parentheses and leading and trailing whitespace characters are removed:" +msgstr "" +"Se o argumento for uma string, ele deve conter ou a parte real (com o mesmo " +"formato usado em :func:`float`) ou uma parte imaginária (com o mesmo " +"formato, mas com um sufixo ``'j'`` ou ``'J'``), ou então ambas as partes " +"real e imaginária (caso no qual o sinal da parte imaginária é obrigatório). " +"A string pode opcionalmente ser cercada por espaços em branco e parênteses " +"``'('`` e ``')'``, que são ignorados. A string não deve conter espaços em " +"branco entre os símbolos ``'+'``, ``'-'``, o sufixo ``'j'`` ou ``'J'``, e o " +"número decimal. Por examplo, ``complex('1+2j')`` é ok, mas ``complex('1 + " +"2j')`` levanta :exc:`ValueError`. Mais precisamente, após descartar os " +"parênteses e os espaços em branco do início e do final, a entrada deve ser " +"conforme a regra de produção :token:`~float:complexvalue` da gramática a " +"seguir:" + +#: ../../library/functions.rst:422 +msgid "" +"If the argument is a number, the constructor serves as a numeric conversion " +"like :class:`int` and :class:`float`. For a general Python object ``x``, " +"``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object." +"__complex__` is not defined then it falls back to :meth:`~object.__float__`. " +"If :meth:`!__float__` is not defined then it falls back to :meth:`~object." +"__index__`." +msgstr "" +"Se o argumento for um número, o construtor serve como uma conversão numérica " +"tal qual :class:`int` e :class:`float`. Para um objeto Python ``x`` " +"qualquer, ``complex(x)`` delega para ``x.__complex__()``. Se :meth:`~object." +"__complex__` não está definido então a chamada é repassada para :meth:" +"`~object.__float__`. Se :meth:`!__float__` não está definido então a chamada " +"é, novamente, repassada para :meth:`~object.__index__`." + +#: ../../library/functions.rst:431 +msgid "" +"If two arguments are provided or keyword arguments are used, each argument " +"may be any numeric type (including complex). If both arguments are real " +"numbers, return a complex number with the real component *real* and the " +"imaginary component *imag*. If both arguments are complex numbers, return a " +"complex number with the real component ``real.real-imag.imag`` and the " +"imaginary component ``real.imag+imag.real``. If one of arguments is a real " +"number, only its real component is used in the above expressions." +msgstr "" +"Se dois argumentos forem passados ou argumentos nomeados forem usados, cada " +"argumento pode ser de qualquer tipo numérico (incluindo complexo). Se ambos " +"argumentos forem números reais, é retornado um número complexo com *real* " +"como parte real e *imag* como parte imaginária. Se ambos os argumentos forem " +"números complexos, é retornado um número complexo com parte real ``real.real-" +"imag.imag`` e parte imaginária ``real.imag+imag.real``. Se um dos argumentos " +"for um número real, somente a sua parte real é usada nas expressões " +"anteriores." + +#: ../../library/functions.rst:441 +msgid "If all arguments are omitted, returns ``0j``." +msgstr "Se todos os argumentos forem omitidos, retorna ``0j``." + +#: ../../library/functions.rst:443 msgid "The complex type is described in :ref:`typesnumeric`." msgstr "O tipo complexo está descrito em :ref:`typesnumeric`." -#: ../../library/functions.rst:400 ../../library/functions.rst:717 -#: ../../library/functions.rst:941 +#: ../../library/functions.rst:445 ../../library/functions.rst:771 +#: ../../library/functions.rst:1014 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "" "Agrupar dígitos com sublinhados como em literais de código é permitido." -#: ../../library/functions.rst:403 +#: ../../library/functions.rst:448 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" "meth:`~object.__float__` are not defined." @@ -1031,7 +1077,7 @@ msgstr "" "Chamadas para :meth:`~object.__index__` se :meth:`~object.__complex__` e :" "meth:`~object.__float__` não estão definidas." -#: ../../library/functions.rst:410 +#: ../../library/functions.rst:455 msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " "string. The string must be the name of one of the object's attributes. The " @@ -1045,7 +1091,7 @@ msgstr "" "exemplo, ``delattr(x, 'foobar')`` é equivalente a ``del x.foobar``. *name* " "não precisa ser um identificador Python (veja :func:`setattr`)." -#: ../../library/functions.rst:423 +#: ../../library/functions.rst:468 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." @@ -1053,7 +1099,7 @@ msgstr "" "Cria um novo dicionário. O objeto :class:`dict` é a classe do dicionário. " "Veja :class:`dict` e :ref:`typesmapping` para documentação sobre esta classe." -#: ../../library/functions.rst:426 +#: ../../library/functions.rst:471 msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." @@ -1061,7 +1107,7 @@ msgstr "" "Para outros contêineres, consulte as classes embutidas :class:`list`, :class:" "`set` e :class:`tuple`, bem como o módulo :mod:`collections`." -#: ../../library/functions.rst:433 +#: ../../library/functions.rst:478 msgid "" "Without arguments, return the list of names in the current local scope. " "With an argument, attempt to return a list of valid attributes for that " @@ -1070,7 +1116,7 @@ msgstr "" "Sem argumentos, devolve a lista de nomes no escopo local atual. Com um " "argumento, tentará devolver uma lista de atributos válidos para esse objeto." -#: ../../library/functions.rst:436 +#: ../../library/functions.rst:481 msgid "" "If the object has a method named :meth:`~object.__dir__`, this method will " "be called and must return the list of attributes. This allows objects that " @@ -1084,7 +1130,7 @@ msgstr "" "func:`~object.__getattribute__` personalizem a maneira como :func:`dir` " "relata seus atributos." -#: ../../library/functions.rst:443 +#: ../../library/functions.rst:488 msgid "" "If the object does not provide :meth:`~object.__dir__`, the function tries " "its best to gather information from the object's :attr:`~object.__dict__` " @@ -1098,7 +1144,7 @@ msgstr "" "necessariamente completa e pode ser imprecisa quando o objeto possui um :" "func:`~object.__getattr__` personalizado." -#: ../../library/functions.rst:449 +#: ../../library/functions.rst:494 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -1108,7 +1154,7 @@ msgstr "" "diferentes tipos de objetos, pois tenta produzir as informações mais " "relevantes e não completas:" -#: ../../library/functions.rst:453 +#: ../../library/functions.rst:498 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." @@ -1116,7 +1162,7 @@ msgstr "" "Se o objeto for um objeto de módulo, a lista conterá os nomes dos atributos " "do módulo." -#: ../../library/functions.rst:456 +#: ../../library/functions.rst:501 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." @@ -1124,7 +1170,7 @@ msgstr "" "Se o objeto for um objeto de tipo ou classe, a lista conterá os nomes de " "seus atributos e recursivamente os atributos de suas bases." -#: ../../library/functions.rst:459 +#: ../../library/functions.rst:504 msgid "" "Otherwise, the list contains the object's attributes' names, the names of " "its class's attributes, and recursively of the attributes of its class's " @@ -1134,11 +1180,11 @@ msgstr "" "dos atributos da classe e recursivamente os atributos das classes base da " "classe." -#: ../../library/functions.rst:463 +#: ../../library/functions.rst:508 msgid "The resulting list is sorted alphabetically. For example:" msgstr "A lista resultante é alfabeticamente ordenada. Por exemplo:" -#: ../../library/functions.rst:483 +#: ../../library/functions.rst:528 msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1153,28 +1199,27 @@ msgstr "" "lançamentos. Por exemplo, os atributos de metaclasse não estão na lista de " "resultados quando o argumento é uma classe." -#: ../../library/functions.rst:493 +#: ../../library/functions.rst:538 msgid "" "Take two (non-complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " "With mixed operand types, the rules for binary arithmetic operators apply. " -"For integers, the result is the same as ``(a // b, a % b)``. For floating " +"For integers, the result is the same as ``(a // b, a % b)``. For floating-" "point numbers the result is ``(q, a % b)``, where *q* is usually ``math." "floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` " "is very close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, " "and ``0 <= abs(a % b) < abs(b)``." msgstr "" -"Toma dois números (não complexos) como argumentos e retorna um par de " -"números que consiste em seu quociente e restante ao usar a divisão inteira. " -"Com tipos de operandos mistos, as regras para operadores aritméticos " -"binários se aplicam. Para números inteiros, o resultado é o mesmo que " -"``(a // b, a % b)``. Para números de ponto flutuante, o resultado é ``(q, a " -"% b)``, onde *q* geralmente é ``math.floor(a / b)``, mas pode ser 1 a menos " -"que isso. Em qualquer caso, ``q * b + a % b`` está muito próximo de *a*, se " -"``a % b`` é diferente de zero, tem o mesmo sinal que *b* e ``0 <= abs(a % b) " -"< abs(b)``." +"Recebe dois números (não complexos) como argumentos e retorna um par de " +"números que consiste em seu quociente e resto ao usar a divisão inteira. Com " +"tipos de operandos mistos, as regras para operadores aritméticos binários se " +"aplicam. Para números inteiros, o resultado é o mesmo que ``(a // b, a % " +"b)``. Para números de ponto flutuante, o resultado é ``(q, a % b)``, onde " +"*q* geralmente é ``math.floor(a / b)``, mas pode ser 1 a menos que isso. Em " +"qualquer caso, ``q * b + a % b`` está muito próximo de *a*, se ``a % b`` é " +"diferente de zero, tem o mesmo sinal que *b* e ``0 <= abs(a % b) < abs(b)``." -#: ../../library/functions.rst:505 +#: ../../library/functions.rst:550 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1188,23 +1233,32 @@ msgstr "" "tupla contendo uma contagem (a partir de *start*, cujo padrão é 0) e os " "valores obtidos na iteração sobre *iterable*." -#: ../../library/functions.rst:517 +#: ../../library/functions.rst:562 msgid "Equivalent to::" msgstr "Equivalente a::" +#: ../../library/functions.rst:564 +msgid "" +"def enumerate(iterable, start=0):\n" +" n = start\n" +" for elem in iterable:\n" +" yield n, elem\n" +" n += 1" +msgstr "" + #: ../../library/functions.rst:0 msgid "Parameters" msgstr "Parâmetros" -#: ../../library/functions.rst:529 +#: ../../library/functions.rst:574 msgid "A Python expression." msgstr "Uma expressão Python." -#: ../../library/functions.rst:533 +#: ../../library/functions.rst:578 msgid "The global namespace (default: ``None``)." msgstr "O espaço de nomes global (por padrão, ``None``)." -#: ../../library/functions.rst:537 +#: ../../library/functions.rst:582 msgid "The local namespace (default: ``None``)." msgstr "O espaço de nomes local (por padrão, ``None``)." @@ -1212,7 +1266,7 @@ msgstr "O espaço de nomes local (por padrão, ``None``)." msgid "Returns" msgstr "Retorna" -#: ../../library/functions.rst:541 +#: ../../library/functions.rst:586 msgid "The result of the evaluated expression." msgstr "O resultado da expressão avaliada." @@ -1220,11 +1274,11 @@ msgstr "O resultado da expressão avaliada." msgid "raises" msgstr "levanta" -#: ../../library/functions.rst:542 +#: ../../library/functions.rst:587 msgid "Syntax errors are reported as exceptions." msgstr "Erros de sintaxe são reportados como exceções." -#: ../../library/functions.rst:544 +#: ../../library/functions.rst:589 msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " @@ -1254,11 +1308,11 @@ msgstr "" "em que :func:`eval` é chamado. Observe que *eval()* não tem acesso a :term:" "`escopos aninhados ` (não locais) no ambiente anexo." -#: ../../library/functions.rst:559 +#: ../../library/functions.rst:604 msgid "Example:" msgstr "Exemplo:" -#: ../../library/functions.rst:565 +#: ../../library/functions.rst:610 msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " @@ -1270,7 +1324,7 @@ msgstr "" "vez de uma string. Se o objeto código foi compilado com ``'exec'`` como o " "argumento *mode*, o valor de retorno de :func:`eval` será ``None``." -#: ../../library/functions.rst:570 +#: ../../library/functions.rst:615 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1282,7 +1336,7 @@ msgstr "" "global e local atual, respectivamente, o que pode ser útil para ser usado " "por :func:`eval` ou :func:`exec`." -#: ../../library/functions.rst:575 +#: ../../library/functions.rst:620 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." @@ -1290,7 +1344,7 @@ msgstr "" "Se a fonte fornecida for uma string, os espaços e tabulações à esquerda ou à " "direita serão removidos." -#: ../../library/functions.rst:578 +#: ../../library/functions.rst:623 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1298,15 +1352,8 @@ msgstr "" "Veja :func:`ast.literal_eval` para uma função que pode avaliar com segurança " "strings com expressões contendo apenas literais." -#: ../../library/functions.rst:581 ../../library/functions.rst:622 -msgid "" -"Raises an :ref:`auditing event ` ``exec`` with argument " -"``code_object``." -msgstr "" -"Levanta um :ref:`evento de auditoria ` ``exec`` com argumento " -"``code_object``." - -#: ../../library/functions.rst:583 ../../library/functions.rst:624 +#: ../../library/functions.rst:626 ../../library/functions.rst:628 +#: ../../library/functions.rst:671 ../../library/functions.rst:673 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1315,7 +1362,7 @@ msgstr "" "objeto como argumento. Eventos de compilação de código também podem ser " "levantados." -#: ../../library/functions.rst:590 +#: ../../library/functions.rst:635 msgid "" "This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " @@ -1327,19 +1374,8 @@ msgid "" "not be used outside of function definitions even within the context of code " "passed to the :func:`exec` function. The return value is ``None``." msgstr "" -"Esta função tem suporte a execução dinâmica de código Python. O parâmetro " -"*object* deve ser ou uma string ou um objeto código. Se for uma string, a " -"mesma é analisada como um conjunto de instruções Python, o qual é então " -"executado (exceto caso um erro de sintaxe ocorra). [#]_ Se for um objeto " -"código, ele é simplesmente executado. Em todos os casos, espera-se que o " -"código a ser executado seja válido como um arquivo de entrada (veja a seção :" -"ref:`file-input` no Manual de Referência). Tenha cuidado, pois as " -"instruções :keyword:`nonlocal`, :keyword:`yield` e :keyword:`return` não " -"podem ser usadas fora das definições de funções mesmo dentro do contexto do " -"código passado para a função :func:`exec` . O valor de retorno é sempre " -"``None``." -#: ../../library/functions.rst:601 +#: ../../library/functions.rst:646 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1347,9 +1383,7 @@ msgid "" "the local variables. If *globals* and *locals* are given, they are used for " "the global and local variables, respectively. If provided, *locals* can be " "any mapping object. Remember that at the module level, globals and locals " -"are the same dictionary. If exec gets two separate objects as *globals* and " -"*locals*, the code will be executed as if it were embedded in a class " -"definition." +"are the same dictionary." msgstr "" "Em todos os casos, se os parâmetros opcionais são omitidos, o código é " "executado no escopo atual. Se somente *globals* é fornecido, deve ser um " @@ -1358,11 +1392,16 @@ msgstr "" "fornecidos, eles são usados para as variáveis globais e locais, " "respectivamente. Se fornecido, *locals* pode ser qualquer objeto de " "mapeamento. Lembre que no nível de módulo, globais e locais são o mesmo " -"dicionário. Se o exec recebe dois objetos separados como *globals* and " -"*locals*, o código será executado como se estivesse embutido em uma " -"definição de classe." +"dicionário." + +#: ../../library/functions.rst:656 +msgid "" +"Most users should just pass a *globals* argument and never *locals*. If exec " +"gets two separate objects as *globals* and *locals*, the code will be " +"executed as if it were embedded in a class definition." +msgstr "" -#: ../../library/functions.rst:611 +#: ../../library/functions.rst:660 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1376,7 +1415,7 @@ msgstr "" "disponíveis para o código executado é inserindo seu próprio ``__builtins__`` " "dicionário em *globals* antes de passar para :func:`exec`." -#: ../../library/functions.rst:617 +#: ../../library/functions.rst:666 msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " "valid when the *object* is a code object containing free variables. The " @@ -1388,7 +1427,7 @@ msgstr "" "O comprimento da tupla deve corresponder exatamente ao número de variáveis " "livres referenciadas pelo objeto código." -#: ../../library/functions.rst:629 +#: ../../library/functions.rst:678 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local dictionary, respectively, which may be useful to pass " @@ -1398,23 +1437,19 @@ msgstr "" "global e local, respectivamente, o que pode ser útil para passar adiante e " "usar como segundo ou terceiro argumento para :func:`exec`." -#: ../../library/functions.rst:635 +#: ../../library/functions.rst:684 msgid "" "The default *locals* act as described for function :func:`locals` below: " "modifications to the default *locals* dictionary should not be attempted. " "Pass an explicit *locals* dictionary if you need to see effects of the code " "on *locals* after function :func:`exec` returns." msgstr "" -"*locals* padrão atua como descrito pela função :func:`locals` abaixo: " -"modificações para o dicionário *locals* padrão não deveriam ser feitas. Se " -"você precisa ver efeitos do código em *locals* depois da função :func:`exec` " -"retornar passe um dicionário *locals* explícito." -#: ../../library/functions.rst:640 +#: ../../library/functions.rst:689 msgid "Added the *closure* parameter." msgstr "Adicionado o parâmetro *closure*." -#: ../../library/functions.rst:646 +#: ../../library/functions.rst:695 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1427,7 +1462,7 @@ msgstr "" "identidade será usada, isto é, todos os elementos de *iterable* que são " "falsos são removidos." -#: ../../library/functions.rst:652 +#: ../../library/functions.rst:701 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1439,7 +1474,7 @@ msgstr "" "``None`` e ``(item for item in iterable if item)`` se *function* for " "``None``." -#: ../../library/functions.rst:657 +#: ../../library/functions.rst:706 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1447,32 +1482,46 @@ msgstr "" "Veja :func:`itertools.filterfalse` para a função complementar que devolve " "elementos de *iterable* para os quais *function* é falso." -#: ../../library/functions.rst:667 -msgid "Return a floating point number constructed from a number or string *x*." +#: ../../library/functions.rst:717 +msgid "Return a floating-point number constructed from a number or a string." msgstr "" -"Devolve um número de ponto flutuante construído a partir de um número ou " -"string *x*." +"Retorna um número de ponto flutuante construído a partir de um número ou " +"string." -#: ../../library/functions.rst:669 +#: ../../library/functions.rst:721 +msgid "" +">>> float('+1.23')\n" +"1.23\n" +">>> float(' -12345\\n')\n" +"-12345.0\n" +">>> float('1e-003')\n" +"0.001\n" +">>> float('+1E6')\n" +"1000000.0\n" +">>> float('-Infinity')\n" +"-inf" +msgstr "" + +#: ../../library/functions.rst:734 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " "sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value " "produced. The argument may also be a string representing a NaN (not-a-" -"number), or positive or negative infinity. More precisely, the input must " -"conform to the ``floatvalue`` production rule in the following grammar, " -"after leading and trailing whitespace characters are removed:" +"number), or positive or negative infinity. More precisely, the input must " +"conform to the :token:`~float:floatvalue` production rule in the following " +"grammar, after leading and trailing whitespace characters are removed:" msgstr "" "Se o argumento for uma string, ele deve conter um número decimal, " "opcionalmente precedido por um sinal e opcionalmente embutido em um espaço " "em branco. O sinal opcional pode ser ``'+'`` ou ``'-'``; um sinal ``'+'`` " "não tem efeito no valor produzido. O argumento também pode ser uma string " "representando um NaN (não um número) ou infinito positivo ou negativo. Mais " -"precisamente, a entrada deve estar de acordo com a regra de produção " -"``floatvalue`` na seguinte gramática, depois que os espaços em branco " +"precisamente, a entrada deve estar de acordo com a regra de produção :token:" +"`~float:floatvalue` na seguinte gramática, depois que os espaços em branco " "iniciais e finais forem removidos:" -#: ../../library/functions.rst:688 +#: ../../library/functions.rst:755 msgid "" "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " "and \"iNfINity\" are all acceptable spellings for positive infinity." @@ -1481,19 +1530,19 @@ msgstr "" "\"INFINITY\" e \"iNfINity\" são todas grafias aceitáveis para o infinito " "positivo." -#: ../../library/functions.rst:691 +#: ../../library/functions.rst:758 msgid "" -"Otherwise, if the argument is an integer or a floating point number, a " -"floating point number with the same value (within Python's floating point " +"Otherwise, if the argument is an integer or a floating-point number, a " +"floating-point number with the same value (within Python's floating-point " "precision) is returned. If the argument is outside the range of a Python " "float, an :exc:`OverflowError` will be raised." msgstr "" "Caso contrário, se o argumento é um inteiro ou um número de ponto flutuante, " "um número de ponto flutuante com o mesmo valor (com a precisão de ponto " -"flutuante de Python) é devolvido. Se o argumento está fora do intervalo de " +"flutuante de Python) é retornado. Se o argumento está fora do intervalo de " "um ponto flutuante Python, uma exceção :exc:`OverflowError` será lançada." -#: ../../library/functions.rst:696 +#: ../../library/functions.rst:763 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1503,19 +1552,15 @@ msgstr "" "__float__()``. Se :meth:`~object.__float__` não estiver definido, então ele " "delega para o método :meth:`~object.__index__`." -#: ../../library/functions.rst:700 +#: ../../library/functions.rst:767 msgid "If no argument is given, ``0.0`` is returned." msgstr "Se nenhum argumento for fornecido, será retornado ``0.0``." -#: ../../library/functions.rst:702 -msgid "Examples::" -msgstr "Exemplos::" - -#: ../../library/functions.rst:715 +#: ../../library/functions.rst:769 msgid "The float type is described in :ref:`typesnumeric`." msgstr "O tipo float é descrito em :ref:`typesnumeric`." -#: ../../library/functions.rst:723 +#: ../../library/functions.rst:777 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." @@ -1523,7 +1568,7 @@ msgstr "" "Chamada para :meth:`~object.__index__` se :meth:`~object.__float__` não está " "definido." -#: ../../library/functions.rst:733 +#: ../../library/functions.rst:787 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1535,7 +1580,7 @@ msgstr "" "argumento *value*; no entanto há uma sintaxe de formatação padrão usada pela " "maioria dos tipos embutidos: :ref:`formatspec`." -#: ../../library/functions.rst:738 +#: ../../library/functions.rst:792 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1543,7 +1588,7 @@ msgstr "" "O *format_spec* padrão é uma string vazia que geralmente produz o mesmo " "efeito que chamar :func:`str(value) `." -#: ../../library/functions.rst:741 +#: ../../library/functions.rst:795 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1559,7 +1604,7 @@ msgstr "" "*format_spec* não estiver vazio, ou se o *format_spec* ou o valor de retorno " "não forem strings." -#: ../../library/functions.rst:748 +#: ../../library/functions.rst:802 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1567,7 +1612,7 @@ msgstr "" "``object().__format__(format_spec)`` levanta um :exc:`TypeError` se " "*format_spec* não for uma string vazia." -#: ../../library/functions.rst:757 +#: ../../library/functions.rst:811 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1577,7 +1622,7 @@ msgstr "" "obtidos de *iterable*. ``frozenset`` é uma classe embutida. Veja :class:" "`frozenset` e :ref:`types-set` para documentação sobre essas classes." -#: ../../library/functions.rst:761 +#: ../../library/functions.rst:815 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1586,7 +1631,7 @@ msgstr "" "`list`, :class:`tuple`, e :class:`dict`, assim como o módulo :mod:" "`collections`." -#: ../../library/functions.rst:769 +#: ../../library/functions.rst:823 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1602,7 +1647,7 @@ msgstr "" "fornecido, caso contrário a exceção :exc:`AttributeError` é levantada. " "*name* não precisa ser um identificador Python (veja :func:`setattr`)." -#: ../../library/functions.rst:778 +#: ../../library/functions.rst:832 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1614,7 +1659,7 @@ msgstr "" "atributo privado (atributos com dois sublinhados à esquerda) para recuperá-" "lo com :func:`getattr`." -#: ../../library/functions.rst:786 +#: ../../library/functions.rst:840 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1624,7 +1669,7 @@ msgstr "" "código dentro de funções, isso é definido quando a função é definida e " "permanece o mesmo, independentemente de onde a função é chamada." -#: ../../library/functions.rst:793 +#: ../../library/functions.rst:847 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1636,7 +1681,7 @@ msgstr "" "implementado chamando ``getattr(object, name)`` e vendo se levanta um :exc:" "`AttributeError` ou não.)" -#: ../../library/functions.rst:801 +#: ../../library/functions.rst:855 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1649,7 +1694,7 @@ msgstr "" "comparados são iguais, possuem o mesmo valor hash (mesmo que eles sejam de " "tipos diferentes, como é o caso de 1 e 1.0)." -#: ../../library/functions.rst:808 +#: ../../library/functions.rst:862 msgid "" "For objects with custom :meth:`~object.__hash__` methods, note that :func:" "`hash` truncates the return value based on the bit width of the host machine." @@ -1658,7 +1703,7 @@ msgstr "" "atento que :func:`hash` trunca o valor devolvido baseado no comprimento de " "bits da máquina hospedeira." -#: ../../library/functions.rst:815 +#: ../../library/functions.rst:869 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1675,7 +1720,7 @@ msgstr "" "console. Se o argumento é qualquer outro tipo de objeto, uma página de ajuda " "para o objeto é gerada." -#: ../../library/functions.rst:822 +#: ../../library/functions.rst:876 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1687,13 +1732,13 @@ msgstr "" "barra são apenas posicionais. Para mais informações, veja :ref:`a entrada no " "FAQ sobre parâmetros somente-posicionais `." -#: ../../library/functions.rst:827 +#: ../../library/functions.rst:881 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "" "Esta função é adicionada ao espaço de nomes embutido pelo módulo :mod:`site`." -#: ../../library/functions.rst:829 +#: ../../library/functions.rst:883 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1701,7 +1746,7 @@ msgstr "" "Mudanças em :mod:`pydoc` e :mod:`inspect` significam que as assinaturas " "reportadas para chamáveis agora são mais compreensíveis e consistentes." -#: ../../library/functions.rst:836 +#: ../../library/functions.rst:890 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1712,7 +1757,7 @@ msgstr "" "tem que definir um método :meth:`~object.__index__` que retorne um inteiro. " "Alguns exemplos:" -#: ../../library/functions.rst:845 +#: ../../library/functions.rst:899 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1722,7 +1767,7 @@ msgstr "" "letras maiúsculas ou minúsculas, com prefixo ou sem, você pode usar qualquer " "uma das seguintes maneiras:" -#: ../../library/functions.rst:857 +#: ../../library/functions.rst:911 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." @@ -1730,7 +1775,7 @@ msgstr "" "Veja também :func:`int` para converter uma string hexadecimal para um " "inteiro usando a base 16." -#: ../../library/functions.rst:862 +#: ../../library/functions.rst:916 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." @@ -1738,7 +1783,7 @@ msgstr "" "Para obter uma string hexadecimal de um ponto flutuante, use o método :meth:" "`float.hex`." -#: ../../library/functions.rst:868 +#: ../../library/functions.rst:922 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1750,11 +1795,11 @@ msgstr "" "vida. Dois objetos com ciclos de vida não sobrepostos podem ter o mesmo " "valor para :func:`id`." -#: ../../library/functions.rst:873 +#: ../../library/functions.rst:927 msgid "This is the address of the object in memory." msgstr "Este é o endereço do objeto na memória." -#: ../../library/functions.rst:875 +#: ../../library/functions.rst:929 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." @@ -1762,7 +1807,7 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.id`` com o " "argumento ``id``." -#: ../../library/functions.rst:881 +#: ../../library/functions.rst:935 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1775,7 +1820,15 @@ msgstr "" "final), e devolve isso. Quando o final do arquivo (EOF / end-of-file) é " "encontrado, um erro :exc:`EOFError` é levantado. Exemplo::" -#: ../../library/functions.rst:891 +#: ../../library/functions.rst:940 +msgid "" +">>> s = input('--> ') \n" +"--> Monty Python's Flying Circus\n" +">>> s \n" +"\"Monty Python's Flying Circus\"" +msgstr "" + +#: ../../library/functions.rst:945 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1783,15 +1836,7 @@ msgstr "" "Se o módulo :mod:`readline` foi carregado, então :func:`input` usará ele " "para prover edição de linhas elaboradas e funcionalidades de histórico." -#: ../../library/functions.rst:894 -msgid "" -"Raises an :ref:`auditing event ` ``builtins.input`` with argument " -"``prompt``." -msgstr "" -"Levanta um :ref:`evento de auditoria ` ``builtins.input`` com " -"argumento ``prompt``." - -#: ../../library/functions.rst:896 +#: ../../library/functions.rst:948 ../../library/functions.rst:950 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1799,54 +1844,68 @@ msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.input`` com " "argumento ``prompt`` antes de ler a entrada." -#: ../../library/functions.rst:899 +#: ../../library/functions.rst:953 ../../library/functions.rst:955 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " -"argument ``result``." +"the result after successfully reading input." msgstr "" "Levanta um :ref:`evento de auditoria ` ``builtins.input/result`` " -"com argumento ``result``." +"com o resultado depois de ler a entrada com sucesso." -#: ../../library/functions.rst:901 +#: ../../library/functions.rst:962 msgid "" -"Raises an :ref:`auditing event ` ``builtins.input/result`` with " -"the result after successfully reading input." +"Return an integer object constructed from a number or a string, or return " +"``0`` if no arguments are given." +msgstr "" +"Retorna um objeto do tipo inteiro construído a partir de um número ou " +"string, ou retorna ``0`` caso nenhum argumento seja passado." + +#: ../../library/functions.rst:967 +msgid "" +">>> int(123.45)\n" +"123\n" +">>> int('123')\n" +"123\n" +">>> int(' -12_345\\n')\n" +"-12345\n" +">>> int('FACE', 16)\n" +"64206\n" +">>> int('0xface', 0)\n" +"64206\n" +">>> int('01110011', base=2)\n" +"115" msgstr "" -"Levanta um :ref:`evento de auditoria ` ``builtins.input/result`` " -"com o resultado depois de ler a entrada com sucesso." -#: ../../library/functions.rst:908 +#: ../../library/functions.rst:982 msgid "" -"Return an integer object constructed from a number or string *x*, or return " -"``0`` if no arguments are given. If *x* defines :meth:`~object.__int__`, " -"``int(x)`` returns ``x.__int__()``. If *x* defines :meth:`~object." -"__index__`, it returns ``x.__index__()``. If *x* defines :meth:`~object." -"__trunc__`, it returns ``x.__trunc__()``. For floating point numbers, this " -"truncates towards zero." +"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." +"__int__()``. If the argument defines :meth:`~object.__index__`, it returns " +"``x.__index__()``. If the argument defines :meth:`~object.__trunc__`, it " +"returns ``x.__trunc__()``. For floating-point numbers, this truncates " +"towards zero." msgstr "" -"Devolve um objeto inteiro construído a partir de um número ou string *x*, ou " -"devolve ``0`` se nenhum argumento foi fornecido. Se *x* definir um método :" -"meth:`~object.__int__`, então ``int(x)`` retorna ``x.__int__()``. Se *x* " -"definir um método :meth:`~object.__index__`, então ele retorna ``x." -"__index__()``. Se *x* definir um método :meth:`~object.__trunc__`, então ele " -"retorna ``x.__trunc__()``. Para números de ponto flutuante, isto trunca o " -"número na direção do zero." +"Se o argumento definir um método :meth:`~object.__int__`, então ``int(x)`` " +"retorna ``x.__int__()``. Se *x* definir um método :meth:`~object.__index__`, " +"então ele retorna ``x.__index__()``. Se o argumento definir um método :meth:" +"`~object.__trunc__`, então ele retorna ``x.__trunc__()``. Para números de " +"ponto flutuante, isto trunca o número na direção do zero." -#: ../../library/functions.rst:915 +#: ../../library/functions.rst:988 msgid "" -"If *x* is not a number or if *base* is given, then *x* must be a string, :" -"class:`bytes`, or :class:`bytearray` instance representing an integer in " -"radix *base*. Optionally, the string can be preceded by ``+`` or ``-`` " -"(with no space in between), have leading zeros, be surrounded by whitespace, " -"and have single underscores interspersed between digits." +"If the argument is not a number or if *base* is given, then it must be a " +"string, :class:`bytes`, or :class:`bytearray` instance representing an " +"integer in radix *base*. Optionally, the string can be preceded by ``+`` or " +"``-`` (with no space in between), have leading zeros, be surrounded by " +"whitespace, and have single underscores interspersed between digits." msgstr "" -"Se *x* não for um número ou se *base* for fornecido, então *x* deve ser uma " -"instância string, :class:`bytes` ou :class:`bytearray` representando um " -"inteiro na base *base*. Opcionalmente, a string pode ser precedida por ``+`` " -"ou ``-`` (sem espaço entre eles), ter zeros à esquerda, estar entre espaços " -"em branco e ter sublinhados simples intercalados entre os dígitos." +"Se o argumento não for um número ou se *base* for fornecido, então o " +"argumento deve ser uma instância de string, :class:`bytes` ou :class:" +"`bytearray` representando um inteiro na base *base*. Opcionalmente, a string " +"pode ser precedida por ``+`` ou ``-`` (sem espaço entre eles), ter zeros à " +"esquerda, estar entre espaços em branco e ter sublinhados simples " +"intercalados entre os dígitos." -#: ../../library/functions.rst:921 +#: ../../library/functions.rst:994 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -1871,11 +1930,11 @@ msgstr "" "permite zeros à esquerda: ``int('010', 0)`` não é válido, enquanto " "``int('010')`` e ``int('010', 8)`` são." -#: ../../library/functions.rst:932 +#: ../../library/functions.rst:1005 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "O tipo inteiro está descrito em :ref:`typesnumeric`." -#: ../../library/functions.rst:934 +#: ../../library/functions.rst:1007 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -1888,7 +1947,11 @@ msgstr "" "`base.__int__ ` ao invés de :meth:`base.__index__ `." -#: ../../library/functions.rst:947 +#: ../../library/functions.rst:1017 +msgid "The first parameter is now positional-only." +msgstr "O primeiro parâmetro agora é somente-posicional." + +#: ../../library/functions.rst:1020 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." @@ -1896,28 +1959,27 @@ msgstr "" "Chamada para :meth:`~object.__index__` se :meth:`~object.__int__` não está " "definido." -#: ../../library/functions.rst:950 +#: ../../library/functions.rst:1023 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "A delegação de :meth:`~object.__trunc__` foi descontinuada." -#: ../../library/functions.rst:953 +#: ../../library/functions.rst:1026 msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " -"limit is exceeded while converting a string *x* to an :class:`int` or when " +"limit is exceeded while converting a string to an :class:`int` or when " "converting an :class:`int` into a string would exceed the limit. See the :" "ref:`integer string conversion length limitation ` " "documentation." msgstr "" -"Entradas de strings :class:`int` e representações de strings podem ser " +"Entradas de strings para :class:`int` e representações em strings podem ser " "limitadas para ajudar a evitar ataques de negação de serviço. Uma exceção :" "exc:`ValueError` é levantada quando o limite é excedido durante a conversão " -"de uma string *x* em um :class:`int` ou quando a conversão de um :class:" -"`int` em uma string excede o limite. Consulte a documentação sobre :ref:" -"`limitação de comprimento de conversão de string em inteiro " -"`." +"de uma string em um :class:`int` ou quando a conversão de um :class:`int` em " +"uma string excede o limite. Consulte a documentação sobre :ref:`limitação de " +"comprimento de conversão de string em inteiro `." -#: ../../library/functions.rst:963 +#: ../../library/functions.rst:1036 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -1960,7 +2022,7 @@ msgstr "" "*classinfo*. Em qualquer outro caso, é levantada uma exceção :exc:" "`TypeError`." -#: ../../library/functions.rst:995 +#: ../../library/functions.rst:1068 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1988,11 +2050,11 @@ msgstr "" "devolvido é igual a *sentinel*, então :exc:`StopIteration` será levantado, " "caso contrário o valor será devolvido." -#: ../../library/functions.rst:1009 +#: ../../library/functions.rst:1082 msgid "See also :ref:`typeiter`." msgstr "Veja também :ref:`typeiter`." -#: ../../library/functions.rst:1011 +#: ../../library/functions.rst:1084 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " @@ -2002,7 +2064,15 @@ msgstr "" "bloco de leitura. Por exemplo, ler blocos de comprimento fixo de um arquivo " "binário de banco de dados até que o final do arquivo seja atingido::" -#: ../../library/functions.rst:1023 +#: ../../library/functions.rst:1088 +msgid "" +"from functools import partial\n" +"with open('mydata.db', 'rb') as f:\n" +" for block in iter(partial(f.read, 64), b''):\n" +" process_block(block)" +msgstr "" + +#: ../../library/functions.rst:1096 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -2012,7 +2082,7 @@ msgstr "" "uma sequência (tal como uma string, bytes, tupla, lista, ou um intervalo) ou " "uma coleção (tal como um dicionário, conjunto, ou conjunto imutável)." -#: ../../library/functions.rst:1029 +#: ../../library/functions.rst:1102 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." @@ -2020,7 +2090,7 @@ msgstr "" "``len`` levanta :exc:`OverflowError` em tamanhos maiores que :data:`sys." "maxsize`, tal como :class:`range(2 ** 100) `." -#: ../../library/functions.rst:1038 +#: ../../library/functions.rst:1111 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2028,27 +2098,21 @@ msgstr "" "Ao invés de ser uma função, :class:`list` é na verdade um tipo de sequência " "mutável, conforme documentado em :ref:`typesseq-list` e :ref:`typesseq`." -#: ../../library/functions.rst:1044 +#: ../../library/functions.rst:1117 msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " "blocks, but not in class blocks. Note that at the module level, :func:" "`locals` and :func:`globals` are the same dictionary." msgstr "" -"Atualiza e devolve um dicionário representando a tabela de símbolos locais " -"atual. Variáveis livres são devolvidas por :func:`locals` quando ele é " -"chamado em blocos de função, mas não em blocos de classes. Perceba que no " -"nível dos módulos, :func:`locals` e :func:`globals` são o mesmo dicionário." -#: ../../library/functions.rst:1050 +#: ../../library/functions.rst:1123 msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." msgstr "" -"O conteúdo deste dicionário não deve ser modificado; as alterações podem não " -"afetar os valores das variáveis ​​locais e livres usadas pelo interpretador." -#: ../../library/functions.rst:1055 +#: ../../library/functions.rst:1128 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2065,14 +2129,14 @@ msgstr "" "parâmetros de entrada da função já estão organizados em tuplas, veja :func:" "`itertools.starmap`\\." -#: ../../library/functions.rst:1067 +#: ../../library/functions.rst:1140 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "" "Devolve o maior item em um iterável ou o maior de dois ou mais argumentos." -#: ../../library/functions.rst:1070 +#: ../../library/functions.rst:1143 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -2082,7 +2146,7 @@ msgstr "" "maior item no iterável é retornado. Se dois ou mais argumentos posicionais " "são fornecidos, o maior dos argumentos posicionais é devolvido." -#: ../../library/functions.rst:1075 ../../library/functions.rst:1113 +#: ../../library/functions.rst:1148 ../../library/functions.rst:1186 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -2097,7 +2161,7 @@ msgstr "" "vazio, e *default* não foi fornecido, uma exceção :exc:`ValueError` é " "levantada." -#: ../../library/functions.rst:1081 +#: ../../library/functions.rst:1154 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2109,15 +2173,15 @@ msgstr "" "estabilidade, tais como ``sorted(iterable, key=keyfunc, reverse=True)[0]`` e " "``heapq.nlargest(1, iterable, key=keyfunc)``." -#: ../../library/functions.rst:1086 ../../library/functions.rst:1124 +#: ../../library/functions.rst:1159 ../../library/functions.rst:1197 msgid "Added the *default* keyword-only parameter." msgstr "Adicionado o parâmetro *default* somente-nomeado." -#: ../../library/functions.rst:1089 ../../library/functions.rst:1127 +#: ../../library/functions.rst:1162 ../../library/functions.rst:1200 msgid "The *key* can be ``None``." msgstr "O valor de *key* pode ser ``None``." -#: ../../library/functions.rst:1097 +#: ../../library/functions.rst:1170 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -2125,14 +2189,14 @@ msgstr "" "Devolve um objeto de \"visão da memória\" criado a partir do argumento " "fornecido. Veja :ref:`typememoryview` para mais informações." -#: ../../library/functions.rst:1105 +#: ../../library/functions.rst:1178 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "" "Devolve o menor item de um iterável ou o menor de dois ou mais argumentos." -#: ../../library/functions.rst:1108 +#: ../../library/functions.rst:1181 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -2142,7 +2206,7 @@ msgstr "" "menor item no iterável é devolvido. Se dois ou mais argumentos posicionais " "são fornecidos, o menor dos argumentos posicionais é devolvido." -#: ../../library/functions.rst:1119 +#: ../../library/functions.rst:1192 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2154,7 +2218,7 @@ msgstr "" "estabilidade, tais como ``sorted(iterable, key=keyfunc)[0]`` e ``heapq." "nsmallest(1, iterable, key=keyfunc)``." -#: ../../library/functions.rst:1134 +#: ../../library/functions.rst:1207 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -2165,7 +2229,7 @@ msgstr "" "iterável tenha sido percorrido por completo, caso contrário :exc:" "`StopIteration` é levantada." -#: ../../library/functions.rst:1141 +#: ../../library/functions.rst:1214 msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " @@ -2175,7 +2239,7 @@ msgstr "" "para todas as classes. Ela tem os métodos que são comuns para todas as " "instâncias de classes Python. Esta função não aceita nenhum argumento." -#: ../../library/functions.rst:1147 +#: ../../library/functions.rst:1220 msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." @@ -2184,7 +2248,7 @@ msgstr "" "não consegue definir atributos arbitrários para uma instância da classe :" "class:`object`." -#: ../../library/functions.rst:1153 +#: ../../library/functions.rst:1226 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -2196,7 +2260,7 @@ msgstr "" "class:`int` Python, ele tem que definir um método :meth:`~object.__index__` " "que devolve um inteiro. Por exemplo:" -#: ../../library/functions.rst:1163 +#: ../../library/functions.rst:1236 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -2204,7 +2268,7 @@ msgstr "" "Se você quiser converter um número inteiro para uma string octal, com o " "prefixo \"0o\" ou não, você pode usar qualquer uma das formas a seguir." -#: ../../library/functions.rst:1180 +#: ../../library/functions.rst:1253 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -2214,7 +2278,7 @@ msgstr "" "não puder ser aberto, uma :exc:`OSError` é levantada. Veja :ref:`tut-files` " "para mais exemplos de como usar esta função." -#: ../../library/functions.rst:1184 +#: ../../library/functions.rst:1257 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -2228,7 +2292,7 @@ msgstr "" "arquivo é fornecido, ele é fechado quando o objeto de I/O retornado é " "fechado, a não ser que *closefd* esteja marcado como ``False``)." -#: ../../library/functions.rst:1190 +#: ../../library/functions.rst:1263 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -2237,88 +2301,78 @@ msgid "" "(which on *some* Unix systems, means that *all* writes append to the end of " "the file regardless of the current seek position). In text mode, if " "*encoding* is not specified the encoding used is platform-dependent: :func:" -"`locale.getencoding()` is called to get the current locale encoding. (For " +"`locale.getencoding` is called to get the current locale encoding. (For " "reading and writing raw bytes use binary mode and leave *encoding* " "unspecified.) The available modes are:" msgstr "" -"*mode* é uma string opcional que especifica o modo no qual o arquivo é " -"aberto. O valor padrão é ``'r'``, o qual significa abrir para leitura em " -"modo texto. Outros valores comuns são ``'w'`` para escrever (truncando o " -"arquivo se ele já existe), ``'x'`` para criação exclusiva e ``'a'`` para " -"anexar (o qual em *alguns* sistemas Unix, significa que *todas* as escritas " -"anexam ao final do arquivo independentemente da posição de busca atual). No " -"modo texto, se *encoding* não for especificada, a codificação usada depende " -"da plataforma: :func:`locale.getencoding()` é chamada para obter a " -"codificação da localidade atual (Para ler e escrever bytes diretamente, use " -"o modo binário e não especifique *encoding*). Os modos disponíveis são:" -#: ../../library/functions.rst:1207 +#: ../../library/functions.rst:1280 msgid "Character" msgstr "Caractere" -#: ../../library/functions.rst:1207 +#: ../../library/functions.rst:1280 msgid "Meaning" msgstr "Significado" -#: ../../library/functions.rst:1209 +#: ../../library/functions.rst:1282 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1209 +#: ../../library/functions.rst:1282 msgid "open for reading (default)" msgstr "abre para leitura (padrão)" -#: ../../library/functions.rst:1210 +#: ../../library/functions.rst:1283 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1210 +#: ../../library/functions.rst:1283 msgid "open for writing, truncating the file first" msgstr "" "abre para escrita, truncando o arquivo primeiro (removendo tudo o que " "estiver contido no mesmo)" -#: ../../library/functions.rst:1211 +#: ../../library/functions.rst:1284 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1211 +#: ../../library/functions.rst:1284 msgid "open for exclusive creation, failing if the file already exists" msgstr "abre para criação exclusiva, falhando caso o arquivo exista" -#: ../../library/functions.rst:1212 +#: ../../library/functions.rst:1285 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1212 +#: ../../library/functions.rst:1285 msgid "open for writing, appending to the end of file if it exists" msgstr "abre para escrita, anexando ao final do arquivo caso o mesmo exista" -#: ../../library/functions.rst:1213 +#: ../../library/functions.rst:1286 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1213 ../../library/functions.rst:1357 +#: ../../library/functions.rst:1286 ../../library/functions.rst:1430 msgid "binary mode" msgstr "modo binário" -#: ../../library/functions.rst:1214 +#: ../../library/functions.rst:1287 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1214 +#: ../../library/functions.rst:1287 msgid "text mode (default)" msgstr "modo texto (padrão)" -#: ../../library/functions.rst:1215 +#: ../../library/functions.rst:1288 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1215 +#: ../../library/functions.rst:1288 msgid "open for updating (reading and writing)" msgstr "aberto para atualização (leitura e escrita)" -#: ../../library/functions.rst:1218 +#: ../../library/functions.rst:1291 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -2328,7 +2382,7 @@ msgstr "" "``'rt'``). Modos ``'w+'`` e ``'w+b'`` abrem e truncam o arquivo. Modos " "``'r+'`` e ``'r+b'`` abrem o arquivo sem truncar o mesmo." -#: ../../library/functions.rst:1222 +#: ../../library/functions.rst:1295 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2347,7 +2401,7 @@ msgstr "" "dependente da plataforma, ou usando a codificação definida em *encoding* se " "fornecida." -#: ../../library/functions.rst:1232 +#: ../../library/functions.rst:1305 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " @@ -2357,7 +2411,7 @@ msgstr "" "texto; todo processamento é feito pelo próprio Python, e é então " "independente de plataforma." -#: ../../library/functions.rst:1236 +#: ../../library/functions.rst:1309 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " @@ -2381,7 +2435,7 @@ msgstr "" "*buffering* é fornecido, a política de buffering padrão funciona da seguinte " "forma:" -#: ../../library/functions.rst:1246 +#: ../../library/functions.rst:1319 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2394,7 +2448,7 @@ msgstr "" "caso não consiga. Em muitos sistemas, o buffer possuirá tipicamente 4096 ou " "8192 bytes de comprimento." -#: ../../library/functions.rst:1251 +#: ../../library/functions.rst:1324 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " @@ -2404,7 +2458,7 @@ msgstr "" "isatty` retornam ``True``) usam buffering de linha. Outros arquivos de texto " "usam a política descrita acima para arquivos binários." -#: ../../library/functions.rst:1255 +#: ../../library/functions.rst:1328 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2418,7 +2472,7 @@ msgstr "" "mas qualquer :term:`codificador de texto` suportado pelo Python pode ser " "usada. Veja o módulo :mod:`codecs` para a lista de codificações suportadas." -#: ../../library/functions.rst:1261 +#: ../../library/functions.rst:1334 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2433,7 +2487,7 @@ msgstr "" "tratamento de erro registrado com :func:`codecs.register_error` também é " "válido. Os nomes padrões incluem:" -#: ../../library/functions.rst:1269 +#: ../../library/functions.rst:1342 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2441,7 +2495,7 @@ msgstr "" "``'strict'`` para levantar uma exceção :exc:`ValueError` se existir um erro " "de codificação. O valor padrão ``None`` tem o mesmo efeito." -#: ../../library/functions.rst:1273 +#: ../../library/functions.rst:1346 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." @@ -2449,7 +2503,7 @@ msgstr "" "``'ignore'`` ignora erros. Note que ignorar erros de código pode levar à " "perda de dados." -#: ../../library/functions.rst:1276 +#: ../../library/functions.rst:1349 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." @@ -2457,7 +2511,7 @@ msgstr "" "``'replace'`` faz um marcador de substituição (tal como ``'?'``) ser " "inserido onde existem dados malformados." -#: ../../library/functions.rst:1279 +#: ../../library/functions.rst:1352 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2471,7 +2525,7 @@ msgstr "" "erros for usado ao gravar dados. Isso é útil para processar arquivos em uma " "codificação desconhecida." -#: ../../library/functions.rst:1286 +#: ../../library/functions.rst:1359 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " @@ -2481,7 +2535,7 @@ msgstr "" "caracteres não suportados pela codificação são substituídos pela referência " "de caracteres XML apropriada :samp:`&#{nnn};`." -#: ../../library/functions.rst:1290 +#: ../../library/functions.rst:1363 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2489,7 +2543,7 @@ msgstr "" "``'backslashreplace'`` substitui dados malformados pela sequência de escape " "utilizando contrabarra do Python." -#: ../../library/functions.rst:1293 +#: ../../library/functions.rst:1366 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2497,7 +2551,7 @@ msgstr "" "``'namereplace'`` (também é suportado somente quando estiver escrevendo) " "substitui caractere não suportados com sequências de escape ``\\N{...}``." -#: ../../library/functions.rst:1301 +#: ../../library/functions.rst:1374 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " @@ -2507,7 +2561,7 @@ msgstr "" "pode ser ``None``, ``''``, ``'\\n'``, ``'\\r'`` e ``'\\r\\n'``. Ele funciona " "da seguinte forma:" -#: ../../library/functions.rst:1305 +#: ../../library/functions.rst:1378 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2526,7 +2580,7 @@ msgstr "" "apenas pela string especificada e a finalização da linha é retornada ao " "chamador sem tradução." -#: ../../library/functions.rst:1313 +#: ../../library/functions.rst:1386 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2540,7 +2594,7 @@ msgstr "" "tradução ocorrerá. Se *newline* for um dos outros valores legais, qualquer " "caractere ``'\\n'`` escrito será traduzido para a string especificada." -#: ../../library/functions.rst:1319 +#: ../../library/functions.rst:1392 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2552,7 +2606,7 @@ msgstr "" "quando o arquivo for fechado. Se um nome de arquivo for fornecido *closefd* " "deve ser ``True`` (o padrão), caso contrário, um erro será levantado." -#: ../../library/functions.rst:1324 +#: ../../library/functions.rst:1397 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2566,11 +2620,11 @@ msgstr "" "arquivo aberto (passando :mod:`os.open` como *opener* resulta em " "funcionalidade semelhante à passagem de ``None``)." -#: ../../library/functions.rst:1330 +#: ../../library/functions.rst:1403 msgid "The newly created file is :ref:`non-inheritable `." msgstr "O arquivo recém-criado é :ref:`non-inheritable `." -#: ../../library/functions.rst:1332 +#: ../../library/functions.rst:1405 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2578,7 +2632,20 @@ msgstr "" "O exemplo a seguir usa o parâmetro :ref:`dir_fd ` da função :func:" "`os.open` para abrir um arquivo relativo a um determinado diretório::" -#: ../../library/functions.rst:1345 +#: ../../library/functions.rst:1408 +msgid "" +">>> import os\n" +">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" +">>> def opener(path, flags):\n" +"... return os.open(path, flags, dir_fd=dir_fd)\n" +"...\n" +">>> with open('spamspam.txt', 'w', opener=opener) as f:\n" +"... print('This will be written to somedir/spamspam.txt', file=f)\n" +"...\n" +">>> os.close(dir_fd) # don't leak a file descriptor" +msgstr "" + +#: ../../library/functions.rst:1418 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2605,7 +2672,7 @@ msgstr "" "bruto, uma subclasse de :class:`io.RawIOBase`, :class:`io.FileIO`, é " "retornado." -#: ../../library/functions.rst:1366 +#: ../../library/functions.rst:1439 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2615,15 +2682,15 @@ msgstr "" "`fileinput`, :mod:`io` (onde :func:`open` é declarado), :mod:`os`, :mod:`os." "path`, :mod:`tempfile` e :mod:`shutil`." -#: ../../library/functions.rst:1370 +#: ../../library/functions.rst:1443 msgid "" -"Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " +"Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." msgstr "" "Levanta um :ref:`evento de auditoria ` ``open`` com os argumentos " -"``file``, ``mode``, ``flags``." +"``path``, ``mode``, ``flags``." -#: ../../library/functions.rst:1372 +#: ../../library/functions.rst:1445 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." @@ -2631,21 +2698,21 @@ msgstr "" "Os argumentos ``mode`` e ``flags`` podem ter sido modificados ou inferidos a " "partir da chamada original." -#: ../../library/functions.rst:1377 +#: ../../library/functions.rst:1450 msgid "The *opener* parameter was added." msgstr "O parâmetro *opener* foi adicionado." -#: ../../library/functions.rst:1378 +#: ../../library/functions.rst:1451 msgid "The ``'x'`` mode was added." msgstr "O modo ``'x'`` foi adicionado." -#: ../../library/functions.rst:1379 +#: ../../library/functions.rst:1452 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" ":exc:`IOError` costumava ser levantado, agora ele é um codinome para :exc:" "`OSError`." -#: ../../library/functions.rst:1380 +#: ../../library/functions.rst:1453 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2653,11 +2720,11 @@ msgstr "" ":exc:`FileExistsError` agora é levantado se o arquivo aberto no modo de " "criação exclusivo (``'x'``) já existir." -#: ../../library/functions.rst:1385 +#: ../../library/functions.rst:1458 msgid "The file is now non-inheritable." msgstr "O arquivo agora é não herdável." -#: ../../library/functions.rst:1389 +#: ../../library/functions.rst:1462 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -2668,16 +2735,16 @@ msgstr "" "levantar uma exceção :exc:`InterruptedError` (consulte :pep:`475` para " "entender a justificativa)." -#: ../../library/functions.rst:1392 +#: ../../library/functions.rst:1465 msgid "The ``'namereplace'`` error handler was added." msgstr "O tratador de erros ``'namereplace'`` foi adicionado." -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1469 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "" "Suporte adicionado para aceitar objetos implementados :class:`os.PathLike`." -#: ../../library/functions.rst:1397 +#: ../../library/functions.rst:1470 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2685,11 +2752,11 @@ msgstr "" "No Windows, a abertura de um buffer do console pode retornar uma subclasse " "de :class:`io.RawIOBase` que não seja :class:`io.FileIO`." -#: ../../library/functions.rst:1400 +#: ../../library/functions.rst:1473 msgid "The ``'U'`` mode has been removed." msgstr "O modo ``'U'`` foi removido." -#: ../../library/functions.rst:1405 +#: ../../library/functions.rst:1478 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2701,7 +2768,7 @@ msgstr "" "exemplo, ``ord('a')`` retorna o número inteiro ``97`` e ``ord('€')`` (sinal " "do Euro) retorna ``8364``. Este é o inverso de :func:`chr`." -#: ../../library/functions.rst:1413 +#: ../../library/functions.rst:1486 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2713,7 +2780,7 @@ msgstr "" "``pow(base, exp) % mod``). A forma de dois argumentos ``pow(base, exp)`` é " "equivalente a usar o operador de potência: ``base**exp``." -#: ../../library/functions.rst:1418 +#: ../../library/functions.rst:1491 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2723,7 +2790,9 @@ msgid "" "2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative " "base of type :class:`int` or :class:`float` and a non-integral exponent, a " "complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value " -"close to ``3j``." +"close to ``3j``. Whereas, for a negative base of type :class:`int` or :class:" +"`float` with an integral exponent, a float result is delivered. For example, " +"``pow(-9, 2.0)`` returns ``81.0``." msgstr "" "Os argumentos devem ter tipos numéricos. Com tipos de operandos mistos, " "aplicam-se as regras de coerção para operadores aritméticos binários. Para " @@ -2733,9 +2802,12 @@ msgstr "" "flutuante é entregue. Por exemplo, ``pow(10, 2)`` retorna ``100``, mas " "``pow(10, -2)`` retorna ``0.01``. Para uma base negativa do tipo :class:" "`int` ou :class:`float` e um expoente não integral, um resultado complexo é " -"entregue. Por exemplo, ``pow(-9, 0.5)`` retorna um valor próximo a ``3j``." +"entregue. Por exemplo, ``pow(-9, 0.5)`` retorna um valor próximo a ``3j``. " +"Enquanto isso, para uma base negativa do tipo :class:`int` ou :class:`float` " +"com um expoente integral, um resultado de ponto flutuante é retornado. Por " +"exemplo, ``pow(-9, 2.0)`` retorna ``81.0``." -#: ../../library/functions.rst:1428 +#: ../../library/functions.rst:1503 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2749,12 +2821,20 @@ msgstr "" "para *mod*. Nesse caso, ``pow(inv_base, -exp, mod)`` é retornado, onde " "*inv_base* é um inverso ao *base* módulo *mod*." -#: ../../library/functions.rst:1434 +#: ../../library/functions.rst:1509 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" "Aqui está um exemplo de computação de um inverso para ``38`` módulo ``97``::" -#: ../../library/functions.rst:1441 +#: ../../library/functions.rst:1511 +msgid "" +">>> pow(38, -1, mod=97)\n" +"23\n" +">>> 23 * 38 % 97 == 1\n" +"True" +msgstr "" + +#: ../../library/functions.rst:1516 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -2763,14 +2843,14 @@ msgstr "" "permite que o segundo argumento seja negativo, permitindo o cálculo de " "inversos modulares." -#: ../../library/functions.rst:1446 +#: ../../library/functions.rst:1521 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" "Permite argumentos de palavra reservada. Anteriormente, apenas argumentos " "posicionais eram suportados." -#: ../../library/functions.rst:1453 +#: ../../library/functions.rst:1528 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " @@ -2780,7 +2860,7 @@ msgstr "" "por *end*. *sep*, *end*, *file* e *flush*, se houver, devem ser fornecidos " "como argumentos nomeados." -#: ../../library/functions.rst:1457 +#: ../../library/functions.rst:1532 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2794,7 +2874,7 @@ msgstr "" "que significa usar os valores padrão. Se nenhum *object* for fornecido, :" "func:`print` escreverá apenas *end*." -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1538 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2807,7 +2887,7 @@ msgstr "" "func:`print` não pode ser usado com objetos de arquivo em modo binário. Para " "esses casos, use ``file.write(...)`` ao invés." -#: ../../library/functions.rst:1468 +#: ../../library/functions.rst:1543 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." @@ -2815,15 +2895,15 @@ msgstr "" "O buffer de saída geralmente é determinado por *arquivo*. No entanto, se " "*flush* for verdadeiro, o fluxo será descarregado à força." -#: ../../library/functions.rst:1472 +#: ../../library/functions.rst:1547 msgid "Added the *flush* keyword argument." msgstr "Adicionado o argumento nomeado *flush*." -#: ../../library/functions.rst:1478 +#: ../../library/functions.rst:1553 msgid "Return a property attribute." msgstr "Retorna um atributo de propriedade." -#: ../../library/functions.rst:1480 +#: ../../library/functions.rst:1555 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " @@ -2833,11 +2913,29 @@ msgstr "" "para definir um valor para um atributo. *fdel* é uma função para deletar um " "valor de um atributo. E *doc* cria um docstring para um atributo." -#: ../../library/functions.rst:1484 +#: ../../library/functions.rst:1559 msgid "A typical use is to define a managed attribute ``x``::" msgstr "Um uso comum é para definir um atributo gerenciável ``x``::" -#: ../../library/functions.rst:1501 +#: ../../library/functions.rst:1561 +msgid "" +"class C:\n" +" def __init__(self):\n" +" self._x = None\n" +"\n" +" def getx(self):\n" +" return self._x\n" +"\n" +" def setx(self, value):\n" +" self._x = value\n" +"\n" +" def delx(self):\n" +" del self._x\n" +"\n" +" x = property(getx, setx, delx, \"I'm the 'x' property.\")" +msgstr "" + +#: ../../library/functions.rst:1576 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." @@ -2845,7 +2943,7 @@ msgstr "" "Se *c* é uma instância de *C*, ``c.x`` irá invocar o método getter, ``c.x = " "value`` irá invocar o método setter, e ``del c.x`` o método deleter." -#: ../../library/functions.rst:1504 +#: ../../library/functions.rst:1579 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2857,7 +2955,19 @@ msgstr "" "torna possível criar facilmente propriedades apenas para leitura usando :" "func:`property` como um :term:`decorador`::" -#: ../../library/functions.rst:1517 +#: ../../library/functions.rst:1583 +msgid "" +"class Parrot:\n" +" def __init__(self):\n" +" self._voltage = 100000\n" +"\n" +" @property\n" +" def voltage(self):\n" +" \"\"\"Get the current voltage.\"\"\"\n" +" return self._voltage" +msgstr "" + +#: ../../library/functions.rst:1592 msgid "" "The ``@property`` decorator turns the :meth:`!voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " @@ -2867,7 +2977,7 @@ msgstr "" "\"getter\" para um atributo somente leitura com o mesmo nome, e define a " "docstring de *voltage* para \"Get the current voltage.\"" -#: ../../library/functions.rst:1525 +#: ../../library/functions.rst:1600 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -2879,7 +2989,27 @@ msgstr "" "correspondente a função definida para a função com decorador. Isso é " "explicado melhor com um exemplo::" -#: ../../library/functions.rst:1549 +#: ../../library/functions.rst:1605 +msgid "" +"class C:\n" +" def __init__(self):\n" +" self._x = None\n" +"\n" +" @property\n" +" def x(self):\n" +" \"\"\"I'm the 'x' property.\"\"\"\n" +" return self._x\n" +"\n" +" @x.setter\n" +" def x(self, value):\n" +" self._x = value\n" +"\n" +" @x.deleter\n" +" def x(self):\n" +" del self._x" +msgstr "" + +#: ../../library/functions.rst:1624 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " @@ -2889,7 +3019,7 @@ msgstr "" "nas funções adicionais usar o mesmo nome que a property original (``x`` " "neste caso)." -#: ../../library/functions.rst:1553 +#: ../../library/functions.rst:1628 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." @@ -2897,11 +3027,11 @@ msgstr "" "O objeto property retornado também tem os atributos ``fget``, ``fset``, e " "``fdel`` correspondendo aos argumentos do construtor." -#: ../../library/functions.rst:1556 +#: ../../library/functions.rst:1631 msgid "The docstrings of property objects are now writeable." msgstr "Agora é possível escrever nas docstrings de objetos property." -#: ../../library/functions.rst:1565 +#: ../../library/functions.rst:1640 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." @@ -2909,7 +3039,7 @@ msgstr "" "Em vez de ser uma função, :class:`range` é realmente um tipo de sequência " "imutável, conforme documentado em :ref:`typesseq-range` e :ref:`typesseq`." -#: ../../library/functions.rst:1571 +#: ../../library/functions.rst:1646 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2931,12 +3061,23 @@ msgstr "" "Se :func:`sys.displayhook` não estiver acessível, esta função vai levantar :" "exc:`RuntimeError`." -#: ../../library/functions.rst:1582 +#: ../../library/functions.rst:1657 msgid "This class has a custom representation that can be evaluated::" msgstr "" "Esta classe possui uma representação personalizada que pode ser executada::" -#: ../../library/functions.rst:1595 +#: ../../library/functions.rst:1659 +msgid "" +"class Person:\n" +" def __init__(self, name, age):\n" +" self.name = name\n" +" self.age = age\n" +"\n" +" def __repr__(self):\n" +" return f\"Person('{self.name}', {self.age})\"" +msgstr "" + +#: ../../library/functions.rst:1670 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -2948,7 +3089,7 @@ msgstr "" "sequência (o método :meth:`~object.__len__` e o método :meth:`~object." "__getitem__` com argumentos inteiros começando em ``0``)." -#: ../../library/functions.rst:1603 +#: ../../library/functions.rst:1678 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " @@ -2958,7 +3099,7 @@ msgstr "" "Se *ndigits* for omitido ou for ``None``, ele retornará o número inteiro " "mais próximo de sua entrada." -#: ../../library/functions.rst:1607 +#: ../../library/functions.rst:1682 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2977,7 +3118,7 @@ msgstr "" "inteiro se *ndigits* for omitido ou ``None``. Caso contrário, o valor de " "retorno tem o mesmo tipo que *number*." -#: ../../library/functions.rst:1616 +#: ../../library/functions.rst:1691 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." @@ -2985,7 +3126,7 @@ msgstr "" "Para um objeto Python geral ``number``, ``round`` delega para ``number." "__round__``." -#: ../../library/functions.rst:1621 +#: ../../library/functions.rst:1696 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2999,7 +3140,7 @@ msgstr "" "das frações decimais não pode ser representada exatamente como um ponto " "flutuante. Veja :ref:`tut-fp-issues` para mais informações." -#: ../../library/functions.rst:1633 +#: ../../library/functions.rst:1708 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" @@ -3009,7 +3150,7 @@ msgstr "" "de *iterable*. ``set`` é uma classe embutida. Veja :class:`set` e :ref:" "`types-set` para documentação sobre esta classe." -#: ../../library/functions.rst:1637 +#: ../../library/functions.rst:1712 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " @@ -3019,7 +3160,7 @@ msgstr "" "class:`list`, :class:`tuple` e :class:`dict`, bem como o módulo :mod:" "`collections`." -#: ../../library/functions.rst:1644 +#: ../../library/functions.rst:1719 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -3033,7 +3174,7 @@ msgstr "" "permita. Por exemplo, ``setattr(x, 'foobar', 123)`` é equivalente a ``x." "foobar = 123``." -#: ../../library/functions.rst:1650 +#: ../../library/functions.rst:1725 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -3048,7 +3189,7 @@ msgstr "" "usando a notação de ponto, mas pode ser acessado através de :func:`getattr` " "etc." -#: ../../library/functions.rst:1658 +#: ../../library/functions.rst:1733 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -3059,7 +3200,7 @@ msgstr "" "atributo privado (atributos com dois sublinhados à esquerda) para defini-lo " "com :func:`setattr`." -#: ../../library/functions.rst:1667 +#: ../../library/functions.rst:1742 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -3069,7 +3210,7 @@ msgstr "" "especificados por ``range(start, stop, step)``. Os argumentos *start* e " "*step* têm o padrão ``None``." -#: ../../library/functions.rst:1675 +#: ../../library/functions.rst:1750 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -3081,7 +3222,7 @@ msgstr "" "(ou seus padrões). Eles não possuem outra funcionalidade explícita; no " "entanto, eles são usados pelo NumPy e outros pacotes de terceiros." -#: ../../library/functions.rst:1680 +#: ../../library/functions.rst:1755 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " "example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" @@ -3092,7 +3233,7 @@ msgstr "" "func:`itertools.islice` para uma versão alternativa que retorna um :term:" "`iterador`." -#: ../../library/functions.rst:1685 +#: ../../library/functions.rst:1760 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." @@ -3100,18 +3241,18 @@ msgstr "" "Os objetos slice agora são :term:`hasheáveis ` (desde que :attr:" "`~slice.start`, :attr:`~slice.stop` e :attr:`~slice.step` sejam hasheáveis)." -#: ../../library/functions.rst:1691 +#: ../../library/functions.rst:1766 msgid "Return a new sorted list from the items in *iterable*." msgstr "Retorna uma nova lista classificada dos itens em *iterable*." -#: ../../library/functions.rst:1693 +#: ../../library/functions.rst:1768 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "" "Possui dois argumentos opcionais que devem ser especificados como argumentos " "nomeados." -#: ../../library/functions.rst:1695 +#: ../../library/functions.rst:1770 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." @@ -3121,7 +3262,7 @@ msgstr "" "comparação de cada elemento em *iterable* (por exemplo, ``key=str.lower``). " "O valor padrão é ``None`` (compara os elementos diretamente)." -#: ../../library/functions.rst:1699 +#: ../../library/functions.rst:1774 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." @@ -3130,7 +3271,7 @@ msgstr "" "elementos da lista são classificados como se cada comparação estivesse " "invertida." -#: ../../library/functions.rst:1702 +#: ../../library/functions.rst:1777 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." @@ -3138,7 +3279,7 @@ msgstr "" "Usa :func:`functools.cmp_to_key` para converter a função das antigas *cmp* " "para uma função *key*." -#: ../../library/functions.rst:1705 +#: ../../library/functions.rst:1780 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -3150,7 +3291,7 @@ msgstr "" "comparam da mesma forma --- isso é útil para ordenar em várias passagens " "(por exemplo, ordenar por departamento e depois por nível de salário)." -#: ../../library/functions.rst:1710 +#: ../../library/functions.rst:1785 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3170,18 +3311,18 @@ msgstr "" "comparações também ajuda a evitar confusão para comparações de tipo misto " "que podem chamar refletido o método :meth:`~object.__gt__`." -#: ../../library/functions.rst:1719 +#: ../../library/functions.rst:1794 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" "Para exemplos de classificação e um breve tutorial de classificação, veja :" "ref:`sortinghowto`." -#: ../../library/functions.rst:1723 +#: ../../library/functions.rst:1798 msgid "Transform a method into a static method." msgstr "Transforma um método em método estático." -#: ../../library/functions.rst:1725 +#: ../../library/functions.rst:1800 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" @@ -3189,7 +3330,14 @@ msgstr "" "Um método estático não recebe um primeiro argumento implícito. Para declarar " "um método estático, use este idioma::" -#: ../../library/functions.rst:1732 +#: ../../library/functions.rst:1803 +msgid "" +"class C:\n" +" @staticmethod\n" +" def f(arg1, arg2, argN): ..." +msgstr "" + +#: ../../library/functions.rst:1807 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -3197,7 +3345,7 @@ msgstr "" "A forma ``@staticmethod`` é uma função de :term:`decorador` -- veja :ref:" "`function` para detalhes." -#: ../../library/functions.rst:1735 +#: ../../library/functions.rst:1810 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, the static method :term:" @@ -3209,7 +3357,7 @@ msgstr "" "estático também é um chamável, então ele pode ser usado na definição de " "classe (como ``f()``)." -#: ../../library/functions.rst:1740 +#: ../../library/functions.rst:1815 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " @@ -3219,7 +3367,7 @@ msgstr "" "+. Veja também :func:`classmethod` para uma variante útil na criação de " "construtores de classe alternativos." -#: ../../library/functions.rst:1744 +#: ../../library/functions.rst:1819 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -3233,11 +3381,20 @@ msgstr "" "corpo de classe e deseja evitar a transformação automática em método de " "instância. Para esses casos, use este idioma::" -#: ../../library/functions.rst:1756 +#: ../../library/functions.rst:1825 +msgid "" +"def regular_function():\n" +" ...\n" +"\n" +"class C:\n" +" method = staticmethod(regular_function)" +msgstr "" + +#: ../../library/functions.rst:1831 msgid "For more information on static methods, see :ref:`types`." msgstr "Para mais informações sobre métodos estáticos, consulte :ref:`types`." -#: ../../library/functions.rst:1758 +#: ../../library/functions.rst:1833 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " @@ -3247,14 +3404,14 @@ msgstr "" "``__name__``, ``__qualname__``, ``__doc__`` e ``__annotations__``), têm um " "novo atributo ``__wrapped__`` e agora são chamáveis como funções regulares." -#: ../../library/functions.rst:1773 +#: ../../library/functions.rst:1848 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" "Retorna uma versão :class:`str` de *object*. Consulte :func:`str` para " "detalhes." -#: ../../library/functions.rst:1775 +#: ../../library/functions.rst:1850 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." @@ -3262,7 +3419,7 @@ msgstr "" "``str`` é uma :term:`classe` de string embutida. Para informações gerais " "sobre strings, consulte :ref:`textseq`." -#: ../../library/functions.rst:1781 +#: ../../library/functions.rst:1856 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " @@ -3272,11 +3429,11 @@ msgstr "" "retornam o total. Os itens do *iterable* são normalmente números e o valor " "inicial não pode ser uma string." -#: ../../library/functions.rst:1785 +#: ../../library/functions.rst:1860 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." -"join(sequence)``. To add floating point values with extended precision, " +"join(sequence)``. To add floating-point values with extended precision, " "see :func:`math.fsum`\\. To concatenate a series of iterables, consider " "using :func:`itertools.chain`." msgstr "" @@ -3286,19 +3443,17 @@ msgstr "" "precisão estendida, consulte :func:`math.fsum`. Para concatenar uma série de " "iteráveis, considere usar :func:`itertools.chain`." -#: ../../library/functions.rst:1791 +#: ../../library/functions.rst:1866 msgid "The *start* parameter can be specified as a keyword argument." msgstr "O parâmetro *start* pode ser especificado como um argumento nomeado." -#: ../../library/functions.rst:1794 +#: ../../library/functions.rst:1869 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy on " "most builds." msgstr "" -"A soma dos pontos flutuantes foi alterada para um algoritmo que oferece " -"maior precisão na maioria das compilações." -#: ../../library/functions.rst:1801 +#: ../../library/functions.rst:1876 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " @@ -3308,7 +3463,7 @@ msgstr "" "irmão do *type*. Isso é útil para acessar métodos herdados que foram " "substituídos em uma classe." -#: ../../library/functions.rst:1805 +#: ../../library/functions.rst:1880 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." @@ -3316,7 +3471,7 @@ msgstr "" "O *object_or_type* determina a :term:`ordem de resolução de métodos` a ser " "pesquisada. A pesquisa inicia a partir da classe logo após o *type*." -#: ../../library/functions.rst:1809 +#: ../../library/functions.rst:1884 msgid "" "For example, if :attr:`~class.__mro__` of *object_or_type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " @@ -3326,7 +3481,7 @@ msgstr "" "> A -> object`` e o valor de *type* é ``B``, então :func:`super` procura por " "``C -> A -> object``." -#: ../../library/functions.rst:1813 +#: ../../library/functions.rst:1888 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -3338,7 +3493,7 @@ msgstr "" "atributo é dinâmico e pode mudar sempre que a hierarquia da herança é " "atualizada." -#: ../../library/functions.rst:1818 +#: ../../library/functions.rst:1893 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -3350,7 +3505,7 @@ msgstr "" "verdadeiro. Se o segundo argumento é um tipo, ``issubclass(type2, type)`` " "deve ser verdadeiro (isto é útil para classmethods)." -#: ../../library/functions.rst:1823 +#: ../../library/functions.rst:1898 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -3362,7 +3517,7 @@ msgstr "" "nomeá-las explicitamente, tornando o código mais sustentável. Esse uso é " "paralelo ao uso de *super* em outras linguagens de programação." -#: ../../library/functions.rst:1828 +#: ../../library/functions.rst:1903 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -3385,12 +3540,20 @@ msgstr "" "e porque essa ordem pode incluir classes de irmãos desconhecidas antes do " "tempo de execução)." -#: ../../library/functions.rst:1838 +#: ../../library/functions.rst:1913 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" "Nos dois casos de uso, uma chamada típica de superclasse se parece com isso::" -#: ../../library/functions.rst:1845 +#: ../../library/functions.rst:1915 +msgid "" +"class C(B):\n" +" def method(self, arg):\n" +" super().method(arg) # This does the same thing as:\n" +" # super(C, self).method(arg)" +msgstr "" + +#: ../../library/functions.rst:1920 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " @@ -3400,7 +3563,7 @@ msgstr "" "de atributo. Um possível caso de uso para isso é chamar :term:`descritores " "` em uma classe pai ou irmã." -#: ../../library/functions.rst:1849 +#: ../../library/functions.rst:1924 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -3417,7 +3580,7 @@ msgstr "" "definida para procuras implícitas usando instruções ou operadores como " "``super()[name]``." -#: ../../library/functions.rst:1857 +#: ../../library/functions.rst:1932 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -3434,7 +3597,7 @@ msgstr "" "corretamente a classe que está sendo definida, além de acessar a instância " "atual para métodos comuns." -#: ../../library/functions.rst:1864 +#: ../../library/functions.rst:1939 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." -#: ../../library/functions.rst:1874 +#: ../../library/functions.rst:1949 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." @@ -3452,7 +3615,7 @@ msgstr "" "Ao invés de ser uma função, :class:`tuple` é na verdade um tipo de sequência " "imutável, conforme documentado em :ref:`typesseq-tuple` e :ref:`typesseq`." -#: ../../library/functions.rst:1883 +#: ../../library/functions.rst:1958 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." @@ -3462,7 +3625,7 @@ msgstr "" "tipo de objeto e geralmente o mesmo objeto retornado por :attr:`object." "__class__ `." -#: ../../library/functions.rst:1887 +#: ../../library/functions.rst:1962 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." @@ -3470,7 +3633,7 @@ msgstr "" "A função embutida :func:`isinstance` é recomendada para testar o tipo de um " "objeto, porque ela leva sub-classes em consideração." -#: ../../library/functions.rst:1891 +#: ../../library/functions.rst:1966 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -3492,11 +3655,11 @@ msgstr "" "`~object.__dict__`. As duas instruções a seguir criam objetos :class:`type` " "idênticos:" -#: ../../library/functions.rst:1906 +#: ../../library/functions.rst:1981 msgid "See also :ref:`bltin-type-objects`." msgstr "Veja também :ref:`bltin-type-objects`." -#: ../../library/functions.rst:1908 +#: ../../library/functions.rst:1983 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3508,11 +3671,11 @@ msgstr "" "__init_subclass__`) da mesma forma que palavras-chave em uma definição de " "classe (além de *metaclasse*) fariam." -#: ../../library/functions.rst:1913 +#: ../../library/functions.rst:1988 msgid "See also :ref:`class-customization`." msgstr "Veja também :ref:`class-customization`." -#: ../../library/functions.rst:1915 +#: ../../library/functions.rst:1990 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." @@ -3520,7 +3683,7 @@ msgstr "" "Subclasses de :class:`type` que não substituem ``type.__new__`` não podem " "mais usar a forma com apenas um argumento para obter o tipo de um objeto." -#: ../../library/functions.rst:1922 +#: ../../library/functions.rst:1997 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." @@ -3528,7 +3691,7 @@ msgstr "" "Retorna o atributo :attr:`~object.__dict__` para um módulo, classe, " "instância, or qualquer outro objeto com um atributo :attr:`~object.__dict__`." -#: ../../library/functions.rst:1925 +#: ../../library/functions.rst:2000 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -3540,7 +3703,7 @@ msgstr "" "atributos :attr:`~object.__dict__` (por exemplo, classes usam um :class:" "`types.MappingProxyType` para prevenir atualizações diretas a dicionário)." -#: ../../library/functions.rst:1930 +#: ../../library/functions.rst:2005 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " @@ -3550,7 +3713,7 @@ msgstr "" "dicionário locals é apenas útil para leitura, pelo fato de alterações no " "dicionário locals serem ignoradas." -#: ../../library/functions.rst:1934 +#: ../../library/functions.rst:2009 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " @@ -3560,7 +3723,7 @@ msgstr "" "ela não tem um atributo :attr:`~object.__dict__` (por exemplo, se sua classe " "define o atributo :attr:`~object.__slots__`)." -#: ../../library/functions.rst:1940 +#: ../../library/functions.rst:2015 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." @@ -3568,11 +3731,21 @@ msgstr "" "Itera sobre vários iteráveis em paralelo, produzindo tuplas com um item de " "cada um." -#: ../../library/functions.rst:1943 +#: ../../library/functions.rst:2018 msgid "Example::" msgstr "Exemplo::" -#: ../../library/functions.rst:1952 +#: ../../library/functions.rst:2020 +msgid "" +">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" +"... print(item)\n" +"...\n" +"(1, 'sugar')\n" +"(2, 'spice')\n" +"(3, 'everything nice')" +msgstr "" + +#: ../../library/functions.rst:2027 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." @@ -3581,7 +3754,7 @@ msgstr "" "ésima tupla contém o *i*-ésimo elemento de cada um dos iteráveis do " "argumento." -#: ../../library/functions.rst:1955 +#: ../../library/functions.rst:2030 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." -#: ../../library/functions.rst:1959 +#: ../../library/functions.rst:2034 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" @@ -3601,7 +3774,7 @@ msgstr "" "iterável seja iterado. Por exemplo, por um loop :keyword:`!for` ou por um :" "class:`list`." -#: ../../library/functions.rst:1963 +#: ../../library/functions.rst:2038 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -3613,7 +3786,7 @@ msgstr "" "bug no código que preparou esses iteráveis. Python oferece três abordagens " "diferentes para lidar com esse problema:" -#: ../../library/functions.rst:1968 +#: ../../library/functions.rst:2043 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " @@ -3623,7 +3796,13 @@ msgstr "" "ignorar os itens restantes nos iteráveis mais longos, cortando o resultado " "para o comprimento do iterável mais curto::" -#: ../../library/functions.rst:1975 +#: ../../library/functions.rst:2047 +msgid "" +">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" +"[(0, 'fee'), (1, 'fi'), (2, 'fo')]" +msgstr "" + +#: ../../library/functions.rst:2050 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " @@ -3633,7 +3812,13 @@ msgstr "" "considerados de tamanho igual. Nesses casos, é recomendado usar a opção " "``strict=True``. Sua saída é a mesma do :func:`zip`:: normal" -#: ../../library/functions.rst:1982 +#: ../../library/functions.rst:2054 +msgid "" +">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" +"[('a', 1), ('b', 2), ('c', 3)]" +msgstr "" + +#: ../../library/functions.rst:2057 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" @@ -3641,7 +3826,7 @@ msgstr "" "Ao contrário do comportamento padrão, ele levanta uma exceção :exc:" "`ValueError` se um iterável for esgotado antes dos outros:" -#: ../../library/functions.rst:2000 +#: ../../library/functions.rst:2075 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " @@ -3651,7 +3836,7 @@ msgstr "" "diferentes comprimentos será silenciado, possivelmente se manifestando como " "um bug difícil de encontrar em outra parte do programa." -#: ../../library/functions.rst:2004 +#: ../../library/functions.rst:2079 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." @@ -3661,7 +3846,7 @@ msgstr "" "fazer com que todos os iteráveis tenham o mesmo comprimento. Isso é feito " "por :func:`itertools.zip_longest`." -#: ../../library/functions.rst:2008 +#: ../../library/functions.rst:2083 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." @@ -3669,11 +3854,11 @@ msgstr "" "Casos extremos: Com um único argumento iterável, :func:`zip` retorna um " "iterador de tuplas de um elemento. Sem argumentos, retorna um iterador vazio." -#: ../../library/functions.rst:2011 +#: ../../library/functions.rst:2086 msgid "Tips and tricks:" msgstr "Dicas e truques:" -#: ../../library/functions.rst:2013 +#: ../../library/functions.rst:2088 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -3688,7 +3873,7 @@ msgstr "" "de chamadas ``n`` para o iterador. Isso tem o efeito de dividir a entrada em " "pedaços de n comprimentos." -#: ../../library/functions.rst:2019 +#: ../../library/functions.rst:2094 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" @@ -3696,11 +3881,22 @@ msgstr "" ":func:`zip` em conjunto com o operador ``*`` pode ser usado para " "descompactar uma lista::" -#: ../../library/functions.rst:2030 +#: ../../library/functions.rst:2097 +msgid "" +">>> x = [1, 2, 3]\n" +">>> y = [4, 5, 6]\n" +">>> list(zip(x, y))\n" +"[(1, 4), (2, 5), (3, 6)]\n" +">>> x2, y2 = zip(*zip(x, y))\n" +">>> x == list(x2) and y == list(y2)\n" +"True" +msgstr "" + +#: ../../library/functions.rst:2105 msgid "Added the ``strict`` argument." msgstr "Adicionado o argumento ``strict``." -#: ../../library/functions.rst:2042 +#: ../../library/functions.rst:2117 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." @@ -3708,7 +3904,7 @@ msgstr "" "Esta é uma função avançada que não é necessária na programação diária do " "Python, ao contrário de :func:`importlib.import_module`." -#: ../../library/functions.rst:2045 +#: ../../library/functions.rst:2120 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3728,7 +3924,7 @@ msgstr "" "importação padrão esteja em uso. O uso direto de :func:`__import__` também é " "desencorajado em favor de :func:`importlib.import_module`." -#: ../../library/functions.rst:2054 +#: ../../library/functions.rst:2129 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3744,7 +3940,7 @@ msgstr "" "seu argumento *locals* e usa seus *globals* apenas para determinar o " "contexto do pacote da instrução :keyword:`import`." -#: ../../library/functions.rst:2061 +#: ../../library/functions.rst:2136 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3758,7 +3954,7 @@ msgstr "" "pesquisados em relação ao diretório do módulo que chama :func:`__import__` " "(consulte :pep:`328` para obter detalhes)." -#: ../../library/functions.rst:2067 +#: ../../library/functions.rst:2142 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -3770,7 +3966,7 @@ msgstr "" "módulo nomeado por *name*. No entanto, quando um argumento *fromlist* não " "vazio é fornecido, o módulo nomeado por *name* é retornado." -#: ../../library/functions.rst:2072 +#: ../../library/functions.rst:2147 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" @@ -3778,11 +3974,19 @@ msgstr "" "Por exemplo, a instrução ``importar spam`` resulta em bytecode semelhante ao " "seguinte código::" -#: ../../library/functions.rst:2077 +#: ../../library/functions.rst:2150 +msgid "spam = __import__('spam', globals(), locals(), [], 0)" +msgstr "" + +#: ../../library/functions.rst:2152 msgid "The statement ``import spam.ham`` results in this call::" msgstr "A instrução ``import spam.ham`` resulta nesta chamada::" -#: ../../library/functions.rst:2081 +#: ../../library/functions.rst:2154 +msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" +msgstr "" + +#: ../../library/functions.rst:2156 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." @@ -3790,7 +3994,7 @@ msgstr "" "Observe como :func:`__import__` retorna o módulo de nível superior aqui, " "porque este é o objeto vinculado a um nome pela instrução :keyword:`import`." -#: ../../library/functions.rst:2084 +#: ../../library/functions.rst:2159 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" @@ -3798,7 +4002,14 @@ msgstr "" "Por outro lado, a instrução ``from spam.ham import eggs, sausage as saus`` " "resulta em ::" -#: ../../library/functions.rst:2091 +#: ../../library/functions.rst:2162 +msgid "" +"_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" +"eggs = _temp.eggs\n" +"saus = _temp.sausage" +msgstr "" + +#: ../../library/functions.rst:2166 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " @@ -3808,7 +4019,7 @@ msgstr "" "desse objeto, os nomes a serem importados são recuperados e atribuídos aos " "seus respectivos nomes." -#: ../../library/functions.rst:2095 +#: ../../library/functions.rst:2170 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." @@ -3816,7 +4027,7 @@ msgstr "" "Se você simplesmente deseja importar um módulo (potencialmente dentro de um " "pacote) pelo nome, use :func:`importlib.import_module`." -#: ../../library/functions.rst:2098 +#: ../../library/functions.rst:2173 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." @@ -3824,7 +4035,7 @@ msgstr "" "Valores negativos para *level* não são mais suportados (o que também altera " "o valor padrão para 0)." -#: ../../library/functions.rst:2102 +#: ../../library/functions.rst:2177 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." @@ -3832,11 +4043,11 @@ msgstr "" "Quando as opções de linha de comando :option:`-E` ou :option:`-I` estão " "sendo usadas, a variável de ambiente :envvar:`PYTHONCASEOK` é agora ignorada." -#: ../../library/functions.rst:2107 +#: ../../library/functions.rst:2182 msgid "Footnotes" msgstr "Notas de rodapé" -#: ../../library/functions.rst:2108 +#: ../../library/functions.rst:2183 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " @@ -3846,110 +4057,110 @@ msgstr "" "no estilo Unix. Se você estiver lendo o código de um arquivo, use o modo de " "conversão de nova linha para converter novas linhas no estilo Windows ou Mac." -#: ../../library/functions.rst:153 +#: ../../library/functions.rst:154 msgid "Boolean" msgstr "Booleano" -#: ../../library/functions.rst:153 ../../library/functions.rst:1881 +#: ../../library/functions.rst:154 ../../library/functions.rst:1956 msgid "type" msgstr "tipo" -#: ../../library/functions.rst:586 +#: ../../library/functions.rst:631 msgid "built-in function" msgstr "função embutida" -#: ../../library/functions.rst:586 +#: ../../library/functions.rst:631 msgid "exec" msgstr "exec" -#: ../../library/functions.rst:663 +#: ../../library/functions.rst:713 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:663 +#: ../../library/functions.rst:713 msgid "Infinity" msgstr "Infinito" -#: ../../library/functions.rst:727 +#: ../../library/functions.rst:781 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:727 ../../library/functions.rst:1765 +#: ../../library/functions.rst:781 ../../library/functions.rst:1840 msgid "string" msgstr "string" -#: ../../library/functions.rst:727 +#: ../../library/functions.rst:781 msgid "format() (built-in function)" msgstr "format() (função embutida)" -#: ../../library/functions.rst:1175 +#: ../../library/functions.rst:1248 msgid "file object" msgstr "objeto arquivo" -#: ../../library/functions.rst:1175 ../../library/functions.rst:1296 +#: ../../library/functions.rst:1248 ../../library/functions.rst:1369 msgid "open() built-in function" msgstr "função embutida open()" -#: ../../library/functions.rst:1203 +#: ../../library/functions.rst:1276 msgid "file" msgstr "arquivo" -#: ../../library/functions.rst:1203 +#: ../../library/functions.rst:1276 msgid "modes" msgstr "modos" -#: ../../library/functions.rst:1296 +#: ../../library/functions.rst:1369 msgid "universal newlines" msgstr "novas linhas universais" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1430 msgid "line-buffered I/O" msgstr "E/S com buffer de linha" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1430 msgid "unbuffered I/O" msgstr "E/S sem buffer" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1430 msgid "buffer size, I/O" msgstr "buffer, tamanho, E/S" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1430 msgid "I/O control" msgstr "controle de E/S" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1430 msgid "buffering" msgstr "buffering" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1430 msgid "text mode" msgstr "texto, modo" -#: ../../library/functions.rst:1357 ../../library/functions.rst:2036 +#: ../../library/functions.rst:1430 ../../library/functions.rst:2111 msgid "module" msgstr "módulo" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1430 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1765 +#: ../../library/functions.rst:1840 msgid "str() (built-in function)" msgstr "str() (função embutida)" -#: ../../library/functions.rst:1881 +#: ../../library/functions.rst:1956 msgid "object" msgstr "objeto" -#: ../../library/functions.rst:2036 +#: ../../library/functions.rst:2111 msgid "statement" msgstr "instrução" -#: ../../library/functions.rst:2036 +#: ../../library/functions.rst:2111 msgid "import" msgstr "import" -#: ../../library/functions.rst:2036 +#: ../../library/functions.rst:2111 msgid "builtins" msgstr "builtins" diff --git a/library/functools.po b/library/functools.po index de5a3b28f..22ab0cdc2 100644 --- a/library/functools.po +++ b/library/functools.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Italo Penaforte , 2021 -# Adorilson Bezerra , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -63,18 +59,30 @@ msgstr "" msgid "" "Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper " "around a dictionary lookup for the function arguments. Because it never " -"needs to evict old values, this is smaller and faster than :func:" -"`lru_cache()` with a size limit." +"needs to evict old values, this is smaller and faster than :func:`lru_cache` " +"with a size limit." msgstr "" -"Retorna o mesmo que ``lru_cache(maxsize=None)``, criando um invólucro fino " -"em torno de uma pesquisa de dicionário para os argumentos da função. Como " -"nunca precisa remover valores antigos, isso é menor e mais rápido do que :" -"func:`lru_cache()` com um limite de tamanho." #: ../../library/functools.rst:39 ../../library/functools.rst:291 msgid "For example::" msgstr "Por exemplo::" +#: ../../library/functools.rst:41 +msgid "" +"@cache\n" +"def factorial(n):\n" +" return n * factorial(n-1) if n else 1\n" +"\n" +">>> factorial(10) # no previously cached result, makes 11 recursive " +"calls\n" +"3628800\n" +">>> factorial(5) # just looks up cached value result\n" +"120\n" +">>> factorial(12) # makes two new recursive calls, the other 10 are " +"cached\n" +"479001600" +msgstr "" + #: ../../library/functools.rst:52 ../../library/functools.rst:158 msgid "" "The cache is threadsafe so that the wrapped function can be used in multiple " @@ -107,6 +115,18 @@ msgstr "" msgid "Example::" msgstr "Exemplo::" +#: ../../library/functools.rst:72 +msgid "" +"class DataSet:\n" +"\n" +" def __init__(self, sequence_of_numbers):\n" +" self._data = tuple(sequence_of_numbers)\n" +"\n" +" @cached_property\n" +" def stdev(self):\n" +" return statistics.stdev(self._data)" +msgstr "" + #: ../../library/functools.rst:81 msgid "" "The mechanics of :func:`cached_property` are somewhat different from :func:" @@ -200,6 +220,11 @@ msgid "" "one argument and returns another value to be used as the sort key." msgstr "" +#: ../../library/functools.rst:144 +msgid "" +"sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order" +msgstr "" + #: ../../library/functools.rst:146 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." @@ -241,6 +266,13 @@ msgstr "" "decorador *lru_cache* seja aplicado diretamente a uma função do usuário, " "deixando *maxsize* em seu valor padrão de 128::" +#: ../../library/functools.rst:178 +msgid "" +"@lru_cache\n" +"def count_vowels(sentence):\n" +" return sum(sentence.count(vowel) for vowel in 'AEIOUaeiou')" +msgstr "" + #: ../../library/functools.rst:182 msgid "" "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " @@ -342,6 +374,26 @@ msgstr "" msgid "Example of an LRU cache for static web content::" msgstr "Exemplo de um cache LRU para conteúdo web estático::" +#: ../../library/functools.rst:235 +msgid "" +"@lru_cache(maxsize=32)\n" +"def get_pep(num):\n" +" 'Retrieve text of a Python Enhancement Proposal'\n" +" resource = f'https://peps.python.org/pep-{num:04d}'\n" +" try:\n" +" with urllib.request.urlopen(resource) as s:\n" +" return s.read()\n" +" except urllib.error.HTTPError:\n" +" return 'Not Found'\n" +"\n" +">>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:\n" +"... pep = get_pep(n)\n" +"... print(n, len(pep))\n" +"\n" +">>> get_pep.cache_info()\n" +"CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" +msgstr "" + #: ../../library/functools.rst:252 msgid "" "Example of efficiently computing `Fibonacci numbers `_ " "técnica::" +#: ../../library/functools.rst:258 +msgid "" +"@lru_cache(maxsize=None)\n" +"def fib(n):\n" +" if n < 2:\n" +" return n\n" +" return fib(n-1) + fib(n-2)\n" +"\n" +">>> [fib(n) for n in range(16)]\n" +"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\n" +"\n" +">>> fib.cache_info()\n" +"CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" +msgstr "" + #: ../../library/functools.rst:272 msgid "Added the *typed* option." msgstr "Adicionada a opção *typed*." @@ -379,6 +446,25 @@ msgid "" "method." msgstr "" +#: ../../library/functools.rst:293 +msgid "" +"@total_ordering\n" +"class Student:\n" +" def _is_valid_operand(self, other):\n" +" return (hasattr(other, \"lastname\") and\n" +" hasattr(other, \"firstname\"))\n" +" def __eq__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) ==\n" +" (other.lastname.lower(), other.firstname.lower()))\n" +" def __lt__(self, other):\n" +" if not self._is_valid_operand(other):\n" +" return NotImplemented\n" +" return ((self.lastname.lower(), self.firstname.lower()) <\n" +" (other.lastname.lower(), other.firstname.lower()))" +msgstr "" + #: ../../library/functools.rst:311 msgid "" "While this decorator makes it easy to create well behaved totally ordered " @@ -411,6 +497,18 @@ msgid "" "extend and override *keywords*. Roughly equivalent to::" msgstr "" +#: ../../library/functools.rst:340 +msgid "" +"def partial(func, /, *args, **keywords):\n" +" def newfunc(*fargs, **fkeywords):\n" +" newkeywords = {**keywords, **fkeywords}\n" +" return func(*args, *fargs, **newkeywords)\n" +" newfunc.func = func\n" +" newfunc.args = args\n" +" newfunc.keywords = keywords\n" +" return newfunc" +msgstr "" + #: ../../library/functools.rst:349 msgid "" "The :func:`partial` is used for partial function application which " @@ -451,6 +549,27 @@ msgid "" "`partialmethod` constructor." msgstr "" +#: ../../library/functools.rst:385 +msgid "" +">>> class Cell:\n" +"... def __init__(self):\n" +"... self._alive = False\n" +"... @property\n" +"... def alive(self):\n" +"... return self._alive\n" +"... def set_state(self, state):\n" +"... self._alive = bool(state)\n" +"... set_alive = partialmethod(set_state, True)\n" +"... set_dead = partialmethod(set_state, False)\n" +"...\n" +">>> c = Cell()\n" +">>> c.alive\n" +"False\n" +">>> c.set_alive()\n" +">>> c.alive\n" +"True" +msgstr "" + #: ../../library/functools.rst:408 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " @@ -468,6 +587,19 @@ msgstr "" msgid "Roughly equivalent to::" msgstr "Aproximadamente equivalente a::" +#: ../../library/functools.rst:419 +msgid "" +"def reduce(function, iterable, initializer=None):\n" +" it = iter(iterable)\n" +" if initializer is None:\n" +" value = next(it)\n" +" else:\n" +" value = initializer\n" +" for element in it:\n" +" value = function(value, element)\n" +" return value" +msgstr "" + #: ../../library/functools.rst:429 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " @@ -487,6 +619,16 @@ msgid "" "dispatch happens on the type of the first argument::" msgstr "" +#: ../../library/functools.rst:441 +msgid "" +">>> from functools import singledispatch\n" +">>> @singledispatch\n" +"... def fun(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Let me just say,\", end=\" \")\n" +"... print(arg)" +msgstr "" + #: ../../library/functools.rst:448 msgid "" "To add overloaded implementations to the function, use the :func:`register` " @@ -495,22 +637,74 @@ msgid "" "first argument automatically::" msgstr "" +#: ../../library/functools.rst:453 +msgid "" +">>> @fun.register\n" +"... def _(arg: int, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> @fun.register\n" +"... def _(arg: list, verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)" +msgstr "" + #: ../../library/functools.rst:466 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" +#: ../../library/functools.rst:468 +msgid "" +">>> @fun.register\n" +"... def _(arg: int | float, verbose=False):\n" +"... if verbose:\n" +"... print(\"Strength in numbers, eh?\", end=\" \")\n" +"... print(arg)\n" +"...\n" +">>> from typing import Union\n" +">>> @fun.register\n" +"... def _(arg: Union[list, set], verbose=False):\n" +"... if verbose:\n" +"... print(\"Enumerate this:\")\n" +"... for i, elem in enumerate(arg):\n" +"... print(i, elem)\n" +"..." +msgstr "" + #: ../../library/functools.rst:483 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" +#: ../../library/functools.rst:486 +msgid "" +">>> @fun.register(complex)\n" +"... def _(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Better than complicated.\", end=\" \")\n" +"... print(arg.real, arg.imag)\n" +"..." +msgstr "" + #: ../../library/functools.rst:494 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" +#: ../../library/functools.rst:497 +msgid "" +">>> def nothing(arg, verbose=False):\n" +"... print(\"Nothing.\")\n" +"...\n" +">>> fun.register(type(None), nothing)" +msgstr "" + #: ../../library/functools.rst:502 msgid "" "The :func:`register` attribute returns the undecorated function. This " @@ -518,12 +712,45 @@ msgid "" "unit tests for each variant independently::" msgstr "" +#: ../../library/functools.rst:506 +msgid "" +">>> @fun.register(float)\n" +"... @fun.register(Decimal)\n" +"... def fun_num(arg, verbose=False):\n" +"... if verbose:\n" +"... print(\"Half of your number:\", end=\" \")\n" +"... print(arg / 2)\n" +"...\n" +">>> fun_num is fun\n" +"False" +msgstr "" + #: ../../library/functools.rst:516 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" +#: ../../library/functools.rst:519 +msgid "" +">>> fun(\"Hello, world.\")\n" +"Hello, world.\n" +">>> fun(\"test.\", verbose=True)\n" +"Let me just say, test.\n" +">>> fun(42, verbose=True)\n" +"Strength in numbers, eh? 42\n" +">>> fun(['spam', 'spam', 'eggs', 'spam'], verbose=True)\n" +"Enumerate this:\n" +"0 spam\n" +"1 spam\n" +"2 eggs\n" +"3 spam\n" +">>> fun(None)\n" +"Nothing.\n" +">>> fun(1.23)\n" +"0.615" +msgstr "" + #: ../../library/functools.rst:536 msgid "" "Where there is no registered implementation for a specific type, its method " @@ -540,18 +767,52 @@ msgid "" "implementation::" msgstr "" +#: ../../library/functools.rst:546 +msgid "" +">>> from collections.abc import Mapping\n" +">>> @fun.register\n" +"... def _(arg: Mapping, verbose=False):\n" +"... if verbose:\n" +"... print(\"Keys & Values\")\n" +"... for key, value in arg.items():\n" +"... print(key, \"=>\", value)\n" +"...\n" +">>> fun({\"a\": \"b\"})\n" +"a => b" +msgstr "" + #: ../../library/functools.rst:557 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" +#: ../../library/functools.rst:560 +msgid "" +">>> fun.dispatch(float)\n" +"\n" +">>> fun.dispatch(dict) # note: default implementation\n" +"" +msgstr "" + #: ../../library/functools.rst:565 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" +#: ../../library/functools.rst:568 +msgid "" +">>> fun.registry.keys()\n" +"dict_keys([, , ,\n" +" , ,\n" +" ])\n" +">>> fun.registry[float]\n" +"\n" +">>> fun.registry[object]\n" +"" +msgstr "" + #: ../../library/functools.rst:579 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" @@ -576,6 +837,22 @@ msgid "" "argument::" msgstr "" +#: ../../library/functools.rst:597 +msgid "" +"class Negator:\n" +" @singledispatchmethod\n" +" def neg(self, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" def _(self, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" def _(self, arg: bool):\n" +" return not arg" +msgstr "" + #: ../../library/functools.rst:610 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" @@ -585,6 +862,25 @@ msgid "" "rather than an instance of the class::" msgstr "" +#: ../../library/functools.rst:616 +msgid "" +"class Negator:\n" +" @singledispatchmethod\n" +" @classmethod\n" +" def neg(cls, arg):\n" +" raise NotImplementedError(\"Cannot negate a\")\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: int):\n" +" return -arg\n" +"\n" +" @neg.register\n" +" @classmethod\n" +" def _(cls, arg: bool):\n" +" return not arg" +msgstr "" + #: ../../library/functools.rst:632 msgid "" "The same pattern can be used for other similar decorators: :func:" @@ -601,12 +897,12 @@ msgid "" "corresponding attributes from the original function. The default values for " "these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` " "(which assigns to the wrapper function's ``__module__``, ``__name__``, " -"``__qualname__``, ``__annotations__`` and ``__doc__``, the documentation " -"string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's " -"``__dict__``, i.e. the instance dictionary)." +"``__qualname__``, ``__annotations__``, ``__type_params__``, and ``__doc__``, " +"the documentation string) and ``WRAPPER_UPDATES`` (which updates the wrapper " +"function's ``__dict__``, i.e. the instance dictionary)." msgstr "" -#: ../../library/functools.rst:651 +#: ../../library/functools.rst:652 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -614,7 +910,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: ../../library/functools.rst:656 +#: ../../library/functools.rst:657 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -623,7 +919,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: ../../library/functools.rst:662 +#: ../../library/functools.rst:663 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -632,21 +928,25 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: ../../library/functools.rst:668 +#: ../../library/functools.rst:669 msgid "" "The ``__wrapped__`` attribute is now automatically added. The " "``__annotations__`` attribute is now copied by default. Missing attributes " "no longer trigger an :exc:`AttributeError`." msgstr "" -#: ../../library/functools.rst:673 +#: ../../library/functools.rst:674 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: ../../library/functools.rst:681 +#: ../../library/functools.rst:679 +msgid "The ``__type_params__`` attribute is now copied by default." +msgstr "" + +#: ../../library/functools.rst:685 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -654,42 +954,66 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: ../../library/functools.rst:707 +#: ../../library/functools.rst:690 +msgid "" +">>> from functools import wraps\n" +">>> def my_decorator(f):\n" +"... @wraps(f)\n" +"... def wrapper(*args, **kwds):\n" +"... print('Calling decorated function')\n" +"... return f(*args, **kwds)\n" +"... return wrapper\n" +"...\n" +">>> @my_decorator\n" +"... def example():\n" +"... \"\"\"Docstring\"\"\"\n" +"... print('Called example function')\n" +"...\n" +">>> example()\n" +"Calling decorated function\n" +"Called example function\n" +">>> example.__name__\n" +"'example'\n" +">>> example.__doc__\n" +"'Docstring'" +msgstr "" + +#: ../../library/functools.rst:711 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: ../../library/functools.rst:715 +#: ../../library/functools.rst:719 msgid ":class:`partial` Objects" msgstr "Objetos :class:`partial`" -#: ../../library/functools.rst:717 +#: ../../library/functools.rst:721 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: ../../library/functools.rst:723 +#: ../../library/functools.rst:727 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: ../../library/functools.rst:729 +#: ../../library/functools.rst:733 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: ../../library/functools.rst:735 +#: ../../library/functools.rst:739 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: ../../library/functools.rst:738 +#: ../../library/functools.rst:742 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " "callable, weak referenceable, and can have attributes. There are some " diff --git a/library/gc.po b/library/gc.po index eac847945..f6a01cf82 100644 --- a/library/gc.po +++ b/library/gc.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -315,6 +315,22 @@ msgstr "" "de lixo de instâncias simples (por exemplo, dicts contendo apenas chaves e " "valores atômicos)::" +#: ../../library/gc.rst:173 +msgid "" +">>> gc.is_tracked(0)\n" +"False\n" +">>> gc.is_tracked(\"a\")\n" +"False\n" +">>> gc.is_tracked([])\n" +"True\n" +">>> gc.is_tracked({})\n" +"False\n" +">>> gc.is_tracked({\"a\": 1})\n" +"False\n" +">>> gc.is_tracked({\"a\": []})\n" +"True" +msgstr "" + #: ../../library/gc.rst:191 msgid "" "Returns ``True`` if the given object has been finalized by the garbage " @@ -323,6 +339,22 @@ msgstr "" "Retorna ``True`` se o objeto fornecido foi finalizado pelo coletor de lixo, " "``False`` caso contrário. ::" +#: ../../library/gc.rst:194 +msgid "" +">>> x = None\n" +">>> class Lazarus:\n" +"... def __del__(self):\n" +"... global x\n" +"... x = self\n" +"...\n" +">>> lazarus = Lazarus()\n" +">>> gc.is_finalized(lazarus)\n" +"False\n" +">>> del lazarus\n" +">>> gc.is_finalized(x)\n" +"True" +msgstr "" + #: ../../library/gc.rst:212 msgid "" "Freeze all the objects tracked by the garbage collector; move them to a " diff --git a/library/getopt.po b/library/getopt.po index 2f4e5b4ea..9e9586fa4 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -196,6 +195,38 @@ msgstr "Usar nomes de opções longos é igualmente fácil:" msgid "In a script, typical usage is something like this::" msgstr "Em um script, o uso típico é algo assim::" +#: ../../library/getopt.rst:120 +msgid "" +"import getopt, sys\n" +"\n" +"def main():\n" +" try:\n" +" opts, args = getopt.getopt(sys.argv[1:], \"ho:v\", [\"help\", " +"\"output=\"])\n" +" except getopt.GetoptError as err:\n" +" # print help information and exit:\n" +" print(err) # will print something like \"option -a not " +"recognized\"\n" +" usage()\n" +" sys.exit(2)\n" +" output = None\n" +" verbose = False\n" +" for o, a in opts:\n" +" if o == \"-v\":\n" +" verbose = True\n" +" elif o in (\"-h\", \"--help\"):\n" +" usage()\n" +" sys.exit()\n" +" elif o in (\"-o\", \"--output\"):\n" +" output = a\n" +" else:\n" +" assert False, \"unhandled option\"\n" +" # ...\n" +"\n" +"if __name__ == \"__main__\":\n" +" main()" +msgstr "" + #: ../../library/getopt.rst:147 msgid "" "Note that an equivalent command line interface could be produced with less " @@ -206,6 +237,19 @@ msgstr "" "com menos código e mais mensagens de erro de ajuda e erro informativas " "usando o módulo :mod:`argparse`::" +#: ../../library/getopt.rst:150 +msgid "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" args = parser.parse_args()\n" +" # ... do something with args.output ...\n" +" # ... do something with args.verbose .." +msgstr "" + #: ../../library/getopt.rst:162 msgid "Module :mod:`argparse`" msgstr "Módulo :mod:`argparse`" diff --git a/library/getpass.po b/library/getpass.po index d96b0ecdf..e8f897dae 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2022 -# Vitor Buxbaum Orlandi, 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Vitor Buxbaum Orlandi, 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -110,7 +109,5 @@ msgstr "" "levantada." #: ../../library/getpass.rst:52 -msgid "" -"In general, this function should be preferred over :func:`os.getlogin()`." +msgid "In general, this function should be preferred over :func:`os.getlogin`." msgstr "" -"Em geral, esta função deve ter preferência sobre :func:`os.getlogin()`." diff --git a/library/gettext.po b/library/gettext.po index 4d842c5f7..009f5feac 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Victor Matheus Castro , 2021 -# Vinicius Gubiani Ferreira , 2023 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -190,6 +188,16 @@ msgstr "" msgid "Here's an example of typical usage for this API::" msgstr "Aqui está um exemplo de uso típico para esta API::" +#: ../../library/gettext.rst:106 +msgid "" +"import gettext\n" +"gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')\n" +"gettext.textdomain('myapplication')\n" +"_ = gettext.gettext\n" +"# ...\n" +"print(_('This is a translatable string.'))" +msgstr "" + #: ../../library/gettext.rst:115 msgid "Class-based API" msgstr "API baseada em classe" @@ -343,6 +351,10 @@ msgstr "" "em sua aplicação, envolvendo-as em uma chamada para a função :func:`!_`, " "assim::" +#: ../../library/gettext.rst:187 +msgid "print(_('This string will be translated.'))" +msgstr "" + #: ../../library/gettext.rst:189 msgid "" "For convenience, you want the :func:`!_` function to be installed in " @@ -495,6 +507,13 @@ msgstr "" "os módulos localizados nunca devem instalar :func:`!_`. Em vez disso, eles " "devem usar este código para disponibilizar :func:`!_` para seu módulo::" +#: ../../library/gettext.rst:285 +msgid "" +"import gettext\n" +"t = gettext.translation('mymodule', ...)\n" +"_ = t.gettext" +msgstr "" + #: ../../library/gettext.rst:289 msgid "" "This puts :func:`!_` only in the module's global namespace and so only " @@ -622,6 +641,16 @@ msgstr "" msgid "Here is an example::" msgstr "Aqui está um exemplo::" +#: ../../library/gettext.rst:350 +msgid "" +"n = len(os.listdir('.'))\n" +"cat = GNUTranslations(somefile)\n" +"message = cat.ngettext(\n" +" 'There is %(num)d file in this directory',\n" +" 'There are %(num)d files in this directory',\n" +" n) % {'num': n}" +msgstr "" + #: ../../library/gettext.rst:360 msgid "" "Look up the *context* and *message* id in the catalog and return the " @@ -684,6 +713,14 @@ msgstr "" "O GNOME usa uma versão do módulo :mod:`gettext` de James Henstridge, mas " "esta versão tem uma API um pouco diferente. Seu uso documentado foi::" +#: ../../library/gettext.rst:399 +msgid "" +"import gettext\n" +"cat = gettext.Catalog(domain, localedir)\n" +"_ = cat.gettext\n" +"print(_('hello world'))" +msgstr "" + #: ../../library/gettext.rst:404 msgid "" "For compatibility with this older module, the function :func:`!Catalog` is " @@ -757,6 +794,14 @@ msgstr "" "envolvendo-a em ``_('...')`` --- isto é, uma chamada para a função :func:`_ " "`. Por exemplo::" +#: ../../library/gettext.rst:434 +msgid "" +"filename = 'mylog.txt'\n" +"message = _('writing a log message')\n" +"with open(filename, 'w') as fp:\n" +" fp.write(message)" +msgstr "" + #: ../../library/gettext.rst:439 msgid "" "In this example, the string ``'writing a log message'`` is marked as a " @@ -879,6 +924,13 @@ msgstr "" "formato GNU :program:`gettext`. Aqui está o que você colocaria sobre o seu " "módulo::" +#: ../../library/gettext.rst:496 +msgid "" +"import gettext\n" +"t = gettext.translation('spam', '/usr/share/locale')\n" +"_ = t.gettext" +msgstr "" + #: ../../library/gettext.rst:502 msgid "Localizing your application" msgstr "Localizando sua aplicação" @@ -904,6 +956,12 @@ msgstr "" "No caso simples, você precisa adicionar apenas o seguinte código ao arquivo " "do driver principal da sua aplicação::" +#: ../../library/gettext.rst:512 +msgid "" +"import gettext\n" +"gettext.install('myapplication')" +msgstr "" + #: ../../library/gettext.rst:515 msgid "" "If you need to set the locale directory, you can pass it into the :func:" @@ -912,6 +970,12 @@ msgstr "" "Se você precisar definir o diretório da localidade, poderá passá-lo para a " "função :func:`install`::" +#: ../../library/gettext.rst:518 +msgid "" +"import gettext\n" +"gettext.install('myapplication', '/usr/share/locale')" +msgstr "" + #: ../../library/gettext.rst:523 msgid "Changing languages on the fly" msgstr "Alterando os idiomas durante o uso" @@ -926,6 +990,24 @@ msgstr "" "convém criar várias instâncias de tradução e alternar entre elas " "explicitamente, assim::" +#: ../../library/gettext.rst:529 +msgid "" +"import gettext\n" +"\n" +"lang1 = gettext.translation('myapplication', languages=['en'])\n" +"lang2 = gettext.translation('myapplication', languages=['fr'])\n" +"lang3 = gettext.translation('myapplication', languages=['de'])\n" +"\n" +"# start by using language1\n" +"lang1.install()\n" +"\n" +"# ... time goes by, user selects language 2\n" +"lang2.install()\n" +"\n" +"# ... more time goes by, user selects language 3\n" +"lang3.install()" +msgstr "" + #: ../../library/gettext.rst:546 msgid "Deferred translations" msgstr "Traduções adiadas" @@ -940,6 +1022,18 @@ msgstr "" "codificadas. Ocasionalmente, no entanto, é necessário marcar strings para " "tradução, mas adiar a tradução real até mais tarde. Um exemplo clássico é::" +#: ../../library/gettext.rst:552 +msgid "" +"animals = ['mollusk',\n" +" 'albatross',\n" +" 'rat',\n" +" 'penguin',\n" +" 'python', ]\n" +"# ...\n" +"for a in animals:\n" +" print(a)" +msgstr "" + #: ../../library/gettext.rst:561 msgid "" "Here, you want to mark the strings in the ``animals`` list as being " @@ -953,6 +1047,23 @@ msgstr "" msgid "Here is one way you can handle this situation::" msgstr "Aqui está uma maneira de lidar com esta situação::" +#: ../../library/gettext.rst:567 +msgid "" +"def _(message): return message\n" +"\n" +"animals = [_('mollusk'),\n" +" _('albatross'),\n" +" _('rat'),\n" +" _('penguin'),\n" +" _('python'), ]\n" +"\n" +"del _\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" +msgstr "" + #: ../../library/gettext.rst:581 msgid "" "This works because the dummy definition of :func:`!_` simply returns the " @@ -981,6 +1092,21 @@ msgstr "" msgid "Another way to handle this is with the following example::" msgstr "Outra maneira de lidar com isso é com o seguinte exemplo::" +#: ../../library/gettext.rst:593 +msgid "" +"def N_(message): return message\n" +"\n" +"animals = [N_('mollusk'),\n" +" N_('albatross'),\n" +" N_('rat'),\n" +" N_('penguin'),\n" +" N_('python'), ]\n" +"\n" +"# ...\n" +"for a in animals:\n" +" print(_(a))" +msgstr "" + #: ../../library/gettext.rst:605 msgid "" "In this case, you are marking translatable strings with the function :func:`!" diff --git a/library/glob.po b/library/glob.po index 6bf02c63f..12c17b7ce 100644 --- a/library/glob.po +++ b/library/glob.po @@ -4,9 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Sheila Gomes , 2021 -# i17obot , 2021 -# Adorilson Bezerra , 2023 # Rafael Fontenelle , 2024 # #, fuzzy @@ -14,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -217,6 +214,21 @@ msgstr "" "resultados. Observe como todos os componentes principais do caminho são " "preservados. ::" +#: ../../library/glob.rst:134 +msgid "" +">>> import glob\n" +">>> glob.glob('./[0-9].*')\n" +"['./1.gif', './2.txt']\n" +">>> glob.glob('*.gif')\n" +"['1.gif', 'card.gif']\n" +">>> glob.glob('?.gif')\n" +"['1.gif']\n" +">>> glob.glob('**/*.txt', recursive=True)\n" +"['2.txt', 'sub/3.txt']\n" +">>> glob.glob('./**/', recursive=True)\n" +"['./', './sub/']" +msgstr "" + #: ../../library/glob.rst:146 msgid "" "If the directory contains files starting with ``.`` they won't be matched by " @@ -227,6 +239,15 @@ msgstr "" "correspondidos por padrão. Por exemplo, considere um diretório contendo :" "file:`card.gif` e :file:`.card.gif` ::" +#: ../../library/glob.rst:150 +msgid "" +">>> import glob\n" +">>> glob.glob('*.gif')\n" +"['card.gif']\n" +">>> glob.glob('.c*')\n" +"['.card.gif']" +msgstr "" + #: ../../library/glob.rst:158 msgid "Module :mod:`fnmatch`" msgstr "Módulo :mod:`fnmatch`" diff --git a/library/graphlib.po b/library/graphlib.po index 664fb7c23..b11ef4a67 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -4,24 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Hildeberto Abreu Magalhães , 2021 -# Leticia Portella , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -124,6 +122,14 @@ msgstr "" "nenhum paralelismo esteja envolvido, o método de conveniência :meth:" "`TopologicalSorter.static_order` pode ser usado diretamente:" +#: ../../library/graphlib.rst:53 +msgid "" +">>> graph = {\"D\": {\"B\", \"C\"}, \"C\": {\"A\"}, \"B\": {\"A\"}}\n" +">>> ts = TopologicalSorter(graph)\n" +">>> tuple(ts.static_order())\n" +"('A', 'C', 'B', 'D')" +msgstr "" + #: ../../library/graphlib.rst:60 msgid "" "The class is designed to easily support parallel processing of the nodes as " @@ -132,6 +138,31 @@ msgstr "" "A classe foi projetada para suportar facilmente o processamento paralelo dos " "nós à medida que eles se tornam prontos. Por exemplo::" +#: ../../library/graphlib.rst:63 +msgid "" +"topological_sorter = TopologicalSorter()\n" +"\n" +"# Add nodes to 'topological_sorter'...\n" +"\n" +"topological_sorter.prepare()\n" +"while topological_sorter.is_active():\n" +" for node in topological_sorter.get_ready():\n" +" # Worker threads or processes take nodes to work on off the\n" +" # 'task_queue' queue.\n" +" task_queue.put(node)\n" +"\n" +" # When the work for a node is done, workers put the node in\n" +" # 'finalized_tasks_queue' so we can get more nodes to work on.\n" +" # The definition of 'is_active()' guarantees that, at this point, at\n" +" # least one node has been placed on 'task_queue' that hasn't yet\n" +" # been passed to 'done()', so this blocking 'get()' must (eventually)\n" +" # succeed. After calling 'done()', we loop back to call 'get_ready()'\n" +" # again, so put newly freed nodes on 'task_queue' as soon as\n" +" # logically possible.\n" +" node = finalized_tasks_queue.get()\n" +" topological_sorter.done(node)" +msgstr "" + #: ../../library/graphlib.rst:87 msgid "" "Add a new node and its predecessors to the graph. Both the *node* and all " @@ -206,10 +237,22 @@ msgstr "" "O método :meth:`~object.__bool__` desta classe adia para essa função, então, " "em vez de::" +#: ../../library/graphlib.rst:121 +msgid "" +"if ts.is_active():\n" +" ..." +msgstr "" + #: ../../library/graphlib.rst:124 msgid "it is possible to simply do::" msgstr "é possível simplesmente fazer::" +#: ../../library/graphlib.rst:126 +msgid "" +"if ts:\n" +" ..." +msgstr "" + #: ../../library/graphlib.rst:129 ../../library/graphlib.rst:152 msgid "" "Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter." @@ -269,6 +312,16 @@ msgstr "" "`~TopologicalSorter.done` não devem ser chamados. Este método é equivalente " "a::" +#: ../../library/graphlib.rst:162 +msgid "" +"def static_order(self):\n" +" self.prepare()\n" +" while self.is_active():\n" +" node_group = self.get_ready()\n" +" yield from node_group\n" +" self.done(*node_group)" +msgstr "" + #: ../../library/graphlib.rst:169 msgid "" "The particular order that is returned may depend on the specific order in " @@ -277,6 +330,21 @@ msgstr "" "A ordem específica retornada pode depender da ordem específica em que os " "itens foram inseridos no grafo. Por exemplo:" +#: ../../library/graphlib.rst:172 +msgid "" +">>> ts = TopologicalSorter()\n" +">>> ts.add(3, 2, 1)\n" +">>> ts.add(1, 0)\n" +">>> print([*ts.static_order()])\n" +"[2, 0, 1, 3]\n" +"\n" +">>> ts2 = TopologicalSorter()\n" +">>> ts2.add(1, 0)\n" +">>> ts2.add(3, 2, 1)\n" +">>> print([*ts2.static_order()])\n" +"[0, 2, 1, 3]" +msgstr "" + #: ../../library/graphlib.rst:186 msgid "" "This is due to the fact that \"0\" and \"2\" are in the same level in the " diff --git a/library/grp.po b/library/grp.po index 73a0618bc..e451314e0 100644 --- a/library/grp.po +++ b/library/grp.po @@ -4,26 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Welington Carlos , 2021 -# Claudio Rogerio Carvalho Filho , 2021 -# Marciel Leal , 2021 -# i17obot , 2021 -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -158,5 +154,4 @@ msgstr "Módulo :mod:`spwd`" #: ../../library/grp.rst:68 msgid "An interface to the shadow password database, similar to this." -msgstr "" -"Uma interface para o banco de dados de shadow passwords, similar a essa." +msgstr "Uma interface para o banco de dados de senhas shadow, similar a esta." diff --git a/library/gzip.po b/library/gzip.po index 0a8e911c8..e0ba9f0b0 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -4,25 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Adorilson Bezerra , 2021 -# Christian Janiake , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -293,10 +290,12 @@ msgstr "" msgid "" "Speed is improved by compressing all data at once instead of in a streamed " "fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." -"compress` for better speed." +"compress` for better speed. In this situation the output may contain a gzip " +"header \"OS\" byte value other than 255 \"unknown\" as supplied by the " +"underlying zlib implementation." msgstr "" -#: ../../library/gzip.rst:201 +#: ../../library/gzip.rst:203 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " "uncompressed data. This function is capable of decompressing multi-member " @@ -305,82 +304,113 @@ msgid "" "*wbits* set to 31 is faster." msgstr "" -#: ../../library/gzip.rst:208 +#: ../../library/gzip.rst:210 msgid "" "Speed is improved by decompressing members at once in memory instead of in a " "streamed fashion." msgstr "" -#: ../../library/gzip.rst:215 +#: ../../library/gzip.rst:217 msgid "Examples of usage" msgstr "Exemplos de uso" -#: ../../library/gzip.rst:217 +#: ../../library/gzip.rst:219 msgid "Example of how to read a compressed file::" msgstr "" -#: ../../library/gzip.rst:223 +#: ../../library/gzip.rst:221 +msgid "" +"import gzip\n" +"with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" +" file_content = f.read()" +msgstr "" + +#: ../../library/gzip.rst:225 msgid "Example of how to create a compressed GZIP file::" msgstr "" -#: ../../library/gzip.rst:230 +#: ../../library/gzip.rst:227 +msgid "" +"import gzip\n" +"content = b\"Lots of content here\"\n" +"with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" +" f.write(content)" +msgstr "" + +#: ../../library/gzip.rst:232 msgid "Example of how to GZIP compress an existing file::" msgstr "" -#: ../../library/gzip.rst:238 +#: ../../library/gzip.rst:234 +msgid "" +"import gzip\n" +"import shutil\n" +"with open('/home/joe/file.txt', 'rb') as f_in:\n" +" with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" +" shutil.copyfileobj(f_in, f_out)" +msgstr "" + +#: ../../library/gzip.rst:240 msgid "Example of how to GZIP compress a binary string::" msgstr "" -#: ../../library/gzip.rst:246 +#: ../../library/gzip.rst:242 +msgid "" +"import gzip\n" +"s_in = b\"Lots of content here\"\n" +"s_out = gzip.compress(s_in)" +msgstr "" + +#: ../../library/gzip.rst:248 msgid "Module :mod:`zlib`" msgstr "Módulo :mod:`zlib`" -#: ../../library/gzip.rst:247 +#: ../../library/gzip.rst:249 msgid "" "The basic data compression module needed to support the :program:`gzip` file " "format." msgstr "" -#: ../../library/gzip.rst:256 +#: ../../library/gzip.rst:258 msgid "Command Line Interface" msgstr "Interface de linha de comando" -#: ../../library/gzip.rst:258 +#: ../../library/gzip.rst:260 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:261 +#: ../../library/gzip.rst:263 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:265 +#: ../../library/gzip.rst:267 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:269 +#: ../../library/gzip.rst:271 msgid "Command line options" msgstr "Opções da linha de comando" -#: ../../library/gzip.rst:273 +#: ../../library/gzip.rst:275 msgid "If *file* is not specified, read from :data:`sys.stdin`." msgstr "" -#: ../../library/gzip.rst:277 +#: ../../library/gzip.rst:279 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:281 +#: ../../library/gzip.rst:283 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:285 +#: ../../library/gzip.rst:287 msgid "Decompress the given file." msgstr "Descompacta o arquivo dado." -#: ../../library/gzip.rst:289 +#: ../../library/gzip.rst:291 msgid "Show the help message." msgstr "Exibe a mensagem de ajuda." diff --git a/library/hashlib.po b/library/hashlib.po index a801c8873..0c2338401 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -4,27 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 -# i17obot , 2021 -# Marco Rougeth , 2022 -# Claudio Rogerio Carvalho Filho , 2023 -# Vinicius Gubiani Ferreira , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: Vinicius Gubiani Ferreira , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -139,6 +134,20 @@ msgid "" "repetition\"``::" msgstr "" +#: ../../library/hashlib.rst:105 +msgid "" +">>> import hashlib\n" +">>> m = hashlib.sha256()\n" +">>> m.update(b\"Nobody inspects\")\n" +">>> m.update(b\" the spammish repetition\")\n" +">>> m.digest()\n" +"b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" +"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:" +"\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" +">>> m.hexdigest()\n" +"'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" +msgstr "" + #: ../../library/hashlib.rst:114 msgid "More condensed:" msgstr "" @@ -361,8 +370,9 @@ msgstr "" #: ../../library/hashlib.rst:331 msgid "" -"*dklen* is the length of the derived key. If *dklen* is ``None`` then the " -"digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512." +"*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` " +"then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for " +"SHA-512." msgstr "" #: ../../library/hashlib.rst:340 @@ -393,7 +403,7 @@ msgstr "" msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " -"*dklen* is the length of the derived key." +"*dklen* is the length of the derived key in bytes." msgstr "" #: ../../library/hashlib.rst:366 @@ -674,18 +684,65 @@ msgid "" "for message ``b'message data'`` with key ``b'pseudorandom key'``::" msgstr "" +#: ../../library/hashlib.rst:583 +msgid "" +">>> from hashlib import blake2b\n" +">>> h = blake2b(key=b'pseudorandom key', digest_size=16)\n" +">>> h.update(b'message data')\n" +">>> h.hexdigest()\n" +"'3d363ff7401e02026f4a4687d4863ced'" +msgstr "" + #: ../../library/hashlib.rst:590 msgid "" "As a practical example, a web application can symmetrically sign cookies " "sent to users and later verify them to make sure they weren't tampered with::" msgstr "" +#: ../../library/hashlib.rst:593 +msgid "" +">>> from hashlib import blake2b\n" +">>> from hmac import compare_digest\n" +">>>\n" +">>> SECRET_KEY = b'pseudorandomly generated server secret key'\n" +">>> AUTH_SIZE = 16\n" +">>>\n" +">>> def sign(cookie):\n" +"... h = blake2b(digest_size=AUTH_SIZE, key=SECRET_KEY)\n" +"... h.update(cookie)\n" +"... return h.hexdigest().encode('utf-8')\n" +">>>\n" +">>> def verify(cookie, sig):\n" +"... good_sig = sign(cookie)\n" +"... return compare_digest(good_sig, sig)\n" +">>>\n" +">>> cookie = b'user-alice'\n" +">>> sig = sign(cookie)\n" +">>> print(\"{0},{1}\".format(cookie.decode('utf-8'), sig))\n" +"user-alice,b'43b3c982cf697e0c5ab22172d1ca7421'\n" +">>> verify(cookie, sig)\n" +"True\n" +">>> verify(b'user-bob', sig)\n" +"False\n" +">>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00')\n" +"False" +msgstr "" + #: ../../library/hashlib.rst:619 msgid "" "Even though there's a native keyed hashing mode, BLAKE2 can, of course, be " "used in HMAC construction with :mod:`hmac` module::" msgstr "" +#: ../../library/hashlib.rst:622 +msgid "" +">>> import hmac, hashlib\n" +">>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)\n" +">>> m.update(b'message')\n" +">>> m.hexdigest()\n" +"'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" +msgstr "" + #: ../../library/hashlib.rst:630 msgid "Randomized hashing" msgstr "" @@ -769,6 +826,21 @@ msgstr "" msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "" +#: ../../library/hashlib.rst:705 +msgid "" +">>> from hashlib import blake2b\n" +">>> FILES_HASH_PERSON = b'MyApp Files Hash'\n" +">>> BLOCK_HASH_PERSON = b'MyApp Block Hash'\n" +">>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4'\n" +">>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON)\n" +">>> h.update(b'the same content')\n" +">>> h.hexdigest()\n" +"'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" +msgstr "" + #: ../../library/hashlib.rst:717 msgid "" "Personalization together with the keyed mode can also be used to derive " @@ -783,12 +855,48 @@ msgstr "Modo árvore" msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "" +#: ../../library/hashlib.rst:735 +msgid "" +" 10\n" +" / \\\n" +"00 01" +msgstr "" + #: ../../library/hashlib.rst:739 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" +#: ../../library/hashlib.rst:742 +msgid "" +">>> from hashlib import blake2b\n" +">>>\n" +">>> FANOUT = 2\n" +">>> DEPTH = 2\n" +">>> LEAF_SIZE = 4096\n" +">>> INNER_SIZE = 64\n" +">>>\n" +">>> buf = bytearray(6000)\n" +">>>\n" +">>> # Left leaf\n" +"... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=0, last_node=False)\n" +">>> # Right leaf\n" +"... h01 = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=1, node_depth=0, last_node=True)\n" +">>> # Root node\n" +"... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH,\n" +"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" +"... node_offset=0, node_depth=1, last_node=True)\n" +">>> h10.update(h00.digest())\n" +">>> h10.update(h01.digest())\n" +">>> h10.hexdigest()\n" +"'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" +msgstr "" + #: ../../library/hashlib.rst:769 msgid "Credits" msgstr "" diff --git a/library/heapq.po b/library/heapq.po index 3abc44f05..5a5334c27 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -4,7 +4,6 @@ # FIRST AUTHOR , YEAR. # # Translators: -# i17obot , 2021 # Rafael Fontenelle , 2024 # #, fuzzy @@ -12,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" "Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -281,6 +280,18 @@ msgstr "" "implementado colocando todos os valores em um heap e, em seguida, retirando " "os menores valores, um de cada vez::" +#: ../../library/heapq.rst:144 +msgid "" +">>> def heapsort(iterable):\n" +"... h = []\n" +"... for value in iterable:\n" +"... heappush(h, value)\n" +"... return [heappop(h) for i in range(len(h))]\n" +"...\n" +">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n" +"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" +msgstr "" + #: ../../library/heapq.rst:153 msgid "" "This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this " @@ -298,6 +309,17 @@ msgstr "" "comparação (como prioridades de tarefas) juntamente com o registro principal " "que está sendo rastreado::" +#: ../../library/heapq.rst:159 +msgid "" +">>> h = []\n" +">>> heappush(h, (5, 'write code'))\n" +">>> heappush(h, (7, 'release product'))\n" +">>> heappush(h, (1, 'write spec'))\n" +">>> heappush(h, (3, 'create tests'))\n" +">>> heappop(h)\n" +"(1, 'write spec')" +msgstr "" + #: ../../library/heapq.rst:169 msgid "Priority Queue Implementation Notes" msgstr "Notas de implementação da fila de prioridade" @@ -368,6 +390,17 @@ msgstr "" "Outra solução para o problema de tarefas não comparáveis é criar uma classe " "wrapper que ignore o item da tarefa e compare apenas o campo de prioridade:" +#: ../../library/heapq.rst:195 +msgid "" +"from dataclasses import dataclass, field\n" +"from typing import Any\n" +"\n" +"@dataclass(order=True)\n" +"class PrioritizedItem:\n" +" priority: int\n" +" item: Any=field(compare=False)" +msgstr "" + #: ../../library/heapq.rst:203 msgid "" "The remaining challenges revolve around finding a pending task and making " @@ -389,6 +422,37 @@ msgstr "" "entrada como removida e adicionar uma nova entrada com a prioridade " "revisada::" +#: ../../library/heapq.rst:211 +msgid "" +"pq = [] # list of entries arranged in a heap\n" +"entry_finder = {} # mapping of tasks to entries\n" +"REMOVED = '' # placeholder for a removed task\n" +"counter = itertools.count() # unique sequence count\n" +"\n" +"def add_task(task, priority=0):\n" +" 'Add a new task or update the priority of an existing task'\n" +" if task in entry_finder:\n" +" remove_task(task)\n" +" count = next(counter)\n" +" entry = [priority, count, task]\n" +" entry_finder[task] = entry\n" +" heappush(pq, entry)\n" +"\n" +"def remove_task(task):\n" +" 'Mark an existing task as REMOVED. Raise KeyError if not found.'\n" +" entry = entry_finder.pop(task)\n" +" entry[-1] = REMOVED\n" +"\n" +"def pop_task():\n" +" 'Remove and return the lowest priority task. Raise KeyError if empty.'\n" +" while pq:\n" +" priority, count, task = heappop(pq)\n" +" if task is not REMOVED:\n" +" del entry_finder[task]\n" +" return task\n" +" raise KeyError('pop from an empty priority queue')" +msgstr "" + #: ../../library/heapq.rst:241 msgid "Theory" msgstr "Teoria" @@ -413,6 +477,19 @@ msgstr "" "O estranho invariante acima pretende ser uma representação de memória " "eficiente para um torneio. Os números abaixo são *k*, não ``a[k]``::" +#: ../../library/heapq.rst:251 +msgid "" +" 0\n" +"\n" +" 1 2\n" +"\n" +" 3 4 5 6\n" +"\n" +" 7 8 9 10 11 12 13 14\n" +"\n" +"15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30" +msgstr "" + #: ../../library/heapq.rst:261 msgid "" "In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a " diff --git a/library/hmac.po b/library/hmac.po index d5d08226c..fa5de168b 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# i17obot , 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: i17obot , 2021\n" +"POT-Creation-Date: 2024-08-23 14:51+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/html.entities.po b/library/html.entities.po index 18213530f..91a34cd98 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -4,22 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2023 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: Rafael Fontenelle , 2023\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" diff --git a/library/html.parser.po b/library/html.parser.po index 4eace77f9..43d865fdd 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -4,23 +4,22 @@ # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2021 -# Raphael Mendonça, 2021 +# Rafael Fontenelle , 2024 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-10 14:14+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: Raphael Mendonça, 2021\n" +"POT-Creation-Date: 2024-08-31 11:30+0000\n" +"PO-Revision-Date: 2024-05-11 00:33+0000\n" +"Last-Translator: Rafael Fontenelle , 2024\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" -"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: pt_BR\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" @@ -84,10 +83,45 @@ msgid "" "encountered::" msgstr "" +#: ../../library/html.parser.rst:48 +msgid "" +"from html.parser import HTMLParser\n" +"\n" +"class MyHTMLParser(HTMLParser):\n" +" def handle_starttag(self, tag, attrs):\n" +" print(\"Encountered a start tag:\", tag)\n" +"\n" +" def handle_endtag(self, tag):\n" +" print(\"Encountered an end tag :\", tag)\n" +"\n" +" def handle_data(self, data):\n" +" print(\"Encountered some data :\", data)\n" +"\n" +"parser = MyHTMLParser()\n" +"parser.feed('Test'\n" +" '

Parse me!

')" +msgstr "" + #: ../../library/html.parser.rst:64 msgid "The output will then be:" msgstr "" +#: ../../library/html.parser.rst:66 +msgid "" +"Encountered a start tag: html\n" +"Encountered a start tag: head\n" +"Encountered a start tag: title\n" +"Encountered some data : Test\n" +"Encountered an end tag : title\n" +"Encountered an end tag : head\n" +"Encountered a start tag: body\n" +"Encountered a start tag: h1\n" +"Encountered some data : Parse me!\n" +"Encountered an end tag : h1\n" +"Encountered an end tag : body\n" +"Encountered an end tag : html" +msgstr "" + #: ../../library/html.parser.rst:83 msgid ":class:`.HTMLParser` Methods" msgstr "" @@ -275,30 +309,121 @@ msgid "" "examples::" msgstr "" +#: ../../library/html.parser.rst:235 +msgid "" +"from html.parser import HTMLParser\n" +"from html.entities import name2codepoint\n" +"\n" +"class MyHTMLParser(HTMLParser):\n" +" def handle_starttag(self, tag, attrs):\n" +" print(\"Start tag:\", tag)\n" +" for attr in attrs:\n" +" print(\" attr:\", attr)\n" +"\n" +" def handle_endtag(self, tag):\n" +" print(\"End tag :\", tag)\n" +"\n" +" def handle_data(self, data):\n" +" print(\"Data :\", data)\n" +"\n" +" def handle_comment(self, data):\n" +" print(\"Comment :\", data)\n" +"\n" +" def handle_entityref(self, name):\n" +" c = chr(name2codepoint[name])\n" +" print(\"Named ent:\", c)\n" +"\n" +" def handle_charref(self, name):\n" +" if name.startswith('x'):\n" +" c = chr(int(name[1:], 16))\n" +" else:\n" +" c = chr(int(name))\n" +" print(\"Num ent :\", c)\n" +"\n" +" def handle_decl(self, data):\n" +" print(\"Decl :\", data)\n" +"\n" +"parser = MyHTMLParser()" +msgstr "" + #: ../../library/html.parser.rst:269 msgid "Parsing a doctype::" msgstr "" +#: ../../library/html.parser.rst:271 +msgid "" +">>> parser.feed('')\n" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." +"org/TR/html4/strict.dtd\"" +msgstr "" + #: ../../library/html.parser.rst:275 msgid "Parsing an element with a few attributes and a title::" msgstr "" +#: ../../library/html.parser.rst:277 +msgid "" +">>> parser.feed('\"The')\n" +"Start tag: img\n" +" attr: ('src', 'python-logo.png')\n" +" attr: ('alt', 'The Python logo')\n" +">>>\n" +">>> parser.feed('

Python

')\n" +"Start tag: h1\n" +"Data : Python\n" +"End tag : h1" +msgstr "" + #: ../../library/html.parser.rst:287 msgid "" "The content of ``script`` and ``style`` elements is returned as is, without " "further parsing::" msgstr "" +#: ../../library/html.parser.rst:290 +msgid "" +">>> parser.feed('