Skip to content

chore: use built-in function issubclass() instead of getmro() #1481

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

Merged
merged 1 commit into from
May 29, 2021
Merged

chore: use built-in function issubclass() instead of getmro() #1481

merged 1 commit into from
May 29, 2021

Conversation

JohnVillalovos
Copy link
Member

@JohnVillalovos JohnVillalovos commented May 28, 2021

Code was using inspect.getmro() to replicate the functionality of the
built-in function issubclass()

Switch to using issubclass()

@JohnVillalovos JohnVillalovos marked this pull request as draft May 28, 2021 21:17
@codecov-commenter
Copy link

codecov-commenter commented May 28, 2021

Codecov Report

Merging #1481 (81f6386) into master (90ecf2f) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1481      +/-   ##
==========================================
- Coverage   90.91%   90.91%   -0.01%     
==========================================
  Files          73       73              
  Lines        4051     4049       -2     
==========================================
- Hits         3683     3681       -2     
  Misses        368      368              
Flag Coverage Δ
cli_func_v4 80.46% <100.00%> (-0.01%) ⬇️
py_func_v4 79.82% <0.00%> (+0.03%) ⬆️
unit 81.99% <70.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
gitlab/v4/cli.py 81.17% <100.00%> (-0.15%) ⬇️

Code was using inspect.getmro() to replicate the functionality of the
built-in function issubclass()

Switch to using issubclass()
@JohnVillalovos JohnVillalovos changed the title WIP: Trying issubclass() instead of using inspect.getmro() chore: use built-in function issubclass() instead of getmro() May 28, 2021
@JohnVillalovos JohnVillalovos marked this pull request as ready for review May 28, 2021 22:35
@JohnVillalovos JohnVillalovos requested a review from nejch May 28, 2021 22:35
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.

Thanks. Looking at this reminds me there's a lot of V3 cruft left in the code (like this try/except). Just one little question :)

@nejch nejch merged commit 489b0d3 into python-gitlab:master May 29, 2021
@JohnVillalovos JohnVillalovos deleted the jlvillal/no_getmro branch May 30, 2021 03:59
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.

3 participants