An Investigation Into the Generality of a Graphical Representation Of

Total Page:16

File Type:pdf, Size:1020Kb

An Investigation Into the Generality of a Graphical Representation Of Clemson University TigerPrints All Dissertations Dissertations 5-2016 An Investigation Into the Generality of a Graphical Representation of Program Code for Source to Source Translation Stephen Schaub Clemson University, [email protected] Follow this and additional works at: https://tigerprints.clemson.edu/all_dissertations Recommended Citation Schaub, Stephen, "An Investigation Into the Generality of a Graphical Representation of Program Code for Source to Source Translation" (2016). All Dissertations. 1677. https://tigerprints.clemson.edu/all_dissertations/1677 This Dissertation is brought to you for free and open access by the Dissertations at TigerPrints. It has been accepted for inclusion in All Dissertations by an authorized administrator of TigerPrints. For more information, please contact [email protected]. An Investigation Into the Generality of a Graphical Representation of Program Code for Source to Source Translation A Dissertation Presented to the Graduate School of Clemson University In Partial Fulfillment of the Requirements for the Degree Doctor of Philosophy Computer Science by Stephen Schaub May 2016 Accepted by: Brian A. Malloy, Committee Chair Jason Hallstrom Murali Sitaraman Mark Smotherman Abstract This thesis addresses the problem of defining a source-to-source translation system for reusable software components. It describes the development of an interoperable language for writing software components, and presents a system to translate components written in the interoperable language to a set of compatible target languages. The common features in a set of popular pro- gramming languages are analyzed to inform the design of the interoperable language. An evaluation is performed by using the source-to-source translator to convert two well-known open source Java libraries to C++ and Python, and the accuracy and performance of the resulting translations are assessed. ii Dedication To my wife, Ruth, for her love and support, and to my father, Paul, for introducing me to the field of computer science. iii Acknowledgments I would like to thank my advisor, Dr. Brian Malloy, for shepherding me through the topic selection, research, and the production of this thesis. I am deeply indebted to him for his encour- agement and for the many hours he invested meeting with me, reviewing my work, coauthoring papers, and providing invaluable guidance. I am also grateful to each of my committee members for their helpful feedback on my research: thanks to Dr. Mark Smotherman for introducing me to the department and advising me on my Ph.D. program; to Dr. Murali Sitaraman and the RESOLVE Software Research Group for exposing me to a significant ongoing research project; and to Dr. Jason Hallstrom, whose stimulating classes and seminars provided early writing experience and prepared me for my own research. Finally, I would like to acknowledge the support of my colleagues in the Division of Mathematical Science at Bob Jones University, especially Dr. Gary Guthrie, Dr. Melissa Gardenghi, Dr. Jim Knisely, Mr. Alan Hughes, and Dr. Debbie Summerlin, who have provided encouragement and shouldered additional responsibilities during my leave of absence to help make this research possible. iv Table of Contents Title Page ............................................ i Abstract ............................................. ii Dedication............................................ iii Acknowledgments ....................................... iv List of Tables ..........................................vii List of Figures..........................................viii List of Listings ......................................... ix 1 Introduction......................................... 1 1.1 Problem Statement..................................... 3 1.2 Research Approach..................................... 3 1.3 Thesis Statement...................................... 4 1.4 Thesis Organization .................................... 4 2 Related Work ........................................ 5 3 Background .........................................10 3.1 Program Representation Graphs ............................. 10 3.2 Language Families ..................................... 12 3.3 Language Interoperability................................. 13 3.4 Language Features..................................... 15 4 Challenges ..........................................19 4.1 Source-to-Source Challenges................................ 19 4.2 Addressing Source-to-Source Challenges......................... 20 5 System Overview......................................22 5.1 Functional View ...................................... 22 5.2 Development View..................................... 23 6 Interoperable Language Design .............................26 6.1 Design Methodology.................................... 26 6.2 Analysis Set Selection ................................... 28 6.3 Language Analysis and Design .............................. 28 7 Translation of Language Features ............................45 v 7.1 Mapping Java to iJava................................... 45 7.2 Mapping iJava to Python and C++ ........................... 47 8 Evaluation and Testing ..................................54 8.1 Test Environment...................................... 54 8.2 Test Cases.......................................... 54 8.3 Test Case Evaluation and Preparation.......................... 56 8.4 Reliability Tests and Execution Traces.......................... 57 8.5 Quality Tests........................................ 61 8.6 Performance Tests ..................................... 62 8.7 Performance Test Methodology.............................. 63 9 Conclusions and Future Directions ...........................65 Appendices ...........................................67 A iJava Language Specification ............................... 68 B iJava Grammar....................................... 106 Bibliography...........................................112 vi List of Tables 6.1 Data Type Analysis .................................... 34 6.2 Operator and Expression Analysis ............................ 37 6.3 Statement Analysis..................................... 38 6.4 Subroutine Feature Analysis................................ 39 6.5 Object Oriented Feature Analysis............................. 42 6.6 Exception Feature Analysis ................................ 43 6.7 Miscellaneous Feature Analysis.............................. 44 8.1 Test Cases.......................................... 55 8.2 Reliability Test Results .................................. 61 8.3 Quality Test Results: PureMVC ............................. 62 8.4 Quality Test Results: Apache Math Commons ..................... 62 8.5 PureMVC and Apache Performance Test Results.................... 63 8.6 Basic Iteration Performance Test Results ........................ 64 vii List of Figures 3.1 A sample Abstract Syntax Tree.............................. 11 3.2 A sample Abstract Semantic Graph ........................... 12 3.3 Source to Source Interoperability............................. 14 3.4 Internal Organization of a Source-To-Source Translator ................ 15 5.1 System Overview...................................... 22 5.2 Expanded System Overview................................ 23 5.3 iJava ASG Organization (Partial)............................. 24 5.4 Target Code Generation Classes.............................. 25 6.1 TIOBE Index History ................................... 29 7.1 Mapping of iJava types to C++ and Python ...................... 51 8.1 Apache Commons Math Classes Translated....................... 57 viii List of Listings 3.1 Source code for class Node................................. 11 7.1 Java Do-while example................................... 46 7.2 iJava Do-while translation................................. 46 7.3 Java inner class example.................................. 47 7.4 iJava inner class translation................................ 47 7.5 Java static initialization example............................. 50 7.6 C++ mapping....................................... 50 7.7 Java dynamic cast example................................ 51 7.8 C++ cast translation.................................... 52 7.9 Java try-catch example................................... 53 7.10 Python try-except translation............................... 53 8.1 Trace of JUnit Test..................................... 59 8.2 Trace of Unit Test (Python Translation)......................... 60 8.3 Python loop iteration performance test.......................... 64 ix Chapter 1 Introduction The software development landscape has changed radically in its relatively short history. The introduction of portable high-level languages, and in particular, the ascendance of object-oriented technologies, has enabled a degree of software reuse that was unimaginable to the assembly language programmers of the 1950's. And yet, solutions to fundamental problems in software engineering reuse and reliability remain elusive and in many cases unsolved. The proliferation of high-level languages|the mechanism enabling reuse|has been a significant factor in fueling this growth but has also increased the scope of the problem, thereby retarding progress in arriving at solutions. Despite ongoing efforts, the limitations of existing language interoperability mechanisms continue to inhibit interlingual code reuse. This lack of progress in reuse, in turn, has hindered improvements in software reliability. If there were a single dominant language, or
Recommended publications
  • Automation Systems and Integration — Object-Process Methodology
    © ISO 2014 – All rights reserved ISO TC 184/SC 5 N 522 Date: 2014-04-29 ISO/PDPAS 19450 ISO TC 184/SC 5/WG 1 N 522 Secretariat: ANSI Automation systems and integration — Object-Process Methodology Systèmes d'automatisation et intégration -- Méthodologie du processus-objet Document type: Publicly Available Specification Document subtype: Document stage: (20) Preparatory Document language: E STD Version 2.1c2 ISO/PDPAS 19450 Copyright notice This ISO document is a working draft or committee draft and is copyright-protected by ISO. While the reproduction of working drafts or committee drafts in any form for use by participants in the ISO standards development process is permitted without prior permission from ISO, neither this document nor any extract from it may be reproduced, stored or transmitted in any form for any other purpose without prior written permission from ISO. Requests for permission to reproduce this document for the purpose of selling it should be addressed as shown below or to ISO's member body in the country of the requester: [Indicate the full address, telephone number, fax number, telex number, and electronic mail address, as appropriate, of the Copyright Manger of the ISO member body responsible for the secretariat of the TC or SC within the framework of which the working document has been prepared.] Reproduction for sales purposes may be subject to royalty payments or a licensing agreement. Violators may be prosecuted. Violators may be prosecuted. ii © ISO 2014 – All rights reserved ISO/PDPAS 19450 Contents Page Foreword
    [Show full text]
  • Chapter 2 Core Basics
    Chapter 2 Core Basics In this chapter we introduce some of the basic concepts that are important for understanding what is to follow. We also introduce a few of the fundamental operations that are involved in the vast majority of useful programs. 2.1 Literals and Types Section 1.3 introduced the string literal. A string literal is a collection of characters enclosed in quotes. In general, a literal is code that exactly represents a value. In addition to a string literal, there are numeric literals. There are actually a few different types of numeric values in Python. There are integer values which correspond to whole numbers (i.e., the countable numbers that lack a fractional part). In Python, an integer is known as an int. A number that can have a fractional part is called a float (a float corresponds to a real number). For example, 42 is an int while 3.14 is a float. The presence of the decimal point makes a number a float—it doesn’t matter if the fractional part is zero. For example, the literal 3.0, or even just 3., are also floats1 despite the fact that these numbers have fractional parts of zero.2 There are some important differences between how computers work with ints and floats. For example, ints are stored exactly in the computer while, in general, floats are only stored approximately. This is a consequence of the fact that we are entering numbers as decimal numbers, i.e., numbers in the base 10 counting system, but the computer stores these numbers internally as a finite number of binary (base 2) digits.
    [Show full text]
  • Lecture 3: Its Time to See the C
    Computer Science 61C Spring 2017 Friedland and Weaver Lecture 3: Its time to see the C... 1 Agenda Computer Science 61C Spring 2017 Friedland and Weaver • Computer Organization • Compile vs. Interpret • C vs Java 2 ENIAC (U.Penn., 1946) First Electronic General-Purpose Computer Computer Science 61C Spring 2017 Friedland and Weaver • Blazingly fast (multiply in 2.8ms!) • 10 decimal digits x 10 decimal digits • But needed 2-3 days to setup new program, as programmed with patch cords and switches • At that time & before, "computer" mostly referred to people who did calculations 3 EDSAC (Cambridge, 1949) First General Stored-Program Computer Computer Science 61C Spring 2017 Friedland and Weaver • Programs held as numbers in memory • This is the revolution: It isn't just programmable, but the program is just the same type of data that the computer computes on • 35-bit binary 2’s complement words 4 Components of a Computer Computer Science 61C Spring 2017 Friedland and Weaver Memory Processor Input Enable? Read/Write Control Program Datapath Address PC Bytes Write Registers Data Arithmetic & Logic Unit Read Data Output (ALU) Data Processor-Memory Interface I/O-Memory Interfaces 5 Great Idea: Levels of Representation/Interpretation Computer Science 61C Spring 2017 Friedland and Weaver temp = v[k]; High Level Language v[k] = v[k+1]; We are here! Program (e.g., C) v[k+1] = temp; lw $t0, 0($2) Compiler Anything can be represented lw $t1, 4($2) Assembly Language as a number, sw $t1, 0($2) Program (e.g., MIPS) i.e., data or instructions sw $t0, 4($2)
    [Show full text]
  • Europe Co P Er Anu Ctu Ers Associ On
    EUROPE CO P ER ANU CTU ERS ASSOCI ON l June 1986 Free copies of this document are available from EC:\lA, European Computer :\Iannfadnrers Association I H Rue dn Hhi'me 1201 Geneva (Switzerland) BRIEF HISTORY The first version of the language BASIC, acronym for Beginner 1 s All-purpose Symbolic Instruction Code, was produced in June 1965 at the Dartmouth Col lege in the USA. In January 1978, ECMA published a Standard for Minimal BASIC, ECMA-55, prepared in coopera­ tion with ANSI X3J2 and fully compatible with the corresponding ANSI standard . This Stan­ dard ECMA-55 served as a basis for the ISO Standard on Minimal BASIC. With the continuation of the work, a draft Standard for full BASIC was agreed by ANSI X3J2 , EWICS TC2 and ECMA/TC21 in January 1985 . This draft is composed of a mandatory Core module and five optional modules . Starting from this draft, ECMA/TC21 prepared a Standard for fully defined subsets of the language . These subsets , called ECMA BASIC-! and ECMA BASIC-2, are designed for business applications , requiring extended file facilities . ECMA BASIC-1 has no exception handling facilities and a reduced set of file operations . In addition, all the keywords in ECMA BASIC-1 are reserved words, reducing the comp lexity of the interpreter or compiler needed . ECMA BASIC-2 provides full exception handling capabilities , full file operations and fixed decimal capabilities . The set of reserved words is minimal . Both subsets provide the full flow control capabilities provided in the ANSI standard . An additional module (ECMA GRAPHICS) provides a minimum of graphic capabilities and can be used with either subset .
    [Show full text]
  • Unary Operator
    Introduction to Python Operations and Variables 1 Topics 1) Arithmetic Operations 2) Floor Division vs True Division 3) Modulo Operator 4) Operator Precedence 5) String Concatenation 6) Augmented Assignment 2 Arithmetic Operations 3 Mixing Types Any expression that two floats produce a float. x = 17.0 – 10.0 print(x) # 7.0 When an expression’s operands are an int and a float, Python automatically converts the int to a float. x = 17.0 – 10 print(x) # 7.0 y = 17 – 10.0 print(y) # 7.0 4 True Division vs Floor Division The operator / is true division and the operator // returns floor division(round down after true divide). True divide / always gives the answer as a float. print(23 // 7) # 3 print(3 // 9) # 0 print(-4 // 3) # -2 print(6 / 5) # 1.2 print(6 / 3) # 2.0 NOT 2! 5 Remainder with % The % operator computes the remainder after floor division. • 14 % 4 is 2 • 218 % 5 is 3 3 43 4 ) 14 5 ) 218 12 20 2 18 15 3 Applications of % operator: • Obtain last digit of a number: 230857 % 10 is 7 • Obtain last 4 digits: 658236489 % 10000 is 6489 • See whether a number is odd: 7 % 2 is 1, 42 % 2 is 0 6 Modulo Operator The operator % returns the modulus which is the remainder after floor division. print(18 % 5) # 3 print(2 % 9) # 2, if first number is smaller, it's the answer print(125 % 10) # 5 print(0 % 10) # 0 print(10 % 0) # ZeroDivisionError 7 Why floor/modulo division is useful Floor division allows us to extract the integer part of the division while the modulo operator extracts the remainder part of the division.
    [Show full text]
  • International Standard Iso 37500:2014(E)
    INTERNATIONAL ISO STANDARD 37500 First edition 2014-11-01 Guidance on outsourcing Lignes directrices relatives à l’externalisation Reference number ISO 37500:2014(E) --`,,,,,,,,```,,,,`,,``,,,``,```-`-`,,`,,`,`,,`--- © ISO 2014 Provided by IHS Licensee=University of Alberta/5966844001, User=sharabiani, shahramfs No reproduction or networking permitted without license from IHS Not for Resale, 11/09/2014 06:14:27 MST ISO 37500:2014(E) COPYRIGHT PROTECTED DOCUMENT © ISO 2014 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISO’s member body in the country of the requester. ISOTel. copyright+ 41 22 749 office 01 11 Case postale 56 • CH-1211 Geneva 20 FaxWeb + www.iso.org 41 22 749 09 47 E-mail--`,,,,,,,,```,,,,`,,``,,,``,```-`-`,,`,,`,`,,`--- [email protected] Published in Switzerland ii © ISO 2014 – All rights reserved Provided by IHS Licensee=University of Alberta/5966844001, User=sharabiani, shahramfs No reproduction or networking permitted without license from IHS Not for Resale, 11/09/2014 06:14:27 MST ISO 37500:2014(E) Contents Page Foreword ..........................................................................................................................................................................................................................................v
    [Show full text]
  • October 16, 2014 VIA ELECTRONIC FILING
    October 16, 2014 VIA ELECTRONIC FILING Honorable Kimberly D. Bose, Secretary Federal Energy Regulatory Commission 888 First Street, NE Washington, D.C. 20426 Re: ISO New England Inc., Filing of 2015 Capital Budget and Revised Tariff Sheets for Recovery of 2015 Administrative Costs; Docket No. ER15-_______________________ Dear Secretary Bose: Pursuant to Section 205 of the Federal Power Act, Part 35 of the Rules and Regulations of the Federal Energy Regulatory Commission (the “Commission”), Section 12 of the Participants Agreement among ISO New England Inc., the New England Power Pool and any Individual Participants,1 and Section IV.B.6.1 of the ISO New England Inc. Transmission, Markets and Services Tariff (the “Tariff”),2 ISO New England Inc. (the “ISO” or “ISO-NE”) hereby submits its capital budget for calendar year 2015 (the “2015 Capital Budget”) and a revised Section IV.A of the Tariff to reflect the collection of its administrative costs for calendar year 2015 (the “2015 Administrative Expenses Tariff”). The ISO requests that the Commission accept the 2015 Capital Budget and the 2015 Administrative Expenses Tariff as filed, effective January 1, 2015. Because the ISO is a non-profit entity without equity, it relies totally on collections under its Tariff to fund its operational expenses, including through depreciation. For this reason, the ISO is not in a position to make refunds should the Commission accept the 2015 Capital Budget or the 2015 Administrative Expenses Tariff for filing but set them for hearing subject to refund. That is, the only “refunds” that can be paid to ISO Customers during 2015 would have to be funded by additional charges to other Customers.
    [Show full text]
  • Technical Specification Iso/Ts 19159-1:2014(E)
    This preview is downloaded from www.sis.se. Buy the entire standard via https://www.sis.se/std-917587 TECHNICAL ISO/TS SPECIFICATION 19159-1 First edition 2014-07-15 Geographic information — Calibration and validation of remote sensing imagery sensors and data — Part 1: Optical sensors Information géographique — Calibration et validation de capteurs de télédétecion — Partie 1: Capteurs optiques Reference number ISO/TS 19159-1:2014(E) © ISO 2014 This preview is downloaded from www.sis.se. Buy the entire standard via https://www.sis.se/std-917587 ISO/TS 19159-1:2014(E) COPYRIGHT PROTECTED DOCUMENT © ISO 2014 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form orthe by requester. any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below or ISO’s member body in the country of ISOTel. copyright+ 41 22 749 office 01 11 CaseFax + postale 41 22 749 56 •09 CH-1211 47 Geneva 20 Web www.iso.org E-mail [email protected] Published in Switzerland ii © ISO 2014 – All rights reserved This preview is downloaded from www.sis.se. Buy the entire standard via https://www.sis.se/std-917587 ISO/TS 19159-1:2014(E) Contents Page Foreword ........................................................................................................................................................................................................................................iv
    [Show full text]
  • Icon Analyst 8
    In-Depth Coverage of the Icon Programming Language October 1991 Number 8 subject := OuterEnvir.subject object := OuterEnvir.object s_pos := OuterEnvir.s_pos In this issue … o_pos := OuterEnvir.o_pos fail String Synthesis … 1 An Imaginary Icon Computer … 2 end Augmented Assignment Operations … 7 procedure Eform(OuterEnvir, e2) The Icon Compiler … 8 local InnerEnvir Programming Tips … 12 InnerEnvir := What’s Coming Up … 12 XformEnvir(subject, s_pos, object, o_pos) subject := OuterEnvir.subject String Synthesis object := OuterEnvir.object s_pos := OuterEnvir.s_pos In the last issue of the Analyst, we posed the problem o_pos := OuterEnvir.o_pos of implementing a string-synthesis facility for Icon, using the ideas given earlier about modeling the string-scanning control suspend InnerEnvir.object structure. OuterEnvir.subject := subject Our solution is given below. First we need procedures OuterEnvir.object := object analogous to the procedure used for modeling string scanning. OuterEnvir.s_pos := s_pos In addition to a subject, there’s now an “object”, which is the OuterEnvir.o_pos := o_pos result of string synthesis. There now also are two positions, subject := InnerEnvir.subject one in the subject and one in the object. The global identifiers object := InnerEnvir.object subject, object, s_pos, and o_pos are used for these four s_pos := InnerEnvir.s_pos “state variables” in the procedures that follow. (In a real o_pos := InnerEnvir.o_pos implementation, these would be keywords.) fail The string synthesis control structure is modeled as end expr1 ? expr2 → Eform(Bform(expr1),expr2) Most of the procedures specified in the last issue of the are straightforward. Care must be taken, however, The procedures Bform() and Eform() are very similar Analyst to assure that values assigned to the positions are in range — to Bscan() and Escan() used in the last issue of the Analyst this is done automatically for the keyword &pos, but it must for modeling string scanning.
    [Show full text]
  • Indian Standard INFORMATION and DOCUMENTATION BIBLIOGRAPHIC REFERENCES PART 1 CONTENT, FORM and STRUCTURE
    IS 2381 (Part 1) : 2009 ISO 690 : 1987 (PREVIEW) Indian Standard INFORMATION AND DOCUMENTATION BIBLIOGRAPHIC REFERENCES PART 1 CONTENT, FORM AND STRUCTURE 1. Scope and field of application This International Standard specifies the elements to be included in bibliographic references to published monographs and serials, to chapters, articles, etc. in such publications and to patent documents. It sets out a prescribed order for the elements of the reference and establishes conventions for the transcription and presentation of information derived from the source publication. This International Standard is intended for use by authors and editors in the compilation of references for inclusion in a bibliography, and in the formulation of citations within the text corresponding to the entries in that bibliography. It does not apply to full bibliographic descriptions as required by librarians, descriptive and analytical bibliographers, indexers, etc. This International Standard covers references to published material in both print and non-print form. It does not, however, apply to references to manuscripts or other unpublished material. 2 References ISO 4, Documentation – Rules for the abbreviation of title words and titles of publications. ISO 9, Documentation – Transliteration of Slavic Cyrillic characters into Latin characters. ISO 233, Documentation – Transliteration of Arabic characters into Latin characters. ISO 259, Documentation – Transliteration of Hebrew characters into Latin characters. ISO 832, Documentation – Bibliographic references – Abbreviations of typical words . ISO 843/R, Documentation – Transliteration of Greek characters into Latin characters. ISO 2014, Writing of calendar dates in all-numeric form. ISO 2100, Documentation – International standard book numbering (ISBN). ISO 3166, Codes for the representation of names of countries.
    [Show full text]
  • Levelling the Playing Field 24
    #106 focusYour gateway to International Standards Levelling the playing field 24 ISOfocus September-October 2014 – ISSN 2226-1095 ISOfocus, the magazine of the International Organization for Standardization, is published six times a year. You can discover more content on our Website at iso.org/isofocus, or by staying connected with us on : TWITTER FACEBOOK googleplusYoutubeFlickrlinkedin 6 Director of Marketing, Communication and Information | Nicolas Fleury Head of Communication and Content Strategy | Katie Bird Editor-in-Chief | Elizabeth Gasiorowski-Denis Editors | Maria Lazarte, Sandrine Tranchard Copy editor and Proofreader | Vivienne Rojas Designers | Xela Damond, Pierre Granier, Alexane Rosa Translators | Cécile Nicole Jeannet, Anita Rochedy, Catherine Vincent Subscriptions and back issues If you enjoy ISOfocus, you can subscribe and download the pdf for free, or purchase single hard-copy issues through our Website iso.org/isofocus. You can also contact our customer service at [email protected]. Contributions You can participate in creating this magazine. If you think your contribution can add value to any of our sections, please get in touch at [email protected]. All content in this magazine is © ISO, 2014. No part can be reproduced without the prior written permission of the publisher. If you wish to do so, please contact us at [email protected]. Views expressed are those of the respective contributors and are not necessarily those of ISO or any of its members. 44 This magazine is printed on certified FSC ® paper. #106 4 Social feed 16 Our first Tweetchat ! 6 Show me the money ! Calculating the benefits of standards has just got easier. ISOfocus 16 Enter the first cyborg-type robot September-October 2014 What if cyborgs were real ? 22 Levelling the playing field… in love and war Celebrate World Standards Day on 14 October 2014.
    [Show full text]
  • View the Index
    INDEX Numbers and Symbols __(double underscore), using in 256 objects and 257 objects, 154–155 dunder methods, 322. See also ./, using with Ubuntu, 42 underscore (_) /? command line argument, 25–26 / (forward slash) = assignment operator, 113 purpose of, 18 == comparison operator, 113, 336 using with command line chaining, 103, 105 arguments, 25 using to compare objects, 154 # (hash mark) using with None, 94–95 using with comments, 183 != comparison operator, 336 using with docstrings, 188 * and ** syntax [] (index operator), using, 117 using to create variadic functions, ; (semicolons), using with timeit 167–171 module, 226–227 using to create wrapper functions, ' (single quote), using, 46 171–172 ~ (tilde), using in macOS, 23 using with arguments and - (unary operator), 155–157 functions, 166–167 + (unary operator), 156–157 * character, using as wildcard, 28–29 _ (underscore) ? character, using as wildcard, 28–29 PEP 8’s naming conventions, [:] syntax, using, 104 60–61 < comparison operator, 337 as prefix for methods and <= comparison operator, 337 attributes, 291–292 > comparison operator, 337 private prefix, 81 >= comparison operator, 337 using with _spaces attribute, 290 -> (arrow), using with type hints, 191 using with dunder methods, 120 \ (backslash) using with private attributes and purpose of, 18 methods, 283 using with strings, 95 using with WizCoin class, 279 : (colon), using with lists, 97–98, 104 , (comma), including in single-item A tuples, 150 abcTraceback.py program, saving, 4 - (dash), using with command line __abs__() numeric dunder arguments, 25 method, 328 $ (dollar sign), using in macOS, 23 absolute versus relative paths, 20–21 . (dot), using with commands, 31 __add__() numeric dunder method, 327 -- (double dash), using with command addToTotal() function, creating, line arguments, 25 172–173 algebra for big O, 236 base class, relationship to algorithm analysis.
    [Show full text]