Hi Adam,
(reordering quoted parts a little)
On Tuesday 19 November 2013 18:33:01 Adam Smith wrote:
> Hi, I'm quite new to Python and Django
Welcome aboard!
> Like I said, I'm quite new to Python and this community, I'm not sure
> whether this is the right place to ask this kind of question.
>
This list is intended for discussing the development of Django, so questions
about its implementation are exactly on topic.
> as I read through the django/utils/functional.py, I was wondering why not
> use `classmethod` as a class method decorator consistently, as line
> 334? Any specific reasons?
>
I assume you're referring to the places like line 122 (which you linked to)
and line 140, where instead of
@classmethod
def x(cls,...):
...
you see
def x(cls,...):
...
x = classmethod(x)
The reason for this is historic: Decorators were only introduced into Python
at version 2.4, and Django<1.2 still supported Python 2.3. Some code hasn't
changed since then. Now that you pointed it out, these specific lines are
likely to change soon :)
Thanks,
Shai.