-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Fix invalid type hinting of initial_channels in WS Connection #461
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the imports from the typing module instead of builtins. This version of TwitchIO has to support 3.8.
You have also removed the generic type of str
.
This can also be None so you can add None inside the Union too.
You should also correct all other instances of this in client.py and bot.py
initial_channels: Union[List[str], Tuple[str, ...], Callable[[], Union[List[str], Tuple[str, ...]]], None] = None,
@chillymosh Thank you for your feedback I corrected all other instances. I just wonder if the tuple[type] in the code below is okay? TwitchIO/twitchio/ext/commands/errors.py Lines 75 to 81 in 8e91cec
|
Our minimum supported version is 3.7, as such all changes should work on 3.7. You can download version 3.7 to verify these changes (or just tell pyright to use that version for type checking if using pyright, which is what we typically use). Also to note: Version 2.x of twitchio does not follow strict type checking. Typing is used as hints through the code, not as a source of truth. |
Description
Resolve : #460
Checklist