pylint #9215 false undefined variable error in lambda function [resolved]

Here is a short demonstration program that shows that a lambda function's parameter is flagged as undefined if the lambda function is an argument to a decorator function.

"""Demonstrate false undefined variable for lambda functions."""

def decorator(expr):
  """Function returning decorator."""
  def func(function):
     """Pass-thru decorator."""
     return function
  # use expr
  expr(0)
  return func

# this lambda is flagged
# E0602:  16:main.<lambda>: Undefined variable 'x'
@decorator(lambda x: x > 0)
def main():
  """Dummy function."""
  # this one is not flagged
  decorator(lambda y: y > 0)

if __name__ == "__main__":
  main()

gives

************* Module lambda
E0602: 16:main.<lambda>: Undefined variable 'x'
> pylint --version
pylint 0.18.0,
astng 0.19.0, common 0.40.0
Python 2.4.1 (#1, Feb  1 2006, 14:47:49)
[GCC 3.4.3 20050227 (Red Hat 3.4.3-22.1)]
priorityimportant
typebug
done in0.18.1
load0.500
load left0.000
closed by<not specified>