automatically convert string to appropriate type : <p>I am trying to find a function to have python automatically convert a string to the "simplest" type. Some examples:</p>

<pre><code>conversion_function("54") -&gt; returns an int 54
conversion_function("6.34") -&gt; returns a float 6.34
conversion_function("False") -&gt; returns a boolean False
conversion_function("text") -&gt; returns a str "text"
</code></pre>

<p>R has a function called <a href="https://stat.ethz.ch/R-manual/R-devel/library/utils/html/type.convert.html" rel="nofollow noreferrer">type.convert</a> that does this. What is the way to do this in python? Is there an existing function or does one need to create a custom one?</p>
