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?

EDIT: I think I was wrong about what triggers this; I'm now able to reproduce it using builtin datetimes, but only if the pprint option is checked in the debug console preferences. I've updated the example below to use datetime.

For example:

from dataclasses import dataclass
import datetime
import typing as tp

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


# Wing shows this as  `A(f=1, g=2)` in the debug console:
A(f=1, g=2)

# Wing shows this as `A()` in the debug console when the pprint option is checked.
A(datetime.datetime.now(), datetime.datetime.now())

Here's a screenshot to prove I'm not crazy: image description

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?

EDIT: I think I was wrong about what triggers this; I'm now able to reproduce it using builtin datetimes, but only if the pprint option is checked in the debug console preferences. I've updated the example below to use datetime.

For example:

from dataclasses import dataclass
import datetime
import typing as tp

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


# Wing shows this as  `A(f=1, g=2)` in the debug console:
A(f=1, g=2)

# Wing shows this as `A()` in the debug console when the pprint option is checked.
A(datetime.datetime.now(), datetime.datetime.now())

Here's a screenshot to prove I'm not crazy: image description

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?

EDIT: I think I was wrong about what triggers this; I'm now able to reproduce it using builtin datetimes, but only if the pprint option is checked in the debug console preferences. I've updated the example below to use datetime.

For example:

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

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


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

# Wing shows this as `A()` in the debug console when the pprint option is checked.
A(datetime.datetime.now(), datetime.datetime.now())
console:
A(f=pendulum.Date(2025, 1, 1))

Here's a screenshot to prove I'm not crazy: image description