[issue38375] Enum lookup fails for callable values

2019-10-07 Thread Massimo
Massimo added the comment: Where is this documented? Sorry, I couldn't find it. In any case, I'd say this behaviour is quite unexpected, and unless technical reasons are overwhelming, would be nice to change it. -- ___ Python tracker

[issue38375] Enum lookup fails for callable values

2019-10-07 Thread Ethan Furman
Ethan Furman added the comment: This is the intended, and documented, behavior. -- assignee: -> ethan.furman resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker _

[issue38375] Enum lookup fails for callable values

2019-10-05 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Some relevant threads * https://stackoverflow.com/questions/40338652/how-to-define-enum-values-that-are-functions * https://mail.python.org/pipermail/python-ideas/2017-April/045428.html -- ___ Python tra

[issue38375] Enum lookup fails for callable values

2019-10-05 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: https://docs.python.org/3/library/enum.html#allowed-members-and-attributes-of-enumerations > The rules for what is allowed are as follows: names that start and end with a > single underscore are reserved by enum and cannot be used; all other > attr

[issue38375] Enum lookup fails for callable values

2019-10-05 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue38375] Enum lookup fails for callable values

2019-10-05 Thread Massimo
New submission from Massimo : ``` from enum import Enum class T(Enum): TEST = 1 print(T["TEST"]) class S(Enum): TEST = lambda a: a print(S["TEST"]) ``` fails with `KeyError: 'TEST'` on the last line. -- components: Interpreter Core messages: 354003 nosy: typish priority: normal