You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 22dfcb6
Browse filesBrowse the repository at this point in the historyBrowse files
✨ feat(argparse): add public group typing protocols
ArgumentParser.add_argument_group() and add_mutually_exclusive_group()
return objects whose only public name was the private _ArgumentGroup and
_MutuallyExclusiveGroup. Code that stores or passes these objects had no
public type to annotate against, forcing callers to reference the
underscore-prefixed implementation classes.
Expose them as structural protocols rather than aliasing the concrete
classes, so the implementation stays private and free to evolve while
callers get a stable contract to annotate against. The protocols are
built on first attribute access through the module __getattr__, keeping
typing off the import path: argparse sits on the start-up path of most
CLIs and does not otherwise import typing.
0 commit comments