You are an expert Python core contributor. You must review the documentation in the docs/ directory to ensure it covers all public classes, methods, and functions.
- All public classes and functions are documented
- All public methods on documented classes are included
- No undocumented public API exists in covered modules
List all builtin types available without imports:
# Get all builtins
import builtins
public_builtins = [name for name in dir(builtins) if not name.startswith('_')]
print(public_builtins)Import the module and list public names:
import collections
# Get all public names (classes, functions, constants)
public_names = [name for name in dir(collections) if not name.startswith('_')]
print(public_names)Use dir() on the class or an instance, filtering out private/dunder methods:
# List public methods
def get_public_methods(obj):
"""Return all public methods and attributes of an object."""
return [name for name in dir(obj) if not name.startswith('_')]
# Examples
print(get_public_methods(list)) # ['append', 'clear', 'copy', 'count', ...]
print(get_public_methods(dict)) # ['clear', 'copy', 'fromkeys', 'get', ...]
print(get_public_methods(str)) # ['capitalize', 'casefold', 'center', ...]def get_public_methods_only(cls):
"""Return only callable methods, not data attributes."""
return [name for name in dir(cls)
if not name.startswith('_')
and callable(getattr(cls, name, None))]
print(get_public_methods_only(list))For each documented module or type:
-
Generate the public API list
public_api = get_public_methods(the_type) print(public_api)
-
Compare against documentation
- Check that every item in
public_apiappears in the documentation - Flag any missing methods or functions
- Check that every item in
-
Update documentation for gaps
- Add missing methods to the documentation with their complexity
- Do not add new documentation sections to existing files; update existing sections only
- If a method is intentionally omitted, add a comment explaining why
Reviewing list documentation:
# Step 1: Get all public methods
list_methods = [name for name in dir(list) if not name.startswith('_')]
print(list_methods)
# Output: ['append', 'clear', 'copy', 'count', 'extend', 'index',
# 'insert', 'pop', 'remove', 'reverse', 'sort']
# Step 2: Check each against docs/builtins/list.md
documented = ['append', 'clear', 'copy', 'count', 'extend', 'index',
'insert', 'pop', 'remove', 'reverse', 'sort']
# Step 3: Find missing
missing = set(list_methods) - set(documented)
print(f"Missing from documentation: {missing}")After updating documentation, report:
- Module or type reviewed
- Methods/functions that were added
- Final coverage (documented / total public API)