-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Allow write() to print non-string objects #34
Comments
@sebageek feel free to open the PR. |
write() now supports printing multiple args, e.g. write("foo", "bar") and also converts objects that are not a string to their string representation. Fixes pavdmyt#34
It seems that I don't completely understand the issue. Let's try to sort out the details.
I agree that calling I'm still open for PR which allows to use non-string objects as arguments to |
Allow write() to print anything that is not a string by converting it via str(), just like the builtin print() does. Fixes pavdmyt#34
Allow write() to print anything that is not a string by converting it via str(), just like the builtin print() does. Fixes pavdmyt#34
Allow write() to print anything that is not a string by converting it via str(), just like the builtin print() does. Fixes pavdmyt#34
Included in yaspin v1.4.0 |
As I have to use
write()
in a yaspin context instead ofprint()
I tend to use it in a similar way. This often includes printing non-string objects.print()
callsrepr()
automatically on anything that is not a string, whereas yaspin runs into an assertion.Would you be open to replace that assertion with something just calling
repr()
on the given text? This coud also be implemented for the spinner text itself. I'd also volunteer to bring up a PR for this.The text was updated successfully, but these errors were encountered: