import io, _pyio obs = {name : getattr(_pyio, name) for name in _pyio.__all__} classes = {name : ob for name, ob in obs.items() if isinstance(ob, type)} not_api = {'__weakref__', '__dict__', '__del__', '__module__', '__abstractmethods__'} def valid_api_name(s): return (not s.startswith('_') or s.endswith('__') and s not in not_api) for name, cls in classes.items(): ccls = getattr(io, name) missing = set(dir(cls)) - set(dir(ccls)) missing = [s for s in missing if valid_api_name(s)] if missing: print(name, 'C is missing:', missing) missing = set(dir(ccls)) - set(dir(cls)) missing = [s for s in missing if valid_api_name(s)] if missing: print(name, 'python is missing:', missing)