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

Change the data type of a Buffer so that it works correctly #471

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pynvim/api/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pynvim.compat import IS_PYTHON3, check_async


__all__ = ('Buffer')
__all__ = ['Buffer']
Copy link
Member

Choose a reason for hiding this comment

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

Alternatively, make it an actual tuple by adding the missing comma:

Suggested change
__all__ = ['Buffer']
__all__ = ('Buffer',)

Looks like this is needed in pynvim/api/{nvim,tabpage,window}.py, pynvim/msgpack_rpc/event_loop/init.py, and pynvim/plugin/host.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does technically work however according to the reference guide the data type of __all__ is explicitly supposed to be a list

Copy link
Contributor

Choose a reason for hiding this comment

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

@farisachugthai
Ok. A link/ref would have been useful, but I believe you.. :)

Can you update the other places also, please?

Looks like this is needed in pynvim/api/{nvim,tabpage,window}.py, pynvim/msgpack_rpc/event_loop/init.py, and pynvim/plugin/host.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't find it in the ref again but some googling got me this from the tutorial.

https://docs.python.org/3/tutorial/modules.html#importing-from-a-package

The import statement uses the following convention: if a package’s __init__.py code defines a list named __all__, it is taken to be the list of module names that should be imported when from package import * is encountered. It is up to the package author to keep this list up-to-date when a new version of the package is released.

Yeah sure I can do that. Is it okay if we merge this and I do the rest in a separate PR?



if IS_PYTHON3:
Expand Down