Re: [Pyobjc-dev] Bridging NSMutableString, a compromise
Brought to you by:
ronaldoussoren
From: David E. <epp...@ic...> - 2003-02-07 20:55:06
|
> I don't care much about having access to the > NSString methods for immutable strings (I'm quite happy with how Python > string methods work), but due to the "fragile immutability syndrome" it > makes no sense to expose the NSMutableString methods only when the > string is immutable. I care about NSString methods; specifically I'd like to use Apple's localized string comparisons instead of Python's, for greater consistency with other Cocoa apps. But as long as NSString.method(str, whatever) works, that's good enough for me. >> Another BTW: We currently try to convert the NSString to ASCII before >> building a unicode object when going from Objective-C to Python, if >> performance is an issue we should at least do away with that piece of >> code and just always convert NSString objects to unicode. > > +1 I also think this is the right thing to do for semantic reasons rather than performance: unicode and NSString are objects that have known encodings, str doesn't. >> s = s.nsstring > According to our coding style this should be 's = s.pyobjc_nsstring', but > otherwise I agree. Under what circumstances is it useful to use s.pyobjc_nsstring.method(...) instead of NSString.method(s, ...)? -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |