getting rid of pass

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David Murmann

    #1

    getting rid of pass

    Hi all!

    i just had this crazy idea:

    instead of

    while cond():
    pass

    write

    while cond().

    or

    try:
    import xyz
    except ImportError:
    pass

    compared to

    try:
    import xyz
    except ImportError.

    i don't know whether this is syntactically unambiguous or replaces all
    uses of pass, but i find it quite nice to read.

    also if something like this has been proposed before and rejected, i
    apologize for this late-in-the-night idea.

    what do you people think?


    have a nice day, David.
  • John Machin

    #2
    Re: getting rid of pass

    On 13/05/2006 11:40 AM, David Murmann wrote:[color=blue]
    > Hi all!
    >
    > i just had this crazy idea:[/color]

    You said it.
    [color=blue]
    > late-in-the-night idea.[/color]

    You said it again.
    [color=blue]
    >
    > what do you people think?[/color]

    I agree with you.

    Comment

    • Terry Reedy

      #3
      Re: getting rid of pass


      "David Murmann" <david.murmann@ rwth-aachen.de> wrote in message
      news:4ckrmbF16k r2bU1@news.dfnc is.de...[color=blue]
      > i just had this crazy idea:[/color]

      Agreed ;-)
      [color=blue]
      > instead of
      > while cond():
      > pass
      > write
      > while cond().[/color]

      Viewing statememts as functions of the program state, pass is the identity
      function/statement. Many languages have the equivalent. Being explicit is
      Python's style. Getting rid of it would gratuitously break code for no
      reason other than your esthetic preference.
      [color=blue]
      > i don't know whether this is syntactically unambiguous or replaces all
      > uses of pass, but i find it quite nice to read.[/color]

      while x/3.

      would become somewhat ambiguous.

      Terry Jan Reedy



      Comment

      • Bruno Desthuilliers

        #4
        Re: getting rid of pass

        David Murmann a écrit :[color=blue]
        > Hi all!
        >
        > i just had this crazy idea:
        >
        > instead of
        >
        > while cond():
        > pass
        >
        > write
        >
        > while cond().[/color]

        Yuck
        [color=blue]
        > or
        >
        > try:
        > import xyz
        > except ImportError:
        > pass
        >
        > compared to
        >
        > try:
        > import xyz
        > except ImportError.[/color]

        Yuck again
        [color=blue]
        > i don't know whether this is syntactically unambiguous or replaces all
        > uses of pass, but i find it quite nice to read.[/color]

        I don't. I find it highly unreadable. I really find the pass statement
        to be a great idea, and to highly improve readability.
        [color=blue]
        > also if something like this has been proposed before and rejected, i
        > apologize for this late-in-the-night idea.
        >
        > what do you people think?[/color]

        Please don't feel offended, but I think it would be a very bad thing to do.

        Comment

        Working...