PythonistaGuild / TwitchIO

An Async Bot/API wrapper for Twitch made in Python.
https://twitchio.dev
MIT License
785 stars 163 forks source link

Fix invalid type hinting of initial_channels in WS Connection #461

Open junah201 opened 2 months ago

junah201 commented 2 months ago

Description

Resolve : #460

Checklist

junah201 commented 2 months ago

@chillymosh Thank you for your feedback

I corrected all other instances.

I just wonder if the tuple[type] in the code below is okay? I mainly use 3.10 version, so Im a little confused about what syntax is available in 3.8.

https://github.com/PythonistaGuild/TwitchIO/blob/8e91cecebb5278016ce6217886b892983a5632cb/twitchio/ext/commands/errors.py#L75-L81

IAmTomahawkx commented 2 months ago

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). tuple[...] is not valid in 3.7. You must use Tuple[...] using typing.Tuple.

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.