Skip to content

Commit 932870e

Browse files
committed
Update README with Contributing guidelines
1 parent d3bd0d8 commit 932870e

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

README.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ python-patterns
33

44
A collection of design patterns and idioms in Python.
55

6-
When an implementation is added or modified, be sure to update this file and
7-
rerun `append_output.sh` (eg. ./append_output.sh borg.py) to keep the output
8-
comments at the bottom up to date.
9-
10-
Current Patterns:
6+
Current Patterns
7+
----------------
118

129
__Creational Patterns__:
1310

@@ -75,3 +72,29 @@ __Others__:
7572
| [blackboard](other/blackboard.py) | architectural model, assemble different sub-system knowledge to build a solution, AI approach - non gang of four pattern |
7673
| [graph_search](other/graph_search.py) | graphing algorithms - non gang of four pattern |
7774
| [hsm](other/hsm/hsm.py) | hierarchical state machine - non gang of four pattern |
75+
76+
77+
Contributing
78+
------------
79+
When an implementation is added or modified, please review the following guidelines:
80+
81+
##### Output
82+
All files with example patterns have `### OUTPUT ###` section at the bottom.
83+
84+
Run `append_output.sh` (e.g. `./append_output.sh borg.py`) to generate/update it.
85+
86+
##### Docstrings
87+
Add module level description in form of a docstring with links to corresponding references or other useful information.
88+
89+
[strategy.py](behavioral/strategy.py) has a good example of detailed description,
90+
but sometimes the shorter one as in [template.py](behavioral/template.py) would suffice.
91+
92+
In some cases class-level docstring with doctest would also help (see [adapter.py](structural/adapter.py))
93+
94+
##### Python2/3 compatibility
95+
Try to keep it (discussion is held in [issue #208](https://github.com/faif/python-patterns/issues/208))
96+
- use new style classes (inherit from `object`)
97+
- use `from future import print`
98+
99+
##### Update README
100+
When everything else is done - update corresponding part of README.

0 commit comments

Comments
 (0)