@@ -249,6 +249,8 @@ msgid ""
249249"How do I catch the output from PyErr_Print() (or anything that prints to "
250250"stdout/stderr)?"
251251msgstr ""
252+ "Como posso capturar a saída da função PyErr_Print() (ou qualquer outra coisa "
253+ "que escreva para stdout/stderr)?"
252254
253255#: ../../faq/extending.rst:144
254256msgid ""
@@ -257,22 +259,28 @@ msgid ""
257259"print_error, or just allow the standard traceback mechanism to work. Then, "
258260"the output will go wherever your ``write()`` method sends it."
259261msgstr ""
262+ "Com código Python, defina um objeto que suporte o método ``write()``. "
263+ "Atribua esse objeto a :data:`sys.stdout` e :data:`sys.stderr`. Chame "
264+ "print_error, or simplesmente deixe o mecanismo padrão de traceback "
265+ "acontecer. Assim, a saída irá para onde quer que o seu método ``write()`` a "
266+ "envie."
260267
261268#: ../../faq/extending.rst:149
262269msgid "The easiest way to do this is to use the :class:`io.StringIO` class:"
263- msgstr ""
270+ msgstr "O jeito mais fácil de fazer isso é usar a classe :class:`io.StringIO`: "
264271
265272#: ../../faq/extending.rst:161
266273msgid "A custom object to do the same would look like this:"
267274msgstr "Um objeto personalizado para fazer a mesma coisa seria esse:"
268275
269276#: ../../faq/extending.rst:182
270277msgid "How do I access a module written in Python from C?"
271- msgstr ""
278+ msgstr "Como faço para acessar a partir do C um módulo escrito em Python? "
272279
273280#: ../../faq/extending.rst:184
274281msgid "You can get a pointer to the module object as follows::"
275282msgstr ""
283+ "Você pode obter um pointeiro para o objeto de módulo da seguinte maneira::"
276284
277285#: ../../faq/extending.rst:188
278286msgid ""
@@ -282,22 +290,31 @@ msgid ""
282290"module into any namespace -- it only ensures it has been initialized and is "
283291"stored in :data:`sys.modules`."
284292msgstr ""
293+ "Se o módulo ainda não foi importado (isto é, ainda não aparece no :data:`sys."
294+ "modules`), essa função vai inicializar o módulo; caso contrário, ela vai "
295+ "simplesmente retornar o valor de ``sys.modules[\" <modulename>\" ]``. Note "
296+ "que ela não adiciona o módulo a nenhum espaço de nomes -- ela simplesmente "
297+ "garante que ele foi inicializado e colocado no :data:`sys.modules`."
285298
286299#: ../../faq/extending.rst:194
287300msgid ""
288301"You can then access the module's attributes (i.e. any name defined in the "
289302"module) as follows::"
290303msgstr ""
304+ "Você pode então acessar os atributos do módulo (isto é, qualquer nome "
305+ "definido no módulo) assim::"
291306
292307#: ../../faq/extending.rst:199
293308msgid ""
294309"Calling :c:func:`PyObject_SetAttrString` to assign to variables in the "
295310"module also works."
296311msgstr ""
312+ "Chamar :c:func:`PyObject_SetAttrString` para definir variáveis no módulo "
313+ "também funciona."
297314
298315#: ../../faq/extending.rst:204
299316msgid "How do I interface to C++ objects from Python?"
300- msgstr ""
317+ msgstr "Como posso interagir com objetos C++ a partir do Python? "
301318
302319#: ../../faq/extending.rst:206
303320msgid ""
@@ -308,45 +325,60 @@ msgid ""
308325"building a new Python type around a C structure (pointer) type will also "
309326"work for C++ objects."
310327msgstr ""
328+ "Dependendo das suas necessidades, há diversas abordagens. Para fazer isso "
329+ "manualmente, comece lendo :ref:`o documento\" Estendendo e Incorporando\" "
330+ "<extending-index>`. Note que, para o sistema Python em tempo de execução, "
331+ "não há muita diferença entre C e C++ -- de forma que a estratégia de "
332+ "construir um novo tipo Python ao redor de uma estrutura C (ou ponteiro para "
333+ "uma) também funciona para objetos C++."
311334
312335#: ../../faq/extending.rst:212
313336msgid "For C++ libraries, see :ref:`c-wrapper-software`."
314- msgstr ""
337+ msgstr "Para bibliotecas C++, veja :ref:`c-wrapper-software`. "
315338
316339#: ../../faq/extending.rst:216
317340msgid "I added a module using the Setup file and the make fails; why?"
318- msgstr ""
341+ msgstr "Adicionei um módulo usando o arquivo de Setup e o make falha; por quê? "
319342
320343#: ../../faq/extending.rst:218
321344msgid ""
322345"Setup must end in a newline, if there is no newline there, the build process "
323346"fails. (Fixing this requires some ugly shell script hackery, and this bug "
324347"is so minor that it doesn't seem worth the effort.)"
325348msgstr ""
349+ "O Setup deve terminar com uma quebra de linha; se não houver uma quebra de "
350+ "linha no final, o processo de compilação falha. (Consertar isso requer umas "
351+ "gambiarras feias em shell script, e esse bug é tão pequeno que o esforço não "
352+ "parece valer a pena.)"
326353
327354#: ../../faq/extending.rst:224
328355msgid "How do I debug an extension?"
329- msgstr ""
356+ msgstr "Como eu depuro uma extensão? "
330357
331358#: ../../faq/extending.rst:226
332359msgid ""
333360"When using GDB with dynamically loaded extensions, you can't set a "
334361"breakpoint in your extension until your extension is loaded."
335362msgstr ""
363+ "Ao usar o GDB com extensões carregadas dinamicamente, você não consegue "
364+ "definir um ponto de interrupção antes da sua extensão ser carregada."
336365
337366#: ../../faq/extending.rst:229
338367msgid "In your ``.gdbinit`` file (or interactively), add the command:"
339368msgstr ""
369+ "No seu arquivo ``.gdbinit`` (ou então interativamente), adicione o comando:"
340370
341371#: ../../faq/extending.rst:235
342372msgid "Then, when you run GDB:"
343- msgstr ""
373+ msgstr "Então, ao executar o GDB: "
344374
345375#: ../../faq/extending.rst:247
346376msgid ""
347377"I want to compile a Python module on my Linux system, but some files are "
348378"missing. Why?"
349379msgstr ""
380+ "Quero compilar um módulo Python no meu sistema Linux, mas alguns arquivos "
381+ "estão faltando. Por quê?"
350382
351383#: ../../faq/extending.rst:249
352384msgid ""
@@ -365,7 +397,7 @@ msgstr ""
365397
366398#: ../../faq/extending.rst:259
367399msgid "How do I tell\" incomplete input\" from\" invalid input\" ?"
368- msgstr ""
400+ msgstr "Como posso distinguir \" entrada incompleta \" de \" entrada inválida \" ? "
369401
370402#: ../../faq/extending.rst:261
371403msgid ""