Skip to content

Commit

Permalink
1.15 - Implementação e decisão
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuxbaum committed Apr 2, 2021
1 parent fed87d5 commit fb0521a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions 1_introducao/15_interface_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""
Python não oferece a implementação explícita de interfaces, como Java, mas o
mesmo comportamento pode ser replicado de duas formas principais.
"""


from abc import ABC, abstractmethod


class Item1(object):
def __gt__(self, outro_item):
raise NotImplementedError()


class Item2(ABC):
@abstractmethod
def create_purchase_invoice(self, purchase):
pass

0 comments on commit fb0521a

Please sign in to comment.