title: Why do JSON queries return object if there is one element, list if more than one?
body: <p>I had to rewrite a python script from python2 to python 3 to solve  the encoding problems I had the easiest way. I had to move from mysqldb to pymysql which seemed to use same syntax. I accessed the pymysql's github[1] site and following examples I noticed that when query result was one element it returned a JSON object but when it returns more than one, it returns a list. </p>
  
  <p>Wouldn't it be more consistent to return always a list with 0, 1 or whichever number of elements? Why is it done this way? </p>
  
  <p>Note: to avoid this behavior in pymysql just remove the cursorclass parameter from:</p>
  
  <pre><code># Connect to the database
  connection = pymysql.connect(host='localhost',user='user',
  passwd='passwd', db='db', charset='utf8mb4',
  cursorclass=pymysql.cursors.DictCursor)
  </code></pre>
  
  <p>[1] <a href="https://github.com/PyMySQL/PyMySQL/">https://github.com/PyMySQL/PyMySQL/</a></p>