From cb438453a266e112203d5d01ae00417ada19d834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Ot=C3=A1vio?= Date: Thu, 17 Nov 2022 10:30:30 -0300 Subject: [PATCH] =?UTF-8?q?(Parte=201)=20Mixins,=20Abstra=C3=A7=C3=A3o=20e?= =?UTF-8?q?=20a=20uni=C3=A3o=20de=20tudo=20at=C3=A9=20aqui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula141/log.py | 14 ++++++++++++++ aula141/main.py | 1 + 2 files changed, 15 insertions(+) create mode 100644 aula141/log.py create mode 100644 aula141/main.py diff --git a/aula141/log.py b/aula141/log.py new file mode 100644 index 0000000..8c51f1b --- /dev/null +++ b/aula141/log.py @@ -0,0 +1,14 @@ +# Abstração +class Log: + def log(self, msg): + raise NotImplementedError('Implemente o método log') + + +class LogFileMixin(Log): + def log(self, msg): + print(msg) + + +if __name__ == '__main__': + l = LogFileMixin() + l.log('qualquer coisa') diff --git a/aula141/main.py b/aula141/main.py new file mode 100644 index 0000000..4e7964e --- /dev/null +++ b/aula141/main.py @@ -0,0 +1 @@ +from log import Log