Python function definition
<pre><code>def CsMatrix(X not None):
</code></pre>

<p>I meet this piece of code. For <strong><em>X not None</em></strong>, I haven't met this kind of syntax? So I write my test code:</p>

<pre><code>def test(x not None):

    pass
</code></pre>

<p>However, I got SyntaxError: invalid syntax.
Can anyone explain this syntax?</p>

<p>That's not valid syntax neither for <a href="https://docs.python.org/2.0/ref/function.html" rel="nofollow">python 2.x</a> nor <a href="http://www.python-course.eu/python3_functions.php" rel="nofollow">python 3.x</a>, maybe you wanted to declare your function with a <code>None</code> default value, something like this:</p>

<pre><code>def CsMatrix(X = None):
    if X is None:
        print("Yeah, I'm None")

CsMatrix()
</code></pre>

python