Mhmm. Then maybe the "lambda" solution can be used. It is faster too as it avoids two isinstance() checks per call at least.