python-fire
python-fire copied to clipboard
Use fire without exposing private members
import fire
class Calculator(object):
def add(self, x, y):
return x + y
def multiply(self, x, y):
return x * y
def _sub(self, x, y):# Privite method
return x -y
Now, i dont want to expose _sub method on cli, How can i do this. thanks..
Private methods are hidden from view by default, but a user can access them by adding the --verbose flag to your CLI. There is not currently a supported way to prevent users from accessing private members altogether. We may support this in a future version, but don't currently.