This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: NotImplementedError on for statement
Type: Stage: resolved
Components: None Versions: Python 2.6
process
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 2022-04-11 14:56 by admin. 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"
            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).
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.
History
Date User Action Args
2022-04-11 14:56:52adminsetgithub: 51028
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