Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the usage of augmented assignment statements #85

Open
elfring opened this issue Nov 3, 2021 · 0 comments
Open

Increase the usage of augmented assignment statements #85

elfring opened this issue Nov 3, 2021 · 0 comments

Comments

@elfring
Copy link

elfring commented Nov 3, 2021

👀 Some source code analysis tools can help to find opportunities for improving software components.
💭 I propose to increase the usage of augmented assignment statements accordingly.

Would you like to integrate anything from a transformation result which can be generated by a command like the following?
(:point_right: Please check also for questionable change suggestions because of an evolving search pattern.)

[Markus_Elfring@fedora lokal]$ perl -p -i.orig -0777 -e 's/^(?<indentation>\s+)(?<target>\S+)\s*=\s*\k<target>[ \t]*(?<operator>[+\-%&|^@]|\*\*?|\/\/?|<<|>>)/$+{indentation}$+{target} $+{operator}=/gm' $(find ~/Projekte/python-mingus/lokal -name '*.py')

How do you think about to improve 12 source code places? 🤔

elfring added a commit to elfring/python-mingus that referenced this issue Nov 3, 2021
…ignments

Augmented assignment statements became available with Python 2.
https://docs.python.org/3/whatsnew/2.0.html#augmented-assignment

Thus improve 12 source code places accordingly.

Signed-off-by: Markus Elfring <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant