And here's another reason to use new-style: I forgot the sauerkraut! Oh, the horror!<br><br><div class="gmail_quote">On Nov 15, 2007 1:42 PM, Marc Tompkins <<a href="mailto:marc.tompkins@gmail.com">marc.tompkins@gmail.com
</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I thought of an analogy I like better than my sign-painting one: ordering a sandwich.
<br>Imagine: you're at the deli, and your waitron asks what you want. (Granted, this is a silly example.)<br> "Classic" order: "I'd like a sandwich with two slices of rye bread, Russian dressing, corned beef, and Swiss cheese. Oh, and I'd like that grilled."
<br> "New-style" order: "Reuben, please."<br><br>Now, I speak not of the time and materials required to construct the above-mentioned tasty treat - in my analogy, Python is the long-suffering waitron, not the cook - but I gotta figure that the second option will take less space to write on the check. Perhaps about 134 bytes' worth.
<br><br>For some reason I'm hungry now...<div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Nov 15, 2007 11:22 AM, Kent Johnson <<a href="mailto:kent37@tds.net" target="_blank">kent37@tds.net</a>
> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Marc Tompkins wrote:<br>> I didn't mean that exactly literally - for goodness' sake, this is a<br>> high-level, object-oriented, interpreted language! We're not writing<br>> machine language here.
<br><br></div>Yes, I was thinking I should re-word my email, it was worded a bit too<br>strongly...<br><div><br>> What I did mean, and will probably still not express as clearly as I'd<br>> like, is that when you create a "classic" class, lots of options remain
<br>> unresolved - slots vs. dict comes to mind - and Python needs to reserve<br>> extra space accordingly. About 134 extra bytes, it would appear.<br><br></div>Still not sure I know what you mean. AFAIK old-style classes don't
<br>support slots, at least not user-defined slots. I do remember talk of<br>new-style classes and properties allowing a much cleaner implementation<br>of the class mechanisms, and it seems plausible that such generalization
<br>would lead to fewer options and streamlining of the class structure, but<br>I don't know enough about the specifics to know if that is right.<br><br>I poked around a bit in the source to see if I could figure it out but
<br>got tired of trying to sift through the header files...<br><br>Kent<br><div>><br>> On Nov 15, 2007 9:32 AM, Kent Johnson <<a href="mailto:kent37@tds.net" target="_blank">kent37@tds.net</a><br></div><div>
> <mailto:<a href="mailto:kent37@tds.net" target="_blank">kent37@tds.net</a>>> wrote:<br>><br>> Marc Tompkins wrote:<br>><br>> > class B is a "new-style' class, meaning that it inherits from a base,
<br>> > pre-existing class (in this case "object", which is as basic and<br>> generic<br>> > as you can get!). class A has to start from nothing, which is why it<br>> > consumes more memory yet has less functionality.
<br>><br>> I don't think it is really accurate to say that an old-style class<br>> "starts from nothing". It doesn't have an explicit base class but it<br>> does have all the old-style class machinery which is built in to Python.
<br>><br>> I don't know why new-style classes are smaller though. My guess is that<br>> it is because there was an opportunity to streamline the class structure<br>> based on experience.<br>>
<br>> Kent<br>><br>><br>><br>><br>> --<br></div>> <a href="http://www.fsrtechnologies.com" target="_blank">www.fsrtechnologies.com</a> <<a href="http://www.fsrtechnologies.com" target="_blank">
http://www.fsrtechnologies.com</a>><br><br></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br><a href="http://www.fsrtechnologies.com" target="_blank">www.fsrtechnologies.com</a>
</font></blockquote></div><br><br clear="all"><br>-- <br><a href="http://www.fsrtechnologies.com">www.fsrtechnologies.com</a>