Customizing Python Object Creation with __new__ and __init__ — LearnFlat
⏱ 2 h 48 min 📚 28 aulas 🎧 Versão em áudio

Customizing Python Object Creation with __new__ and __init__

For Python developers ready to understand the lifecycle of class instances, allowing you to control object construction, initialization, and memory allocation.

  • 💬 Instrutor de IA
    Pergunte sobre qualquer aula e receba uma resposta clara na hora, quando quiser.
  • 🕐 Comece quando quiser
    Sem horários nem prazos: aprenda no seu ritmo, quando quiser.
  • 🌐 Em português
    Aulas, tarefas e certificado: tudo totalmente no seu idioma.

Sobre este curso

If you have worked with Python classes, you are familiar with the standard `__init__` method, but true object construction happens before that. Understanding the deep relationship between `__new__` and `__init__` is crucial for advanced object-oriented design. By completing this course, you will understand the fundamental mechanics of object instantiation, enabling you to override the creation process for specialized class behaviors, such as implementing singletons or customizing immutable types. What you'll learn: * Understand the distinction between object creation (`__new__`) and object initialization (`__init__`). * Analyze the order of operations when creating objects and how to manage arguments passed to the constructor. * Apply `__new__` to implement core design patterns like the Singleton pattern effectively. * Practice defining custom constructors that manage class attributes before initialization occurs. * Configure classes using modern Python type hints for constructor arguments and return types. * Master the proper usage of `super()` within both `__new__` and `__init__` across inheritance chains. The course begins by defining core object-oriented concepts and the standard instantiation workflow. We then dive into practical examples showing how to override default creation behaviors, concluding with best practices for writing readable and maintainable custom object creators. This course is designed for beginner to intermediate Python programmers who are comfortable with basic classes and want to deepen their understanding of the object model. No prior knowledge of overriding object creation methods is required. Start reading now to unlock the full potential of Python's class system.

O que você vai receber

  • 📜 Certificado de conclusão
    Adicione ao seu perfil do LinkedIn
  • 💬 Tutor AI pessoal
    Travou em uma aula? Pergunte ao seu tutor integrado qualquer coisa, a qualquer hora.
  • 🎧 Versão em áudio incluída
    Estude em qualquer lugar, sem tela
  • ♾️ Acesso vitalício
    Volte quando quiser, sem expirar
  • 📱 Celular ou computador
    Funciona em qualquer dispositivo
  • 💸 Reembolso em 14 dias
    Sem perguntas
  • ⚡ Curto e focado
    2 h 48 min de conteúdo prático

Avaliações

Ainda não há avaliações — seja o primeiro a compartilhar sua experiência.

Escrever uma avaliação

☆☆☆☆☆
Pediremos para fazer login após enviar — o rascunho fica salvo.

Perguntas frequentes

O que preciso para fazer este curso? +

Só um celular ou computador com internet. Sem instalações nem hardware especial.

Como faço para pagar? +

Com cartão via Stripe. Não guardamos dados do cartão — o Stripe processa com segurança.

Posso pedir reembolso? +

Sim — reembolso integral em 14 dias, sem perguntas.

Por quanto tempo terei acesso? +

Para sempre. Uma vez comprado, o curso é seu para revisar quando quiser.

Vou receber um certificado? +

Sim. Ao concluir, você recebe um certificado que pode adicionar ao seu perfil do LinkedIn.

Feito para profissionais em
Tecnologia Design Finanças Marketing Saúde Educação Hotelaria Indústria