Skip to content

Commit

Permalink
Polishes tutorial, Sphinx configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub committed Feb 3, 2016
1 parent 6ced957 commit 76a1ee4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ One thing to note here is that unlike the other operator functions, `(-)` can ei
return self.pts |> map$((-)) |*> vector
```

Our next method will be equality. We're again going to use `data` pattern-matching to implement this, but this time inside of a `match` statement instead of with destructuring assignment, since we want to `return False` not raise an error if the match fails. Here's the code:
```python
def __eq__(self, other):
"""Compare whether two vectors are equal."""
Expand All @@ -507,8 +508,9 @@ One thing to note here is that unlike the other operator functions, `(-)` can ei
return False
```

The last method we'll implement is multiplication.
The only new construct here is the use of `=self.pts` in the `match` statement. This construct is used to perform a check inside of the pattern-matching, making sure the `match` only succeeds if `other.pts == self.pts`.

The last method we'll implement is multiplication.
```python
def __mul__(self, other):
"""Scalar multiplication and dot product."""
Expand Down
4 changes: 2 additions & 2 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

from root import *
from recommonmark.parser import CommonMarkParser
import sphinx_bootstrap_theme
from sphinx_bootstrap_theme import get_html_theme_path

#-----------------------------------------------------------------------------------------------------------------------
# DEFINITIONS:
#-----------------------------------------------------------------------------------------------------------------------

html_theme = "bootstrap"
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
html_theme_path = get_html_theme_path()

project = "Coconut"
copyright = "2015, Evan Hubinger, licensed under Apache 2.0"
Expand Down

0 comments on commit 76a1ee4

Please sign in to comment.