all AI news
Python super() vs Base.__init__ Method
Jan. 8, 2024, 8:58 a.m. | Bhavani Ravi
DEV Community dev.to
When defining a subclass, there are different ways to call the __init__ method of a parent class. Let’s start with a base class and go through each of these methods.
For this blog, it’s better that you open a sample.py python file and follow along.
class Base(object):
def __init__ (self):
print "Base created"
Method 1 :: Using Parent Reference Directly
class ChildA(Base):
def __init__ (self):
Base. __init__ …
More from dev.to / DEV Community
Jobs in AI, ML, Big Data
Software Engineer for AI Training Data (School Specific)
@ G2i Inc | Remote
Software Engineer for AI Training Data (Python)
@ G2i Inc | Remote
Software Engineer for AI Training Data (Tier 2)
@ G2i Inc | Remote
Data Engineer
@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania
Artificial Intelligence – Bioinformatic Expert
@ University of Texas Medical Branch | Galveston, TX
Lead Developer (AI)
@ Cere Network | San Francisco, US