From: Drumheller, M. <mic...@bo...> - 2005-12-08 18:56:08
|
Below is a description of a pychecker bug that I have run across. (Believe it or not, I do have a good reason for nesting this many function definitions. Note that it is perfectly legal Python that does exactly what I want it to do--in its real context; I have merely abstracted it here for simplicity.) Thank you. Michael Drumheller The Boeing Company Seattle, Washington P.S. (Actually, it's two bugs: The parameter y *is* used, despite the warning message.) -------------pychecker version--------- 0.8.14 -------------code: foo.py------------- def f(x): def g(y): def h(z): x.m(y, z) return h return g --------------pychecker trace---------- Warnings... foo.py:2: Parameter (y) not used foo.py:3: INTERNAL ERROR -- STOPPED PROCESSING FUNCTION -- Traceback (most recent call last): File "c:\Python24\lib\site-packages\pychecker\warn.py", line 220, in _checkFunction _handleNestedCode(func_code, code, codeSource) File "c:\Python24\lib\site-packages\pychecker\warn.py", line 170, in _handleNestedCode _checkCode(code, codeSource) File "c:\Python24\lib\site-packages\pychecker\warn.py", line 144, in _checkCode dispatch_func(oparg, operand, codeSource, code) File "c:\Python24\lib\site-packages\pychecker\CodeChecks.py", line 1041, in _LOAD_DEREF argname =3D func_code.co_freevars[oparg - len(func_code.co_cellvars)] IndexError: tuple index out of range =09 Processing foo... -------------end trace----------------------------- |