Skip to content
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

Add open() and close() to SerialBase #39

Closed
jrast opened this issue Dec 3, 2015 · 0 comments
Closed

Add open() and close() to SerialBase #39

jrast opened this issue Dec 3, 2015 · 0 comments

Comments

@jrast
Copy link

jrast commented Dec 3, 2015

The SerialBase should have the open() and close() Method implemented with a raise NotImplementedError() like this:

class SerialBase(io.RawIOBase):
    # All the existing code ...

    def open(self):
        """Opens the Port"""
        raise NotImplementedError("This function must be implemented in the subclass")

    def close(self):
        """Closes the Port"""
        raise NotImplementedError("This function must be implemented in the subclass")

This way it is immediatly clear that this functions must be implemented in subclasses and if somenone is looking at the code of SerialBase its obvious where these methods are doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant