-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathprogramming.po
More file actions
4951 lines (4443 loc) · 226 KB
/
programming.po
File metadata and controls
4951 lines (4443 loc) · 226 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-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-12-04 09:48+0200\n"
"PO-Revision-Date: 2025-05-05 22:13+0300\n"
"Last-Translator: Panagiotis Skias <panagiotis.skias@gmail.com>\n"
"Language-Team: PyGreece <organizers@pygreece.org>\n"
"Language: el\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.2\n"
#: faq/programming.rst:5
msgid "Programming FAQ"
msgstr "FAQ Προγραμματισμού"
#: faq/programming.rst:8
msgid "Contents"
msgstr "Περιεχόμενα"
#: faq/programming.rst:12
msgid "General Questions"
msgstr "Γενικές Ερωτήσεις"
#: faq/programming.rst:15
msgid ""
"Is there a source code level debugger with breakpoints, single-stepping, "
"etc.?"
msgstr ""
"Υπάρχει πρόγραμμα εντοπισμού σφαλμάτων σε επίπεδο πηγαίου κώδικα με σημεία "
"διακοπής , με ένα βήμα κλπ.;"
#: faq/programming.rst:58
msgid "Yes."
msgstr "Ναι."
#: 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 ""
"Πολλοί εντοπιστές σφαλμάτων για την Python περιγράφονται παρακάτω και η "
"ενσωματωμένη συνάρτηση :func:`breakpoint` σάς επιτρέπει να μεταβείτε σε "
"οποιοδήποτε από αυτά."
#: 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 module είναι ένα απλό αλλά επαρκές πρόγραμμα εντοπισμού σφαλμάτων σε "
"λειτουργία κονσόλας για την Python. Είναι μέρος της τυπικής βιβλιοθήκης "
"Python και είναι :mod:`documented in the Library Reference Manual <pdb>`. "
"Μπορείτε επίσης να γράψετε το δικό σας πρόγραμμα σφαλμάτων χρησιμοποιώντας "
"τον κώδικα για το pdb ως παράδειγμα."
#: faq/programming.rst:27
msgid ""
"The IDLE interactive development environment, which is part of the standard "
"Python distribution (normally available as `Tools/scripts/idle3 <https://"
"github.com/python/cpython/blob/main/Tools/scripts/idle3>`_), includes a "
"graphical debugger."
msgstr ""
"Το διαδραστικό περιβάλλον ανάπτυξης IDLE, το οποίο αποτελεί μέρος της "
"τυπικής διανομής Python (συνήθως διαθέσιμο ως `Tools/scripts/idle3 <https://"
"github.com/python/cpython/blob/main/Tools/scripts/idle3>`_), που "
"περιλαμβάνει ένα γραφικό πρόγραμμα εντοπισμού σφαλμάτων."
#: faq/programming.rst:32
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 "
"`pywin32 <https://github.com/mhammond/pywin32>`_ project and as a part of "
"the `ActivePython <https://www.activestate.com/products/python/>`_ "
"distribution."
msgstr ""
"Το PythonWin είναι ένα Python IDE που περιλαμβάνει ένα πρόγραμμα εντοπισμού "
"σφαλμάτων GUI που βασίζεται σε pdb. Το πρόγραμμα εντοπισμού σφαλμάτων "
"PythonWin χρωματίζει τα σημεία διακοπής και έχει αρκετά ωραία "
"χαρακτηριστικά, όπως τον εντοπισμό σφαλμάτων σε προγράμματα που δεν είναι "
"PythonWin. Το PythonWin είναι διαθέσιμο ως μέρος του `pywin32 <https://"
"github.com/mhammond/pywin32>`_ έργου και ως μέρος της διανομής `ActivePython "
"<https://www.activestate.com/products/python/>`_ ."
#: faq/programming.rst:39
msgid ""
"`Eric <https://eric-ide.python-projects.org/>`_ is an IDE built on PyQt and "
"the Scintilla editing component."
msgstr ""
"Το `Eric <https://eric-ide.python-projects.org/>`_ είναι ένα IDE που "
"βασίζεται στο PyQt και το component επεξεργασίας Scintilla."
#: faq/programming.rst:42
msgid ""
"`trepan3k <https://github.com/rocky/python3-trepan/>`_ is a gdb-like "
"debugger."
msgstr ""
"Το `trepan3k <https://github.com/rocky/python3-trepan/>`_ είναι ένα "
"πρόγραμμα εντοπισμού σφαλμάτων παρόμοιο με το gdb."
#: faq/programming.rst:44
msgid ""
"`Visual Studio Code <https://code.visualstudio.com/>`_ is an IDE with "
"debugging tools that integrates with version-control software."
msgstr ""
"Το `Visual Studio Code <https://code.visualstudio.com/>`_ είναι ένας IDE με "
"εργαλεία εντοπισμού σφαλμάτων που ενσωματώνεται με λογισμικό ελέγχου έκδοσης."
#: faq/programming.rst:47
msgid ""
"There are a number of commercial Python IDEs that include graphical "
"debuggers. They include:"
msgstr ""
"Υπάρχει ένας αριθμός εμπορικών Python IDEs που περιλαμβάνουν γραφικούς "
"εντοπισμούς σφαλμάτων. Αυτά περιλαμβάνουν:"
#: faq/programming.rst:50
msgid "`Wing IDE <https://wingware.com/>`_"
msgstr "`Wing IDE <https://wingware.com/>`_"
#: faq/programming.rst:51
msgid "`Komodo IDE <https://www.activestate.com/products/komodo-ide/>`_"
msgstr "`Komodo IDE <https://www.activestate.com/products/komodo-ide/>`_"
#: faq/programming.rst:52
msgid "`PyCharm <https://www.jetbrains.com/pycharm/>`_"
msgstr "`PyCharm <https://www.jetbrains.com/pycharm/>`_"
#: faq/programming.rst:56
msgid "Are there tools to help find bugs or perform static analysis?"
msgstr ""
"Υπάρχουν εργαλεία που βοηθούν στην εύρεση σφαλμάτων ή στην εκτέλεση στατικής "
"ανάλυσης;"
#: faq/programming.rst:60
msgid ""
"`Pylint <https://pylint.pycqa.org/en/latest/index.html>`_ and `Pyflakes "
"<https://github.com/PyCQA/pyflakes>`_ do basic checking that will help you "
"catch bugs sooner."
msgstr ""
"`Pylint <https://pylint.pycqa.org/en/latest/index.html>`_ και `Pyflakes "
"<https://github.com/PyCQA/pyflakes>`_ κάνουν βασικό έλεγχο που θα σας "
"βοηθήσει να εντοπίσετε τα σφάλματα νωρίτερα."
#: faq/programming.rst:64
msgid ""
"Static type checkers such as `Mypy <https://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 <https://mypy-lang.org/>`_, `Pyre <https://"
"pyre-check.org/>`_, και `Pytype <https://github.com/google/pytype>`_ μπορεί "
"να ελέγξει υποδείξεις τύπου στον πηγαίο κώδικα της Python."
#: faq/programming.rst:73
msgid "How can I create a stand-alone binary from a Python script?"
msgstr "Πως μπορώ να δημιουργήσω ένα stand-alone binary από ένα Python script;"
#: faq/programming.rst:75
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 ""
"Δεν χρειάζεστε την δυνατότητα μεταγλώττισης κώδικα Python σε C, εάν το μόνο "
"που θέλετε είναι ένα stand-alone πρόγραμμα που οι χρήστες μπορούν να "
"κατεβάσουν και να εκτελέσουν χωρίς να χρειάζεται να εγκαταστήσουν πρώτα την "
"διανομή της Python. Υπάρχει μια σειρά από εργαλεία που καθορίζουν το σύνολο "
"των modules που απαιτούνται από ένα πρόγραμμα και συνδέουν αυτά τα modules "
"μαζί με ένα δυαδικό αρχείο Python για να παραχθεί ένα μόνο εκτελέσιμο."
#: faq/programming.rst:81
msgid ""
"One is to use the freeze tool, which is included in the Python source tree "
"as `Tools/freeze <https://github.com/python/cpython/tree/main/Tools/"
"freeze>`_. It converts Python byte code to C arrays; with a C compiler you "
"can embed all your modules into a new program, which is then linked with the "
"standard Python modules."
msgstr ""
"Το ένα είναι να χρησιμοποιήσετε το εργαλείο παγώματος, το οποίο "
"περιλαμβάνεται στο δέντρο πηγαίου της Python ως `Tools/freeze <https://"
"github.com/python/cpython/tree/main/Tools/freeze>`_. Μετατρέπει δυαδικό "
"κώδικα Python σε C πίνακες∙ με έναν C μεταγλωττιστή μπορείτε να ενσωματώσετε "
"όλα τα modules σας σε ένα νέο πρόγραμμα, το οποίο στη συνέχεια συνδέεται με "
"τα τυπικά Python modules."
#: faq/programming.rst:87
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 ""
"Λειτουργεί σαρώνοντας τον πηγαίο κώδικα αναδρομικά για δηλώσεις εισαγωγής "
"(και στις δύο μορφές) και αναζητώντας τα modules στην τυπική διαδρομή Python "
"καθώς και στον κατάλογο προέλευσης (για ενσωματωμένα modules). Στην "
"συνέχεια γυρίζει τα bytecode για modules που είναι γραμμένες σε Python σε "
"κώδικα C (initializers πίνακα που μπορούν να μετατραπούν σε αντικείμενα "
"κώδικα χρησιμοποιώντας το marshal module) και δημιουργεί ένα προσαρμοσμένο "
"αρχείο διαμόρφωσης που περιέχει μόνο εκείνα τα ενσωματωμένα modules που "
"χρησιμοποιούνται πραγματικά στο πρόγραμμα και το συνδέει με τον υπόλοιπο "
"διερμηνέα Python για να σχηματίσει ένα αυτόνομο δυαδικό αρχείο που "
"λειτουργεί ακριβώς όπως το σενάριο σας."
#: faq/programming.rst:96
msgid ""
"The following packages can help with the creation of console and GUI "
"executables:"
msgstr ""
"Τα παρακάτω πακέτα μπορούν να σας βοηθήσουν για την δημιουργία εκτελέσιμων "
"κονσόλας και GUI:"
#: faq/programming.rst:99
msgid "`Nuitka <https://nuitka.net/>`_ (Cross-platform)"
msgstr "`Nuitka <https://nuitka.net/>`_ (Cross-platform)"
#: faq/programming.rst:100
msgid "`PyInstaller <https://pyinstaller.org/>`_ (Cross-platform)"
msgstr "`PyInstaller <https://pyinstaller.org/>`_ (Cross-platform)"
#: faq/programming.rst:101
msgid ""
"`PyOxidizer <https://pyoxidizer.readthedocs.io/en/stable/>`_ (Cross-platform)"
msgstr ""
"`PyOxidizer <https://pyoxidizer.readthedocs.io/en/stable/>`_ (Cross-platform)"
#: faq/programming.rst:102
msgid ""
"`cx_Freeze <https://marcelotduarte.github.io/cx_Freeze/>`_ (Cross-platform)"
msgstr ""
"`cx_Freeze <https://marcelotduarte.github.io/cx_Freeze/>`_ (Cross-platform)"
#: faq/programming.rst:103
msgid "`py2app <https://github.com/ronaldoussoren/py2app>`_ (macOS only)"
msgstr "`py2app <https://github.com/ronaldoussoren/py2app>`_ (macOS μόνο)"
#: faq/programming.rst:104
msgid "`py2exe <https://www.py2exe.org/>`_ (Windows only)"
msgstr "`py2exe <https://www.py2exe.org/>`_ (Windows μόνο)"
#: faq/programming.rst:107
msgid "Are there coding standards or a style guide for Python programs?"
msgstr "Υπάρχουν πρότυπα κωδικοποίησης ή οδηγός στυλ για προγράμματα Python;"
#: faq/programming.rst:109
msgid ""
"Yes. The coding style required for standard library modules is documented "
"as :pep:`8`."
msgstr ""
"Ναι. Το στυλ κωδικοποίησης που απαιτείται για τα τυπικά modules βιβλιοθήκης "
"τεκμηριώνεται ως :pep:`8`."
#: faq/programming.rst:114
msgid "Core Language"
msgstr "Βασική Γλώσσα"
#: faq/programming.rst:119
msgid "Why am I getting an UnboundLocalError when the variable has a value?"
msgstr "Γιατί λαμβάνω ένα UnboundLocalError όταν η μεταβλητή έχει μια τιμή;"
#: faq/programming.rst:121
msgid ""
"It can be a surprise to get the :exc:`UnboundLocalError` in previously "
"working code when it is modified by adding an assignment statement somewhere "
"in the body of a function."
msgstr ""
"Μπορεί να είναι έκπληξη να λάβετε το :exc:`UnboundLocalError` σε κώδικα που "
"λειτουργούσε προηγουμένως όταν τροποποιείται προσθέτοντας μια δήλωση "
"εκχώρησης κάπου στο σώμα μιας συνάρτησης."
#: faq/programming.rst:125
msgid "This code:"
msgstr "Αυτό ο κώδικας:"
#: faq/programming.rst:134
msgid "works, but this code:"
msgstr "δουλεύει, αλλά αυτός ο κώδικας:"
#: faq/programming.rst:141
msgid "results in an :exc:`!UnboundLocalError`:"
msgstr "καταλήγει σε ένα :exc:`!UnboundLocalError`:"
#: faq/programming.rst:148
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 ""
"Αυτό συμβαίνει επειδή όταν κάνετε μια ανάθεση σε μια μεταβλητή σε ένα εύρος, "
"αυτή η μεταβλητή γίνεται τοπική σε αυτό το εύρος και σκιάζει οποιαδήποτε "
"μεταβλητή με παρόμοιο όνομα στο εξωτερικό εύρος. Εφόσον η τελευταία πρόταση "
"στο foo εκχωρεί μια νέα τιμή στο ``x``, ο μεταγλωττιστής την αναγνωρίζει ως "
"τοπική μεταβλητή. Κατά συνέπεια όταν η προηγούμενη ``print(x)`` επιχειρεί να "
"εκτυπώσει την uninitialized τοπική μεταβλητή και προκύπτει σφάλμα."
#: faq/programming.rst:155
msgid ""
"In the example above you can access the outer scope variable by declaring it "
"global:"
msgstr ""
"Στο παραπάνω παράδειγμα, μπορείτε να αποκτήσετε πρόσβαση στη μεταβλητή "
"εξωτερικού εύρους δηλώνοντας την ως καθολική::"
#: faq/programming.rst:167
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 ""
"Αυτή η ρητή δήλωση απαιτείται για να σας υπενθυμίσει ότι (σε αντίθεση με την "
"επιφανειακά ανάλογη κατάσταση με τις μεταβλητές κλάσης και στιγμιότυπου) "
"στην πραγματικότητα τροποποιείτε την τιμή της μεταβλητής στο εξωτερικό "
"πεδίο::"
#: faq/programming.rst:174
msgid ""
"You can do a similar thing in a nested scope using the :keyword:`nonlocal` "
"keyword:"
msgstr ""
"Μπορείτε να κάνετε κάτι παρόμοιο σε ένα ένθετο πεδίο χρησιμοποιώντας τη λέξη "
"κλειδί :keyword:`nonlocal`:"
#: faq/programming.rst:192
msgid "What are the rules for local and global variables in Python?"
msgstr ""
"Ποιοι είναι οι κανόνες για τις τοπικές και τις καθολικές μεταβλητές στην "
"Python;"
#: faq/programming.rst:194
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 ""
"Στην Python, οι μεταβλητές που αναφέρονται μόνο μέσα σε μια συνάρτηση είναι "
"έμμεσα καθολικές. Εάν σε μια μεταβλητή εκχωρηθεί μια τιμή οπουδήποτε μέσα "
"στο σώμα της συνάρτησης, θεωρείται ότι είναι τοπική, εκτός αν δηλωθεί ρητά "
"ως καθολική."
#: faq/programming.rst:198
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`` "
"όλη την ώρα. Θα έπρεπε να δηλώσετε ως καθολική κάθε αναφορά σε μια "
"ενσωματωμένη λειτουργία ή σε ένα στοιχείο ενός εισαγόμενου module. Αυτή η "
"ακαταστασία θα νικήσει την χρησιμότητα της δήλωσης ``global`` για τον "
"εντοπισμό παρενεργειών."
#: faq/programming.rst:208
msgid ""
"Why do lambdas defined in a loop with different values all return the same "
"result?"
msgstr ""
"Γιατί τα lambdas που ορίζονται σε έναν βρόχο με διαφορετικές τιμές "
"επιστρέφουν όλα το ίδιο αποτέλεσμα;"
#: faq/programming.rst:210
msgid ""
"Assume you use a for loop to define a few different lambdas (or even plain "
"functions), e.g.::"
msgstr ""
"Ας υποθέσουμε ότι χρησιμοποιείτε έναν βρόχο for για να ορίσετε μερικά "
"διαφορετικά lambdas (ή ακόμα και απλές συναρτήσεις), π.χ.::"
#: faq/programming.rst:213
msgid ""
">>> squares = []\n"
">>> for x in range(5):\n"
"... squares.append(lambda: x**2)"
msgstr ""
">>> squares = []\n"
">>> for x in range(5):\n"
"... squares.append(lambda: x**2)"
#: faq/programming.rst:217
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 ""
"Αυτό σας δίνει μια λίστα που περιέχει 5 lambdas που υπολογίζουν το "
"``x**2``. Μπορεί να περιμένετε ότι, όταν καλέσετε, θα επέστρεφαν, "
"αντίστοιχα, ``0``, ``1``, ``4``, ``9`` και ``16``. Ωστόσο, όταν δοκιμάσετε "
"πραγματικά θα δείτε ότι όλα επιστρέφουν ``16``::"
#: faq/programming.rst:222
msgid ""
">>> squares[2]()\n"
"16\n"
">>> squares[4]()\n"
"16"
msgstr ""
">>> squares[2]()\n"
"16\n"
">>> squares[4]()\n"
"16"
#: faq/programming.rst:227
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`` δεν είναι τοπικό για τα lambdas, αλλά "
"ορίζεται στο εξωτερικό εύρος και είναι προσβάσιμο όταν το lambda καλείται "
"--- όχι όταν ορίζεται. Στο τέλος του βρόχου, η τιμή του ``x`` είναι ``4``, "
"επομένως όλες οι συναρτήσεις επιστρέφουν τώρα ``4**2``, δηλαδή ``16``. "
"Μπορείτε επίσης να το επαληθεύσετε αλλάζοντας την τιμή του ``x`` και δείτε "
"πως αλλάζουν τα αποτελέσματα του lambda::"
#: faq/programming.rst:233
msgid ""
">>> x = 8\n"
">>> squares[2]()\n"
"64"
msgstr ""
">>> x = 8\n"
">>> squares[2]()\n"
"64"
#: faq/programming.rst:237
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 ""
"Για να το αποφύγετε αυτό, πρέπει να αποθηκεύσετε τις τιμές σε μεταβλητές "
"τοπικές στο lambda, έτσι ώστε να μην βασίζονται στην τιμή του καθολικού "
"``x``::"
#: faq/programming.rst:240
msgid ""
">>> squares = []\n"
">>> for x in range(5):\n"
"... squares.append(lambda n=x: n**2)"
msgstr ""
">>> squares = []\n"
">>> for x in range(5):\n"
"... squares.append(lambda n=x: n**2)"
#: faq/programming.rst:244
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`` τοπική στο lambda και "
"υπολογίζεται όταν το lambda ορίζεται έτσι ώστε να έχει την ίδια τιμή που "
"είχε το ``x`` σε εκείνο το σημείο βρόχου. Αυτό σημαίνει ότι η τιμή του ``n`` "
"θα είναι ``0`` στο πρώτο lambda, ``1`` στο δεύτερο , ``2`` στο τρίτο και "
"ούτω καθεξής. Επομένως κάθε lambda θα επιστρέψει τώρα το σωστό αποτέλεσμα::"
#: faq/programming.rst:250
msgid ""
">>> squares[2]()\n"
"4\n"
">>> squares[4]()\n"
"16"
msgstr ""
">>> squares[2]()\n"
"4\n"
">>> squares[4]()\n"
"16"
#: faq/programming.rst:255
msgid ""
"Note that this behaviour is not peculiar to lambdas, but applies to regular "
"functions too."
msgstr ""
"Σημειώστε ότι αυτή η συμπεριφορά δεν είναι ιδιόμορφη για το lambdas, αλλά "
"ισχύει και για κανονικές λειτουργίες."
#: faq/programming.rst:260
msgid "How do I share global variables across modules?"
msgstr "Πως μοιράζομαι καθολικές μεταβλητές σε modules;"
#: faq/programming.rst:262
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 ""
"Ο κανονικός τρόπος για να μοιράζεστε πληροφορίες μεταξύ των λειτουργικών "
"μονάδων μέσα σε ένα μόνο πρόγραμμα είναι η δημιουργία ενός ειδικού module "
"(συχνά ονομάζεται config ή cfg). Απλώς εισαγάγετε το module διαμόρφωσης σε "
"όλες τα modules της εφαρμογής σας∙ το module στην συνέχεια γίνεται διαθέσιμο "
"ως παγκόσμιο όνομα. Επειδή υπάρχει μόνο ένα παράδειγμα για κάθε module , οι "
"αλλαγές που γίνονται στο αντικείμενο του module αντικατοπτρίζονται παντού. "
"Για παράδειγμα:"
#: faq/programming.rst:268
msgid "config.py::"
msgstr "config.py::"
#: faq/programming.rst:270
msgid "x = 0 # Default value of the 'x' configuration setting"
msgstr "x = 0 # Default value of the 'x' configuration setting"
#: faq/programming.rst:272
msgid "mod.py::"
msgstr "mod.py::"
#: faq/programming.rst:274
msgid ""
"import config\n"
"config.x = 1"
msgstr ""
"import config\n"
"config.x = 1"
#: faq/programming.rst:277
msgid "main.py::"
msgstr "main.py::"
#: faq/programming.rst:279
msgid ""
"import config\n"
"import mod\n"
"print(config.x)"
msgstr ""
"import config\n"
"import mod\n"
"print(config.x)"
#: faq/programming.rst:283
msgid ""
"Note that using a module is also the basis for implementing the singleton "
"design pattern, for the same reason."
msgstr ""
"Λάβετε υπόψη ότι η χρήση ενός module είναι επίσης η βάση για την εφαρμογή "
"του μοτίβου σχεδιασμού singleton, για τον ίδιο λόγο."
#: faq/programming.rst:288
msgid "What are the \"best practices\" for using import in a module?"
msgstr ""
"Ποιες είναι οι \"βέλτιστες πρακτικές\" για τη χρήση import σε ένα module;"
#: faq/programming.rst:290
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 *``. Κάτι τέτοιο "
"δημιουργεί μια ακαταστασία στο importer's namespace, και καθιστά πιο δύσκολο "
"για τα linters να εντοπίσουν απροσδιόριστα ονόματα."
#: faq/programming.rst:294
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 ""
"Εισαγωγή modules στην κορυφή ενός αρχείου. Με αυτόν τον τρόπο καθιστά σαφές "
"ποια άλλα modules απαιτεί ο κώδικας σας και αποφεύγονται ερωτήσεις σχετικά "
"με το αν το όνομα της μονάδας είναι εντός πεδίου. Χρησιμοποιώντας ένα import "
"ανά γραμμή καθιστά εύκολη την προσθήκη και τη διαγραφή module imports, αλλά "
"χρησιμοποιώντας πολλαπλά imports ανά γραμμής καταναλώνεται λιγότερος χώρος "
"στην οθόνη."
#: faq/programming.rst:299
msgid "It's good practice if you import modules in the following order:"
msgstr "Είναι καλή πρακτική εάν εισάγετε module με την ακόλουθη σειρά:"
#: faq/programming.rst:301
msgid ""
"standard library modules -- e.g. :mod:`sys`, :mod:`os`, :mod:`argparse`, :"
"mod:`re`"
msgstr ""
"τυπικά module βιβλιοθήκης -- π.χ. :mod:`sys`, :mod:`os`, :mod:`argparse`, :"
"mod:`re`"
#: faq/programming.rst:302
msgid ""
"third-party library modules (anything installed in Python's site-packages "
"directory) -- e.g. :mod:`!dateutil`, :mod:`!requests`, :mod:`!PIL.Image`"
msgstr ""
"module βιβλιοθήκης τρίτων (ό, τι είναι εγκατεστημένο στο κατάλογο site-"
"packages της Python) -- π.χ. :mod:`!dateutil`, :mod:`! requests`, :mod:`!PIL."
"Image`"
#: faq/programming.rst:304
msgid "locally developed modules"
msgstr "τοπικά αναπτυγμένα modules"
#: faq/programming.rst:306
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 λέει:"
#: faq/programming.rst:309
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 ""
"Οι κυκλικές εισαγωγές είναι καλές όταν και τα δύο modules χρησιμοποιούν τη "
"μορφή εισαγωγής \"import <module>\". Αποτυγχάνουν όταν το 2ο module θέλει να "
"πάρει ένα όνομα από το πρώτο (\"from module import name\") και η εισαγωγή "
"είναι στο κορυφαίο επίπεδο. Αυτό συμβαίνει επειδή το πρώτο module είναι "
"απασχολημένο με την εισαγωγή του 2ου."
#: faq/programming.rst:315
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 ""
"Σε αυτήν την περίπτωση, εάν το δεύτερο module χρησιμοποιείται μόνο σε μια "
"συνάρτηση, τότε η εισαγωγή μπορεί εύκολα να μεταφερθεί μέσα σε αυτήν την "
"συνάρτηση. Από τη στιγμή που καλείται η εισαγωγή, το πρώτο module θα έχει "
"ολοκληρώσει την αρχικοποίηση, και το δεύτερο module μπορεί να κάνει την "
"εισαγωγή του."
#: faq/programming.rst:320
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 ""
"Μπορεί επίσης να είναι απαραίτητο να μετακινήσετε τις εισαγωγές από το "
"ανώτερο επίπεδο κώδικα, εάν ορισμένα από τα module είναι συγκεκριμένα για "
"την πλατφόρμα. Σε αυτήν την περίπτωση, ενδέχεται να μην είναι καν δυνατή η "
"εισαγωγή όλων των modules στο επάνω μέρος του αρχείου. Σε αυτήν την "
"περίπτωση, η εισαγωγή των σωστών modules στον αντίστοιχο κώδικα για "
"συγκεκριμένη πλατφόρμα είναι μια καλή επιλογή."
#: faq/programming.rst:325
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 ""
"Μετακινήστε τις εισαγωγές σε τοπικό πεδίο, όπως μέσα σε έναν ορισμό "
"συνάρτησης, μόνο εάν είναι απαραίτητο να λυθεί ένα πρόβλημα όπως η αποφυγή "
"μιας κυκλικής εισαγωγής ή εάν προσπαθείτε να μειώσετε τον χρόνο "
"προετοιμασίας μιας μονάδας. Αυτή η τεχνική είναι ιδιαίτερα χρήσιμη εάν "
"πολλές από τις εισαγωγές δεν είναι απαραίτητες ανάλογα με τον τρόπο "
"εκτέλεσης του προγράμματος. Μπορείτε επίσης να θέλετε να μετακινήσετε τις "
"εισαγωγές σε μια συνάρτηση εάν τα modules χρησιμοποιούνται μόνο σε αυτήν τη "
"συνάρτηση. Λάβετε υπόψη ότι η φόρτωση ενός module την πρώτη φορά μπορεί να "
"είναι δαπανηρή λόγω της μιας φοράς της αρχικοποίησης του module, αλλά η "
"φόρτωση ενός module πολλές φορές είναι σχεδόν δωρεάν, κοστίζοντας μόνο "
"μερικές αναζητήσεις σε λεξικό. Ακόμα και αν το όνομα του module έχει "
"ξεφύγει από το πεδίο εφαρμογής του, το module είναι πιθανώς διαθέσιμο στο :"
"data:`sys.modules`."
#: faq/programming.rst:338
msgid "Why are default values shared between objects?"
msgstr "Γιατί μοιράζονται οι προεπιλεγμένες τιμές μεταξύ των αντικειμένων;"
#: faq/programming.rst:340
msgid ""
"This type of bug commonly bites neophyte programmers. Consider this "
"function::"
msgstr ""
"Αυτός ο τύπος σφάλματος συνήθως δαγκώνει νεοφυείς προγραμματιστές. Σκεφτείτε "
"αυτήν τη συνάρτηση::"
#: faq/programming.rst:342
msgid ""
"def foo(mydict={}): # Danger: shared reference to one dict for all calls\n"
" ... compute something ...\n"
" mydict[key] = value\n"
" return mydict"
msgstr ""
"def foo(mydict={}): # Danger: shared reference to one dict for all calls\n"
" ... compute something ...\n"
" mydict[key] = value\n"
" return mydict"
#: faq/programming.rst:347
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`` περιέχει ένα "
"μεμονωμένο στοιχείο. Τη δεύτερη φορά, το ``mydict`` περιέχει δύο στοιχεία "
"γιατί όταν το ``foo()`` ξεκινά την εκτέλεση, το ``mydict`` ξεκινά με ένα "
"αντικείμενο ήδη μέσα."
#: faq/programming.rst:351
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 ""
"Συχνά αναμένεται ότι μια κλήση συνάρτησης δημιουργεί νέα αντικείμενα για "
"προεπιλεγμένες τιμές. Δεν συμβαίνει αυτό. Οι προεπιλεγμένες τιμές "
"δημιουργούνται ακριβώς μία φορά, όταν ορίζεται η συνάρτηση. Εάν αυτό το "
"αντικείμενο αλλάξει, όπως το λεξικό σε αυτό το παράδειγμα, επόμενες κλήσεις "
"στην συνάρτηση θα αναφέρονται σε αυτό το αλλαγμένο αντικείμενο."
#: faq/programming.rst:356
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`` , είναι ασφαλή από αλλαγές. Οι αλλαγές σε μεταβλητά αντικείμενα "
"όπως λεξικά, λίστες και παρουσίες κλάσεων μπορεί να οδηγήσουν σε σύγχυση."
#: faq/programming.rst:360
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`` και δημιουργήστε μια νέα λίστα/"
"λεξικά/ό,τι και αν είναι. Για παράδειγμα μην γράψετε::"
#: faq/programming.rst:365
msgid ""
"def foo(mydict={}):\n"
" ..."
msgstr ""
"def foo(mydict={}):\n"
" ..."
#: faq/programming.rst:368
msgid "but::"
msgstr "αλλά::"
#: faq/programming.rst:370
msgid ""
"def foo(mydict=None):\n"
" if mydict is None:\n"
" mydict = {} # create a new dict for local namespace"
msgstr ""
"def foo(mydict=None):\n"
" if mydict is None:\n"
" mydict = {} # create a new dict for local namespace"
#: faq/programming.rst:374
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\", και μπορεί να εφαρμοστεί ως "
"εξής:"
#: faq/programming.rst:379
msgid ""
"# Callers can only provide two parameters and optionally pass _cache by "
"keyword\n"
"def expensive(arg1, arg2, *, _cache={}):\n"
" if (arg1, arg2) in _cache:\n"
" return _cache[(arg1, arg2)]\n"
"\n"
" # Calculate the value\n"
" result = ... expensive computation ...\n"
" _cache[(arg1, arg2)] = result # Store result in the cache\n"
" return result"
msgstr ""
"# Callers can only provide two parameters and optionally pass _cache by "
"keyword\n"
"def expensive(arg1, arg2, *, _cache={}):\n"
" if (arg1, arg2) in _cache:\n"
" return _cache[(arg1, arg2)]\n"
"\n"
" # Calculate the value\n"
" result = ... expensive computation ...\n"
" _cache[(arg1, arg2)] = result # Store result in the cache\n"
" return result"
#: faq/programming.rst:389
msgid ""
"You could use a global variable containing a dictionary instead of the "
"default value; it's a matter of taste."
msgstr ""
"Θα μπορούσατε να χρησιμοποιήσετε μια καθολική μεταβλητή που περιέχει ένα "
"λεξικό αντί για την προεπιλεγμένη τιμή∙ Είναι θέμα γούστου."
#: faq/programming.rst:394
msgid ""
"How can I pass optional or keyword parameters from one function to another?"
msgstr ""
"Πώς μπορώ να μεταβιβάσω προαιρετικές παραμέτρους ή παραμέτρους λέξεων-"
"κλειδιών από τη μια συνάρτηση στην άλλη;"
#: faq/programming.rst:396
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 ""
"Συλλέξτε τα ορίσματα χρησιμοποιώντας τους specifiers ``*`` και ``**`` στη "
"λίστα παραμέτρων της συνάρτησης∙ Αυτό σας δίνει τα ορίσματα θέσης ως πλειάδα "
"και τα ορίσματα λέξεων-κλειδιών ως λεξικό. Στη συνέχεια, μπορείτε να "
"μεταβιβάσετε αυτά τα ορίσματα κατά την κλήση άλλης συνάρτησης με τη χρήση "
"των ``*`` και ``**``::"
#: faq/programming.rst:401
msgid ""
"def f(x, *args, **kwargs):\n"
" ...\n"
" kwargs['width'] = '14.3c'\n"
" ...\n"
" g(x, *args, **kwargs)"
msgstr ""
"def f(x, *args, **kwargs):\n"
" ...\n"
" kwargs['width'] = '14.3c'\n"
" ...\n"
" g(x, *args, **kwargs)"
#: faq/programming.rst:415
msgid "What is the difference between arguments and parameters?"
msgstr "Ποια είναι η διαφορά μεταξύ ορισμάτων και παραμέτρων;"
#: faq/programming.rst:417
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 :term:"
"`kind of arguments <parameter>` a function can accept. For example, given "
"the function definition::"
msgstr ""
":term:`Παράμετροι <parameter>` ορίζονται από τα ονόματα που εμφανίζονται "
"στον ορισμό μιας συνάρτησης, ενώ τα :term:`ορίσματα <argument>` είναι οι "
"τιμές που πραγματικά μεταβιβάζονται σε μια συνάρτηση κατά την κλήση της. Οι "
"παράμετροι ορίζουν τι :term:`kind of arguments <parameter>` μπορεί να δεχτεί "
"μια συνάρτηση. Για παράδειγμα δεδομένου του ορισμού της συνάρτησης::"
#: faq/programming.rst:423
msgid ""
"def func(foo, bar=None, **kwargs):\n"
" pass"
msgstr ""
"def func(foo, bar=None, **kwargs):\n"
" pass"
#: faq/programming.rst:426
msgid ""
"*foo*, *bar* and *kwargs* are parameters of ``func``. However, when calling "
"``func``, for example::"
msgstr ""
"*foo*, *bar* και *kwargs* είναι παράμετροι της ``func``. Ωστόσο, όταν "
"καλείται η ``func``, για παράδειγμα::"
#: faq/programming.rst:429
msgid "func(42, bar=314, extra=somevar)"
msgstr "func(42, bar=314, extra=somevar)"
#: faq/programming.rst:431
msgid "the values ``42``, ``314``, and ``somevar`` are arguments."
msgstr "οι τιμές ``42``, ``314``, και ``somevar`` είναι ορίσματα."
#: faq/programming.rst:435
msgid "Why did changing list 'y' also change list 'x'?"
msgstr "Γιατί η αλλαγή της λίστας 'y' αλλάζει επίσης και τη λίστα 'x';"
#: faq/programming.rst:437
msgid "If you wrote code like::"
msgstr "Αν γράψατε κώδικα όπως::"
#: faq/programming.rst:439
msgid ""
">>> x = []\n"
">>> y = x\n"
">>> y.append(10)\n"
">>> y\n"
"[10]\n"
">>> x\n"
"[10]"
msgstr ""
">>> x = []\n"
">>> y = x\n"
">>> y.append(10)\n"
">>> y\n"
"[10]\n"
">>> x\n"
"[10]"
#: faq/programming.rst:447
msgid ""
"you might be wondering why appending an element to ``y`` changed ``x`` too."
msgstr ""
"μπορεί να αναρωτιέστε γιατί η προσθήκη ενός στοιχείου στο ``y`` άλλαξε "
"επίσης το ``x``."
#: faq/programming.rst:449
msgid "There are two factors that produce this result:"
msgstr "Υπάρχουν δύο παράγοντες που παράγουν αυτό το αποτέλεσμα:"
#: faq/programming.rst:451
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`` δεν δημιουργείται αντίγραφο της λίστας -- δημιουργεί μια νέα "
"μεταβλητή ``y`` που αναφέρεται στο ίδιο αντικείμενο που αναφέρεται το "
"``x``. Αυτό σημαίνει ότι υπάρχει μόνο ένα αντικείμενο (η λίστα), και το "
"``x`` και το ``y`` αναφέρονται σε αυτό."
#: faq/programming.rst:455
msgid ""
"Lists are :term:`mutable`, which means that you can change their content."
msgstr ""
"Οι λίστες είναι :term:`mutable`, που σημαίνει ότι μπορείτε να αλλάξετε το "
"περιεχόμενό τους."
#: faq/programming.rst:457
msgid ""
"After the call to :meth:`~sequence.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:`~sequence.append`, το περιεχόμενο του μεταβλητού "
"αντικειμένου έχει αλλάξει από ``[]`` σε ``[10]``. Επειδή και οι δύο "
"μεταβλητές αναφέρονται στο ίδιο αντικείμενο, χρησιμοποιώντας οποιοδήποτε "
"όνομα αποκτά πρόσβαση στην τροποποιημένη τιμή ``[10]``."
#: faq/programming.rst:461
msgid "If we instead assign an immutable object to ``x``::"
msgstr "Αν αντιστοιχίσουμε ένα αμετάβλητο αντικείμενο σε ``x``::"
#: faq/programming.rst:463
msgid ""
">>> x = 5 # ints are immutable\n"
">>> y = x\n"
">>> x = x + 1 # 5 can't be mutated, we are creating a new object here\n"
">>> x\n"
"6\n"
">>> y\n"