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

Enforcing implementations of certain methods in classes #254

Closed
czgdp1807 opened this issue Apr 9, 2020 · 1 comment · Fixed by #255
Closed

Enforcing implementations of certain methods in classes #254

czgdp1807 opened this issue Apr 9, 2020 · 1 comment · Fixed by #255

Comments

@czgdp1807
Copy link
Member

Description of the problem

As highlighted in #252 there are good chances that API can become inconsistent if certain methods aren't named properly and such mistakes are missed in the review process. So, a solution should be proposed to solve this problem satisfying the following conditions,

  1. A set of certain methods should be implemented(i.e., shouldn't raise NotImplementedError) in every class. If some methods from the given set of methods isn't implemented then that should be detected in CI.
  2. The solutions should be simple enough such that it can be easily ported to C++11.

One of the approaches is described at #252 (comment)

Example of the problem

References/Other comments

Please discuss your approach first rather than jumping to code directly.

@HarsheetKakar
Copy link
Contributor

One way is to use something like init_subclass if it works or plain old collections.abc should work too

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

Successfully merging a pull request may close this issue.

3 participants