what does "()" syntax mean in python
<p>I am learning Exception Handling in python and came across following code snippet : an exception class:</p>

<pre><code>from flask import jsonify

class InvalidUsage(Exception):
    status_code = 400

    def __init__(self, message, status_code=None, payload=None):
        Exception.__init__(self)
        self.message = message
        if status_code is not None:
            self.status_code = status_code
        self.payload = payload

    def to_dict(self):
        rv = dict(self.payload or ())
        rv['message'] = self.message
        return rv
</code></pre>

<p>In this code, what does this line actually mean</p>

<pre><code>rv = dict(self.payload or ())
</code></pre>

<p>inside <code>to_dict</code> method? What does <code>()</code> stand for?</p>

<p>From python shell:</p>

<pre><code>&gt;&gt;&gt; type(())
&lt;type 'tuple'&gt;
</code></pre>

<p>So it's a <a href="https://docs.python.org/2/library/functions.html?highlight=tuple#tuple" rel="nofollow">tuple</a>.</p>

python