Add EntryPoints.__repr__#473
Conversation
Change __repr__ to reflect that Entrpoints is are longer indexable by integers like tuples, but signal our custom behavior.
Thanks for reporting. In an early iteration of this approach, I was aiming to make things like
Yes, that seems perfectly reasonable.
Given that this implementation is reflected in the stdlib ( |

@jaraco With commit 0c81964 the behavior of Entrypoints gets a bit disorienting.
Being unfamiliar with the EntryPoints API I fired up ipython and inspected the result of selecting some entry-point I am interested in.
The representation is that of a regular tuple:
(EntryPoint(name='py.test', value='pytest:console_main', group='console_scripts'),
EntryPoint(name='pytest', value='pytest:console_main', group='console_scripts'),
EntryPoint(name='humanfriendly', value='humanfriendly.cli:main', group='console_scripts'))
My expectation was that the collection should act like a tuple which can be indexed by integers. Would you be open to accept the custom
__repr__in this PR ?I gather that Entrypoints at this point is essentially an immutable OrderedDict with some convenience selectors/filters. Is this correct?
Alternatively you could consider vendoring frozenordereddict (I haven't tried it myself).