enthought / enthought/traits

Better display on list of objects in `print_traits`

Open
#534 3 comments 0 reactions 0 assignees View on GitHub
easy good first issue type: enhancement
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

Here is a minimal script to demonstrate the issue
```
from traits.api import HasTraits, List, Instance

class Child(HasTraits):
pass

class Parent(HasTraits):
children = List(Instance(Child))

if __name__ == '__main__':
children = [Child() for i in range(10)]
parent = Parent(children=children)
parent.print_traits()
```
which outputs:
```
children: [<__main__.Child object at 0x11dd...n__.Child object at 0x11dd0db48>]
```

The way it is abbreviated might be confusing such that one might misunderstand it as a list of single object. Might better try to add some informative suffix such as " and 9 other entries"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.