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

Cannot assign real numbers to Real #7104

Closed
DMR-coding opened this issue Jun 28, 2019 · 1 comment
Closed

Cannot assign real numbers to Real #7104

DMR-coding opened this issue Jun 28, 2019 · 1 comment

Comments

@DMR-coding
Copy link

DMR-coding commented Jun 28, 2019

  • Are you reporting a bug, or opening a feature request?
    Reporting a bug

  • Minimal repro:

from numbers import Real


def double(n: Real) -> float:
    return n * 2.0


print(double(1))
print(double(1.0))
  • What is the actual behavior/output?
min_repro.py:8: error: Argument 1 to "double" has incompatible type "int"; expected "Real"
min_repro.py:9: error: Argument 1 to "double" has incompatible type "float"; expected "Real"
  • What is the behavior/output you expect?
    No output-- isinstance(1, Real) and isinstance(1.0, Real) are both true.

  • What are the versions of mypy and Python you are using?
    I am using 0.711. (I was not able to successfully install from master.)

  • What are the mypy flags you are using? (For example --strict-optional)
    No flags

@ilevkivskyi
Copy link
Member

Duplicate of #3186

@ilevkivskyi ilevkivskyi marked this as a duplicate of #3186 Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants