I found the problem. I had this within a build system generating a Ruby extension. When I decided to add Python bindings, I just added a new (Xcode) target generating it just as I was doing for the Ruby extension. What I didn't realize was that swig also generates a module.py file with all the initialization code (unlike Ruby). Once I found that, I simply moved the generated python file along with the extension dynamic library file and imported it instead. It all works now.
I found that by actually creating the above myfoo code by hand (as opposed to running my build system, which ignored the extra myfoo.py file alltogether). Once I run swig by hand, I noticed it generated not only myfoo_wrapp.cpp but also myfoo.py.
Thanks for the effort. For future reference, this has nothing to do with directors (I'm not trying to create a two-way interface). It was simply not knowing about the extra python initialization code generated by swig.
Before:
myfoo.i
myfoo.h
myfoo.cpp
>swig -c++ -python myfoo.i
After:
myfoo.i
myfoo.h
myfoo.cpp
myfoo.py <== Missed this one
myfoo_wrap.cxx