Wrap inspect.classify_class_attrs, with fixup for data descriptors and bound methods.
(object)
| 311 | return not name.startswith('_') |
| 312 | |
| 313 | def classify_class_attrs(object): |
| 314 | """Wrap inspect.classify_class_attrs, with fixup for data descriptors and bound methods.""" |
| 315 | results = [] |
| 316 | for (name, kind, cls, value) in inspect.classify_class_attrs(object): |
| 317 | if inspect.isdatadescriptor(value): |
| 318 | kind = 'data descriptor' |
| 319 | if isinstance(value, property) and value.fset is None: |
| 320 | kind = 'readonly property' |
| 321 | elif kind == 'method' and _is_bound_method(value): |
| 322 | kind = 'static method' |
| 323 | results.append((name, kind, cls, value)) |
| 324 | return results |
| 325 | |
| 326 | def sort_attributes(attrs, object): |
| 327 | 'Sort the attrs list in-place by _fields and then alphabetically by name' |
no test coverage detected