Series.to_init_repr will call the new method _prefixed_repr with the prefix="pl."
for normal DataTypes _prefixed_repr will use __repr__ and prefix it with the given prefix => no further changes necessary
for NestedTypes the flow of control is reversed __repr__ will call _prefixed_repr with no prefix. _prefixed_repr will take care of passing the prefix for the inner dtype representation
This is a minimal fix for https://github.com/pola-rs/polars/issues/15802 by adding a method that prefixes representations, which will be called "recursively" for nested types. Idea:
Series.to_init_repr
will call the new method_prefixed_repr
with the prefix="pl."_prefixed_repr
will use__repr__
and prefix it with the given prefix => no further changes necessary__repr__
will call_prefixed_repr
with no prefix._prefixed_repr
will take care of passing the prefix for the inner dtype representation