Allow key to be a callable