Open
Description
Feature
Allow this:
from typing import Protocol, final
class Sized(Protocol):
len: int
@final
def __len__(self) -> int:
return self.len
Pitch
I get that this is a bit unusual, but I don’t really see any harm that could come from this (as an aside, pyright
allows it). My use case is that I’m using Protocol
s for mixins, and sometimes I want to make sure my mixed-in methods don’t get overwritten.