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
Simplify deriving from _StreamBase #65
Conversation
cool, being able to easily subclass StreamBase will be a big help for me. It looks like if you set 'kind' to None that means full duplex correct? Neat trick with the usage of |
Thanks! And yes, Would you think it's easier to understand if I use Also, I don't know of the name If you have any other suggestions or comments, please tell me! |
|
The problem with I'm also using it for the internal functions Do you think I should name those different occurrences of I don't really like the |
I wasn't trying to suggest that we treat the streams as file objects - they're not even file-like - which is why I didn't suggest a direct analog to the python file mode argument types but still, I can see how it could be confusing. Perhaps something more explicit like |
Thanks for your suggestions, I very much appreciate them. Do you know any other alternatives for Regarding #66 would also be a great opportunity to change |
I've merged #66 just now. If you know a better name for |
Can't think of anything. device_type is still probably better than kind but maybe not worth the commit. The only other thought I had was using so for example, for instantiating a stream class, instead of Personally I think it's cleaner and clearer but again, just my two cents :) |
So am I understanding correctly that you are suggesting to use |
Note that this is further used in I'm also doing things like I'm really open to (and thankful for) your suggestions and I don't want to seem dismissive, but the use of the strings |
@tgarc Any more thoughts? I would like to make a new release soon and if I change anything |
I suppose that I still think PS I'm all for a new release, I'd like to see this PR in particular be released for my own selfish needs ;) |
Yes, if it's only changing a parameter name in a non-documented class (namely I'm still not 100% convinced, so I'm reluctant to implement it myself. After that and #73 is done, I'll make a new release. |
I decided that I can't really justify making this change to the API. I'm going to leave it as is. |
OK, that's fine by me. Thanks anyway for the discussions, I found it very interesting. |
People who want to create their own callback-based stream classes can directly inherit from
_StreamBase
, avoiding the unnecessary (and non-functional)read()
andwrite()
methods.Also, if desired, they can quite easily implement a single stream class that (based on constructor arguments) supports only inputs, only outputs, or both inputs and outputs.