Re: [Pyobjc-dev] Decorators with descriptors
Brought to you by:
ronaldoussoren
|
From: Barron S. <li...@ba...> - 2009-01-20 22:47:21
|
On Jan 20, 2009, at 3:16 PM, Diez B. Roggisch wrote: > Barron Snyder schrieb: >> Hello, >> Can decorators with descriptors be used with pyobjc? >> I'm getting the error: >> * File "/Users/barron/Projects/Python/Relations/build/Debug/ >> Relations.app/Contents/Resources/Person.py", line 22, in Person* >> * @givenNames.setter* >> *AttributeError: 'property' object has no attribute 'setter'* >> *2009-01-17 09:45:26.140 Relations[1476:10b] *** Terminating app >> due to uncaught exception * >> Here's my class: >> class Person(NSObject): >> def __init__(self, givenNames, surname): >> self.givenNames = givenNames >> self.surname = surname >> @property >> def givenNames(self): >> return self.givenNames >> @givenNames.setter >> def givenNames(self, givenNames): >> self.givenNames = givenNames >> @property >> def surname(self): >> return self.surname >> @surname.setter >> def surname(self, surname): >> self.surname = surname >> Does pyobjc require a different way to do getters/setters than the >> Guido recommended way?: >> http://mail.python.org/pipermail/python-dev/2007-November/075182.html > > AFAIK that's python2.6-property-descriptor. You sure you are using > 2.6? > > Diez (sheepish grin) Well no, I'm using 2.5.1. Sorry, I'm new to all this and didn't know it was a new feature. Thanks for enlightening me. - Barron |