File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,22 +79,31 @@ Contributing
7979When an implementation is added or modified, please review the following guidelines:
8080
8181##### Output
82- All files with example patterns have ` ### OUTPUT ### ` section at the bottom.
82+ All files with example patterns have ` ### OUTPUT ### ` section at the bottom
83+ (migration to OUTPUT = """...""" is in progress).
8384
8485Run ` append_output.sh ` (e.g. ` ./append_output.sh borg.py ` ) to generate/update it.
8586
8687##### Docstrings
8788Add module level description in form of a docstring with links to corresponding references or other useful information.
8889
89- [ strategy.py] ( patterns/behavioral/strategy.py ) has a good example of detailed description,
90+ Add "Examples in Python ecosystem" section if you know some. It shows how patterns could be applied to real-world problems.
91+
92+ [ facade.py] ( patterns/structural/facade.py ) has a good example of detailed description,
9093but sometimes the shorter one as in [ template.py] ( patterns/behavioral/template.py ) would suffice.
9194
9295In some cases class-level docstring with doctest would also help (see [ adapter.py] ( patterns/structural/adapter.py ) )
96+ but readable OUTPUT section is much better.
97+
9398
9499##### Python2/3 compatibility
95100Try to keep it (discussion is held in [ issue #208 ] ( https://github.com/faif/python-patterns/issues/208 ) )
96101- use new style classes (inherit from ` object ` )
97- - use ` from future import print `
102+ - use ` from __future__ import print_function `
98103
99104##### Update README
100105When everything else is done - update corresponding part of README.
106+
107+
108+ ##### Travis CI
109+ Please run ` flake8 ` and ` pytest ` commands locally to be sure your changes will pass CI .
Original file line number Diff line number Diff line change 1313- "8.22. Implementing the Visitor Pattern Without Recursion"
1414
1515*Examples in Python ecosystem:
16- Python's ast.NodeVisitor: https://github.com/python/cpython/blob/master/Lib/ast.py#L250
16+ - Python's ast.NodeVisitor: https://github.com/python/cpython/blob/master/Lib/ast.py#L250
17+ which is then being used e.g. in tools like `pyflakes`.
18+ - `Black` formatter tool implements it's own: https://github.com/ambv/black/blob/master/black.py#L718
1719"""
1820
1921
You can’t perform that action at this time.
0 commit comments