[Tutor] Memory consumption question

Marc Tompkins marc.tompkins at gmail.com
Fri Nov 16 04:24:28 CET 2007


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__']
>
>

On Nov 15, 2007 6:50 PM, Kent Johnson <kent37 at tds.net> wrote:

> 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 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 cheese.  Oh, and I'd like that
> > grilled."
> >   "New-style" order: "Reuben, please."
> >
> > 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.
>



-- 
www.fsrtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20071115/d2b9c469/attachment.htm 


More information about the Tutor mailing list