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

Another increment for static analysis #659

Merged
merged 3 commits into from
Sep 12, 2018
Merged

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Sep 11, 2018

I'm going in small stages to make review (and debugging) manageable, so:

  • Internally get names as attributes of the stdlib ssl and socket modules, rather than by magic
  • Remove a bunch of unused imports (mostly leftover from deleted code)
  • Minor cleanups I found in the process

Use names from stdlib socket as attributes of the imported module, not via runtime reexport magic
@codecov
Copy link

codecov bot commented Sep 11, 2018

Codecov Report

Merging #659 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #659      +/-   ##
==========================================
- Coverage   99.31%   99.31%   -0.01%     
==========================================
  Files          94       94              
  Lines       11014    11002      -12     
  Branches      790      789       -1     
==========================================
- Hits        10939    10927      -12     
  Misses         56       56              
  Partials       19       19
Impacted Files Coverage Δ
trio/tests/test_signals.py 100% <ø> (ø) ⬆️
trio/_core/tests/test_multierror.py 100% <ø> (ø) ⬆️
trio/_core/_ki.py 98.36% <ø> (-0.03%) ⬇️
trio/tests/test_ssl.py 100% <ø> (ø) ⬆️
trio/testing/_checkpoints.py 100% <ø> (ø) ⬆️
trio/_socket.py 100% <100%> (ø) ⬆️
trio/_deprecate.py 100% <100%> (ø) ⬆️
trio/_ssl.py 100% <100%> (ø) ⬆️
trio/_core/_multierror.py 99.37% <100%> (-0.02%) ⬇️
trio/_core/_run.py 99.7% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca14ffe...4022454. Read the comment docs.

not self._nested_child_running and not self._children
and not self._pending_starts
if not any(
[self._nested_child_running, self._children, self._pending_starts]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this is an improvement in readability? Consistency-wise I don't think Trio ever uses any() over a literal list of bools and I personally avoid that style because I feel it's less expressive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I do find it reads more naturally this way, as starting with "not any" makes reading the three attributes easier. It's also closer to English grammar!

However, if there's any doubt or disagreement I'd rather take it out and get the rest merged.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I guess I'd do it the way I originally did it? But they're both fine and let's focus on more important things :-)

@njsmith njsmith merged commit 2ccc46f into python-trio:master Sep 12, 2018
@belm0
Copy link
Member

belm0 commented Sep 12, 2018

regarding unused imports, does trio not having a lint check for this set up on the continuous build?

@Zac-HD
Copy link
Member Author

Zac-HD commented Sep 12, 2018

@belm0 - not yet, as the analysis challenges documented in #542 throw up literally hundreds of false-positives. We're working on it though, and this PR is based on some experiments I ran with flake8 - it still needs a long ignore list but it could be added to CI as soon as we pin our dependencies ✨

@Zac-HD Zac-HD deleted the static-er branch September 12, 2018 01:23
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

Successfully merging this pull request may close these issues.

4 participants