@@ -144,6 +144,10 @@ msgid ""
144144">>> t.substitute(village='Nottingham', cause='the ditch fund')\n"
145145"'Nottinghamfolk send $10 to the ditch fund.'"
146146msgstr ""
147+ ">>> from string import Template\n"
148+ ">>> t = Template('${village}anie wysyłają $$10 na $cause.')\n"
149+ ">>> t.substitute(village='Nottingham', cause='fundusz rowu')\n"
150+ "'Nottinghamanie wysyłają $10 na fundusz rowu.'"
147151
148152msgid ""
149153"The :meth:`~string.Template.substitute` method raises a :exc:`KeyError` when "
@@ -290,6 +294,10 @@ msgid ""
290294"module provides a number of synchronization primitives including locks, "
291295"events, condition variables, and semaphores."
292296msgstr ""
297+ "Głównym wyzwaniem wielowątkowej aplikacji jest koordynacja wątkow, które "
298+ "współdzielą dane lub inne zasoby. W tym celu wątkowanie moduł zapewnia "
299+ "szereg prymitywów synchronizacji, w tym blokady, zdarzenia, zmienne "
300+ "warunkowe i semafory."
293301
294302msgid ""
295303"While those tools are powerful, minor design errors can result in problems "
@@ -404,6 +412,28 @@ msgid ""
404412" o = self.data[key]()\n"
405413"KeyError: 'primary'"
406414msgstr ""
415+ ">>> import weakref, gc\n"
416+ ">>> class A:\n"
417+ "... def __init__(self, value):\n"
418+ "... self.value = value\n"
419+ "... def __repr__(self):\n"
420+ "... return str(self.value)\n"
421+ "...\n"
422+ ">>> a = A(10) # utwórz odniesienie\n"
423+ ">>> d = weakref.WeakValueDictionary()\n"
424+ ">>> d['primary'] = a # nie tworzy odniesienia\n"
425+ ">>> d['primary'] # pobierz obiekt, jeśli nadal istnieje\n"
426+ "10\n"
427+ ">>> del a # usuń jedyne odniesienie\n"
428+ ">>> gc.collect() # wymuś natychmiastowe uruchomienie garbage collection\n"
429+ "0\n"
430+ ">>> d['primary'] # wpis został automatycznie usunięty\n"
431+ "Traceback (most recent call last):\n"
432+ "File \"\" , line 1, in \n"
433+ "d['primary'] # wpis został automatycznie usunięty\n"
434+ "File \" C:/python313/lib/weakref.py\" , line 46, in __getitem__\n"
435+ "o = self.data[key]()\n"
436+ "KeyError: 'primary'"
407437
408438msgid "Tools for Working with Lists"
409439msgstr "Narzędzia do pracy z listami"
0 commit comments