| |
- coor2dir(c)
- Converts (1, -1) style coords to "NE' style coords
- coor2rect(c)
- Converts ((x,y),(x,y)) style coords to a Rect object
- debug(*m)
- multiblit(dest, im)
- Blits ImageServer instance to surface. Assumes surface is large enough.
- multiply_surf(surf, x=2, y=2)
- Multiplies surfaces by x and y (repeating)
- picklable(obj)
- Checks whether object is picklable
- preserveuniq(s)
- Return a list of the elements in s in order, but without duplicates.
SOURCE:
Alex Martelli
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
- printtrace()
- randcycle(l)
- Yield random items from l.
- subtractrect(outer, inner)
- tiled_blit(src, dest, destrect=None, offset=(0, 0), srcrect=None)
- Repeats blitting src to dest until destrect is filled.
- touches(rect1, rect2)
- Checks whether rect1 and rect2 touch each other.
- uniq(s)
- Return a list of the elements in s, but without duplicates.
For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],
unique("abcabc") some permutation of ["a", "b", "c"], and
unique(([1, 2], [2, 3], [1, 2])) some permutation of
[[2, 3], [1, 2]].
For best speed, all sequence elements should be hashable. Then
unique() will usually work in linear time.
If not possible, the sequence elements should enjoy a total
ordering, and if list(s).sort() doesn't raise TypeError it's
assumed that they do enjoy a total ordering. Then unique() will
usually work in O(N*log2(N)) time.
If that's not possible either, the sequence elements must support
equality-testing. Then unique() will usually work in quadratic
time.
SOURCE:
Tim Peters, "Remove duplicates from a sequence", in:
Python Cookbook, 4 Juni 2001,
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
|