[Pyobjc-dev] Strings: Python -> ObjC
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2003-02-07 15:41:56
|
On Friday, Feb 7, 2003, at 05:14 US/Eastern, Just van Rossum wrote: > Proposal for Python -> ObjC: > > - if it's a pure Python string (str or unicode), simply convert to > NSString, don't keep a ref to the Python string. AFAIK this is what we > have now. > - if it's an instance of our unicode subclass, use the underlying > NSString. This can even preserve identity. (I'll comment on the rest of the proposal later -- have to think hard about it and don't have time or caffeine to do so now . Just wanted to give a brief comment on this.) I have an OC_PythonString implementation [that needs some adjustment in light of Ronald's recent improvements] that does not convert the Python string and maintains the reference to the string. It works as you describe for both unicode and python strings, naively assuming that python strings can be represented within an NSString without problem [so far so good]. I hope to clean it up and commit sometime soon. If you are going to dive into this stuff, I'd be happy to throw you the source... b.bum |