If the intended purpose is to use `identity` if `None` is passed, we should explicitly check for `if f is None`, not ignore everything that is not callable.
In particular, strings containing the name of a callable are sometimes used in Pylearn2 (in yaml scripts for instance), which are resolved and used as callables. A user would expect this to work or raise an exception, not silently use `identity` instead.