-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
MNT: Minor cleanups in the pdf backend and related files #4603
Conversation
The sole non-ASCII character (in a docstring) had already been converted to UTF-8 by an earlier commit.
- replace the single use of six.moves.map with a list comprehension - io.BytesIO is included in all versions of Python we support - the set type is a builtin in all versions of Python we support
Probably too annoying even for debug-annoying
Probably more readable.
@@ -20,14 +19,10 @@ | |||
|
|||
import numpy as np | |||
from six import unichr | |||
from six import BytesIO | |||
from io import BytesIO | |||
|
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.
According to https://pythonhosted.org/six/ six.BytesIO is StringIO.StringIO in Python 2 not io.BytesIO does that make any difference?
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 think the io.BytesIO
version is closer to the corresponding code in Python 3, and six uses StringIO
probably because BytesIO
was only introduced in 2.6. For example, BytesIO
has a readinto
method that StringIO
lacks.
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.
After some googling I think you are right.
One inline comment. The rest is definite improvements IMHO 👍 |
MNT: Minor cleanups in the pdf backend and related files
No description provided.