Re: [Pyobjc-dev] Auto bridging instances by conversion
Brought to you by:
ronaldoussoren
From: Ronald O. <ous...@ci...> - 2003-02-03 16:22:28
|
On Monday, Feb 3, 2003, at 16:58 Europe/Amsterdam, Bob Ippolito wrote: > > On Monday, Feb 3, 2003, at 10:30 America/New_York, Just van Rossum > wrote: > >> bb...@ma... wrote: >> >>> The fact that NSString<->PyString are converted is a bug -- >> >> To me it isn't, it's what I call "transparent". This feature is >> absolutely a _pleasure_ to work with. > > It's what I call a "real pain in the ass", at least when > NSMutableString gets bridged into a PyString. A real argument for not doing the conversion! Not converting can also be problematic: What if you pass the NSString to an extension-function that expects a string (like open), unless these get changed to also accept NSStrings you'll have to perform manual conversion from NSString to a python string. > > Why can't we wrap the NSString class cluster with some cruft that > makes it pythonic instead of converting it to something that it > wasn't? There is absolutely no namespace clash between NSString and > PyString, with the added bonus that NSString can do just about > everything that PyString can with one line of code or less. The 'problem' with NSString is that its interface is much more powerfull than that of python strings (the word cruft springs to mind when seeing methods like stringByAbbreviatingWithTildeInPath). In case anyone cares: I (still) haven't made made my mind up on whether automaticly converting values is a usefull feature or not. There are to many irritating 'features' on either solution (converting or wrapping). Ronald |