Can you use isinstance()?
isinstance(sin, int)
will eval to true or false.
isinstance(object_instance, object_type)
might work for the other objects you want to evaluate as well.
Your checking of 'f' or 'm' is a bit different since you're comparing data rather than type. Not sure if you can get around that way of checking data.
Hope that helps.