You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.
Possibly add the ability to open a file from a blob or a filehandle that is already open.
If we do want to do this, what does the API look like? Wand uses a somewhat un-Pythonic solution:
Raw(filename=None, file=None, blob=None)
and then does some aweful iteration to decide if any two arguments are set and throw a TypeError if so. This looks fairly terrible, but it does lead to a nice clean API.
The more Pythonic way to do this would probably be to just have a single method and just see what works (or even do a type check and attempt to open a file if a string is passed in, open a raw if bytes or a huge string is passed in, or read from the file if a file object is passed in). That would effectively keep the method signature the same:
Raw(data=None)
where data replaces file and can either be a string, blob, or file object.
The text was updated successfully, but these errors were encountered:
Possibly add the ability to open a file from a blob or a filehandle that is already open.
If we do want to do this, what does the API look like? Wand uses a somewhat un-Pythonic solution:
and then does some aweful iteration to decide if any two arguments are set and throw a
TypeError
if so. This looks fairly terrible, but it does lead to a nice clean API.The more Pythonic way to do this would probably be to just have a single method and just see what works (or even do a type check and attempt to open a file if a string is passed in, open a raw if bytes or a huge string is passed in, or read from the file if a file object is passed in). That would effectively keep the method signature the same:
where data replaces file and can either be a string, blob, or file object.
The text was updated successfully, but these errors were encountered: