[New-bugs-announce] [issue6779] NotImplementedError on for statement

Samuel Quiring report at bugs.python.org
Mon Aug 24 23:25:11 CEST 2009


New submission from Samuel Quiring <sam.quiring at windriver.com>:

I have the following for statement:

                lenc = len(children)
                for ic in range(lenc):
                    print "ic: ", ic
                    child = children[ic]
                    print "  -", ic, child.__class__.__name__
                    print "XXX"
            except:
                try:
                    exctype, value = sys.exc_info()[:2]
                    print "exception", exctype, value
                    traceback.print_exc()
                    print range(lenc)
                except:
                    print "exception X"
            print "loop done"

When I execute it, I get the following output:

  - count changed, old: -1 new: 4
ic:  0
  - 0 XGRect
XXX
ic:  1
  - 1 PanelEntry
XXX
ic:  2
  - 2 ScrollView
XXX
ic:  3
  - 3 CloseButton
XXX
exception <type 'exceptions.NotImplementedError'> method not implemented
Traceback (most recent call last):
  File "/home/stpuser/prizm/lib/python2.6/libprizm/pui/atspi.py", line
187, in _get_n_children
    for ic in range(lenc):
NotImplementedError: method not implemented
[0, 1, 2, 3]
loop done


Why am I getting the NotImplementedError exception?  This looks like a
bug to me (I am pretty new to Python).

----------
components: None
messages: 91941
nosy: sbq
severity: normal
status: open
title: NotImplementedError on for statement
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6779>
_______________________________________


More information about the New-bugs-announce mailing list