Skip to content

Commit

Permalink
Add TODO comment regarding @Final (meta)classes
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Nov 18, 2024
1 parent a5e502b commit fefd47a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ else:
## `type(x) == C`, `type(x) != C`

No narrowing can occur for equality comparisons, since there might be a custom `__eq__`
implementation on the metaclass:
implementation on the metaclass.

TODO: Narrowing might be possible in some cases where the classes themselves are `@final` or their
metaclass is `@final`.

```py
class IsEqualToEverything(type):
Expand Down

0 comments on commit fefd47a

Please sign in to comment.