Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server
http://dinnerbone.com/minecraft/tools/status/
1.11k stars 146 forks source link

Annotate alternative constructors with Self #205

Closed ItsDrike closed 2 years ago

ItsDrike commented 2 years ago

After an approval from discord, this PR uses the recently added Self type annotation from PEP 673, scheduled to be added into python in 3.11 to annotate alternative constructors easily without having to make individual type variables for each class that needs them just to support subclassing.

Even though this type annotation isn't yet in python's standard library, the typing_extensions package does already contain it and pyright type checker does already full support it.