Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#63 returning None from setParseAction

open
nobody
None
5
2013-04-01
2013-04-01
Anonymous
No

When I return None from setParseAction, pyparsing assumes that this means "leave the tokens as is"

This is an incorrect assumption. First, it would be more pythonic to be explicit, and if I want to leave the tokens as is, I'll just "return tokens"

Also, this prevents me from returning a None value when I actually want that value to be None.

Discussion

  • Paul McGuire
    Paul McGuire
    2013-04-01

    This has been posted previously - from your parse action, return [None] instead of return None.