Python Forum
Do packages really require "__init__.py" ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Do packages really require "__init__.py" ?
#2
I means that Python knows that it is a package even if the file "__init__.py" does not exist.
Sooner or later you will run into an issue where an import cannot be located, and your software will fail.
You can wait for that to happen, or buy some insurance by creating the __init__.py files.
Personally, I always create them.
Reply


Messages In This Thread
RE: Do packages really require "__init__.py" ? - by Larz60+ - Feb-14-2019, 09:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why doesn't list require global keyword? johnywhy 9 920 Jan-15-2024, 11:47 PM
Last Post: sgrey
  Pattern Require Last Line Print() why? Harshil 4 2,465 Aug-08-2020, 04:54 PM
Last Post: Harshil
  Require Some Suggestions gouravlal 2 1,906 Jul-27-2020, 06:14 AM
Last Post: gouravlal
  Do you require imports used in other files? Panda 1 2,533 Jul-14-2018, 02:30 PM
Last Post: gontajones
  Why does function print require bracket for text? richardm55 2 3,013 May-23-2018, 07:30 PM
Last Post: buran
  I Require some help for project idea...FaceRecognizer Door actived JavierGTZ 0 2,503 Aug-18-2017, 04:45 PM
Last Post: JavierGTZ
  Why is there an __init__ statement within the __init__ definition iFunKtion 7 6,085 Feb-06-2017, 07:31 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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