CountFields/MaltsevAN
CountFields/Bangod
n1def fcounter(object, *args):n1def fcounter(class_name, *args):
2    method_list = [func for func in dir(object) if callable(2    cm = [field for field in dir(class_name) if
3          callable(getattr(class_name, field)) and not field.startswith('_')]
4 
5    cf = [field for field in dir(class_name) if not callable(
3        getattr(object, func)) and not func.startswith('_')]6        getattr(class_name, field)) and not field.startswith('_')]
4    fields_list = [func for func in dir(object) if not callable(7 
5        getattr(object, func)) and not func.startswith('_')]8    instance = class_name(*args)
6    class_instance = object(*args)9 
7    instance_method_list = [10    om = [field for field in dir(instance) if
8        func for func in dir(class_instance) if callable(11          callable(getattr(instance, field)) and
9            getattr(12          not field.startswith('_') and
10                class_instance,13          field not in cm]
11                func)) and not func.startswith('_') and func not in method_list]14 
12    instance_fields_list = [15    of = [field for field in dir(instance) if
13        func for func in dir(class_instance) if not callable(16          not callable(getattr(instance, field)) and
14            getattr(17          not field.startswith('_') and
15                class_instance,18          field not in cf]
16                func)) and not func.startswith('_') and func not in fields_list]19 
17    return method_list, fields_list, instance_method_list, instance_fields_list20    return cm, cf, om, of
21 
1822
19# class C:23# class C:
20#     x, y, z = 1, 3, 524#     x, y, z = 1, 3, 5
n21#n25 
22#     def X(self): return self.x26#     def X(self): return self.x
23#     def Y(self): return self.y27#     def Y(self): return self.y
n24#n28 
25#     def __init__(self, dx, dy, dz):29#     def __init__(self, dx, dy, dz):
26#         self.x = dx30#         self.x = dx
27#         self.Y = dy31#         self.Y = dy
28#         self.Z = dz32#         self.Z = dz
t29#t33 
34 
30# cm, cf, om, of = fcounter(C, 6, 7, 8)35# cm, cf, om, of = fcounter(C, 6, 7, 8)
31# print("Class: methods", *cm)36# print("Class: methods", *cm)
32# print("Class: fields", *cf)37# print("Class: fields", *cf)
33# print("Object: methods", *om)38# print("Object: methods", *om)
34# print("Object: fields", *of)39# print("Object: fields", *of)
3540
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op