Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Django's Meta an old-style class?

I noticed that in Django models, there is a class Meta which makes some additional definitions about the model.

My question is, why is this done as an old-style class? (i.e. not subclassing object?) Is there a reason for this or is this just a custom? Could I do it as a new-style class in my projects?

like image 900
Ram Rachum Avatar asked Jan 05 '10 09:01

Ram Rachum


1 Answers

I believe that there is no real reason (including history, since new-style classes exist since Python 2.2) and that not only can you choose to use a new-style class instead, but that it would probably be a good idea for you to do so (for all the usual reasons).

like image 197
Alex Martelli Avatar answered Sep 22 '22 09:09

Alex Martelli