Re: @property decorator doesn't raise exceptions

2008-10-29 Thread Peter Otten
Rafe wrote: > Thanks for the idea Peter. What confuses me is why this only happens > to @Property (and I assume other decorator related bindings?). Does it > have something to do with the way the class gets built? 'Normal' > attributes will raise AttributeErrors as expected, without triggering > _

Re: @property decorator doesn't raise exceptions

2008-10-29 Thread Rafe
On Oct 27, 2:47 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Rafewrote: > > Can anyone explain why this is happening? > > When an attribute error is raised that is an indication that the requested > attribute doesn't exist, and __getattr__() must be called as a fallback. > > > I can hack a work-aro

Re: @property decorator doesn't raise exceptions

2008-10-29 Thread Rafe
OT... Sorry about he spam. Thanks for taking the time to post this Duncan. I had the same thought. I have posted to this list before but never experienced anything like this wait. I figured it was possible that I hit "Reply to Author" the first time so I sent it again. I waited about 8 hours befor

Re: @property decorator doesn't raise exceptions

2008-10-27 Thread Peter Otten
Rafe wrote: > Can anyone explain why this is happening? When an attribute error is raised that is an indication that the requested attribute doesn't exist, and __getattr__() must be called as a fallback. > I can hack a work-around, > but even then I could use some tips on how to raise the 'rea

Re: @property decorator doesn't raise exceptions

2008-10-26 Thread Duncan Booth
Rafe <[EMAIL PROTECTED]> wrote: > Peter Oten pointed me in the right direction. I tried to reply to his > post 2 times and in spite of GoogleGroups reporting the post was > successful, it never showed up. This is the third variant on your message that has shown up in the newsgroup. Please be aw

Re: @property decorator doesn't raise exceptions

2008-10-25 Thread Rafe
On Oct 24, 1:47 am, Rafe <[EMAIL PROTECTED]> wrote: > Hi, > > I've encountered a problem which is making debugging less obvious than > it should be. The @property decorator doesn't always raise exceptions. > It seems like it is bound to the class but ignored when called. I can > see the attribute u

Re: @property decorator doesn't raise exceptions

2008-10-25 Thread greg
Rafe wrote: The docs seem to suggest this is impossible: "Called when an attribute lookup has not found the attribute in the usual places (i.e. it is not an instance attribute nor is it found in the class tree for self). Getting an AttributeError is the way that the interpreter machinery tells

Re: @property decorator doesn't raise exceptions

2008-10-25 Thread Rafe
On Oct 24, 9:58 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Rafe wrote: > > On Oct 24, 2:21 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > >> Rafewrote: > >> > Hi, > > >> > I've encountered a problem which is making debugging less obvious than > >> > it should be. The @property decorator doesn'

Re: @property decorator doesn't raise exceptions

2008-10-25 Thread Rafe
On Oct 24, 9:58 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Rafe wrote: > > On Oct 24, 2:21 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > >> Rafewrote: > >> > Hi, > > >> > I've encountered a problem which is making debugging less obvious than > >> > it should be. The @property decorator doesn'

Re: @property decorator doesn't raise exceptions

2008-10-24 Thread Steven D'Aprano
On Fri, 24 Oct 2008 01:47:10 -0700, Rafe wrote: > Hi, > > I've encountered a problem which is making debugging less obvious than > it should be. The @property decorator doesn't always raise exceptions. I don't think that's the problem. I think properties do correctly raise all exceptions that o

Re: @property decorator doesn't raise exceptions

2008-10-24 Thread Steven D'Aprano
On Fri, 24 Oct 2008 09:34:36 -0700, Rafe wrote: >> You must subclass from "object" to get a new style class. properties >> don't work correctly on old style classes. >> >> Christian > > All classes are a sub-class of object. Any other ideas? Only in Python 3. If you are relying on that to be tru

Re: @property decorator doesn't raise exceptions

2008-10-24 Thread Peter Otten
Rafe wrote: > On Oct 24, 2:21 am, Christian Heimes <[EMAIL PROTECTED]> wrote: >> Rafewrote: >> > Hi, >> >> > I've encountered a problem which is making debugging less obvious than >> > it should be. The @property decorator doesn't always raise exceptions. >> > It seems like it is bound to the clas

Re: @property decorator doesn't raise exceptions

2008-10-24 Thread Rafe
On Oct 24, 2:21 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > Rafewrote: > > Hi, > > > I've encountered a problem which is making debugging less obvious than > > it should be. The @property decorator doesn't always raise exceptions. > > It seems like it is bound to the class but ignored when ca

Re: @property decorator doesn't raise exceptions

2008-10-24 Thread Christian Heimes
Rafe wrote: Hi, I've encountered a problem which is making debugging less obvious than it should be. The @property decorator doesn't always raise exceptions. It seems like it is bound to the class but ignored when called. I can see the attribute using dir(self.__class__) on an instance, but when

@property decorator doesn't raise exceptions

2008-10-24 Thread Rafe
Hi, I've encountered a problem which is making debugging less obvious than it should be. The @property decorator doesn't always raise exceptions. It seems like it is bound to the class but ignored when called. I can see the attribute using dir(self.__class__) on an instance, but when called, pytho