Due to a change allowing Enums to have None as a value, the default value has changed to support this feature. However this has broken the DistinctFlag.__call__ used by interactions.py which explicity uses None as a name as the default making this a breaking change. By adjusting the function to not rely on a hard-coded default value we can support both a custom name as well as the new default while maintaining compatibility for old versions of python
Changes
Adjusted DistinctFlag.__call__ to call its super with kwargs that are previously defined based on the function call. If the default value is given, we throw them out, but if a non-default value is used, kwargs is filled with the `names parameter appropriately to be passed to the super
Related Issues
Fixes #1657
Test Scenarios
import interactions
interactions.Intents(0)
Python Compatibility
[X] I've ensured my code works on Python 3.10.x
[X] I've ensured my code works on Python 3.11.x
[X] I've ensured my code works on Python 3.12.x
Checklist
[X] I've run the pre-commit code linter over all edited files
[X] I've tested my changes on supported Python versions
[X] I've added tests for my code, if applicable
[X] I've updated / added documentation, where applicable
Pull Request Type
Description
Due to a change allowing Enums to have None as a value, the default value has changed to support this feature. However this has broken the
DistinctFlag.__call__
used by interactions.py which explicity uses None as a name as the default making this a breaking change. By adjusting the function to not rely on a hard-coded default value we can support both a custom name as well as the new default while maintaining compatibility for old versions of pythonChanges
Adjusted
DistinctFlag.__call__
to call its super with kwargs that are previously defined based on the function call. If the default value is given, we throw them out, but if a non-default value is used, kwargs is filled with the`names
parameter appropriately to be passed to the superRelated Issues
Fixes #1657
Test Scenarios
Python Compatibility
3.10.x
3.11.x
3.12.x
Checklist
pre-commit
code linter over all edited files