Proposal for adding symbols within Python

Pierre Barbier de Reuille pierre.barbier at cirad.fr
Sun Nov 13 06:33:48 EST 2005


Steven D'Aprano a écrit :
> On Sun, 13 Nov 2005 10:11:04 +0100, Pierre Barbier de Reuille wrote:
> 
> 
>>The problem, IMHO, is that way you need to declare "symbols"
>>beforehands, that's what I was trying to avoid by requiring a new syntax.
> 
> 
> ???
> 
> If you don't declare your symbols, how will you get the ones that you want?
> 
> I don't understand why it is a problem to declare them first, and if it is
> a problem, what your solution would be.
> 

Well, just as Python do not need variable declaration, you can just
*use* them ... in dynamic languages using symbols, they just get created
when used (i.e. have a look at LISP or Ruby).

> [snip]
> 
> 
>>Well, I don't think enumarated objects ARE symbols. I can see two
>>"problems" :
>> 1 - in the implementation, trying to compare values from different
>>groups raises an error instead of simply returning "False" (easy to fix ...)
> 
> 
> As you say, that's easy to fix.
> 
> 
>> 2 - You have to declare these enumerable variables, which is not
>>pythonic IMO (impossible to fix ... needs complete redesign)
> 
> 
> Are you suggesting that the Python language designers should somehow
> predict every possible symbol that anyone in the world might ever need,
> and build them into the language as predefined things?
> 
> If that is not what you mean, can you explain please, because I'm confused.
> 

Well, the best I can propose is for you to read the discussion with Mike
Meyer.
He pointer out the flaws in my proposal and we're trying to precise things.

Pierre



More information about the Python-list mailing list