-
Notifications
You must be signed in to change notification settings - Fork 273
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
Use python's builtin abstract base classes #100
Comments
What will happen to if we will do this? Will there be any enhancement in code readability or software design? |
Yes, isinstance(obj, Sequence) More importantly, the ABCs have some abstract methods. These abstract methods need to be present in the subclasses. For example, an |
So, it looks like that if you inherit an ABC then it will not allow you to instantiate a class object unless you override all the abstract methods of the base class which is kind of good but depends on the use case. If you never want to define, |
Description of the problem
The current code creates a new abstract class, as in the example below. Python has dedicated
abc.ABC
s for abstract base classes. It would provide us more flexibility and conform better to python's standards.Example of the problem
https://github.com/codezonediitj/pydatastructs/blob/master/pydatastructs/linear_data_structures/arrays.py
References/Other comments
https://docs.python.org/3/library/abc.html
https://www.python.org/dev/peps/pep-3119/
The text was updated successfully, but these errors were encountered: