Issues

Issue #1152 resolved

PyCode analyzer breaks on "partial(lambda p: p('xx'), print)" ... causes autodoc_member_order = "bysource" not to work

Lukas Vacek
created an issue

Hey,

When I use latest sphinx release v1.2b1 (but same problem in 1.1.3) to generate documentation for following:

from functools import partial

def b():
    "b docstring"
    pass

partial(lambda p: p('xx'), print)

def a():
    "a docstring"
    pass

member_order = "bysource" is ignored.

Doing a bit of debugging, it turned out that pycode analyzer raises an exception ParseError("bad input: type=1, value='print', context=('', (83, 20))",)

I have added to line 159 in pycode/pgen2/parse.py (just before the exception would be thrown)

                    if value == "print":
                        return

This is indeed just a quick-fix to solve the problem for me and a more general fix should go in.

Thanks, Lukas

Comments (3)

  1. Log in to comment