#196 Parse of fn with lambda kw argument fails


If a method contains a keyword argument with a lambda as its value, EpyDoc fails with:

Error: Source code parsing failed: Error during parsing: invalid syntax, Bad argument list.

Definition causing the failure:

class foo:
def __init__(self,a,fn=lambda x:x):


  • Edward Loper

    Edward Loper - 2007-09-23
    • status: open --> pending-works-for-me
  • Edward Loper

    Edward Loper - 2007-09-23

    Logged In: YES
    Originator: NO

    I was unable to replicate this bug using epydoc's svn head. I tested it using Python versions 2.3, 2.4, and 2.5. In all cases I get output that looks like this:

    Instance Methods [hide private]

    __init__(self, a, fn=<function <lambda> at 0x4030648c>)

    My test file was:

    class foo:
    ....def __init__(self,a,fn=lambda x:x):

    (with leading dots replaced by spaces.)

    I'd appreciate it if you could test using the svn head version of epydoc, to see if this bug still exists. Alternatively, try adding the following line to the beginning of init_arglist() in epydoc/docparser.py:


    This will show the syntax tree that epydoc's working from. The output I get is:

    [(51, u'('), (1, u'self'), (51, u','), (1, u'a'), (51, u','), (1, u'fn'), (51, u'='), (1, u'lambda'), (1, u'x'), (51, u':'), (1, u'x'), (51, u')')]

  • SourceForge Robot

    • status: pending-works-for-me --> closed-works-for-me
  • SourceForge Robot

    Logged In: YES
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks