I understand that to write python module private/protected functions you use
def _func():
...
but I have an object hierarchy with specialized overrides. Also I want to hide the internal implementation(since its not meant for outside use, and so I can hopefully improve it without breaking code, not that I think anybody will use it except me). If I use
class Paragraph(Tag):
def _method(self):
...
and try calling _method from a different class that subclasses Tag IntelliJ IDEA(and probably pylint/other checkers would also) give me a warning. Is there any way to fix this?
My use case is a set of markdown tag objects to generate a "Tree"-like structure that can be transformed into the correct markdown string. Each tag overrides a protected method to transform itself and the tags it contains and some override a method to check whether the sub-tags are valid(example no nested Bolds). Only the top level tag context has a public method to transform the tree.
edit:
IntelliJ IDEA warning:
access to a protected member of a class _method