True inconsistency in Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry Reedy

    #46
    Re: True inconsistency in Python


    "Ron Adam" <radam2@tampaba y.rr.com> wrote in message
    news:7rhjrvgefd pfkm15divsor9e3 iktl0falh@4ax.c om...[color=blue]
    > On Mon, 17 Nov 2003 23:40:52 -0500, "Terry Reedy" <tjreedy@udel.e du>
    > wrote:
    >[color=green]
    > >In 2.2.2+, you only need to not change them and to not work with a
    > >psycopath.[/color]
    >
    > Many people are starting to learn programming with python as their
    > first computer language. I wouldn't refer to them as a psychopath.[/color]

    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.]
    [color=blue]
    > They may one day write programs that save peoples lives. They have[/color]
    to[color=blue]
    > 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.[/color]

    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.

    ....[color=blue]
    > I'm not sure what your point is here, but using PyChecker sounds[/color]
    like[color=blue]
    > a good suggestion.[/color]

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

    Terry J. Reedy


    Comment

    • Ron Adam

      #47
      Re: True inconsistency in Python

      On Tue, 18 Nov 2003 19:50:49 -0500, "Terry Reedy" <tjreedy@udel.e du>
      wrote:
      [color=blue]
      >[Prohibiting this scenario (import module and mask builtins there in)
      >has been suggested. I believe it was once approved and is still under
      >consideratio n but the change has the problem that there seem to be
      >legitimate uses.][/color]

      It might conflict with existing programs that assign 'True = 1' and
      'False = 0', I can see where that could be a very common
      occurrence for people who are new to Python. And once they learn
      about the True and False values, they may not go back and change the
      older programs. ie... if it'n not broke don't fix it. In other
      words, they leave them as is and move on to the next project.

      _Ronald Adam


      Comment

      Working...