What does the syntax "cls: 'BasePlugin'"?

Hi all!

I wouldn't be asking the question here, if I knew how to write for search engine. So do not blame me.

Met equal unknown syntax (https://habr.com/company/binarydistrict/blog/422409/):

def __new__(mcs, name, bases, attrs): 
 cls: 'BasePlugin' = super().__new__(mcs, name, bases, attrs)

The second line is incomprehensible to part with the cls:

Please suggest what it is.
March 12th 20 at 08:00
1 answer
March 12th 20 at 08:02
This Type Hints. Read as "assign to a variable cls of type BasePlugin the result of a method call __new__ of superclass".
The first time I see that the abstract types declared in the definition. Interesting. Thank you! - Luella_Hickle commented on March 12th 20 at 08:05

Find more questions by tags Python