Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported operand types for + ("Union[int, float]" and "int") #22

Merged
merged 3 commits into from
Dec 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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