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

changing isinstance to issubclass #236

Closed
wants to merge 2 commits into from
Closed

Conversation

fool65c
Copy link
Contributor

@fool65c fool65c commented May 23, 2019

the isinstance check if isinstance(app.contents_manager_class, TextFileContentsManager): will always fail because app.contents_manager_class is not an instance.

Changing this to if issubclass(app.contents_manager_class, TextFileContentsManager): will allow others to extend.

the isinstance check `if isinstance(app.contents_manager_class, TextFileContentsManager):` will always fail because app.contents_manager_class is not an instance.  

Changing this to `if issubclass(app.contents_manager_class, TextFileContentsManager):`  will allow others to extend.

https://www.codevscolor.com/python-isinstance-issubclass/
@codecov
Copy link

codecov bot commented May 23, 2019

Codecov Report

Merging #236 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
+ Coverage   99.23%   99.23%   +<.01%     
==========================================
  Files          65       65              
  Lines        6176     6181       +5     
==========================================
+ Hits         6129     6134       +5     
  Misses         47       47
Impacted Files Coverage Δ
jupytext/__init__.py 100% <ø> (ø) ⬆️
tests/test_contentsmanager.py 100% <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 fd6569d...4b55d2e. Read the comment docs.

@mwouts
Copy link
Owner

mwouts commented May 23, 2019

Hello @fool65c , thanks for reporting this. I will integrate this soon (and add an explicit test to make sure it does what we want).

@mwouts mwouts added this to the 1.1.4 milestone May 25, 2019
@mwouts
Copy link
Owner

mwouts commented May 25, 2019

I have integrated this in the branch 1.1.4

@mwouts mwouts closed this May 25, 2019
@mwouts mwouts mentioned this pull request Jun 4, 2019
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.

2 participants