]> granicus.if.org Git - python/commitdiff
Add an example
authorRaymond Hettinger <python@rcn.com>
Sun, 5 Sep 2010 05:56:44 +0000 (05:56 +0000)
committerRaymond Hettinger <python@rcn.com>
Sun, 5 Sep 2010 05:56:44 +0000 (05:56 +0000)
Doc/whatsnew/3.2.rst

index 48c0c587fdbf1a2747022c3b8f69769d1c3732bf..26bac21ae08f66450e83b163b8aad6cea8b29385 100644 (file)
@@ -154,7 +154,12 @@ Some smaller changes made to the core Python language are:
 * The :func:`str` of a float or complex number is now the same as it
   :func:`repr`. Previously, the :func:`str` form was shorter but that just
   caused confusion and is no longer needed now that we the shortest possible
-  :func:`repr` is displayed by default.
+  :func:`repr` is displayed by default::
+
+   >>> repr(math.pi)
+   '3.141592653589793'
+   >>> str(math.pi)
+   '3.141592653589793'
 
   (Proposed and implemented by Mark Dickinson; :issue:`9337`).