question about class vs class at

grocery_stocker cdalten at gmail.com
Sun Apr 26 17:52:15 EDT 2009


On Apr 26, 2:07 pm, Arnaud Delobelle <arno... at googlemail.com> wrote:
> grocery_stocker <cdal... at gmail.com> writes:
> > When I do pexpect.spawn in the following example, I see <class
> > 'pexpect.spawn'>
>
> > [cdalten at localhost oakland]$ python
> > Python 2.4.3 (#1, Oct  1 2006, 18:00:19)
> > [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import pexpect
> >>>> pexpect.spawn
> > <class 'pexpect.spawn'>
>
> > But now, when I do telnetlib.Telnet, I see <class telnetlib.Telnet at
> > 0xb7eded1c>
> >>>> import telnetlib
> >>>> telnetlib.Telnet
> > <class telnetlib.Telnet at 0xb7eded1c>
>
> > Why do I see <class telnetlib.Telnet at 0xb7eded1c> for
> > telnetlib.Telnet, but I don't see the same for  <class
> > 'pexpect.spawn'>? Ie, how come I don't see  <class 'pexpect.spawn' at
> > 0xb7eded1c> ?
>
> Because pexpect.spawn is a new-style class whereas telnetlib.Telnet is
> an old-style class?
>

Maybe. I guess I haven't been around python long enough to realize
that there was a difference in 'output' between the old-style class
and new-style class.




More information about the Python-list mailing list