Message148234
this is annoying:
i’m creating a reindentation script that reindents any valid python script. the user can specify if, and how many spaces he/she wants to use per indentation level. `0` or leaving the option out means “one tab per level”.
if the argument is given, appended code works as intended. but in the default case, the code fails for any of the two default values i tried.
i would expect that one of the default values works: either `0`, if the default value *is* converted via the `type` function, or `"\t"` if the default value bypasses it.
it seems that argparse applies the `type` function to the default instantly, and then to the argument (be it the already-converted default or a passed option).
this breaks `type` functions which aren’t reflexive for values from their result set, i.e.: `t(x) = y => t(y) = y` must be true for all `x` that the function can handle |
|
Date |
User |
Action |
Args |
2011-11-24 09:54:06 | flying sheep | set | recipients:
+ flying sheep, bethard, eric.araujo, arnau |
2011-11-24 09:54:06 | flying sheep | set | messageid: <1322128446.78.0.599369995243.issue12776@psf.upfronthosting.co.za> |
2011-11-24 09:54:06 | flying sheep | link | issue12776 messages |
2011-11-24 09:54:05 | flying sheep | create | |
|