File: type_utils.py

package info (click to toggle)
crazy-complete 0.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 2,404 kB
  • sloc: python: 7,949; sh: 4,636; makefile: 74
file content (13 lines) | stat: -rw-r--r-- 249 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
'''Type utility functions.'''


def is_dict_type(obj):
    '''Return if `obj` is a dictionary type.'''

    return hasattr(obj, 'items')


def is_list_type(obj):
    '''Return if `obj` is list or tuple.'''

    return isinstance(obj, (list, tuple))