Python Forum
pygame why init() & not __init__()?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pygame why init() & not __init__()?
#1
Why does Pygame use init() to initialize all imported modules instead of __init__()?
What's the difference between init() and __init__()?
Reply
#2
init() is regular function, just as any other.
__init__() is a special function, part of a set of functions (so called dunders, from double-undercore) that are used to customize your own classes. In the case __init__() is called at class instantiation.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pygame.mixer.init() devicename issue wanhr 2 4,805 Sep-15-2019, 09:08 AM
Last Post: wanhr
  pygame.init help raichu4vuhs 2 5,926 May-18-2017, 08:33 PM
Last Post: kennybassett

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020