[Python-Dev] argparse ugliness
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun Mar 7 00:28:17 CET 2010
Antoine Pitrou wrote:
> I would argue that a string is actually more Pythonic than
> integers or anonymous objects repurposed as magic constants.
> (I'm looking at things such as SEEK_SET and friends)
Strings are certainly preferable to ints, one reason being that
they display as something meaningful in debugging output.
But it also doesn't hurt to export named constants for them,
in the interests of catching typos.
--
Greg
More information about the Python-Dev
mailing list