I know that there is no such thing as true private in Python for sometimes you need to following:
- prevent people from calling some methods or warn them when they do, but allow them to be called from other modules
- detect where these methods are used and raise an warning on the console or even an exception, this would allow you to start marking methods to private without breaking existing code.
- hide the private methods from IDE auto-complete (optional) - probably by using one underline before its name. Now I'm wondering if someone found a beautiful way to obtain this behaviour, maybe one that use
annotations?
Please remember that this has to work with existing codebase, so it should support a gradually re factoring of the existing code.
The last point is almost solved, the only question about it is if I should use one underscore or two underscores?