Skip to content

Commit 672281a

Browse files
committed
fixed some errors, steps into dunder method list
1 parent 2af0a15 commit 672281a

File tree

2 files changed

+86
-36
lines changed

2 files changed

+86
-36
lines changed

bibliography/bibliography.bib

+37-36
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ @string { a_antiga_luca
3030
@string { a_archibald_anne_m = "Anne M.\ Archibald" }
3131
@string { a_arthur_jones = "Arthur Jones" }
3232
@string { a_ascher_david = "David Ascher" }
33-
@string { a_b_jean_francois = "Jean{-}Fran{\c{c}}ois B." }
33+
@string { a_b_jean_francois = "Jean{\nobreakdashes-}Fran{\c{c}}ois B." }
3434
@string { a_babuska_ivo = "Ivo Babu{\v{s}}ka" }
3535
@string { a_bachmann_paul_gustav_heinrich = "Paul Gustav Heinrich Bachmann" }
3636
@string { a_back_ralph_johan = "Ralph{\nobreakdashes-}Johan Back" }
@@ -164,7 +164,7 @@ @string { a_haberland_matt
164164
@string { a_haldane_allan = "Allan Haldane" }
165165
@string { a_hammoud_mohammad = "Mohammad Hammoud" }
166166
@string { a_hammouda_imed = "Imed Hammouda" }
167-
@string { a_han_myung_ja_k = "Myung{-}Ja K.\ Han" }
167+
@string { a_han_myung_ja_k = "Myung{\nobreakdashes-}Ja K.\ Han" }
168168
@string { a_hance_jared = "Jared Hance" }
169169
@string { a_harris_charles_r = "Charles R.\ Harris" }
170170
@string { a_hastings_larry = "Larry Hastings" }
@@ -177,7 +177,7 @@ @string { a_herbsleb_james_d
177177
@string { a_hetland_magnus_lie = "Magnus Lie Hetland" }
178178
@string { a_hettinger_raymond = "Raymond Hettinger" }
179179
@string { a_hickson_ian = "Ian Hickson" }
180-
@string { a_hilton_balfe_james = "James Hilton{-}Balfe" }
180+
@string { a_hilton_balfe_james = "James Hilton{\nobreakdashes-}Balfe" }
181181
@string { a_hollasch_steve = "Steve Hollasch" }
182182
@string { a_hoyer_stephan = "Stephan Hoyer" }
183183
@string { a_hubbard_steve = "Steve Hubbard" }
@@ -190,7 +190,7 @@ @string { a_ito_ysuaki
190190
@string { a_jackson_dean = "Dean Jackson" }
191191
@string { a_jain_shantanu = "Shantanu Jain" }
192192
@string { a_james_mike = "Mike James" }
193-
@string { a_jewet_jim_j = "Jim J\. Jewett" }
193+
@string { a_jewet_jim_j = "Jim J.\ Jewett" }
194194
@string { a_joh_sangwoo = "Sangwoo Joh" }
195195
@string { a_johansson_robert = "Robert Johansson" }
196196
@string { a_johnson_stephen_curtis = "Stephen Curtis Johnson" }
@@ -370,7 +370,7 @@ @string { a_smith_ethan
370370
@string { a_smith_nathaniel_j = "Nathaniel J.\ Smith" }
371371
@string { a_sobolev_nikita = "Nikita Sobolev" }
372372
@string { a_sottet_jean_sebastien = "Jean{\nobreakdashes-}S{\'e}bastien Sottet" }
373-
@string { a_sperberg_mcqueen_c_m = "C.\ M.\ Sperberg{-}McQueen" }
373+
@string { a_sperberg_mcqueen_c_m = "C.\ M.\ Sperberg{\nobreakdashes-}McQueen" }
374374
@string { a_sphinx_developers = "{\Pgls{sphinx} Developers}" }
375375
@string { a_srinivasan_pradeep_kumar = "Pradeep Kumar Srinivasan" }
376376
@string { a_stein_clifford = "Clifford Stein" }
@@ -530,15 +530,15 @@ @string { l_usa_wilmington
530530
%% publishers
531531
@string { p_aci_learning = "{{ACI} Learning}" }
532532
@string { p_acm = "{Association for Computing Machinery~({ACM})}" }
533-
@string { p_active_state = "ActiveState Software Inc." }
533+
@string { p_active_state = "{ActiveState Software~Inc.}" }
534534
@string { p_addison_wesley = "{Addison\nobreakdashes-Wesley Professional}" }
535-
@string { p_addison_wesley_longman = "{Addison Wesley Longman Publishing Co., Inc.}" }
535+
@string { p_addison_wesley_longman = "{Addison Wesley Longman Publishing Co.,~Inc.}" }
536536
@string { p_adobe = "{Adobe Systems Incorporated}" }
537-
@string { p_amacom = "AMACOM" }
537+
@string { p_amacom = "{AMACOM}" }
538538
@string { p_ams = "{American Mathematical Society~({AMS})}" }
539539
@string { p_apress = "{Apress Media,~LLC}" }
540540
@string { p_asa = "{American Standards Association Incorporated}" }
541-
@string { p_astral = "Astral Software~Inc." }
541+
@string { p_astral = "{Astral Software~Inc.}" }
542542
@string { p_bell_labs = "{Bell Telephone Laboratories, Incorporated}" }
543543
@string { p_birkhauser_boston = "{Birkh{\"a}user}" }
544544
@string { p_bruhin_software = "{Bruhin Software}" }
@@ -547,27 +547,27 @@ @string { p_carnegie_mellon_university_qatar
547547
@string { p_cnri = "{Corporation for National Research Initiatives~({CNRI})}" }
548548
@string { p_crc_press = "{{CRC} Press}" }
549549
@string { p_cornell_university_library = "{Cornell Universiy Library}" }
550-
@string { p_document_foundation = "The Document Foundation" }
551-
@string { p_ecma = "Ecma International" }
550+
@string { p_document_foundation = "{The Document Foundation}" }
551+
@string { p_ecma = "{Ecma International}" }
552552
@string { p_elsevier = "{Elsevier~B.V.}" }
553-
@string { p_encyclopaedia_britannica_inc = "Encyclop{\ae}dia Britannica, Inc." }
553+
@string { p_encyclopaedia_britannica_inc = "{Encyclop{\ae}dia Britannica,~Inc.}" }
554554
@string { p_geeksforgeeks = "{GeeksforGeeks -- Sanchhaya Education Private Limited}" }
555555
@string { p_github = "{\github~Inc}" }
556556
@string { p_hanser_verlag = "{Carl Hanser Verlag GmbH \& Co.~KG}" }
557557
@string { p_hiroshima_university_dep_ie = "{Department of Information Engineering, Hiroshima University}" }
558-
@string { p_ibm = "International Business Machines Corporation~{(IBM)}" }
558+
@string { p_ibm = "{International Business Machines Corporation~{(IBM)}}" }
559559
@string { p_iec = "{International Electrotechnical Commission~{(IEC)}}" }
560560
@string { p_ieee = "{Institute of Electrical and Electronics Engineers~{(IEEE)}}" }
561561
@string { p_ieee_computer_society = "{{IEEE}~Computer Society}" }
562562
@string { p_ietf = "{Internet Engineering Task Force~{(IETF)}}" }
563563
@string { p_ifip = "{International Federation for Information Processing~{(IFIP)}}" }
564-
@string { p_infinite_skills = "Infinite Skills Inc" }
564+
@string { p_infinite_skills = "{Infinite Skills~Inc}" }
565565
@string { p_informs = "{The Institute for Operations Research and the Management Sciences~({INFORMS})}" }
566566
@string { p_io_press = "{{I/O}~Press}" }
567567
@string { p_iso = "{International Organization for Standardization~{(ISO)}}" }
568568
@string { p_leibniz_zentrum_fur_informatik = "{{Schloss Dagstuhl} -- {Leibniz\nobreakdashes-Zentrum f{\"u}r Informatik}}" }
569-
@string { p_libraries_unlimited = "Libraries Unlimited" }
570-
@string { p_logilab = "Logilab" }
569+
@string { p_libraries_unlimited = "{Libraries Unlimited}" }
570+
@string { p_logilab = "{Logilab}" }
571571
@string { p_manning_publications = "{Manning Publications}" }
572572
@string { p_mcgraw_hill = "{McGraw\nobreakdashes-Hill}" }
573573
@string { p_merlinux = "{merlinux GmbH}" }
@@ -578,32 +578,32 @@ @string { p_nasa
578578
@string { p_nasa_asd = "{Astrophysics Science Division~{(ASD)}}, " # p_nasa }
579579
@string { p_neurips = "{The Neural Information Processing Systems Foundation~{(NeurIPS)}}" }
580580
@string { p_north_holland = "{North\nobreakdashes-Holland Publishing Co.}" }
581-
@string { p_oeis_foundation = "The {OEIS} Foundation Inc." }
582-
@string { p_open_group = "The Open Group" }
581+
@string { p_oeis_foundation = "{The {OEIS} Foundation~Inc.}" }
582+
@string { p_open_group = "{The Open Group}" }
583583
@string { p_oracle = "{Oracle Corporation}" }
584-
@string { p_oreilly = "{{O'Reilly} Media, Inc.}" }
584+
@string { p_oreilly = "{{O'Reilly} Media,~Inc.}" }
585585
@string { p_oxford_university_cl = "{Oxford University Computing Laboratory}" }
586586
@string { p_oxford_university_press = "{Oxford University Press}" }
587587
@string { p_packt = "{Packt Publishing Ltd}" }
588-
@string { p_payhip = "Payhip" }
589-
@string { p_pearson_education = "{Pearson Education, Inc.}" }
588+
@string { p_payhip = "{Payhip}" }
589+
@string { p_pearson_education = "{Pearson Education,~Inc.}" }
590590
@string { p_microsoft_press = "{Microsoft Press}, " # p_pearson_education }
591-
@string { p_plos = "Public Library of Science~{(PLOS)}" }
591+
@string { p_plos = "{Public Library of Science~{(PLOS)}}" }
592592
@string { p_pragmatic_ai_labs = "{Pragmatic {AI} Labs}" }
593593
@string { p_pragmatic_bookshelf = "{{Pragmatic Bookshelf} {by} {The Pragmatic Programmers, {L.L.C.}}}" }
594-
@string { p_princeton_university_press = "Princeton University Press" }
594+
@string { p_princeton_university_press = "{Princeton University Press}" }
595595
@string { p_project_gutenberg = "{Project Gutenberg Literary Archive Foundation}" }
596596
@string { p_python_morsels = "{Python Morsels}" }
597597
@string { p_python_software_foundation = "{\python\ Software Foundation~{(PSF)}}" }
598-
@string { p_readthedocs_inc = "{Read the Docs, Inc.}" }
598+
@string { p_readthedocs_inc = "{Read the Docs,~Inc.}" }
599599
@string { p_springer_cham = "{Springer}" }
600600
@string { p_springer_nature_limited = "{Springer Nature Limited}" }
601601
@string { p_springer_new_york = "{Springer New York}" }
602602
@string { p_springer_science_and_business = "{Springer Science+Business Media}" }
603603
@string { p_springer_verlag = "{Springer\nobreakdashes-Verlag {GmbH} Germany}" }
604604
@string { p_story_needle = "{Story Needle}" }
605-
@string { p_taylor_and_francis = "{Taylor and Francis Ltd.}" }
606-
@string { p_teubner_b_g = "{B.\ G.\ Teubner}" }
605+
@string { p_taylor_and_francis = "{Taylor and Francis~Ltd.}" }
606+
@string { p_teubner_b_g = "{B.~G.~Teubner}" }
607607
@string { p_typis_academiae = "{Typis Academiae}" }
608608
@string { p_unicode_consortium = "{The Unicode Consortium}" }
609609
@string { p_universidad_del_pais_vasco = "{{Universidad del Pa{\'i}s Vasco} / {Euskal Herriko Unibertsitatea}}" }
@@ -616,9 +616,9 @@ @string { p_usas
616616
@string { p_usenix = "{{USENIX} Association}" }
617617
@string { p_w3c = "{World Wide Web Consortium~{(W3C)}}" }
618618
@string { p_wiley = "{Wiley}" }
619-
@string { p_wiley_and_sons_ltd = "{John Wiley and Sons Ltd.}" }
620-
@string { p_wiley_vch = "Wiley\nobreakdashes-VCH GmbH" }
621-
@string { p_wolfram_research = "{Wolfram Research, Inc.}" }
619+
@string { p_wiley_and_sons_ltd = "{John Wiley and Sons~Ltd.}" }
620+
@string { p_wiley_vch = "{Wiley\nobreakdashes-VCH GmbH}" }
621+
@string { p_wolfram_research = "{Wolfram Research,~Inc.}" }
622622
623623
624624
%% publisher addresses
@@ -1221,7 +1221,7 @@ @article{B2012DPWP
12211221

12221222
@techreport{B2017TJONJDIF,
12231223
author = a_bray_tim,
1224-
title = {The \pgls{javascript} Object Notation (\pgls{JSON}) Data Interchange Format},
1224+
title = {The \pgls{javascript} Object Notation~(\pgls{json}) Data Interchange Format},
12251225
xdata = {rep_rfc},
12261226
number = {8259},
12271227
date = {2017-12},
@@ -1753,7 +1753,7 @@ @article{H2007MA2GE
17531753

17541754
@book{H2021D0XBPFPSM,
17551755
author = a_helmes_christian,
1756-
title = {defusedxml~0.7.1: \pgls{xml}~Bomb Protection for \python\ stdlib Modules},
1756+
title = {\pythonilIdx{defusedxml}~0.7.1: \pgls{xml}~Bomb Protection for \python\ stdlib Modules},
17571757
date = {2021-03-08},
17581758
url = {https://pypi.org/project/defusedxml},
17591759
urldate = {2024-12-15}
@@ -1780,7 +1780,7 @@ @book{H2023ABGTP3P
17801780

17811781
@book{H2024PBOTTCODDSIPP33,
17821782
author = a_hunner_trey,
1783-
title = {\python\ Big~\bigO:~{T}he Time Complexities of Different Data Structures in \python; \python~3.8-3.12},
1783+
title = {\python\ Big~\bigO:~{T}he Time Complexities of Different Data Structures in \python; \python~3.8\nobreakdashes-3.12},
17841784
date = {2024-04-16},
17851785
publisher = p_python_morsels,
17861786
address = pa_python_morsels,
@@ -1946,7 +1946,7 @@ @book{K2018EIPFEUU
19461946

19471947
@book{K2019ITXJY,
19481948
author = a_kodes_katie,
1949-
title = {Intro to~\pgls{xml}, JSON, \&~YAML},
1949+
title = {Intro to~\pgls{xml}, \pgls{json}, \&~YAML},
19501950
date = {2019/2020-09-04},
19511951
publisher = p_payhip,
19521952
address = pa_payhip
@@ -2450,7 +2450,7 @@ @techreport{PEP515
24502450

24512451
@techreport{PEP585,
24522452
author = a_langa_lukasz,
2453-
title = {Type Hinting Generics In Standard Collections},
2453+
title = {\glslink{typeHint}{Type Hinting} Generics In Standard Collections},
24542454
xdata = {rep_pep},
24552455
number = {585},
24562456
date = {2019-03-03},
@@ -2461,7 +2461,7 @@ @techreport{PEP585
24612461
@techreport{PEP586,
24622462
author = a_lee_michael # and # a_levkivskyi_ivan # and # a_lehtosalo_jukka,
24632463
title = {\pythonilIdx{Literal} Types},
2464-
type = {rep_pep},
2464+
xdata = {rep_pep},
24652465
number = {586},
24662466
date = {2019-03-14},
24672467
url = {https://peps.python.org/pep-0586},
@@ -2480,7 +2480,7 @@ @techreport{PEP591
24802480

24812481
@techreport{PEP604,
24822482
author = a_prados_philippe # and # a_moss_maggie,
2483-
title = {Allow Writing Union Types as \pythonil{X | Y}},
2483+
title = {Allow Writing Union Types as \pythonil{X | Y}\pythonIdx{"|}},
24842484
xdata = {rep_pep},
24852485
number = {604},
24862486
date = {2019-08-28},
@@ -2521,6 +2521,7 @@ @techreport{PEP635
25212521
@techreport{PEP673,
25222522
author = a_srinivasan_pradeep_kumar # and # a_hilton_balfe_james,
25232523
number = {673},
2524+
xdata = {rep_pep},
25242525
title = {\pythonilIdx{Self}\pythonIdx{typing!Self} Type},
25252526
date = {2021-11-10/2021-11-17},
25262527
url = {https://peps.python.org/pep-0673},

text/main/classes/dunder/dunder.tex

+49
Original file line numberDiff line numberDiff line change
@@ -1460,4 +1460,53 @@
14601460
\FloatBarrier%
14611461
\endhsection%
14621462
%
1463+
\hsection{Overview over Dunder Methods}%
1464+
%
1465+
\begin{figure}%
1466+
\renewcommand*\DTstylecomment{\relax}%
1467+
\renewcommand*\DTstyle{\small}%
1468+
\def\dunder#1{\expandafter\pythonilIdx{\_\_#1\_\_}\expandafter\pythonIdx{dunder!\_\_#1\_\_}}%
1469+
%
1470+
\dirtree{%
1471+
.1 String Representation.
1472+
.2 \dunder{str}\DTcomment{returns a concise string representation for users; \pythonil{str(a)} $\equiv$ \pythonil{a.\_\_str\_\_()}}.
1473+
.2 \dunder{repr}\DTcomment{a string with all information about the object for programmers; \pythonil{repr(a)} $\equiv$ \pythonil{a.\_\_repr\_\_()}}.
1474+
.1 Hashing.
1475+
.2 \dunder{hash}\DTcomment{compute an integer value representing this object; \pythonil{hash(a)} $\equiv$ \pythonil{a.\_\_hash\_\_()}}.
1476+
.1 Ordering and Equality.
1477+
.2 \dunder{eq}\DTcomment{equality: \pythonil{a == b} $\equiv$ \pythonil{a.\_\_eq\_\_(b)}}.
1478+
.2 \dunder{ne}\DTcomment{inequality: \pythonil{a != b} $\equiv$ \pythonil{a.\_\_ne\_\_(b)}}.
1479+
.2 \dunder{lt}\DTcomment{less than: \pythonil{a < b} $\equiv$ \pythonil{a.\_\_lt\_\_(b)}}.
1480+
.2 \dunder{le}\DTcomment{less than or equal: \pythonil{a <= b} $\equiv$ \pythonil{a.\_\_le\_\_(b)}}.
1481+
.2 \dunder{gt}\DTcomment{greater than: \pythonil{a > b} $\equiv$ \pythonil{a.\_\_gt\_\_(b)}}.
1482+
.2 \dunder{ge}\DTcomment{greater than or equal: \pythonil{a >= b} $\equiv$ \pythonil{a.\_\_ge\_\_(b)}}.
1483+
.1 Context Managers.
1484+
.2 \dunder{enter}\DTcomment{enter a \pythonilIdx{with} statement, returns a value given to \pythonilIdx{as}}.
1485+
.2 \dunder{exit}\DTcomment{leave a \pythonilIdx{with} statement, receive exception information, returns~\pythonil{False} to re-raise caught exceptions, if any}.
1486+
.1 Arithmetics.
1487+
.2 \dunder{add}\DTcomment{add: \pythonil{a + b} $\equiv$ \pythonil{a.\_\_add\_\_(b)}}.
1488+
.2 \dunder{radd}\DTcomment{right-add: \pythonil{a + b} $\equiv$ \pythonil{b.\_\_radd\_\_(a)}, if \pythonil{a.\_\_add\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1489+
.2 \dunder{sub}\DTcomment{subtract: \pythonil{a - b} $\equiv$ \pythonil{a.\_\_sub\_\_(b)}}.
1490+
.2 \dunder{rsub}\DTcomment{right-subtract: \pythonil{a - b} $\equiv$ \pythonil{b.\_\_rsub\_\_(a)}, if \pythonil{a.\_\_sub\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1491+
.2 \dunder{mul}\DTcomment{multiply: \pythonil{a * b} $\equiv$ \pythonil{a.\_\_mul\_\_(b)}}.
1492+
.2 \dunder{rmul}\DTcomment{right-multiply: \pythonil{a * b} $\equiv$ \pythonil{b.\_\_rmul\_\_(a)}, if \pythonil{a.\_\_mul\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1493+
.2 \dunder{truediv}\DTcomment{divide: \pythonil{a / b} $\equiv$ \pythonil{a.\_\_truediv\_\_(b)}}.
1494+
.2 \dunder{rtruediv}\DTcomment{right-divide: \pythonil{a / b} $\equiv$ \pythonil{b.\_\_rtruediv\_\_(a)}, if \pythonil{a.\_\_truediv\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1495+
.2 \dunder{mod}\DTcomment{modulo-divide: \pythonil{a \% b} $\equiv$ \pythonil{a.\_\_mod\_\_(b)}}.
1496+
.2 \dunder{rmod}\DTcomment{right-modulo-divide: \pythonil{a \% b} $\equiv$ \pythonil{b.\_\_rmod\_\_(a)}, if \pythonil{a.\_\_mod\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1497+
.2 \dunder{floordiv}\DTcomment{integer-divide: \pythonil{a // b} $\equiv$ \pythonil{a.\_\_floordiv\_\_(b)}}.
1498+
.2 \dunder{rfloordiv}\DTcomment{right-integer-divide: \pythonil{a // b} $\equiv$ \pythonil{b.\_\_rfloordiv\_\_(a)}, if \pythonil{a.\_\_floordiv\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1499+
.2 \dunder{pow}\DTcomment{exponential: \pythonil{a ** b} $\equiv$ \pythonil{a.\_\_pow\_\_(b)}}.
1500+
.2 \dunder{rpow}\DTcomment{right-exponential: \pythonil{a ** b} $\equiv$ \pythonil{b.\_\_rpow\_\_(a)}, if \pythonil{a.\_\_pow\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1501+
.2 \dunder{matmul}\DTcomment{matrix-multiply: \pythonil{a @ b} $\equiv$ \pythonil{a.\_\_matmul\_\_(b)}}.
1502+
.2 \dunder{rmatmul}\DTcomment{right-matrix-multiply: \pythonil{a @ b} $\equiv$ \pythonil{b.\_\_rmatmul\_\_(a)}, if \pythonil{a.\_\_matmul\_\_(b)} yields~\pythonilIdx{NotImplemented}}.
1503+
}%
1504+
%
1505+
\caption{An overview of the dunder in \python.}%
1506+
\label{fig:pythonDunder}%
1507+
\end{figure}%
1508+
%
1509+
\FloatBarrier%
1510+
\endhsection%
1511+
%
14631512
\endhsection%

0 commit comments

Comments
 (0)