[Adjust rule] Drop SIM105 due to performance
See original GitHub issueDesired change
- Rule(s): SIM105
- Adjustment: It should be dropped! Or at least highlight performance impact in the documentation!
Explanation
By conforming to this, the code will perform worse. Please check with timeit.
In [1]: %%timeit
...: try:
...: a = {'a': 1}
...: a['b']
...: except KeyError:
...: pass
...:
199 ns ± 1.16 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
In [5]: %%timeit
...: with contextlib.suppress(KeyError):
...: a = {'a': 1}
...: a['b']
...:
621 ns ± 6.38 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Final rule: Pay Versus Performance - SEC.gov
Section 14(i) directs the Commission to adopt rules requiring registrants to provide disclosure of pay versus performance. The disclosure is.
Read more >Chapter 18: Transition Rules - Louisiana State Civil Service
An employee who has a “Satisfactory” or equivalent rating effective July 1, 2012 shall become eligible for and may be granted a performance...
Read more >How to find a bottle-neck in your rule for performance analysis
method dumps a list of nodes with associated rules. It will help you to find related rules from a problematic constraint/node.
Read more >6 Rules of Pay for Performance for Maximum Employee ...
Rule #5: Set your goals against your baseline Set goals to reduce that baseline cost. If your cost per unit is $1.00 and...
Read more >SEC Releases Final Pay Versus Performance Rules
Set forth below is a summary of the final rules and considerations for ... A financial performance measure chosen by the company (the ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

https://github.com/django/django/pull/9038 It’s slow because of the way Python makes function calls.
I found this repository because I followed your tutorial on Medium on how to write a
flake8plugin. Thanks a bunch for this! 😃