This lesson is from the Real Python video course by Darren Jones.
Using Python Class Constructors (Summary)
00:03 You now know how Python class constructors allow you to instantiate classes so you can create concrete and ready-to-use objects in your code. In Python, class constructors internally trigger the instantiation or construction process, which goes through instance creation and instance initialization.
00:21
These steps are driven by the .__new__()
and .__init__()
special methods. In this course, you learned how Python’s instantiation process works internally, how your own .__init__()
methods help you customize object initialization, and how overriding the .__new__()
method allows for custom object creation.
00:42 You’re now ready to take advantage of this knowledge to fine-tune your class constructors and take full control over instance creation and initialization in object-oriented Python programming. We hope you found this course useful, and we’ll see you again soon at realpython.com.
You must own this product to join the conversation.