Re: [Python-Dev] functools additions

2007-04-15 Thread SevenInchBread
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

[Python-Dev] Py3: function signatures, type checking, and related crap

2007-04-15 Thread SevenInchBread
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

[Python-Dev] functools additions

2007-04-15 Thread SevenInchBread
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

[Python-Dev] Some new additions to functools

2007-04-15 Thread SevenInchBread
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