Steven D'Aprano added the comment:

Its not clear what you are asking for here. Do you think the current behaviour 
is a bug? Are you asking for a new feature? What do you want?

When the decorator is called, "self" doesn't exist, so of course 
@self.decorator *must* fail. What else could it do? Which instance should 
Python use, if there is no instance that exists yet?

You say "many people rely on Decorators in class that accepts an instance of 
itself", but I doubt that. I've never wanted code like that, and the example 
you show wouldn't work even if "self" existed. Can you give a better example?

Personally, I think this is a good learning experience for programmers, not 
something that needs to be fixed. Anyone who tries to decorate a method in a 
class by calling self.method is confused about classes, instances and 
decorators, and this is a good lesson for them to learn.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29848>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to