One-liner to syntax check a Python script

It's always bothered me that PHP has php -l to do a quick syntax check of a file and there wasn't an equivalent in Python.

And then I came across this gem of a one-liner:

~~~~ {.python name="code"} python -c "compile(open('myapp.py').read(), 'myapp.py', 'exec')" wzxhzdk:0