facebook / facebook/pyrefly

Literal-Comparison of Tuples does not work

Open
#896 8 comments 2 reactions 0 assignees View on GitHub
pytorch
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

### Describe the Bug

```
x = (3, 12) <= (3, 14)
print(x)
```

Will print `true` but get this error:

```
ERROR 2:5-23: `<=` is not supported between `tuple[Literal[3], Literal[12]]` and `tuple[Literal[3], Literal[14]]` [[unsupported-operation](https://pyrefly.org/en/docs/error-kinds/#unsupported-operation)]
Argument `tuple[Literal[3], Literal[14]]` is not assignable to parameter `value` with type `tuple[Literal[3, 12], ...]` in function `tuple.__le__`

```

### Sandbox Link

https://pyrefly.org/sandbox/?code=FADwBAvGAUDMA0YCMAmAlGAPFOikBY1gAHAJwEsA7AF2hDSA&version=3.12

### (Only applicable for extension issues) IDE Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.