libb.get_attrs

get_attrs(klazz)[source]

Get class attributes (excluding methods and dunders).

Parameters:

klazz (type) – Class to inspect.

Returns:

List of (name, value) tuples for class attributes.

Return type:

list

Example:

>>> class MyClass(object):
...     a = '12'
...     b = '34'
...     def myfunc(self):
...         return self.a
>>> get_attrs(MyClass)
[('a', '12'), ('b', '34')]