<blockquote>
<p>The only question is whether the semantics make any sense, as in whether returning nothing in the Python function should default to returning <code>FALSE</code> to Geany. The <a href="https://www.geany.org/manual/reference/keybindings_8h.html#afb2861d240a298186fe4d84430e5066f" rel="nofollow">API Reference</a> makes it sound like this is not the normal case.</p>
</blockquote>
<p>It's a good question, but it will always be better than the current situation that returns a more or less random value -- I'm not sure if it's undefined or implementation defined behavior, but GCC seems to return 0.<br>
In practice, this seems to lead to no change if the Python function doesn't return, but allows it to return a value that will be passed along.</p>
<p>If you want returning <code>True</code> as the default case, I'm not sure what the best solution is but maybe simply assuming <code>None</code> means <em>"didn't return a value"</em> might be good enough, as it's the default return value, and not a valid value for an explicit return.</p>
<blockquote>
<p>It may be useful in either case to improve <a href="https://github.com/geany/geany-plugins/pull/809/files#diff-8c19fc53e5ac665274c8ae6877c63a84L145">the doctstrings</a> to clarify this, as a separate change if need be.</p>
</blockquote>
<p>Yep, definitely.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/pull/809#issuecomment-451696211">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ1rNXIvtjStiZu1iWJotXYa59KFcks5vASU0gaJpZM4ZuLmn">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ61-5cktqXcZTJzWxi44vrTtJqHqks5vASU0gaJpZM4ZuLmn.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany-plugins","title":"geany/geany-plugins","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany-plugins"}},"updates":{"snippets":[{"icon":"PERSON","message":"@b4n in #809: \u003e The only question is whether the semantics make any sense, as in whether returning nothing in the Python function should default to returning `FALSE` to Geany. The [API Reference](https://www.geany.org/manual/reference/keybindings_8h.html#afb2861d240a298186fe4d84430e5066f) makes it sound like this is not the normal case.\r\n\r\nIt's a good question, but it will always be better than the current situation that returns a more or less random value -- I'm not sure if it's undefined or implementation defined behavior, but GCC seems to return 0.\r\nIn practice, this seems to lead to no change if the Python function doesn't return, but allows it to return a value that will be passed along.\r\n\r\nIf you want returning `True` as the default case, I'm not sure what the best solution is but maybe simply assuming `None` means *\"didn't return a value\"* might be good enough, as it's the default return value, and not a valid value for an explicit return.\r\n\r\n\u003e It may be useful in either case to improve [the doctstrings](https://github.com/geany/geany-plugins/pull/809/files#diff-8c19fc53e5ac665274c8ae6877c63a84L145) to clarify this, as a separate change if need be.\r\n\r\nYep, definitely."}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany-plugins/pull/809#issuecomment-451696211"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/pull/809#issuecomment-451696211",
"url": "https://github.com/geany/geany-plugins/pull/809#issuecomment-451696211",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>