-
-
Notifications
You must be signed in to change notification settings - Fork 380
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
Render user-friendly string representation of open files #316
Comments
We could implement What should we do for non-custom wrapper classes? e.g. import sys
from smart_open import open
print('str read_text: ' + str(open(sys.argv[1]))) gives
We don't really have control of that object. What's the best thing to do there? |
I'd leave builtins as-is. "Falling back to built-in where possible" is a well-communicated property of smart_open. A nicer display would be welcome, but not essential. Also, I never bother overriding |
Hi! I'm new to OSS and am looking to contribute somewhere, mind if I give this a shot? Just to clarify, the behavior you're looking for is to related to the |
Closed via #359 |
Currently, an open S3 object prints like this:
This is not useful, and we can do much better: we have full info about the concrete bucket, key, mode, etc. Compare to boto3's nice native display:
Task: render open objects more nicely in
__str__
. This is great help during logging and debugging (I consider a human-friendlystr()
best practice, and define them religiously on custom classes).It seems easy enough to do for S3, but I'm not sure how much work for our other supported storages (HTTP, FTP or whatever), for consistency.
The text was updated successfully, but these errors were encountered: