Re: [Pyobjc-dev] Re: [ pyobjc-Bugs-679748 ] NSMutableString gets converted to Python string
Brought to you by:
ronaldoussoren
From: Just v. R. <ju...@le...> - 2003-02-03 22:36:33
|
Bob Ippolito wrote: > What about this: > class UnicodeNSStringWrapper(unicode): > def __new__(clazz, myNSString): > s = > unicode.__new__(somethingToConvertNSStringInstanceToPyUnicodeObject(myNS > String)) > s._objc = myNSString > return s > def __getattr__(self, attr): > try: > return getattr(self._objc, attr) > except: > raise AttributeError, '%r object has no attribute %r' % > (self.__class__.__name__, self._objc) > > It should do anything that unicode() will do, just like the str > subclass I posted a bit ago.. and you don't lose any of the NSString > functionality. This seems the worst of both worlds, performance wise: allocate new storage *and* keep the old object? Hm... Just |