MyClassAbstract
An example of abstract class.
An example of abstract class. If you need to use a framework, abstract class is a good method. There is a random boolean by baz function and an abstract method named foo function. It is not possible to instantiate a class with an abstract method. And it is not possible to have an abstract method protected: it will be changed in a pubilc method.
# license MIT # author Alessandra Bilardi <alessandra.bilardi@gmail.com> # see https://github.com/bilardi/python-prototype for details # cite https://www.python.org/dev/peps/pep-3119/
Much of the thinking that went into the proposal is not about the specific mechanism of ABCs, as contrasted with Interfaces or Generic Functions (GFs), but about clarifying philosophical issues like “what makes a set”, “what makes a mapping” and “what makes a sequence”. ABCs are intended to solve problems that don’t have a good solution at all in Python 2, such as distinguishing between mappings and sequences.
- class simple_sample.my_class_abstract.MyClassAbstract
An example of abstract class.
If you need to use a framework, abstract class is a good method. There is a random boolean by implemented_method function and an abstract method named get_param_processing function. It is not possible to instantiate a class with an abstract method. And it is not possible to have an abstract method protected: it will be changed in a pubilc method.
- abstractmethod get_param_processing(param: bool) bool
Get boolean by param processing.
Not implemented and abstract method
- Args:
param(bool): a boolean value
- Returns:
A boolean value
- Raises:
NotImplementedError
- get_random_boolean() bool
Get a random boolean.
- Returns:
A random boolean value