GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — python-docs-ru/reference/simple_stmts.po at 3.13 · python/python-docs-ru

Expand file tree

/

simple_stmts.po

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
2117 lines (1807 loc) · 108 KB
/

simple_stmts.po

Copy path

File metadata and controls

2117 lines (1807 loc) · 108 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2026
# Dmitry Luschan, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-07 18:23+0000\n"
"PO-Revision-Date: 2025-09-16 00:02+0000\n"
"Last-Translator: Dmitry Luschan, 2026\n"
"Language-Team: Russian (https://app.transifex.com/python-doc/teams/5390/"
"ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
"(n%100>=11 && n%100<=14)? 2 : 3);\n"
msgid "Simple statements"
msgstr "Простые инструкции"
msgid ""
"A simple statement is comprised within a single logical line. Several simple "
"statements may occur on a single line separated by semicolons. The syntax "
"for simple statements is:"
msgstr ""
"Простая инструкция состоит из одной логической строки. Несколько простых "
"инструкций могут находиться в одной строке, разделённой точкой с запятой. "
"Синтаксис простых инструкций:"
msgid "Expression statements"
msgstr "Инструкции выражений"
msgid ""
"Expression statements are used (mostly interactively) to compute and write a "
"value, or (usually) to call a procedure (a function that returns no "
"meaningful result; in Python, procedures return the value ``None``). Other "
"uses of expression statements are allowed and occasionally useful. The "
"syntax for an expression statement is:"
msgstr ""
"Инструкции выражений используются (в основном в интерактивном режиме) для "
"вычисления и вывода значения или (обычно) для вызова процедуры (функции, "
"которая не возвращает значимого результата; в Python процедуры возвращают "
"значение ``None``). Другие варианты использования инструкций выражений "
"разрешены и иногда полезны. Синтаксис инструкции выражения:"
msgid ""
"An expression statement evaluates the expression list (which may be a single "
"expression)."
msgstr ""
"Инструкция выражения вычисляет список выражений (который может быть одним "
"выражением)."
msgid ""
"In interactive mode, if the value is not ``None``, it is converted to a "
"string using the built-in :func:`repr` function and the resulting string is "
"written to standard output on a line by itself (except if the result is "
"``None``, so that procedure calls do not cause any output.)"
msgstr ""
"В интерактивном режиме, если значение отличается от ``None``, оно "
"преобразуется в строку с помощью встроенной функции :func:`repr`, и "
"результирующая строка записывается в стандартный вывод в отдельной строке "
"(кроме случаев, когда результатом будет ``None``, так что вызовы процедур не "
"приводят к каким-либо выводам)."
msgid "Assignment statements"
msgstr "Инструкции присваивания"
msgid ""
"Assignment statements are used to (re)bind names to values and to modify "
"attributes or items of mutable objects:"
msgstr ""
"Инструкции присваивания используются для (повторного) связывания имён со "
"значениями, а также для изменения атрибутов или элементов изменяемых "
"объектов:"
msgid ""
"(See section :ref:`primaries` for the syntax definitions for *attributeref* "
"and *subscription*.)"
msgstr ""
"(См. раздел :ref:`primaries` для описания синтаксиса *обращения к атрибуту* "
"и *обращения к элементу*)."
msgid ""
"An assignment statement evaluates the expression list (remember that this "
"can be a single expression or a comma-separated list, the latter yielding a "
"tuple) and assigns the single resulting object to each of the target lists, "
"from left to right."
msgstr ""
"Инструкция присваивания вычисляет список выражений (напомним, что это может "
"быть одно выражение или список выражений, разделённых запятыми; в последнем "
"случае результатом является кортеж) и присваивает один получившийся объект "
"каждому целевому списку слева направо."
msgid ""
"Assignment is defined recursively depending on the form of the target "
"(list). When a target is part of a mutable object (an attribute reference or "
"subscription), the mutable object must ultimately perform the assignment and "
"decide about its validity, and may raise an exception if the assignment is "
"unacceptable. The rules observed by various types and the exceptions raised "
"are given with the definition of the object types (see section :ref:`types`)."
msgstr ""
"Присваивание определяется рекурсивно в зависимости от формы цели (или "
"целевого списка). Когда цель является частью изменяемого объекта (обращение "
"к атрибуту или к элементу), сам этот объект должен в конечном итоге "
"выполнить присваивание и принять решение о его допустимости, в противном "
"случае может быть выброшено исключение. Правила, соблюдаемые различными "
"типами, и возникающие исключения приведены вместе с определением типов "
"объектов (см. раздел :ref:`types`)."
msgid ""
"Assignment of an object to a target list, optionally enclosed in parentheses "
"or square brackets, is recursively defined as follows."
msgstr ""
"Присваивание объекта целевому списку, при необходимости заключённому в "
"круглые или квадратные скобки, определяется рекурсивно следующим образом."
msgid ""
"If the target list is a single target with no trailing comma, optionally in "
"parentheses, the object is assigned to that target."
msgstr ""
"Если целевой список состоит из одной цели без завершающей запятой, возможно "
"в круглых скобках, объект присваивается этой цели."
msgid "Else:"
msgstr "Иначе:"
msgid ""
"If the target list contains one target prefixed with an asterisk, called a "
"\"starred\" target: The object must be an iterable with at least as many "
"items as there are targets in the target list, minus one. The first items "
"of the iterable are assigned, from left to right, to the targets before the "
"starred target. The final items of the iterable are assigned to the targets "
"after the starred target. A list of the remaining items in the iterable is "
"then assigned to the starred target (the list can be empty)."
msgstr ""
"Если целевой список содержит одну цель со звёздочкой в префиксе, называемую "
"«звёздной» целью, то объект должен быть итерируемым. Число элементов в нём "
"может быть больше, чем в целевом списке, равным ему или ровно на один "
"меньше. Первые элементы итерируемого объекта присваиваются, слева направо, "
"целям до звёздной, а последние — после неё. Затем оставшиеся элементы "
"итерируемого объекта формируют список (возможно пустой), который "
"присваивается самой звёздной цели."
msgid ""
"Else: The object must be an iterable with the same number of items as there "
"are targets in the target list, and the items are assigned, from left to "
"right, to the corresponding targets."
msgstr ""
"Иначе: объект должен быть итерируемым и содержать столько же элементов, "
"сколько и в целевом списке, и элементы присваиваются соответствующим целям, "
"слева направо."
msgid ""
"Assignment of an object to a single target is recursively defined as follows."
msgstr ""
"Присваивание объекта одной цели определяется рекурсивно следующим образом."
msgid "If the target is an identifier (name):"
msgstr "Если целью является идентификатор (имя):"
msgid ""
"If the name does not occur in a :keyword:`global` or :keyword:`nonlocal` "
"statement in the current code block: the name is bound to the object in the "
"current local namespace."
msgstr ""
"Если имя не встречается в инструкции :keyword:`global` "
"или :keyword:`nonlocal` в текущем блоке кода, оно связывается с объектом в "
"текущем локальном пространстве имён."
msgid ""
"Otherwise: the name is bound to the object in the global namespace or the "
"outer namespace determined by :keyword:`nonlocal`, respectively."
msgstr ""
"В противном случае имя связывается с объектом в глобальном пространстве имён "
"или во внешнем, определяемом :keyword:`nonlocal`, соответственно."
msgid ""
"The name is rebound if it was already bound. This may cause the reference "
"count for the object previously bound to the name to reach zero, causing the "
"object to be deallocated and its destructor (if it has one) to be called."
msgstr ""
"Если имя уже было связано с каким-либо объектом, оно переназначается. Это "
"может привести к тому, что счётчик ссылок на объект, ранее связанный с "
"именем, достигнет нуля, что вызовет освобождение объекта и вызов его "
"деструктора (если он определён)."
msgid ""
"If the target is an attribute reference: The primary expression in the "
"reference is evaluated. It should yield an object with assignable "
"attributes; if this is not the case, :exc:`TypeError` is raised. That "
"object is then asked to assign the assigned object to the given attribute; "
"if it cannot perform the assignment, it raises an exception (usually but not "
"necessarily :exc:`AttributeError`)."
msgstr ""
"Если целью является ссылка на атрибут, сначала вычисляется первичное "
"выражение в ссылке. Оно должно вернуть объект с присваиваемыми атрибутами; "
"если это не так, возбуждается исключение :exc:`TypeError`. Затем у этого "
"объекта запрашивается присваивание переданного объекта указанному атрибуту; "
"если объект не может выполнить присваивание, выбрасывается исключение "
"(обычно, но не обязательно, :exc:`AttributeError`)."
msgid ""
"Note: If the object is a class instance and the attribute reference occurs "
"on both sides of the assignment operator, the right-hand side expression, "
"``a.x`` can access either an instance attribute or (if no instance attribute "
"exists) a class attribute. The left-hand side target ``a.x`` is always set "
"as an instance attribute, creating it if necessary. Thus, the two "
"occurrences of ``a.x`` do not necessarily refer to the same attribute: if "
"the right-hand side expression refers to a class attribute, the left-hand "
"side creates a new instance attribute as the target of the assignment::"
msgstr ""
"Примечание: если объект является экземпляром класса и ссылка на атрибут "
"встречается с обеих сторон знака присваивания, выражение справа, например "
"``a.x``, может обращаться либо к атрибуту экземпляра, либо (если атрибут "
"экземпляра отсутствует) к атрибуту класса. Цель слева, ``a.x``, всегда "
"устанавливается как атрибут экземпляра, создавая его при необходимости. "
"Таким образом, два вхождения ``a.x`` не обязательно ссылаются на один и тот "
"же атрибут: если выражение справа ссылается на атрибут класса, левая часть "
"создаёт новый атрибут экземпляра, который становится целью присваивания."
msgid ""
"class Cls:\n"
" x = 3 # class variable\n"
"inst = Cls()\n"
"inst.x = inst.x + 1 # writes inst.x as 4 leaving Cls.x as 3"
msgstr ""
"class Cls:\n"
" x = 3 # переменная класса\n"
"inst = Cls()\n"
"inst.x = inst.x + 1 # записывает 4 в inst.x, при этом Cls.x остаётся 3"
msgid ""
"This description does not necessarily apply to descriptor attributes, such "
"as properties created with :deco:`property`."
msgstr ""
"Это описание не обязательно применимо к дескрипторным атрибутам, таким как "
"свойства, создаваемые с помощью :deco:`property`."
msgid ""
"If the target is a subscription: The primary expression in the reference is "
"evaluated. Next, the subscript expression is evaluated. Then, the "
"primary's :meth:`~object.__setitem__` method is called with two arguments: "
"the subscript and the assigned object."
msgstr ""
"Если в качестве цели используется обращение к элементу, сначала вычисляется "
"первичное выражение в этом обращении, затем — выражение индексатора. После "
"этого вызывается метод :meth:`~object.__setitem__` первичного объекта с "
"двумя аргументами: значением индексатора и присваиваемым объектом."
msgid ""
"Typically, :meth:`~object.__setitem__` is defined on mutable sequence "
"objects (such as lists) and mapping objects (such as dictionaries), and "
"behaves as follows."
msgstr ""
"Как правило, метод :meth:`~object.__setitem__` определён у изменяемых "
"последовательностей (таких как списки) и отображений (таких как словари) и "
"ведёт себя следующим образом."
msgid ""
"If the primary is a mutable sequence object (such as a list), the subscript "
"must yield an integer. If it is negative, the sequence's length is added to "
"it. The resulting value must be a nonnegative integer less than the "
"sequence's length, and the sequence is asked to assign the assigned object "
"to its item with that index. If the index is out of "
"range, :exc:`IndexError` is raised (assignment to a subscripted sequence "
"cannot add new items to a list)."
msgstr ""
"Если первичный объект является объектом изменяемой последовательности "
"(например, списком), выражение индексатора должно возвращать целое число. "
"Если оно отрицательное, к нему прибавляется длина последовательности. "
"Полученное таким образом значение должно быть неотрицательным целым числом "
"меньше длины последовательности. Затем последовательности поручается "
"присвоить объект элементу с этим индексом. Если индекс выходит за пределы "
"допустимого диапазона, выбрасывается исключение :exc:`IndexError` "
"(присваивание элементу последовательности через индекс не может добавлять "
"новые элементы в список)."
msgid ""
"If the primary is a mapping object (such as a dictionary), the subscript "
"must have a type compatible with the mapping's key type, and the mapping is "
"then asked to create a key/value pair which maps the subscript to the "
"assigned object. This can either replace an existing key/value pair with "
"the same key value, or insert a new key/value pair (if no key with the same "
"value existed)."
msgstr ""
"Если первичный объект является объектом отображения (например, словарём), "
"выражение индексатора должно иметь тип, совместимый с типом ключей "
"отображения. Затем отображению поручается создать пару ключ/значение, "
"которая связывает индексатор с присваиваемым объектом. Это может либо "
"заменить существующую пару с таким же ключом, либо вставить новую пару ключ/"
"значение (если ключ с таким значением ранее отсутствовал)."
msgid ""
"If the target is a slicing: The primary expression should evaluate to a "
"mutable sequence object (such as a list). The assigned object should "
"be :term:`iterable`. The slicing's lower and upper bounds should be "
"integers; if they are ``None`` (or not present), the defaults are zero and "
"the sequence's length. If either bound is negative, the sequence's length is "
"added to it. The resulting bounds are clipped to lie between zero and the "
"sequence's length, inclusive. Finally, the sequence object is asked to "
"replace the slice with the items of the assigned sequence. The length of "
"the slice may be different from the length of the assigned sequence, thus "
"changing the length of the target sequence, if the target sequence allows it."
msgstr ""
"Если целью присваивания является срез, первичное выражение должно "
"вычисляться в изменяемую последовательность (например, список). "
"Присваиваемый объект должен быть :term:`итерируемым <iterable>`. Нижняя и "
"верхняя границы среза должны быть целыми числами; если они равны ``None`` "
"(или отсутствуют), по умолчанию используются ноль и длина "
"последовательности. Если какая-либо из границ отрицательна, к ней "
"прибавляется длина последовательности. Полученные границы затем "
"ограничиваются диапазоном от нуля до длины последовательности включительно. "
"Наконец, последовательности поручается заменить указанный срез элементами "
"присваиваемой последовательности. Длина среза может отличаться от длины "
"присваиваемой последовательности, что приводит к изменению длины целевой "
"последовательности, если она это позволяет."
msgid ""
"Although the definition of assignment implies that overlaps between the left-"
"hand side and the right-hand side are 'simultaneous' (for example ``a, b = "
"b, a`` swaps two variables), overlaps *within* the collection of assigned-to "
"variables occur left-to-right, sometimes resulting in confusion. For "
"instance, the following program prints ``[0, 2]``::"
msgstr ""
"Хотя определение присваивания подразумевает, что пересечения между левой и "
"правой частью происходят «одновременно» (например, ``a, b = b, a`` меняет "
"значения двух переменных местами), пересечения *внутри* множества "
"присваиваемых переменных выполняются слева направо, что иногда приводит к "
"неожиданным результатам. Например, следующая программа выводит ``[0, 2]``::"
msgid ""
"x = [0, 1]\n"
"i = 0\n"
"i, x[i] = 1, 2 # i is updated, then x[i] is updated\n"
"print(x)"
msgstr ""
"x = [0, 1]\n"
"i = 0\n"
"i, x[i] = 1, 2 # сначала обновляется i, затем обновляется x[i]\n"
"print(x)"
msgid ":pep:`3132` - Extended Iterable Unpacking"
msgstr ":pep:`3132` — Расширенная распаковка итерируемых объектов"
msgid "The specification for the ``*target`` feature."
msgstr "Спецификация конструкции ``*target``."
msgid "Augmented assignment statements"
msgstr "Комбинированные инструкции присваивания"
msgid ""
"Augmented assignment is the combination, in a single statement, of a binary "
"operation and an assignment statement:"
msgstr ""
"Комбинированное присваивание — это объединение в одной инструкции бинарной "
"операции и инструкции присваивания:"
msgid ""
"(See section :ref:`primaries` for the syntax definitions of the last three "
"symbols.)"
msgstr ""
"(См. раздел :ref:`primaries` для описания синтаксиса трёх последних "
"операторов.)"
msgid ""
"An augmented assignment evaluates the target (which, unlike normal "
"assignment statements, cannot be an unpacking) and the expression list, "
"performs the binary operation specific to the type of assignment on the two "
"operands, and assigns the result to the original target. The target is only "
"evaluated once."
msgstr ""
"Комбинированная инструкция присваивания вычисляет целевой объект (который, в "
"отличие от обычного присваивания, не может быть списком целей и учавствовать "
"в распаковке) и список выражений, выполняет бинарную операцию, "
"соответствующую типу присваивания, над двумя операндами и присваивает "
"результат исходной цели. Цель присваивания вычисляется только один раз."
msgid ""
"An augmented assignment statement like ``x += 1`` can be rewritten as ``x = "
"x + 1`` to achieve a similar, but not exactly equal effect. In the augmented "
"version, ``x`` is only evaluated once. Also, when possible, the actual "
"operation is performed *in-place*, meaning that rather than creating a new "
"object and assigning that to the target, the old object is modified instead."
msgstr ""
"Инструкция вида ``x += 1`` может быть переписана как ``x = x + 1`` для "
"получения похожего, но не полностью идентичного результата. В "
"комбинированной инструкции присваивания ``x`` вычисляется только один раз. "
"Кроме того, когда возможно, операция выполняется *на месте*, то есть вместо "
"создания нового объекта и присваивания его цели, изменяется существующий "
"объект."
msgid ""
"Unlike normal assignments, augmented assignments evaluate the left-hand side "
"*before* evaluating the right-hand side. For example, ``a[i] += f(x)`` "
"first looks-up ``a[i]``, then it evaluates ``f(x)`` and performs the "
"addition, and lastly, it writes the result back to ``a[i]``."
msgstr ""
"В отличие от обычного присваивания, комбинированное присваивание вычисляет "
"левую часть *перед* правой. Например, в выражении ``a[i] += f(x)`` сначала "
"вычисляется ``a[i]``, затем вычисляется ``f(x)`` и выполняется сложение, "
"после чего результат записывается обратно в ``a[i]``."
msgid ""
"With the exception of assigning to tuples and multiple targets in a single "
"statement, the assignment done by augmented assignment statements is handled "
"the same way as normal assignments. Similarly, with the exception of the "
"possible *in-place* behavior, the binary operation performed by augmented "
"assignment is the same as the normal binary operations."
msgstr ""
"За исключением присваивания кортежам и множеству целей в одной инструкции, "
"присваивание, выполняемое комбинированной инструкцией, обрабатывается так "
"же, как обычное присваивание. Аналогично, за исключением возможного "
"поведения *на месте*, бинарная операция, выполняемая при комбинированном "
"присваивании, идентична обычной бинарной операции."
msgid ""
"For targets which are attribute references, the same :ref:`caveat about "
"class and instance attributes <attr-target-note>` applies as for regular "
"assignments."
msgstr ""
"Для целей, которые являются ссылками на атрибуты, действует то "
"же :ref:`предостережение о различии атрибутов класса и экземпляра <attr-"
"target-note>`, что и для обычного присваивания."
msgid "Annotated assignment statements"
msgstr "Аннотированные инструкции присваивания"
msgid ""
":term:`Annotation <variable annotation>` assignment is the combination, in a "
"single statement, of a variable or attribute annotation and an optional "
"assignment statement:"
msgstr ""
":term:`Аннотированное <variable annotation>` присваивание — это комбинация в "
"одной инструкции аннотации переменной или атрибута с необязательной "
"инструкцией присваивания:"
msgid ""
"The difference from normal :ref:`assignment` is that only a single target is "
"allowed."
msgstr ""
"Отличие от обычного :ref:`assignment` заключается в том, что допускается "
"только одна цель."
msgid ""
"The assignment target is considered \"simple\" if it consists of a single "
"name that is not enclosed in parentheses. For simple assignment targets, if "
"in class or module scope, the annotations are gathered in a lazily "
"evaluated :ref:`annotation scope <annotation-scopes>`. The annotations can "
"be evaluated using the :attr:`~object.__annotations__` attribute of a class "
"or module, or using the facilities in the :mod:`annotationlib` module."
msgstr ""
"Цель присваивания считается «простой», если она состоит из одного имени, не "
"заключённого в скобки. Для простых целей в области видимости класса или "
"модуля^ аннотации собираются в вычисляемую отложенно :ref:`область аннотаций "
"<annotation-scopes>`. Эти аннотации можно получить через "
"атрибут :attr:`~object.__annotations__` класса или модуля, либо через "
"средства модуля :mod:`annotationlib`."
msgid ""
"If the assignment target is not simple (an attribute, subscript node, or "
"parenthesized name), the annotation is never evaluated."
msgstr ""
"Если цель присваивания не является простой (то есть атрибутом, обращением к "
"элементу или именем в скобках), аннотация никогда не вычисляется."
msgid ""
"If a name is annotated in a function scope, then this name is local for that "
"scope. Annotations are never evaluated and stored in function scopes."
msgstr ""
"Если имя аннотировано в области видимости функции, оно считается локальным "
"для этой области. Аннотации в функциях никогда не вычисляются и не "
"сохраняются."
msgid ""
"If the right hand side is present, an annotated assignment performs the "
"actual assignment as if there was no annotation present. If the right hand "
"side is not present for an expression target, then the interpreter evaluates "
"the target except for the last :meth:`~object.__setitem__` "
"or :meth:`~object.__setattr__` call."
msgstr ""
"Если правая часть присутствует, аннотированное присваивание выполняет "
"присваивание как обычное, игнорируя аннотацию. Если правая часть "
"отсутствует, интерпретатор вычисляет выражение для цели, но не выполняет "
"последующий вызов :meth:`~object.__setitem__` "
"или :meth:`~object.__setattr__`."
msgid ":pep:`526` - Syntax for Variable Annotations"
msgstr ":pep:`526` — Синтаксис аннотаций переменных"
msgid ""
"The proposal that added syntax for annotating the types of variables "
"(including class variables and instance variables), instead of expressing "
"them through comments."
msgstr ""
"Предложение, добавившее синтаксис для указания типов переменных (включая "
"переменные классов и экземпляров), вместо использования комментариев."
msgid ":pep:`484` - Type hints"
msgstr ":pep:`484` — Подсказки типов"
msgid ""
"The proposal that added the :mod:`typing` module to provide a standard "
"syntax for type annotations that can be used in static analysis tools and "
"IDEs."
msgstr ""
"Предложение, добавившее модуль :mod:`typing` для стандартного синтаксиса "
"аннотаций типов, который может использоваться инструментами статического "
"анализа и IDE."
msgid ""
"Now annotated assignments allow the same expressions in the right hand side "
"as regular assignments. Previously, some expressions (like un-parenthesized "
"tuple expressions) caused a syntax error."
msgstr ""
"Теперь аннотированные присваивания допускают те же выражения в правой части, "
"что и обычные присваивания. Ранее некоторые выражения (например, кортежи без "
"скобок) вызывали синтаксическую ошибку."
msgid ""
"Annotations are now lazily evaluated in a separate :ref:`annotation scope "
"<annotation-scopes>`. If the assignment target is not simple, annotations "
"are never evaluated."
msgstr ""
"Аннотации теперь вычисляются отложенно в отдельной :ref:`области аннотаций "
"<annotation-scopes>`. Если цель присваивания не является простой, аннотации "
"никогда не вычисляются."
msgid "The :keyword:`!assert` statement"
msgstr "Инструкция :keyword:`!assert`"
msgid ""
"Assert statements are a convenient way to insert debugging assertions into a "
"program:"
msgstr ""
"Инструкции assert — это удобный способ вставки отладочных утверждений в "
"программу:"
msgid "The simple form, ``assert expression``, is equivalent to ::"
msgstr "Простая форма, ``assert expression``, эквивалентна ::"
msgid ""
"if __debug__:\n"
" if not expression: raise AssertionError"
msgstr ""
"if __debug__:\n"
" if not expression: raise AssertionError"
msgid ""
"The extended form, ``assert expression1, expression2``, is equivalent to ::"
msgstr ""
"Расширенная форма, ``assert expression1, expression2``, эквивалентна ::"
msgid ""
"if __debug__:\n"
" if not expression1: raise AssertionError(expression2)"
msgstr ""
"if __debug__:\n"
" if not expression1: raise AssertionError(expression2)"
msgid ""
"These equivalences assume that :const:`__debug__` and :exc:`AssertionError` "
"refer to the built-in variables with those names. In the current "
"implementation, the built-in variable ``__debug__`` is ``True`` under normal "
"circumstances, ``False`` when optimization is requested (command line "
"option :option:`-O`). The current code generator emits no code for "
"an :keyword:`assert` statement when optimization is requested at compile "
"time. Note that 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 ""
"Этот эквивалентный код предполагает, что :const:`__debug__` "
"и :exc:`AssertionError` ссылаются на одноимённые встроенные переменные. В "
"текущей реализации встроенная переменная ``__debug__`` имеет значение "
"``True`` при обычном запуске и ``False``, когда запрошена оптимизация (опция "
"командной строки :option:`-O`). Текущий генератор кода не создаёт никакого "
"кода для инструкции :keyword:`assert`, если оптимизация запрошена во время "
"компиляции. Обратите внимание, что нет необходимости включать исходный код "
"выражения, которое не прошло проверку, в сообщение об ошибке; он будет "
"отображён как часть трассировки стека."
msgid ""
"Assignments to :const:`__debug__` are illegal. The value for the built-in "
"variable is determined when the interpreter starts."
msgstr ""
"Присваивания :const:`__debug__` недопустимы. Значение этой встроенной "
"переменной определяется при запуске интерпретатора."
msgid "The :keyword:`!pass` statement"
msgstr "Инструкция :keyword:`!pass`"
msgid ""
":keyword:`pass` is a null operation --- when it is executed, nothing "
"happens. It is useful as a placeholder when a statement is required "
"syntactically, but no code needs to be executed, for example::"
msgstr ""
"Инструкция :keyword:`pass` — это пустая операция. При её выполнении ничего "
"не происходит. Она полезна как заглушка в тех случаях, когда синтаксически "
"требуется инструкция, но выполнять никакой код не нужно, например::"
msgid ""
"def f(arg): pass # a function that does nothing (yet)\n"
"\n"
"class C: pass # a class with no methods (yet)"
msgstr ""
"def f(arg): pass # функция, которая (пока) ничего не делает\n"
"\n"
"class C: pass # класс без методов (пока)"
msgid "The :keyword:`!del` statement"
msgstr "Инструкция :keyword:`!del`"
msgid ""
"Deletion is recursively defined very similar to the way assignment is "
"defined. Rather than spelling it out in full details, here are some hints."
msgstr ""
"Удаление определяется рекурсивно, очень похоже на то, как определяется "
"присваивание. Вместо подробного изложения всех деталей ниже приведены "
"некоторые пояснения."
msgid ""
"Deletion of a target list recursively deletes each target, from left to "
"right."
msgstr "Удаление списка целей рекурсивно удаляет каждую цель слева направо."
msgid ""
"Deletion of a name removes the binding of that name from the local or global "
"namespace, depending on whether the name occurs in a :keyword:`global` "
"statement in the same code block. Trying to delete an unbound name raises "
"a :exc:`NameError` exception."
msgstr ""
"Удаление имени удаляет привязку этого имени из локального или глобального "
"пространства имён — в зависимости от того, присутствует ли это имя в "
"инструкции :keyword:`global` в том же блоке кода. Попытка удалить имя без "
"привязки приводит к возбуждению исключения :exc:`NameError`."
msgid ""
"Deletion of attribute references and subscriptions is passed to the primary "
"object involved; deletion of a slicing is in general equivalent to "
"assignment of an empty slice of the right type (but even this is determined "
"by the sliced object)."
msgstr ""
"Удаление атрибутов и элементов через индексирование передаётся "
"соответствующему первичному объекту. Удаление среза в общем случае "
"эквивалентно присваиванию пустого среза соответствующего типа (однако даже "
"это определяется объектом, к которому применяется срез)."
msgid ""
"Previously it was illegal to delete a name from the local namespace if it "
"occurs as a free variable in a nested block."
msgstr ""
"Раньше было запрещено удалять имя из локального пространства имён, если оно "
"встречается как свободная переменная во вложенном блоке."
msgid "The :keyword:`!return` statement"
msgstr "Инструкция :keyword:`!return`"
msgid ""
":keyword:`return` may only occur syntactically nested in a function "
"definition, not within a nested class definition."
msgstr ""
":keyword:`return` может встречаться только внутри определения функции, но не "
"внутри определения вложенного класса."
msgid ""
"If an expression list is present, it is evaluated, else ``None`` is "
"substituted."
msgstr ""
"Если список выражений присутствует, он вычисляется, в противном случае он "
"заменяется на ``None``."
msgid ""
":keyword:`return` leaves the current function call with the expression list "
"(or ``None``) as return value."
msgstr ""
":keyword:`return` завершает текущий вызов функции, возвращая список "
"выражений (или ``None``) в качестве значения."
msgid ""
"When :keyword:`return` passes control out of a :keyword:`try` statement with "
"a :keyword:`finally` clause, that :keyword:`!finally` clause is executed "
"before really leaving the function."
msgstr ""
"Когда :keyword:`return` выходит из инструкции :keyword:`try` "
"с :keyword:`finally`, то перед фактическим завершением функции выполняется "
"этот блок :keyword:`!finally`."
msgid ""
"In a generator function, the :keyword:`return` statement indicates that the "
"generator is done and will cause :exc:`StopIteration` to be raised. The "
"returned value (if any) is used as an argument to "
"construct :exc:`StopIteration` and becomes the :attr:`StopIteration.value` "
"attribute."
msgstr ""
"В генераторной функции инструкция :keyword:`return` указывает на завершение "
"генератора и выбрасывает исключение :exc:`StopIteration`. Возвращаемое "
"значение (если есть) передаётся конструктору :exc:`StopIteration` и "
"становится атрибутом :attr:`StopIteration.value`."
msgid ""
"In an asynchronous generator function, an empty :keyword:`return` statement "
"indicates that the asynchronous generator is done and will "
"cause :exc:`StopAsyncIteration` to be raised. A non-empty :keyword:`!"
"return` statement is a syntax error in an asynchronous generator function."
msgstr ""
"В асинхронной генераторной функции пустая инструкция :keyword:`return` "
"указывает на завершение генератора и выбрасывает :exc:`StopAsyncIteration`. "
"Непустая инструкция :keyword:`!return` в асинхронной генераторной функции "
"является синтаксической ошибкой."
msgid "The :keyword:`!yield` statement"
msgstr "Инструкция :keyword:`!yield`"
msgid ""
"A :keyword:`yield` statement is semantically equivalent to a :ref:`yield "
"expression <yieldexpr>`. The ``yield`` statement can be used to omit the "
"parentheses that would otherwise be required in the equivalent yield "
"expression statement. For example, the yield statements ::"
msgstr ""
"Инструкция :keyword:`yield` семантически эквивалентна :ref:`выражению yield "
"<yieldexpr>`. Использование инструкции ``yield`` позволяет не ставить "
"скобки, которые требовались бы в эквивалентном выражении yield. Например, "
"инструкции ::"
msgid ""
"yield <expr>\n"
"yield from <expr>"
msgstr ""
"yield <expr>\n"
"yield from <expr>"
msgid "are equivalent to the yield expression statements ::"
msgstr "эквивалентны выражениям ::"
msgid ""
"(yield <expr>)\n"
"(yield from <expr>)"
msgstr ""
"(yield <expr>)\n"
"(yield from <expr>)"
msgid ""
"Yield expressions and statements are only used when defining "
"a :term:`generator` function, and are only used in the body of the generator "
"function. Using :keyword:`yield` in a function definition is sufficient to "
"cause that definition to create a generator function instead of a normal "
"function."
msgstr ""
"Выражения и инструкции yield используются только при "
"определении :term:`генераторной <generator>` функции и только в её теле. "
"Использование :keyword:`yield` внутри определения функции делает эту функцию "
"генераторной, а не обычной."
msgid ""
"For full details of :keyword:`yield` semantics, refer to "
"the :ref:`yieldexpr` section."
msgstr ""
"Полную информацию о семантике :keyword:`yield` можно найти в "
"разделе :ref:`yieldexpr`."
msgid "The :keyword:`!raise` statement"
msgstr "Инструкция :keyword:`!raise`"
msgid ""
"If no expressions are present, :keyword:`raise` re-raises the exception that "
"is currently being handled, which is also known as the *active exception*. "
"If there isn't currently an active exception, a :exc:`RuntimeError` "
"exception is raised indicating that this is an error."
msgstr ""
"Если выражения отсутствуют, инструкция :keyword:`raise` повторно возбуждает "
"исключение, которое в данный момент обрабатывается, так называемое *активное "
"исключение*. Если активного исключения нет, возбуждается "
"исключение :exc:`RuntimeError`, указывающее на ошибку."
msgid ""
"Otherwise, :keyword:`raise` evaluates the first expression as the exception "
"object. It must be either a subclass or an instance "
"of :class:`BaseException`. If it is a class, the exception instance will be "
"obtained when needed by instantiating the class with no arguments."
msgstr ""
"В противном случае :keyword:`raise` вычисляет первое выражение как объект "
"исключения. Оно должно быть либо подклассом :class:`BaseException`, либо его "
"экземпляром. Если указан класс, экземпляр исключения будет создан по мере "
"необходимости путём вызова конструктора без аргументов."
msgid ""
"The :dfn:`type` of the exception is the exception instance's class, "
"the :dfn:`value` is the instance itself."
msgstr ""
":dfn:`Тип` исключения — это класс экземпляра исключения, а :dfn:`значение` — "
"сам экземпляр."
msgid ""
"A traceback object is normally created automatically when an exception is "
"raised and attached to it as the :attr:`~BaseException.__traceback__` "
"attribute. You can create an exception and set your own traceback in one "
"step using the :meth:`~BaseException.with_traceback` exception method (which "
"returns the same exception instance, with its traceback set to its "
"argument), like so::"
msgstr ""
"Объект трассировки обычно создаётся автоматически при возбуждении исключения "
"и присоединяется к нему в атрибуте :attr:`~BaseException.__traceback__`. "
"Создать исключение и сразу задать собственную трассировку можно за один шаг "
"с помощью метода :meth:`~BaseException.with_traceback`, который возвращает "
"тот же экземпляр исключения с установленным объектом трассировки, например::"
msgid "raise Exception(\"foo occurred\").with_traceback(tracebackobj)"
msgstr "raise Exception(\"произошло foo\").with_traceback(tracebackobj)"
msgid ""
"The ``from`` clause is used for exception chaining: if given, the second "
"*expression* must be another exception class or instance. If the second "
"expression is an exception instance, it will be attached to the raised "
"exception as the :attr:`~BaseException.__cause__` attribute (which is "
"writable). If the expression is an exception class, the class will be "
"instantiated and the resulting exception instance will be attached to the "
"raised exception as the :attr:`!__cause__` attribute. If the raised "
"exception is not handled, both exceptions will be printed:"
msgstr ""
"Часть ``from`` используется для построения цепочек исключений: если она "
"указана, второе *выражение* должно быть другим классом исключения или его "
"экземпляром. Если второе выражение — экземпляр исключения, он присоединяется "
"к возбуждаемому исключению в атрибуте :attr:`~BaseException.__cause__` "
"(доступном для записи). Если указан класс исключения, он будет "
"инстанцирован, и полученный экземпляр будет присоединён к возбуждаемому "
"исключению в атрибуте :attr:`!__cause__`. Если исключение не "
"перехватывается, выводятся оба исключения."
msgid ""
">>> try:\n"
"... print(1 / 0)\n"
"... except Exception as exc:\n"
"... raise RuntimeError(\"Something bad happened\") from exc\n"
"...\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 2, in <module>\n"
" print(1 / 0)\n"
" ~~^~~\n"
"ZeroDivisionError: division by zero\n"
"\n"
"The above exception was the direct cause of the following exception:\n"
"\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 4, in <module>\n"
" raise RuntimeError(\"Something bad happened\") from exc\n"
"RuntimeError: Something bad happened"
msgstr ""
">>> try:\n"
"... print(1 / 0)\n"
"... except Exception as exc:\n"
"... raise RuntimeError(\"Случилось что-то плохое\") from exc\n"
"...\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 2, in <module>\n"
" print(1 / 0)\n"
" ~~^~~\n"
"ZeroDivisionError: division by zero\n"
"\n"
"The above exception was the direct cause of the following exception:\n"
"\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 4, in <module>\n"
" raise RuntimeError(\"Случилось что-то плохое\") from exc\n"
"RuntimeError: Случилось что-то плохое"
msgid ""
"A similar mechanism works implicitly if a new exception is raised when an "
"exception is already being handled. An exception may be handled when "
"an :keyword:`except` or :keyword:`finally` clause, or a :keyword:`with` "
"statement, is used. The previous exception is then attached as the new "
"exception's :attr:`~BaseException.__context__` attribute:"
msgstr ""
"Похожий механизм работает неявно, если новое исключение возбуждается в "
"момент, когда другое исключение уже обрабатывается. Исключение считается "
"обрабатываемым внутри блоков :keyword:`except` и :keyword:`finally` или "
"инструкции :keyword:`with`. В этом случае предыдущее исключение "
"присоединяется к новому в атрибуте :attr:`~BaseException.__context__`:"
msgid ""
">>> try:\n"
"... print(1 / 0)\n"
"... except:\n"
"... raise RuntimeError(\"Something bad happened\")\n"
"...\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 2, in <module>\n"
" print(1 / 0)\n"
" ~~^~~\n"
"ZeroDivisionError: division by zero\n"
"\n"
"During handling of the above exception, another exception occurred:\n"
"\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 4, in <module>\n"
" raise RuntimeError(\"Something bad happened\")\n"
"RuntimeError: Something bad happened"
msgstr ""
">>> try:\n"
"... print(1 / 0)\n"
"... except:\n"
"... raise RuntimeError(\"Случилось что-то плохое\")\n"
"...\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 2, in <module>\n"
" print(1 / 0)\n"
" ~~^~~\n"
"ZeroDivisionError: division by zero\n"
"\n"
"During handling of the above exception, another exception occurred:\n"
"\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 4, in <module>\n"
" raise RuntimeError(\"Случилось что-то плохое\")\n"
"RuntimeError: Случилось что-то плохое"
msgid ""
"Exception chaining can be explicitly suppressed by specifying :const:`None` "
"in the ``from`` clause:"
msgstr ""
"Цепочку исключений можно явно подавить, указав :const:`None` в части "
"``from``:"
msgid ""
">>> try:\n"
"... print(1 / 0)\n"
"... except:\n"
"... raise RuntimeError(\"Something bad happened\") from None\n"
"...\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 4, in <module>\n"
"RuntimeError: Something bad happened"
msgstr ""
">>> try:\n"
"... print(1 / 0)\n"
"... except:\n"
"... raise RuntimeError(\"Случилось что-то плохое\") from None\n"
"...\n"
"Traceback (most recent call last):\n"
" File \"<stdin>\", line 4, in <module>\n"
"RuntimeError: Случилось что-то плохое"
msgid ""
"Additional information on exceptions can be found in "
"section :ref:`exceptions`, and information about handling exceptions is in "
"section :ref:`try`."
msgstr ""
"Дополнительную информацию об исключениях можно найти в "
"разделе :ref:`exceptions`, а информацию об их обработке — в "
"разделе :ref:`try`."
msgid ":const:`None` is now permitted as ``Y`` in ``raise X from Y``."
msgstr ""
"Теперь :const:`None` допускается в качестве ``Y`` в конструкции ``raise X "
"from Y``."
msgid ""
"Added the :attr:`~BaseException.__suppress_context__` attribute to suppress "
"automatic display of the exception context."
msgstr ""
"Добавлен атрибут :attr:`~BaseException.__suppress_context__` для подавления "
"автоматического отображения контекста исключения."
msgid ""
"If the traceback of the active exception is modified in an :keyword:`except` "
"clause, a subsequent ``raise`` statement re-raises the exception with the "
"modified traceback. Previously, the exception was re-raised with the "
"traceback it had when it was caught."
msgstr ""
"Если трассировка активного исключения изменяется в блоке :keyword:`except`, "
"последующая инструкция ``raise`` повторно возбуждает исключение с изменённой "
"трассировкой. Ранее исключение повторно возбуждалось с трассировкой, которая "
"была у него в момент перехвата."
msgid "The :keyword:`!break` statement"
msgstr "Инструкция :keyword:`!break`"
msgid ""
":keyword:`break` may only occur syntactically nested in a :keyword:`for` "
"or :keyword:`while` loop, but not nested in a function or class definition "
"within that loop."
msgstr ""
"Инструкция :keyword:`break` может использоваться только внутри "
"циклов :keyword:`for` или :keyword:`while`, но не внутри определения функции "
"или класса, вложенного в такой цикл."
msgid ""
"It terminates the nearest enclosing loop, skipping the optional :keyword:`!"
"else` clause if the loop has one."
msgstr ""
"Она завершает ближайший охватывающий цикл, пропуская необязательную "
"часть :keyword:`!else`, если она у цикла есть."
View remainder of file in raw view
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.