[Python-Dev] PEP 362 Third Revision (original) (raw)
Eric Snow ericsnowcurrently at gmail.com
Thu Jun 14 20:23:37 CEST 2012
- Previous message: [Python-Dev] PEP 362 Third Revision
- Next message: [Python-Dev] PEP 362 Third Revision
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Jun 14, 2012 at 9:06 AM, R. David Murray <rdmurray at bitdance.com> wrote:
I don't have strong feelings about this, but to me the fact that there are values of the individual parameters that if they occur on the same object at the same time would be invalid is a code smell. If the thing can be one and only one of a list of possible types, it makes sense to me that this be indicated as a single attribute with a list of possible values, rather than a set of boolean options, one for each type.
For the attribute error issue, we could have module attributes that give names to the strings: if parameter.kind == inspect.VARARGKIND: stuff Or if we don't want that in the stdlib, the individual programmer who cares about it can define their own constants.
On Thu, Jun 14, 2012 at 11:10 AM, Brett Cannon <brett at python.org> wrote:
I agree with Benjamin, it goes against TOOWTDI without enough of a justification to break the rule. Just make the strings constants on the Parameter class and you solve the lack of enum issue.
+1
-eric
- Previous message: [Python-Dev] PEP 362 Third Revision
- Next message: [Python-Dev] PEP 362 Third Revision
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]