[Python-ideas] Keyword/Symbol literals

Michael Mitchell epsilonmichael at gmail.com
Wed Jan 21 11:12:56 CET 2015


On Tue, Jan 20, 2015 at 9:20 PM, Matthew Rocklin <mrocklin at gmail.com> wrote:

> df.sort(df.name)
>
> or strings
>
> df.sort('name')
>
> auto-generated attributes work great until you want to use chained
> expressions
>
> df.change_dataframe().sort(some_new_column_not_in_df)
>

I would like to add that Python 3.4 enums would make a better and more
idiomatic replacement for auto-generated attributes, e.g. df.columns.name
(which may look similar to SQLAlchemy semantics for those familiar). Note
how languages such as Ruby, Clojure, and Julia do not have enums and how
languages with enums tend to not have symbols. With immutable strings and
enums already present, symbols do not add very much value.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150121/2083db6f/attachment.html>


More information about the Python-ideas mailing list