Issue with inspect module

Cristina Yenyxe González García the.blue.valkyrie at gmail.com
Sat Apr 19 14:31:20 EDT 2008


2008/4/19, ilanschnell at gmail.com <ilanschnell at gmail.com>:
> 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?



More information about the Python-list mailing list