Exemple #1
0
def property_record(iterable=()):
    """ Convert a dictionary-like iterable into a :class:`.Record`
    by sorting keys and dropping all values that are :const:`.None`.
    """
    return Record(
        sorted((key, value) for key, value in iter_items(iterable)
               if value is not None))
Exemple #2
0
 def __new__(cls, iterable=()):
     keys = []
     values = []
     for key, value in iter_items(iterable):
         keys.append(key)
         values.append(value)
     inst = tuple.__new__(cls, values)
     inst.__keys = tuple(keys)
     return inst
def property_record(iterable=()):
    """ Convert a dictionary-like iterable into a :class:`.Record`
    by sorting keys and dropping all values that are :const:`.None`.
    """
    keys = []
    values = []
    for key, value in iter_items(iterable):
        if value is not None:
            keys.append(key)
            values.append(value)
    return Record(keys, values)