Re: [Pyobjc-dev] NSString & mutability
Brought to you by:
ronaldoussoren
From: David E. <epp...@ic...> - 2003-02-05 17:05:58
|
On 2/5/03 9:39 AM +0100 Ronald Oussoren <ous...@ci...> wrote: > I think you should read this as 'even though some methods are defined as > returning an NSFoo they may return any subclass (like NSMutableFoo), > depending on the actuall type is bad'. Read like that this is pretty > relevant to our discussion: If we convert NSString and wrap > NSMutableString (a subclass of NSString) the user may sometimes get a > python string object and sometimes not from functions/methods that are > documented as returning a NSString. The bad part about this is that the mutable returns may be quite rare, so you won't notice for a long time that your code has a bug. I'd rather find out quickly when a str() wrapper is necessary. -- David Eppstein UC Irvine Dept. of Information & Computer Science epp...@ic... http://www.ics.uci.edu/~eppstein/ |