Symbols as parameters?

Jean-Michel Pichavant jeanmichel at sequans.com
Fri Jan 22 13:53:58 CET 2010


Ben Finney wrote:
> Jean-Michel Pichavant <jeanmichel at sequans.com> writes:
>
>   
>> Steven D'Aprano wrote:
>>     
>>> I would call it a horrible, horrible, horrible code smell. A stench
>>> in fact.
>>>       
> […]
>
>   
>> As soon as it is properly documented, as a public interface should be,
>> it becomes an acceptable design, IMO.
>>     
> […]
>
> So your position seems to be that any design fault ceases to be a fault
> if it is documented. If that's not your position, I would be interested
> to know what relevance the above statement has to Stephen's objection.
>
>   
Well, this disign is:

1/ working
2/ simple
3/ unusual

I don't now if unusual means necessarily faulty or horrible. Still I 
don't want to defend this design at all cost, 'cause I'm not using it 
anyway, and I happily acknowledge that there are better ones (commonly 
used). I just wanted to help the OP with writing some simple and short 
code to use constants instead of strings in a context of one function. 
Note how I used *acceptable* in my previous post to qualify this design 
which is a rather cautious statement.

Cheers,

Jean-Michel



More information about the Python-list mailing list