News for hackers. Stuff that matters.
Re:True hacker resume: CV as Python unit test by masklinn on Thursday July 15, 2010 @06:00PM (#1519386)
> Putting the constant left in a conditional means you will never miss an accidental = instead of ==.

That's only useful for dumb languages

    >>> a = 5
    >>> if a = 3: print 'ok'; else: print 'nok'
      File "<stdin>", line 1
        if a = 3: print 'ok'; else: print 'nok'
             ^
    SyntaxError: invalid syntax
Python simply does not allow assignments in conditional contexts.
Re:True hacker resume: CV as Python unit test by moe on Thursday July 15, 2010 @06:12PM (#1519427)
Dumb is a strong word, young padawan.

The difference between theory and practice is smaller in theory than in practice.

Re:True hacker resume: CV as Python unit test by masklinn on Friday July 16, 2010 @01:49AM (#1520404)
> Dumb is a strong word, young padawan.

I carefully weighted my words, and I rest my case.

Re:True hacker resume: CV as Python unit test by 146 on Thursday July 15, 2010 @09:12PM (#1519850)
> That's only useful for dumb languages

The compilers/interpreters I know that don't do this are PHP and Perl (C/C++ will do it if you use -Wall, which you should be using anyway).

So yeah, you're pretty much right. /snark

Re:True hacker resume: CV as Python unit test by chromatic on Thursday July 15, 2010 @10:40PM (#1520029)
Perl does indeed warn about the use of = instead of == in a conditional.
Re:True hacker resume: CV as Python unit test by 146 on Friday July 16, 2010 @01:57PM (#1521894)
You're right; I didn't know about the -w setting. I guess that just leaves PHP.