Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust DistinctFlag.__call__ for python 3.12.3+ #1658

Closed
wants to merge 2 commits into from

Conversation

AstreaTSS
Copy link
Member

@AstreaTSS AstreaTSS commented Apr 17, 2024

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

On Python 3.12.3 onwards (specifically 3.12.3), a change to EnumType.__call__ messed up our own overriding of the same function at DistinctFlag.__call__, causing issues like those seen in #1657. This PR fixes that with version-specific code.

Changes

  • Make DistinctFlag.__call__ use a separate branch of code for 3.12.3+.
    • This code is forced to recreate the entirety of EnumType.__call__ due to a singleton that is not exported. This adds quite a burden to us, but hopefully it should be alright.
    • Versions before 3.12.3 should still use the same code as previously.

Related Issues

Fixes #1657.

Test Scenarios

import interactions
interactions.Intents(0)

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.12.3

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@AstreaTSS
Copy link
Member Author

Superceded by #1659.

@AstreaTSS AstreaTSS closed this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants