Defining Multiple Constructors in Python

Publicado em: 13 Outubro 2022
no canal de: Real Python
2,831
68

Sometimes you need to write a Python class that provides multiple ways to construct objects. In other words, you want a class that implements multiple constructors. This kind of class comes in handy when you need to create instances using different types or numbers of arguments.

This is a portion of the complete course, which you can find here:
https://realpython.com/courses/multip...

The rest of the course covers how to:
Checking argument types
Writing multiple constructors using the built-in @classmethod decorator
Overloading your class constructors using the @singledispatchmethod decorator


Nesta página do site você pode assistir ao vídeo on-line Defining Multiple Constructors in Python duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Real Python 13 Outubro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 2,831 vezes e gostou 68 espectadores. Boa visualização!