Converting a string to the most probable type
John Machin
sjmachin at lexicon.net
Fri Mar 7 20:09:37 EST 2008
On Mar 8, 11:13 am, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> Pierre Quentel <quentel.pie... at wanadoo.fr> writes:
> > I would like to know if there is a module that converts a string to a
> > value of the "most probable type"
>
> Python 2.4.4 (#1, Oct 23 2006, 13:58:00)
> >>> import this
> The Zen of Python, by Tim Peters
> ...
> In the face of ambiguity, refuse the temptation to guess.
Reminds me of the story about the avionics software for a fighter
plane which when faced with the situation of being exactly upside-down
refused to guess whether it should initiate a left roll or a right
roll :-)
More information about the Python-list
mailing list