Raghuram Devarakonda added the comment: > > But what type should I specify? > > I was using a callback to get a datetime object as an option... >
If you are looking for a new type of option than what are already supported (string, int, long, choice, float and complex), you need to extend optparse (there is a section for that). I personally prefer a simple approach where the option value is taken as a string and any processing is done on the value to convert to what ever type of object one wants. For example, in this case, you can convert a string, say, 2007-10-8, internally to a datetime object. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1243> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com