Converting a string to the most probable type

John Machin sjmachin at lexicon.net
Mon Mar 10 17:09:34 EDT 2008


On Mar 11, 2:24 am, rockingred <willsteve2... at yahoo.ca> wrote:
>
> In the case where dots are used as a date separator, count the number
> of dots (you should also count commas).  If a single comma appears and
> is preceeded by only numbers or numbers with decimals, assume "foreign
> float".

Bzzzzt. 1,234 is the integer 1234 to John, and its only a float to
Jean if Jean is not a Scots lass :-)




More information about the Python-list mailing list