question about class vs class at

G

grocery_stocker

When I do pexpect.spawn in the following example, I see <class
'pexpect.spawn'>

[cdalten@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.
But now, when I do telnetlib.Telnet, I see <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> ?
 
A

Arnaud Delobelle

grocery_stocker said:
When I do pexpect.spawn in the following example, I see <class
'pexpect.spawn'>

[cdalten@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.
But now, when I do telnetlib.Telnet, I see <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?
 
G

grocery_stocker

grocery_stocker said:
When I do pexpect.spawn in the following example, I see <class
'pexpect.spawn'>
[cdalten@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>
<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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top