We have this class structure here:
from abc import ABC, abstractmethod
from pydantic import BaseModel
class Super(ABC, BaseModel):
@property
@abstractmethod
def name(self) -> str:
...
class Sub1(Super):
name : str # pydantic field
class Sub2(Super):
@computed_field
@property
def name(self) -> str:
return "computed_name"
But no matter what I try, one of the two subclasses always has a type error. Is there a way to achieve this in python or is it just impossible?