<table><tr><td style="">nalvarez created this revision.<br />nalvarez added a project: KDevelop.<br />Restricted Application added a subscriber: kdevelop-devel.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D5915" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>kdev-python was assuming boolean operator expressions like <tt style="background: #ebebeb; font-size: 13px;">foo or bar</tt> always returned <tt style="background: #ebebeb; font-size: 13px;">bool</tt>, but Python defines them to always return the value of either variable depending on whether the first one is false-like. Thus, <tt style="background: #ebebeb; font-size: 13px;">someString or "bar"</tt> should be interpreted as a string, not a boolean.</p>

<p>This commit makes such boolean operator expressions have a type of <tt style="background: #ebebeb; font-size: 13px;">unsure(type(foo), type(bar))</tt> instead. I also added new tests for this new behavior, and to ensure the good old <tt style="background: #ebebeb; font-size: 13px;">True or False</tt> is still interpreted as a <tt style="background: #ebebeb; font-size: 13px;">bool</tt>.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Added new unit tests, and ensured old ones don't fail. Tested in the IDE with a simple .py file.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R53 KDevelop: Python Support</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5915" rel="noreferrer">https://phabricator.kde.org/D5915</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>duchain/expressionvisitor.cpp<br />
duchain/tests/pyduchaintest.cpp</div></div></div><br /><div><strong>To: </strong>nalvarez, brauch<br /><strong>Cc: </strong>kdevelop-devel, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger<br /></div>