Message56279
| Author |
draghuram |
| Recipients |
cjw296, draghuram, gvanrossum |
| Date |
2007年10月08日.14:47:55 |
| SpamBayes Score |
0.11937779 |
| Marked as misclassified |
No |
| Message-id |
<2c51ecee0710080747q20e7b5l5ba67fef9d53da03@mail.gmail.com> |
| In-reply-to |
<1191853954.3.0.774470947607.issue1243@psf.upfronthosting.co.za> |
| Content |
>
> 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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年10月08日 14:47:56 | draghuram | set | spambayes_score: 0.119378 -> 0.11937779 recipients:
+ draghuram, gvanrossum, cjw296 |
| 2007年10月08日 14:47:56 | draghuram | link | issue1243 messages |
| 2007年10月08日 14:47:55 | draghuram | create |
|