Programming Methods & Algorithms Python scripts - Top 4 Download

Programming Methods & Algorithms Python script downloads

Bag collection class

Bag collection class script implements Smalltalk's bag class. ...
Python

Constant Object Passing

This script shows you how to pass objects as "constant" (immutable) in python. ...
Python

Quasi Singleton Metaclass

In effect, this script provides a pattern for a set of quasi-singletons, identified by keyword. If no keyword is given, the default share is accessed. ...
Python

Static or Class Methods

This script implements class methods that do not require an object instance. ...
Python

Large File Sizes on 32 bit Windows

You can't use the os library to determine the size of large files on 32 bit Windows. This script uses the FindFiles win32call which provides among other things file size information. ...
Python

Number Format function

This function takes a number (integer or float) and returns a string with the integer portion grouped by thousands and the decimal portion rounded or padded to given number of decimal places. ...
Python

z matrix

This module provides two classes that emulate one and two dimentional lists with fixed sizes but mutable internals. Their primary purpose is to be used as a building tool for classes that need storage structures that cannot change in size. ...
Python

A List of Dictionaries

This  class emulates a list of dictionary objects without the memory and pickle storage overhead which occurs when storing every item in the list as a dictionary. ...
Python

Lazy streams using generators

This class allows you to use generators as more list-like streams. The chief advantage is that it is impossible to iterate through a generator more than once, while a stream can be re-used like a list. ...
Python

Memento Closure

The memento pattern is great for transaction-like processing. This script adds transactional semantics to methods. Methods decorated with @transactional will rollback to entry state upon exceptions. ...
Python

Debuging of object instantiation

If you are debugging a program, this script will help you to know if some special objects exist and where they came from. ...
Python

TryFinally

This script is a convenient way to deeply nest try/finally statements. It is appropriate for complicated resource initialization and destruction. For instance, if you have a list of 50 things that need to get intialized and later destructed via using try/finally (especially if you need to create the list dynamically) this function ...
Python

Transposing a List of Lists

This script allows you to transpose a list of lists of different lengths. ...
Python

Splicing of lists

This script splices any number of nonempty lists as one list. Each input list may be of different length.Elements of shorter lists may be recycled when the keyword argument recycle is set to True. Any error result in an empty output list. ...
Python

Variant assertion

Variant assertion script is Eiffel like loop variant assertion. ...
Python

Quick and easy FIFO queue class

Quick and easy FIFO queue class is an easy First-In-First-Out queue class based on Python's List data structure. ...
Python

Changing return value for mutating list methods

Mutating list methods such as 'append' or 'extend' return None instead of the (mutated) list itself. Sometimes, this is not the desired behaviour. To have a reference to the (mutated) list returned is usefull, if one wants to chain commands such as mylistinstance.append(7).sort(). ...
Python

Extending Classes

This script contains two implementations for extending an exsisting class using metaclasses. ...
Python

Just in time instantiation

JIT is a class for Just In Time instantiation of objects. Init is called only when the first attribute is either get or set. Then automatic delegation is used to front for the object. ...
Python