Type conversion using type hinting
Advertisements Say, I have a function that should do some internal stuff and display the provided text: def display_text(text: str): … print(text) There’s also a class with a convert() method: class String: def __init__(self, string: str): self.string = string def convert(self): return self.string Now, can you type hint text argument in display_text with String, but… Read More Type conversion using type hinting