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

Skip to content

fix error with Literal, causing tests/docs to fail #3764

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

Merged

Conversation

lemontree210
Copy link
Member

Fix test failure caused by introduction of Literal types.

@lemontree210 lemontree210 added bug 🐛 ⚙️ documentation affected functionality: documentation labels Jun 18, 2023
@lemontree210 lemontree210 requested a review from Bibo-Joshi June 18, 2023 09:50
@lemontree210 lemontree210 self-assigned this Jun 18, 2023
Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

docs successfully built locally for me

Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

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

Can you maybe extend the CSI comment about why Literal needs to be treated here as well?

@lemontree210
Copy link
Member Author

Can you maybe extend the CSI comment about why Literal needs to be treated here as well?

To me, it looks rather natural in this sequence and it might look a bit strange if I explain only the Literal bit:

(
            "<class 'typing._GenericAlias'>",
            "<class 'types.GenericAlias'>",
            "<class 'typing._LiteralGenericAlias'>",
        )

They're all Generic aliases.

OTOH, it's hard to imagine that we'll ever put a telegram class inside a literal. Something like:

Persistence = Literal["PicklePersistence", "DictPersistence"]

In this case, I could just create a separate condition for Literal and skip it altogether without even checking what's inside.

@Bibo-Joshi Bibo-Joshi merged commit 27a8683 into drop-py-37 Jun 19, 2023
@Bibo-Joshi Bibo-Joshi deleted the fix-admonition-inserter-after-adding-literals branch June 19, 2023 19:46
Seonzzang2 added a commit to Seonzzang2/python-telegram-bot that referenced this pull request Jun 20, 2023
@Bibo-Joshi Bibo-Joshi mentioned this pull request Jun 25, 2023
17 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2023
@Bibo-Joshi Bibo-Joshi added 🔌 bug pr description: bug and removed bug 🐛 labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔌 bug pr description: bug ⚙️ documentation affected functionality: documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants