[Python-3000] removing functions from string module (original) (raw)

Steven Bethard steven.bethard at gmail.com
Wed Apr 18 07:11:20 CEST 2007


On 4/17/07, Josiah Carlson <jcarlson at uci.edu> wrote:

"Steven Bethard" <steven.bethard at gmail.com> wrote: > On 4/17/07, Josiah Carlson <jcarlson at uci.edu> wrote: > > Christian Heimes <lists at cheimes.de> wrote: > > > Neal Norwitz schrieb: > > > > I'm tempted to ask the same thing about the types module. > > > > > > Don't forget the 'new' module. It's a candidate for 'svn rm'. > > > > > > """Create new objects of various types. Deprecated. > > > > > > This module is no longer required except for backward compatibility. > > > Objects of most types can now be created by calling the type object. > > > """ > > > > I would generally agree with you, except that when monkey patching > > instances... > > self.method = new.instancemethod(other.method.imfunc, > > self, > > self.class) > > Yes, but you could just as easily write this as:: > > self.method = other.method.imfunc.get(self) > > which I'd contend is better than the original new.instancemethod version. It is certainly easier to read, but I don't believe it is as self-documenting as the new.instancemethod variant. What do you get when calling 'new.instancemethod'? A new instance method. Is func.get documented anywhere?

In the Reference:

http://docs.python.org/ref/descriptor-invocation.html

But I agree it's not as prominent or as clear as it should be.

Steve

I'm not in-sane. Indeed, I am so far out of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy



More information about the Python-3000 mailing list