Issue with inspect module

I

ilanschnell

Hi,
I have this trivial program:

import inspect
class A:
def __init__(self, a):
self.a = a
def __str__(self):
return 'A(%s)' % self.a
a = A(8)
print a

the output is:
A(8)
A(8)

Why does the inspect module cause the output
to be printed twice?

Thanks
 
C

Cristina Yenyxe González García

2008/4/19 said:
Hi,
Hello,

I have this trivial program:

import inspect
class A:
def __init__(self, a):
self.a = a
def __str__(self):
return 'A(%s)' % self.a
a = A(8)
print a

the output is:
A(8)
A(8)

Why does the inspect module cause the output
to be printed twice?

I have just run it on the CPython interpreter and it works well. Have
you tried it without the 'import inspect' line and checked there is no
problem?

Or maybe are you using another interpreter?
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top