What code goes in __init__.py file to make it a python package | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What code goes in __init__.py file to make it a python package

I know, it can be blank. I assume that we can configure the package by putting some code in __init__.py. Any example of sample code in __init__.py file

1st Oct 2016, 12:49 PM
Rohit Kumar
1 Answer
+ 1
see the code of the collections' __init__.py to satisfy your curiosity : it actually imports a C file to work with Python. It is available by going to the docs and looking source code.
13th Nov 2016, 9:19 AM
Amaras A
Amaras A - avatar