Skip to content

chore: Update old Optional syntax to use new type | None syntax - #3407

Open
ToothyDev wants to merge 7 commits into
chore/update-union-syntaxfrom
chore/update-optionals-syntax
Open

ToothyDev wants to merge 7 commits into
chore/update-union-syntaxfrom
chore/update-optionals-syntax

Conversation

@ToothyDev

Copy link
Copy Markdown
Contributor

This will make None clickable in the docs and lead to the python docs

Summary

This PR updates the "old" Optional[...] syntax to use the new type | None syntax, primarily affecting docstrings.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).
  • Non-breaking code change that doesn't really add or remove anything :)

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • I have read the Contributing Guidelines.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

This will make None clickable in the docs and lead to the python docs
@ToothyDev
ToothyDev added this pull request to stack #3408 October 10, 2026 19:59
@ToothyDev ToothyDev added the typing Is related to / changes python typing label Oct 10, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Pycord Oct 10, 2026
@pycord-app

pycord-app Bot commented Oct 10, 2026

Copy link
Copy Markdown

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3407/head:pr-3407
git checkout pr-3407

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3407/head

@ToothyDev ToothyDev changed the title chore: Update old None-types to use correct syntax chore: Update old Optional-types to use new type | None syntax Oct 10, 2026
@ToothyDev
ToothyDev marked this pull request as ready for review October 11, 2026 10:16
@ToothyDev
ToothyDev requested a review from a team as a code owner October 11, 2026 10:17
@ToothyDev ToothyDev changed the title chore: Update old Optional-types to use new type | None syntax chore: Update old Optional syntax to use new type | None syntax Oct 11, 2026

@vmphase vmphase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a disaster to review with some many changes done.
All problems tend to be CTRL + SHIFT + F global replace because they're repetitive.

Comment thread discord/channel.py Outdated
Comment thread discord/channel.py Outdated
Comment thread discord/channel.py Outdated
Comment thread discord/channel.py Outdated
Comment thread discord/guild.py Outdated
Comment thread discord/channel.py Outdated
Comment thread discord/ext/pages/pagination.py Outdated
Comment thread discord/ext/pages/pagination.py Outdated
Comment thread discord/emoji.py Outdated
Comment thread discord/player.py Outdated
Comment thread discord/utils.py Outdated
Comment thread discord/commands/options.py Outdated
Comment thread discord/channel.py Outdated
ToothyDev and others added 2 commits October 12, 2026 12:51
Co-authored-by: Michael <8661717+sgtlaggy@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typing Is related to / changes python typing

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants