-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Unicode #17
Conversation
fixes #15 |
# n - number of finished iterations | ||
# total - total number of iterations, or None | ||
# elapsed - number of seconds passed since start | ||
# ncols - the output width in chars. If specified, dynamically resizes bar. | ||
# [default bar width: 10]. | ||
# prefix - prepend message (included in total width) | ||
# ascii - whether to use ascii (otherwise unicode) character set | ||
if total and n > total: |
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.
Could you add a proper doctstring for parameters please ?
Thanks for working on this ! |
lol tbh I'm just using this as procrastination. It might look like I've been working on this all day for the last few days but really I haven't. I work better when constantly switching projects :P |
sheesh. @kmike late to the party, yes, maybe, but definitely partyin'
|
('utf' in file.encoding) or | ||
('UTF' in file.encoding)) | ||
else: | ||
ascii = True |
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.
What about extracting this to a helper function? Something like file_suports_unicode
:
def _is_utf(encoding):
return ('U8' == encoding) or ('utf' in encoding) or ('UTF' in encoding))
def file_supports_unicode(fp):
if not getattr(fp, 'encoding', None):
return False
return _is_utf(file.encoding)
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.
+1
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.
will leave it to you ;) i'm not pedantic about loop startup overhead so don't mind abstractions at this level.
nvm. was easier to correct than type chat message about it lol |
going to sleep, then spend weekend at a data science competition hackathon (used |
Conflicts: README.md tqdm/_tqdm.py
Fallback ascii if not specified and not explicitly supported by stream