[Idle-dev] a debug problem

Tal Einat tal.no.no.spam at gmail.com
Mon Dec 4 14:50:07 CET 2006


Joop,

I haven't been able to recreate your error.

Please specify your version of Python and OS, and explain the steps required
to recreate this error.

- Tal


On 28/11/06, *Joop Kaldeway* <joop.kaldeway at planet.nl> wrote:
>
>
> Dear idle-developers,.
>
> I have the following problem:
>
> I use the very simple program:
>
> class NewClass(object):
>
>    def __init__(self,element):
>        self.element = element
>
>    def __repr__(self):
>        return str(self.element)
>
> if __name__ == '__main__':
>
>    b = NewClass(3)
>    print b
>
>    raw_input("Press Enter to finish")
>
> It runs with output:
>
> 3
> Press Enter to finish
>
> But when I use te debugger and walk through the code step by step  I get
> an error:
>
> ...
> ...
> File "E:\Python25\lib\repr.py", line 34, in repr1
>    s = __builtin__.repr(x)
> File "F:\demo\NewClassDemo.py", line 24, in __repr__
>    return str(self.element)
> AttributeError: 'NewClass' object has no attribute 'element'
> [DEBUG ON]
> >>>
>
> Is it a bug in IDLE?
>
> Joop Kaldeway
>
>
>
> _______________________________________________
> IDLE-dev mailing list
> IDLE-dev at python.org
> http://mail.python.org/mailman/listinfo/idle-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/idle-dev/attachments/20061204/c9bece13/attachment.html 


More information about the IDLE-dev mailing list