[Python-3000] symbols?
Adam DePrince
adam.deprince at gmail.com
Wed Apr 12 21:02:37 CEST 2006
On Tue, 2006-04-11 at 12:11 +1200, Greg Ewing wrote:
> Kendall Clark wrote:
>
> > One thing I'd really like to see in Python 3000 is support for first-
> > class symbols, with literal syntax.
>
> Actually I think enumerations would be more useful than
> symbols. There's no essential difference between a symbol
> and an interned string. The only real disadvantage to
> using strings as symbols is that you don't get an
> immediate NameError if you misspell one. A symbol type
> wouldn't solve that problem; enumerations would.
You can get all of the benefits of a symbol, including the immediate
spelling correction, by encouraging users to use module members instead
of string literals. Drawing on the os as an example ...
...
os.O_EXCL
os.O_LARGEFILE
...
I don't see the benefit.
>
> --
> Greg
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/adam.deprince%40gmail.com
More information about the Python-3000
mailing list