sync with Atlas repo

This commit is contained in:
Luciano Ramalho
2014-11-19 17:10:02 -02:00
parent b3e36a2a41
commit 2f495627fb
12 changed files with 183 additions and 112 deletions

View File

@@ -28,7 +28,7 @@
"""
# BEGIN CLASSIC_STRATEGY
from abc import ABCMeta, abstractmethod
from abc import ABC, abstractmethod
from collections import namedtuple
Customer = namedtuple('Customer', 'name fidelity')
@@ -69,7 +69,7 @@ class Order: # the Context
return fmt.format(self.total(), self.due())
class Promotion(metaclass=ABCMeta): # the Strategy
class Promotion(ABC): # the Strategy: an Abstract Base Class
@abstractmethod
def discount(self, order):