TP0226
Error: object used before it is fully initialized
Messages
Section titled “Messages”'__init__' does not set '<f>''<f>' has no default, and '<C>' has no '__init__''<f>' is read before it is set'self' is used before '<f>' is set(orbefore 'super().__init__' is called)'<f>' is inherited, so it is set by 'super().__init__''super().__init__' is called before '<f>' is set'<C>.__init__' must call 'super().__init__(…)''super().__init__' must be called once, directly in '__init__''super().__init__' can only be called in '__init__''__init__' returns before '<f>' is set(orbefore 'super().__init__' is called) (when several fields are unset, the first in declaration order is named)'super().__init__' must come first, since '<B>' is a .NET class(M43)
Example
Section titled “Example”From the golden case tests/cases/m43/tp0226_dotnet.tpn:
# A .NET base is constructed first (SPEC §13.16).from dotnet.System import Random
class Loaded(Random): seed: int
def __init__(self, seed: int): self.seed = seed super().__init__(seed)The compiler reports:
tp0226_dotnet.tpn:9:9: error TP0226: 'super().__init__' must come first, since 'Random' is a .NET classThe specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.