Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86601

Re: Python Worst Practices

References <mclca6$iie$1@ger.gmane.org> <7053A277-9687-49B0-9FDB-CB4DB3E76DEC@gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2015-02-27 15:37 -0700
Subject Re: Python Worst Practices
Newsgroups comp.lang.python
Message-ID <mailman.19324.1425076688.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Feb 27, 2015 at 2:21 PM, Travis Griggs <travisgriggs@gmail.com> wrote:
> * Make your language have a lot of keywords. Enough to make memorizing them ALL unlikely, requiring constant visits to your documentation
> * Make sure said keywords are many of the obvious words programmers would use in their applications (map, object, bytes, dir, etc)

None of those are keywords. Keywords are these:
https://docs.python.org/3/reference/lexical_analysis.html#keywords

> * Design your syntax so that you can’t disambiguate them contextually between bind and reference

Maybe I misunderstand your complaint, but Python draws a sharp
syntactic distinction between references and assignment targets: the
latter are only ever found to the left of an = in an assignment
statement; the former are never found there. There is no reason why an
editor should be unable to tell the difference.

> * Be sure to use it in a late bound language where no warnings will be provided about the mistake you’re making at authorship time, deferring the educational experience to sundry run times

You should lint your code to get warnings about this (and many other
things) at authorship time. A good editor should also provide some
visual warning when a built-in is shadowed.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python Worst Practices Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-27 15:37 -0700

csiph-web