forked from Pycord-Development/pycord
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
pyepPYcord Enhancement ProposalPYcord Enhancement Proposal
Milestone
Description
InvalidArgument currently duplicates behavior that is already covered by the built-in exceptions TypeError and ValueError. In most cases across the codebase, the situations where InvalidArgument is raised are either:
- Incorrect types → should be
TypeError - Incorrect values (but correct type) → should be
ValueError
Because Python already provides a clear semantic split here, InvalidArgument adds no meaningful benefit and instead introduces inconsistency in error patterns across the library.
Proposal
- Remove
InvalidArgument - Replace existing uses with the appropriate built-in exception (
TypeErrororValueErrordepending on context) - Update documentation and type hints accordingly
Benefits
- Aligns with standard Python exception semantics
- Improves clarity for users handling exceptions
- Reduces surface area of the public API
Copilot
Metadata
Metadata
Labels
pyepPYcord Enhancement ProposalPYcord Enhancement Proposal