Skip to content

Commit addd5cf

Browse files
authored
Merge pull request faif#173 from 0--key/pep8
Minor changes in creational patterns
2 parents 47a52df + d8af8a6 commit addd5cf

File tree

6 files changed

+10
-1
lines changed

6 files changed

+10
-1
lines changed

creational/borg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def __str__(self):
1616
class YourBorg(Borg):
1717
pass
1818

19+
1920
if __name__ == '__main__':
2021
rm1 = Borg()
2122
rm2 = Borg()

creational/builder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def build_size(self):
3838
raise NotImplementedError
3939

4040
# Concrete Builder
41+
42+
4143
class BuilderHouse(Builder):
4244

4345
def build_floor(self):

creational/factory_method.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def get_localizer(language="English"):
2929
languages = dict(English=EnglishGetter, Greek=GreekGetter)
3030
return languages[language]()
3131

32+
3233
# Create our localizers
3334
e, g = get_localizer(language="English"), get_localizer(language="Greek")
3435
# Localize some text

creational/lazy_evaluation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525

2626
class lazy_property(object):
27+
2728
def __init__(self, function):
2829
self.function = function
2930
functools.update_wrapper(self, function)
@@ -37,6 +38,7 @@ def __get__(self, obj, type_):
3738

3839

3940
class Person(object):
41+
4042
def __init__(self, name, occupation):
4143
self.name = name
4244
self.occupation = occupation

creational/pool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
"""http://stackoverflow.com/questions/1514120/python-implementation-of-the-object-pool-design-pattern"""
4+
"""
5+
http://stackoverflow.com/questions/1514120/python-implementation-of-the-object-pool-design-pattern
6+
"""
57

68

79
class QueueObject():

creational/prototype.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def main():
4545
dispatcher.register_object('default', d)
4646
print([{n: p.value} for n, p in dispatcher.get_objects().items()])
4747

48+
4849
if __name__ == '__main__':
4950
main()
5051

0 commit comments

Comments
 (0)