-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathimport.po
More file actions
1924 lines (1723 loc) · 102 KB
/
import.po
File metadata and controls
1924 lines (1723 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-2017, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-04-17 23:44+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Dong-gweon Oh <flowdas@gmail.com>\n"
"Language-Team: Korean (https://python.flowdas.com)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.17.0\n"
#: ../../reference/import.rst:6
msgid "The import system"
msgstr "임포트 시스템"
#: ../../reference/import.rst:10
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 ""
"한 :term:`모듈 <module>` 에 있는 파이썬 코드는 :term:`임포팅 <importing>` 이라는 프로세스를 통해 "
"다른 모듈에 있는 코드들에 대한 접근권을 얻습니다. :keyword:`import` 문은 임포트 절차를 일으키는 가장 흔한 "
"방법이지만, 유일한 방법은 아닙니다. :func:`importlib.import_module` 같은 함수나 내장 "
":func:`__import__` 도 임포트 절차를 일으키는데 사용될 수 있습니다."
#: ../../reference/import.rst:16
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` 문을 보세요."
#: ../../reference/import.rst:25
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` 문만이 이름 연결 연산을 수행합니다."
#: ../../reference/import.rst:31
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__` 를 "
"사용하지 않고 임포트 개념을 구현하기 위한 자신의 방법을 사용할 수 있습니다."
#: ../../reference/import.rst:36
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 ""
"모듈이 처음 임포트 될 때, 파이썬은 모듈을 검색하고, 발견된다면, 모듈 객체를 만들고 [#fnmo]_, 초기화합니다. 만약 그 "
"이름의 모듈을 발견할 수 없다면, :exc:`ModuleNotFoundError` 를 일으킵니다. 파이썬은 임포트 절차가 호출될 때"
" 이름 붙여진 모듈을 찾는 다양한 전략을 구현합니다. 이 전략들은 다음 섹션에서 설명하는 여러 가지 훅을 통해 수정되고 확장될 수 "
"있습니다."
#: ../../reference/import.rst:43
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` 을 통해 노출됩니다. 여기에 더해, 네이티브(native) 이름 공간 "
"패키지의 지원이 구현되었습니다 (:pep:`420` 을 보세요)."
#: ../../reference/import.rst:51
msgid ":mod:`importlib`"
msgstr ":mod:`importlib`"
#: ../../reference/import.rst:53
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` 는 임포트 절차를 구동하는 데 있어 내장 :func:`__import__`"
" 에 비해 권장되고, 더 간단한 API를 제공합니다. 더 상세한 내용은 :mod:`importlib` 라이브러리 설명서를 "
"참조하십시오."
#: ../../reference/import.rst:62
msgid "Packages"
msgstr "패키지(package)"
#: ../../reference/import.rst:67
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 ""
"파이썬은 한 가지 종류의 모듈 객체만 갖고 있고, 모든 모듈은 모듈이 파이썬이나 C나 그 밖의 다른 어떤 방법으로 구현되었는지와 "
"상관없이 이 형입니다. 모듈을 조직화하고 이름 계층구조를 제공하기 위해, 파이썬은 :term:`패키지 <package>` 라는 "
"개념을 갖고 있습니다."
#: ../../reference/import.rst:72
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 ""
"패키지를 파일 시스템에 있는 디렉터리라고 생각할 수 있지만, 패키지와 모듈이 파일시스템으로부터 올 필요는 없으므로 이 비유를 너무 "
"문자 그대로 해석하지 말아야 합니다. 이 문서의 목적상, 디렉터리와 파일이라는 비유를 사용할 것입니다. 파일 시스템 디렉터리처럼, "
"패키지는 계층적으로 조직화하고, 패키지는 보통 모듈뿐만 아니라 서브 패키지도 포함할 수 있습니다."
#: ../../reference/import.rst:80
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__`` 어트리뷰트를 포함하는 모든 모듈은 패키지로 취급됩니다."
#: ../../reference/import.rst:85
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 ""
"모든 모듈은 이름이 있습니다. 서브 패키지 이름은 파이썬의 표준 어트리뷰트 액세스 문법을 따라, 부모 패키지 이름과 점(dot)으로"
" 구분됩니다. 그래서 :mod:`email` 이라고 불리는 패키지가 있을 수 있습니다. email 은 다시 서브 패키지 "
":mod:`email.mime` 을 갖고, 이 서브 패키지 내에 모듈 :mod:`email.mime.text` 가 있을 수 "
"있습니다."
#: ../../reference/import.rst:93
msgid "Regular packages"
msgstr "정규 패키지"
#: ../../reference/import.rst:98
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 ""
"파이썬은 두 가지 종류의 패키지를 정의합니다, :term:`정규 패키지 <regular package>` 와 :term:`이름 공간"
" 패키지 <namespace package>`. 정규 패키지는 파이썬 3.2와 그 이전에 존재하던 전통적인 패키지입니다. 정규 "
"패키지는 보통 ``__init__.py`` 파일을 가진 디렉터리로 구현됩니다. 정규 패키지가 임포트될 때, 이 "
"``__init__.py`` 파일이 묵시적으로 실행되고, 그것이 정의하는 객체들이 패키지의 이름 공간의 이름들도 연결됩니다. "
"``__init__.py`` 파일은 다른 모듈들이 가질 수 있는 것과 같은 파이썬 코드를 포함할 수 있고, 파이썬은 임포트될 때 "
"모듈에 몇 가지 어트리뷰트를 추가합니다."
#: ../../reference/import.rst:108
msgid ""
"For example, the following file system layout defines a top level "
"``parent`` package with three subpackages::"
msgstr "예를 들어, 다음과 같은 파일시스템 배치는 최상위 ``parent`` 패키지와 세 개의 서브 패키지를 정의합니다::"
#: ../../reference/import.rst:111
msgid ""
"parent/\n"
" __init__.py\n"
" one/\n"
" __init__.py\n"
" two/\n"
" __init__.py\n"
" three/\n"
" __init__.py"
msgstr ""
"parent/\n"
" __init__.py\n"
" one/\n"
" __init__.py\n"
" two/\n"
" __init__.py\n"
" three/\n"
" __init__.py"
#: ../../reference/import.rst:120
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`` 를 실행합니다."
#: ../../reference/import.rst:129
msgid "Namespace packages"
msgstr "이름 공간 패키지"
#: ../../reference/import.rst:135
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 파일이나 네트워크나 파이썬이 임포트 할 때 "
"검색하는 어떤 다른 장소에서 발견될 수 있습니다. 이름 공간 패키지는 파일시스템의 객체와 직접적인 상관관계가 있을 수도 있고 그렇지"
" 않을 수도 있습니다; 구체적인 형태가 없는 가상 모듈일 수도 있습니다."
#: ../../reference/import.rst:143
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`) 의"
" 경로가 변했으면 패키지 포션에 대한 새 검색을 자동으로 수행하게 됩니다."
#: ../../reference/import.rst:149
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`` 파일이 없습니다. 사실, 임포트 검색 동안 여러 개의 "
"``parent`` 디렉터리가 발견될 수 있고, 각각의 것은 다른 포션들에 의해 제공됩니다. 그래서 ``parent/one`` 은 "
"물리적으로 ``parent/two`` 옆에 위치하지 않을 수 있습니다. 이 경우, 파이썬은 자신 또는 서브 패키지 중 어느 하나가 "
"임포트 될 때마다 최상위 ``parent`` 패키지를 위한 이름 공간 패키지를 만듭니다."
#: ../../reference/import.rst:156
msgid "See also :pep:`420` for the namespace package specification."
msgstr "이름 공간 패키지의 규격은 :pep:`420` 을 참조하세요."
#: ../../reference/import.rst:160
msgid "Searching"
msgstr "검색"
#: ../../reference/import.rst:162
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 ""
"검색을 시작하기 위해, 파이썬은 임포트될 모듈(또는 패키지, 하지만 이 논의에서 차이점은 중요하지 않다)의 완전히 "
":term:`정규화된 이름 <qualified name>` 을 필요로 합니다. 이 이름은 :keyword:`import` 문으로 "
"제공된 여러 인자나, :func:`importlib.import_module` 나 :func:`__import__` 함수로 전달된 "
"매개변수들로부터 옵니다."
#: ../../reference/import.rst:168
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``. 이 경우에, 파이썬은 먼저 ``foo`` 를, 그다음에 ``foo.bar`` 를, 마지막으로 "
"``foo.bar.baz`` 를 임포트하려고 시도합니다. 만약 중간 임포트가 어느 하나라도 실패한다면 "
":exc:`ModuleNotFoundError` 가 발생합니다."
#: ../../reference/import.rst:175
msgid "The module cache"
msgstr "모듈 캐시"
#: ../../reference/import.rst:180
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`` 항목들을 포함합니다. 각"
" 키에 대응하는 값들은 모듈 객체입니다."
#: ../../reference/import.rst:187
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` 를 일으킵니다. 만약 "
"모듈 이름이 없다면, 파이썬은 모듈 검색을 계속 진행합니다."
#: ../../reference/import.rst:193
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` 은 쓰기가 허락됩니다. 키를 삭제해도 해당 모듈을 파괴하지는 않지만(다른 모듈들이 아직 그 "
"모듈에 대한 참조를 유지하고 있을 수 있으므로), 해당 이름의 모듈에 대한 캐시를 무효화해서, 다음 임포트때 파이썬으로 하여금 그 "
"모듈을 다시 찾도록 만듭니다. 키에는 ``None`` 을 대입할 수도 있는데, 다음 임포트 때 "
":exc:`ModuleNotFoundError` 가 일어나도록 만듭니다."
#: ../../reference/import.rst:200
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` 는 같은 모듈 객체를 "
"재사용하고, 간단하게 모듈의 코드를 다시 실행해서 모듈의 내용을 다시 초기화합니다."
#: ../../reference/import.rst:210
msgid "Finders and loaders"
msgstr "파인더(finder)와 로더(loader)"
#: ../../reference/import.rst:217
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` 에서 발견되지 않으면, 모듈을 찾아서 로드하기 위해 파이썬의 임포트 프로토콜이 "
"구동됩니다. 이 프로토콜은 두 개의 개념적 객체들로 구성되어 있습니다, :term:`파인더 <finder>` 와 :term:`로더 "
"<loader>`. 파인더의 일은 자신이 알고 있는 전략을 사용해, 주어진 이름의 모듈을 찾을 수 있는지 결정하는 것입니다. 두 "
"인터페이스 모두를 구현한 객체들을 :term:`임포터 <importer>`\\라고 부릅니다 - 요청한 모듈을 로딩할 수 있다고 "
"판단할 때 자신을 돌려줍니다."
#: ../../reference/import.rst:225
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 ""
"파이썬은 여러 가지 기본 파인더들과 임포터들을 포함하고 있습니다. 첫 번째 것은 내장 모듈들의 위치를 찾을 수 있고, 두 번째 것은"
" 프로즌 모듈(frozen module)의 위치를 찾을 수 있고, 세 번째 것은 모듈을 :term:`임포트 경로 <import "
"path>` 에서 검색합니다. :term:`임포트 경로 <import path>` 는 파일 시스템의 경로나 zip 파일을 가리키는 "
"위치들의 목록입니다. 그것은 URL로 식별될 수 있는 것들처럼, 위치가 지정될 수 있는 자원들을 검색하도록 확장될 수 있습니다."
#: ../../reference/import.rst:232
msgid ""
"The import machinery is extensible, so new finders can be added to extend"
" the range and scope of module searching."
msgstr "임포트 절차는 확장 가능해서, 모듈 검색의 범위를 확대하기 위해 새 파인더를 추가할 수 있습니다."
#: ../../reference/import.rst:235
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)` 을 돌려주는데, 임포트 절차는 모듈을 로딩할 때 이것을 사용하게 됩니다."
#: ../../reference/import.rst:239
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 ""
"다음 섹션은 파인더와 로더의 프로토콜에 대해 좀 더 자세히 설명하는데, 임포트 절차를 확장하기 위해 어떻게 새로운 것들을 만들고 "
"등록하는지를 포함합니다."
#: ../../reference/import.rst:243
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 ""
"이전 버전의 파이썬에서, 파인더가 :term:`로더 <loader>` 를 직접 돌려주었지만, 이제는 로더를 *포함하고* 있는 모듈 "
"스펙을 돌려줍니다. 임포트 도중 로더가 아직 사용되기는 하지만 그 역할은 축소되었습니다."
#: ../../reference/import.rst:249
msgid "Import hooks"
msgstr "임포트 훅(import hooks)"
#: ../../reference/import.rst:259
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 ""
"임포트 절차는 확장할 수 있도록 설계되었습니다; 일차적인 메커니즘은 *임포트 훅(import hook)* 입니다. 두 가지 종류의 "
"임포트 훅이 있습니다: *메타 훅(meta hook)* 과 *임포트 경로 훅(import path hook)*."
#: ../../reference/import.rst:263
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` 에 새 파인더 객체를 추가하는 방법으로 등록할 수 있습니다."
#: ../../reference/import.rst:269
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` 에 새 콜러블을 추가하는 "
"방법으로 등록할 수 있습니다."
#: ../../reference/import.rst:276
msgid "The meta path"
msgstr "메타 경로(meta path)"
#: ../../reference/import.rst:282
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 ""
"주어진 이름의 모듈을 :data:`sys.modules` 에서 찾을 수 없을 때, 파이썬은 :data:`sys.meta_path` "
"를 검색하는데, 메타 경로 파인더 객체들의 목록을 포함하고 있습니다. 이 파인더들이 주어진 이름의 모듈을 처리하는 방법을 알고 "
"있는지 확인하도록 요청합니다. 메타 경로 파인더들은 "
":meth:`~importlib.abc.MetaPathFinder.find_spec` 라는 이름의 메서드를 구현해야만 하는데, 세 "
"개의 인자를 받아들입니다: 이름, 임포트 경로, (생략 가능한) 타깃(target) 모듈. 메타 경로 파인더는 주어진 이름의 모듈을"
" 처리할 수 있는지를 결정하기 위해 어떤 전략이건 사용할 수 있습니다."
#: ../../reference/import.rst:291
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` 를 일으킵니다. 발생하는 다른 예외들은 그냥 확산시키고, 임포트 프로세스를 "
"중단합니다."
#: ../../reference/import.rst:297
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 ""
"메타 경로 파인더의 :meth:`~importlib.abc.MetaPathFinder.find_spec` 메서드는 두 개나 세 개의"
" 인자로 호출됩니다. 첫 번째 인자는 모듈의 완전히 정규화된 이름(fully qualified name)입니다, 예를 들어 "
"``foo.bar.baz``. 두 번째 인자는 모듈 검색에 사용할 경로 엔트리입니다. 최상위 모듈이 경우 두 번째 인자는 "
"``None`` 이지만, 서브 모듈이나 서브 패키지의 경우 두 번째 인자는 부모 패키지의 ``__path__`` 어트리뷰트 "
"값입니다. 만약 적절한 ``__path__`` 어트리뷰트를 참조할 수 없으면 :exc:`ModuleNotFoundError` 를 "
"일으킵니다. 세 번째 인자는 이미 존재하는 모듈 객체인데, 뒤에서 로딩할 대상이 됩니다. 임포트 시스템은 다시 로드(reload)할"
" 때만 타깃을 전달합니다."
#: ../../reference/import.rst:308
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``)들에 대해 "
"``mpf.find_spec(\"foo\", None, None)`` 를 호출해서 최상위 임포트를 수행합니다. ``foo`` 가 "
"임포트 된 후에, 메타 경로를 두 번째 탐색해서 ``foo.bar`` 를 임포트 하는데, "
"``mpf.find_spec(\"foo.bar\", foo.__path__, None)`` 를 호출합니다. 일단 "
"``foo.bar`` 가 임포트 되면, 마지막 탐색은 ``mpf.find_spec(\"foo.bar.baz\", "
"foo.bar.__path__, None)`` 를 호출합니다."
#: ../../reference/import.rst:318
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`` 을 돌려줍니다."
#: ../../reference/import.rst:322
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` 는 세 개의 메타 경로 파인더를 갖고 있습니다. 하나는 내장 모듈을 임포트하는"
" 법을 알고, 하나는 프로즌 모듈을 임포트하는 법을 알고, 하나는 :term:`임포트 경로 <import path>` 에서 모듈을 "
"임포트하는 법을 압니다(즉 :term:`경로 기반 파인더 <path based finder>`)."
#: ../../reference/import.rst:327
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 ""
"메타 경로 파인더의 :meth:`~importlib.abc.MetaPathFinder.find_spec` 메서드가 이제 폐지된 "
":meth:`!find_module` 을 대체합니다. 변경 없이도 동작하기는 하지만, 임포트 절차는 파인더가 "
":meth:`~importlib.abc.MetaPathFinder.find_spec` 을 구현하지 않았을 때만 사용합니다."
#: ../../reference/import.rst:334
msgid ""
"Use of :meth:`!find_module` by the import system now raises "
":exc:`ImportWarning`."
msgstr "임포트 시스템에서 :meth:`!find_module`\\을 사용하면 이제 :exc:`ImportWarning`\\을 발생시킵니다."
#: ../../reference/import.rst:338
msgid ""
":meth:`!find_module` has been removed. Use "
":meth:`~importlib.abc.MetaPathFinder.find_spec` instead."
msgstr ""
":meth:`!find_module`\\은 제거했습니다. 대신 "
":meth:`~importlib.abc.MetaPathFinder.find_spec`\\을 사용하십시오."
#: ../../reference/import.rst:344
msgid "Loading"
msgstr "로딩(loading)"
#: ../../reference/import.rst:346
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 ""
"모듈 스펙이 발견되면, 임포트 절차는 모듈을 로딩할 때 그것(그것이 가진 로더도)을 사용합니다. 여기에 임포트의 로딩 과정 동안 "
"일어나는 일에 대한 대략적인 그림이 있습니다::"
#: ../../reference/import.rst:350
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 ""
"module = None\n"
"if spec.loader is not None and hasattr(spec.loader, 'create_module'):\n"
" # 'exec_module'도 loader에 정의되어 있다고 가정합니다.\n"
" module = spec.loader.create_module(spec)\n"
"if module is None:\n"
" module = ModuleType(spec.name)\n"
"# 임포트 관련 모듈 어트리뷰트들은 여기에서 설정됩니다:\n"
"_init_module_attrs(spec, module)\n"
"\n"
"if spec.loader is None:\n"
" # 지원되지 않습니다\n"
" raise ImportError\n"
"if spec.origin is None and spec.submodule_search_locations is not None:\n"
" # 이름 공간 패키지\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]"
#: ../../reference/import.rst:379
msgid "Note the following details:"
msgstr "다음과 같은 세부 사항에 주의해야 합니다:"
#: ../../reference/import.rst:381
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` 에 있다면, 임포트는 이미 그걸 돌려줄 겁니다."
#: ../../reference/import.rst:384
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` 에 추가함으로써 최악의 상황에 제한 "
"없는 재귀(recursion)를 방지하고, 최선의 상황에 여러 번 로딩되는 것을 막습니다."
#: ../../reference/import.rst:390
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` 에 남아있게 되는 리로딩과 대비됩니다."
#: ../../reference/import.rst:396
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 ""
"모듈이 만들어졌지만, 아직 실행되기 전에, :ref:`뒤의 섹션 <import-mod-attrs>` 에서 요약되듯이, 임포트 절차는"
" 임포트 관련 모듈 어트리뷰트들을 설정합니다(위의 의사 코드 예에서 \\“_init_module_attrs\\”)."
#: ../../reference/import.rst:401
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 ""
"모듈 실행은 로딩에서 모듈의 이름 공간이 채워지는 결정적 순간입니다. 실행은 전적으로 로더에 위임되는데, 로더가 어떤 것이 어떻게 "
"채워져야 하는지 결정합니다."
#: ../../reference/import.rst:405
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]_."
#: ../../reference/import.rst:408
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` 메서드에서 수행되었습니다."
#: ../../reference/import.rst:414
msgid "Loaders"
msgstr "로더"
#: ../../reference/import.rst:416
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` 이 돌려주는 값은 무시됩니다."
#: ../../reference/import.rst:421
msgid "Loaders must satisfy the following requirements:"
msgstr "로더는 다음과 같은 요구 조건들을 만족해야 합니다:"
#: ../../reference/import.rst:423
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 ""
"만약 모듈이 파이썬 모듈(내장 모듈이나 동적으로 로딩되는 확장이 아니라)이면, 로더는 모듈의 코드를 모듈의 전역 이름 "
"공간(``module.__dict__``)에서 실행해야 합니다."
#: ../../reference/import.rst:427
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` 동안 발생하는 다른 예외도 전파됩니다."
#: ../../reference/import.rst:431
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`` 로 설정된 "
"스펙을 돌려줍니다."
#: ../../reference/import.rst:435
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`` 을 "
"돌려주면, 임포트 절차는 새 모듈을 스스로 만듭니다."
#: ../../reference/import.rst:442
msgid "The :meth:`~importlib.abc.Loader.create_module` method of loaders."
msgstr "로더의 :meth:`~importlib.abc.Loader.create_module` 메서드."
#: ../../reference/import.rst:445
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` 로 대체되었고, 임포트 절차가 로딩의 공통 "
"코드(boilerplate)에 대한 책임을 집니다."
#: ../../reference/import.rst:450
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()`` 을 사용합니다. 하지만 "
"``load_module()`` 은 폐지되었습니다. 로더는 대신 ``exec_module()`` 를 구현해야 합니다."
#: ../../reference/import.rst:455
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()`` 메서드는 모듈을 실행하는 것 외에 위에서 언급한 모든 공통(boilerplate) 로딩 기능을 "
"구현해야만 합니다. 같은 제약들이 모두 적용되는데, 추가적인 설명을 붙여보면:"
#: ../../reference/import.rst:459
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` 에 추가해야 합니다."
#: ../../reference/import.rst:465
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` 에 존재해야 합니다."
#: ../../reference/import.rst:469
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` 에 삽입한 모듈들을 제거해야 하는데, 실패한 모듈만을 제거해야 "
"하고, 로더가 그 모듈을 직접 명시적으로 로드한 경우에만 그래야 합니다."
#: ../../reference/import.rst:474
msgid ""
"A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined "
"but ``create_module()`` is not."
msgstr ""
"``exec_module()`` 이 정의되었지만 ``create_module()`` 이 정의되지 않으면 "
":exc:`DeprecationWarning` 이 발생합니다."
#: ../../reference/import.rst:478
msgid ""
"An :exc:`ImportError` is raised when ``exec_module()`` is defined but "
"``create_module()`` is not."
msgstr ""
"``exec_module()`` 이 정의되었지만 ``create_module()`` 이 정의되지 않으면 "
":exc:`ImportError` 를 일으킵니다."
#: ../../reference/import.rst:482
msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`."
msgstr "``load_module()``\\의 사용은 :exc:`ImportWarning`\\을 발생시킵니다."
#: ../../reference/import.rst:486
msgid "Submodules"
msgstr "서브 모듈"
#: ../../reference/import.rst:488
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`` 를 갖게 됩니다. 다음과 같은 디렉터리 구조로 되어 있다고 합시다::"
#: ../../reference/import.rst:495
msgid ""
"spam/\n"
" __init__.py\n"
" foo.py"
msgstr ""
"spam/\n"
" __init__.py\n"
" foo.py"
#: ../../reference/import.rst:499
msgid "and ``spam/__init__.py`` has the following line in it::"
msgstr "그리고 ``spam/__init__.py`` 가 다음과 같은 줄을 포함한다고 합시다::"
#: ../../reference/import.rst:501
msgid "from .foo import Foo"
msgstr "from .foo import Foo"
#: ../../reference/import.rst:503
msgid ""
"then executing the following puts name bindings for ``foo`` and ``Foo`` "
"in the ``spam`` module::"
msgstr "그러면 다음과 같이 실행하면 ``spam`` 모듈에 ``foo`` 와 ``Foo`` 에 대한 이름 연결이 일어납니다."
#: ../../reference/import.rst:506
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 ""
">>> import spam\n"
">>> spam.foo\n"
"<module 'spam.foo' from '/tmp/imports/spam/foo.py'>\n"
">>> spam.Foo\n"
"<class 'spam.foo.Foo'>"
#: ../../reference/import.rst:512
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 ""
"파이썬의 익숙한 이름 연결 규칙에서 볼 때 의외의 결과로 보일 수 있습니다. 하지만 실제로는 임포트 시스템의 근본적인 기능입니다. "
"불변의 규칙은 이렇습니다: 만약 ``sys.modules['spam']`` 과 ``sys.modules['spam.foo']`` 가"
" 있다면 (위의 임포트 이후의 상태가 그러합니다), 뒤에 있는 것은 반드시 앞에 있는 것의 ``foo`` 어트리뷰트가 되어야 "
"합니다."
#: ../../reference/import.rst:521
msgid "Module specs"
msgstr "모듈 스펙"
#: ../../reference/import.rst:523
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 ""
"임포트 절차는 임포트 동안 각 모듈에 대한 다양한 정보들을 사용합니다, 특히 로딩 전에. 대부분 정보는 모든 모듈의 공통이다. 모듈"
" 스펙의 목적은 이 임포트 관련 정보를 모듈별로 요약하는 것입니다."
#: ../../reference/import.rst:528
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 ""
"임포트 동안 스펙을 사용하면 상태가 임포트 시스템의 구성 요소들로 전달될 수 있습니다, 예를 들어 모듈 스펙을 만드는 파인더와 "
"그것을 실행하는 로더 간에. 가장 중요한 것은, 임포트 절차가 로딩의 공통 연산(boilerplate operation)을 수행할 "
"수 있도록 하는 것입니다. 모듈 스펙이 없다면 로더가 모든 책임을 지게 됩니다."
#: ../../reference/import.rst:534
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 ""
"모듈의 스펙은 :attr:`module.__spec__`\\으로 노출됩니다. :attr:`!__spec__` 을 적절히 설정하는 "
"것은 :ref:`인터프리터가 구동되는 동안 초기화되는 모듈들 <programs>` 에도 마찬가지로 적용됩니다. 한가지 예외는 "
"``__main__`` 인데, :attr:`!__spec__` 이 :ref:`어떤 경우에 None 으로 설정됩니다 "
"<main_spec>`."
#: ../../reference/import.rst:540
msgid ""
"See :class:`~importlib.machinery.ModuleSpec` for details on the contents "
"of the module spec."
msgstr "모듈 스펙의 내용에 대한 세부 사항은 :class:`~importlib.machinery.ModuleSpec` 을 보세요."