Merged
Conversation
Will find more later
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new file containing code golf examples intended as experimental functions.
- Adds a new file "src/golf/golf.py" with golfed code for demonstration.
- Implements a compact function (e2) and a lambda expression using eval for code golfing.
Comments suppressed due to low confidence (4)
src/golf/golf.py:4
- [nitpick] The alias '_p' for the built-in print function is not very descriptive. Consider using the built-in print directly or a more meaningful alias to improve readability.
+_p=print
src/golf/golf.py:6
- [nitpick] The function name 'e2' is ambiguous. Consider renaming it to something more descriptive that reflects its purpose.
+def e2(s):
src/golf/golf.py:8
- [nitpick] The slicing operation on the string "FTarlusee" using a boolean expression is unclear. Consider adding an inline comment or refactoring this logic for better clarity.
+ return "FTarlusee"[a==b::2]+"".join(c)
src/golf/golf.py:12
- Using eval in the lambda can lead to potential security risks or unintended behavior if inputs are not strictly controlled. Consider using a safer alternative or ensuring input sanitization.
+ _p((lambda a,b,c:eval(a*b+c))("b+",3,"b**7"))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Will find more later