def cheap_date(dt_str, kw_list = [], reg_xp = r'\D', val_conv = int):
    """ Cheap incremental date parser preserving ISO microseconds

    dt_str:     String representing source date
           pass "2012-03-05 13:05:14.453728"
        returns [2012, 3, 5, 13, 5, 14, 453728]

      optional- ['2012', '03', '05', '13', '05', '14.453728']
        returns {'tm_year': 2012, 'tm_mday': 5, 'tm_mon': 3 ... }

    Optional arguments:

    kw_list:    Ordered list of return-dictionary keys
    reg_xp:     Regular expression used to split the string
    val_conv:   List-processor for data-conversion i.e. str --> int

    >>> cheap_date(TEST_DATE)
    [2012, 3, 5, 13, 5, 14, 453728]
    >>> cheap_date(TEST_DATE, ISO_KEYS[:3])
    {'t_mon': 3, 't_day': 5, 't_year': 2012}
    >>> FMT_STR2 % cheap_date(TEST_DATE, ISO_KEYS, val_conv = str)
    '13:05-03/05/2012'
    """
    # shake the numbers out with re ['2012', '03'...]
    tm_list = re.split(reg_xp, dt_str)
    
    # juice 'em: apply function to each list-value [2012, 03...]
    # you _could_ test if val_conv == str an omit this step
    tm_list = map(val_conv, tm_list)

    # Existence of this list, enables return of a dictionary
    if kw_list:
        # fabricate list of key-value pairs [['yr',2012],[....],]
        tm_list = zip(kw_list, tm_list)
        
        # map the key-val pairs into a dict to be proud of
        tm_list = dict(tm_list)
    
    return tm_list
 Cheap incremental date parser preserving ISO microseconds

    dt_str:     String representing source date
           pass "2012-03-05 13:05:14.453728"
        returns [2012, 3, 5, 13, 5, 14, 453728]

      optional- ['2012', '03', '05', '13', '05', '14.453728']
        returns {'tm_year': 2012, 'tm_mday': 5, 'tm_mon': 3 ... }

    Optional arguments:

    kw_list:    Ordered list of return-dictionary keys
    reg_xp:     Regular expression used to split the string
    val_conv:   List-processor for data-conversion i.e. str --> int

    >>> cheap_date(TEST_DATE)
    [2012, 3, 5, 13, 5, 14, 453728]
    >>> cheap_date(TEST_DATE, ISO_KEYS[:3])
    {'t_mon': 3, 't_day': 5, 't_year': 2012}
    >>> FMT_STR2 % cheap_date(TEST_DATE, ISO_KEYS, val_conv = str)
    '13:05-03/05/2012'
    
recipes/Python/578064_Cheapdate_trick_different_way/recipe-578064.py