-
Notifications
You must be signed in to change notification settings - Fork 119
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
Remove dead code. #313
Remove dead code. #313
Conversation
neovim/api/common.py
Outdated
@@ -154,10 +150,6 @@ def __contains__(self, item): | |||
return item in self._fetch() | |||
|
|||
|
|||
def _identity(obj, session, method, kind): | |||
return obj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for debugging I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry. So, I remove this commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force updated.
@@ -69,8 +69,8 @@ class RemoteMap(object): | |||
It is used to provide a dict-like API to vim variables and options. | |||
""" | |||
|
|||
def __init__(self, obj, get_method, set_method=None, self_obj=None): | |||
"""Initialize a RemoteMap with session, getter/setter and self_obj.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is used or not, but it seems like there's no test coverage. If it is used a test would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your comment. As you say, I should add a test covering this change.
I'll add several tests after I read existing tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one test is enough. @bfredl would know better whether self_obj
is still needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self_obj
looks completely dead to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your check!
I've checked existing test code(under test
directory), and I have a question.
RemoteSequence
/ RemoteMap
isn't public, and their __init__
methods(fixed by this PR) are called internally. On the other hand, it seems that current test code covers public API.
I wonder whether it's better to also cover private APIs(In this case, __init__
of RemoteSequence
/ RemoteMap
).
Best regards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think tests of internal classes are needed, if both classes are already covered by public API, there is no need to add a test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thank you or your comment!
This release adds support for Python 3.7 which now is in beta. `async` is a keyword in python3.7, and it should be replaced with `async_` when used as a keyword argument to API methods. `async` is still supported with python 2.7 and 3.6 for the moment, but considered deprecated. Also, integration with the in-process lua interpreter in Nvim is now supported. Changes since 0.2.4: * debcde0 clean up remote object implementation (#313) * e880fe7 Guidelines for local plugin development (#317) * 1ab98e8 Update the working directory on DirChanged for legacy plugins (#296) * d53415d Fix SyntaxError in py3.7: use `async_` instead of `async` (#274) * b65f62d Use `pytest` as `nosetests` are not longer maintained (#266) * d9aed96 Support using lua functions. `buf.update_higlights` as an internal example (#325)
I found several dead code in neovim/api/common.py. This PR removes them.
Best regards.