Skip to content

Commit 08cec57

Browse files
committed
Update .travis.yml and documentation
1 parent 035fec9 commit 08cec57

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

.travis.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
language: python
21
sudo: false
3-
python:
4-
- 2.7
5-
- 3.4
6-
- 3.5
7-
- 3.6
2+
language: python
3+
matrix:
4+
include:
5+
- python: 2.7
6+
- python: 3.4
7+
- python: 3.5
8+
- python: 3.6
9+
- python: 3.7
10+
dist: xenial
11+
sudo: true
812
install:
9-
- pip install flake8 mock pytest pytest-cov python-coveralls sphinx sphinx_rtd_theme
13+
- pip install flake8 mock
14+
- pip install pytest==3.5.1
15+
- pip install pytest-cov==2.5.1
16+
- pip install python-coveralls==2.9.1
17+
- pip install sphinx sphinx_rtd_theme
1018
- pip install .
1119
script:
1220
- python -m flake8

binarytree/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def _is_bst(root, min_value=float('-inf'), max_value=float('inf')):
5858

5959

6060
def _is_symmetric(root):
61-
"""Check if the binary tree is symmetric
61+
"""Check if the binary tree is symmetric.
6262
63-
:param root: Root node of the binary tree
63+
:param root: Root node of the binary tree.
6464
:type root: binarytree.Node | None
6565
:return: True if the binary tree is symmetric, False otherwise.
6666
:rtype: bool
@@ -323,7 +323,7 @@ class Node(object):
323323
current node and its descendants.
324324
325325
:param value: Node value (must be a number).
326-
:type value: int | float
326+
:type value: int | float | numbers.Number
327327
:param left: Left child node (default: None).
328328
:type left: binarytree.Node | None
329329
:param right: Right child node (default: None).
@@ -1128,7 +1128,9 @@ def is_bst(self):
11281128
def is_symmetric(self):
11291129
"""Check if the binary tree is symmetric.
11301130
1131-
* Left subtree is a mirror of the right subtree around the center
1131+
A binary tree is symmetric if it meets the following criteria:
1132+
1133+
* Left subtree is a mirror of the right subtree about the root node.
11321134
11331135
:return: True if the binary tree is a symmetric, False otherwise.
11341136
:rtype: bool
@@ -1138,13 +1140,15 @@ def is_symmetric(self):
11381140
.. doctest::
11391141
11401142
>>> from binarytree import Node
1143+
>>>
11411144
>>> root = Node(1)
11421145
>>> root.left = Node(2)
11431146
>>> root.right = Node(2)
11441147
>>> root.left.left = Node(3)
11451148
>>> root.left.right = Node(4)
11461149
>>> root.right.left = Node(4)
11471150
>>> root.right.right = Node(3)
1151+
>>>
11481152
>>> print(root)
11491153
<BLANKLINE>
11501154
__1__

binarytree/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '4.0.0' # pragma: no cover
1+
__version__ = '4.1.0' # pragma: no cover

0 commit comments

Comments
 (0)