mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
mark stubs for __bool__ and __nonzero__ as returning bool.
This commit is contained in:
@@ -542,6 +542,10 @@ class FunctionDef(BaseDef, FixWxPrefix):
|
||||
params.append(s)
|
||||
|
||||
self.pyArgsString = f"({', '.join(params)})"
|
||||
# __bool__ and __nonzero__ need to be defined as returning int for SIP, but for Python
|
||||
# __bool__ is required to return a bool:
|
||||
if (self.name or self.pyName) in ('__bool__', '__nonzero__'):
|
||||
returns = ['bool']
|
||||
if not returns:
|
||||
self.pyArgsString = f'{self.pyArgsString} -> None'
|
||||
elif len(returns) == 1:
|
||||
|
||||
Reference in New Issue
Block a user