Rename this file between md-rst-test.rst and md-rst-test.md to see the respective versions.
EDIT: This doesn't work. See my comment below.
Example syntax-highlighted Python code using a reStructuredText 0.9 directive:
def foo():
return 'bar'
Example syntax-highlighted Python code using a Markdown codeblock:
return 'bar'
After much experimenting, I determined that it is impossible to make a file have Python syntax highlighting in either rst or md such that simply renaming the file's extension will make either version work.