TP0225
Error: invalid class definition
Messages
Section titled “Messages”a class can have only one base class(protocols aside, M17)'<T>' cannot be a base classa dataclass can only derive from a dataclass(with helpexceptions are plain classes; give it an '__init__'for an exception base, M16; since M41 only for a plain user exception class,SystemExit,PythonErrororDotNetError)a plain class can only derive from a plain classgeneric classes cannot be derived fromgeneric classes cannot have a base class'<C>' derives from itselfspecial method '<m>' is not supporteda dataclass cannot define '__init__'field without a default follows field with a default'<m>' must be 'def <m>(self, …) -> <R>'(M28, replacing M17’s'__lt__' must take one parameter of type '<C>' (or a base class) and return bool)'<m>' must take 'self' first(or'cls')a static method takes neither 'self' nor 'cls'a property takes no parameters other than 'self'a property must have a return typea setter must follow its propertya setter must take one parameter of type <T> and return nothingclass attribute '<a>' needs a value(generic classes cannot have <static methods|class methods|class attributes>until M39)an abstract method's body must be '...''<C>' would not be hashable, but its base '<B>' is, with helpdefine '__hash__'(M28)'<C>' defines '__exit__' but not '__enter__'(or the reverse) (M37)'<P>' is already declared(oralready declared by '<B>')a protocol can only declare methodsa protocol method's body must be '...'protocol method parameters cannot have defaultsprotocols cannot be generica protocol can only derive from 'Protocol'(M17)a protocol field can't have a defaultan exception class can't be generic(M40)a frozen dataclass can't derive from one that isn't(or the reverse)'order=True' needs fields that can be ordered: '<f>' is <T>'order=True' generates '<m>'; remove it'__post_init__' must be 'def __post_init__(self) -> None''__post_init__' is only for dataclassescannot derive from final class '<C>''@total_ordering' needs '__lt__', '__le__', '__gt__' or '__ge__'(M39)cannot derive from '<B>': it's <sealed|static|a struct|an exception class|without a constructor Taipan can call>(with helpderive from 'Exception'for an exception class)'<C>' must define '<m>' to implement '<I>''<C>' must override '<B>.<m>''<m>' is defined by '<special>''<C>' derives from the .NET class '<B>', so it can't be derived from yetgeneric classes cannot implement .NET interfaces yet(M43)
Example
Section titled “Example”From the golden case tests/cases/m21/tp0225_dotneterror.tpn:
class Mine(DotNetError): passThe compiler reports:
tp0225_dotneterror.tpn:1:12: error TP0225: 'DotNetError' cannot be a base classThe specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.