PythonBites: Introduction

getting started

These Bites are a linked series of web pages hosting presentations about the Python programming language. They are intended to ease entry into the craft of writing Python. Each Bite provides an introduction to, and discusses the ideas behind, some aspect of the language. A menu on this page (lower right - Pages) shows the things we will be covering in this sequence.

Why Python ?

Fig 1. Point Class Definition
Fig 2. Using Code
Fig 3. Output
Python is a relatively small and simple imperative language. It is interpreted and supports object oriented design with an uncluttered syntax. Its types are all dynamic, e.g., defined at run-time, so there is no static program analysis before execution. That means that most errors are found by exceptions thrown when the translator cannot correctly interpret a function.

Things you need to know:


  • All data types are references into data stored in a managed heap. That means that assignments assign handles, not data instances, so an assignment results in two handles pointing to the same data instance.
  • The Python standard library provides a deepcopy function that will make a new instance returned as an independent entity of the assignment source. Note that requires traversing and copying an object graph that could be quite large, and so may be an expensive operation.
  • Python has a relatively simple syntax that defines scope by source white-space indentation. A lot of its power comes from a substantial collection of standard and user-defined libraries.

Figures 1, 2, and 3 provide a sample of how Python code is structured. Figure 1. holds some of the code for a Point class definition. Figure 2 shows how using code creates and uses instances of the class, and Figure 3 displays the output when the code in Figure 2 runs.

References

reference comments
Wikipedia C++ Survey of language origin, evolution, and properties
C++ 11 - Herb Sutter video Survey of important advancements
Back to Basics - Herb Sutter video Thoughtful advice about developing with C++
C++ 11 - Wikipedia Survey of C++ 11 standard
Writing good C++14 by default - Herb Sutter video Writing relatively simple and clear C++ using features of C++14
C++ 14 - Wikipedia Survey of C++ 14 standard
C++ 17 the good and ugly - Nicolai Josuttis video Informed opinions about C++ 17
C++ 17 features - Bryce Lelbach video Survey of selected features
C++ 17 - Wikipedia Survey of C++ 17 standard
Almost complete overview of C++20 - Marc Gregoire video Survey of C++ 20 standard
C++ 20 - Wikipedia Survey of C++ 20 standard