Howdy --

My two bits:

* Class methods basically exist to mask dogmatic language design. They make sense in languages with shitty namespace support (Java, Objective-C) but they're lame in Python. Speaking as someone who has taught a lot of people to program in a lot of languages: nobody gets class methods. The concept of classes as a first-class object comes very late in a programmer's maturity, and trying to explain what happens when you call a class method to a first-timer is very difficult. Django's not just for experienced Python programmers, it's also for first time web developers to whom "stories.get_list()" makes sense.

* The reason a module is better is because if you were writing the generated code by hand, you'd probably use use a module Written by hand, you'd do:

        class MyModel():
                ...

        class AddManipulator():
                ...

        class AddManipulator():
                ...

not something like:

        class MyModel():
                class AddManipulator():
                        ...

right? This is easy to explain: "if you were doing this by hand, you'd write a get_list() method in your module, but that's boring so Django does it for you."

* Prettiness is very important to me. If I didn't care how my code looked I'd still be writing PHP. Allowing Poll.get_list() is a problem, because than I can't have a relation named "list";Poll.table.get_list() is ugly As, for that matter, is Poll.get_list(). I'm not getting a list of Poll, I'm getting a list of polls. Python rocks because it's so readable; Django similarly rocks that way.

This isn't about name-churn, it's about making code "look" right. "from django.models.foo import bar" has always looked wrong; "from ellington.news.models import stories" looks right. "stories.Story.get_object()" looks wrong; "stories.get_object()" looks right.

Robert Wittams writes:
Just look at the downsides to the magic generated class : wierdo issues
with visibility, importing, naming, inheritance (quite apart from the
odd current interpretation of inheritance, things like mixins are a
nightmare. Georg had something about this somewhere as well)....

* The fix solves the visibility problems, solves naming issues, and makes importing crystal clear. Inheritance is quite unrelated to this as are mixins.

* Good calls on a point release before the change and doing the work on the branch.

Finally, I know that syntax changes are controversial, but the tone of this discussion is already a little hot. Let's all please try to keep things civil and remember that whatever we come up with will kick PHP's ass six ways to Sunday.

Jacob

Reply via email to