#!/usr/bin/env python ###################################################################### # This module provides a means of converting a keyword argument list # to a dictionary. Thank you, "Internet Programming With Python". # # Mitch Chapman #--------------------------------------------------------------------- # $Log: KWDict.py,v $ # Revision 1.1 1996/12/01 22:58:54 mchapman # Initial revision # ###################################################################### __version__ = "$Revision: 1.1 $" ###################################################################### # Build a dictionary using keyword notation. Include only items # whose values are not None. ###################################################################### def dict(**kw): result = {} for k, v in kw.items(): if v != None: result[k] = v return result ###################################################################### # Main function for unit testing. ###################################################################### def main(): return if __name__ == "__main__": main()