Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmytrostriletskyi/87b16ee683b5c14c8d415956ce42649e to your computer and use it in GitHub Desktop.
Save dmytrostriletskyi/87b16ee683b5c14c8d415956ce42649e to your computer and use it in GitHub Desktop.
Python access modifiers agreement in use.
class Car:
def _start_engine(self):
return "Engine's sound."
def run(self):
return self._start_engine()
if __name__ == '__main__':
car = Car()
assert "Engine's sound." == car.run()
assert "Engine's sound." == car._start_engine()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment