[Pyobjc-dev] Decorators with descriptors
Brought to you by:
ronaldoussoren
|
From: Barron S. <li...@ba...> - 2009-01-17 15:18:57
|
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
Thanks,
Barron |