Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COYour pythons skills are more than acceptable! But I still don't see completely that this is the right way. Doing like this we lose the abstract superclass, and at the same time we got several subclasses. I think it would be better if there is only and only one way to create a Report object (this way you can instantiate the subclass, or the superclass passing the path). Then again, I'm kinda new to OOP and don't have the best grasp yet. Thanks for the answer!
      singulars
    2. COMy intention was indeed that the `ReportEngine` class is *abstract*, but I didn't know how the syntax for this is in Python. A quick search reveals that this is even not possible, but there is a workaround: http://www.boduch.ca/2010/04/python-abstract-class.html Then again wich way you go depends on the functionality in the different classes. If your concrete ReportX classes won't differ but in the config_path, it makes no sense to create the hierarchy. If they differ in more things, you will be happy with the code due to separation of concerns.
      singulars
    3. COIn your example, I can instantiate report1 = ReportEngine(path_conf_1), and the object would be complete and fully functional. That somehow means that it is not an abstract class, right? By the way, Python does not have an abstract declaration, but this is the philosophy/culture of this language: you are an adult and you know what you do. And if finally you really want to, no protection will keep you from working around(with private variables happens something similar).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload