Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix GameHighScore return in admonition #4414

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

Closed
harshil21 opened this issue Aug 3, 2024 · 3 comments · Fixed by #4462
Closed

Fix GameHighScore return in admonition #4414

harshil21 opened this issue Aug 3, 2024 · 3 comments · Fixed by #4462
Assignees
Labels
⚙️ documentation affected functionality: documentation
Milestone

Comments

@harshil21
Copy link
Member

Steps to Reproduce

  1. Check the docs for gamehighscore
  2. No returned in admonition present

Expected behaviour

It should show Returned in Bot.get_game_high_scores.

I propose refactoring the code of AdmonitionInserter._resolve_arg, since that is why this fails. I am unsure why typing.get_origin is used instead typing.get_args. Moreover, we can let python resolve forward refs, as we've done recently in test_official, which should reduce complexity.

Actual behaviour

Nothing shown.

Operating System

Agnostic

Version of Python, python-telegram-bot & dependencies

python-telegram-bot 21.4 (v21.4-13-g356a58ffd)
Bot API 7.8
Python 3.13.0b1 (main, May 10 2024, 23:59:20) [GCC 13.2.0]

Relevant log output

No response

Additional Context

No response

@harshil21 harshil21 added bug 🐛 ⚙️ documentation affected functionality: documentation labels Aug 3, 2024
@harshil21 harshil21 self-assigned this Aug 3, 2024
@Bibo-Joshi
Copy link
Member

Moreover, we can let python resolve forward refs, as we've done recently in test_official, which should reduce complexity.

Are you referring to

@functools.cache
def resolve_forward_refs_in_type(obj: type) -> type:
"""Resolves forward references in a type hint."""
return _eval_type(obj, localns=tg_objects, globalns=None)

? If so: I see that you're usign the protected function typing._eval_type. Is there a specific reason why you're not using a documented, public function here?

@harshil21
Copy link
Member Author

I had already started work on this, and no I did not use that function, but typing.get_type_hints instead.

@Bibo-Joshi
Copy link
Member

Ah, good to know, then I'll keep off :) Thanks for letting me know!
Still wondering about _eval_type in test official, but that's a different track, then :)

@Bibo-Joshi Bibo-Joshi changed the title [BUG] Fix GameHighScore return in admonition Fix GameHighScore return in admonition Nov 8, 2024
@Bibo-Joshi Bibo-Joshi added this to the v22.0 milestone Nov 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
⚙️ documentation affected functionality: documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants