Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Widen specified type forallowed_updates Application/Updater parameter#4589

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Bibo-Joshi merged 2 commits intopython-telegram-bot:masterfromnemacysts:master
Dec 4, 2024

Conversation

nemacysts
Copy link
Contributor

@nemacystsnemacysts commentedDec 4, 2024
edited
Loading

This parameter has been inconsistently typed as either list[str] or tuple[str] - as either is acceptable, we can widen the type to Sequence[str] to satisfymypy and/or other type checkers.

This will allow for constructs like:

application.run_polling(allowed_updates=(UpdateType.MESSAGE,UpdateType.EDITED_MESSAGE,    ))

which currently fails mypy (and likely other typecheckers) with an error like:
error: Argument "allowed_updates" to "run_polling" of "Application" hasincompatible type "tuple[UpdateType, UpdateType]"; expected "list[str] | None" [arg-type]

  • run pre-commit
  • run tests
  • add self to AUTHORS.rst
  • add versionchanged to existing docstrings

This parameter has been inconsistently typed as either list[str] ortuple[str] - as either is acceptable, we can widen the type toSequence[str] to satisfy `mypy` and/or other type checkers.This will allow for constructs like:```Pythonapplication.run_polling(    allowed_updates=(        UpdateType.MESSAGE,        UpdateType.EDITED_MESSAGE,    ))```which currently fails mypy (and likely other typecheckers) with an errorlike:`error: Argument "allowed_updates" to "run_polling" of "Application" hasincompatible type "tuple[UpdateType, UpdateType]"; expected "list[str] | None"  [arg-type]`
@nemacysts
Copy link
ContributorAuthor

looks likeUnit Tests / pytest (3.10, ubuntu-latest) is failing to report coverage witherror - 2024-12-04 05:33:48,773 -- Report creating failed: {"message":"Token required because branch is protected"} - however, the actual test stage seems to have passed all tests :)

Copy link
Member

@harshil21harshil21 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

nemacysts reacted with hooray emoji
@Bibo-JoshiBibo-Joshi added ⚙️ type-hintingaffected functionality: type-hinting 🔌 enhancementpr description: enhancement labelsDec 4, 2024
@Bibo-JoshiBibo-Joshi merged commiteda2172 intopython-telegram-bot:masterDec 4, 2024
21 of 22 checks passed
@Bibo-Joshi
Copy link
Member

Thank you for the contribution!

nemacysts reacted with hooray emoji

cuevasrja pushed a commit to USB-CI3715/python-telegram-bot that referenced this pull requestDec 9, 2024
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsDec 12, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@harshil21harshil21harshil21 approved these changes

Assignees
No one assigned
Labels
🔌 enhancementpr description: enhancement⚙️ type-hintingaffected functionality: type-hinting
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@nemacysts@Bibo-Joshi@harshil21

[8]ページ先頭

©2009-2025 Movatter.jp