facebook / facebook/pyrefly

new rule - ban subtyping dataclass with `order=True`

Open
#3,762 7 comments 0 reactions 1 assignee Claimed by @ak4-sh View on GitHub
good first issue stale typechecking
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

https://docs.astral.sh/ty/reference/rules/#subclass-of-dataclass-with-order

```py
from dataclasses import dataclass

@dataclass(order=True)
class Parent:
value: int

class Child(Parent): # Ty emits a warning here
pass

# At runtime, this raises TypeError:
Child(1) < Parent(2)
```

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.