First time here? Check out the FAQ!

Revision history  [back]

Wing doesn't print repr of dataclasses in some cases

I've noticed that Wing doesn't print a full repr of some dataclasses in the debug console. For example, a dataclass containing a builtin datetime as one of its fields prints it in its repr, while one using a pendulum.DateTime does not. Is this deliberate? Is there a way to make Wing print all contents, similar to how it would print a namedtuple?

For example:

from dataclasses import dataclass
import datetime
import pendulum
import typing as tp

@dataclass
class A:
    f: tp.Any = None


# Wing shows this as  `A(f=datetime.date(2025, 1, 1))` in the debug console:
A(f=datetime.date(2025, 1, 1))

# Wing shows this as `A()` in the debug console:
A(f=pendulum.Date(2025, 1, 1))