Does python have built in type values?
Question: Not a typo. I mean type values. Values who's type is 'type'.

I want to write a confition to ask:

    
    
    if type(f) is a function : do_something()
    

Do I NEED to created a temporary function and do:

    
    
    if type(f) == type(any_function_name_here) : do_something()
    

or is that a built-in set of type types that I can use? Like this:

    
    
    if type(f) == functionT : do_something()
    


Answer: For functions you would usually check

    
    
    >>> callable(lambda: 0)
    True
    

to respect duck typing. However there is the `types` module:

    
    
    >>> import types
    >>> dir(types)
    ['BooleanType', 'BufferType', 'BuiltinFunctionType', 'BuiltinMethodType', 'ClassType', 'CodeType', 'ComplexType', 'DictProxyType', 'DictType', 'DictionaryType', 'EllipsisType', 'FileType', 'FloatType', 'FrameType', 'FunctionType', 'GeneratorType', 'GetSetDescriptorType', 'InstanceType', 'IntType', 'LambdaType', 'ListType', 'LongType', 'MemberDescriptorType', 'MethodType', 'ModuleType', 'NoneType', 'NotImplementedType', 'ObjectType', 'SliceType', 'StringType', 'StringTypes', 'TracebackType', 'TupleType', 'TypeType', 'UnboundMethodType', 'UnicodeType', 'XRangeType', '__builtins__', '__doc__', '__file__', '__name__', '__package__']
    

However you shouldn't check `type` equality, instead use `isinstance`

    
    
    >>> isinstance(lambda: 0, types.LambdaType)
    True
    

