Thread: [Pyobjc-dev] Article on MacDevCenter
Brought to you by:
ronaldoussoren
From: Bill B. <bb...@co...> - 2003-02-01 06:08:08
|
http://www.macdevcenter.com/pub/a/mac/2003/01/31/pyobjc_one.html :-) b.bum |
From: Dinu G. <gh...@da...> - 2003-02-01 18:36:56
|
> http://www.macdevcenter.com/pub/a/mac/2003/01/31/pyobjc_one.html Nice and a good move! All I have to "criticize" is that there is not quite enough of an emphasis on mutable vs. unmutable objects, both in Python and the Foundation framework (Tuples/Lists vs. NSArray/ NSMutableArray, say) and the PyObjC bridging between them. Or is that no issue at all? I'm curious for the next parts! Any hints on when to expect them? Regards, Dinu -- Dinu C. Gherman ...................................................................... "Women give to men the very gold of their lives. But they invariably want it back in small change." (Oscar Wilde) |
From: Bill B. <bb...@co...> - 2003-02-01 18:54:40
|
On Saturday, Feb 1, 2003, at 13:37 US/Eastern, Dinu Gherman wrote: >> http://www.macdevcenter.com/pub/a/mac/2003/01/31/pyobjc_one.html > > Nice and a good move! All I have to "criticize" is that there is not > quite enough of an emphasis on mutable vs. unmutable objects, both > in Python and the Foundation framework (Tuples/Lists vs. NSArray/ > NSMutableArray, say) and the PyObjC bridging between them. Or is > that no issue at all? Definitely an issue -- but the bridge "handles" it in the same fashion that ObjC "handles" it: >>> a = NSArray.arrayWithArray_([1,2,3,4,5]) >>> a <NSCFArray objective-c instance 0x50290> >>> a[0] = 5 Traceback (most recent call last): File "<stdin>", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/objc/_convenience.py", line 173, in <lambda> ('__setitem__', lambda self, index, anObject: self.replaceObjectAtIndex_withObject_(index, anObject)), objc.error: NSInternalInconsistencyException - *** -[NSCFArray replaceObjectAtIndex:withObject:]: mutating method sent to immutable object If you need a mutable array, you can create one in a couple of different ways: >>> a = a.mutableCopy() >>> a[0] = 5 >>> from Foundation import Conversion >>> x = Conversion.pythonCollectionFromPropertyList(a) Well, that last one *will* work after I fix a bug in the Conversion module. :-) > I'm curious for the next parts! Any hints on when to expect them? After 0.9... The next article will discuss the construction of a trimmed down version of Web Services Tool -- WST without the dynamic toolbar, basically. A good example as it nicely demonstrates how to build a multi-window style app [actually -- I *could* do it as a multi-doc app example] that leverages the incredible ease with which Python can communicate to XML-RPC servers. b.bum |
From: Jack J. <Jac...@or...> - 2003-02-02 00:01:20
|
On zaterdag, feb 1, 2003, at 07:07 Europe/Amsterdam, Bill Bumgarner wrote: > http://www.macdevcenter.com/pub/a/mac/2003/01/31/pyobjc_one.html Bill, looks good!! There's, however, one little thing that bothers me. Actually, it's been bothering me since I first came across the PyObjC module a few years ago: PyObjC is very daunting to a Python programmer initially, with all the long method names with _ all over them. This made me stay away from it for a long time (until less than a year ago, actually, after I had done a few Cocoa examples in ObjC itself and got to know the power of Cocoa). Your article shares that treat of PyObjC, I think: if you're a Python programmer fresh to OSX and you start your foray into Cocoa with reading it you'll probably turn away and stick to Tk or wxWindows. I think PyObjC popularity would be helped very much if there was an introduction to PyObjC that was targeted at Python users, which would somehow ease them into the funny naming scheme and such... -- - Jack Jansen <Jac...@or...> http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - |
From: Bob I. <bo...@re...> - 2003-02-02 00:06:46
|
On Saturday, Feb 1, 2003, at 19:01 America/New_York, Jack Jansen wrote: > > On zaterdag, feb 1, 2003, at 07:07 Europe/Amsterdam, Bill Bumgarner > wrote: > >> http://www.macdevcenter.com/pub/a/mac/2003/01/31/pyobjc_one.html > > Bill, > looks good!! > > There's, however, one little thing that bothers me. Actually, it's > been bothering me since I first came across the PyObjC module a few > years ago: PyObjC is very daunting to a Python programmer initially, > with all the long method names with _ all over them. This made me stay > away from it for a long time (until less than a year ago, actually, > after I had done a few Cocoa examples in ObjC itself and got to know > the power of Cocoa). Your article shares that treat of PyObjC, I > think: if you're a Python programmer fresh to OSX and you start your > foray into Cocoa with reading it you'll probably turn away and stick > to Tk or wxWindows. > > I think PyObjC popularity would be helped very much if there was an > introduction to PyObjC that was targeted at Python users, which would > somehow ease them into the funny naming scheme and such... Well the biggest plus for me is that it's the easiest to install and lightest to deploy python GUI framework on OS X. -bob |