facebook / facebook/pyrefly

new rule - non-decorator usage of `final`

Open
#3,741 1 comment 0 reactions 0 assignees View on GitHub
typechecking
Dominant language
Rust
Stars
7k
Forks
516
PR merge metrics
No merged PRs in 30d

Description

not sure how common this is, but [ty has a check for it](https://docs.astral.sh/ty/reference/rules/#ineffective-final):

```py
from typing import final

# error: Type checkers will not prevent subclassing when `final()` is called as a function
MyClass = final(type("MyClass", (), {}))

class Bar(MyClass): ... # no error
```

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.