@lower_cast(MyDummyType, types.Number)
def mydummy_to_number(context, builder, fromty, toty, val):
 return context.get_constant(toty, 42)

@ lower_cast ( MyDummyType , types . Number ) def mydummy_to_number ( context , builder , fromty , toty , val ) : return context . get_constant ( toty , 42 )
implicit conversion from mydummy to int .