forked from python/python-docs-tr
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path3.8.html
More file actions
1590 lines (1520 loc) · 303 KB
/
3.8.html
File metadata and controls
1590 lines (1520 loc) · 303 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
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta property="og:title" content="Python 3.8’deki Yenilikler" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://docs.python.org/3/whatsnew/3.8.html" />
<meta property="og:site_name" content="Python documentation" />
<meta property="og:description" content="Editör, Raymond Hettinger,. Bu makale, 3.7 ile karşılaştırıldığında Python 3.8 ‘deki yeni özellikleri açıklamaktadır. Tüm ayrıntılar için Changelog ‘a bakın. Özet – Sürümün öne çıkanları: Yeni Özel..." />
<meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
<meta property="og:image:alt" content="Python documentation" />
<meta name="description" content="Editör, Raymond Hettinger,. Bu makale, 3.7 ile karşılaştırıldığında Python 3.8 ‘deki yeni özellikleri açıklamaktadır. Tüm ayrıntılar için Changelog ‘a bakın. Özet – Sürümün öne çıkanları: Yeni Özel..." />
<meta property="og:image:width" content="200" />
<meta property="og:image:height" content="200" />
<meta name="theme-color" content="#3776ab" />
<title>Python 3.8’deki Yenilikler — Python 3.11.5 belgelendirmesi</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?digest=b37c26da2f7529d09fe70b41c4b2133fe4931a90" />
<link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/translations.js"></script>
<script src="../_static/sidebar.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Python 3.11.5 belgelendirmesi içinde ara"
href="../_static/opensearch.xml"/>
<link rel="author" title="Bu belgeler hakkında" href="../about.html" />
<link rel="index" title="Dizin" href="../genindex.html" />
<link rel="search" title="Ara" href="../search.html" />
<link rel="copyright" title="Telif Hakkı" href="../copyright.html" />
<link rel="next" title="What’s New In Python 3.7" href="3.7.html" />
<link rel="prev" title="Python 3.9’daki Yenilikler" href="3.9.html" />
<link rel="canonical" href="https://docs.python.org/3/whatsnew/3.8.html" />
<style>
@media only screen {
table.full-width-table {
width: 100%;
}
}
</style>
<link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
<link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
<script type="text/javascript" src="../_static/copybutton.js"></script>
<script type="text/javascript" src="../_static/menu.js"></script>
<script type="text/javascript" src="../_static/search-focus.js"></script>
<script type="text/javascript" src="../_static/themetoggle.js"></script>
</head>
<body>
<div class="mobile-nav">
<input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
<nav class="nav-content" role="navigation">
<label for="menuToggler" class="toggler__label">
<span></span>
</label>
<span class="nav-items-wrapper">
<a href="https://www.python.org/" class="nav-logo">
<img src="../_static/py.svg" alt="Logo"/>
</a>
<span class="version_switcher_placeholder"></span>
<form role="search" class="search" action="../search.html" method="get">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
<path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
</svg>
<input placeholder="Hızlı Arama" aria-label="Hızlı Arama" type="search" name="q" />
<input type="submit" value="Git"/>
</form>
</span>
</nav>
<div class="menu-wrapper">
<nav class="menu" role="navigation" aria-label="main navigation">
<div class="language_switcher_placeholder"></div>
<label class="theme-selector-label">
Theme
<select class="theme-selector" oninput="activateTheme(this.value)">
<option value="auto" selected>Auto</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
</select>
</label>
<div>
<h3><a href="../contents.html">İçindekiler</a></h3>
<ul>
<li><a class="reference internal" href="#">Python 3.8’deki Yenilikler</a><ul>
<li><a class="reference internal" href="#summary-release-highlights">Özet – Sürümün öne çıkanları</a></li>
<li><a class="reference internal" href="#new-features">Yeni Özellikler</a><ul>
<li><a class="reference internal" href="#assignment-expressions">Atama ifadeleri</a></li>
<li><a class="reference internal" href="#positional-only-parameters">Yalnızca konumsal parametreler</a></li>
<li><a class="reference internal" href="#parallel-filesystem-cache-for-compiled-bytecode-files">Derlenmiş bayt kodu dosyaları için paralel dosya sistemi önbelleği</a></li>
<li><a class="reference internal" href="#debug-build-uses-the-same-abi-as-release-build">Hata ayıklama derlemesi, yayın derlemesiyle aynı ABI’yi kullanır</a></li>
<li><a class="reference internal" href="#f-strings-support-for-self-documenting-expressions-and-debugging">kendi kendini belgeleyen ifadeler ve hata ayıklama için f-dizeleri <code class="docutils literal notranslate"><span class="pre">=</span></code> desteği</a></li>
<li><a class="reference internal" href="#pep-578-python-runtime-audit-hooks">PEP 578: Python Çalışma Zamanı Denetim Kancaları</a></li>
<li><a class="reference internal" href="#pep-587-python-initialization-configuration">PEP 587: Python Başlatma Yapılandırması</a></li>
<li><a class="reference internal" href="#pep-590-vectorcall-a-fast-calling-protocol-for-cpython">PEP 590: Vectorcall: CPython için hızlı arama protokolü</a></li>
<li><a class="reference internal" href="#pickle-protocol-5-with-out-of-band-data-buffers">Bant dışı veri tamponlarıyla Pickle protokolü 5</a></li>
</ul>
</li>
<li><a class="reference internal" href="#other-language-changes">Diğer Dil Değişiklikleri</a></li>
<li><a class="reference internal" href="#new-modules">Yeni Modüller</a></li>
<li><a class="reference internal" href="#improved-modules">Geliştirilmiş Modüller</a><ul>
<li><a class="reference internal" href="#ast">ast</a></li>
<li><a class="reference internal" href="#asyncio">asyncio</a></li>
<li><a class="reference internal" href="#builtins">builtins</a></li>
<li><a class="reference internal" href="#collections">collections</a></li>
<li><a class="reference internal" href="#cprofile">cProfile</a></li>
<li><a class="reference internal" href="#csv">csv</a></li>
<li><a class="reference internal" href="#curses">curses</a></li>
<li><a class="reference internal" href="#ctypes">ctypes</a></li>
<li><a class="reference internal" href="#datetime">datetime</a></li>
<li><a class="reference internal" href="#functools">functools</a></li>
<li><a class="reference internal" href="#gc">gc</a></li>
<li><a class="reference internal" href="#gettext">gettext</a></li>
<li><a class="reference internal" href="#gzip">gzip</a></li>
<li><a class="reference internal" href="#idle-and-idlelib">IDLE ve idlelib</a></li>
<li><a class="reference internal" href="#inspect">inspect</a></li>
<li><a class="reference internal" href="#io">io</a></li>
<li><a class="reference internal" href="#itertools">itertools</a></li>
<li><a class="reference internal" href="#json-tool">json.tool</a></li>
<li><a class="reference internal" href="#logging">kayıt tutma</a></li>
<li><a class="reference internal" href="#math">math</a></li>
<li><a class="reference internal" href="#mmap">mmap</a></li>
<li><a class="reference internal" href="#multiprocessing">multiprocessing</a></li>
<li><a class="reference internal" href="#os">os</a></li>
<li><a class="reference internal" href="#os-path">os.path</a></li>
<li><a class="reference internal" href="#pathlib">pathlib</a></li>
<li><a class="reference internal" href="#pickle">pickle</a></li>
<li><a class="reference internal" href="#plistlib">plistlib</a></li>
<li><a class="reference internal" href="#pprint">pprint</a></li>
<li><a class="reference internal" href="#py-compile">py_compile</a></li>
<li><a class="reference internal" href="#shlex">shlex</a></li>
<li><a class="reference internal" href="#shutil">shutil</a></li>
<li><a class="reference internal" href="#socket">socket</a></li>
<li><a class="reference internal" href="#ssl">ssl</a></li>
<li><a class="reference internal" href="#statistics">statistics</a></li>
<li><a class="reference internal" href="#sys">sys</a></li>
<li><a class="reference internal" href="#tarfile">tarfile</a></li>
<li><a class="reference internal" href="#threading">threading</a></li>
<li><a class="reference internal" href="#tokenize">tokenize</a></li>
<li><a class="reference internal" href="#tkinter">tkinter</a></li>
<li><a class="reference internal" href="#time">time</a></li>
<li><a class="reference internal" href="#typing">typing</a></li>
<li><a class="reference internal" href="#unicodedata">unicodedata</a></li>
<li><a class="reference internal" href="#unittest">unittest</a></li>
<li><a class="reference internal" href="#venv">venv</a></li>
<li><a class="reference internal" href="#weakref">weakref</a></li>
<li><a class="reference internal" href="#xml">xml</a></li>
<li><a class="reference internal" href="#xmlrpc">xmlrpc</a></li>
</ul>
</li>
<li><a class="reference internal" href="#optimizations">Optimizasyonlar</a></li>
<li><a class="reference internal" href="#build-and-c-api-changes">Derleme ve C API Değişiklikleri</a></li>
<li><a class="reference internal" href="#deprecated">Kullanımdan kaldırıldı</a></li>
<li><a class="reference internal" href="#api-and-feature-removals">API ve Özellik Kaldırmaları</a></li>
<li><a class="reference internal" href="#porting-to-python-3-8">Python 3.8’e Taşıma</a><ul>
<li><a class="reference internal" href="#changes-in-python-behavior">Python davranışındaki değişiklikler</a></li>
<li><a class="reference internal" href="#changes-in-the-python-api">Python API’sindeki değişiklikler</a></li>
<li><a class="reference internal" href="#changes-in-the-c-api">C API’sindeki değişiklikler</a></li>
<li><a class="reference internal" href="#cpython-bytecode-changes">CPython bayt kodu değişiklikleri</a></li>
<li><a class="reference internal" href="#demos-and-tools">Demolar ve Araçlar</a></li>
</ul>
</li>
<li><a class="reference internal" href="#notable-changes-in-python-3-8-1">Python 3.8.1’deki önemli değişiklikler</a></li>
<li><a class="reference internal" href="#notable-changes-in-python-3-8-8">Python 3.8.8’deki önemli değişiklikler</a></li>
<li><a class="reference internal" href="#notable-changes-in-python-3-8-12">Python 3.8.12’deki önemli değişiklikler</a></li>
</ul>
</li>
</ul>
</div>
<div>
<h4>Önceki konu</h4>
<p class="topless"><a href="3.9.html"
title="önceki bölüm">Python 3.9’daki Yenilikler</a></p>
</div>
<div>
<h4>Sonraki konu</h4>
<p class="topless"><a href="3.7.html"
title="sonraki bölüm">What’s New In Python 3.7</a></p>
</div>
<div role="note" aria-label="source link">
<h3>Bu Sayfa</h3>
<ul class="this-page-menu">
<li><a href="../bugs.html">Hata Bildir</a></li>
<li>
<a href="https://github.com/python/cpython/blob/3.11/Doc/whatsnew/3.8.rst"
rel="nofollow">Kaynağı Göster
</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Gezinti</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="Genel Endeks"
accesskey="I">dizin</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Modül Dizini"
>modülleri</a> |</li>
<li class="right" >
<a href="3.7.html" title="What’s New In Python 3.7"
accesskey="N">sonraki</a> |</li>
<li class="right" >
<a href="3.9.html" title="Python 3.9’daki Yenilikler"
accesskey="P">önceki</a> |</li>
<li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://www.python.org/">Python</a> »</li>
<li class="switchers">
<div class="language_switcher_placeholder"></div>
<div class="version_switcher_placeholder"></div>
</li>
<li>
</li>
<li id="cpython-language-and-version">
<a href="../index.html">3.11.5 Documentation</a> »
</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">What’s New in Python</a> »</li>
<li class="nav-item nav-item-this"><a href="">Python 3.8’deki Yenilikler</a></li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="../search.html" method="get">
<input placeholder="Hızlı Arama" aria-label="Hızlı Arama" type="search" name="q" id="search-box" />
<input type="submit" value="Git" />
</form>
</div>
|
</li>
<li class="right">
<label class="theme-selector-label">
Theme
<select class="theme-selector" oninput="activateTheme(this.value)">
<option value="auto" selected>Auto</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
</select>
</label> |</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="what-s-new-in-python-3-8">
<h1>Python 3.8’deki Yenilikler<a class="headerlink" href="#what-s-new-in-python-3-8" title="Permalink to this heading">¶</a></h1>
<dl class="field-list simple">
<dt class="field-odd">Editör<span class="colon">:</span></dt>
<dd class="field-odd"><p>Raymond Hettinger</p>
</dd>
</dl>
<p>Bu makale, 3.7 ile karşılaştırıldığında Python 3.8 ‘deki yeni özellikleri açıklamaktadır. Tüm ayrıntılar için <a class="reference internal" href="changelog.html#changelog"><span class="std std-ref">Changelog</span></a> ‘a bakın.</p>
<section id="summary-release-highlights">
<h2>Özet – Sürümün öne çıkanları<a class="headerlink" href="#summary-release-highlights" title="Permalink to this heading">¶</a></h2>
</section>
<section id="new-features">
<h2>Yeni Özellikler<a class="headerlink" href="#new-features" title="Permalink to this heading">¶</a></h2>
<section id="assignment-expressions">
<h3>Atama ifadeleri<a class="headerlink" href="#assignment-expressions" title="Permalink to this heading">¶</a></h3>
<p>Daha büyük bir ifadenin parçası olarak değişkenlere değerler atayan yeni sözdizimi <code class="docutils literal notranslate"><span class="pre">:=</span></code> var. Bir morsun <a class="reference external" href="https://en.wikipedia.org/wiki/Walrus#/media/File:Pacific_Walrus_-_Bull_(8247646168).jpg">gözlerine ve dişlerine benzerliği nedeniyle “mors operatörü” olarak bilinir</a>.</p>
<p>Bu örnekte, atama ifadesi <a class="reference internal" href="../library/functions.html#len" title="len"><code class="xref py py-func docutils literal notranslate"><span class="pre">len()</span></code></a> öğesini iki kez çağırmaktan kaçınmaya yardımcı olur:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">n</span> <span class="o">:=</span> <span class="nb">len</span><span class="p">(</span><span class="n">a</span><span class="p">))</span> <span class="o">></span> <span class="mi">10</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">"List is too long (</span><span class="si">{</span><span class="n">n</span><span class="si">}</span><span class="s2"> elements, expected <= 10)"</span><span class="p">)</span>
</pre></div>
</div>
<p>Benzer bir fayda, eşleştirme nesnelerine iki kez ihtiyaç duyulan normal ifade eşleştirme sırasında ortaya çıkar; bir kez bir eşleşme olup olmadığını test etmek ve başka bir kez bir alt grup çıkarmak için:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">discount</span> <span class="o">=</span> <span class="mf">0.0</span>
<span class="k">if</span> <span class="p">(</span><span class="n">mo</span> <span class="o">:=</span> <span class="n">re</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="sa">r</span><span class="s1">'(\d+)</span><span class="si">% d</span><span class="s1">iscount'</span><span class="p">,</span> <span class="n">advertisement</span><span class="p">)):</span>
<span class="n">discount</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="n">mo</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span> <span class="o">/</span> <span class="mf">100.0</span>
</pre></div>
</div>
<p>Operatör, döngü sonlandırmasını test etmek için bir değer hesaplayan ve ardından döngü gövdesinde aynı değere tekrar ihtiyaç duyan while döngülerinde de kullanışlıdır:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># Loop over fixed length blocks</span>
<span class="k">while</span> <span class="p">(</span><span class="n">block</span> <span class="o">:=</span> <span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">256</span><span class="p">))</span> <span class="o">!=</span> <span class="s1">''</span><span class="p">:</span>
<span class="n">process</span><span class="p">(</span><span class="n">block</span><span class="p">)</span>
</pre></div>
</div>
<p>Başka bir motive edici kullanım durumu, bir filtreleme koşulunda hesaplanan bir değerin ifade gövdesinde de gerekli olduğu liste üreteçlerinde ortaya çıkar:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">clean_name</span><span class="o">.</span><span class="n">title</span><span class="p">()</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">names</span>
<span class="k">if</span> <span class="p">(</span><span class="n">clean_name</span> <span class="o">:=</span> <span class="n">normalize</span><span class="p">(</span><span class="s1">'NFC'</span><span class="p">,</span> <span class="n">name</span><span class="p">))</span> <span class="ow">in</span> <span class="n">allowed_names</span><span class="p">]</span>
</pre></div>
</div>
<p>Karmaşıklığı azaltan ve okunabilirliği artıran vakaları temizlemek için mors operatörünün kullanımını sınırlamaya çalışın.</p>
<p>Tam açıklama için <span class="target" id="index-50"></span><a class="pep reference external" href="https://peps.python.org/pep-0572/"><strong>PEP 572</strong></a> konusuna bakın.</p>
<p>(Emily Morehouse’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35224">bpo-35224</a> ‘teki katkısıyla.)</p>
</section>
<section id="positional-only-parameters">
<h3>Yalnızca konumsal parametreler<a class="headerlink" href="#positional-only-parameters" title="Permalink to this heading">¶</a></h3>
<p>Bazı fonksiyon parametrelerinin konumsal olarak belirtilmesi gerektiğini ve anahtar kelime bağımsız değişkenleri olarak kullanılamayacağını belirtmek için yeni bir fonksiyon parametresi sözdizimi <code class="docutils literal notranslate"><span class="pre">/</span></code> vardır. Bu, Larry Hastings’in <a class="reference internal" href="../howto/clinic.html#howto-clinic"><span class="std std-ref">Argument Clinic</span></a> aracıyla açıklanan C fonksiyonları için <code class="docutils literal notranslate"><span class="pre">help()</span></code> tarafından gösterilen notasyonunun aynısıdır.</p>
<p>Aşağıdaki örnekte, <em>a</em> ve <em>b</em> parametreleri yalnızca konumsaldır, <em>c</em> veya <em>d</em> konumsal veya anahtar sözcük olabilir ve <em>e</em> veya <em>f</em>’nin anahtar sözcük olması gerekir:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">f</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">/</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">d</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">e</span><span class="p">,</span> <span class="n">f</span><span class="p">):</span>
<span class="nb">print</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">d</span><span class="p">,</span> <span class="n">e</span><span class="p">,</span> <span class="n">f</span><span class="p">)</span>
</pre></div>
</div>
<p>Aşağıdaki geçerli bir çağrıdır:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">f</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="n">d</span><span class="o">=</span><span class="mi">40</span><span class="p">,</span> <span class="n">e</span><span class="o">=</span><span class="mi">50</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="mi">60</span><span class="p">)</span>
</pre></div>
</div>
<p>Ancak, bunlar geçersiz çağrılardır:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">f</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="mi">20</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="mi">30</span><span class="p">,</span> <span class="n">d</span><span class="o">=</span><span class="mi">40</span><span class="p">,</span> <span class="n">e</span><span class="o">=</span><span class="mi">50</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="mi">60</span><span class="p">)</span> <span class="c1"># b cannot be a keyword argument</span>
<span class="n">f</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">40</span><span class="p">,</span> <span class="mi">50</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="mi">60</span><span class="p">)</span> <span class="c1"># e must be a keyword argument</span>
</pre></div>
</div>
<p>Bu gösterim için bir kullanım durumu, saf Python fonksiyonlarının mevcut C kodlu fonksiyonlarının davranışlarını tam olarak taklit etmesine izin vermesidir. Örneğin, yerleşik <a class="reference internal" href="../library/functions.html#divmod" title="divmod"><code class="xref py py-func docutils literal notranslate"><span class="pre">divmod()</span></code></a> fonksiyonu, anahtar kelime bağımsız değişkenlerini kabul etmez:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">divmod</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">/</span><span class="p">):</span>
<span class="s2">"Emulate the built in divmod() function"</span>
<span class="k">return</span> <span class="p">(</span><span class="n">a</span> <span class="o">//</span> <span class="n">b</span><span class="p">,</span> <span class="n">a</span> <span class="o">%</span> <span class="n">b</span><span class="p">)</span>
</pre></div>
</div>
<p>Başka bir kullanım durumu, parametre adı yardımcı olmadığında anahtar kelime bağımsız değişkenlerini engellemektir. Örneğin, yerleşik <a class="reference internal" href="../library/functions.html#len" title="len"><code class="xref py py-func docutils literal notranslate"><span class="pre">len()</span></code></a> işlevi <code class="docutils literal notranslate"><span class="pre">len(obj,</span> <span class="pre">/)</span></code> imzasına sahiptir. Bu, aşağıdaki gibi garip çağrıları engeller:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="nb">len</span><span class="p">(</span><span class="n">obj</span><span class="o">=</span><span class="s1">'hello'</span><span class="p">)</span> <span class="c1"># The "obj" keyword argument impairs readability</span>
</pre></div>
</div>
<p>Bir parametreyi yalnızca konumsal olarak işaretlemenin başka bir yararı da, parametre adının gelecekte yerel kodunu kırma riski olmadan değiştirilmesine izin vermesidir. Örneğin, <a class="reference internal" href="../library/statistics.html#module-statistics" title="statistics: Mathematical statistics functions"><code class="xref py py-mod docutils literal notranslate"><span class="pre">statistics</span></code></a> modülünde, <em>dist</em> parametre adı gelecekte değiştirilebilir. Bu, aşağıdaki fonksiyon belirtimi ile mümkün olmuştur:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">quantiles</span><span class="p">(</span><span class="n">dist</span><span class="p">,</span> <span class="o">/</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">n</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="s1">'exclusive'</span><span class="p">)</span>
<span class="o">...</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">/</span></code> öğesinin solundaki parametreler olası anahtar kelimeler olarak gösterilmediğinden, parametre adları <code class="docutils literal notranslate"><span class="pre">**kwargs</span></code> içinde kullanılmaya devam eder:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="k">def</span> <span class="nf">f</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">/</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="gp">... </span> <span class="nb">print</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">)</span>
<span class="gp">...</span>
<span class="gp">>>> </span><span class="n">f</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="n">a</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">c</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span> <span class="c1"># a and b are used in two ways</span>
<span class="go">10 20 {'a': 1, 'b': 2, 'c': 3}</span>
</pre></div>
</div>
<p>Bu, rasgele anahtar kelime bağımsız değişkenlerini kabul etmesi gereken fonksiyonlarının ve yöntemlerin uygulanmasını büyük ölçüde basitleştirir. Örneğin, <a class="reference internal" href="../library/collections.html#module-collections" title="collections: Container datatypes"><code class="xref py py-mod docutils literal notranslate"><span class="pre">collections</span></code></a> modülündeki koddan bir alıntı:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Counter</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iterable</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">/</span><span class="p">,</span> <span class="o">**</span><span class="n">kwds</span><span class="p">):</span>
<span class="c1"># Note "iterable" is a possible keyword argument</span>
</pre></div>
</div>
<p>Tam açıklama için <span class="target" id="index-51"></span><a class="pep reference external" href="https://peps.python.org/pep-0570/"><strong>PEP 570</strong></a> ‘e bakın.</p>
<p>(Pablo Galindo’nun <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36540">bpo-36540</a> ‘taki katkısıyla.)</p>
</section>
<section id="parallel-filesystem-cache-for-compiled-bytecode-files">
<h3>Derlenmiş bayt kodu dosyaları için paralel dosya sistemi önbelleği<a class="headerlink" href="#parallel-filesystem-cache-for-compiled-bytecode-files" title="Permalink to this heading">¶</a></h3>
<p>Yeni <span class="target" id="index-52"></span><a class="reference internal" href="../using/cmdline.html#envvar-PYTHONPYCACHEPREFIX"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPYCACHEPREFIX</span></code></a> ayarı ( <a class="reference internal" href="../using/cmdline.html#cmdoption-X"><code class="xref std std-option docutils literal notranslate"><span class="pre">-X</span></code></a> <code class="docutils literal notranslate"><span class="pre">pycache_prefix</span></code> olarak da mevcuttur), örtük bayt kodu önbelleğini, içindeki varsayılan <code class="docutils literal notranslate"><span class="pre">__pycache__</span></code> alt dizinleri yerine ayrı bir paralel dosya sistemi ağacı kullanacak şekilde yapılandırır.</p>
<p>Önbelleğin konumu <a class="reference internal" href="../library/sys.html#sys.pycache_prefix" title="sys.pycache_prefix"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.pycache_prefix</span></code></a> içinde rapor edilir (<a class="reference internal" href="../library/constants.html#None" title="None"><code class="xref py py-const docutils literal notranslate"><span class="pre">None</span></code></a>, <code class="docutils literal notranslate"><span class="pre">__pycache__</span></code> alt dizinlerindeki varsayılan konumu belirtir).</p>
<p>(Carl Meyer’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33499">bpo-33499</a> ‘daki katkısıyla.)</p>
</section>
<section id="debug-build-uses-the-same-abi-as-release-build">
<h3>Hata ayıklama derlemesi, yayın derlemesiyle aynı ABI’yi kullanır<a class="headerlink" href="#debug-build-uses-the-same-abi-as-release-build" title="Permalink to this heading">¶</a></h3>
<p>Python artık sürüm veya hata ayıklama modunda oluşturulduğunda aynı ABI’yi kullanıyor. Unix’te, Python hata ayıklama modunda oluşturulduğunda, artık sürüm modunda oluşturulmuş C uzantılarını ve kararlı ABI kullanılarak oluşturulmuş C uzantılarını yüklemek mümkündür.</p>
<p>Release ve <a class="reference internal" href="../using/configure.html#debug-build"><span class="std std-ref">hata ayıklama derlemeleri</span></a> artık ABI ile uyumludur: <code class="docutils literal notranslate"><span class="pre">Py_DEBUG</span></code> makrosunu tanımlamak artık tek ABI uyumsuzluğunu ortaya çıkaran <code class="docutils literal notranslate"><span class="pre">Py_TRACE_REFS</span></code> makrosunu gerektirmez. <code class="xref py py-func docutils literal notranslate"><span class="pre">sys.getobjects()</span></code> fonksiyonunu ve <span class="target" id="index-53"></span><a class="reference internal" href="../using/cmdline.html#envvar-PYTHONDUMPREFS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONDUMPREFS</span></code></a> ortam değişkenini ekleyen <code class="docutils literal notranslate"><span class="pre">Py_TRACE_REFS</span></code> makrosu, yeni <a class="reference internal" href="../using/configure.html#cmdoption-with-trace-refs"><code class="xref std std-option docutils literal notranslate"><span class="pre">./configure</span> <span class="pre">--with-trace-refs</span></code></a> derleme seçeneği kullanılarak ayarlanabilir.(Victor Stinner’ın’ <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36465">bpo-36465</a> ‘deki katkısıyla.)</p>
<p>Unix’te, Android ve Cygwin dışında C uzantıları artık libpython’a bağlı değildir. Statik olarak bağlı bir Python’un, paylaşılan bir Python kitaplığı kullanılarak oluşturulmuş bir C uzantısını yüklemesi artık mümkün. (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=21536">bpo-21536</a> ‘daki katkısıyla.)</p>
<p>Unix’te, Python hata ayıklama modunda oluşturulduğunda, import artık yayın modunda derlenen C uzantılarını ve kararlı ABI ile derlenen C uzantılarını da arar. (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36722">bpo-36722</a> ‘deki katkısıyla.)</p>
<p>Python’u bir uygulamaya gömmek için, <code class="docutils literal notranslate"><span class="pre">-lpython3.8</span></code> (uygulamayı libpython’a bağlamak) elde etmek için <code class="docutils literal notranslate"><span class="pre">python3-config</span> <span class="pre">--libs</span> <span class="pre">--embed</span></code> seçeneğine yeni bir <code class="docutils literal notranslate"><span class="pre">--embed</span></code> seçeneği aktarılmalıdır. Hem 3.8 hem de daha eski sürümleri desteklemek için, önce <code class="docutils literal notranslate"><span class="pre">python3-config</span> <span class="pre">--libs</span> <span class="pre">--embed</span></code> seçeneğini deneyin ve önceki komut başarısız olursa <code class="docutils literal notranslate"><span class="pre">python3-config</span> <span class="pre">--libs</span></code> (<code class="docutils literal notranslate"><span class="pre">--embed</span></code> olmadan) seçeneğine geri dönün.</p>
<p>Python’u bir uygulamaya gömmek için bir pkg-config <code class="docutils literal notranslate"><span class="pre">python-3.8-embed</span></code> modülü ekleyin: <code class="docutils literal notranslate"><span class="pre">pkg-config</span> <span class="pre">python-3.8-embed</span> <span class="pre">--libs</span></code> <code class="docutils literal notranslate"><span class="pre">-lpython3.8</span></code> içerir. Hem 3.8 hem de daha eski sürümleri desteklemek için, önce <code class="docutils literal notranslate"><span class="pre">pkg-config</span> <span class="pre">python-X.Y-embed</span> <span class="pre">--libs</span></code> komutunu deneyin ve önceki komut başarısız olursa <code class="docutils literal notranslate"><span class="pre">pkg-config</span> <span class="pre">python-X.Y</span> <span class="pre">--libs</span></code> (<code class="docutils literal notranslate"><span class="pre">--embed</span></code> olmadan) komutuna geri dönün (<code class="docutils literal notranslate"><span class="pre">X.Y</span></code> yerine Python sürümünü yazın).</p>
<p>Öte yandan, <code class="docutils literal notranslate"><span class="pre">pkg-config</span> <span class="pre">python3.8</span> <span class="pre">--libs</span></code> artık <code class="docutils literal notranslate"><span class="pre">-lpython3.8</span></code> içermiyor. C uzantıları libpython’a bağlanmamalıdır (durumları dize tarafından işlenen Android ve Cygwin hariç); bu değişiklik kasıtlı olarak geriye dönük uyumsuzdur. (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36721">bpo-36721</a> ‘deki katkısıyla.)</p>
</section>
<section id="f-strings-support-for-self-documenting-expressions-and-debugging">
<span id="bpo-36817-whatsnew"></span><h3>kendi kendini belgeleyen ifadeler ve hata ayıklama için f-dizeleri <code class="docutils literal notranslate"><span class="pre">=</span></code> desteği<a class="headerlink" href="#f-strings-support-for-self-documenting-expressions-and-debugging" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../glossary.html#term-f-string"><span class="xref std std-term">f-string</span></a>s için bir <code class="docutils literal notranslate"><span class="pre">=</span></code> tanımlayıcısı eklendi. <code class="docutils literal notranslate"><span class="pre">f'{expr=}'</span></code> gibi bir f-dizesi, ifade metnine, eşittir işaretine ve ardından değerlendirilen ifadenin temsiline genişler. Örneğin:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">user</span> <span class="o">=</span> <span class="s1">'eric_idle'</span>
<span class="gp">>>> </span><span class="n">member_since</span> <span class="o">=</span> <span class="n">date</span><span class="p">(</span><span class="mi">1975</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">31</span><span class="p">)</span>
<span class="gp">>>> </span><span class="sa">f</span><span class="s1">'</span><span class="si">{</span><span class="n">user</span><span class="si">=}</span><span class="s1"> </span><span class="si">{</span><span class="n">member_since</span><span class="si">=}</span><span class="s1">'</span>
<span class="go">"user='eric_idle' member_since=datetime.date(1975, 7, 31)"</span>
</pre></div>
</div>
<p>Her zamanki <a class="reference internal" href="../reference/lexical_analysis.html#f-strings"><span class="std std-ref">f-string biçim belirleyicileri</span></a>, ifadenin sonucunun nasıl görüntülendiği üzerinde daha fazla kontrol sağlar:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">delta</span> <span class="o">=</span> <span class="n">date</span><span class="o">.</span><span class="n">today</span><span class="p">()</span> <span class="o">-</span> <span class="n">member_since</span>
<span class="gp">>>> </span><span class="sa">f</span><span class="s1">'</span><span class="si">{</span><span class="n">user</span><span class="si">=!s}</span><span class="s1"> </span><span class="si">{</span><span class="n">delta</span><span class="o">.</span><span class="n">days</span><span class="si">=:</span><span class="s1">,d</span><span class="si">}</span><span class="s1">'</span>
<span class="go">'user=eric_idle delta.days=16,075'</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">=</span></code> belirleyicisi, hesaplamaların gösterilebilmesi için ifadenin tamamını görüntüler:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">'</span><span class="si">{</span><span class="n">theta</span><span class="si">=}</span><span class="s1"> </span><span class="si">{</span><span class="n">cos</span><span class="p">(</span><span class="n">radians</span><span class="p">(</span><span class="n">theta</span><span class="p">))</span><span class="si">=:</span><span class="s1">.3f</span><span class="si">}</span><span class="s1">'</span><span class="p">)</span>
<span class="go">theta=30 cos(radians(theta))=0.866</span>
</pre></div>
</div>
<p>(Eric V. Smith ve Larry Hastings’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36817">bpo-36817</a> ‘deki katkılarıyla.)</p>
</section>
<section id="pep-578-python-runtime-audit-hooks">
<h3>PEP 578: Python Çalışma Zamanı Denetim Kancaları<a class="headerlink" href="#pep-578-python-runtime-audit-hooks" title="Permalink to this heading">¶</a></h3>
<p>PEP, Denetim Kancası ve Doğrulanmış Açık Kanca ekler. Her ikisi de Python ve yerel koddan edinilebilir, saf Python kodunda yazılmış uygulamaların ve çerçevelerin ekstra bildirimlerden yararlanmasına izin verirken, aynı zamanda gömücülerin veya sistem yöneticilerinin denetimin her zaman etkin olduğu Python yapılarını dağıtmasına izin verir.</p>
<p>Tüm ayrıntılar için bkz. <span class="target" id="index-54"></span><a class="pep reference external" href="https://peps.python.org/pep-0578/"><strong>PEP 578</strong></a>.</p>
</section>
<section id="pep-587-python-initialization-configuration">
<h3>PEP 587: Python Başlatma Yapılandırması<a class="headerlink" href="#pep-587-python-initialization-configuration" title="Permalink to this heading">¶</a></h3>
<p><span class="target" id="index-55"></span><a class="pep reference external" href="https://peps.python.org/pep-0587/"><strong>PEP 587</strong></a>, tüm yapılandırma üzerinde daha hassas kontrol ve daha iyi hata raporlama sağlayan Python Başlatmayı yapılandırmak için yeni bir C API ekler.</p>
<p>Yeni yapılar:</p>
<ul class="simple">
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig" title="PyConfig"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyConfig</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyPreConfig" title="PyPreConfig"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyPreConfig</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus" title="PyStatus"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyStatus</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyWideStringList" title="PyWideStringList"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyWideStringList</span></code></a></p></li>
</ul>
<p>Yeni fonksiyonlar:</p>
<ul class="simple">
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_Clear" title="PyConfig_Clear"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_Clear()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_InitIsolatedConfig" title="PyConfig_InitIsolatedConfig"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_InitIsolatedConfig()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_InitPythonConfig" title="PyConfig_InitPythonConfig"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_InitPythonConfig()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_Read" title="PyConfig_Read"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_Read()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_SetArgv" title="PyConfig_SetArgv"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_SetArgv()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_SetBytesArgv" title="PyConfig_SetBytesArgv"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_SetBytesArgv()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_SetBytesString" title="PyConfig_SetBytesString"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_SetBytesString()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyConfig_SetString" title="PyConfig_SetString"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyConfig_SetString()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyPreConfig_InitIsolatedConfig" title="PyPreConfig_InitIsolatedConfig"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyPreConfig_InitIsolatedConfig()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyPreConfig_InitPythonConfig" title="PyPreConfig_InitPythonConfig"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyPreConfig_InitPythonConfig()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus_Error" title="PyStatus_Error"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyStatus_Error()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus_Exception" title="PyStatus_Exception"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyStatus_Exception()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus_Exit" title="PyStatus_Exit"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyStatus_Exit()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus_IsError" title="PyStatus_IsError"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyStatus_IsError()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus_IsExit" title="PyStatus_IsExit"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyStatus_IsExit()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus_NoMemory" title="PyStatus_NoMemory"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyStatus_NoMemory()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyStatus_Ok" title="PyStatus_Ok"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyStatus_Ok()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyWideStringList_Append" title="PyWideStringList_Append"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyWideStringList_Append()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.PyWideStringList_Insert" title="PyWideStringList_Insert"><code class="xref c c-func docutils literal notranslate"><span class="pre">PyWideStringList_Insert()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/veryhigh.html#c.Py_BytesMain" title="Py_BytesMain"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_BytesMain()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.Py_ExitStatusException" title="Py_ExitStatusException"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_ExitStatusException()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.Py_InitializeFromConfig" title="Py_InitializeFromConfig"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_InitializeFromConfig()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.Py_PreInitialize" title="Py_PreInitialize"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_PreInitialize()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.Py_PreInitializeFromArgs" title="Py_PreInitializeFromArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_PreInitializeFromArgs()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.Py_PreInitializeFromBytesArgs" title="Py_PreInitializeFromBytesArgs"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_PreInitializeFromBytesArgs()</span></code></a></p></li>
<li><p><a class="reference internal" href="../c-api/init_config.html#c.Py_RunMain" title="Py_RunMain"><code class="xref c c-func docutils literal notranslate"><span class="pre">Py_RunMain()</span></code></a></p></li>
</ul>
<p>Bu PEP ayrıca bu iç yapılara <code class="docutils literal notranslate"><span class="pre">_PyRuntimeState.preconfig</span></code> (<a class="reference internal" href="../c-api/init_config.html#c.PyPreConfig" title="PyPreConfig"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyPreConfig</span></code></a> type) ve <code class="docutils literal notranslate"><span class="pre">PyInterpreterState.config</span></code> (<a class="reference internal" href="../c-api/init_config.html#c.PyConfig" title="PyConfig"><code class="xref c c-type docutils literal notranslate"><span class="pre">PyConfig</span></code></a> type) alanlarını ekler. <code class="docutils literal notranslate"><span class="pre">PyInterpreterState.config</span></code>, global yapılandırma değişkenlerinin ve diğer özel değişkenlerin yerini alarak yeni referans yapılandırması haline gelir.</p>
<p>Belgeler için <a class="reference internal" href="../c-api/init_config.html#init-config"><span class="std std-ref">Python Başlatma Yapılandırması</span></a> konusuna bakın.</p>
<p>Tam açıklama için <span class="target" id="index-56"></span><a class="pep reference external" href="https://peps.python.org/pep-0587/"><strong>PEP 587</strong></a> konusuna bakın.</p>
<p>(Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36763">bpo-36763</a> ‘teki katkısıyla.)</p>
</section>
<section id="pep-590-vectorcall-a-fast-calling-protocol-for-cpython">
<h3>PEP 590: Vectorcall: CPython için hızlı arama protokolü<a class="headerlink" href="#pep-590-vectorcall-a-fast-calling-protocol-for-cpython" title="Permalink to this heading">¶</a></h3>
<p>Python/C API’sine <a class="reference internal" href="../c-api/call.html#vectorcall"><span class="std std-ref">The Vectorcall Protocol</span></a> eklendi. Çeşitli sınıflar için zaten yapılmış olan mevcut optimizasyonları resmileştirmeyi amaçlamaktadır. Bir çağrılabilir uygulayan herhangi bir <a class="reference internal" href="../c-api/typeobj.html#static-types"><span class="std std-ref">static type</span></a> bu protokolü kullanabilir.</p>
<p>Bu şu anda geçicidir. Amaç, Python 3.9 ‘da tamamen halka açık hale getirmektir.</p>
<p>Tam açıklama için <span class="target" id="index-57"></span><a class="pep reference external" href="https://peps.python.org/pep-0590/"><strong>PEP 590</strong></a> ‘a bakın.</p>
<p>(Jeroen Demeyer, Mark Shannon ve Petr Viktorin’in katkılarıyla <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36974">bpo-36974</a>.)</p>
</section>
<section id="pickle-protocol-5-with-out-of-band-data-buffers">
<h3>Bant dışı veri tamponlarıyla Pickle protokolü 5<a class="headerlink" href="#pickle-protocol-5-with-out-of-band-data-buffers" title="Permalink to this heading">¶</a></h3>
<p>Çok çekirdekli veya çok makineli işlemeden yararlanmak amacıyla Python süreçleri arasında büyük verileri aktarmak için <a class="reference internal" href="../library/pickle.html#module-pickle" title="pickle: Convert Python objects to streams of bytes and back."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pickle</span></code></a> kullanıldığında, bellek kopyalarını azaltarak ve muhtemelen veriye bağlı sıkıştırma gibi özel teknikler uygulayarak aktarımı optimize etmek önemlidir.</p>
<p><a class="reference internal" href="../library/pickle.html#module-pickle" title="pickle: Convert Python objects to streams of bytes and back."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pickle</span></code></a> protokolü 5, <span class="target" id="index-58"></span><a class="pep reference external" href="https://peps.python.org/pep-3118/"><strong>PEP 3118</strong></a> uyumlu verilerin iletişim katmanının takdirine bağlı olarak ana pickle akışından ayrı olarak iletilebildiği bant dışı tamponlar için destek sunar.</p>
<p>Tam açıklama için <span class="target" id="index-59"></span><a class="pep reference external" href="https://peps.python.org/pep-0574/"><strong>PEP 574</strong></a> ‘e bakın.</p>
<p>(Antoine Pitrou’nun <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36785">bpo-36785</a> ‘teki katkısıyla.)</p>
</section>
</section>
<section id="other-language-changes">
<h2>Diğer Dil Değişiklikleri<a class="headerlink" href="#other-language-changes" title="Permalink to this heading">¶</a></h2>
<ul>
<li><p>Bir <a class="reference internal" href="../reference/simple_stmts.html#continue"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">continue</span></code></a> ifadesi, uygulamadaki bir sorun nedeniyle <a class="reference internal" href="../reference/compound_stmts.html#finally"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">finally</span></code></a> cümlesinde yasadışı idi. Python 3.8’de bu kısıtlama kaldırıldı. (Serhiy Storchaka’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32489">bpo-32489</a> ‘daki katkısıyla.)</p></li>
<li><p><a class="reference internal" href="../library/functions.html#bool" title="bool"><code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code></a>, <a class="reference internal" href="../library/functions.html#int" title="int"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a> ve <a class="reference internal" href="../library/fractions.html#fractions.Fraction" title="fractions.Fraction"><code class="xref py py-class docutils literal notranslate"><span class="pre">fractions.Fraction</span></code></a> türleri artık <a class="reference internal" href="../library/functions.html#float" title="float"><code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code></a> ve <a class="reference internal" href="../library/decimal.html#decimal.Decimal" title="decimal.Decimal"><code class="xref py py-class docutils literal notranslate"><span class="pre">decimal.Decimal</span></code></a> türlerinde olduğu gibi bir <a class="reference internal" href="../library/stdtypes.html#int.as_integer_ratio" title="int.as_integer_ratio"><code class="xref py py-meth docutils literal notranslate"><span class="pre">as_integer_ratio()</span></code></a> yöntemine sahiptir. Bu küçük API uzantısı <code class="docutils literal notranslate"><span class="pre">numerator,</span> <span class="pre">denominator</span> <span class="pre">=</span> <span class="pre">x.as_integer_ratio()</span></code> yazmayı ve bunun birden fazla sayısal türde çalışmasını mümkün kılmaktadır. (Lisa Roach tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33073">bpo-33073</a> ve Raymond Hettinger tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37819">bpo-37819</a> ile katkıda bulunulmuştur)</p></li>
<li><p><a class="reference internal" href="../library/functions.html#int" title="int"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>, <a class="reference internal" href="../library/functions.html#float" title="float"><code class="xref py py-class docutils literal notranslate"><span class="pre">float</span></code></a> ve <a class="reference internal" href="../library/functions.html#complex" title="complex"><code class="xref py py-class docutils literal notranslate"><span class="pre">complex</span></code></a> kurucuları artık <a class="reference internal" href="../reference/datamodel.html#object.__index__" title="object.__index__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__index__()</span></code></a> özel yöntemini kullanacak, eğer mevcutsa ve ilgili yöntem <a class="reference internal" href="../reference/datamodel.html#object.__int__" title="object.__int__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__int__()</span></code></a>, <a class="reference internal" href="../reference/datamodel.html#object.__float__" title="object.__float__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__float__()</span></code></a> veya mevcut değilse <a class="reference internal" href="../reference/datamodel.html#object.__complex__" title="object.__complex__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">__complex__()</span></code></a> . (Serhiy Storchaka’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=20092">bpo-20092</a> ‘deki katkısıyla.)</p></li>
<li><p><a class="reference internal" href="../library/re.html#module-re" title="re: Regular expression operations."><code class="xref py py-mod docutils literal notranslate"><span class="pre">regular</span> <span class="pre">expressions</span></code></a> içine <code class="docutils literal notranslate"><span class="pre">\N{name}</span></code> kaçış desteği eklendi:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">notice</span> <span class="o">=</span> <span class="s1">'Copyright © 2019'</span>
<span class="gp">>>> </span><span class="n">copyright_year_pattern</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s1">'\N{copyright sign}\s*(\d</span><span class="si">{4}</span><span class="s1">)'</span><span class="p">)</span>
<span class="gp">>>> </span><span class="nb">int</span><span class="p">(</span><span class="n">copyright_year_pattern</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">notice</span><span class="p">)</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">2019</span>
</pre></div>
</div>
<p>(Jonathan Eunice ve Serhiy Storchaka tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=30688">bpo-30688</a> ‘de katkıda bulunulmuştur.)</p>
</li>
<li><p>Dict ve dictviews artık <a class="reference internal" href="../library/functions.html#reversed" title="reversed"><code class="xref py py-func docutils literal notranslate"><span class="pre">reversed()</span></code></a> kullanılarak tersine çevrilmiş ekleme sırasına göre yinelenebilir. (Rémi Lapeyre’nin <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33462">bpo-33462</a> ‘deki katkısıyla.)</p></li>
<li><p>Fonksiyon çağrılarında anahtar kelime isimleri için izin verilen sözdizimi daha da kısıtlandı. Özellikle, <code class="docutils literal notranslate"><span class="pre">f((keyword)=arg)</span></code> ifadesine artık izin verilmemektedir. Bir anahtar kelime argüman atama teriminin sol tarafında çıplak bir isimden daha fazlasına izin verilmesi asla amaçlanmamıştır. (Benjamin Peterson’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34641">bpo-34641</a> ‘deki katkısıyla.)</p></li>
<li><p><a class="reference internal" href="../reference/simple_stmts.html#yield"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">yield</span></code></a> ve <a class="reference internal" href="../reference/simple_stmts.html#return"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">return</span></code></a> ifadelerinde genelleştirilmiş yinelenebilir paket açma artık parantez içine alma gerektirmez. Bu, <em>yield</em> ve <em>return</em> sözdizimini normal atama sözdizimiyle daha iyi uyumlu hale getirir:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="k">def</span> <span class="nf">parse</span><span class="p">(</span><span class="n">family</span><span class="p">):</span>
<span class="go"> lastname, *members = family.split()</span>
<span class="go"> return lastname.upper(), *members</span>
<span class="gp">>>> </span><span class="n">parse</span><span class="p">(</span><span class="s1">'simpsons homer marge bart lisa maggie'</span><span class="p">)</span>
<span class="go">('SIMPSONS', 'homer', 'marge', 'bart', 'lisa', 'maggie')</span>
</pre></div>
</div>
<p>(David Cuthbert ve Jordan Chapman’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32117">bpo-32117</a> ‘deki katkılarıyla.)</p>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">[(10,</span> <span class="pre">20)</span> <span class="pre">(30,</span> <span class="pre">40)]</span></code> gibi bir kodda virgül atlandığında, derleyici yardımcı bir öneriyle birlikte bir <a class="reference internal" href="../library/exceptions.html#SyntaxWarning" title="SyntaxWarning"><code class="xref py py-exc docutils literal notranslate"><span class="pre">SyntaxWarning</span></code></a> görüntüler. Bu, sadece ilk tuple’ın çağrılabilir olmadığını belirten bir <a class="reference internal" href="../library/exceptions.html#TypeError" title="TypeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code></a> olmasıyla gelişir. (Serhiy Storchaka’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=15248">bpo-15248</a> ‘deki katkısıyla.)</p></li>
<li><p><a class="reference internal" href="../library/datetime.html#datetime.date" title="datetime.date"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.date</span></code></a> veya <a class="reference internal" href="../library/datetime.html#datetime.datetime" title="datetime.datetime"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.datetime</span></code></a> ve <a class="reference internal" href="../library/datetime.html#datetime.timedelta" title="datetime.timedelta"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.timedelta</span></code></a> nesnelerinin alt sınıfları arasındaki aritmetik işlemler artık temel sınıf yerine alt sınıfın bir örneğini döndürmektedir. Bu, <a class="reference internal" href="../library/datetime.html#datetime.datetime.astimezone" title="datetime.datetime.astimezone"><code class="xref py py-meth docutils literal notranslate"><span class="pre">astimezone()</span></code></a> gibi uygulaması (doğrudan veya dolaylı olarak) <a class="reference internal" href="../library/datetime.html#datetime.timedelta" title="datetime.timedelta"><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.timedelta</span></code></a> aritmetiğini kullanan işlemlerin dönüş türünü de etkiler. (Paul Ganssle tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32417">bpo-32417</a> ile katkıda bulunulmuştur)</p></li>
<li><p>Python yorumlayıcısı Ctrl-C (SIGINT) tarafından kesintiye uğradığında ve ortaya çıkan <a class="reference internal" href="../library/exceptions.html#KeyboardInterrupt" title="KeyboardInterrupt"><code class="xref py py-exc docutils literal notranslate"><span class="pre">KeyboardInterrupt</span></code></a> istisnası yakalanmadığında, Python işlemi artık bir SIGINT sinyali ile veya çağıran işlemin Ctrl-C nedeniyle öldüğünü algılayabileceği şekilde doğru çıkış koduyla çıkar. POSIX ve Windows üzerindeki kabuklar, etkileşimli oturumlardaki komut dosyalarını düzgün bir şekilde sonlandırmak için bunu kullanır. (Google tarafından Gregory P. Smith aracılığıyla <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=1054041">bpo-1054041</a> ‘de katkıda bulunulmuştur)</p></li>
<li><p>Bazı gelişmiş programlama stilleri, mevcut bir fonksiyon için <a class="reference internal" href="../library/types.html#types.CodeType" title="types.CodeType"><code class="xref py py-class docutils literal notranslate"><span class="pre">types.CodeType</span></code></a> nesnesinin güncellenmesini gerektirir. Kod nesneleri değişmez olduğundan, mevcut kod nesnesini model alan yeni bir kod nesnesi oluşturulması gerekir. 19 parametre ile bu biraz sıkıcıydı. Şimdi, yeni <code class="docutils literal notranslate"><span class="pre">replace()</span></code> yöntemi, birkaç değiştirilmiş parametre ile bir klon oluşturmayı mümkün kılıyor.</p>
<p>İşte <a class="reference internal" href="../library/statistics.html#statistics.mean" title="statistics.mean"><code class="xref py py-func docutils literal notranslate"><span class="pre">statistics.mean()</span></code></a> fonksiyonunu değiştirerek <em>data</em> parametresinin bir anahtar kelime argümanı olarak kullanılmasını engelleyen bir örnek:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">statistics</span> <span class="kn">import</span> <span class="n">mean</span>
<span class="gp">>>> </span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="p">[</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">90</span><span class="p">])</span>
<span class="go">40</span>
<span class="gp">>>> </span><span class="n">mean</span><span class="o">.</span><span class="vm">__code__</span> <span class="o">=</span> <span class="n">mean</span><span class="o">.</span><span class="vm">__code__</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">co_posonlyargcount</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="p">[</span><span class="mi">10</span><span class="p">,</span> <span class="mi">20</span><span class="p">,</span> <span class="mi">90</span><span class="p">])</span>
<span class="gt">Traceback (most recent call last):</span>
<span class="w"> </span><span class="c">...</span>
<span class="gr">TypeError</span>: <span class="n">mean() got some positional-only arguments passed as keyword arguments: 'data'</span>
</pre></div>
</div>
<p>(Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37032">bpo-37032</a> ‘deki katkısıyla.)</p>
</li>
<li><p>Tamsayılar için, <a class="reference internal" href="../library/functions.html#pow" title="pow"><code class="xref py py-func docutils literal notranslate"><span class="pre">pow()</span></code></a> fonksiyonunun üç argümanlı formu artık tabanın modüle göre asal olduğu durumda üssün negatif olmasına izin vermektedir. Daha sonra, üs <code class="docutils literal notranslate"><span class="pre">-1</span></code> olduğunda tabanın modüler bir tersini ve diğer negatif üsler için bu tersin uygun bir kuvvetini hesaplar. Örneğin, 38 modulo 137`nin <a class="reference external" href="https://en.wikipedia.org/wiki/Modular_multiplicative_inverse">modüler çarpımsal tersini</a> hesaplamak için şunu yazın:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="nb">pow</span><span class="p">(</span><span class="mi">38</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">137</span><span class="p">)</span>
<span class="go">119</span>
<span class="gp">>>> </span><span class="mi">119</span> <span class="o">*</span> <span class="mi">38</span> <span class="o">%</span> <span class="mi">137</span>
<span class="go">1</span>
</pre></div>
</div>
<p>Modüler tersler, <a class="reference external" href="https://en.wikipedia.org/wiki/Diophantine_equation">lineer Diophantine denklemlerinin</a> çözümünde ortaya çıkar. Örneğin, <code class="docutils literal notranslate"><span class="pre">4258𝑥</span> <span class="pre">+</span> <span class="pre">147𝑦</span> <span class="pre">=</span> <span class="pre">369</span></code> tamsayı çözümlerini bulmak için, önce <code class="docutils literal notranslate"><span class="pre">4258𝑥</span> <span class="pre">≡</span> <span class="pre">369</span> <span class="pre">(mod</span> <span class="pre">147)</span></code> olarak yeniden yazın ve sonra çözün:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="mi">369</span> <span class="o">*</span> <span class="nb">pow</span><span class="p">(</span><span class="mi">4258</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">147</span><span class="p">)</span> <span class="o">%</span> <span class="mi">147</span>
<span class="gp">>>> </span><span class="n">y</span> <span class="o">=</span> <span class="p">(</span><span class="mi">4258</span> <span class="o">*</span> <span class="n">x</span> <span class="o">-</span> <span class="mi">369</span><span class="p">)</span> <span class="o">//</span> <span class="o">-</span><span class="mi">147</span>
<span class="gp">>>> </span><span class="mi">4258</span> <span class="o">*</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">147</span> <span class="o">*</span> <span class="n">y</span>
<span class="go">369</span>
</pre></div>
</div>
<p>(Mark Dickinson’ın tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36027">bpo-36027</a> ‘deki katkısıyla.)</p>
</li>
<li><p>Dict kavramaları dict değişmezleri ile senkronize edilmiştir, böylece anahtar ilk olarak ve değer ikinci olarak hesaplanır:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="c1"># Dict comprehension</span>
<span class="gp">>>> </span><span class="n">cast</span> <span class="o">=</span> <span class="p">{</span><span class="nb">input</span><span class="p">(</span><span class="s1">'role? '</span><span class="p">):</span> <span class="nb">input</span><span class="p">(</span><span class="s1">'actor? '</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">2</span><span class="p">)}</span>
<span class="go">role? King Arthur</span>
<span class="go">actor? Chapman</span>
<span class="go">role? Black Knight</span>
<span class="go">actor? Cleese</span>
<span class="gp">>>> </span><span class="c1"># Dict literal</span>
<span class="gp">>>> </span><span class="n">cast</span> <span class="o">=</span> <span class="p">{</span><span class="nb">input</span><span class="p">(</span><span class="s1">'role? '</span><span class="p">):</span> <span class="nb">input</span><span class="p">(</span><span class="s1">'actor? '</span><span class="p">)}</span>
<span class="go">role? Sir Robin</span>
<span class="go">actor? Eric Idle</span>
</pre></div>
</div>
<p>Garantili yürütme sırası atama ifadelerinde yardımcı olur çünkü anahtar ifadesinde atanan değişkenler değer ifadesinde kullanılabilir olacaktır:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">names</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'Martin von Löwis'</span><span class="p">,</span> <span class="s1">'Łukasz Langa'</span><span class="p">,</span> <span class="s1">'Walter Dörwald'</span><span class="p">]</span>
<span class="gp">>>> </span><span class="p">{(</span><span class="n">n</span> <span class="o">:=</span> <span class="n">normalize</span><span class="p">(</span><span class="s1">'NFC'</span><span class="p">,</span> <span class="n">name</span><span class="p">))</span><span class="o">.</span><span class="n">casefold</span><span class="p">()</span> <span class="p">:</span> <span class="n">n</span> <span class="k">for</span> <span class="n">name</span> <span class="ow">in</span> <span class="n">names</span><span class="p">}</span>
<span class="go">{'martin von löwis': 'Martin von Löwis',</span>
<span class="go"> 'łukasz langa': 'Łukasz Langa',</span>
<span class="go"> 'walter dörwald': 'Walter Dörwald'}</span>
</pre></div>
</div>
<p>(Jörn Heissler’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35224">bpo-35224</a> ‘teki katkısıyla.)</p>
</li>
<li><p><a class="reference internal" href="../library/pickle.html#object.__reduce__" title="object.__reduce__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">object.__reduce__()</span></code></a> yöntemi artık iki ila altı eleman uzunluğunda bir tuple döndürebilir. Eskiden sınır beşti. Yeni, isteğe bağlı altıncı eleman <code class="docutils literal notranslate"><span class="pre">(obj,</span> <span class="pre">state)</span></code> imzasına sahip bir çağrılabilirdir. Bu, belirli bir nesnenin durum güncelleme davranışı üzerinde doğrudan kontrol sağlar. Eğer <em>None</em> değilse, bu çağrılabilir öğe nesnenin <code class="xref py py-meth docutils literal notranslate"><span class="pre">__setstate__()</span></code> yöntemine göre önceliğe sahip olacaktır. (Pierre Glaser ve Olivier Grisel’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35900">bpo-35900</a> ‘deki katkılarıyla.)</p></li>
</ul>
</section>
<section id="new-modules">
<h2>Yeni Modüller<a class="headerlink" href="#new-modules" title="Permalink to this heading">¶</a></h2>
<ul>
<li><p>Yeni <a class="reference internal" href="../library/importlib.metadata.html#module-importlib.metadata" title="importlib.metadata: Accessing package metadata"><code class="xref py py-mod docutils literal notranslate"><span class="pre">importlib.metadata</span></code></a> modülü, üçüncü taraf paketlerden meta verileri okumak için (geçici) destek sağlar. Örneğin, yüklü bir paketin sürüm numarasını, giriş noktalarının listesini ve daha fazlasını çıkarabilir:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="c1"># Note following example requires that the popular "requests"</span>
<span class="gp">>>> </span><span class="c1"># package has been installed.</span>
<span class="gp">>>></span>
<span class="gp">>>> </span><span class="kn">from</span> <span class="nn">importlib.metadata</span> <span class="kn">import</span> <span class="n">version</span><span class="p">,</span> <span class="n">requires</span><span class="p">,</span> <span class="n">files</span>
<span class="gp">>>> </span><span class="n">version</span><span class="p">(</span><span class="s1">'requests'</span><span class="p">)</span>
<span class="go">'2.22.0'</span>
<span class="gp">>>> </span><span class="nb">list</span><span class="p">(</span><span class="n">requires</span><span class="p">(</span><span class="s1">'requests'</span><span class="p">))</span>
<span class="go">['chardet (<3.1.0,>=3.0.2)']</span>
<span class="gp">>>> </span><span class="nb">list</span><span class="p">(</span><span class="n">files</span><span class="p">(</span><span class="s1">'requests'</span><span class="p">))[:</span><span class="mi">5</span><span class="p">]</span>
<span class="go">[PackagePath('requests-2.22.0.dist-info/INSTALLER'),</span>
<span class="go"> PackagePath('requests-2.22.0.dist-info/LICENSE'),</span>
<span class="go"> PackagePath('requests-2.22.0.dist-info/METADATA'),</span>
<span class="go"> PackagePath('requests-2.22.0.dist-info/RECORD'),</span>
<span class="go"> PackagePath('requests-2.22.0.dist-info/WHEEL')]</span>
</pre></div>
</div>
<p>(Barry Warsaw ve Jason R. Coombs’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34632">bpo-34632</a> ‘deki katkılarıyla.)</p>
</li>
</ul>
</section>
<section id="improved-modules">
<h2>Geliştirilmiş Modüller<a class="headerlink" href="#improved-modules" title="Permalink to this heading">¶</a></h2>
<section id="ast">
<h3>ast<a class="headerlink" href="#ast" title="Permalink to this heading">¶</a></h3>
<p>AST düğümleri artık düğümün sonunun kesin konumunu veren <code class="docutils literal notranslate"><span class="pre">end_lineno</span></code> ve <code class="docutils literal notranslate"><span class="pre">end_col_offset</span></code> niteliklerine sahiptir. (Bu sadece <code class="docutils literal notranslate"><span class="pre">lineno</span></code> ve <code class="docutils literal notranslate"><span class="pre">col_offset</span></code> niteliklerine sahip düğümler için geçerlidir)</p>
<p>Yeni fonksiyon <a class="reference internal" href="../library/ast.html#ast.get_source_segment" title="ast.get_source_segment"><code class="xref py py-func docutils literal notranslate"><span class="pre">ast.get_source_segment()</span></code></a> belirli bir AST düğümü için kaynak kodunu döndürür.</p>
<p>(Ivan Levkivskyi’nin <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33416">bpo-33416</a> ‘daki katkısıyla.)</p>
<p><a class="reference internal" href="../library/ast.html#ast.parse" title="ast.parse"><code class="xref py py-func docutils literal notranslate"><span class="pre">ast.parse()</span></code></a> fonksiyonu bazı yeni bayraklara sahiptir:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">type_comments=True</span></code> , belirli AST düğümleriyle ilişkili <span class="target" id="index-60"></span><a class="pep reference external" href="https://peps.python.org/pep-0484/"><strong>PEP 484</strong></a> ve <span class="target" id="index-61"></span><a class="pep reference external" href="https://peps.python.org/pep-0526/"><strong>PEP 526</strong></a> tipi yorumların metnini döndürmesine neden olur;</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">mode='func_type'</span></code>, <span class="target" id="index-62"></span><a class="pep reference external" href="https://peps.python.org/pep-0484/"><strong>PEP 484</strong></a> “imza tipi yorumlarını” (fonksiyon tanımı AST düğümleri için döndürülür) ayrıştırmak için kullanılabilir;</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">feature_version=(3,</span> <span class="pre">N)</span></code> daha önceki bir Python 3 sürümünü belirtmeye izin verir. Örneğin, <code class="docutils literal notranslate"><span class="pre">feature_version=(3,</span> <span class="pre">4)</span></code>, <a class="reference internal" href="../reference/compound_stmts.html#async"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">async</span></code></a> ve <a class="reference internal" href="../reference/expressions.html#await"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">await</span></code></a> sözcüklerini rezerve edilmemiş sözcükler olarak ele alacaktır.</p></li>
</ul>
<p>(Guido van Rossum’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35766">bpo-35766</a> ‘daki katkısıyla.)</p>
</section>
<section id="asyncio">
<h3>asyncio<a class="headerlink" href="#asyncio" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/asyncio-runner.html#asyncio.run" title="asyncio.run"><code class="xref py py-func docutils literal notranslate"><span class="pre">asyncio.run()</span></code></a> geçici API’den kararlı API’ye geçiş yaptı. Bu fonksiyon, bir <a class="reference internal" href="../glossary.html#term-coroutine"><span class="xref std std-term">coroutine</span></a> yürütmek ve olay döngüsünü otomatik olarak yönetirken sonucu döndürmek için kullanılabilir. Örneğin:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="k">await</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="k">return</span> <span class="mi">42</span>
<span class="n">asyncio</span><span class="o">.</span><span class="n">run</span><span class="p">(</span><span class="n">main</span><span class="p">())</span>
</pre></div>
</div>
<p>Bu, <em>kabaca</em> şuna eşdeğerdir:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">asyncio</span>
<span class="k">async</span> <span class="k">def</span> <span class="nf">main</span><span class="p">():</span>
<span class="k">await</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="k">return</span> <span class="mi">42</span>
<span class="n">loop</span> <span class="o">=</span> <span class="n">asyncio</span><span class="o">.</span><span class="n">new_event_loop</span><span class="p">()</span>
<span class="n">asyncio</span><span class="o">.</span><span class="n">set_event_loop</span><span class="p">(</span><span class="n">loop</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">loop</span><span class="o">.</span><span class="n">run_until_complete</span><span class="p">(</span><span class="n">main</span><span class="p">())</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">asyncio</span><span class="o">.</span><span class="n">set_event_loop</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
<span class="n">loop</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
</pre></div>
</div>
<p>Gerçek uygulama önemli ölçüde daha karmaşıktır. Bu nedenle, <a class="reference internal" href="../library/asyncio-runner.html#asyncio.run" title="asyncio.run"><code class="xref py py-func docutils literal notranslate"><span class="pre">asyncio.run()</span></code></a> asyncio programlarını çalıştırmak için tercih edilen yol olmalıdır.</p>
<p>(Yury Selivanov’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32314">bpo-32314</a> ‘teki katkısıyla.)</p>
<p><code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">asyncio</span></code> çalıştırıldığında yerel bir async REPL başlatılır. Bu, üst düzey bir <a class="reference internal" href="../reference/expressions.html#await"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">await</span></code></a> içeren kodla hızlı denemeler yapılmasına olanak tanır. Artık her çağrıda yeni bir olay döngüsü oluşturacak <code class="docutils literal notranslate"><span class="pre">asyncio.run()</span></code> fonksiyonunu doğrudan çağırmaya gerek yoktur:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ python -m asyncio
asyncio REPL 3.8.0
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> await asyncio.sleep(10, result='hello')
hello
</pre></div>
</div>
<p>(Yury Selivanov’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37028">bpo-37028</a> ‘deki katkısıyla.)</p>
<p>İstisna <a class="reference internal" href="../library/asyncio-exceptions.html#asyncio.CancelledError" title="asyncio.CancelledError"><code class="xref py py-class docutils literal notranslate"><span class="pre">asyncio.CancelledError</span></code></a> artık <a class="reference internal" href="../library/exceptions.html#Exception" title="Exception"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a> yerine <a class="reference internal" href="../library/exceptions.html#BaseException" title="BaseException"><code class="xref py py-class docutils literal notranslate"><span class="pre">BaseException</span></code></a> ‘dan miras alıyor ve artık <a class="reference internal" href="../library/concurrent.futures.html#concurrent.futures.CancelledError" title="concurrent.futures.CancelledError"><code class="xref py py-class docutils literal notranslate"><span class="pre">concurrent.futures.CancelledError</span></code></a> ‘dan miras almıyor. (Yury Selivanov’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32528">bpo-32528</a> ‘deki katkısıyla.)</p>
<p>Windows’ta, varsayılan olay döngüsü artık <a class="reference internal" href="../library/asyncio-eventloop.html#asyncio.ProactorEventLoop" title="asyncio.ProactorEventLoop"><code class="xref py py-class docutils literal notranslate"><span class="pre">ProactorEventLoop</span></code></a> şeklindedir. (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34687">bpo-34687</a> ‘deki katkısıyla.)</p>
<p><a class="reference internal" href="../library/asyncio-eventloop.html#asyncio.ProactorEventLoop" title="asyncio.ProactorEventLoop"><code class="xref py py-class docutils literal notranslate"><span class="pre">ProactorEventLoop</span></code></a> artık UDP’yi de destekliyor. (Adam Meily ve Andrew Svetlov’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=29883">bpo-29883</a> ‘teki katkılarıyla.)</p>
<p><a class="reference internal" href="../library/asyncio-eventloop.html#asyncio.ProactorEventLoop" title="asyncio.ProactorEventLoop"><code class="xref py py-class docutils literal notranslate"><span class="pre">ProactorEventLoop</span></code></a> artık <a class="reference internal" href="../library/exceptions.html#KeyboardInterrupt" title="KeyboardInterrupt"><code class="xref py py-exc docutils literal notranslate"><span class="pre">KeyboardInterrupt</span></code></a> (“CTRL+C”) ile kesilebilir. (Vladimir Matveev’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=23057">bpo-23057</a> ‘deki katkısıyla.)</p>
<p>Bir <a class="reference internal" href="../library/asyncio-task.html#asyncio.Task" title="asyncio.Task"><code class="xref py py-class docutils literal notranslate"><span class="pre">asyncio.Task</span></code></a> içindeki sarılmış korutini almak için <a class="reference internal" href="../library/asyncio-task.html#asyncio.Task.get_coro" title="asyncio.Task.get_coro"><code class="xref py py-meth docutils literal notranslate"><span class="pre">asyncio.Task.get_coro()</span></code></a> eklendi. (Alex Grönholm’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36999">bpo-36999</a> ‘daki katkısıyla.)</p>
<p>Asyncio görevleri artık <a class="reference internal" href="../library/asyncio-task.html#asyncio.create_task" title="asyncio.create_task"><code class="xref py py-func docutils literal notranslate"><span class="pre">asyncio.create_task()</span></code></a> veya <a class="reference internal" href="../library/asyncio-eventloop.html#asyncio.loop.create_task" title="asyncio.loop.create_task"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_task()</span></code></a> olay döngüsü yöntemine <code class="docutils literal notranslate"><span class="pre">name</span></code> anahtar sözcük argümanı geçirilerek ya da görev nesnesi üzerinde <a class="reference internal" href="../library/asyncio-task.html#asyncio.Task.set_name" title="asyncio.Task.set_name"><code class="xref py py-meth docutils literal notranslate"><span class="pre">set_name()</span></code></a> yöntemi çağrılarak adlandırılabilir. Görev adı <a class="reference internal" href="../library/asyncio-task.html#asyncio.Task" title="asyncio.Task"><code class="xref py py-class docutils literal notranslate"><span class="pre">asyncio.Task</span></code></a> metodunun <code class="docutils literal notranslate"><span class="pre">repr()</span></code> çıktısında görülebilir ve <a class="reference internal" href="../library/asyncio-task.html#asyncio.Task.get_name" title="asyncio.Task.get_name"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_name()</span></code></a> metodu kullanılarak da alınabilir. (Alex Grönholm’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34270">bpo-34270</a> ‘teki katkısıyla.)</p>
<p><a class="reference internal" href="../library/asyncio-eventloop.html#asyncio.loop.create_connection" title="asyncio.loop.create_connection"><code class="xref py py-func docutils literal notranslate"><span class="pre">asyncio.loop.create_connection()</span></code></a> ‘a <a class="reference external" href="https://en.wikipedia.org/wiki/Happy_Eyeballs">Happy Eyeballs</a> desteği eklendi. Davranışı belirtmek için iki yeni parametre eklendi: <em>happy_eyeballs_delay</em> ve <em>interleave</em>. Happy Eyeballs algoritması, IPv4 ve IPv6’yı destekleyen uygulamalarda, her ikisini de kullanarak aynı anda bağlanmaya çalışarak yanıt verebilirliği artırır. (twisteroid ambassador’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33530">bpo-33530</a> ‘daki katkısıyla.)</p>
</section>
<section id="builtins">
<h3>builtins<a class="headerlink" href="#builtins" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/functions.html#compile" title="compile"><code class="xref py py-func docutils literal notranslate"><span class="pre">compile()</span></code></a> yerleşik yapısı <code class="docutils literal notranslate"><span class="pre">ast.PyCF_ALLOW_TOP_LEVEL_AWAIT</span></code> bayrağını kabul edecek şekilde geliştirilmiştir. Bu yeni bayrak geçildiğinde, <a class="reference internal" href="../library/functions.html#compile" title="compile"><code class="xref py py-func docutils literal notranslate"><span class="pre">compile()</span></code></a> genellikle geçersiz sözdizimi olarak kabul edilen üst düzey <code class="docutils literal notranslate"><span class="pre">await</span></code>, <code class="docutils literal notranslate"><span class="pre">async</span> <span class="pre">for</span></code> ve <code class="docutils literal notranslate"><span class="pre">async</span> <span class="pre">with</span></code> yapılarına izin verecektir. Daha sonra <code class="docutils literal notranslate"><span class="pre">CO_COROUTINE</span></code> bayrağı ile işaretlenmiş asenkron kod nesnesi döndürülebilir. (Matthias Bussonnier’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34616">bpo-34616</a> ‘daki katkısıyla.)</p>
</section>
<section id="collections">
<h3>collections<a class="headerlink" href="#collections" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/collections.html#collections.namedtuple" title="collections.namedtuple"><code class="xref py py-func docutils literal notranslate"><span class="pre">collections.namedtuple()</span></code></a> için <a class="reference internal" href="../library/collections.html#collections.somenamedtuple._asdict" title="collections.somenamedtuple._asdict"><code class="xref py py-meth docutils literal notranslate"><span class="pre">_asdict()</span></code></a> yöntemi artık <a class="reference internal" href="../library/collections.html#collections.OrderedDict" title="collections.OrderedDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">collections.OrderedDict</span></code></a> yerine bir <a class="reference internal" href="../library/stdtypes.html#dict" title="dict"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a> döndürüyor. Bu işe yarıyor çünkü normal dictler Python 3.7’den beri garantili sıralamaya sahip. Eğer <code class="xref py py-class docutils literal notranslate"><span class="pre">OrderedDict</span></code> ‘in ekstra özellikleri gerekiyorsa, önerilen çözüm sonucu istenen türe dönüştürmektir: <code class="docutils literal notranslate"><span class="pre">OrderedDict(nt._asdict())</span></code>. (Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35864">bpo-35864</a> ‘teki katkısıyla.)</p>
</section>
<section id="cprofile">
<h3>cProfile<a class="headerlink" href="#cprofile" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/profile.html#profile.Profile" title="profile.Profile"><code class="xref py py-class docutils literal notranslate"><span class="pre">cProfile.Profile</span></code></a> sınıfı artık bir bağlam yöneticisi olarak kullanılabilir. Çalıştırarak bir kod bloğunun profilini oluşturun:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">cProfile</span>
<span class="k">with</span> <span class="n">cProfile</span><span class="o">.</span><span class="n">Profile</span><span class="p">()</span> <span class="k">as</span> <span class="n">profiler</span><span class="p">:</span>
<span class="c1"># code to be profiled</span>
<span class="o">...</span>
</pre></div>
</div>
<p>(Scott Sanderson’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=29235">bpo-29235</a> ‘teki katkısıyla.)</p>
</section>
<section id="csv">
<h3>csv<a class="headerlink" href="#csv" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/csv.html#csv.DictReader" title="csv.DictReader"><code class="xref py py-class docutils literal notranslate"><span class="pre">csv.DictReader</span></code></a> artık <a class="reference internal" href="../library/collections.html#collections.OrderedDict" title="collections.OrderedDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">collections.OrderedDict</span></code></a> yerine <a class="reference internal" href="../library/stdtypes.html#dict" title="dict"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a> örneklerini döndürüyor. Araç artık daha hızlı ve alan sırasını korurken daha az bellek kullanıyor. (Michael Selik’ in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34003">bpo-34003</a> ‘teki katkısıyla.)</p>
</section>
<section id="curses">
<h3>curses<a class="headerlink" href="#curses" title="Permalink to this heading">¶</a></h3>
<p>Temel ncurses kütüphanesi için yapılandırılmış sürüm bilgilerini tutan yeni bir değişken eklendi: <a class="reference internal" href="../library/curses.html#curses.ncurses_version" title="curses.ncurses_version"><code class="xref py py-data docutils literal notranslate"><span class="pre">ncurses_version</span></code></a>. (Serhiy Storchaka’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=31680">bpo-31680</a> ‘deki katkısıyla.)</p>
</section>
<section id="ctypes">
<h3>ctypes<a class="headerlink" href="#ctypes" title="Permalink to this heading">¶</a></h3>
<p>Windows üzerinde, <a class="reference internal" href="../library/ctypes.html#ctypes.CDLL" title="ctypes.CDLL"><code class="xref py py-class docutils literal notranslate"><span class="pre">CDLL</span></code></a> ve alt sınıfları artık temel <code class="docutils literal notranslate"><span class="pre">LoadLibraryEx</span></code> çağrısı için bayrakları belirtmek üzere bir <em>winmode</em> parametresi kabul etmektedir. Varsayılan bayraklar, DLL’nin depolandığı yol (ilk DLL’yi yüklemek için tam veya kısmi bir yol kullanılmışsa) ve <a class="reference internal" href="../library/os.html#os.add_dll_directory" title="os.add_dll_directory"><code class="xref py py-func docutils literal notranslate"><span class="pre">add_dll_directory()</span></code></a> tarafından eklenen yollar dahil olmak üzere, yalnızca güvenilir konumlardan DLL bağımlılıklarını yükleyecek şekilde ayarlanmıştır. (Steve Dower’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36085">bpo-36085</a> ‘teki katkısıyla.)</p>
</section>
<section id="datetime">
<h3>datetime<a class="headerlink" href="#datetime" title="Permalink to this heading">¶</a></h3>
<p>ISO yılı, hafta numarası ve haftanın gününden sırasıyla <code class="xref py py-class docutils literal notranslate"><span class="pre">date</span></code> ve <a class="reference internal" href="../library/datetime.html#module-datetime" title="datetime: Basic date and time types."><code class="xref py py-class docutils literal notranslate"><span class="pre">datetime</span></code></a> nesnelerini oluşturan yeni alternatif kurucular <a class="reference internal" href="../library/datetime.html#datetime.date.fromisocalendar" title="datetime.date.fromisocalendar"><code class="xref py py-meth docutils literal notranslate"><span class="pre">datetime.date.fromisocalendar()</span></code></a> ve <a class="reference internal" href="../library/datetime.html#datetime.datetime.fromisocalendar" title="datetime.datetime.fromisocalendar"><code class="xref py py-meth docutils literal notranslate"><span class="pre">datetime.datetime.fromisocalendar()</span></code></a> eklendi; bunlar her sınıfın <code class="docutils literal notranslate"><span class="pre">isocalendar</span></code> yönteminin tersidir. (Paul Ganssle’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36004">bpo-36004</a> ‘teki katkısıyla.)</p>
</section>
<section id="functools">
<h3>functools<a class="headerlink" href="#functools" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/functools.html#functools.lru_cache" title="functools.lru_cache"><code class="xref py py-func docutils literal notranslate"><span class="pre">functools.lru_cache()</span></code></a> artık bir dekoratör döndüren bir fonksiyon yerine düz bir dekoratör olarak kullanılabilir. Yani bunların ikisi de artık destekleniyor:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="nd">@lru_cache</span>
<span class="k">def</span> <span class="nf">f</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
<span class="o">...</span>
<span class="nd">@lru_cache</span><span class="p">(</span><span class="n">maxsize</span><span class="o">=</span><span class="mi">256</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">f</span><span class="p">(</span><span class="n">x</span><span class="p">):</span>
<span class="o">...</span>
</pre></div>
</div>
<p>(Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36772">bpo-36772</a> ‘deki katkısıyla.)</p>
<p>Örneğin ömrü boyunca önbelleğe alınan hesaplanmış özellikler için yeni bir <a class="reference internal" href="../library/functools.html#functools.cached_property" title="functools.cached_property"><code class="xref py py-func docutils literal notranslate"><span class="pre">functools.cached_property()</span></code></a> dekoratörü eklendi:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">functools</span>
<span class="kn">import</span> <span class="nn">statistics</span>
<span class="k">class</span> <span class="nc">Dataset</span><span class="p">:</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sequence_of_numbers</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">sequence_of_numbers</span>
<span class="nd">@functools</span><span class="o">.</span><span class="n">cached_property</span>
<span class="k">def</span> <span class="nf">variance</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">statistics</span><span class="o">.</span><span class="n">variance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
</pre></div>
</div>
<p>(Carl Meyer’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=21145">bpo-21145</a> ‘teki katkısıyla.)</p>
<p>Metotları <a class="reference internal" href="../glossary.html#term-single-dispatch"><span class="xref std std-term">single dispatch</span></a> kullanarak <a class="reference internal" href="../glossary.html#term-generic-function"><span class="xref std std-term">generic functions</span></a> haline dönüştüren yeni bir <a class="reference internal" href="../library/functools.html#functools.singledispatchmethod" title="functools.singledispatchmethod"><code class="xref py py-func docutils literal notranslate"><span class="pre">functools.singledispatchmethod()</span></code></a> dekoratörü eklendi:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">functools</span> <span class="kn">import</span> <span class="n">singledispatchmethod</span>
<span class="kn">from</span> <span class="nn">contextlib</span> <span class="kn">import</span> <span class="n">suppress</span>
<span class="k">class</span> <span class="nc">TaskManager</span><span class="p">:</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">tasks</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">tasks</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">tasks</span><span class="p">)</span>
<span class="nd">@singledispatchmethod</span>
<span class="k">def</span> <span class="nf">discard</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="k">with</span> <span class="n">suppress</span><span class="p">(</span><span class="ne">ValueError</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">tasks</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
<span class="nd">@discard</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="nb">list</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">tasks</span><span class="p">):</span>
<span class="n">targets</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">tasks</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">tasks</span> <span class="o">=</span> <span class="p">[</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">tasks</span> <span class="k">if</span> <span class="n">x</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">targets</span><span class="p">]</span>
</pre></div>
</div>
<p>(Ethan Smith’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32380">bpo-32380</a> ‘deki katkısıyla)</p>
</section>
<section id="gc">
<h3>gc<a class="headerlink" href="#gc" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/gc.html#gc.get_objects" title="gc.get_objects"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_objects()</span></code></a> artık nesnelerin alınacağı nesli belirten isteğe bağlı bir <em>nesil</em> parametresi alabilir. (Pablo Galindo’nun <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36016">bpo-36016</a> ‘daki katkılarıyla.)</p>
</section>
<section id="gettext">
<h3>gettext<a class="headerlink" href="#gettext" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/gettext.html#gettext.pgettext" title="gettext.pgettext"><code class="xref py py-func docutils literal notranslate"><span class="pre">pgettext()</span></code></a> ve varyantları eklendi. (Franz Glasner, Éric Araujo ve Cheryl Sabella’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=2504">bpo-2504</a> ‘teki katkılarıyla.)</p>
</section>
<section id="gzip">
<h3>gzip<a class="headerlink" href="#gzip" title="Permalink to this heading">¶</a></h3>
<p>Tekrarlanabilir çıktı için <a class="reference internal" href="../library/gzip.html#gzip.compress" title="gzip.compress"><code class="xref py py-func docutils literal notranslate"><span class="pre">gzip.compress()</span></code></a> dosyasına <em>mtime</em> parametresi eklendi. (Guo Ci Teo’nun <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34898">bpo-34898</a> ‘deki katkılarıyla.)</p>
<p>Belirli türdeki geçersiz veya bozuk gzip dosyaları için <a class="reference internal" href="../library/exceptions.html#OSError" title="OSError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">OSError</span></code></a> yerine artık <a class="reference internal" href="../library/gzip.html#gzip.BadGzipFile" title="gzip.BadGzipFile"><code class="xref py py-exc docutils literal notranslate"><span class="pre">BadGzipFile</span></code></a> istisnası oluşturulmaktadır. (Filip Gruszczyński, Michele Orrù ve Zackery Spytz’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=6584">bpo-6584</a> ‘teki katkılarıyla.)</p>
</section>
<section id="idle-and-idlelib">
<h3>IDLE ve idlelib<a class="headerlink" href="#idle-and-idlelib" title="Permalink to this heading">¶</a></h3>
<p>N satırın üzerindeki çıktı (varsayılan olarak 50) bir düğmeye sıkıştırılır. N, Ayarlar iletişim kutusunun Genel sayfasının PyShell bölümünde değiştirilebilir. Daha az, ancak muhtemelen ekstra uzun satırlar, çıktıya sağ tıklanarak sıkıştırılabilir. Sıkıştırılmış çıktı, düğmeye çift tıklanarak yerinde veya düğmeye sağ tıklanarak panoya veya ayrı bir pencereye genişletilebilir. (Tal Einat’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=1529353">bpo-1529353</a> ‘teki katkısıyla.)</p>
<p>Bir modülü özelleştirilmiş ayarlarla çalıştırmak için Çalıştır menüsüne “Özelleştirilmiş Çalıştır” seçeneğini ekleyin. Girilen tüm komut satırı argümanları sys.argv’ye eklenir. Ayrıca bir sonraki özelleştirilmiş çalıştırma için kutuda yeniden görünürler. Ayrıca normal Shell ana modülünün yeniden başlatılması da engellenebilir. (Cheryl Sabella, Terry Jan Reedy ve diğerleri tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=5680">bpo-5680</a> ve <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37627">bpo-37627</a> ‘de katkıda bulunulmuştur)</p>
<p>IDLE düzenleyici pencereleri için isteğe bağlı satır numaraları eklendi. Yapılandırma iletişim kutusunun Genel sekmesinde aksi ayarlanmadığı sürece pencereler satır numaraları olmadan açılır. Mevcut bir pencere için satır numaraları Seçenekler menüsünde gösterilir ve gizlenir. (Tal Einat ve Saimadhav Heblikar’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=17535">bpo-17535</a> ‘teki katkılarıyla.)</p>
<p>OS yerel kodlaması artık Python dizeleri ve Tcl nesneleri arasında dönüştürme yapmak için kullanılıyor. Bu, IDLE’ın emoji ve diğer BMP olmayan karakterlerle çalışmasını sağlar. Bu karakterler görüntülenebilir veya kopyalanıp panoya veya panodan yapıştırılabilir. Dizeleri Tcl’den Python’a ve geri dönüştürmek artık asla başarısız olmuyor. (Birçok kişi sekiz yıl boyunca bunun üzerinde çalıştı ancak sorun sonunda Serhiy Storchaka tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=13153">bpo-13153</a> ‘de çözüldü)</p>
<p>3.8.1’deki yenilikler:</p>
<p>İmleç yanıp sönmesini kapatmak için seçenek ekleyin. (Zackery Spytz’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=4603">bpo-4603</a> ‘teki katkısıyla.)</p>
<p>Escape tuşu artık IDLE tamamlama pencerelerini kapatıyor. (Johnny Najera’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=38944">bpo-38944</a> ‘teki katkısıyla.)</p>
<p>Yukarıdaki değişiklikler 3.7 bakım sürümlerine geri aktarılmıştır.</p>
<p>Modül adı tamamlama listesine anahtar kelimeler ekleyin. (Terry J. Reedy’nin <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37765">bpo-37765</a> ‘teki katkısıyla.)</p>
</section>
<section id="inspect">
<h3>inspect<a class="headerlink" href="#inspect" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/inspect.html#inspect.getdoc" title="inspect.getdoc"><code class="xref py py-func docutils literal notranslate"><span class="pre">inspect.getdoc()</span></code></a> fonksiyonu artık <code class="docutils literal notranslate"><span class="pre">__slots__</span></code> için doktrin bulabilir, eğer bu nitelik değerlerin doktrin olduğu bir <a class="reference internal" href="../library/stdtypes.html#dict" title="dict"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a> ise. Bu, <a class="reference internal" href="../library/functions.html#property" title="property"><code class="xref py py-func docutils literal notranslate"><span class="pre">property()</span></code></a>, <a class="reference internal" href="../library/functions.html#classmethod" title="classmethod"><code class="xref py py-func docutils literal notranslate"><span class="pre">classmethod()</span></code></a> ve <a class="reference internal" href="../library/functions.html#staticmethod" title="staticmethod"><code class="xref py py-func docutils literal notranslate"><span class="pre">staticmethod()</span></code></a> için zaten sahip olduğumuza benzer doktrin seçenekleri sağlar:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">AudioClip</span><span class="p">:</span>
<span class="vm">__slots__</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'bit_rate'</span><span class="p">:</span> <span class="s1">'expressed in kilohertz to one decimal place'</span><span class="p">,</span>
<span class="s1">'duration'</span><span class="p">:</span> <span class="s1">'in seconds, rounded up to an integer'</span><span class="p">}</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">bit_rate</span><span class="p">,</span> <span class="n">duration</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">bit_rate</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="n">bit_rate</span> <span class="o">/</span> <span class="mf">1000.0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">duration</span> <span class="o">=</span> <span class="n">ceil</span><span class="p">(</span><span class="n">duration</span><span class="p">)</span>
</pre></div>
</div>
<p>(Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36326">bpo-36326</a> ‘daki katkısıyla.)</p>
</section>
<section id="io">
<h3>io<a class="headerlink" href="#io" title="Permalink to this heading">¶</a></h3>
<p>Geliştirme modunda (<a class="reference internal" href="../using/cmdline.html#cmdoption-X"><code class="xref std std-option docutils literal notranslate"><span class="pre">-X</span></code></a> <code class="docutils literal notranslate"><span class="pre">env</span></code>) ve <a class="reference internal" href="../using/configure.html#debug-build"><span class="std std-ref">debug build</span></a> içinde, <a class="reference internal" href="../library/io.html#io.IOBase" title="io.IOBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">io.IOBase</span></code></a> sonlandırıcısı artık <code class="docutils literal notranslate"><span class="pre">close()</span></code> yöntemi başarısız olursa istisnayı kaydeder. Sürüm derlemesinde istisna varsayılan olarak sessizce yok sayılır. (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=18748">bpo-18748</a> ‘deki katkısıyla.)</p>
</section>
<section id="itertools">
<h3>itertools<a class="headerlink" href="#itertools" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/itertools.html#itertools.accumulate" title="itertools.accumulate"><code class="xref py py-func docutils literal notranslate"><span class="pre">itertools.accumulate()</span></code></a> fonksiyonuna bir başlangıç değeri belirtmek için <em>initial</em> anahtar kelime argümanı seçeneği eklendi:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">accumulate</span>
<span class="gp">>>> </span><span class="nb">list</span><span class="p">(</span><span class="n">accumulate</span><span class="p">([</span><span class="mi">10</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">30</span><span class="p">,</span> <span class="mi">15</span><span class="p">],</span> <span class="n">initial</span><span class="o">=</span><span class="mi">1000</span><span class="p">))</span>
<span class="go">[1000, 1010, 1015, 1045, 1060]</span>
</pre></div>
</div>
<p>(Lisa Roach’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34659">bpo-34659</a> ‘daki katkısıyla.)</p>
</section>
<section id="json-tool">
<h3>json.tool<a class="headerlink" href="#json-tool" title="Permalink to this heading">¶</a></h3>
<p>Her girdi satırını ayrı bir JSON nesnesi olarak ayrıştırmak için <code class="docutils literal notranslate"><span class="pre">--json-lines</span></code> seçeneğini ekleyin. (Weipeng Hong’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=31553">bpo-31553</a> ‘teki katkısıyla.)</p>
</section>
<section id="logging">
<h3>kayıt tutma<a class="headerlink" href="#logging" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/logging.html#logging.basicConfig" title="logging.basicConfig"><code class="xref py py-func docutils literal notranslate"><span class="pre">logging.basicConfig()</span></code></a> fonksiyonuna bir <em>force</em> anahtar kelime argümanı eklendi. Doğru olarak ayarlandığında, diğer argümanlarla belirtilen yapılandırma gerçekleştirilmeden önce kök kaydediciye bağlı mevcut işleyiciler kaldırılır ve kapatılır.</p>
<p>Bu, uzun süredir devam eden bir sorunu çözmektedir. Bir kaydedici veya <em>basicConfig()</em> çağrıldıktan sonra, <em>basicConfig()</em> ‘e yapılan sonraki çağrılar sessizce yok sayılıyordu. Bu durum, etkileşimli komut istemini veya Jupyter not defterini kullanarak çeşitli kaydedici yapılandırma seçeneklerini güncellemeyi, denemeyi veya öğretmeyi zorlaştırıyordu.</p>
<p>(Raymond Hettinger tarafından önerildi, Dong-hee Na tarafından uygulandı ve <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33897">bpo-33897</a> ‘de Vinay Sajip tarafından gözden geçirildi.)</p>
</section>
<section id="math">
<h3>math<a class="headerlink" href="#math" title="Permalink to this heading">¶</a></h3>
<p>İki nokta arasındaki Öklid mesafesini hesaplamak için yeni <a class="reference internal" href="../library/math.html#math.dist" title="math.dist"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.dist()</span></code></a> fonksiyonu eklendi. (Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33089">bpo-33089</a> ‘daki katkısıyla.)</p>
<p><a class="reference internal" href="../library/math.html#math.hypot" title="math.hypot"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.hypot()</span></code></a> fonksiyonu çoklu boyutları işleyecek şekilde genişletildi. Önceden sadece 2 boyutlu durumu destekliyordu. (Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33089">bpo-33089</a> ‘daki katkısıyla.)</p>
<p>Yeni <a class="reference internal" href="../library/math.html#math.prod" title="math.prod"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.prod()</span></code></a> fonksiyonu eklendi, <a class="reference internal" href="../library/functions.html#sum" title="sum"><code class="xref py py-func docutils literal notranslate"><span class="pre">sum()</span></code></a> fonksiyonuna benzer bir fonksiyon olarak, bir ‘başlangıç’ değeri (varsayılan: 1) ile bir sayı yinelenebilirinin çarpımını döndürür:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">prior</span> <span class="o">=</span> <span class="mf">0.8</span>
<span class="gp">>>> </span><span class="n">likelihoods</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.625</span><span class="p">,</span> <span class="mf">0.84</span><span class="p">,</span> <span class="mf">0.30</span><span class="p">]</span>
<span class="gp">>>> </span><span class="n">math</span><span class="o">.</span><span class="n">prod</span><span class="p">(</span><span class="n">likelihoods</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="n">prior</span><span class="p">)</span>
<span class="go">0.126</span>
</pre></div>
</div>
<p>(Pablo Galindo’nun <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35606">bpo-35606</a> ‘daki katkısıyla.)</p>
<p>İki yeni kombinatorik fonksiyon eklendi <a class="reference internal" href="../library/math.html#math.perm" title="math.perm"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.perm()</span></code></a> ve <a class="reference internal" href="../library/math.html#math.comb" title="math.comb"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.comb()</span></code></a>:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">math</span><span class="o">.</span><span class="n">perm</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> <span class="c1"># Permutations of 10 things taken 3 at a time</span>
<span class="go">720</span>
<span class="gp">>>> </span><span class="n">math</span><span class="o">.</span><span class="n">comb</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> <span class="c1"># Combinations of 10 things taken 3 at a time</span>
<span class="go">120</span>
</pre></div>
</div>
<p>(Yash Aggarwal, Keller Fuchs, Serhiy Storchaka ve Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37128">bpo-37128</a>, <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37178">bpo-37178</a> ve <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35431">bpo-35431</a> ‘deki katkılarıyla.)</p>
<p>Kayan noktaya dönüştürmeden doğru tamsayı kareköklerini hesaplamak için yeni bir <a class="reference internal" href="../library/math.html#math.isqrt" title="math.isqrt"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.isqrt()</span></code></a> fonksiyonu eklendi. Yeni fonksiyon keyfi olarak büyük tamsayıları destekler. Bu fonksiyon <code class="docutils literal notranslate"><span class="pre">floor(sqrt(n))</span></code> fonksiyonundan daha hızlıdır ancak <a class="reference internal" href="../library/math.html#math.sqrt" title="math.sqrt"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.sqrt()</span></code></a>: fonksiyonundan daha yavaştır:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">r</span> <span class="o">=</span> <span class="mi">650320427</span>
<span class="gp">>>> </span><span class="n">s</span> <span class="o">=</span> <span class="n">r</span> <span class="o">**</span> <span class="mi">2</span>
<span class="gp">>>> </span><span class="n">isqrt</span><span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="c1"># correct</span>
<span class="go">650320426</span>
<span class="gp">>>> </span><span class="n">floor</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="n">s</span> <span class="o">-</span> <span class="mi">1</span><span class="p">))</span> <span class="c1"># incorrect</span>
<span class="go">650320427</span>
</pre></div>
</div>
<p>(Mark Dickinson’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36887">bpo-36887</a> ‘deki katkısıyla.)</p>
<p>Fonksiyon <a class="reference internal" href="../library/math.html#math.factorial" title="math.factorial"><code class="xref py py-func docutils literal notranslate"><span class="pre">math.factorial()</span></code></a> artık int benzeri olmayan argümanları kabul etmiyor. (Pablo Galindo’nun <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33083">bpo-33083</a> ‘deki katkısıyla)</p>
</section>
<section id="mmap">
<h3>mmap<a class="headerlink" href="#mmap" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/mmap.html#mmap.mmap" title="mmap.mmap"><code class="xref py py-class docutils literal notranslate"><span class="pre">mmap.mmap</span></code></a> sınıfı artık <code class="docutils literal notranslate"><span class="pre">madvise()</span></code> sistem çağrısına erişmek için bir <a class="reference internal" href="../library/mmap.html#mmap.mmap.madvise" title="mmap.mmap.madvise"><code class="xref py py-meth docutils literal notranslate"><span class="pre">madvise()</span></code></a> yöntemine sahiptir. (Zackery Spytz’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32941">bpo-32941</a> ‘deki katkısıyla.)</p>
</section>
<section id="multiprocessing">
<h3>multiprocessing<a class="headerlink" href="#multiprocessing" title="Permalink to this heading">¶</a></h3>
<p>Yeni <a class="reference internal" href="../library/multiprocessing.shared_memory.html#module-multiprocessing.shared_memory" title="multiprocessing.shared_memory: Provides shared memory for direct access across processes."><code class="xref py py-mod docutils literal notranslate"><span class="pre">multiprocessing.shared_memory</span></code></a> modülü eklendi. (Davin Potts’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35813">bpo-35813</a> ‘deki katkısıyla.)</p>
<p>macOS’ta <em>spawn</em> başlatma yöntemi artık varsayılan olarak kullanılmaktadır. (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33725">bpo-33725</a> ‘teki katkısıyla.)</p>
</section>
<section id="os">
<h3>os<a class="headerlink" href="#os" title="Permalink to this heading">¶</a></h3>
<p>Eklenti modüllerini içe aktarırken veya <a class="reference internal" href="../library/ctypes.html#module-ctypes" title="ctypes: A foreign function library for Python."><code class="xref py py-mod docutils literal notranslate"><span class="pre">ctypes</span></code></a> kullanarak DLL’leri yüklerken yerel bağımlılıklar için ek arama yolları sağlamak için Windows’ta yeni <a class="reference internal" href="../library/os.html#os.add_dll_directory" title="os.add_dll_directory"><code class="xref py py-func docutils literal notranslate"><span class="pre">add_dll_directory()</span></code></a> fonksiyonu eklendi. (Steve Dower’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36085">bpo-36085</a> ‘teki katkısıyla.)</p>
<p>Yeni bir <a class="reference internal" href="../library/os.html#os.memfd_create" title="os.memfd_create"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.memfd_create()</span></code></a> fonksiyonu <code class="docutils literal notranslate"><span class="pre">memfd_create()</span></code> sistem çağrısını sarmak için eklendi. (Zackery Spytz ve Christian Heimes tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=26836">bpo-26836</a> ‘daki katkısıyla.)</p>
<p>Windows’ta, yeniden ayrıştırma noktalarını (sembolik bağlantılar ve dizin bağlantıları dahil) işlemek için manuel mantığın çoğu işletim sistemine devredilmiştir. Özellikle, <a class="reference internal" href="../library/os.html#os.stat" title="os.stat"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.stat()</span></code></a> artık işletim sistemi tarafından desteklenen her şeyi geçerken, <a class="reference internal" href="../library/os.html#os.lstat" title="os.lstat"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.lstat()</span></code></a> yalnızca “isim vekilleri” olarak tanımlanan yeniden ayrıştırma noktalarını açacak, diğerleri ise <a class="reference internal" href="../library/os.html#os.stat" title="os.stat"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.stat()</span></code></a> için olduğu gibi açılacaktır. Her durumda, <code class="xref py py-attr docutils literal notranslate"><span class="pre">stat_result.st_mode</span></code> sadece sembolik bağlantılar için <code class="docutils literal notranslate"><span class="pre">S_IFLNK</span></code> ayarına sahip olacak, diğer türdeki ayrıştırma noktaları için olmayacaktır. Diğer yeniden ayrıştırma noktası türlerini tanımlamak için yeni <code class="xref py py-attr docutils literal notranslate"><span class="pre">stat_result.st_reparse_tag</span></code> niteliğini kontrol edin.</p>
<p>Windows üzerinde, <a class="reference internal" href="../library/os.html#os.readlink" title="os.readlink"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.readlink()</span></code></a> artık dizin bağlantılarını okuyabilmektedir. <a class="reference internal" href="../library/os.path.html#os.path.islink" title="os.path.islink"><code class="xref py py-func docutils literal notranslate"><span class="pre">islink()</span></code></a> dizin bağlantıları için <code class="docutils literal notranslate"><span class="pre">False</span></code> döndürecektir ve bu nedenle önce <code class="docutils literal notranslate"><span class="pre">islink</span></code> kontrol eden kod bağlantıları dizin olarak ele almaya devam ederken, <a class="reference internal" href="../library/os.html#os.readlink" title="os.readlink"><code class="xref py py-func docutils literal notranslate"><span class="pre">os.readlink()</span></code></a> hatalarını işleyen kod artık bağlantıları linkler olarak ele alabilir.</p>
<p>(Steve Dower’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37834">bpo-37834</a> ‘teki katkısıyla.)</p>
</section>
<section id="os-path">
<h3>os.path<a class="headerlink" href="#os-path" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/os.path.html#os.path.exists" title="os.path.exists"><code class="xref py py-func docutils literal notranslate"><span class="pre">exists()</span></code></a>, <a class="reference internal" href="../library/os.path.html#os.path.lexists" title="os.path.lexists"><code class="xref py py-func docutils literal notranslate"><span class="pre">lexists()</span></code></a>, <a class="reference internal" href="../library/os.path.html#os.path.isdir" title="os.path.isdir"><code class="xref py py-func docutils literal notranslate"><span class="pre">isdir()</span></code></a>, <a class="reference internal" href="../library/os.path.html#os.path.isfile" title="os.path.isfile"><code class="xref py py-func docutils literal notranslate"><span class="pre">isfile()</span></code></a>, <a class="reference internal" href="../library/os.path.html#os.path.islink" title="os.path.islink"><code class="xref py py-func docutils literal notranslate"><span class="pre">islink()</span></code></a> ve <code class="xref py py-func docutils literal notranslate"> <span class="pre">ismount()</span></code> gibi boolean sonuç döndüren <a class="reference internal" href="../library/os.path.html#module-os.path" title="os.path: Operations on pathnames."><code class="xref py py-mod docutils literal notranslate"><span class="pre">os.path</span></code></a> fonksiyonları artık işletim sistemi düzeyinde temsil edilemeyen karakterler veya baytlar içeren yollar için <a class="reference internal" href="../library/exceptions.html#ValueError" title="ValueError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code></a> veya alt sınıfları <a class="reference internal" href="../library/exceptions.html#UnicodeEncodeError" title="UnicodeEncodeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">UnicodeEncodeError</span></code></a> ve <a class="reference internal" href="../library/exceptions.html#UnicodeDecodeError" title="UnicodeDecodeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">UnicodeDecodeError</span></code></a> yerine <code class="docutils literal notranslate"><span class="pre">False</span></code> döndürüyor. (Serhiy Storchaka’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33721">bpo-33721</a> ‘deki katkısıyla.)</p>
<p>Windows üzerinde <a class="reference internal" href="../library/os.path.html#os.path.expanduser" title="os.path.expanduser"><code class="xref py py-func docutils literal notranslate"><span class="pre">expanduser()</span></code></a> artık <span class="target" id="index-63"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">USERPROFILE</span></code> ortam değişkenini tercih ediyor ve normalde normal kullanıcı hesapları için ayarlanmamış olan <span class="target" id="index-64"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">HOME</span></code> değişkenini kullanmıyor. (Anthony Sottile’nin <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36264">bpo-36264</a> ‘deki katkısıyla.)</p>
<p><a class="reference internal" href="../library/os.path.html#os.path.isdir" title="os.path.isdir"><code class="xref py py-func docutils literal notranslate"><span class="pre">isdir()</span></code></a> Windows üzerinde artık var olmayan bir dizine bağlantı için <code class="docutils literal notranslate"><span class="pre">True</span></code> döndürmüyor.</p>
<p>Windows üzerinde <a class="reference internal" href="../library/os.path.html#os.path.realpath" title="os.path.realpath"><code class="xref py py-func docutils literal notranslate"><span class="pre">realpath()</span></code></a> artık ortak bağlantılar ve dizin birleşimleri de dahil olmak üzere yeniden ayrıştırma noktalarını çözümlüyor.</p>
<p>(Steve Dower’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37834">bpo-37834</a> ‘teki katkısıyla.)</p>
</section>
<section id="pathlib">
<h3>pathlib<a class="headerlink" href="#pathlib" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/pathlib.html#pathlib.Path.exists" title="pathlib.Path.exists"><code class="xref py py-meth docutils literal notranslate"><span class="pre">exists()</span></code></a>, <a class="reference internal" href="../library/pathlib.html#pathlib.Path.is_dir" title="pathlib.Path.is_dir"><code class="xref py py-meth docutils literal notranslate"><span class="pre">is_dir()</span></code></a>, <code class="xref py py-meth docutils literal notranslate"><span class="pre">is_file()</span></code>, <a class="reference internal" href="../library/pathlib.html#pathlib.Path.is_mount" title="pathlib.Path.is_mount"><code class="xref py py-meth docutils literal notranslate"><span class="pre">is_mount()</span></code></a>, <a class="reference internal" href="../library/pathlib.html#pathlib.Path.is_symlink" title="pathlib.Path.is_symlink"><code class="xref py py-meth docutils literal notranslate"><span class="pre">is_symlink()</span></code></a>, <a class="reference internal" href="../library/pathlib.html#pathlib.Path.is_block_device" title="pathlib.Path.is_block_device"><code class="xref py py-meth docutils literal notranslate"><span class="pre">is_block_device()</span></code></a>, <code class="xref py py-meth docutils literal notranslate"><span class="pre">is_char_device()</span></code>, <a class="reference internal" href="../library/pathlib.html#pathlib.Path.is_fifo" title="pathlib.Path.is_fifo"><code class="xref py py-meth docutils literal notranslate"><span class="pre">is_fifo()</span></code></a>, <a class="reference internal" href="../library/pathlib.html#pathlib.Path.is_socket" title="pathlib.Path.is_socket"><code class="xref py py-meth docutils literal notranslate"><span class="pre">is_socket()</span></code></a> gibi boolean sonuç döndüren <a class="reference internal" href="../library/pathlib.html#pathlib.Path" title="pathlib.Path"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pathlib.Path</span></code></a> metotları artık işletim sistemi seviyesinde temsil edilemeyen karakterler içeren yollar için <a class="reference internal" href="../library/exceptions.html#ValueError" title="ValueError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ValueError</span></code></a> veya alt sınıfı <a class="reference internal" href="../library/exceptions.html#UnicodeEncodeError" title="UnicodeEncodeError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">UnicodeEncodeError</span></code></a> yükseltmek yerine <code class="docutils literal notranslate"><span class="pre">False</span></code> döndürüyor. (Serhiy Storchaka’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33721">bpo-33721</a> ‘deki katkısıyla.)</p>
<p>Bir yola işaret eden sabit bir bağlantı oluşturan <a class="reference internal" href="../library/pathlib.html#pathlib.Path.link_to" title="pathlib.Path.link_to"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pathlib.Path.link_to()</span></code></a> eklendi. (Joannah Nanjekye’nin <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=26978">bpo-26978</a> ‘deki katkısıyla.)</p>
</section>
<section id="pickle">
<h3>pickle<a class="headerlink" href="#pickle" title="Permalink to this heading">¶</a></h3>
<p>C-optimized <a class="reference internal" href="../library/pickle.html#pickle.Pickler" title="pickle.Pickler"><code class="xref py py-class docutils literal notranslate"><span class="pre">Pickler</span></code></a> alt sınıfını kullanan <a class="reference internal" href="../library/pickle.html#module-pickle" title="pickle: Convert Python objects to streams of bytes and back."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pickle</span></code></a> uzantıları artık özel <a class="reference internal" href="../library/pickle.html#pickle.Pickler.reducer_override" title="pickle.Pickler.reducer_override"><code class="xref py py-meth docutils literal notranslate"><span class="pre">reducer_override()</span></code></a> yöntemini tanımlayarak fonksiyon ve sınıfların pickling mantığını geçersiz kılabilir. (Pierre Glaser ve Olivier Grisel’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35900">bpo-35900</a> ‘deki katkılarıyla.)</p>
</section>
<section id="plistlib">
<h3>plistlib<a class="headerlink" href="#plistlib" title="Permalink to this heading">¶</a></h3>
<p>Yeni <a class="reference internal" href="../library/plistlib.html#plistlib.UID" title="plistlib.UID"><code class="xref py py-class docutils literal notranslate"><span class="pre">plistlib.UID</span></code></a> eklendi ve NSKeyedArchiver ile kodlanmış ikili plistleri okuma ve yazma desteği etkinleştirildi. (Jon Janzen tarafından <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=26707">bpo-26707</a> ‘deki katkısıyla.)</p>
</section>
<section id="pprint">
<h3>pprint<a class="headerlink" href="#pprint" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/pprint.html#module-pprint" title="pprint: Data pretty printer."><code class="xref py py-mod docutils literal notranslate"><span class="pre">pprint</span></code></a> modülü çeşitli fonksiyonlara <em>sort_dicts</em> parametresi ekledi. Varsayılan olarak, bu fonksiyonlar sözlükleri oluşturmadan veya yazdırmadan önce sıralamaya devam eder. Ancak, <em>sort_dicts</em> yanlış olarak ayarlanırsa, sözlükler anahtarların eklendiği sırayı korur. Bu, hata ayıklama sırasında JSON girdileriyle karşılaştırma yapmak için yararlı olabilir.</p>
<p>In addition, there is a convenience new function, <a class="reference internal" href="../library/pprint.html#pprint.pp" title="pprint.pp"><code class="xref py py-func docutils literal notranslate"><span class="pre">pprint.pp()</span></code></a> that is
like <a class="reference internal" href="../library/pprint.html#pprint.pprint" title="pprint.pprint"><code class="xref py py-func docutils literal notranslate"><span class="pre">pprint.pprint()</span></code></a> but with <em>sort_dicts</em> defaulting to <code class="docutils literal notranslate"><span class="pre">False</span></code>:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pprint</span> <span class="kn">import</span> <span class="n">pprint</span><span class="p">,</span> <span class="n">pp</span>
<span class="gp">>>> </span><span class="n">d</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">source</span><span class="o">=</span><span class="s1">'input.txt'</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="s1">'filter'</span><span class="p">,</span> <span class="n">destination</span><span class="o">=</span><span class="s1">'output.txt'</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">pp</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">40</span><span class="p">)</span> <span class="c1"># Original order</span>
<span class="go">{'source': 'input.txt',</span>
<span class="go"> 'operation': 'filter',</span>
<span class="go"> 'destination': 'output.txt'}</span>
<span class="gp">>>> </span><span class="n">pprint</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">40</span><span class="p">)</span> <span class="c1"># Keys sorted alphabetically</span>
<span class="go">{'destination': 'output.txt',</span>
<span class="go"> 'operation': 'filter',</span>
<span class="go"> 'source': 'input.txt'}</span>
</pre></div>
</div>
<p>(Rémi Lapeyre’nin <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=30670">bpo-30670</a> ‘teki katkısıyla.)</p>
</section>
<section id="py-compile">
<h3>py_compile<a class="headerlink" href="#py-compile" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/py_compile.html#py_compile.compile" title="py_compile.compile"><code class="xref py py-func docutils literal notranslate"><span class="pre">py_compile.compile()</span></code></a> artık sessiz modu destekliyor. (Joannah Nanjekye’nin <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=22640">bpo-22640</a> ‘taki katkısıyla.)</p>
</section>
<section id="shlex">
<h3>shlex<a class="headerlink" href="#shlex" title="Permalink to this heading">¶</a></h3>
<p>Yeni <a class="reference internal" href="../library/shlex.html#shlex.join" title="shlex.join"><code class="xref py py-func docutils literal notranslate"><span class="pre">shlex.join()</span></code></a> fonksiyonu <a class="reference internal" href="../library/shlex.html#shlex.split" title="shlex.split"><code class="xref py py-func docutils literal notranslate"><span class="pre">shlex.split()</span></code></a> fonksiyonunun tersi gibi davranır. (Bo Bayles’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32102">bpo-32102</a> ‘deki katkısıyla.)</p>
</section>
<section id="shutil">
<h3>shutil<a class="headerlink" href="#shutil" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/shutil.html#shutil.copytree" title="shutil.copytree"><code class="xref py py-func docutils literal notranslate"><span class="pre">shutil.copytree()</span></code></a> artık yeni bir <code class="docutils literal notranslate"><span class="pre">dirs_exist_ok</span></code> anahtar kelime argümanını kabul ediyor. (Josh Bronson’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=20849">bpo-20849</a> ‘daki katkısıyla.)</p>
<p><a class="reference internal" href="../library/shutil.html#shutil.make_archive" title="shutil.make_archive"><code class="xref py py-func docutils literal notranslate"><span class="pre">shutil.make_archive()</span></code></a> artık taşınabilirliği ve standartlara uygunluğu artırmak için yeni arşivler için modern pax (POSIX.1-2001) formatını varsayılan olarak kullanmaktadır, <a class="reference internal" href="../library/tarfile.html#module-tarfile" title="tarfile: Read and write tar-format archive files."><code class="xref py py-mod docutils literal notranslate"><span class="pre">tarfile</span></code></a> modülündeki ilgili değişiklikten miras alınmıştır. (C.A.M. Gerlach’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=30661">bpo-30661</a> ‘deki katkısıyla.)</p>
<p>windows üzerinde <a class="reference internal" href="../library/shutil.html#shutil.rmtree" title="shutil.rmtree"><code class="xref py py-func docutils literal notranslate"><span class="pre">shutil.rmtree()</span></code></a> artık dizin bağlantılarını önce içeriklerini özyinelemeli olarak kaldırmadan kaldırıyor. (Steve Dower’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37834">bpo-37834</a> ‘teki katkısıyla.)</p>
</section>
<section id="socket">
<h3>socket<a class="headerlink" href="#socket" title="Permalink to this heading">¶</a></h3>
<p>Aynı soket üzerinde hem IPv4 hem de IPv6 bağlantılarını kabul etmek de dahil olmak üzere bir sunucu soketi oluştururken genellikle gerekli görevleri otomatikleştirmek için <a class="reference internal" href="../library/socket.html#socket.create_server" title="socket.create_server"><code class="xref py py-meth docutils literal notranslate"><span class="pre">create_server()</span></code></a> ve <a class="reference internal" href="../library/socket.html#socket.has_dualstack_ipv6" title="socket.has_dualstack_ipv6"><code class="xref py py-meth docutils literal notranslate"><span class="pre">has_dualstack_ipv6()</span></code></a> kolaylık fonksiyonları eklendi. (Giampaolo Rodolà’nın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=17561">bpo-17561</a> ‘deki katkısıyla.)</p>
<p><a class="reference internal" href="../library/socket.html#socket.if_nameindex" title="socket.if_nameindex"><code class="xref py py-func docutils literal notranslate"><span class="pre">socket.if_nameindex()</span></code></a>, <a class="reference internal" href="../library/socket.html#socket.if_nametoindex" title="socket.if_nametoindex"><code class="xref py py-func docutils literal notranslate"><span class="pre">socket.if_nametoindex()</span></code></a> ve <a class="reference internal" href="../library/socket.html#socket.if_indextoname" title="socket.if_indextoname"><code class="xref py py-func docutils literal notranslate"><span class="pre">socket.if_indextoname()</span></code></a> fonksiyonları Windows’ta uygulanmıştır. (Zackery Spytz’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37007">bpo-37007</a> ‘deki katkısıyla.)</p>
</section>
<section id="ssl">
<h3>ssl<a class="headerlink" href="#ssl" title="Permalink to this heading">¶</a></h3>
<p>TLS 1.3 post-handshake kimlik doğrulamasını başlatmak için <a class="reference internal" href="../library/ssl.html#ssl.SSLContext.post_handshake_auth" title="ssl.SSLContext.post_handshake_auth"><code class="xref py py-attr docutils literal notranslate"><span class="pre">post_handshake_auth</span></code></a> etkinleştirildi ve <a class="reference internal" href="../library/ssl.html#ssl.SSLSocket.verify_client_post_handshake" title="ssl.SSLSocket.verify_client_post_handshake"><code class="xref py py-meth docutils literal notranslate"><span class="pre">verify_client_post_handshake()</span></code></a> eklendi. (Christian Heimes’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34670">bpo-34670</a> ‘teki katkısıyla.)</p>
</section>
<section id="statistics">
<h3>statistics<a class="headerlink" href="#statistics" title="Permalink to this heading">¶</a></h3>
<p>Eklenen <a class="reference internal" href="../library/statistics.html#statistics.fmean" title="statistics.fmean"><code class="xref py py-func docutils literal notranslate"><span class="pre">statistics.fmean()</span></code></a>, <a class="reference internal" href="../library/statistics.html#statistics.mean" title="statistics.mean"><code class="xref py py-func docutils literal notranslate"><span class="pre">statistics.mean()</span></code></a> ‘in daha hızlı, kayan noktalı bir çeşididir. (Raymond Hettinger ve Steven D’Aprano ‘nun <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35904">bpo-35904</a> ‘taki katkılarıyla.)</p>
<p><a class="reference internal" href="../library/statistics.html#statistics.geometric_mean" title="statistics.geometric_mean"><code class="xref py py-func docutils literal notranslate"><span class="pre">statistics.geometric_mean()</span></code></a> eklendi (Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=27181">bpo-27181</a> ‘deki katkısıyla.)</p>
<p>En yaygın değerlerin bir listesini döndüren <a class="reference internal" href="../library/statistics.html#statistics.multimode" title="statistics.multimode"><code class="xref py py-func docutils literal notranslate"><span class="pre">statistics.multimode()</span></code></a> eklendi. (Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35892">bpo-35892</a> ‘teki katkısıyla.)</p>
<p>Verileri veya bir dağılımı eşitlenebilir aralıklara (örneğin çeyrekler, ondalıklar veya yüzdelikler) bölen <a class="reference internal" href="../library/statistics.html#statistics.quantiles" title="statistics.quantiles"><code class="xref py py-func docutils literal notranslate"><span class="pre">statistics.quantiles()</span></code></a> eklendi. (Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36546">bpo-36546</a> ‘teki katkısıyla.)</p>
<p>Rastgele bir değişkenin normal dağılımlarını oluşturmak ve işlemek için bir araç olan <a class="reference internal" href="../library/statistics.html#statistics.NormalDist" title="statistics.NormalDist"><code class="xref py py-class docutils literal notranslate"><span class="pre">statistics.NormalDist</span></code></a> eklendi. (Raymond Hettinger’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36018">bpo-36018</a> ‘deki katkısıyla. )</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">temperature_feb</span> <span class="o">=</span> <span class="n">NormalDist</span><span class="o">.</span><span class="n">from_samples</span><span class="p">([</span><span class="mi">4</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">14</span><span class="p">])</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span><span class="o">.</span><span class="n">mean</span>
<span class="go">6.0</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span><span class="o">.</span><span class="n">stdev</span>
<span class="go">6.356099432828281</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span><span class="o">.</span><span class="n">cdf</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span> <span class="c1"># Chance of being under 3 degrees</span>
<span class="go">0.3184678262814532</span>
<span class="gp">>>> </span><span class="c1"># Relative chance of being 7 degrees versus 10 degrees</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span><span class="o">.</span><span class="n">pdf</span><span class="p">(</span><span class="mi">7</span><span class="p">)</span> <span class="o">/</span> <span class="n">temperature_feb</span><span class="o">.</span><span class="n">pdf</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="go">1.2039930378537762</span>
<span class="gp">>>> </span><span class="n">el_niño</span> <span class="o">=</span> <span class="n">NormalDist</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mf">2.5</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span> <span class="o">+=</span> <span class="n">el_niño</span> <span class="c1"># Add in a climate effect</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span>
<span class="go">NormalDist(mu=10.0, sigma=6.830080526611674)</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span> <span class="o">*</span> <span class="p">(</span><span class="mi">9</span><span class="o">/</span><span class="mi">5</span><span class="p">)</span> <span class="o">+</span> <span class="mi">32</span> <span class="c1"># Convert to Fahrenheit</span>
<span class="go">NormalDist(mu=50.0, sigma=12.294144947901014)</span>
<span class="gp">>>> </span><span class="n">temperature_feb</span><span class="o">.</span><span class="n">samples</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span> <span class="c1"># Generate random samples</span>
<span class="go">[7.672102882379219, 12.000027119750287, 4.647488369766392]</span>
</pre></div>
</div>
</section>
<section id="sys">
<h3>sys<a class="headerlink" href="#sys" title="Permalink to this heading">¶</a></h3>
<p>Yeni <a class="reference internal" href="../library/sys.html#sys.unraisablehook" title="sys.unraisablehook"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys.unraisablehook()</span></code></a> fonksiyonunu ekleyin, bu fonksiyon “kaldırılamayan istisnaların” nasıl işleneceğini kontrol etmek için geçersiz kılınabilir. Bir istisna oluştuğunda çağrılır, ancak Python’un bunu ele almasının bir yolu yoktur. Örneğin, bir yıkıcı bir istisna ortaya çıkardığında veya çöp toplama sırasında (<a class="reference internal" href="../library/gc.html#gc.collect" title="gc.collect"><code class="xref py py-func docutils literal notranslate"><span class="pre">gc.collect()</span></code></a>). (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36829">bpo-36829</a> ‘daki katkısıyla.)</p>
</section>
<section id="tarfile">
<h3>tarfile<a class="headerlink" href="#tarfile" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/tarfile.html#module-tarfile" title="tarfile: Read and write tar-format archive files."><code class="xref py py-mod docutils literal notranslate"><span class="pre">tarfile</span></code></a> modülü artık yeni arşivler için önceki GNU’ya özgü format yerine modern pax (POSIX.1-2001) formatını varsayılan olarak kullanmaktadır. Bu, standartlaştırılmış ve genişletilebilir bir formatta tutarlı bir kodlama (UTF-8) ile platformlar arası taşınabilirliği geliştirir ve başka avantajlar da sunar. (C.A.M. Gerlach’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36268">bpo-36268</a> ‘deki katkısıyla.)</p>
</section>
<section id="threading">
<h3>threading<a class="headerlink" href="#threading" title="Permalink to this heading">¶</a></h3>
<p>Yakalanmamış <a class="reference internal" href="../library/threading.html#threading.Thread.run" title="threading.Thread.run"><code class="xref py py-meth docutils literal notranslate"><span class="pre">threading.Thread.run()</span></code></a> istisnalarını işleyen yeni bir <a class="reference internal" href="../library/threading.html#threading.excepthook" title="threading.excepthook"><code class="xref py py-func docutils literal notranslate"><span class="pre">threading.excepthook()</span></code></a> fonksiyonu ekleyin. Yakalanmamış <a class="reference internal" href="../library/threading.html#threading.Thread.run" title="threading.Thread.run"><code class="xref py py-meth docutils literal notranslate"><span class="pre">threading.Thread.run()</span></code></a> istisnalarının nasıl işleneceğini kontrol etmek için geçersiz kılınabilir. (Victor Stinner’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=1230540">bpo-1230540</a> ‘taki katkısıyla.)</p>
<p>Yeni bir <a class="reference internal" href="../library/threading.html#threading.get_native_id" title="threading.get_native_id"><code class="xref py py-func docutils literal notranslate"><span class="pre">threading.get_native_id()</span></code></a> fonksiyonu ve <a class="reference internal" href="../library/threading.html#threading.Thread.native_id" title="threading.Thread.native_id"><code class="xref py py-data docutils literal notranslate"><span class="pre">native_id</span></code></a> niteliğini <a class="reference internal" href="../library/threading.html#threading.Thread" title="threading.Thread"><code class="xref py py-class docutils literal notranslate"><span class="pre">threading.Thread</span></code></a> sınıfına ekleyin. Bunlar, çekirdek tarafından atanan geçerli iş parçacığının yerel integral İş Parçacığı Kimliğini döndürür. Bu özellik yalnızca belirli platformlarda kullanılabilir, daha fazla bilgi için <a class="reference internal" href="../library/threading.html#threading.get_native_id" title="threading.get_native_id"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_native_id</span></code></a> bölümüne bakın. (Jake Tesler’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=36084">bpo-36084</a> ‘teki katkısıyla.)</p>
</section>
<section id="tokenize">
<h3>tokenize<a class="headerlink" href="#tokenize" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/tokenize.html#module-tokenize" title="tokenize: Lexical scanner for Python source code."><code class="xref py py-mod docutils literal notranslate"><span class="pre">tokenize</span></code></a> modülü artık sonda yeni bir satır olmayan girdi sağlandığında örtük olarak bir <code class="docutils literal notranslate"><span class="pre">NEWLINE</span></code> belirteci yayar. Bu davranış artık C tokenizer’ın dahili olarak yaptığı ile eşleşiyor. (Ammar Askar’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=33899">bpo-33899</a> ‘daki katkısıyla.)</p>
</section>
<section id="tkinter">
<h3>tkinter<a class="headerlink" href="#tkinter" title="Permalink to this heading">¶</a></h3>
<p><code class="xref py py-class docutils literal notranslate"><span class="pre">tkinter.Spinbox</span></code> sınıfına <code class="xref py py-meth docutils literal notranslate"><span class="pre">selection_from()</span></code>, <code class="xref py py-meth docutils literal notranslate"><span class="pre">selection_present()</span></code>, <code class="xref py py-meth docutils literal notranslate"><span class="pre">selection_range()</span></code> ve <code class="xref py py-meth docutils literal notranslate"><span class="pre">selection_to()</span></code> yöntemleri eklendi. (Juliette Monsel’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=34829">bpo-34829</a> ‘daki katkısıyla.)</p>
<p><code class="xref py py-class docutils literal notranslate"><span class="pre">tkinter.Canvas</span></code> sınıfına <code class="xref py py-meth docutils literal notranslate"><span class="pre">moveto()</span></code> metodu eklendi. (Juliette Monsel’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=23831">bpo-23831</a> ‘deki katkısıyla.)</p>
<p><code class="xref py py-class docutils literal notranslate"><span class="pre">tkinter.PhotoImage</span></code> sınıfı artık <code class="xref py py-meth docutils literal notranslate"><span class="pre">transparency_get()</span></code> ve <code class="xref py py-meth docutils literal notranslate"><span class="pre">transparency_set()</span></code> yöntemlerine sahiptir. (Zackery Spytz’in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=25451">bpo-25451</a> ‘deki katkısıyla.)</p>
</section>
<section id="time">
<h3>time<a class="headerlink" href="#time" title="Permalink to this heading">¶</a></h3>
<p>Added new clock <a class="reference internal" href="../library/time.html#time.CLOCK_UPTIME_RAW" title="time.CLOCK_UPTIME_RAW"><code class="xref py py-const docutils literal notranslate"><span class="pre">CLOCK_UPTIME_RAW</span></code></a> for macOS 10.12.
(Contributed by Joannah Nanjekye in <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35702">bpo-35702</a>.)</p>
</section>
<section id="typing">
<h3>typing<a class="headerlink" href="#typing" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/typing.html#module-typing" title="typing: Support for type hints (see :pep:`484`)."><code class="xref py py-mod docutils literal notranslate"><span class="pre">typing</span></code></a> modülü birkaç yeni özellik içerir:</p>
<ul>
<li><p>Anahtar başına türleri olan bir sözlük türü. Bakınız <span class="target" id="index-65"></span><a class="pep reference external" href="https://peps.python.org/pep-0589/"><strong>PEP 589</strong></a> ve <a class="reference internal" href="../library/typing.html#typing.TypedDict" title="typing.TypedDict"><code class="xref py py-class docutils literal notranslate"><span class="pre">typing.TypedDict</span></code></a>. TypedDict yalnızca dize anahtarları kullanır. Varsayılan olarak, her anahtarın mevcut olması gerekir. Anahtarların isteğe bağlı olmasına izin vermek için “total=False” belirtin:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Location</span><span class="p">(</span><span class="n">TypedDict</span><span class="p">,</span> <span class="n">total</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="n">lat_long</span><span class="p">:</span> <span class="nb">tuple</span>
<span class="n">grid_square</span><span class="p">:</span> <span class="nb">str</span>
<span class="n">xy_coordinate</span><span class="p">:</span> <span class="nb">tuple</span>
</pre></div>
</div>
</li>
<li><p>Değişmez tipler. Bakınız <span class="target" id="index-66"></span><a class="pep reference external" href="https://peps.python.org/pep-0586/"><strong>PEP 586</strong></a> ve <a class="reference internal" href="../library/typing.html#typing.Literal" title="typing.Literal"><code class="xref py py-class docutils literal notranslate"><span class="pre">typing.Literal</span></code></a>. Değişmez tipler, bir parametrenin veya dönüş değerinin bir veya daha fazla belirli değişmez değerle sınırlandırıldığını gösterir:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">get_status</span><span class="p">(</span><span class="n">port</span><span class="p">:</span> <span class="nb">int</span><span class="p">)</span> <span class="o">-></span> <span class="n">Literal</span><span class="p">[</span><span class="s1">'connected'</span><span class="p">,</span> <span class="s1">'disconnected'</span><span class="p">]:</span>
<span class="o">...</span>
</pre></div>
</div>
</li>
<li><p>“Final” değişkenler, fonksiyonlar, metotlar ve sınıflar. Bakınız <span class="target" id="index-67"></span><a class="pep reference external" href="https://peps.python.org/pep-0591/"><strong>PEP 591</strong></a>, <a class="reference internal" href="../library/typing.html#typing.Final" title="typing.Final"><code class="xref py py-class docutils literal notranslate"><span class="pre">typing.Final</span></code></a> ve <a class="reference internal" href="../library/typing.html#typing.final" title="typing.final"><code class="xref py py-func docutils literal notranslate"><span class="pre">typing.final()</span></code></a>. Final niteleyicisi statik tip denetleyicisine alt sınıflamayı, geçersiz kılmayı veya yeniden atamayı kısıtlama talimatı verir:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">pi</span><span class="p">:</span> <span class="n">Final</span><span class="p">[</span><span class="nb">float</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.1415926536</span>
</pre></div>
</div>
</li>
<li><p>Protokol tanımları. Bakınız <span class="target" id="index-68"></span><a class="pep reference external" href="https://peps.python.org/pep-0544/"><strong>PEP 544</strong></a>, <a class="reference internal" href="../library/typing.html#typing.Protocol" title="typing.Protocol"><code class="xref py py-class docutils literal notranslate"><span class="pre">typing.Protocol</span></code></a> ve <a class="reference internal" href="../library/typing.html#typing.runtime_checkable" title="typing.runtime_checkable"><code class="xref py py-func docutils literal notranslate"><span class="pre">typing.runtime_checkable()</span></code></a>. <a class="reference internal" href="../library/typing.html#typing.SupportsInt" title="typing.SupportsInt"><code class="xref py py-class docutils literal notranslate"><span class="pre">typing.SupportsInt</span></code></a> gibi basit ABC’ler artık <code class="docutils literal notranslate"><span class="pre">Protocol</span></code> alt sınıflarıdır.</p></li>
<li><p>Yeni protokol sınıfı <a class="reference internal" href="../library/typing.html#typing.SupportsIndex" title="typing.SupportsIndex"><code class="xref py py-class docutils literal notranslate"><span class="pre">typing.SupportsIndex</span></code></a>.</p></li>
<li><p>Yeni fonksiyonlar <a class="reference internal" href="../library/typing.html#typing.get_origin" title="typing.get_origin"><code class="xref py py-func docutils literal notranslate"><span class="pre">typing.get_origin()</span></code></a> ve <a class="reference internal" href="../library/typing.html#typing.get_args" title="typing.get_args"><code class="xref py py-func docutils literal notranslate"><span class="pre">typing.get_args()</span></code></a>.</p></li>
</ul>
</section>
<section id="unicodedata">
<h3>unicodedata<a class="headerlink" href="#unicodedata" title="Permalink to this heading">¶</a></h3>
<p><a class="reference internal" href="../library/unicodedata.html#module-unicodedata" title="unicodedata: Access the Unicode Database."><code class="xref py py-mod docutils literal notranslate"><span class="pre">unicodedata</span></code></a> modülü <a class="reference external" href="http://blog.unicode.org/2019/05/unicode-12-1-en.html">Unicode 12.1.0</a> sürümünü kullanacak şekilde yükseltildi.</p>
<p>Yeni <a class="reference internal" href="../library/unicodedata.html#unicodedata.is_normalized" title="unicodedata.is_normalized"><code class="xref py py-func docutils literal notranslate"><span class="pre">is_normalized()</span></code></a> fonksiyonu, bir dizenin belirli bir normal formda olduğunu doğrulamak için kullanılabilir, genellikle dizeyi gerçekten normalleştirmekten çok daha hızlıdır. (Max Belanger, David Euresti ve Greg Price’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32285">bpo-32285</a> ve <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=37966">bpo-37966</a> ‘daki katkılarıyla).</p>
</section>
<section id="unittest">
<h3>unittest<a class="headerlink" href="#unittest" title="Permalink to this heading">¶</a></h3>
<p>Eklenen <a class="reference internal" href="../library/unittest.mock.html#unittest.mock.AsyncMock" title="unittest.mock.AsyncMock"><code class="xref py py-class docutils literal notranslate"><span class="pre">AsyncMock</span></code></a>, <a class="reference internal" href="../library/unittest.mock.html#unittest.mock.Mock" title="unittest.mock.Mock"><code class="xref py py-class docutils literal notranslate"><span class="pre">Mock</span></code></a> ‘un asenkron versiyonunu desteklemektedir. Test için uygun yeni savunma fonksiyonları da eklenmiştir. (Lisa Roach’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=26467">bpo-26467</a> ‘deki katkısıyla.)</p>
<p>Unitteste <code class="xref py py-func docutils literal notranslate"><span class="pre">setUpModule()</span></code> ve <a class="reference internal" href="../library/unittest.html#unittest.TestCase.setUpClass" title="unittest.TestCase.setUpClass"><code class="xref py py-meth docutils literal notranslate"><span class="pre">setUpClass()</span></code></a> için temizleme işlemlerini desteklemek üzere <a class="reference internal" href="../library/unittest.html#unittest.addModuleCleanup" title="unittest.addModuleCleanup"><code class="xref py py-func docutils literal notranslate"><span class="pre">addModuleCleanup()</span></code></a> ve <a class="reference internal" href="../library/unittest.html#unittest.TestCase.addClassCleanup" title="unittest.TestCase.addClassCleanup"><code class="xref py py-meth docutils literal notranslate"><span class="pre">addClassCleanup()</span></code></a> eklendi. (Lisa Roach ‘un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=24412">bpo-24412</a> ‘deki katkısıyla.)</p>
<p>Birkaç sahte savunma fonksiyonu artık başarısızlık durumunda gerçek çağrıların bir listesini de yazdırıyor. (Petter Strandmark’ın <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=35047">bpo-35047</a> ‘deki katkısıyla.)</p>
<p><a class="reference internal" href="../library/unittest.html#module-unittest" title="unittest: Unit testing framework for Python."><code class="xref py py-mod docutils literal notranslate"><span class="pre">unittest</span></code></a> modülü, <a class="reference internal" href="../library/unittest.html#unittest.IsolatedAsyncioTestCase" title="unittest.IsolatedAsyncioTestCase"><code class="xref py py-class docutils literal notranslate"><span class="pre">unittest.IsolatedAsyncioTestCase</span></code></a> ile test durumları olarak kullanılacak korutinler için destek kazandı. (Andrew Svetlov’un <a class="reference external" href="https://bugs.python.org/issue?@action=redirect&bpo=32972">bpo-32972</a> ‘deki katkısıyla.)</p>
<p>Örnek:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">unittest</span>