-
-
Notifications
You must be signed in to change notification settings - Fork 480
fix: cleanup of 3.9 removal and preparation for 3.14 #2988
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
base: master
Are you sure you want to change the base?
Conversation
Replaced usage of typing_extensions with standard typing imports for TypedDict, ParamSpec, Concatenate, and related types where supported. Updated asyncio event loop initialization in Client to avoid deprecation warnings on Python 3.11+. Removed unused PY_310 constant and related conditional logic in utils.py.
|
Thanks for opening this pull request! This pull request can be checked-out with: git fetch origin pull/2988/head:pr-2988
git checkout pr-2988This pull request can be installed with: pip install git+https://github.com/Pycord-Development/pycord@refs/pull/2988/head |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the codebase by migrating from typing_extensions to the standard typing module for features that are now available in Python 3.10+. Since the project requires Python >= 3.10, these imports can be safely moved to the standard library. Additionally, the PR updates the event loop initialization in the Client class to avoid deprecation warnings in Python 3.11+.
Key changes:
- Migrated
TypedDict,ParamSpec,Concatenate,TypeGuard,Literal,Annotated,get_args, andget_originfromtyping_extensionstotyping - Removed Python 3.10 version checks and related code paths that are no longer needed
- Updated event loop initialization to use
asyncio.get_running_loop()with fallback toasyncio.new_event_loop()to avoid deprecation warnings
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| discord/utils.py | Migrated ParamSpec import; removed sys import, PY_310 version check, and Python < 3.10 code path for literal flattening |
| discord/types/*.py | Migrated TypedDict from typing_extensions to typing across multiple type definition files |
| discord/ext/commands/core.py | Migrated Concatenate, ParamSpec, and TypeGuard imports |
| discord/ext/commands/context.py | Migrated ParamSpec import |
| discord/commands/core.py | Removed sys import and Python 3.11 version check; migrated Annotated, Literal, get_args, get_origin, Concatenate, and ParamSpec imports |
| discord/commands/context.py | Migrated ParamSpec import and consolidated imports on single line |
| discord/client.py | Updated event loop initialization to avoid asyncio.get_event_loop() deprecation warning |
| discord/_version.py | Migrated TypedDict import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Lala Sabathil <[email protected]>
* Initial plan * Remove unused flatten_literal_params function Co-authored-by: Lulalaby <[email protected]> --------- Co-Authored-By: copilot-swe-agent[bot] <[email protected]> Co-Authored-By: Lulalaby <[email protected]>
5ddd192 to
e41a8b0
Compare
WIP
Depends on #2948