[Python-checkins] peps: PEP 501: Explicit note regarding prerendering templates

nick.coghlan python-checkins at python.org
Sun Aug 23 06:18:02 CEST 2015


https://hg.python.org/peps/rev/331fbc7ada74
changeset:   5982:331fbc7ada74
user:        Nick Coghlan <ncoghlan at gmail.com>
date:        Sun Aug 23 14:17:45 2015 +1000
summary:
  PEP 501: Explicit note regarding prerendering templates

files:
  pep-0501.txt |  11 +++++++++++
  1 files changed, 11 insertions(+), 0 deletions(-)


diff --git a/pep-0501.txt b/pep-0501.txt
--- a/pep-0501.txt
+++ b/pep-0501.txt
@@ -462,6 +462,17 @@
 such support can be readily added later, further consideration of binary
 interpolation is considered out of scope for the current PEP.
 
+Interoperability with str-only interfaces
+-----------------------------------------
+
+For interoperability with interfaces that only accept strings, interpolation
+templates can be prerendered with ``str``, rather than delegating the rendering
+to the called function.
+
+This reflects the key difference from PEP 498, which *always* eagerly applies]
+the default rendering, without any convenient way to decide to do something
+different.
+
 Preserving the raw template string
 ----------------------------------
 

-- 
Repository URL: https://hg.python.org/peps


More information about the Python-checkins mailing list