-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathimport.po
More file actions
1755 lines (1555 loc) · 102 KB
/
Copy pathimport.po
File metadata and controls
1755 lines (1555 loc) · 102 KB
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-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Dmytro Kazanzhy, 2023
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.13\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-04-18 14:18+0000\n"
"PO-Revision-Date: 2021-06-28 01:49+0000\n"
"Last-Translator: Dmytro Kazanzhy, 2023\n"
"Language-Team: Ukrainian (https://app.transifex.com/python-doc/teams/5390/"
"uk/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != "
"11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % "
"100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || "
"(n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
msgid "The import system"
msgstr "Система імпорту"
msgid ""
"Python code in one :term:`module` gains access to the code in another module "
"by the process of :term:`importing` it. The :keyword:`import` statement is "
"the most common way of invoking the import machinery, but it is not the only "
"way. Functions such as :func:`importlib.import_module` and built-in :func:"
"`__import__` can also be used to invoke the import machinery."
msgstr ""
"Код Python в одному :term:`module` отримує доступ до коду в іншому модулі "
"шляхом процесу :term:`importing` його. Інструкція :keyword:`import` є "
"найпоширенішим способом виклику механізму імпорту, але це не єдиний спосіб. "
"Такі функції, як :func:`importlib.import_module` і вбудований :func:"
"`__import__` також можна використовувати для виклику механізму імпорту."
msgid ""
"The :keyword:`import` statement combines two operations; it searches for the "
"named module, then it binds the results of that search to a name in the "
"local scope. The search operation of the :keyword:`!import` statement is "
"defined as a call to the :func:`__import__` function, with the appropriate "
"arguments. The return value of :func:`__import__` is used to perform the "
"name binding operation of the :keyword:`!import` statement. See the :"
"keyword:`!import` statement for the exact details of that name binding "
"operation."
msgstr ""
"Оператор :keyword:`import` поєднує дві операції; він шукає названий модуль, "
"а потім прив’язує результати цього пошуку до імені в локальній області. "
"Операція пошуку оператора :keyword:`!import` визначається як виклик функції :"
"func:`__import__` з відповідними аргументами. Значення, що повертається :"
"func:`__import__`, використовується для виконання операції зв’язування імені "
"оператора :keyword:`!import`. Перегляньте оператор :keyword:`!import` для "
"отримання точних деталей цієї операції зв’язування імені."
msgid ""
"A direct call to :func:`__import__` performs only the module search and, if "
"found, the module creation operation. While certain side-effects may occur, "
"such as the importing of parent packages, and the updating of various caches "
"(including :data:`sys.modules`), only the :keyword:`import` statement "
"performs a name binding operation."
msgstr ""
"Прямий виклик :func:`__import__` виконує лише пошук модуля та, якщо "
"знайдено, операцію створення модуля. Хоча можуть виникнути певні побічні "
"ефекти, такі як імпортування батьківських пакетів і оновлення різних кешів "
"(включаючи :data:`sys.modules`), тільки оператор :keyword:`import` виконує "
"операцію зв’язування імені."
msgid ""
"When an :keyword:`import` statement is executed, the standard builtin :func:"
"`__import__` function is called. Other mechanisms for invoking the import "
"system (such as :func:`importlib.import_module`) may choose to bypass :func:"
"`__import__` and use their own solutions to implement import semantics."
msgstr ""
"Коли виконується оператор :keyword:`import`, викликається стандартна "
"вбудована функція :func:`__import__`. Інші механізми для виклику системи "
"імпорту (такі як :func:`importlib.import_module`) можуть вибрати обхід :func:"
"`__import__` і використовувати власні рішення для реалізації семантики "
"імпорту."
msgid ""
"When a module is first imported, Python searches for the module and if "
"found, it creates a module object [#fnmo]_, initializing it. If the named "
"module cannot be found, a :exc:`ModuleNotFoundError` is raised. Python "
"implements various strategies to search for the named module when the import "
"machinery is invoked. These strategies can be modified and extended by "
"using various hooks described in the sections below."
msgstr ""
"Коли модуль імпортовано вперше, Python шукає модуль і, якщо знайдено, "
"створює об’єкт модуля [#fnmo]_, ініціалізуючи його. Якщо вказаний модуль не "
"знайдено, виникає помилка :exc:`ModuleNotFoundError`. Python реалізує різні "
"стратегії для пошуку названого модуля під час виклику механізму імпорту. Ці "
"стратегії можна модифікувати та розширювати за допомогою різноманітних "
"хуків, описаних у розділах нижче."
msgid ""
"The import system has been updated to fully implement the second phase of :"
"pep:`302`. There is no longer any implicit import machinery - the full "
"import system is exposed through :data:`sys.meta_path`. In addition, native "
"namespace package support has been implemented (see :pep:`420`)."
msgstr ""
"Систему імпорту оновлено для повної реалізації другої фази :pep:`302`. "
"Більше немає механізму неявного імпорту – повна система імпорту доступна "
"через :data:`sys.meta_path`. Крім того, була реалізована підтримка рідного "
"пакету простору імен (див. :pep:`420`)."
msgid ":mod:`importlib`"
msgstr ":mod:`importlib`"
msgid ""
"The :mod:`importlib` module provides a rich API for interacting with the "
"import system. For example :func:`importlib.import_module` provides a "
"recommended, simpler API than built-in :func:`__import__` for invoking the "
"import machinery. Refer to the :mod:`importlib` library documentation for "
"additional detail."
msgstr ""
"Модуль :mod:`importlib` надає багатий API для взаємодії із системою імпорту. "
"Наприклад, :func:`importlib.import_module` надає рекомендований простіший "
"API, ніж вбудований :func:`__import__` для виклику механізму імпорту. "
"Зверніться до документації бібліотеки :mod:`importlib` для отримання "
"додаткової інформації."
msgid "Packages"
msgstr "пакети"
msgid ""
"Python has only one type of module object, and all modules are of this type, "
"regardless of whether the module is implemented in Python, C, or something "
"else. To help organize modules and provide a naming hierarchy, Python has a "
"concept of :term:`packages <package>`."
msgstr ""
"Python має лише один тип об’єкта модуля, і всі модулі належать до цього "
"типу, незалежно від того, чи реалізовано модуль на Python, C чи в чомусь "
"іншому. Щоб допомогти організувати модулі та забезпечити ієрархію імен, "
"Python має концепцію :term:`packages <package>`."
msgid ""
"You can think of packages as the directories on a file system and modules as "
"files within directories, but don't take this analogy too literally since "
"packages and modules need not originate from the file system. For the "
"purposes of this documentation, we'll use this convenient analogy of "
"directories and files. Like file system directories, packages are organized "
"hierarchically, and packages may themselves contain subpackages, as well as "
"regular modules."
msgstr ""
"Ви можете розглядати пакети як каталоги у файловій системі, а модулі як "
"файли в каталогах, але не сприймайте цю аналогію надто буквально, оскільки "
"пакети та модулі не обов’язково походять із файлової системи. Для цілей цієї "
"документації ми будемо використовувати цю зручну аналогію каталогів і "
"файлів. Як і каталоги файлової системи, пакунки організовані ієрархічно, і "
"самі пакунки можуть містити підпакети, а також звичайні модулі."
msgid ""
"It's important to keep in mind that all packages are modules, but not all "
"modules are packages. Or put another way, packages are just a special kind "
"of module. Specifically, any module that contains a ``__path__`` attribute "
"is considered a package."
msgstr ""
"Важливо мати на увазі, що всі пакети є модулями, але не всі модулі є "
"пакетами. Або інакше кажучи, пакунки - це просто особливий вид модулів. "
"Зокрема, будь-який модуль, який містить атрибут ``__path__``, вважається "
"пакетом."
msgid ""
"All modules have a name. Subpackage names are separated from their parent "
"package name by a dot, akin to Python's standard attribute access syntax. "
"Thus you might have a package called :mod:`email`, which in turn has a "
"subpackage called :mod:`email.mime` and a module within that subpackage "
"called :mod:`email.mime.text`."
msgstr ""
"Усі модулі мають назву. Назви підпакетів відокремлюються від назви "
"батьківського пакета крапкою, подібно до стандартного синтаксису доступу до "
"атрибутів Python. Таким чином, у вас може бути пакет під назвою :mod:"
"`email`, який, у свою чергу, має підпакет під назвою :mod:`email.mime` і "
"модуль у цьому підпакеті під назвою :mod:`email.mime.text`."
msgid "Regular packages"
msgstr "Звичайні пакети"
msgid ""
"Python defines two types of packages, :term:`regular packages <regular "
"package>` and :term:`namespace packages <namespace package>`. Regular "
"packages are traditional packages as they existed in Python 3.2 and earlier. "
"A regular package is typically implemented as a directory containing an "
"``__init__.py`` file. When a regular package is imported, this ``__init__."
"py`` file is implicitly executed, and the objects it defines are bound to "
"names in the package's namespace. The ``__init__.py`` file can contain the "
"same Python code that any other module can contain, and Python will add some "
"additional attributes to the module when it is imported."
msgstr ""
"Python визначає два типи пакетів: :term:`звичайні пакунки <regular package>` "
"і :term:`пакети простору імен <namespace package>`. Звичайні пакунки — це "
"традиційні пакунки, які існували в Python 3.2 і раніше. Звичайний пакет "
"зазвичай реалізується як каталог, що містить файл ``__init__.py``. Коли "
"імпортується звичайний пакет, цей файл ``__init__.py`` виконується неявно, а "
"об’єкти, які він визначає, прив’язуються до імен у просторі імен пакета. "
"Файл ``__init__.py`` може містити той самий код Python, який може містити "
"будь-який інший модуль, і Python додасть деякі додаткові атрибути до модуля "
"під час його імпорту."
msgid ""
"For example, the following file system layout defines a top level ``parent`` "
"package with three subpackages::"
msgstr ""
"Наприклад, наведений нижче макет файлової системи визначає \"батьківський\" "
"пакет верхнього рівня з трьома підпакетами:"
msgid ""
"parent/\n"
" __init__.py\n"
" one/\n"
" __init__.py\n"
" two/\n"
" __init__.py\n"
" three/\n"
" __init__.py"
msgstr ""
msgid ""
"Importing ``parent.one`` will implicitly execute ``parent/__init__.py`` and "
"``parent/one/__init__.py``. Subsequent imports of ``parent.two`` or "
"``parent.three`` will execute ``parent/two/__init__.py`` and ``parent/three/"
"__init__.py`` respectively."
msgstr ""
"Імпорт ``parent.one`` неявно виконає ``parent/__init__.py`` і ``parent/one/"
"__init__.py``. Наступні імпорти ``parent.two`` або ``parent.three`` "
"виконають ``parent/two/__init__.py`` та ``parent/three/__init__.py`` "
"відповідно."
msgid "Namespace packages"
msgstr "Пакети простору імен"
msgid ""
"A namespace package is a composite of various :term:`portions <portion>`, "
"where each portion contributes a subpackage to the parent package. Portions "
"may reside in different locations on the file system. Portions may also be "
"found in zip files, on the network, or anywhere else that Python searches "
"during import. Namespace packages may or may not correspond directly to "
"objects on the file system; they may be virtual modules that have no "
"concrete representation."
msgstr ""
"Пакет простору імен — це сукупність різноманітних :term:`частин <portion>`, "
"де кожна частина додає підпакет до батьківського пакета. Частини можуть "
"знаходитися в різних місцях файлової системи. Частини також можна знайти в "
"zip-файлах, у мережі чи будь-де ще, де Python шукає під час імпорту. Пакети "
"простору імен можуть або не можуть відповідати безпосередньо об'єктам у "
"файловій системі; вони можуть бути віртуальними модулями, які не мають "
"конкретного представлення."
msgid ""
"Namespace packages do not use an ordinary list for their ``__path__`` "
"attribute. They instead use a custom iterable type which will automatically "
"perform a new search for package portions on the next import attempt within "
"that package if the path of their parent package (or :data:`sys.path` for a "
"top level package) changes."
msgstr ""
"Пакунки простору імен не використовують звичайний список для свого атрибута "
"``__path__``. Натомість вони використовують настроюваний ітерований тип, "
"який автоматично виконає новий пошук частин пакета під час наступної спроби "
"імпорту в цьому пакеті, якщо шлях до їх батьківського пакета (або :data:`sys."
"path` для пакета верхнього рівня) зміниться."
msgid ""
"With namespace packages, there is no ``parent/__init__.py`` file. In fact, "
"there may be multiple ``parent`` directories found during import search, "
"where each one is provided by a different portion. Thus ``parent/one`` may "
"not be physically located next to ``parent/two``. In this case, Python will "
"create a namespace package for the top-level ``parent`` package whenever it "
"or one of its subpackages is imported."
msgstr ""
"У пакетах простору імен немає файлу ``parent/__init__.py``. Насправді під "
"час пошуку імпорту може бути знайдено кілька ``батьківських`` каталогів, де "
"кожен надається окремою частиною. Таким чином, ``батьківський/один`` може "
"фізично не знаходитися поруч із ``батьківським/два``. У цьому випадку Python "
"створюватиме пакет простору імен для ``батьківського`` пакета верхнього "
"рівня кожного разу, коли він або один із його підпакетів імпортується."
msgid "See also :pep:`420` for the namespace package specification."
msgstr "Дивіться також :pep:`420` для специфікації пакета простору імен."
msgid "Searching"
msgstr "Пошук"
msgid ""
"To begin the search, Python needs the :term:`fully qualified <qualified "
"name>` name of the module (or package, but for the purposes of this "
"discussion, the difference is immaterial) being imported. This name may "
"come from various arguments to the :keyword:`import` statement, or from the "
"parameters to the :func:`importlib.import_module` or :func:`__import__` "
"functions."
msgstr ""
"Щоб розпочати пошук, Python потребує :term:`повної <qualified name>` назви "
"модуля (або пакета, але для цілей цього обговорення різниця несуттєва), який "
"імпортується. Це ім’я може походити з різних аргументів оператора :keyword:"
"`import` або з параметрів функцій :func:`importlib.import_module` або :func:"
"`__import__`."
msgid ""
"This name will be used in various phases of the import search, and it may be "
"the dotted path to a submodule, e.g. ``foo.bar.baz``. In this case, Python "
"first tries to import ``foo``, then ``foo.bar``, and finally ``foo.bar."
"baz``. If any of the intermediate imports fail, a :exc:`ModuleNotFoundError` "
"is raised."
msgstr ""
"Ця назва використовуватиметься на різних етапах пошуку імпорту, і це може "
"бути пунктирний шлях до підмодуля, напр. ``foo.bar.baz``. У цьому випадку "
"Python спочатку намагається імпортувати ``foo``, потім ``foo.bar`` і, "
"нарешті, ``foo.bar.baz``. Якщо будь-який із проміжних імпортів не вдається, "
"виникає помилка :exc:`ModuleNotFoundError`."
msgid "The module cache"
msgstr "Кеш модуля"
msgid ""
"The first place checked during import search is :data:`sys.modules`. This "
"mapping serves as a cache of all modules that have been previously imported, "
"including the intermediate paths. So if ``foo.bar.baz`` was previously "
"imported, :data:`sys.modules` will contain entries for ``foo``, ``foo.bar``, "
"and ``foo.bar.baz``. Each key will have as its value the corresponding "
"module object."
msgstr ""
"Перше місце, яке перевіряється під час пошуку імпорту, це :data:`sys."
"modules`. Це відображення служить кеш-пам’яттю всіх модулів, які були раніше "
"імпортовані, включаючи проміжні шляхи. Отже, якщо ``foo.bar.baz`` був раніше "
"імпортований, :data:`sys.modules` міститиме записи для ``foo``, ``foo.bar`` "
"і ``foo.bar.baz``. Кожен ключ матиме значення відповідного об’єкта модуля."
msgid ""
"During import, the module name is looked up in :data:`sys.modules` and if "
"present, the associated value is the module satisfying the import, and the "
"process completes. However, if the value is ``None``, then a :exc:"
"`ModuleNotFoundError` is raised. If the module name is missing, Python will "
"continue searching for the module."
msgstr ""
"Під час імпорту ім’я модуля шукається в :data:`sys.modules` і, якщо воно "
"присутнє, пов’язане значення означає модуль, який задовольняє імпорт, і "
"процес завершується. Однак, якщо значенням є ``None``, тоді виникає :exc:"
"`ModuleNotFoundError`. Якщо ім’я модуля відсутнє, Python продовжить пошук "
"модуля."
msgid ""
":data:`sys.modules` is writable. Deleting a key may not destroy the "
"associated module (as other modules may hold references to it), but it will "
"invalidate the cache entry for the named module, causing Python to search "
"anew for the named module upon its next import. The key can also be assigned "
"to ``None``, forcing the next import of the module to result in a :exc:"
"`ModuleNotFoundError`."
msgstr ""
":data:`sys.modules` доступний для запису. Видалення ключа може не знищити "
"пов’язаний модуль (оскільки інші модулі можуть містити посилання на нього), "
"але це зробить недійсним запис кешу для названого модуля, змусивши Python "
"знову шукати названий модуль під час наступного імпорту. Ключ також може "
"бути призначений як ``None``, змушуючи наступний імпорт модуля призводити "
"до :exc:`ModuleNotFoundError`."
msgid ""
"Beware though, as if you keep a reference to the module object, invalidate "
"its cache entry in :data:`sys.modules`, and then re-import the named module, "
"the two module objects will *not* be the same. By contrast, :func:`importlib."
"reload` will reuse the *same* module object, and simply reinitialise the "
"module contents by rerunning the module's code."
msgstr ""
"Але будьте обережні: якби ви зберегли посилання на об’єкт модуля, зробили "
"недійсним запис кешу в :data:`sys.modules`, а потім повторно імпортували "
"названий модуль, два об’єкти модуля *не* будуть однаковими. Навпаки, :func:"
"`importlib.reload` повторно використовуватиме *той самий* об’єкт модуля та "
"просто повторно ініціалізує вміст модуля, повторно запускаючи код модуля."
msgid "Finders and loaders"
msgstr "Шукачі та вантажники"
msgid ""
"If the named module is not found in :data:`sys.modules`, then Python's "
"import protocol is invoked to find and load the module. This protocol "
"consists of two conceptual objects, :term:`finders <finder>` and :term:"
"`loaders <loader>`. A finder's job is to determine whether it can find the "
"named module using whatever strategy it knows about. Objects that implement "
"both of these interfaces are referred to as :term:`importers <importer>` - "
"they return themselves when they find that they can load the requested "
"module."
msgstr ""
"Якщо названий модуль не знайдено в :data:`sys.modules`, тоді для пошуку та "
"завантаження модуля викликається протокол імпорту Python. Цей протокол "
"складається з двох концептуальних об’єктів, :term:`finders <finder>` і :term:"
"`loaders <loader>`. Робота шукача полягає в тому, щоб визначити, чи зможе "
"він знайти названий модуль, використовуючи ту стратегію, про яку він знає. "
"Об’єкти, які реалізують обидва ці інтерфейси, називаються :term:`імпортерами "
"<importer>` — вони повертаються самі, коли виявляють, що можуть завантажити "
"запитаний модуль."
msgid ""
"Python includes a number of default finders and importers. The first one "
"knows how to locate built-in modules, and the second knows how to locate "
"frozen modules. A third default finder searches an :term:`import path` for "
"modules. The :term:`import path` is a list of locations that may name file "
"system paths or zip files. It can also be extended to search for any "
"locatable resource, such as those identified by URLs."
msgstr ""
"Python містить ряд засобів пошуку та імпорту за замовчуванням. Перший знає, "
"як знайти вбудовані модулі, а другий знає, як знайти заморожені модулі. "
"Третій засіб пошуку за умовчанням шукає модулі в :term:`шляху імпорту "
"<import path>`. :term:`шлях імпорту <import path>` — це список розташувань, "
"які можуть іменувати шляхи файлової системи або файли zip. Його також можна "
"розширити для пошуку будь-якого ресурсу, який можна знайти, наприклад, "
"ідентифікованого за URL-адресами."
msgid ""
"The import machinery is extensible, so new finders can be added to extend "
"the range and scope of module searching."
msgstr ""
"Механізм імпорту можна розширювати, тому можна додавати нові шукачі, щоб "
"розширити діапазон і обсяг пошуку модулів."
msgid ""
"Finders do not actually load modules. If they can find the named module, "
"they return a :dfn:`module spec`, an encapsulation of the module's import-"
"related information, which the import machinery then uses when loading the "
"module."
msgstr ""
"Шукачі фактично не завантажують модулі. Якщо їм вдається знайти названий "
"модуль, вони повертають :dfn:`module spec`, інкапсуляцію інформації, "
"пов’язаної з імпортом модуля, яку потім використовує механізм імпорту під "
"час завантаження модуля."
msgid ""
"The following sections describe the protocol for finders and loaders in more "
"detail, including how you can create and register new ones to extend the "
"import machinery."
msgstr ""
"У наступних розділах більш детально описано протоколи для шукачів і "
"завантажувачів, зокрема те, як ви можете створити та зареєструвати нові "
"протоколи для розширення механізму імпорту."
msgid ""
"In previous versions of Python, finders returned :term:`loaders <loader>` "
"directly, whereas now they return module specs which *contain* loaders. "
"Loaders are still used during import but have fewer responsibilities."
msgstr ""
"У попередніх версіях Python шукачі повертали :term:`loaders <loader>` "
"безпосередньо, тоді як тепер вони повертають специфікації модулів, які "
"*містять* завантажувачі. Завантажувачі все ще використовуються під час "
"імпорту, але мають менше обов’язків."
msgid "Import hooks"
msgstr "Імпортні гачки"
msgid ""
"The import machinery is designed to be extensible; the primary mechanism for "
"this are the *import hooks*. There are two types of import hooks: *meta "
"hooks* and *import path hooks*."
msgstr ""
"Імпортна техніка розрахована на розширення; основним механізмом для цього є "
"*перехоплення імпорту*. Існує два типи хуків імпорту: *мета-хуки* та *хуки "
"шляху імпорту*."
msgid ""
"Meta hooks are called at the start of import processing, before any other "
"import processing has occurred, other than :data:`sys.modules` cache look "
"up. This allows meta hooks to override :data:`sys.path` processing, frozen "
"modules, or even built-in modules. Meta hooks are registered by adding new "
"finder objects to :data:`sys.meta_path`, as described below."
msgstr ""
"Мета-хуки викликаються на початку обробки імпорту, до того, як відбулася "
"будь-яка інша обробка імпорту, окрім пошуку кешу :data:`sys.modules`. Це "
"дозволяє мета-хукам перевизначати :data:`sys.path` обробку, заморожені "
"модулі або навіть вбудовані модулі. Мета-хуки реєструються шляхом додавання "
"нових об’єктів пошуку до :data:`sys.meta_path`, як описано нижче."
msgid ""
"Import path hooks are called as part of :data:`sys.path` (or ``package."
"__path__``) processing, at the point where their associated path item is "
"encountered. Import path hooks are registered by adding new callables to :"
"data:`sys.path_hooks` as described below."
msgstr ""
"Перехоплювачі шляхів імпорту викликаються як частина обробки :data:`sys."
"path` (або ``package.__path__``) у точці, де зустрічається пов’язаний з ними "
"елемент шляху. Хуки шляхів імпорту реєструються шляхом додавання нових "
"викликів до :data:`sys.path_hooks`, як описано нижче."
msgid "The meta path"
msgstr "Меташлях"
msgid ""
"When the named module is not found in :data:`sys.modules`, Python next "
"searches :data:`sys.meta_path`, which contains a list of meta path finder "
"objects. These finders are queried in order to see if they know how to "
"handle the named module. Meta path finders must implement a method called :"
"meth:`~importlib.abc.MetaPathFinder.find_spec` which takes three arguments: "
"a name, an import path, and (optionally) a target module. The meta path "
"finder can use any strategy it wants to determine whether it can handle the "
"named module or not."
msgstr ""
msgid ""
"If the meta path finder knows how to handle the named module, it returns a "
"spec object. If it cannot handle the named module, it returns ``None``. "
"If :data:`sys.meta_path` processing reaches the end of its list without "
"returning a spec, then a :exc:`ModuleNotFoundError` is raised. Any other "
"exceptions raised are simply propagated up, aborting the import process."
msgstr ""
"Якщо засіб пошуку меташляху знає, як обробляти названий модуль, він повертає "
"специфікаційний об’єкт. Якщо він не може обробити названий модуль, він "
"повертає ``None``. Якщо обробка :data:`sys.meta_path` досягає кінця свого "
"списку без повернення специфікації, тоді виникає :exc:`ModuleNotFoundError`. "
"Будь-які інші викликані винятки просто поширюються, перериваючи процес "
"імпорту."
msgid ""
"The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path "
"finders is called with two or three arguments. The first is the fully "
"qualified name of the module being imported, for example ``foo.bar.baz``. "
"The second argument is the path entries to use for the module search. For "
"top-level modules, the second argument is ``None``, but for submodules or "
"subpackages, the second argument is the value of the parent package's "
"``__path__`` attribute. If the appropriate ``__path__`` attribute cannot be "
"accessed, a :exc:`ModuleNotFoundError` is raised. The third argument is an "
"existing module object that will be the target of loading later. The import "
"system passes in a target module only during reload."
msgstr ""
msgid ""
"The meta path may be traversed multiple times for a single import request. "
"For example, assuming none of the modules involved has already been cached, "
"importing ``foo.bar.baz`` will first perform a top level import, calling "
"``mpf.find_spec(\"foo\", None, None)`` on each meta path finder (``mpf``). "
"After ``foo`` has been imported, ``foo.bar`` will be imported by traversing "
"the meta path a second time, calling ``mpf.find_spec(\"foo.bar\", foo."
"__path__, None)``. Once ``foo.bar`` has been imported, the final traversal "
"will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``."
msgstr ""
"Мета-шлях може проходити кілька разів для одного запиту на імпорт. "
"Наприклад, якщо припустити, що жоден із задіяних модулів уже не кешовано, "
"імпорт ``foo.bar.baz`` спочатку виконає імпорт верхнього рівня, викликаючи "
"``mpf.find_spec(\"foo\", None, None)`` на шукач кожного меташляху (``mpf``). "
"Після того, як ``foo`` було імпортовано, ``foo.bar`` буде імпортовано шляхом "
"проходження меташляху вдруге, викликавши ``mpf.find_spec(\"foo.bar\", foo."
"__path__, None)`` . Після того, як ``foo.bar`` буде імпортовано, остаточний "
"обхід викличе ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``."
msgid ""
"Some meta path finders only support top level imports. These importers will "
"always return ``None`` when anything other than ``None`` is passed as the "
"second argument."
msgstr ""
"Деякі засоби пошуку меташляхів підтримують лише імпорт верхнього рівня. Ці "
"імпортери завжди повертатимуть ``None``, якщо будь-що інше, ніж ``None``, "
"передається як другий аргумент."
msgid ""
"Python's default :data:`sys.meta_path` has three meta path finders, one that "
"knows how to import built-in modules, one that knows how to import frozen "
"modules, and one that knows how to import modules from an :term:`import "
"path` (i.e. the :term:`path based finder`)."
msgstr ""
"За замовчуванням :data:`sys.meta_path` Python має три засоби пошуку "
"меташляху: один, який знає, як імпортувати вбудовані модулі, інший, який "
"знає, як імпортувати заморожені модулі, і інший, який знає, як імпортувати "
"модулі зі шляху імпорту (:term:`import path`, тобто :term:`path based "
"finder`)."
msgid ""
"The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path "
"finders replaced :meth:`!find_module`, which is now deprecated. While it "
"will continue to work without change, the import machinery will try it only "
"if the finder does not implement :meth:`~importlib.abc.MetaPathFinder."
"find_spec`."
msgstr ""
msgid ""
"Use of :meth:`!find_module` by the import system now raises :exc:"
"`ImportWarning`."
msgstr ""
msgid ""
":meth:`!find_module` has been removed. Use :meth:`~importlib.abc."
"MetaPathFinder.find_spec` instead."
msgstr ""
msgid "Loading"
msgstr "Завантаження"
msgid ""
"If and when a module spec is found, the import machinery will use it (and "
"the loader it contains) when loading the module. Here is an approximation "
"of what happens during the loading portion of import::"
msgstr ""
"Якщо специфікація модуля буде знайдена, механізм імпорту використовуватиме "
"її (і завантажувач, який вона містить) під час завантаження модуля. Ось "
"приблизно те, що відбувається під час завантаження частини імпорту:"
msgid ""
"module = None\n"
"if spec.loader is not None and hasattr(spec.loader, 'create_module'):\n"
" # It is assumed 'exec_module' will also be defined on the loader.\n"
" module = spec.loader.create_module(spec)\n"
"if module is None:\n"
" module = ModuleType(spec.name)\n"
"# The import-related module attributes get set here:\n"
"_init_module_attrs(spec, module)\n"
"\n"
"if spec.loader is None:\n"
" # unsupported\n"
" raise ImportError\n"
"if spec.origin is None and spec.submodule_search_locations is not None:\n"
" # namespace package\n"
" sys.modules[spec.name] = module\n"
"elif not hasattr(spec.loader, 'exec_module'):\n"
" module = spec.loader.load_module(spec.name)\n"
"else:\n"
" sys.modules[spec.name] = module\n"
" try:\n"
" spec.loader.exec_module(module)\n"
" except BaseException:\n"
" try:\n"
" del sys.modules[spec.name]\n"
" except KeyError:\n"
" pass\n"
" raise\n"
"return sys.modules[spec.name]"
msgstr ""
msgid "Note the following details:"
msgstr "Зверніть увагу на такі деталі:"
msgid ""
"If there is an existing module object with the given name in :data:`sys."
"modules`, import will have already returned it."
msgstr ""
"Якщо в :data:`sys.modules` є існуючий об’єкт модуля з вказаною назвою, "
"імпортування його вже повернуло."
msgid ""
"The module will exist in :data:`sys.modules` before the loader executes the "
"module code. This is crucial because the module code may (directly or "
"indirectly) import itself; adding it to :data:`sys.modules` beforehand "
"prevents unbounded recursion in the worst case and multiple loading in the "
"best."
msgstr ""
"Модуль існуватиме в :data:`sys.modules` до того, як завантажувач виконає код "
"модуля. Це важливо, оскільки код модуля може (прямо чи опосередковано) "
"імпортувати сам себе; додавання його до :data:`sys.modules` заздалегідь "
"запобігає необмеженій рекурсії в гіршому випадку та багаторазовому "
"завантаженню в найкращому."
msgid ""
"If loading fails, the failing module -- and only the failing module -- gets "
"removed from :data:`sys.modules`. Any module already in the :data:`sys."
"modules` cache, and any module that was successfully loaded as a side-"
"effect, must remain in the cache. This contrasts with reloading where even "
"the failing module is left in :data:`sys.modules`."
msgstr ""
"Якщо завантаження не вдасться, модуль із помилкою -- і тільки модуль із "
"помилкою -- видаляється з :data:`sys.modules`. Будь-який модуль, який уже "
"знаходиться в кеші :data:`sys.modules`, і будь-який модуль, який було "
"успішно завантажено як побічний ефект, повинні залишатися в кеші. Це "
"контрастує з перезавантаженням, коли навіть несправний модуль залишається в :"
"data:`sys.modules`."
msgid ""
"After the module is created but before execution, the import machinery sets "
"the import-related module attributes (\"_init_module_attrs\" in the pseudo-"
"code example above), as summarized in a :ref:`later section <import-mod-"
"attrs>`."
msgstr ""
"Після створення модуля, але перед його виконанням, механізм імпорту "
"встановлює пов’язані з імпортом атрибути модуля (\"_init_module_attrs\" у "
"наведеному вище прикладі псевдокоду), як підсумовано в :ref:`пізнішому "
"розділі <import-mod-attrs>`."
msgid ""
"Module execution is the key moment of loading in which the module's "
"namespace gets populated. Execution is entirely delegated to the loader, "
"which gets to decide what gets populated and how."
msgstr ""
"Виконання модуля є ключовим моментом завантаження, під час якого простір "
"імен модуля заповнюється. Виконання повністю делеговано завантажувачу, який "
"вирішує, що заповнювати і як."
msgid ""
"The module created during loading and passed to exec_module() may not be the "
"one returned at the end of import [#fnlo]_."
msgstr ""
"Модуль, створений під час завантаження та переданий у exec_module(), може не "
"бути тим, що повертається в кінці імпорту [#fnlo]_."
msgid ""
"The import system has taken over the boilerplate responsibilities of "
"loaders. These were previously performed by the :meth:`importlib.abc.Loader."
"load_module` method."
msgstr ""
"Система імпорту взяла на себе шаблонні обов’язки вантажників. Раніше вони "
"виконувалися методом :meth:`importlib.abc.Loader.load_module`."
msgid "Loaders"
msgstr "Вантажники"
msgid ""
"Module loaders provide the critical function of loading: module execution. "
"The import machinery calls the :meth:`importlib.abc.Loader.exec_module` "
"method with a single argument, the module object to execute. Any value "
"returned from :meth:`~importlib.abc.Loader.exec_module` is ignored."
msgstr ""
"Завантажувачі модулів забезпечують критичну функцію завантаження: виконання "
"модуля. Механізм імпорту викликає метод :meth:`importlib.abc.Loader."
"exec_module` з одним аргументом, об’єктом модуля, який потрібно виконати. "
"Будь-яке значення, повернуте з :meth:`~importlib.abc.Loader.exec_module` "
"ігнорується."
msgid "Loaders must satisfy the following requirements:"
msgstr "Вантажники повинні відповідати таким вимогам:"
msgid ""
"If the module is a Python module (as opposed to a built-in module or a "
"dynamically loaded extension), the loader should execute the module's code "
"in the module's global name space (``module.__dict__``)."
msgstr ""
"Якщо модуль є модулем Python (на відміну від вбудованого модуля або "
"динамічно завантажуваного розширення), завантажувач повинен виконати код "
"модуля в глобальному просторі імен модуля (``module.__dict__``)."
msgid ""
"If the loader cannot execute the module, it should raise an :exc:"
"`ImportError`, although any other exception raised during :meth:`~importlib."
"abc.Loader.exec_module` will be propagated."
msgstr ""
"Якщо завантажувач не може виконати модуль, він має викликати :exc:"
"`ImportError`, хоча будь-які інші винятки, викликані під час :meth:"
"`~importlib.abc.Loader.exec_module`, будуть поширені."
msgid ""
"In many cases, the finder and loader can be the same object; in such cases "
"the :meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return "
"a spec with the loader set to ``self``."
msgstr ""
"У багатьох випадках шукач і завантажувач можуть бути одним і тим же "
"об'єктом; у таких випадках метод :meth:`~importlib.abc.MetaPathFinder."
"find_spec` просто повертатиме специфікацію із завантажувачем, встановленим "
"на ``self``."
msgid ""
"Module loaders may opt in to creating the module object during loading by "
"implementing a :meth:`~importlib.abc.Loader.create_module` method. It takes "
"one argument, the module spec, and returns the new module object to use "
"during loading. ``create_module()`` does not need to set any attributes on "
"the module object. If the method returns ``None``, the import machinery "
"will create the new module itself."
msgstr ""
"Завантажувачі модулів можуть вибрати створення об’єкта модуля під час "
"завантаження, реалізувавши метод :meth:`~importlib.abc.Loader."
"create_module`. Він приймає один аргумент, специфікацію модуля, і повертає "
"новий об’єкт модуля для використання під час завантаження. "
"``create_module()`` не потребує встановлення жодних атрибутів для об’єкта "
"модуля. Якщо метод повертає ``None``, механізм імпорту створить новий модуль "
"сам."
msgid "The :meth:`~importlib.abc.Loader.create_module` method of loaders."
msgstr "Метод завантажувачів :meth:`~importlib.abc.Loader.create_module`."
msgid ""
"The :meth:`~importlib.abc.Loader.load_module` method was replaced by :meth:"
"`~importlib.abc.Loader.exec_module` and the import machinery assumed all the "
"boilerplate responsibilities of loading."
msgstr ""
"Метод :meth:`~importlib.abc.Loader.load_module` було замінено на :meth:"
"`~importlib.abc.Loader.exec_module`, а механізм імпорту взяв на себе всі "
"шаблонні обов’язки щодо завантаження."
msgid ""
"For compatibility with existing loaders, the import machinery will use the "
"``load_module()`` method of loaders if it exists and the loader does not "
"also implement ``exec_module()``. However, ``load_module()`` has been "
"deprecated and loaders should implement ``exec_module()`` instead."
msgstr ""
"Для сумісності з існуючими завантажувачами механізм імпорту "
"використовуватиме метод завантажувачів ``load_module()``, якщо він існує, а "
"завантажувач також не реалізує ``exec_module()``. Однак ``load_module()`` "
"застаріло, і завантажувачі повинні використовувати ``exec_module()`` замість "
"нього."
msgid ""
"The ``load_module()`` method must implement all the boilerplate loading "
"functionality described above in addition to executing the module. All the "
"same constraints apply, with some additional clarification:"
msgstr ""
"Метод ``load_module()`` має реалізовувати всі стандартні функції "
"завантаження, описані вище, на додаток до виконання модуля. Застосовуються "
"ті самі обмеження з деякими додатковими уточненнями:"
msgid ""
"If there is an existing module object with the given name in :data:`sys."
"modules`, the loader must use that existing module. (Otherwise, :func:"
"`importlib.reload` will not work correctly.) If the named module does not "
"exist in :data:`sys.modules`, the loader must create a new module object and "
"add it to :data:`sys.modules`."
msgstr ""
"Якщо в :data:`sys.modules` є існуючий об’єкт модуля з вказаною назвою, "
"завантажувач повинен використати цей існуючий модуль. (Інакше :func:"
"`importlib.reload` не працюватиме належним чином.) Якщо названий модуль не "
"існує в :data:`sys.modules`, завантажувач має створити новий об’єкт модуля "
"та додати його до :data:`sys.modules`."
msgid ""
"The module *must* exist in :data:`sys.modules` before the loader executes "
"the module code, to prevent unbounded recursion or multiple loading."
msgstr ""
"Модуль *має* існувати в :data:`sys.modules` до того, як завантажувач виконає "
"код модуля, щоб запобігти необмеженій рекурсії або багаторазовому "
"завантаженню."
msgid ""
"If loading fails, the loader must remove any modules it has inserted into :"
"data:`sys.modules`, but it must remove **only** the failing module(s), and "
"only if the loader itself has loaded the module(s) explicitly."
msgstr ""
"Якщо завантаження не вдається, завантажувач повинен видалити будь-які "
"модулі, які він вставив у :data:`sys.modules`, але він повинен видалити "
"**лише** модуль(и) з помилкою, і лише якщо завантажувач сам завантажив "
"модуль( s) явно."
msgid ""
"A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but "
"``create_module()`` is not."
msgstr ""
":exc:`DeprecationWarning` виникає, коли ``exec_module()`` визначено, а "
"``create_module()`` ні."
msgid ""
"An :exc:`ImportError` is raised when ``exec_module()`` is defined but "
"``create_module()`` is not."
msgstr ""
"Помилка :exc:`ImportError` виникає, коли ``exec_module()`` визначено, а "
"``create_module()`` ні."
msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`."
msgstr "Використання ``load_module()`` призведе до :exc:`ImportWarning`."
msgid "Submodules"
msgstr "Підмодулі"
msgid ""
"When a submodule is loaded using any mechanism (e.g. ``importlib`` APIs, the "
"``import`` or ``import-from`` statements, or built-in ``__import__()``) a "
"binding is placed in the parent module's namespace to the submodule object. "
"For example, if package ``spam`` has a submodule ``foo``, after importing "
"``spam.foo``, ``spam`` will have an attribute ``foo`` which is bound to the "
"submodule. Let's say you have the following directory structure::"
msgstr ""
"Коли підмодуль завантажується за допомогою будь-якого механізму (наприклад, "
"``importlib`` API, ``import`` або ``import-from`` оператори, або вбудований "
"``__import__()``), прив’язка розміщується в простір імен батьківського "
"модуля до об’єкта підмодуля. Наприклад, якщо пакет ``spam`` має підмодуль "
"``foo``, після імпорту ``spam.foo``, ``spam`` матиме атрибут ``foo``, який "
"прив’язаний до підмодуля. Скажімо, у вас є така структура каталогів:"
msgid ""
"spam/\n"
" __init__.py\n"
" foo.py"
msgstr ""
msgid "and ``spam/__init__.py`` has the following line in it::"
msgstr "а ``spam/__init__.py`` містить такий рядок::"
msgid "from .foo import Foo"
msgstr ""
msgid ""
"then executing the following puts name bindings for ``foo`` and ``Foo`` in "
"the ``spam`` module::"
msgstr ""
"потім виконання наступного ставить прив’язки імен для ``foo`` і ``Foo`` в "
"``spam`` модуль::"
msgid ""
">>> import spam\n"
">>> spam.foo\n"
"<module 'spam.foo' from '/tmp/imports/spam/foo.py'>\n"
">>> spam.Foo\n"
"<class 'spam.foo.Foo'>"
msgstr ""
msgid ""
"Given Python's familiar name binding rules this might seem surprising, but "
"it's actually a fundamental feature of the import system. The invariant "
"holding is that if you have ``sys.modules['spam']`` and ``sys.modules['spam."
"foo']`` (as you would after the above import), the latter must appear as the "
"``foo`` attribute of the former."
msgstr ""
"Враховуючи знайомі правила прив’язки імен Python, це може здатися дивним, "
"але насправді це фундаментальна функція системи імпорту. Незмінним є те, що "
"якщо у вас є ``sys.modules['spam']`` і ``sys.modules['spam.foo']`` (як після "
"імпорту вище), останній повинен відображатися як атрибут ``foo`` першого."
msgid "Module specs"
msgstr ""
msgid ""
"The import machinery uses a variety of information about each module during "
"import, especially before loading. Most of the information is common to all "
"modules. The purpose of a module's spec is to encapsulate this import-"
"related information on a per-module basis."
msgstr ""
"Механізм імпорту використовує різноманітну інформацію про кожен модуль під "
"час імпорту, особливо перед завантаженням. Більшість інформації є спільною "
"для всіх модулів. Метою специфікації модуля є інкапсуляція цієї інформації, "
"пов’язаної з імпортом, на основі кожного модуля."
msgid ""
"Using a spec during import allows state to be transferred between import "
"system components, e.g. between the finder that creates the module spec and "
"the loader that executes it. Most importantly, it allows the import "
"machinery to perform the boilerplate operations of loading, whereas without "
"a module spec the loader had that responsibility."
msgstr ""
"Використання специфікації під час імпорту дозволяє передавати стан між "
"компонентами системи імпорту, наприклад. між шукачем, який створює "
"специфікацію модуля, і завантажувачем, який його виконує. Найважливіше те, "
"що це дозволяє імпортним механізмам виконувати стандартні операції "
"завантаження, тоді як без специфікації модуля цю відповідальність несе "
"завантажувач."
msgid ""
"The module's spec is exposed as :attr:`module.__spec__`. Setting :attr:`!"
"__spec__` appropriately applies equally to :ref:`modules initialized during "
"interpreter startup <programs>`. The one exception is ``__main__``, where :"
"attr:`!__spec__` is :ref:`set to None in some cases <main_spec>`."
msgstr ""
msgid ""
"See :class:`~importlib.machinery.ModuleSpec` for details on the contents of "
"the module spec."
msgstr ""
msgid "__path__ attributes on modules"
msgstr ""
msgid ""
"The :attr:`~module.__path__` attribute should be a (possibly empty) :term:"
"`sequence` of strings enumerating the locations where the package's "
"submodules will be found. By definition, if a module has a :attr:`!__path__` "
"attribute, it is a :term:`package`."
msgstr ""
msgid ""
"A package's :attr:`~module.__path__` attribute is used during imports of its "
"subpackages. Within the import machinery, it functions much the same as :"
"data:`sys.path`, i.e. providing a list of locations to search for modules "
"during import. However, :attr:`!__path__` is typically much more constrained "
"than :data:`!sys.path`."
msgstr ""
msgid ""
"The same rules used for :data:`sys.path` also apply to a package's :attr:`!"
"__path__`. :data:`sys.path_hooks` (described below) are consulted when "
"traversing a package's :attr:`!__path__`."
msgstr ""
msgid ""
"A package's ``__init__.py`` file may set or alter the package's :attr:"
"`~module.__path__` attribute, and this was typically the way namespace "
"packages were implemented prior to :pep:`420`. With the adoption of :pep:"
"`420`, namespace packages no longer need to supply ``__init__.py`` files "
"containing only :attr:`!__path__` manipulation code; the import machinery "
"automatically sets :attr:`!__path__` correctly for the namespace package."
msgstr ""
msgid "Module reprs"
msgstr "Репрезентація модуля"
msgid ""
"By default, all modules have a usable repr, however depending on the "
"attributes set above, and in the module's spec, you can more explicitly "
"control the repr of module objects."
msgstr ""
"За замовчуванням усі модулі мають придатне для використання відображення, "
"однак, залежно від атрибутів, налаштованих вище, і в специфікації модуля ви "
"можете чіткіше керувати відтворенням об’єктів модуля."
msgid ""
"If the module has a spec (``__spec__``), the import machinery will try to "
"generate a repr from it. If that fails or there is no spec, the import "
"system will craft a default repr using whatever information is available on "
"the module. It will try to use the ``module.__name__``, ``module."
"__file__``, and ``module.__loader__`` as input into the repr, with defaults "
"for whatever information is missing."
msgstr ""
"Якщо модуль має специфікацію (``__spec__``), механізм імпорту спробує "
"згенерувати з неї repr. Якщо це не вдається або немає специфікації, система "
"імпорту створить відображення за замовчуванням, використовуючи будь-яку "
"інформацію, доступну в модулі. Він намагатиметься використати ``module."
"__name__``, ``module.__file__`` і ``module.__loader__`` як вхідні дані в "
"repr, із значеннями за замовчуванням для будь-якої інформації, якої немає."
msgid "Here are the exact rules used:"