constructor call
A call that creates a new object, written as the type or class name used like a function, such as list(), set("abc") or Point(1, 2).
In more detail
Built-in constructors also convert: int("7"), str(7), list("abc"). Calling your own class runs its __init__ method to set up the new instance.
Related terms
- class — A blueprint in code that bundles data and the functions that work on it, from which objects are made.
- __init__ — The dunder method Python calls to set up a newly created instance, receiving the arguments passed to the class.
- type conversion — Turning a value of one type into another, such as the string "23" into the integer 23.
Taught in
- Appending To Lists, Sets, Constructors — Hands-on Python: Complete Video Course & Book
- A Graphics Introduction — Hands-on Python: Complete Video Course & Book
- Sample Graphics Programs — Hands-on Python: Complete Video Course & Book
- Chapter Two In One Sitting — Hands-on Python: Complete Video Course & Book