Programming in Python
As part of our cross-over to Python for software development we are putting together some opensource notes and libraries. This page consolidates that work. Here you will find a growing list of opensource python libraries and modules provided by BPC. All modules come with additional unit test and example use modules in the zip files.
Below is an adhoc, essentially unsorted, list of articles we have written covering various Python programming techniques. As the list grows we shall make it more organised.
Free for use by anyone for any purpose under the condition that Jonathan Bishop as author & creator is acknowledged in project documentation and on the about / credits screens of the project along with other module credits.
DlinkedList provides a doubly linked list that emulates the functionality of standard python lists, with some additional capabilities. Any iterable type can be provided as the initialiser argument and it will be converted to a doubly linked list. Any iterable can also be used as the right hand side of comparatives, additions, subtractions, etc. and it will be added to or subtracted from the list as appropriate. The class comes with both forward and reverse iteration support, which can be switched mid iteration, so the list can be used as an oscillator. The iterator also checks for a user defined "next" and "prev" function, so the next node in each iteration can be selected as a result of that function. This raises the possibility of having a one node list that is algorithmically infinite (and oscillating)! It would look like an infinite list to python. The objective was to make this object blend in seemlessly with other mutable python objects, so all enumeratable capabilities have been implemented. The list can store any python objects as its members.
Although it is actually a linked list of nodes, the library is designed to look like an array - similar to python lists.
The module comes with two additional files. One is a unittest object - for testing code changes, and the other is a set of tests designed to demonstrate some of its capabilities (and test stuff is working)