Implementing features directly in python

Hi,

I would like to add some features ( say a function foo() )
in gr-trellis that is not implemented in c++ but directly
in python. So in my programs when I do

from gnuradio import trellis

I would like to have access to

trellis.foo()

how do I do that?
in particular, where should the python file reside
and how should I change the Makefile.am file?
is there an example of this in gnuradio?

Thanks
Achilleas