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

Introduce Two-ended Comparison #3564

Closed
amab8901 opened this issue Feb 5, 2024 · 3 comments
Closed

Introduce Two-ended Comparison #3564

amab8901 opened this issue Feb 5, 2024 · 3 comments

Comments

@amab8901
Copy link

amab8901 commented Feb 5, 2024

In Python, you can write two-ended comparison as 50 < x < 100, but in Rust this simple syntax doesn't work and you instead have to write 50 < x && x < 100. I think we should introduce the former syntax to Rust since it's more readable and concise. The implementation shouldn't be too hard since I imagine you could just tell the compiler that the former syntax is synonymous with the latter syntax.

@petar-dambovaliev
Copy link

More readable to whom? Python programmers?
It's not more readable to me.

@kennytm
Copy link
Member

kennytm commented Feb 5, 2024

duplicate of #2083.

@fmease
Copy link
Member

fmease commented Feb 5, 2024

Closing as duplicate then.

@fmease fmease closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
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

4 participants