[issue33862] doc Fix Enum __members__ type

2018-06-14 Thread Ethan Furman
Ethan Furman added the comment: Serhiy is correct. The exact return type only needs to be ordered, and have appropriate dictionary methods such as `keys()`, `values()`, and `items()`. The reason a mappingproxy was chosen is exactly because what you just tried is illegal and/or confusing:

[issue33862] doc Fix Enum __members__ type

2018-06-14 Thread Andrés Delfino
Andrés Delfino added the comment: I can't really say if it the return of __members__ is an implementation detail as there's no mention of that in the doc, but from reading the doc I think it's reasonable to think this is allowed: import enum class Colors(enum.Enum): RED = enum.auto()

[issue33862] doc Fix Enum __members__ type

2018-06-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is not returning a mappingproxy an implementation detail? The important thing is that the result is a mapping of names to members, and that it is ordered. -- nosy: +barry, eli.bendersky, ethan.furman, serhiy.storchaka

[issue33862] doc Fix Enum __members__ type

2018-06-14 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch pull_requests: +7309 stage: -> patch review ___ Python tracker ___ ___

[issue33862] doc Fix Enum __members__ type

2018-06-14 Thread Andrés Delfino
New submission from Andrés Delfino : Documentation says __members__ attribute returns an "ordered dictionary" but it returns a mappingproxy instead. PR fixes this. -- assignee: docs@python components: Documentation messages: 319532 nosy: adelfino, docs@python priority: normal