[Python-Dev] decorator module patch
Raymond Hettinger
raymond.hettinger at verizon.net
Sun Mar 12 22:14:42 CET 2006
[Ian Bicking]
>> memoize seems to fit into functools fairly well, though deprecated not
>> so much. functools is similarly named to itertools, another module
>> that
>> is kind of vague in scope (though functools is much more vague).
>> partial would make just as much sense in functools as in functional.
[Alex]
> Couldn't we merge functools and functional into just one (user-
> visible) module? The distinction between what goes into one vs the
> other is exceedingly subtle and poor users will be guessing as to
> what's where. If we need a mixed module with something in C and
> something in Python, we can do it the usual way, func.py wrapping
> _func.pyd (or .so or whatever)...
+1 on putting the tools all in one module.
With respect to decorator entries, I would like to see python-dev collectively
decide to show restraint. There are so many ways to write and use decorators
that best-of-the-best are not yet obvious. Hopefully, collections of decorators
will be allowed to grow-in-the-wild as recipes and as third-party modules before
being put into the core. Georg's proposal seems like a good candidate for a
first entry -- its chief virtue being that it may help people avoid writing
crummy decorators. If his goes in, hopefully it will not fall down a slippery
slope and trigger an avalance of immature decorators being added to the core.
my-two-cents,
Raymond
More information about the Python-Dev
mailing list