Do you have commit access? What's your real name?
I prefer to remain pseudonymous, and I don't have commit access.
Yeah... they're not terribly useful - more or less there for the sake of
being there. Batteries included and all that
...but now I've got a more useful idea for a function wrapper
People seem to be pushing for a consistent method for checking the "x-ness"
of objects (that is, interfaces that the object implements).
So I present an idea for a simple and straightforward type that provides a
way to construct descriptions of object structures, and I'd like some help
expanding
So if it's alright with the privledged folk - I'd like to commit these
minor (and probably non-controversial) additions to the functools module.
def cat(x): return x
def multimap(func, s, n=2):
assert n > 0, "n must be positive"
return (map(func, seq)
if n == 1 else
So I've cooked up some very simple functions to add to functools - to expand
it into a more general-purpose module.
def cat(x): return x
class nullfunc(object):
def __call__(self, *args, **kargs): return self
def __getattr__(self, name):return getattr(None, name)
def multimap(fun