You still have to call shutdown. And if you do it there, you're going
to end up having weird code like this:
try:
import libaudioverse
except LibaudioverseError as e:
log_what_went_wrong(e)
Except I honestly have no idea how you catch specifically Libaudioverse
errors because the module wasn't imported, so you'd probably have to
catch anything.
99% of the time init is just going to work. The remaining 1% of the
time, you need to either put up a dialog or log it or something. Just
crashing isn't acceptable. Importing libaudioverse also happens before
you put logging in place, so you can't see what init decided to (or not
to) do.
No one is going to manage to convince me to kill the init function. No
one is going to convince me to make init implicitly happen if you
forget. The most I might do in this area is a context manager so that
your Python app can properly shutdown even if it crashes. I.e.:
with libaudioverse.InitializerManager():
#your main function here.
And of course the previously discussed error on a few functions. I
consider it to have been a problem previously, but it's not anymore.
Somehow, I didn't realize it's only 5 or 6 functions only. I thought it
would have to be all of them. If it had been, the cost might have been
too prohibitive for phones in future. People using the Python API on
desktop would have never noticed, but anyone trying to use the C++ API
on phones (when I do that) might have, especially since I'm already
thinking of ways to get rid of the locks and let you run Libaudioverse
as part of your main loop if you want.