diff --git a/README.md b/README.md index 6867313..d8962ad 100644 --- a/README.md +++ b/README.md @@ -418,9 +418,9 @@ Format ### Strings **`'!r'` calls object's [repr()](#class) method, instead of [str()](#class), to get a string.** ```python -{'abcde'!r:<10} # "'abcde' " -{'abcde':.3} # 'abc' +{'abcde'!r:10} # "'abcde' " {'abcde':10.3} # 'abc ' +{'abcde':.3} # 'abc' ``` ### Numbers diff --git a/index.html b/index.html index 1d3d215..bd6eabd 100644 --- a/index.html +++ b/index.html @@ -510,9 +510,9 @@ to_exclusive = <range>.stop <pre><code class="python language-python hljs">{<el>:.<<span class="hljs-number">10</span>} <span class="hljs-comment"># '<el>......'</span> {<el>:<<span class="hljs-number">0</span>} <span class="hljs-comment"># '<el>'</span> </code></pre> -<div><h3 id="strings">Strings</h3><p><strong><code class="python hljs"><span class="hljs-string">'!r'</span></code> calls object's <a href="#class">repr()</a> method, instead of <a href="#class">str()</a>, to get a string.</strong></p><pre><code class="python language-python hljs">{<span class="hljs-string">'abcde'</span>!r:<<span class="hljs-number">10</span>} <span class="hljs-comment"># "'abcde' "</span> -{<span class="hljs-string">'abcde'</span>:<span class="hljs-number">.3</span>} <span class="hljs-comment"># 'abc'</span> +<div><h3 id="strings">Strings</h3><p><strong><code class="python hljs"><span class="hljs-string">'!r'</span></code> calls object's <a href="#class">repr()</a> method, instead of <a href="#class">str()</a>, to get a string.</strong></p><pre><code class="python language-python hljs">{<span class="hljs-string">'abcde'</span>!r:<span class="hljs-number">10</span>} <span class="hljs-comment"># "'abcde' "</span> {<span class="hljs-string">'abcde'</span>:<span class="hljs-number">10.3</span>} <span class="hljs-comment"># 'abc '</span> +{<span class="hljs-string">'abcde'</span>:<span class="hljs-number">.3</span>} <span class="hljs-comment"># 'abc'</span> </code></pre></div>