1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

tests: mark methods is_bool and is_number as static

This commit is contained in:
Sébastien Helleu
2023-01-04 21:11:41 +01:00
parent 0ce0fa9f1f
commit d1f2d54a1e
+4 -2
View File
@@ -139,11 +139,13 @@ class UnparsePython(object):
result.append(value)
return result
def is_bool(self, node): # pylint: disable=no-self-use
@staticmethod
def is_bool(node):
"""Check if the node is a boolean."""
return isinstance(node, ast.Name) and node.id in ('False', 'True')
def is_number(self, node): # pylint: disable=no-self-use
@staticmethod
def is_number(node):
"""Check if the node is a number."""
return (isinstance(node, ast.Num) or
(isinstance(node, ast.UnaryOp) and