On Jan 17, 2008 6:15 AM, Andy Cheesman <<a href="mailto:Andy.cheesman@bristol.ac.uk">Andy.cheesman@bristol.ac.uk</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
My only arising question is why should i<br>"derive from object, so that you get a new-style class."<br></blockquote></div><br>This list discussed this topic a couple of weeks ago. Recklessly simplifying, it boils down to this: By using new-style classes, your objects inherit a number of pre-defined methods and properties which you would otherwise have to write yourself. Ceteris paribus, a new-style class takes up less memory than the equivalent old-style class (there was some wild surmise about why that should be, but it's not important now.) Finally, it appears that Python 3000 will require new-style classes, so you might as well get used to them now.
<br><br>For your program, the only difference is that instead of defining a class like this:<br><br>class Thingy():<br> pass<br><br>you would write this:<br><br>class Thingy(object):<br> pass<br><br>Not much downside, I'd say.
<br><br clear="all"><br>-- <br><a href="http://www.fsrtechnologies.com">www.fsrtechnologies.com</a>