Re: True inconsistency in Python

From: Terry Reedy (tjreedy_at_udel.edu)
Date: 11/19/03


Date: Tue, 18 Nov 2003 19:50:49 -0500


"Ron Adam" <radam2@tampabay.rr.com> wrote in message
news:7rhjrvgefdpfkm15divsor9e3iktl0falh@4ax.com...
> On Mon, 17 Nov 2003 23:40:52 -0500, "Terry Reedy" <tjreedy@udel.edu>
> wrote:
>
> >In 2.2.2+, you only need to not change them and to not work with a
> >psycopath.
>
> Many people are starting to learn programming with python as their
> first computer language. I wouldn't refer to them as a psychopath.

Neither would I. I was thinking of the following scenario. You are
part of a programming group. You write module ronad, to be imported
by danor written by 'Dan Oreo'. Psycho writes unrelated module
'sneaky' with

import ronad
ronad.True, ronad.False = False, True

perhaps disguised. You get blamed for the 'bug' that you did not
write and cannot find.

[Prohibiting this scenario (import module and mask builtins there in)
has been suggested. I believe it was once approved and is still under
consideration but the change has the problem that there seem to be
legitimate uses.]

> They may one day write programs that save peoples lives. They have
to
> start someplace. Many people using python will not be professional
> programmers but enthusiast and hobbiests, or web page programmers,
> or ..... in other words, a very large and diverse group.

People often post code redefining builtings like file and list, and
get reminders not to do so. I cannot remember anyone accidentally
overwriting True or False.

...
> I'm not sure what your point is here, but using PyChecker sounds
like
> a good suggestion.

That suggestion was my final point. Ignore the warm-up pitch.

Terry J. Reedy



Relevant Pages

  • Re: [Python-Dev] The baby and the bathwater (Re: Scoping, augmented assignment, fast locals &#
    ... but on a *space* of programs of identical function, as of manner of probing recent features and modules of Python that I manage to apply to it. ... parent lexical scope, be performed on the object bound to a parent scope ... I guess not in the manner of someone who started programming when programs had to fit in a couple dozen kbytes. ... intersection of the file tagged "arrogant would-be mind-readers", and of the file tagged "you are late on the normal trajectory if you did not reproduce my own oh-so-significant mistakes", both well-populated already, although I forgot who I put in them. ...
    (comp.lang.python)
  • Re: [Python-Dev] The baby and the bathwater (Re: Scoping, augmented assignment, fast locals &#
    ... Python 3.x development has started already, so it's not so much a "fairy ... of your approach when using the Python programming language. ... the mistake I mention, both in personal code, as well as code I was ... Nobody forces any school to present closures to beginners. ...
    (comp.lang.python)
  • Re: Attack a sacred Python Cow
    ... The fact that a function is defined within a class statement doesn't ... It's bad programming, but the world is full of bad programmers, and we ... It's also a way to make Python more complicated than it needs to be. ... def fun(self, cat): ...
    (comp.lang.python)
  • Re: Any maths or science fans using Solaris? (related to Mathematica on Solaris)
    ... Sage is based around the Python language, but glues together lots of open-source maths software - a list is at ... Automatically Tuned Linear Algebra Software ... Convex optimization, linear programming, least squares, etc. ... Cython: C-Extensions for Python ...
    (comp.unix.solaris)
  • Re: Perl Vs Python: Blind Folks
    ... perl's ";" etc. makes writing python programs perhaps very device ... is roughly one fourth of what it is with speech. ... Most screen readers primarily output stuff using highly intelligible, ... This means some major difficulties in programming in any language. ...
    (comp.lang.perl.misc)