Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Add explicit support for NamedTuples #2012

Closed
willmcgugan opened this issue Feb 28, 2022 · 1 comment · Fixed by #2031
Closed

[REQUEST] Add explicit support for NamedTuples #2012

willmcgugan opened this issue Feb 28, 2022 · 1 comment · Fixed by #2031
Assignees
Labels
enhancement New feature or request

Comments

@willmcgugan
Copy link
Collaborator

The Pretty class doesn't support pretty printing NamedTuples.

We should attempt to auto detect named tuples in order to expand these on to multiple lines as appropriate.

NamedTuples inherit from tuple and don't have a common base class. They have a _fields attribute which could identify them as a named tuple.

We will also need to check if a custom repr has been provided (in the same was as we do dataclasses).

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

Did I solve your problem?

Why not buy the devs a coffee to say thanks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants