updated from Atlas
This commit is contained in:
1 parent
aab93699a4
commit
573e1a94c4
109 files changed
+5
-6
No files matched your search
File renamed without changes.
File renamed without changes.
@@ -23,6 +23,6 @@ with open(sys.argv[1], encoding='utf-8') as fp:
|
||||
index[word] = occurrences # <3>
|
||||
|
||||
# print in alphabetical order
|
||||
for word in sorted(index, key=str.upper):
|
||||
for word in sorted(index, key=str.upper): # <4>
|
||||
print(word, index[word])
|
||||
# END INDEX0
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -19,7 +19,7 @@
|
||||
|
||||
# BEGIN CLIP_ANNOT
|
||||
|
||||
def clip(text:str, max_len:'int > 0'=80) -> str:
|
||||
def clip(text:str, max_len:'int > 0'=80) -> str: # <1>
|
||||
"""Return text clipped at the last space before or after max_len
|
||||
"""
|
||||
end = None
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -73,7 +73,7 @@ class Promotion(ABC): # the Strategy: an Abstract Base Class
|
||||
|
||||
@abstractmethod
|
||||
def discount(self, order):
|
||||
"""Return discount as an positive dollar amount"""
|
||||
"""Return discount as a positive dollar amount"""
|
||||
|
||||
|
||||
class FidelityPromo(Promotion): # first Concrete Strategy
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -8,9 +8,8 @@ def register(active=True): # <2>
|
||||
% (active, func))
|
||||
if active: # <4>
|
||||
registry.add(func)
|
||||
else: # <5>
|
||||
if func in registry:
|
||||
registry.remove(func)
|
||||
else:
|
||||
registry.discard(func) # <5>
|
||||
|
||||
return func # <6>
|
||||
return decorate # <7>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 109 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user