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

Comparison chaining bug #309

Closed
gvanrossum opened this issue Jul 19, 2014 · 4 comments · Fixed by #439
Closed

Comparison chaining bug #309

gvanrossum opened this issue Jul 19, 2014 · 4 comments · Fixed by #439
Labels
bug mypy got something wrong

Comments

@gvanrossum
Copy link
Member

I have this one-liner:

assert 0.0 < 0.5 < 1.0

This gives the following error:

/tmp/x.py, line 1: Unsupported operand types for > ("float" and "bool")

Eh?!?!

@spkersten
Copy link
Contributor

I'm implementing this feature. Parsing of these kind of comparison expressions is done. I'm now working on the type checking part. See my parsecomp branch for progress.

@JukkaL
Copy link
Collaborator

JukkaL commented Sep 8, 2014

I had a quick look at your branch and it's looking good!

Note that the transform-related code is obsolete and doesn't need to be maintained any longer. It could still be useful for other projects, but I'd rather not spend time updating it.

@spkersten
Copy link
Contributor

Thanks. The transform related code is the only part I still have some doubts about (even tough it passes the existing test). Do you want me to leave it out?

I want to add a few unit tests for chain comparisons. So I should be able to create a pull request after a few evenings.

On 8 sep. 2014, at 02:50, Jukka Lehtosalo notifications@github.com wrote:

I had a quick look at your branch and it's looking good!

Note that the transform-related code is obsolete and doesn't need to be maintained any longer. It could still be useful for other projects, but I'd rather not spend time updating it.


Reply to this email directly or view it on GitHub.

@JukkaL
Copy link
Collaborator

JukkaL commented Sep 8, 2014

You can leave it out. If some tests fail, you can add a -skip prefix to not run them. Here is an example from test/data/dyncheck-trans-generics.test:

[case testCastWithDynamicAndTypedArguments-skip]

I'm going to remove all transform-related code one of these days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants