scapy icon indicating copy to clipboard operation
scapy copied to clipboard

Increase the usage of augmented assignment statements

Open elfring opened this issue 4 years ago • 4 comments

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: 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.)

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

elfring avatar Nov 22 '21 19:11 elfring

Thanks for your interest in Scapy. What will be the benefit of such changes?

guedou avatar May 21 '22 18:05 guedou

I find that the rationale of the Python enhancement proposal 203 (from 2000-07-13) can indicate also motivation for another bit of collateral evolution. :thinking:

elfring avatar May 21 '22 18:05 elfring

I am not convinced by this proposal. The readability gain is likely marginal. Do you know if this could have a positive impact on performances ?

guedou avatar May 26 '22 11:05 guedou

The proposed software adjustment should influence run time characteristics of affected components in desirable directions. Would you like to measure differences?

elfring avatar May 26 '22 11:05 elfring