-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathprogramming.po
More file actions
2636 lines (2276 loc) · 136 KB
/
programming.po
File metadata and controls
2636 lines (2276 loc) · 136 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: 2021-04-08 08:18+0900\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.7.0\n"
#: ../Doc/faq/programming.rst:5
msgid "Programming FAQ"
msgstr "프로그래밍 FAQ"
#: ../Doc/faq/programming.rst:8
msgid "Contents"
msgstr "목차"
#: ../Doc/faq/programming.rst:12
msgid "General Questions"
msgstr "일반적인 질문"
#: ../Doc/faq/programming.rst:15
msgid ""
"Is there a source code level debugger with breakpoints, single-stepping, "
"etc.?"
msgstr "중단점, 단일 스테핑(single-stepping) 등을 포함하는 소스 코드 수준 디버거가 있습니까?"
#: ../Doc/faq/programming.rst:17 ../Doc/faq/programming.rst:57
msgid "Yes."
msgstr "예."
#: ../Doc/faq/programming.rst:19
msgid ""
"Several debuggers for Python are described below, and the built-in "
"function :func:`breakpoint` allows you to drop into any of them."
msgstr ""
"파이썬을 위한 여러 디버거가 아래에 설명되어 있으며, 내장 함수 :func:`breakpoint`\\를 사용하면 이들 중 하나로 "
"들어갈 수 있습니다."
#: ../Doc/faq/programming.rst:22
msgid ""
"The pdb module is a simple but adequate console-mode debugger for Python."
" It is part of the standard Python library, and is :mod:`documented in "
"the Library Reference Manual <pdb>`. You can also write your own debugger"
" by using the code for pdb as an example."
msgstr ""
"pdb 모듈은 간단하지만 적절한 파이썬 용 콘솔 모드 디버거입니다. 표준 파이썬 라이브러리의 일부이며, :mod:`라이브러리 "
"레퍼런스 매뉴얼에서 설명 <pdb>`\\하고 있습니다. pdb의 코드를 예로 사용하여 자체 디버거를 작성할 수도 있습니다."
#: ../Doc/faq/programming.rst:27
msgid ""
"The IDLE interactive development environment, which is part of the "
"standard Python distribution (normally available as Tools/scripts/idle), "
"includes a graphical debugger."
msgstr ""
"표준 파이썬 배포의 일부인 (보통 Tools/scripts/idle에 있습니다) IDLE 대화식 개발 환경에는 그래픽 디버거가 "
"포함되어 있습니다."
#: ../Doc/faq/programming.rst:31
msgid ""
"PythonWin is a Python IDE that includes a GUI debugger based on pdb. The"
" Pythonwin debugger colors breakpoints and has quite a few cool features "
"such as debugging non-Pythonwin programs. Pythonwin is available as part"
" of the `Python for Windows Extensions "
"<https://sourceforge.net/projects/pywin32/>`__ project and as a part of "
"the ActivePython distribution (see "
"https://www.activestate.com/activepython\\ )."
msgstr ""
"PythonWin은 pdb 기반 GUI 디버거를 포함하는 파이썬 IDE입니다. Pythonwin 디버거는 중단점에 색을 입히고 비 "
"Pythonwin 프로그램 디버깅과 같은 멋진 기능을 제공합니다. Pythonwin은 `Python for Windows "
"Extensions <https://sourceforge.net/projects/pywin32/>`__ 프로젝트의 일부와 "
"ActivePython 배포의 일부로 제공됩니다 (https://www.activestate.com/activepython 를 "
"참조하십시오)."
#: ../Doc/faq/programming.rst:38
msgid ""
"`Eric <http://eric-ide.python-projects.org/>`_ is an IDE built on PyQt "
"and the Scintilla editing component."
msgstr ""
"`Eric <http://eric-ide.python-projects.org/>`_\\은 PyQt와 Scintilla 편집 "
"컴포넌트를 기반으로 하는 IDE입니다."
#: ../Doc/faq/programming.rst:41
msgid ""
"Pydb is a version of the standard Python debugger pdb, modified for use "
"with DDD (Data Display Debugger), a popular graphical debugger front end."
" Pydb can be found at http://bashdb.sourceforge.net/pydb/ and DDD can be"
" found at https://www.gnu.org/software/ddd."
msgstr ""
"Pydb는 널리 사용되는 그래픽 디버거 프런트 엔드인 DDD(Data Display Debugger)와 함께 사용하도록 수정된 표준"
" 파이썬 디버거 pdb의 버전입니다. Pydb는 http://bashdb.sourceforge.net/pydb/ 에서 찾을 수 있고"
" DDD는 https://www.gnu.org/software/ddd 에서 찾을 수 있습니다."
#: ../Doc/faq/programming.rst:46
msgid ""
"There are a number of commercial Python IDEs that include graphical "
"debuggers. They include:"
msgstr "그래픽 디버거를 포함하는 많은 상용 파이썬 IDE가 있습니다. 다음을 포함합니다:"
#: ../Doc/faq/programming.rst:49
msgid "Wing IDE (https://wingware.com/)"
msgstr "Wing IDE (https://wingware.com/)"
#: ../Doc/faq/programming.rst:50
msgid "Komodo IDE (https://komodoide.com/)"
msgstr "Komodo IDE (https://komodoide.com/)"
#: ../Doc/faq/programming.rst:51
msgid "PyCharm (https://www.jetbrains.com/pycharm/)"
msgstr "PyCharm (https://www.jetbrains.com/pycharm/)"
#: ../Doc/faq/programming.rst:55
msgid "Are there tools to help find bugs or perform static analysis?"
msgstr "버그를 찾거나 정적 분석을 수행하는 데 도움이 되는 도구가 있습니까?"
#: ../Doc/faq/programming.rst:59
msgid ""
"`Pylint <https://www.pylint.org/>`_ and `Pyflakes "
"<https://github.com/PyCQA/pyflakes>`_ do basic checking that will help "
"you catch bugs sooner."
msgstr ""
"`Pylint <https://www.pylint.org/>`_\\와 `Pyflakes "
"<https://github.com/PyCQA/pyflakes>`_\\는 버그를 더 빨리 발견하는 데 도움이 되는 기본 검사를 "
"수행합니다."
#: ../Doc/faq/programming.rst:63
msgid ""
"Static type checkers such as `Mypy <http://mypy-lang.org/>`_, `Pyre "
"<https://pyre-check.org/>`_, and `Pytype "
"<https://github.com/google/pytype>`_ can check type hints in Python "
"source code."
msgstr ""
"`Mypy <http://mypy-lang.org/>`_, `Pyre <https://pyre-check.org/>`_ 및 "
"`Pytype <https://github.com/google/pytype>`_\\과 같은 정적 형 검사기는 파이썬 소스 코드에 "
"있는 형 힌트를 검사할 수 있습니다."
#: ../Doc/faq/programming.rst:70
msgid "How can I create a stand-alone binary from a Python script?"
msgstr "파이썬 스크립트로 독립 실행형 바이너리를 만들려면 어떻게 해야 합니까?"
#: ../Doc/faq/programming.rst:72
msgid ""
"You don't need the ability to compile Python to C code if all you want is"
" a stand-alone program that users can download and run without having to "
"install the Python distribution first. There are a number of tools that "
"determine the set of modules required by a program and bind these modules"
" together with a Python binary to produce a single executable."
msgstr ""
"사용자가 파이썬 배포를 먼저 설치하지 않고도 다운로드하여 실행할 수 있는 독립 실행형 프로그램을 원하는 것이 전부라면 파이썬을 C "
"코드로 컴파일하는 기능이 필요하지는 않습니다. 프로그램에 필요한 모듈 집합을 파악하고 이러한 모듈들을 파이썬 바이너리와 결합하여 "
"단일 실행 파일을 생성하는 많은 도구가 있습니다."
#: ../Doc/faq/programming.rst:78
msgid ""
"One is to use the freeze tool, which is included in the Python source "
"tree as ``Tools/freeze``. It converts Python byte code to C arrays; a C "
"compiler you can embed all your modules into a new program, which is then"
" linked with the standard Python modules."
msgstr ""
"그중 하나는 파이썬 소스 트리에 ``Tools/freeze``\\로 포함된 freeze 도구를 사용하는 것입니다. 파이썬 바이트 "
"코드를 C 배열로 변환합니다; C 컴파일러를 사용하면 모든 모듈을 새 프로그램에 내장시킨 다음 표준 파이썬 모듈과 링크할 수 "
"있습니다."
#: ../Doc/faq/programming.rst:83
msgid ""
"It works by scanning your source recursively for import statements (in "
"both forms) and looking for the modules in the standard Python path as "
"well as in the source directory (for built-in modules). It then turns "
"the bytecode for modules written in Python into C code (array "
"initializers that can be turned into code objects using the marshal "
"module) and creates a custom-made config file that only contains those "
"built-in modules which are actually used in the program. It then "
"compiles the generated C code and links it with the rest of the Python "
"interpreter to form a self-contained binary which acts exactly like your "
"script."
msgstr ""
"소스를 재귀적으로 검색하여 import 문(두 형식 모두)을 찾고 표준 파이썬 경로뿐만 아니라 소스 디렉터리에서 모듈을 찾습니다 "
"(내장할 모듈을 위해). 그런 다음 파이썬으로 작성된 모듈의 바이트 코드를 C 코드 (marshal 모듈을 사용하여 코드 객체로 "
"변환할 수 있는 배열 초기화기)로 바꾸고 프로그램에서 실제로 사용되는 내장 모듈만 포함하는 특별한 구성 파일을 만듭니다. 그런 다음"
" 생성된 C 코드를 컴파일하고 이를 나머지 파이썬 인터프리터와 링크하여 스크립트와 똑같게 작동하는 자체 포함 바이너리를 형성합니다."
#: ../Doc/faq/programming.rst:92
msgid ""
"Obviously, freeze requires a C compiler. There are several other "
"utilities which don't. One is Thomas Heller's py2exe (Windows only) at"
msgstr ""
"명백히, freeze는 C 컴파일러를 요구합니다. 그렇지 않은 다른 유틸리티가 몇 가지 있습니다. 그중 하나는 Thomas "
"Heller의 py2exe(윈도우 전용)이고, 다음에서 찾을 수 있습니다."
#: ../Doc/faq/programming.rst:95
msgid "http://www.py2exe.org/"
msgstr "http://www.py2exe.org/"
#: ../Doc/faq/programming.rst:97
msgid ""
"Another tool is Anthony Tuininga's `cx_Freeze <https://anthony-"
"tuininga.github.io/cx_Freeze/>`_."
msgstr ""
"또 다른 도구는 Anthony Tuininga의 `cx_Freeze <https://anthony-"
"tuininga.github.io/cx_Freeze/>`_\\입니다."
#: ../Doc/faq/programming.rst:101
msgid "Are there coding standards or a style guide for Python programs?"
msgstr "파이썬 프로그램을 위한 코딩 표준이나 스타일 지침서가 있습니까?"
#: ../Doc/faq/programming.rst:103
msgid ""
"Yes. The coding style required for standard library modules is "
"documented as :pep:`8`."
msgstr "예. 표준 라이브러리 모듈에 요구되는 코딩 스타일은 :pep:`8`\\에서 설명합니다."
#: ../Doc/faq/programming.rst:108
msgid "Core Language"
msgstr "핵심 언어"
#: ../Doc/faq/programming.rst:111
msgid "Why am I getting an UnboundLocalError when the variable has a value?"
msgstr "변수에 값이 있을 때 UnboundLocalError 가 발생하는 이유는 무엇입니까?"
#: ../Doc/faq/programming.rst:113
msgid ""
"It can be a surprise to get the UnboundLocalError in previously working "
"code when it is modified by adding an assignment statement somewhere in "
"the body of a function."
msgstr "전에는 동작하던 코드에서 함수 본문 어딘가에 대입문을 추가했을 때 UnboundLocalError 가 발생하면 당황할 수 있습니다."
#: ../Doc/faq/programming.rst:117
msgid "This code:"
msgstr "이 코드는:"
#: ../Doc/faq/programming.rst:125
msgid "works, but this code:"
msgstr "작동하지만, 이 코드는:"
#: ../Doc/faq/programming.rst:132
msgid "results in an UnboundLocalError:"
msgstr "UnboundLocalError 가 발생합니다:"
#: ../Doc/faq/programming.rst:139
msgid ""
"This is because when you make an assignment to a variable in a scope, "
"that variable becomes local to that scope and shadows any similarly named"
" variable in the outer scope. Since the last statement in foo assigns a "
"new value to ``x``, the compiler recognizes it as a local variable. "
"Consequently when the earlier ``print(x)`` attempts to print the "
"uninitialized local variable and an error results."
msgstr ""
"이는 스코프에서 변수에 대입할 때, 해당 변수가 그 스코프에 대해 지역(local)이 되고 외부 스코프에서 비슷한 이름의 변수를 "
"가리기 때문입니다. foo의 마지막 문장은 ``x``\\에 새 값을 대입하므로, 컴파일러는 이 값을 지역 변수로 인식합니다. "
"결과적으로 앞의 ``print(x)``\\가 초기화되지 않은 지역 변수를 인쇄하려고 할 때 에러가 발생합니다."
#: ../Doc/faq/programming.rst:146
msgid ""
"In the example above you can access the outer scope variable by declaring"
" it global:"
msgstr "위의 예에서 변수를 전역(global)으로 선언하여 외부 스코프 변수에 액세스 할 수 있습니다:"
#: ../Doc/faq/programming.rst:157
msgid ""
"This explicit declaration is required in order to remind you that (unlike"
" the superficially analogous situation with class and instance variables)"
" you are actually modifying the value of the variable in the outer scope:"
msgstr ""
"이 명시적 선언은 (클래스와 인스턴스 변수의 표면적으로 유사한 상황과 달리) 실제로 외부 스코프에 있는 변수의 값을 수정하고 있음을"
" 상기시키기 위해 필요합니다:"
#: ../Doc/faq/programming.rst:164
msgid ""
"You can do a similar thing in a nested scope using the "
":keyword:`nonlocal` keyword:"
msgstr ":keyword:`nonlocal` 키워드를 사용하여 중첩된 스코프에서 비슷한 일을 할 수 있습니다:"
#: ../Doc/faq/programming.rst:181
msgid "What are the rules for local and global variables in Python?"
msgstr "파이썬에서 지역과 전역 변수에 대한 규칙은 무엇입니까?"
#: ../Doc/faq/programming.rst:183
msgid ""
"In Python, variables that are only referenced inside a function are "
"implicitly global. If a variable is assigned a value anywhere within the"
" function's body, it's assumed to be a local unless explicitly declared "
"as global."
msgstr ""
"파이썬에서, 함수 내에서 참조되기만 하는 변수는 묵시적으로 전역입니다. 변수가 함수 본문 내 어디에서건 값을 대입하면, 명시적으로 "
"전역으로 선언되지 않는 한 지역으로 간주합니다."
#: ../Doc/faq/programming.rst:187
msgid ""
"Though a bit surprising at first, a moment's consideration explains this."
" On one hand, requiring :keyword:`global` for assigned variables "
"provides a bar against unintended side-effects. On the other hand, if "
"``global`` was required for all global references, you'd be using "
"``global`` all the time. You'd have to declare as global every reference"
" to a built-in function or to a component of an imported module. This "
"clutter would defeat the usefulness of the ``global`` declaration for "
"identifying side-effects."
msgstr ""
"처음에는 조금 의외지만, 잠시 생각해보면 이해가 됩니다. 한편으로, 대입된 변수에 :keyword:`global`\\을 요구하면 "
"의도하지 않은 부작용에 대한 저지선을 제공합니다. 반면에, 모든 전역 참조에 ``global``\\이 요구된다면, 항상 "
"``global``\\을 사용하게 됩니다. 내장 함수나 임포트 한 모듈의 구성 요소에 대한 모든 참조를 전역으로 선언해야 합니다. "
"이 혼란은 부작용을 식별하기 위한 ``global`` 선언의 유용성을 무효로 합니다."
#: ../Doc/faq/programming.rst:197
msgid ""
"Why do lambdas defined in a loop with different values all return the "
"same result?"
msgstr "다른 값으로 루프에서 정의된 람다는 왜 모두 같은 결과를 반환합니까?"
#: ../Doc/faq/programming.rst:199
msgid ""
"Assume you use a for loop to define a few different lambdas (or even "
"plain functions), e.g.::"
msgstr "for 루프를 사용하여 몇 가지 다른 람다(또는 일반 함수조차)를 정의한다고 가정하십시오, 예를 들어::"
#: ../Doc/faq/programming.rst:206
msgid ""
"This gives you a list that contains 5 lambdas that calculate ``x**2``. "
"You might expect that, when called, they would return, respectively, "
"``0``, ``1``, ``4``, ``9``, and ``16``. However, when you actually try "
"you will see that they all return ``16``::"
msgstr ""
"이것은 ``x**2``\\를 계산하는 5개의 람다가 포함된 리스트를 제공합니다. 호출되면, 각각 ``0``, ``1``, "
"``4``, ``9`` 및 ``16``\\을 반환할 것으로 예상할 수 있습니다. 그러나, 실제로 시도하면 모두 ``16``\\을 "
"반환한다는 것을 알 수 있습니다::"
#: ../Doc/faq/programming.rst:216
msgid ""
"This happens because ``x`` is not local to the lambdas, but is defined in"
" the outer scope, and it is accessed when the lambda is called --- not "
"when it is defined. At the end of the loop, the value of ``x`` is ``4``,"
" so all the functions now return ``4**2``, i.e. ``16``. You can also "
"verify this by changing the value of ``x`` and see how the results of the"
" lambdas change::"
msgstr ""
"이는 ``x``\\가 람다에 지역(local)이 아니라 외부 스코프에 정의되어 있기 때문에 발생하며, 람다가 호출될 때 액세스 "
"됩니다 --- 정의될 때가 아닙니다. 루프의 끝에서, ``x``\\의 값은 ``4``\\이므로, 모든 함수는 이제 ``4**2``,"
" 즉 ``16``\\을 반환합니다. ``x``\\의 값을 변경하고 람다의 결과가 어떻게 변경되는지 봄으로써 이를 확인할 수도 "
"있습니다::"
#: ../Doc/faq/programming.rst:226
msgid ""
"In order to avoid this, you need to save the values in variables local to"
" the lambdas, so that they don't rely on the value of the global ``x``::"
msgstr "이를 피하려면, 람다에 대해 지역인 변수에 값을 저장하여, 전역 ``x``\\의 값에 의존하지 않도록 할 필요가 있습니다::"
#: ../Doc/faq/programming.rst:233
msgid ""
"Here, ``n=x`` creates a new variable ``n`` local to the lambda and "
"computed when the lambda is defined so that it has the same value that "
"``x`` had at that point in the loop. This means that the value of ``n`` "
"will be ``0`` in the first lambda, ``1`` in the second, ``2`` in the "
"third, and so on. Therefore each lambda will now return the correct "
"result::"
msgstr ""
"여기서 ``n=x``\\는 람다에 지역인 새 변수 ``n``\\을 만들고, 루프의 해당 시점에서 ``x`` 와 같은 값을 갖도록 "
"람다가 정의될 때 계산됩니다. 이는 ``n``\\의 값이 첫 번째 람다에서 ``0``, 두 번째에서 ``1``, 세 번째에서 "
"``2`` 등이 됨을 의미합니다. 따라서 각 람다는 이제 올바른 결과를 반환합니다::"
#: ../Doc/faq/programming.rst:244
msgid ""
"Note that this behaviour is not peculiar to lambdas, but applies to "
"regular functions too."
msgstr "이 동작은 람다에만 국한된 것이 아니라 일반 함수에도 적용됩니다."
#: ../Doc/faq/programming.rst:249
msgid "How do I share global variables across modules?"
msgstr "모듈 간에 전역 변수를 공유하려면 어떻게 해야 합니까?"
#: ../Doc/faq/programming.rst:251
msgid ""
"The canonical way to share information across modules within a single "
"program is to create a special module (often called config or cfg). Just"
" import the config module in all modules of your application; the module "
"then becomes available as a global name. Because there is only one "
"instance of each module, any changes made to the module object get "
"reflected everywhere. For example:"
msgstr ""
"단일 프로그램 내에서 모듈 간에 정보를 공유하는 규범적인 방법은 특별한 모듈(종종 config나 cfg라고 불립니다)을 만드는 "
"것입니다. 응용 프로그램의 모든 모듈에서 config 모듈을 임포트 하기만 하면 됩니다; 그러면 모듈이 전역 이름으로 사용 "
"가능해집니다. 각 모듈의 인스턴스는 오직 하나이기 때문에, 모듈 객체에 대한 변경 사항은 모든 곳에 반영됩니다. 예를 들면 다음과 "
"같습니다:"
#: ../Doc/faq/programming.rst:257
msgid "config.py::"
msgstr "config.py::"
#: ../Doc/faq/programming.rst:261
msgid "mod.py::"
msgstr "mod.py::"
#: ../Doc/faq/programming.rst:266
msgid "main.py::"
msgstr "main.py::"
#: ../Doc/faq/programming.rst:272
msgid ""
"Note that using a module is also the basis for implementing the Singleton"
" design pattern, for the same reason."
msgstr "같은 이유로, 모듈을 사용하는 것도 싱글톤 디자인 패턴 구현을 위한 기초입니다."
#: ../Doc/faq/programming.rst:277
msgid "What are the \"best practices\" for using import in a module?"
msgstr "모듈에서 임포트를 사용하는 \"모범 사례\"는 무엇입니까?"
#: ../Doc/faq/programming.rst:279
msgid ""
"In general, don't use ``from modulename import *``. Doing so clutters "
"the importer's namespace, and makes it much harder for linters to detect "
"undefined names."
msgstr ""
"일반적으로, ``from modulename import *``\\를 사용하지 마십시오. 그렇게 하면 임포트 하는 곳의 이름 공간이"
" 어수선해지고, 린터(linter)가 정의되지 않은 이름을 감지하기가 훨씬 어려워집니다."
#: ../Doc/faq/programming.rst:283
msgid ""
"Import modules at the top of a file. Doing so makes it clear what other "
"modules your code requires and avoids questions of whether the module "
"name is in scope. Using one import per line makes it easy to add and "
"delete module imports, but using multiple imports per line uses less "
"screen space."
msgstr ""
"파일 맨 위에서 모듈을 임포트 하십시오. 그렇게 하면 코드에 필요한 다른 모듈을 명확하게 하고 모듈 이름이 스코프에 있는지에 대한 "
"질문을 피할 수 있습니다. 한 줄에 하나의 임포트를 사용하면 모듈 임포트를 쉽게 추가하고 삭제할 수 있지만, 한 줄에 여러 임포트를"
" 사용하면 화면 공간을 덜 사용합니다."
#: ../Doc/faq/programming.rst:288
msgid "It's good practice if you import modules in the following order:"
msgstr "다음 순서로 모듈을 임포트 하는 것이 좋습니다:"
#: ../Doc/faq/programming.rst:290
msgid "standard library modules -- e.g. ``sys``, ``os``, ``getopt``, ``re``"
msgstr "표준 라이브러리 모듈 -- 예를 들어 ``sys``, ``os``, ``getopt``, ``re``"
#: ../Doc/faq/programming.rst:291
msgid ""
"third-party library modules (anything installed in Python's site-packages"
" directory) -- e.g. mx.DateTime, ZODB, PIL.Image, etc."
msgstr ""
"제삼자 라이브러리 모듈 (파이썬의 site-packages 디렉터리에 설치된 모든 것) -- 예를 들어 mx.DateTime, "
"ZODB, PIL.Image 등."
#: ../Doc/faq/programming.rst:293
msgid "locally-developed modules"
msgstr "내부에서 개발된 모듈"
#: ../Doc/faq/programming.rst:295
msgid ""
"It is sometimes necessary to move imports to a function or class to avoid"
" problems with circular imports. Gordon McMillan says:"
msgstr ""
"순환 임포트 관련 문제를 피하고자 임포트를 함수나 클래스로 이동해야 하는 경우가 있습니다. Gordon McMillan은 다음과 "
"같이 말했습니다:"
#: ../Doc/faq/programming.rst:298
msgid ""
"Circular imports are fine where both modules use the \"import <module>\" "
"form of import. They fail when the 2nd module wants to grab a name out "
"of the first (\"from module import name\") and the import is at the top "
"level. That's because names in the 1st are not yet available, because "
"the first module is busy importing the 2nd."
msgstr ""
"두 모듈 모두 \"import <module>\" 형식의 임포트를 사용하면 순환 임포트는 괜찮습니다. 두 번째 모듈이 첫 번째 "
"모듈의 이름(name)을 붙잡으려고 하고 (\"from module import name\") 임포트가 최상위 수준에 있으면 "
"실패합니다. 첫 번째 모듈이 두 번째 모듈을 임포트 하는 중이라서 첫 번째 모듈에 있는 이름을 아직 사용할 수 없기 때문입니다."
#: ../Doc/faq/programming.rst:304
msgid ""
"In this case, if the second module is only used in one function, then the"
" import can easily be moved into that function. By the time the import "
"is called, the first module will have finished initializing, and the "
"second module can do its import."
msgstr ""
"이 경우, 두 번째 모듈이 하나의 함수에서만 사용된다면, 임포트를 해당 함수로 쉽게 이동할 수 있습니다. 임포트가 호출될 때, 첫 "
"번째 모듈의 초기화가 완료되었고, 두 번째 모듈은 임포트를 수행할 수 있습니다."
#: ../Doc/faq/programming.rst:309
msgid ""
"It may also be necessary to move imports out of the top level of code if "
"some of the modules are platform-specific. In that case, it may not even"
" be possible to import all of the modules at the top of the file. In "
"this case, importing the correct modules in the corresponding platform-"
"specific code is a good option."
msgstr ""
"일부 모듈이 플랫폼 특정이면 임포트를 코드의 최상위 수준에서 다른 곳으로 이동해야 할 수도 있습니다. 이 경우, 파일 맨 위에서 "
"모든 모듈을 임포트 하는 것이 가능하지 않을 수도 있습니다. 이 경우, 해당 플랫폼 특정 코드에서 올바른 모듈을 임포트 하는 것이 "
"좋은 선택입니다."
#: ../Doc/faq/programming.rst:314
msgid ""
"Only move imports into a local scope, such as inside a function "
"definition, if it's necessary to solve a problem such as avoiding a "
"circular import or are trying to reduce the initialization time of a "
"module. This technique is especially helpful if many of the imports are "
"unnecessary depending on how the program executes. You may also want to "
"move imports into a function if the modules are only ever used in that "
"function. Note that loading a module the first time may be expensive "
"because of the one time initialization of the module, but loading a "
"module multiple times is virtually free, costing only a couple of "
"dictionary lookups. Even if the module name has gone out of scope, the "
"module is probably available in :data:`sys.modules`."
msgstr ""
"순환 임포트를 피하거나 모듈의 초기화 시간을 줄이려는 등의 문제를 해결하는 데 필요할 때만, 함수 정의 내부와 같은 지역 스코프로 "
"임포트를 옮기십시오. 이 기법은 프로그램 실행 방법에 따라 많은 임포트가 필요하지 않을 때 특히 유용합니다. 모듈이 해당 함수에서만"
" 사용될 때 임포트를 함수로 옮기고 싶을 수도 있습니다. 모듈의 일회성 초기화 때문에 모듈을 처음 로드하는 데 비용이 많이들 수 "
"있지만, 모듈을 여러 번 로드하는 것은 사실상 무료임에 유의하십시오, 두 번의 딕셔너리 조회만 발생합니다. 모듈 이름이 스코프를 "
"벗어난 경우에도, 모듈은 아마도 :data:`sys.modules`\\에 있을 겁니다."
#: ../Doc/faq/programming.rst:327
msgid "Why are default values shared between objects?"
msgstr "객체 간에 기본값이 공유되는 이유는 무엇입니까?"
#: ../Doc/faq/programming.rst:329
msgid ""
"This type of bug commonly bites neophyte programmers. Consider this "
"function::"
msgstr "이 유형의 버그는 흔히 신참 프로그래머들을 깨뭅니다. 이 함수를 생각해보십시오::"
#: ../Doc/faq/programming.rst:336
msgid ""
"The first time you call this function, ``mydict`` contains a single item."
" The second time, ``mydict`` contains two items because when ``foo()`` "
"begins executing, ``mydict`` starts out with an item already in it."
msgstr ""
"이 함수를 처음 호출하면, ``mydict``\\에 단일 항목이 포함됩니다. 두 번째는, ``foo()``\\가 실행되기 시작할 "
"때, ``mydict``\\가 이미 항목에 들어 있는 상태로 시작하기 때문에, ``mydict``\\가 두 개의 항목을 포함합니다."
#: ../Doc/faq/programming.rst:340
msgid ""
"It is often expected that a function call creates new objects for default"
" values. This is not what happens. Default values are created exactly "
"once, when the function is defined. If that object is changed, like the "
"dictionary in this example, subsequent calls to the function will refer "
"to this changed object."
msgstr ""
"종종 함수 호출이 기본값으로 새 객체를 만들 것으로 기대합니다. 그렇게 되지 않습니다. 함수가 정의될 때, 기본값은 정확히 한 번 "
"만들어집니다. 이 예제의 딕셔너리와 같이, 해당 객체가 변경되면, 함수에 대한 후속 호출은 이 변경된 객체를 참조합니다."
#: ../Doc/faq/programming.rst:345
msgid ""
"By definition, immutable objects such as numbers, strings, tuples, and "
"``None``, are safe from change. Changes to mutable objects such as "
"dictionaries, lists, and class instances can lead to confusion."
msgstr ""
"정의에 따라, 숫자, 문자열, 튜플 및 ``None``\\과 같은 불변 객체는 변경에 안전합니다. 딕셔너리, 리스트 및 클래스 "
"인스턴스와 같은 가변 객체를 변경하면 혼란스러울 수 있습니다."
#: ../Doc/faq/programming.rst:349
msgid ""
"Because of this feature, it is good programming practice to not use "
"mutable objects as default values. Instead, use ``None`` as the default "
"value and inside the function, check if the parameter is ``None`` and "
"create a new list/dictionary/whatever if it is. For example, don't "
"write::"
msgstr ""
"이 기능으로 인해, 가변 객체를 기본값으로 사용하지 않는 것이 좋습니다. 대신, ``None``\\을 기본값으로 사용하고 함수 "
"내부에서 매개변수가 ``None``\\인지 확인한 다음 새 리스트/딕셔너리/무엇이든 새로 만드십시오. 예를 들어, 다음과 같이 쓰지"
" 마십시오::"
#: ../Doc/faq/programming.rst:357
msgid "but::"
msgstr "대신 이렇게 쓰십시오::"
#: ../Doc/faq/programming.rst:363
msgid ""
"This feature can be useful. When you have a function that's time-"
"consuming to compute, a common technique is to cache the parameters and "
"the resulting value of each call to the function, and return the cached "
"value if the same value is requested again. This is called "
"\"memoizing\", and can be implemented like this::"
msgstr ""
"이 기능은 유용할 수 있습니다. 계산하는 데 시간이 걸리는 함수가 있을 때, 일반적인 기법은 각 함수 호출의 매개변수와 결괏값을 "
"캐시하고, 같은 값이 다시 요청되면 캐시 된 값을 반환하는 것입니다. 이것을 \"memoizing\" 이라고 하며, 다음과 같이 "
"구현할 수 있습니다::"
#: ../Doc/faq/programming.rst:378
msgid ""
"You could use a global variable containing a dictionary instead of the "
"default value; it's a matter of taste."
msgstr "기본값 대신 딕셔너리를 포함하는 전역 변수를 사용할 수 있습니다; 취향의 문제입니다."
#: ../Doc/faq/programming.rst:383
msgid ""
"How can I pass optional or keyword parameters from one function to "
"another?"
msgstr "한 함수에서 다른 함수로 선택적이나 키워드 매개변수를 전달하려면 어떻게 해야 합니까?"
#: ../Doc/faq/programming.rst:385
msgid ""
"Collect the arguments using the ``*`` and ``**`` specifiers in the "
"function's parameter list; this gives you the positional arguments as a "
"tuple and the keyword arguments as a dictionary. You can then pass these"
" arguments when calling another function by using ``*`` and ``**``::"
msgstr ""
"함수의 매개변수 목록에 ``*``\\와 ``**`` 지정자를 사용하여 인자를 수집하십시오; 이것은 위치 인자를 튜플로, 키워드 "
"인자를 딕셔너리로 제공합니다. 그런 다음 ``*``\\와 ``**``\\를 사용하여 다른 함수를 호출할 때 이러한 인자를 전달할 수"
" 있습니다::"
#: ../Doc/faq/programming.rst:404
msgid "What is the difference between arguments and parameters?"
msgstr "인자와 매개변수의 차이점은 무엇입니까?"
#: ../Doc/faq/programming.rst:406
msgid ""
":term:`Parameters <parameter>` are defined by the names that appear in a "
"function definition, whereas :term:`arguments <argument>` are the values "
"actually passed to a function when calling it. Parameters define what "
"types of arguments a function can accept. For example, given the "
"function definition::"
msgstr ""
":term:`매개변수 <parameter>`\\는 함수 정의에 나타나는 이름으로 정의되는 반면, :term:`인자 "
"<argument>`\\는 함수를 호출할 때 실제로 함수에 전달되는 값입니다. 매개변수는 함수가 받아들일 수 있는 인자 형을 "
"정의합니다. 예를 들어, 다음과 같은 함수 정의가 주어졌을 때::"
#: ../Doc/faq/programming.rst:414
msgid ""
"*foo*, *bar* and *kwargs* are parameters of ``func``. However, when "
"calling ``func``, for example::"
msgstr ""
"*foo*, *bar* 및 *kwargs*\\는 ``func``\\의 매개변수입니다. 그러나, ``func``\\를 호출할 때, "
"예를 들면::"
#: ../Doc/faq/programming.rst:419
msgid "the values ``42``, ``314``, and ``somevar`` are arguments."
msgstr "``42``, ``314`` 및 ``somevar`` 값은 인자입니다."
#: ../Doc/faq/programming.rst:423
msgid "Why did changing list 'y' also change list 'x'?"
msgstr "리스트 'y'를 변경할 때 리스트 'x'도 변경되는 이유는 무엇입니까?"
#: ../Doc/faq/programming.rst:425
msgid "If you wrote code like::"
msgstr "다음과 같은 코드를 작성하면::"
#: ../Doc/faq/programming.rst:435
msgid ""
"you might be wondering why appending an element to ``y`` changed ``x`` "
"too."
msgstr "``y``\\에 요소를 추가하면 ``x``\\도 변경되는 이유가 궁금할 것입니다."
#: ../Doc/faq/programming.rst:437
msgid "There are two factors that produce this result:"
msgstr "이 결과를 만드는 두 가지 요소가 있습니다:"
#: ../Doc/faq/programming.rst:439
msgid ""
"Variables are simply names that refer to objects. Doing ``y = x`` "
"doesn't create a copy of the list -- it creates a new variable ``y`` that"
" refers to the same object ``x`` refers to. This means that there is "
"only one object (the list), and both ``x`` and ``y`` refer to it."
msgstr ""
"변수는 단순히 객체를 가리키는 이름입니다. ``y = x``\\를 수행하면 리스트의 사본을 만들지 않습니다 -- ``x``\\가 "
"참조하는 것과 같은 객체를 참조하는 새 변수 ``y``\\를 만듭니다. 이는 하나의 객체(리스트)만 있고, ``x`` 와 ``y``"
" 모두 그 객체를 참조함을 의미합니다."
#: ../Doc/faq/programming.rst:443
msgid "Lists are :term:`mutable`, which means that you can change their content."
msgstr "리스트는 :term:`가변 <mutable>`\\입니다, 내용을 변경할 수 있다는 뜻입니다."
#: ../Doc/faq/programming.rst:445
msgid ""
"After the call to :meth:`~list.append`, the content of the mutable object"
" has changed from ``[]`` to ``[10]``. Since both the variables refer to "
"the same object, using either name accesses the modified value ``[10]``."
msgstr ""
":meth:`~list.append`\\를 호출한 후, 가변 객체의 내용이 ``[]``\\에서 ``[10]`` 으로 변경되었습니다."
" 두 변수가 모두 동일한 객체를 참조하기 때문에, 두 이름 중 어느 것을 사용하더라도 수정된 값 ``[10]`` 에 액세스합니다."
#: ../Doc/faq/programming.rst:449
msgid "If we instead assign an immutable object to ``x``::"
msgstr "대신 불변 객체를 ``x``\\에 대입하면::"
#: ../Doc/faq/programming.rst:459
msgid ""
"we can see that in this case ``x`` and ``y`` are not equal anymore. This"
" is because integers are :term:`immutable`, and when we do ``x = x + 1`` "
"we are not mutating the int ``5`` by incrementing its value; instead, we "
"are creating a new object (the int ``6``) and assigning it to ``x`` (that"
" is, changing which object ``x`` refers to). After this assignment we "
"have two objects (the ints ``6`` and ``5``) and two variables that refer "
"to them (``x`` now refers to ``6`` but ``y`` still refers to ``5``)."
msgstr ""
"이 경우 ``x`` 와 ``y``\\가 더는 같지 않다는 것을 알 수 있습니다. 이는 정수가 :term:`불변 "
"<immutable>`\\이기 때문이고, ``x = x + 1``\\을 수행할 때 값을 증가시켜서 정수 ``5``\\를 변경하는 "
"것이 아닙니다; 대신 새 객체(정수 ``6``)를 만들어 ``x``\\에 대입합니다 (즉, ``x``\\가 참조하는 객체를 "
"바꿉니다). 이 대입 후에는 두 개의 객체(정수 ``6``\\과 ``5``)와 이를 참조하는 두 개의 변수를 갖게 됩니다 "
"(``x``\\는 이제 ``6``\\을 참조하지만, ``y``\\는 여전히 ``5``\\를 참조합니다)."
#: ../Doc/faq/programming.rst:467
msgid ""
"Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate "
"the object, whereas superficially similar operations (for example ``y = y"
" + [10]`` and ``sorted(y)``) create a new object. In general in Python "
"(and in all cases in the standard library) a method that mutates an "
"object will return ``None`` to help avoid getting the two types of "
"operations confused. So if you mistakenly write ``y.sort()`` thinking it"
" will give you a sorted copy of ``y``, you'll instead end up with "
"``None``, which will likely cause your program to generate an easily "
"diagnosed error."
msgstr ""
"일부 연산(예를 들어 ``y.append(10)``\\과 ``y.sort()``)은 객체를 변경하지만, 표면적으로 유사한 연산(예를"
" 들어 ``y = y + [10]`` 과 ``sorted(y)``)은 새 객체를 만듭니다. 일반적으로 파이썬에서 (그리고 표준 "
"라이브러리의 모든 경우에서) 객체를 변경하는 메서드는 ``None``\\을 반환하여 두 가지 유형의 연산이 혼동되지 않도록 합니다."
" 따라서 실수로 ``y.sort()``\\라고 작성하고 ``y``\\의 정렬된 사본을 얻을 수 있다고 생각하면, 대신 "
"``None``\\을 얻어서 프로그램에서 쉽게 진단되는 에러가 발생하도록 합니다."
#: ../Doc/faq/programming.rst:476
msgid ""
"However, there is one class of operations where the same operation "
"sometimes has different behaviors with different types: the augmented "
"assignment operators. For example, ``+=`` mutates lists but not tuples "
"or ints (``a_list += [1, 2, 3]`` is equivalent to ``a_list.extend([1, 2, "
"3])`` and mutates ``a_list``, whereas ``some_tuple += (1, 2, 3)`` and "
"``some_int += 1`` create new objects)."
msgstr ""
"그러나, 같은 연산이 때때로 형에 따라 다른 동작을 갖는 한 가지 연산 클래스가 있습니다: 증분 대입 연산자. 예를 들어, "
"``+=``\\는 리스트를 변경하지만, 튜플이나 정수는 변경하지 않습니다 (``a_list += [1, 2, 3]``\\은 "
"``a_list.extend([1, 2, 3])``\\과 동등하고 ``a_list``\\를 변경하지만, ``some_tuple "
"+= (1, 2, 3)``\\과 ``some_int += 1``\\은 새 객체를 만듭니다)."
#: ../Doc/faq/programming.rst:483
msgid "In other words:"
msgstr "달리 표현하면:"
#: ../Doc/faq/programming.rst:485
msgid ""
"If we have a mutable object (:class:`list`, :class:`dict`, :class:`set`, "
"etc.), we can use some specific operations to mutate it and all the "
"variables that refer to it will see the change."
msgstr ""
"가변 객체(:class:`list`, :class:`dict`, :class:`set` 등)가 있으면, 일부 특정 연산을 사용하여 "
"객체를 변경하면 해당 객체를 참조하는 모든 변수가 변경을 보게 됩니다."
#: ../Doc/faq/programming.rst:488
msgid ""
"If we have an immutable object (:class:`str`, :class:`int`, "
":class:`tuple`, etc.), all the variables that refer to it will always see"
" the same value, but operations that transform that value into a new "
"value always return a new object."
msgstr ""
"불변 객체(:class:`str`, :class:`int`, :class:`tuple` 등)가 있으면, 이를 참조하는 모든 변수는 "
"항상 같은 값을 보게 되지만, 해당 값을 새로운 값으로 변환하는 연산은 항상 새로운 객체를 반환합니다."
#: ../Doc/faq/programming.rst:493
msgid ""
"If you want to know if two variables refer to the same object or not, you"
" can use the :keyword:`is` operator, or the built-in function :func:`id`."
msgstr ""
"두 변수가 같은 객체를 참조하는지를 알고 싶다면, :keyword:`is` 연산자나 내장 함수 :func:`id`\\를 사용할 수 "
"있습니다."
#: ../Doc/faq/programming.rst:498
msgid "How do I write a function with output parameters (call by reference)?"
msgstr "출력 매개변수가 있는 함수를 작성하려면 어떻게 해야 합니까 (참조에 의한 호출)?"
#: ../Doc/faq/programming.rst:500
msgid ""
"Remember that arguments are passed by assignment in Python. Since "
"assignment just creates references to objects, there's no alias between "
"an argument name in the caller and callee, and so no call-by-reference "
"per se. You can achieve the desired effect in a number of ways."
msgstr ""
"파이썬에서 인자는 대입으로 전달됨을 기억하십시오. 대입은 단지 객체에 대한 참조를 만들기 때문에, 호출자와 피호출자의 인자 이름 "
"간에 에일리어스가 없고, 참조에 의한 호출도 없습니다. 여러 가지 방법으로 원하는 효과를 얻을 수 있습니다."
#: ../Doc/faq/programming.rst:505
msgid "By returning a tuple of the results::"
msgstr "결과의 튜플을 반환하여::"
#: ../Doc/faq/programming.rst:516
msgid "This is almost always the clearest solution."
msgstr "이것은 거의 항상 가장 명확한 해법입니다."
#: ../Doc/faq/programming.rst:518
msgid ""
"By using global variables. This isn't thread-safe, and is not "
"recommended."
msgstr "전역 변수를 사용하여. 이것은 스레드 안전하지 않고, 권장하지 않습니다."
#: ../Doc/faq/programming.rst:520
msgid "By passing a mutable (changeable in-place) object::"
msgstr "가변 (제자리에서 변경할 수 있는) 객체를 전달하여::"
#: ../Doc/faq/programming.rst:531
msgid "By passing in a dictionary that gets mutated::"
msgstr "변경되는 딕셔너리를 전달하여::"
#: ../Doc/faq/programming.rst:542
msgid "Or bundle up values in a class instance::"
msgstr "또는 클래스 인스턴스에 값을 묶어서::"
#: ../Doc/faq/programming.rst:559
msgid "There's almost never a good reason to get this complicated."
msgstr "이렇게 복잡하게 만들어야 할 좋은 이유는 거의 없습니다."
#: ../Doc/faq/programming.rst:561
msgid "Your best choice is to return a tuple containing the multiple results."
msgstr "최선의 선택은 여러 결과가 포함된 튜플을 반환하는 것입니다."
#: ../Doc/faq/programming.rst:565
msgid "How do you make a higher order function in Python?"
msgstr "파이썬에서 고차 함수(higher order function)를 어떻게 만드나요?"
#: ../Doc/faq/programming.rst:567
msgid ""
"You have two choices: you can use nested scopes or you can use callable "
"objects. For example, suppose you wanted to define ``linear(a,b)`` which "
"returns a function ``f(x)`` that computes the value ``a*x+b``. Using "
"nested scopes::"
msgstr ""
"두 가지 선택이 있습니다: 중첩된 스코프를 사용하거나 콜러블 객체를 사용할 수 있습니다. 예를 들어, 값 ``a*x+b``\\를 "
"계산하는 함수 ``f(x)``\\를 반환하는 ``linear(a,b)``\\를 정의하려고 한다고 가정하십시오. 중첩된 스코프를 "
"사용해서::"
#: ../Doc/faq/programming.rst:576
msgid "Or using a callable object::"
msgstr "또는 콜러블 객체를 사용해서::"
#: ../Doc/faq/programming.rst:586
msgid "In both cases, ::"
msgstr "두 경우 모두, ::"
#: ../Doc/faq/programming.rst:590
msgid "gives a callable object where ``taxes(10e6) == 0.3 * 10e6 + 2``."
msgstr "``taxes(10e6) == 0.3 * 10e6 + 2``\\가 되도록 하는 콜러블 객체를 제공합니다."
#: ../Doc/faq/programming.rst:592
msgid ""
"The callable object approach has the disadvantage that it is a bit slower"
" and results in slightly longer code. However, note that a collection of"
" callables can share their signature via inheritance::"
msgstr ""
"콜러블 객체 접근 방식은 약간 느리고 코드가 약간 길어진다는 단점이 있습니다. 그러나, 콜러블 컬렉션은 상속을 통해 서명을 공유할 "
"수 있습니다::"
#: ../Doc/faq/programming.rst:601
msgid "Object can encapsulate state for several methods::"
msgstr "객체는 여러 메서드의 상태를 캡슐화 할 수 있습니다::"
#: ../Doc/faq/programming.rst:619
msgid ""
"Here ``inc()``, ``dec()`` and ``reset()`` act like functions which share "
"the same counting variable."
msgstr "여기서 ``inc()``, ``dec()`` 및 ``reset()``\\은 같은 계수 변수를 공유하는 함수처럼 작동합니다."
#: ../Doc/faq/programming.rst:624
msgid "How do I copy an object in Python?"
msgstr "파이썬에서 객체를 어떻게 복사합니까?"
#: ../Doc/faq/programming.rst:626
msgid ""
"In general, try :func:`copy.copy` or :func:`copy.deepcopy` for the "
"general case. Not all objects can be copied, but most can."
msgstr ""
"일반적으로, 일반적일 때 :func:`copy.copy`\\나 :func:`copy.deepcopy`\\를 시도하십시오. 모든 "
"객체를 복사할 수는 없지만, 대부분 가능합니다."
#: ../Doc/faq/programming.rst:629
msgid ""
"Some objects can be copied more easily. Dictionaries have a "
":meth:`~dict.copy` method::"
msgstr "일부 객체는 더 쉽게 복사할 수 있습니다. 딕셔너리에는 :meth:`~dict.copy` 메서드가 있습니다::"
#: ../Doc/faq/programming.rst:634
msgid "Sequences can be copied by slicing::"
msgstr "시퀀스는 슬라이싱으로 복사할 수 있습니다::"
#: ../Doc/faq/programming.rst:640
msgid "How can I find the methods or attributes of an object?"
msgstr "객체의 메서드나 어트리뷰트를 어떻게 찾을 수 있습니까?"
#: ../Doc/faq/programming.rst:642
msgid ""
"For an instance x of a user-defined class, ``dir(x)`` returns an "
"alphabetized list of the names containing the instance attributes and "
"methods and attributes defined by its class."
msgstr ""
"사용자 정의 클래스의 인스턴스 x에 대해, ``dir(x)``\\는 인스턴스 어트리뷰트와 메서드 및 해당 클래스에 의해 정의된 "
"어트리뷰트를 포함하는 알파벳순의 이름 리스트를 반환합니다."
#: ../Doc/faq/programming.rst:648
msgid "How can my code discover the name of an object?"
msgstr "코드에서 객체 이름을 어떻게 찾을 수 있습니까?"
#: ../Doc/faq/programming.rst:650
msgid ""
"Generally speaking, it can't, because objects don't really have names. "
"Essentially, assignment always binds a name to a value; the same is true "
"of ``def`` and ``class`` statements, but in that case the value is a "
"callable. Consider the following code::"
msgstr ""
"일반적으로 말하자면, 객체에는 실제로 이름이 없기 때문에 그럴 수 없습니다. 기본적으로, 대입은 항상 이름을 값에 연결합니다; "
"``def``\\와 ``class`` 문의 경우도 마찬가지이지만, 이 경우 값은 콜러블입니다. 다음 코드를 고려하십시오::"
#: ../Doc/faq/programming.rst:666
msgid ""
"Arguably the class has a name: even though it is bound to two names and "
"invoked through the name B the created instance is still reported as an "
"instance of class A. However, it is impossible to say whether the "
"instance's name is a or b, since both names are bound to the same value."
msgstr ""
"분명히 클래스는 이름이 있습니다: 설사 이것이 두 가지 이름에 연결되어 있고 이름 B를 통해 호출되었더라도 만들어진 인스턴스는 "
"여전히 클래스 A의 인스턴스로 보고됩니다. 그러나, 두 이름이 같은 값에 연결되기 때문에, 인스턴스 이름이 a인지 b인지는 말할 수"
" 없습니다."
#: ../Doc/faq/programming.rst:671
msgid ""
"Generally speaking it should not be necessary for your code to \"know the"
" names\" of particular values. Unless you are deliberately writing "
"introspective programs, this is usually an indication that a change of "
"approach might be beneficial."
msgstr ""
"일반적으로 말해 코드가 특정 값의 \"이름을 알아야\" 할 필요는 없습니다. 의도적으로 내성적인(introspective) "
"프로그램을 작성하지 않는 한, 이는 일반적으로 접근 방식의 변경이 도움이 될 수 있다는 신호입니다."
#: ../Doc/faq/programming.rst:676
msgid ""
"In comp.lang.python, Fredrik Lundh once gave an excellent analogy in "
"answer to this question:"
msgstr "comp.lang.python에서, Fredrik Lundh는 언젠가 이 질문에 대해 훌륭한 비유를 했습니다:"
#: ../Doc/faq/programming.rst:679
msgid ""
"The same way as you get the name of that cat you found on your porch: the"
" cat (object) itself cannot tell you its name, and it doesn't really care"
" -- so the only way to find out what it's called is to ask all your "
"neighbours (namespaces) if it's their cat (object)..."
msgstr ""
"여러분이 현관에서 발견한 고양이의 이름을 얻는 것과 같은 방법: 고양이(객체) 자체는 여러분에게 자신의 이름을 말할 수 없고, 전혀"
" 신경 쓰지도 않습니다 -- 따라서 그것이 어떻게 불리는지 알아내는 유일한 방법은 여러분 이웃 모두(이름 공간)에게 자신의 "
"고양이(객체)인지 묻는 것입니다..."
#: ../Doc/faq/programming.rst:684
msgid ""
"....and don't be surprised if you'll find that it's known by many names, "
"or no name at all!"
msgstr ".... 여러 이름으로 알려져 있거나 전혀 이름이 없다는 것을 알게 되더라도 놀라지 마십시오!"
#: ../Doc/faq/programming.rst:689
msgid "What's up with the comma operator's precedence?"
msgstr "쉼표 연산자의 우선순위는 어떻게 되나요?"
#: ../Doc/faq/programming.rst:691
msgid "Comma is not an operator in Python. Consider this session::"
msgstr "쉼표는 파이썬에서 연산자가 아닙니다. 이 세션을 고려하십시오::"
#: ../Doc/faq/programming.rst:696
msgid ""
"Since the comma is not an operator, but a separator between expressions "
"the above is evaluated as if you had entered::"
msgstr "쉼표는 연산자가 아니라 표현식 사이의 구분자이기 때문에 위는 다음과 같이 입력한 것처럼 평가됩니다::"
#: ../Doc/faq/programming.rst:701
msgid "not::"
msgstr "다음과 같이 평가되지 않습니다::"
#: ../Doc/faq/programming.rst:705
msgid ""
"The same is true of the various assignment operators (``=``, ``+=`` etc)."
" They are not truly operators but syntactic delimiters in assignment "
"statements."
msgstr "다양한 대입 연산자(``=``, ``+=`` 등)도 마찬가지입니다. 이들은 실제로 연산자가 아니라 대입 문의 문법 구분자입니다."
#: ../Doc/faq/programming.rst:710
msgid "Is there an equivalent of C's \"?:\" ternary operator?"
msgstr "C의 \"?:\" 삼항 연산자와 동등한 것이 있습니까?"
#: ../Doc/faq/programming.rst:712
msgid "Yes, there is. The syntax is as follows::"
msgstr "예, 있습니다. 문법은 다음과 같습니다::"
#: ../Doc/faq/programming.rst:719
msgid ""
"Before this syntax was introduced in Python 2.5, a common idiom was to "
"use logical operators::"
msgstr "이 문법이 파이썬 2.5에서 소개되기 전에, 일반적인 관용구는 논리 연산자를 사용하는 것이었습니다::"
#: ../Doc/faq/programming.rst:724
msgid ""
"However, this idiom is unsafe, as it can give wrong results when "
"*on_true* has a false boolean value. Therefore, it is always better to "
"use the ``... if ... else ...`` form."
msgstr ""
"그러나, 이 관용구는 안전하지 않습니다. *on_true*\\가 거짓 불리언 값을 가질 때 잘못된 결과가 나올 수 있습니다. "
"따라서, 항상 ``... if ... else ...`` 형식을 사용하는 것이 좋습니다."
#: ../Doc/faq/programming.rst:730
msgid "Is it possible to write obfuscated one-liners in Python?"
msgstr "파이썬에서 난독화된 한 줄 코드를 작성할 수 있습니까?"
#: ../Doc/faq/programming.rst:732
msgid ""