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

chore: make _types always present in RESTManager #1365

Merged
merged 1 commit into from Mar 7, 2021
Merged

chore: make _types always present in RESTManager #1365

merged 1 commit into from Mar 7, 2021

Conversation

JohnVillalovos
Copy link
Collaborator

We now create _types = {} in RESTManager class.

By making _types always present in RESTManager it makes the code
simpler. We no longer have to do:
types = getattr(self, "_types", {})

And the type checker now understands the type.

@codecov-io
Copy link

Codecov Report

Merging #1365 (1b5cdc5) into master (48fc907) will increase coverage by 0.01%.
The diff coverage is 58.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1365      +/-   ##
==========================================
+ Coverage   79.92%   79.94%   +0.01%     
==========================================
  Files          73       73              
  Lines        4010     4008       -2     
==========================================
- Hits         3205     3204       -1     
+ Misses        805      804       -1     
Flag Coverage Δ
unit 79.94% <58.33%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gitlab/v4/cli.py 40.40% <0.00%> (+0.16%) ⬆️
gitlab/mixins.py 77.77% <62.50%> (-0.16%) ⬇️
gitlab/base.py 84.86% <100.00%> (+0.20%) ⬆️

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 48fc907...1b5cdc5. Read the comment docs.

@JohnVillalovos JohnVillalovos marked this pull request as draft March 7, 2021 17:29
We now create _types = {} in RESTManager class.

By making _types always present in RESTManager it makes the code
simpler. We no longer have to do:
   types = getattr(self, "_types", {})

And the type checker now understands the type.
@JohnVillalovos JohnVillalovos marked this pull request as ready for review March 7, 2021 17:40
Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

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

Cool, gets rid of some of the magic as well.

@nejch nejch merged commit de73ea7 into python-gitlab:master Mar 7, 2021
@JohnVillalovos JohnVillalovos deleted the jlvillal/getattr branch March 14, 2021 17:47
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.

None yet

3 participants