[Python-3000] symbols?

Kendall Clark kendall at monkeyfist.com
Tue Apr 11 07:00:14 CEST 2006


On Apr 10, 2006, at 8:05 PM, Greg Ewing wrote:

> Kendall Clark wrote:
>> Folks,
>>
>> One thing I'd really like to see in Python 3000 is support for first-
>> class symbols,
>>
>> 	def web_dispatch("/bank-account", :GET, retrieve_account): pass
>
> class SymGen:
>
>    def __getattr__(self, name):
>      return intern(name)
>
> sym = SymGen()
>
> web_dispatch("/bank-account", sym.GET, retrieve_account)

Yep, of course. I suspect anyone who's used Python in anger has  
written some such thing. The question is whether it's worth effort to  
have something standardized in the language. I think it would be  
worth the effort, but that's my 2 cents.

Cheers,
Kendall




More information about the Python-3000 mailing list