@@ -612,24 +612,37 @@ msgid ""
612612"specific initial state. Therefore a class may define a special method named :"
613613"meth:`~object.__init__`, like this::"
614614msgstr ""
615+ "Operacja instancjonowania („wywołanie” obiektu klasy) tworzy pusty obiekt. "
616+ "Wiele klas lubi tworzyć obiekty z instancjami dostosowanymi do określonego "
617+ "stanu początkowego. Dlatego klasa może zdefiniować specjalną metodę o "
618+ "nazwie :meth:`~object.__init__`, taką jak ta::"
615619
616620msgid ""
617621"def __init__(self):\n"
618622" self.data = []"
619623msgstr ""
624+ "def __init__(self):\n"
625+ " self.data = []"
620626
621627msgid ""
622628"When a class defines an :meth:`~object.__init__` method, class instantiation "
623629"automatically invokes :meth:`!__init__` for the newly created class "
624630"instance. So in this example, a new, initialized instance can be obtained "
625631"by::"
626632msgstr ""
633+ "Gdy klasa definiuje metodę :meth:`~object.__init__`, instancjonowanie klasy "
634+ "automatycznie wywołuje :meth:`!__init__` dla nowo utworzonej instancji "
635+ "klasy. Tak więc w tym przykładzie nową, zainicjalizowaną instancję można "
636+ "uzyskać przez::"
627637
628638msgid ""
629639"Of course, the :meth:`~object.__init__` method may have arguments for "
630640"greater flexibility. In that case, arguments given to the class "
631641"instantiation operator are passed on to :meth:`!__init__`. For example, ::"
632642msgstr ""
643+ "Oczywiście metoda :meth:`~object.__init__` może mieć argumenty dla większej "
644+ "elastyczności. W takim przypadku argumenty podane operatorowi "
645+ "instancjonowania klasy są przekazywane do :meth:`!__init__`. Na przykład ::"
633646
634647msgid ""
635648">>> class Complex:\n"
@@ -641,6 +654,14 @@ msgid ""
641654">>> x.r, x.i\n"
642655"(3.0, -4.5)"
643656msgstr ""
657+ ">>> class Complex:\n"
658+ "... def __init__(self, realpart, imagpart):\n"
659+ "... self.r = realpart\n"
660+ "... self.i = imagpart\n"
661+ "...\n"
662+ ">>> x = Complex(3.0, -4.5)\n"
663+ ">>> x.r, x.i\n"
664+ "(3.0, -4.5)"
644665
645666msgid "Instance Objects"
646667msgstr ""
0 commit comments