Why is there a need for Django to introduce the decorator classonlymethod ?
Why can’t it reuse python classmethod?
Why is there a need for Django to introduce the decorator classonlymethod ? Why
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best explanation is the source code itself:
The difference is that a
classmethodcan be called on an instance, having the same effect as calling it on the class, but theclassonlymethodcan only be called on the class.