Jacob Kaplan-Moss wrote: > > * Prettiness is very important to me.
I just really don't know what to think about this rant, it is effectively building up a personal preference about how evil class methods are into a reason to cause yourself lots of other problems in the future. I honestly have no idea how generating mirror classes in some arbitrary 'kinda related' namespace is ever going to be pretty. > 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. This is pretty much the definition of name churn - changing names to make yourself feel better. Do you know what would really 'look right'? Importing the thing that you actually defined. > > 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. That would have been quite a useful bit of information to have at the beginning of the discussion, wouldn't it? >Inheritance is quite unrelated to this > as are mixins. No, its not *at all*. If you are generating a new class, you are necessarily mucking about with the meaning of inheritance. This means model classes act differently than normal classes. We should aim for inheritance to act completely normally. The sensible way to do this is to use normal python inheritance for everything, by not generating magic classes, and then intervening only to maintain those semantics when needed. Also, almost all sane meanings of the term 'mixin' use it as a subset of inheritance, so... Are you still generating a new class ? Why? And from the tone ('the fix'), I assume that this whole change is already a fait accompli? > * 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. Its not that they are controversial, its that from the information that has trickled out so far, it sounds like it doesn't go far enough, but still causes just as much pain as a real fix would.