Re: [Tutor] Memory consumption question

2007-11-16 Thread Tiger12506
> OK, the analogy is cute, but I really don't know what it means in > Python. Can you give an example? What are the parts of an old-style > class that have to be 'ordered' separately? How do you 'order' them > concisely with a new-style class? > > Thanks, > Kent He is setting up the analogy so tha

Re: [Tutor] Memory consumption question

2007-11-15 Thread Marc Tompkins
Sorry, sloppy cutting and pasting. Should be: Referring to the original post: > > > >>> dir(A) > > ['__doc__', '__module__'] > > >>> dir(B) > > ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', > > '__hash__', '__init__', '__module__', '__new__', '__reduce__', > > '__reduce_

Re: [Tutor] Memory consumption question

2007-11-15 Thread Marc Tompkins
Referring to the original post: > >>> dir(B) > ['__doc__', '__module__'] > >>> dir(B) > ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', > '__hash__', '__init__', '__module__', '__new__', '__reduce__', > '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__'] >

Re: [Tutor] Memory consumption question

2007-11-15 Thread Kent Johnson
OK, the analogy is cute, but I really don't know what it means in Python. Can you give an example? What are the parts of an old-style class that have to be 'ordered' separately? How do you 'order' them concisely with a new-style class? Thanks, Kent Marc Tompkins wrote: > I thought of an analog

Re: [Tutor] Memory consumption question

2007-11-15 Thread Eric Brunson
I'm sorry, but a Reuben with no 'kraut is just a corned beef sandwich. :-) Marc Tompkins wrote: > And here's another reason to use new-style: I forgot the sauerkraut! > Oh, the horror! > > On Nov 15, 2007 1:42 PM, Marc Tompkins <[EMAIL PROTECTED] > > wrote: > >

Re: [Tutor] Memory consumption question

2007-11-15 Thread Marc Tompkins
And here's another reason to use new-style: I forgot the sauerkraut! Oh, the horror! On Nov 15, 2007 1:42 PM, Marc Tompkins <[EMAIL PROTECTED]> wrote: > I thought of an analogy I like better than my sign-painting one: ordering > a sandwich. > Imagine: you're at the deli, and your waitron asks w

Re: [Tutor] Memory consumption question

2007-11-15 Thread Marc Tompkins
I thought of an analogy I like better than my sign-painting one: ordering a sandwich. Imagine: you're at the deli, and your waitron asks what you want. (Granted, this is a silly example.) "Classic" order: "I'd like a sandwich with two slices of rye bread, Russian dressing, corned beef, and Swiss

Re: [Tutor] Memory consumption question

2007-11-15 Thread Kent Johnson
Marc Tompkins wrote: > I didn't mean that exactly literally - for goodness' sake, this is a > high-level, object-oriented, interpreted language! We're not writing > machine language here. Yes, I was thinking I should re-word my email, it was worded a bit too strongly... > What I did mean, and

Re: [Tutor] Memory consumption question

2007-11-15 Thread Marc Tompkins
I didn't mean that exactly literally - for goodness' sake, this is a high-level, object-oriented, interpreted language! We're not writing machine language here. What I did mean, and will probably still not express as clearly as I'd like, is that when you create a "classic" class, lots of options

Re: [Tutor] Memory consumption question

2007-11-15 Thread Marc Tompkins
Thus spake Bart Cramer: > I have a question... : > > >>> class A: pass > ... > >>> class B(object) : pass > ... > >>> dir(A) > ['__doc__', '__module__'] > >>> dir(B) > ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', > '__hash__', '__init__', '__module__', '__new__', '__redu

Re: [Tutor] Memory consumption question

2007-11-15 Thread Kent Johnson
Marc Tompkins wrote: > class B is a "new-style' class, meaning that it inherits from a base, > pre-existing class (in this case "object", which is as basic and generic > as you can get!). class A has to start from nothing, which is why it > consumes more memory yet has less functionality. I d

[Tutor] Memory consumption question

2007-11-15 Thread Bart Cramer
Dear all, I have a question... : >>> class A: pass ... >>> class B(object) : pass ... >>> dir(A) ['__doc__', '__module__'] >>> dir(B) ['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',