Python Worst Practices

Chris Angelico rosuav at gmail.com
Sat Feb 28 07:45:05 EST 2015


On Sat, Feb 28, 2015 at 9:39 PM, BartC <bc at freeuk.com> wrote:
> (People here would like PL/I then which apparently has *no* reserved words,
> so you can write: "if if=then then ...")

Likewise REXX has no reserved words; also, SQL went part-way there,
with the notion of "non-reserved keywords". For example, "ORDER" and
"BY" are reserved keywords, so they are unavailable as table/column
names, but "NULLS" is non-reserved. You could use it, if you wanted
to, but it's a syntactic element in some contexts. You can say "ORDER
BY some_column NULLS FIRST" or "NULLS LAST" to affect the ordering;
you can even say "ORDER BY NULLS NULLS FIRST", which will sort by a
column named NULLS, in ascending order, but counting NULL as lower
than everything (instead of higher than everything). Given the style
of SQL, it'd be insanely restrictive if it had to have everything be
either a keyword or nothing, so this is a good half-way-house.

ChrisA



More information about the Python-list mailing list