testing array of logicals

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Janto Dreijer

    #16
    Re: testing array of logicals


    Janto Dreijer wrote:
    John Henry wrote:
    Simon Forman wrote:

    False not in logflags

    >
    Or, if your values aren't already bools
    >
    False not in (bool(n) for n in logflags)
    Very intriguing use of "not in"...
    >
    Is there a reason why you didn't write
    True in (bool(n) for n in logflags)
    <slaps foreheaddoh! Never mind.

    Comment

    • Simon Forman

      #17
      Re: testing array of logicals

      Janto Dreijer wrote:
      Janto Dreijer wrote:
      John Henry wrote:
      Simon Forman wrote:
      >
      False not in logflags
      >

      Or, if your values aren't already bools

      False not in (bool(n) for n in logflags)
      >
      Very intriguing use of "not in"...
      Is there a reason why you didn't write
      True in (bool(n) for n in logflags)
      >
      <slaps foreheaddoh! Never mind.
      *grin*

      Comment

      • H J van Rooyen

        #18
        Re: testing array of logicals


        "Janto Dreijer" <jantod@gmail.c omwrote:


        |
        | Janto Dreijer wrote:
        | John Henry wrote:
        | Simon Forman wrote:
        |
        | False not in logflags
        |
        | >
        | Or, if your values aren't already bools
        | >
        | False not in (bool(n) for n in logflags)
        |
        | Very intriguing use of "not in"...
        | >
        | Is there a reason why you didn't write
        | True in (bool(n) for n in logflags)
        |
        | <slaps foreheaddoh! Never mind.
        |

        *lol* - don't feel bad about this - real programmers make this mistake with a
        varying frequency -
        >From once every six days or so if you are no good, to once in a lifetime if
        you are brilliant, and never only if you are a genius...

        First time it bit me I was an apprentice writing in Cobol.

        - Hendrik


        Comment

        Working...