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


Groups > comp.lang.python > #86601 > unrolled thread

Re: Python Worst Practices

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2015-02-27 15:37 -0700
Last post2015-02-27 15:37 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#86601 — Re: Python Worst Practices

FromIan Kelly <ian.g.kelly@gmail.com>
Date2015-02-27 15:37 -0700
SubjectRe: Python Worst Practices
Message-ID<mailman.19324.1425076688.18130.python-list@python.org>
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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web