on-internet
← Community

python callable class as a decorator naming convention

Stack Overflow ·

I have following decorator declared as callable object: class nest: def __init__(self, func): self.func = func def __get__(self, instance, owner): self.obj = instance self.cls = owner return self.__call__ def __call__(self, request, *args, **kwargs): .... Then I can use it in the code like that: class Abc: @nest def test(self, *args, **kwargs): My question is: what is the convention of naming such decorator ? When I look into different decorators declaration (e.g. as functions) they're always? starting with lowercase. Nevertheless class name should start with the uppercase (according to PEP8).

Comments

Sign in or sign up to comment and upvote.

No comments yet.