"git" is really trivial, written in four days. Most of that was not actually spent coding, but thinking about the data structures.
Monday, 9 February 2009
Monday, 2 February 2009
It is quite common to write such initializers:
Why not test it in a generic way?
def __init__(self, a, b):
self.a = a
self.b = b
allargs = inspect.getargspec(klass.__init__)
args = allargs[1:] # skipping self
instance = klass(*args)
for argname in args:
assert hasattr(instance, argname) # skipped the message
assert getattr(instance, argname) == argname # to keep short
Autor: Konrad o 08:09