[issue38854] Decorator with paren tokens in arguments breaks inspect.getsource

2022-02-28 Thread Adam Hopkins
Change by Adam Hopkins : -- nosy: +ahopkins nosy_count: 3.0 -> 4.0 pull_requests: +29736 pull_request: https://github.com/python/cpython/pull/31605 ___ Python tracker <https://bugs.python.org/issu

[issue46873] inspect.getsource with some lambdas in decorators does not get the full source

2022-02-27 Thread Adam Hopkins
Adam Hopkins added the comment: Duplicate of https://bugs.python.org/issue38854 Sorry I didn't come across our before submitting. -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed ___ Python tracke

[issue46873] inspect.getsource with some lambdas in decorators does not get the full source

2022-02-27 Thread Adam Hopkins
Change by Adam Hopkins : -- keywords: +patch pull_requests: +29728 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31605 ___ Python tracker <https://bugs.python.org/issu

[issue46873] inspect.getsource with some lambdas in decorators does not get the full source

2022-02-27 Thread Adam Hopkins
Adam Hopkins added the comment: Sorry about that. I am doing some more digging to see if I can find the route of it and a proposal for a non-breaking patch. The problem seems to be in BlockFinder.tokeneater. -- type: behavior -> versions: +Python 3.7, Python

[issue46873] inspect.getsource with some lambdas in decorators does not get the full source

2022-02-27 Thread Adam Hopkins
New submission from Adam Hopkins : I believe the following produces an unexpected behavior: from inspect import getsource def bar(*funcs): def decorator(func): return func return decorator @bar(lambda x: bool(True), lambda x: False) async def