Title: NotImplementedError on for statement
Type: Stage: resolved
Components: None Versions: Python 2.6
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: r.david.murray, sbq
Priority: normal Keywords:

Created on 2009-08-24 21:25 by sbq, last changed 2009-08-24 22:51 by r.david.murray. This issue is now closed.

Messages (2)
msg91941 - (view) Author: Samuel Quiring (sbq) Date: 2009-08-24 21:25
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"
                    exctype, value = sys.exc_info()[:2]
                    print "exception", exctype, value
                    print range(lenc)
                    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
ic:  1
  - 1 PanelEntry
ic:  2
  - 2 ScrollView
ic:  3
  - 3 CloseButton
exception <type 'exceptions.NotImplementedError'> method not implemented
Traceback (most recent call last):
  File "/home/stpuser/prizm/lib/python2.6/libprizm/pui/", 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).
msg91946 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-08-24 22:51
The bug tracker is not a place to get help debugging your code.  Your
code is not a complete example, and is doing odd things with try/except
and the printing of errors which may well be masking what is really
going on, so I can't begin to evaluate whether or not you've found a
real bug, but it seems unlikely.  Please post your question to
python-list (or perhaps even python-tutor), and if it turns out you do
have a real bug, reopen this ticket.
Date User Action Args
2009-08-24 22:51:14r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg91946

resolution: not a bug
stage: resolved
2009-08-24 21:25:10sbqcreate