Skip to content

Conversation

@marinelay
Copy link
Contributor

Close #4198
Fix type annotation of self._decrypted_secret from str to bytes

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.

Thanks for the PR! Just one question: Is the "# type: ignore" iin line 183 still necessary with your changes or can it be removed?

@marinelay
Copy link
Contributor Author

I think it is still necessary despite the change.
The type checker infers self.get_bot().private_key can be None, so it reports false alarm with the message "None does not have attribute 'private_key".
I used Pyright for this, but I believe that mypy is the same.

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.

Ah, right … Then let's merge. Thanks for the contribution!

@Bibo-Joshi Bibo-Joshi merged commit 58b8ef4 into python-telegram-bot:master Apr 13, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Type Hinting] EncryptedCredentials.decrypted_secret is not properly annotated

2 participants