[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: Probably not because an enum class' __call__ comes from the type EnumMeta -- so having two different __call__ methods would mean two different metaclasses, and I'm pretty sure I don't want to go there. ;) There is a __doc__ defined for the __call__ method,

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm wondering is it worth to set different __call__ methods for enum types with and without members? -- ___ Python tracker

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: There are actually two signatures: EnumCls(value) --> return member with value `value` EnumCls(name, members, module, qualname, type, start) --> create new Enum An example of the first: class A(Enum): x = 1 A(1) --> an example of the second: class

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This line is came from the signature of the __call__ method. >>> import enum, inspect >>> class A(enum.Enum): ...x = 1 ... >>> inspect.signature(A) >>> inspect.signature(A.__call__) >>> inspect.signature(enum.EnumMeta.__call__) But calling A with

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: That that is very unhelpful help text. :( Better would be: Color(value) So how do we allow Python code to determine the help text? -- ___ Python tracker

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
New submission from Ethan Furman: >From issue29338, msg286139: -- It is easy to fix the [pydoc] test by adding missed lines. But I'm not sure that output the (correct) signature of enum classes makes the help better. Color(value, names=None, *, module=None,