Skip to content

Commit

Permalink
Merge pull request #22 from wsanchez/mypy
Browse files Browse the repository at this point in the history
Unsupported operand types for + ("Union[int, float]" and "int")
  • Loading branch information
wsanchez committed Dec 17, 2016
2 parents e28495d + 349c6b5 commit 1f5a182
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ matrix:
- python: 3.5
env: TOXENV=py35-trial-coverage,codecov_publish

allow_failures:
- env: TOXENV=lint-mypy

script:
- tox
12 changes: 8 additions & 4 deletions src/sample_klein_app/application/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def add(self, request: IRequest, a: str, b: str) -> KleinRenderable:
@param b: A number to add to C{a}.
"""
return "{}".format(self.numberify(a) + self.numberify(b))
x = self.numberify(a) + self.numberify(b) # type: ignore #see #21
return "{}".format(x)

@router.route("/subtract/<a>/<b>")
def subtract(self, request: IRequest, a: str, b: str) -> KleinRenderable:
Expand All @@ -67,7 +68,8 @@ def subtract(self, request: IRequest, a: str, b: str) -> KleinRenderable:
@param b: A number to subtract from C{a}.
"""
return "{}".format(self.numberify(a) - self.numberify(b))
x = self.numberify(a) - self.numberify(b) # type: ignore #see #21
return "{}".format(x)

@router.route("/multiply/<a>/<b>")
def multiply(self, request: IRequest, a: str, b: str) -> KleinRenderable:
Expand All @@ -82,7 +84,8 @@ def multiply(self, request: IRequest, a: str, b: str) -> KleinRenderable:
@param b: A number to multiply with C{a}.
"""
return "{}".format(self.numberify(a) * self.numberify(b))
x = self.numberify(a) * self.numberify(b) # type: ignore #see #21
return "{}".format(x)

@router.route("/divide/<a>/<b>")
def divide(self, request: IRequest, a: str, b: str) -> KleinRenderable:
Expand All @@ -98,7 +101,8 @@ def divide(self, request: IRequest, a: str, b: str) -> KleinRenderable:
@param b: A number to divide C{a} by.
"""
return "{}".format(self.numberify(a) / self.numberify(b))
x = self.numberify(a) / self.numberify(b) # type: ignore #see #21
return "{}".format(x)

@router.handle_errors(ValueError)
def valueError(self, request: IRequest, failure) -> KleinRenderable:
Expand Down

0 comments on commit 1f5a182

Please sign in to comment.