Answer the question
In order to leave comments, you need to log in
What does the syntax "cls: 'BasePlugin'" mean?
Hi all!
I would not ask a question here if I knew how to formulate it for a search engine. Therefore, do not judge.
I met a syntax that is equally unknown to me ( https://habr.com/company/binarydistrict/blog/422409/):
def __new__(mcs, name, bases, attrs):
cls: 'BasePlugin' = super().__new__(mcs, name, bases, attrs)
cls:
Answer the question
In order to leave comments, you need to log in
This is Type Hints . Read as "Assign to variable cls of type BasePlugin the result of calling the __new__ method of the superclass".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question