Just some misc formatting. Do I even need a review on style nits?
---
bindings/python/clang/cindex.py | 22 +++++++++++-----------
bindings/python/tests/cindex/test_type.py | 3 +++
2 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/bindings/python/clang/cindex.py b/bindings/python/clang/cindex.py
index 991a6b1..d7904ae 100644
--- a/bindings/python/clang/cindex.py
+++ b/bindings/python/clang/cindex.py
@@ -1215,36 +1215,36 @@ class Type(Structure):
ways a specific type can be represented. The canonical type
is the underlying type with all the "sugar" removed. For
example, if 'T' is a typedef for 'int', the canonical type for
'T' would be 'int'.
"""
return Type_get_canonical(self)
def is_const_qualified(self):
- """
- Determine whether a Type has the "const" qualifier set,
- without looking through typedefs that may have added "const"
+ """Determine whether a Type has the "const" qualifier set.
+
+ This does not look through typedefs that may have added "const"
at a different level.
"""
return Type_is_const_qualified(self)
def is_volatile_qualified(self):
- """
- Determine whether a Type has the "volatile" qualifier set,
- without looking through typedefs that may have added
- "volatile" at a different level.
+ """Determine whether a Type has the "volatile" qualifier set.
+
+ This does not look through typedefs that may have added "volatile"
+ at a different level.
"""
return Type_is_volatile_qualified(self)
def is_restrict_qualified(self):
- """
- Determine whether a Type has the "restrict" qualifier set,
- without looking through typedefs that may have added
- "restrict" at a different level.
+ """Determine whether a Type has the "restrict" qualifier set.
+
+ This does not look through typedefs that may have added "restrict" at
+ a different level.
"""
return Type_is_restrict_qualified(self)
def is_function_variadic(self):
"""Determine whether this function Type is a variadic function type."""
assert self.kind == TypeKind.FUNCTIONPROTO
return Type_is_variadic(self)
diff --git a/bindings/python/tests/cindex/test_type.py b/bindings/python/tests/cindex/test_type.py
index e7d3f30..cf24bd6 100644
--- a/bindings/python/tests/cindex/test_type.py
+++ b/bindings/python/tests/cindex/test_type.py
@@ -192,16 +192,17 @@ def test_arguments_invalid_type():
"""Ensure that obtaining arguments on a type without them raises."""
tu = get_tu('int i;')
i = get_cursor(tu, 'i')
ok_(i is not None)
i.type.arguments()
def test_is_pod():
+ """Ensure Type.is_pod() works."""
index = Index.create()
tu = index.parse('t.c', unsaved_files=[('t.c', 'int i; void f();')])
assert tu is not None
i, f = None, None
for cursor in tu.cursor.get_children():
if cursor.spelling == 'i':
i = cursor
@@ -235,16 +236,17 @@ void bar(int a, int b);
ok_(foo is not None)
ok_(bar is not None)
ok_(isinstance(foo.type.is_function_variadic(), bool))
ok_(foo.type.is_function_variadic())
ok_(not bar.type.is_function_variadic())
def test_element_type():
+ """Ensure Type.element_type works."""
index = Index.create()
tu = index.parse('t.c', unsaved_files=[('t.c', 'int i[5];')])
assert tu is not None
for cursor in tu.cursor.get_children():
if cursor.spelling == 'i':
i = cursor
break
@@ -263,16 +265,17 @@ def test_invalid_element_type():
if cursor.spelling == 'i':
i = cursor
break
ok_(i is not None)
i.element_type
def test_element_count():
+ """Ensure Type.element_count works."""
index = Index.create()
tu = index.parse('t.c', unsaved_files=[('t.c', 'int i[5]; int j;')])
assert tu is not None
for cursor in tu.cursor.get_children():
if cursor.spelling == 'i':
i = cursor
elif cursor.spelling == 'j':
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits