reference to an object. The actual parameter value is assigned to the formal parameter. Pass-by-
assignment is basically the same as pass-by-reference because all of the actual parameters are
Abstract Data Types and Encapsulation Constructs
Python doesn’t support encapsulation. Although you can declare a semi private function by using an underscore before the function name. However this isn’t a private function in a traditional sense and doesn’t stop the function from being accessed directly from a different class. It only prevents other classes from accessing it indirectly.
Python is a primarily an object-oriented language despite the lack of encapsulation. Everything in Python is considered an object. This includes every class, function, and variable. One of Python’s key object-orientation features is multiple inheritance. This allows a class to inherit traits from multiple different classes. Another one of Pythons object-orientated features is the way Python handles polymorphism. Instead of using traditional polymorphism, Python uses what is called duck typing. The operator “is” tests an objects identity in order to figure out what kind of object it is. Pythons method changes based on the type of object being given to it.
Since Python is an interpreted language the only type of concurrency that can be used is logical concurrency. This means that a python program cannot directly take advantage of a machine that has multiple processors. However, Python does allow a programmer to create threads in Python. These threads can carry out tasks independently, adding concurrency to Python programs.
Exception Handling and Event Handling
Just like what is found in many languages, Python also supports exception handling. Instead of a Try..Catch block, in Python it is a Try..Except block but it works exactly the same. In addition to the standard catch block Python provides additional tools for working with exceptions. The raise statement allows a programmer to create an exception object in their program that will either re-raise the last exception within the current scope or if no exception is found in the current scope a runtime error is raised. This function is helpful for troubleshooting problems within sections of code. Python also allows users to create their own exceptions through class objects. However it is recommended that these new exceptions be derived from Pythons built-in exception class.
Python really doesn’t have built in event handling options other than the raw_input function. However Python does have a great deal of modules available for event handling. One of these modules is called tKinter. This is a GUI module that also provides event handlers for a Python programs GUI interface. It also seems to be the most popular.
Other Python Features
Python has two modes, programmer mode and interactive mode. In programmer mode the finished .py files are run as normal in the Python interpreter. Interactive mode is a command line shell that gives immediate feedback for each statement as it goes through memory. In this mode any code you type is immediately run. This mode is useful for troubleshooting issues with a program.
Evaluation of Python
Readability is probably Pythons strongest feature. Python is well known as an easy to understand language. This is why many teachers use it as a introduction language. Pythons greatest strength is in its simplicity. Python forces a programmer to use indentions for their control structures and the lack of a goto function ensures the code will be easier to read.
Python excels at writability as well, although this is diminished by the lack of built in event handlers. Due to the lack of built in event handlers, a programmer will either have to learn an existing module or create his own. Overall Python is easy to write with its simple syntax. Python makes it easy for programs to add their own classes or packages to Python. Python can also use C or C++ packages which makes it easier for programmers to implement code they find in those languages.
While Python has many features making it reliable, I found the language lacking in this aspect. Python doesn’t do type checking when passing parameters, doesn’t support encapsulation, and uses aliasing. While the readability/writability helps insure there are fewer errors in the code, the lack of certain features lowers it reliability.
One of Pythons key features is portability which makes it very cost effective. Python is open source and easy to learn. C or C++ programmers will already be able to make packages for Python. However the cost is increased with the lack of encapsulation or native event handlers increases cost. Python is a scripting language, which means the memory manager must always keep track of the type for each of the variables which slows the code down and makes it not as fast as C code. This is why many programmers use C packages for certain sections of their program to speed up performance. Overall Python is very flexible and easy to work with but without using C code packages, wouldn’t be the best language to use for real-time results or heavy processing.
Beazley, David. "An Introduction to Python Concurrency." An Introduction to Python Concurrency. USENIX Technical Conference, June 2009. Web. 20 Nov. 2012. .