<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: joakimRN</title>
    <description>The latest articles on DEV Community by joakimRN (@belfinwe).</description>
    <link>https://dev.to/belfinwe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F273404%2F91c9bc36-2d2d-4b30-a110-068e15016678.png</url>
      <title>DEV Community: joakimRN</title>
      <link>https://dev.to/belfinwe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/belfinwe"/>
    <language>en</language>
    <item>
      <title>Best practice for Python returns</title>
      <dc:creator>joakimRN</dc:creator>
      <pubDate>Fri, 13 Dec 2019 21:17:07 +0000</pubDate>
      <link>https://dev.to/belfinwe/best-practice-for-python-returns-4bii</link>
      <guid>https://dev.to/belfinwe/best-practice-for-python-returns-4bii</guid>
      <description>&lt;p&gt;Hi.&lt;br&gt;
I have a function that should return the result of a query.&lt;br&gt;
It works, but my question is related to what is the best practise.&lt;/p&gt;

&lt;p&gt;The return value in this case is a response object from an API, that contains a value which indicate whether the query failed or not. The first question then is, should I have my function return the result of the query as it is?&lt;/p&gt;

&lt;p&gt;For the cases where the return object says nothing about how the execution of the function went, should it also return a boolean to indicate if things went as it should?&lt;/p&gt;

&lt;p&gt;And lastly, if I would need to return more than one variable, should they be returned as a tuple, a dictionary, or in some other way?&lt;/p&gt;

&lt;p&gt;I haven't been programming with Python for long. I know a bit, but I lack a lot of knowledge about how to write good/nice code.&lt;/p&gt;

</description>
      <category>python</category>
      <category>help</category>
    </item>
  </channel>
</rss>
