question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple no-arg lambda functions use same variable name (underscore)

See original GitHub issue

I’m having trouble creating a minimal example, but having several optional-arg lambdas -> something (-> something-more)) in one line of code reuses/redefines the underscore variable name in the compiled Python code which sometimes seems to breaks my code.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
evhubcommented, Feb 9, 2019

@ArneBachmann @Sitwon I think I’m going to close this issue as a won’t fix, under the rationale that no-arg lambdas aren’t really built for nesting, and all the possible fixes I can think of only make no-arg lambdas more complicated.

0reactions
evhubcommented, Feb 15, 2019

@ArneBachmann Yeah, that’s probably a good idea. I’ll change this to be a documentation issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python's lambda with underscore for an argument?
Underscore _ is a valid identifier and is used here as a variable name. It will always return True for the argument passed...
Read more >
Allow the parameter name _ (underscore) multiple times in ...
This crashes with: SyntaxError: duplicate argument '_' in function definition. Using an underscore as a parameter name or variable name is a ...
Read more >
Python Lambda with underscore as an argument
A lambda function can take more than one number of arguments, ... This variable name is usually a name for an ignored variable....
Read more >
A tour of the Dart language
This page shows you how to use each major Dart feature, from variables and operators to classes and libraries, with the assumption that...
Read more >
High-order functions and lambdas
Underscore for unused variables. If the lambda parameter is unused, you can place an underscore instead of its name:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found