A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/048581.html below:

[Python-Dev] Alternative Implementation for PEP 292:SimpleString Substitutions

[Python-Dev] Alternative Implementation for PEP 292:SimpleString Substitutions [Python-Dev] Alternative Implementation for PEP 292:SimpleString SubstitutionsRaymond Hettinger raymond.hettinger at verizon.net
Fri Sep 3 20:51:52 CEST 2004
> > By not inheriting from unicode, the bug can be fixed while retaining
a
> > class implementation (see sandbox\curry292.py for an example).
> >
> > But, be clear, it *is* a bug.
> >
> > If all the inputs are strings, Unicode should not magically appear.
See
> > all the other string methods as an example.
> 
> But the Template classes aren't string methods, so I don't think the
> analogy is quite right.  Because the template string itself is by
> definition a Unicode, it actually makes more sense that everything its
> mod operator returns is also a Unicode.  So I still don't think it's a
> bug.

Templates are not Unicode by definition.  That is an arbitrary
implementation quirk and a design flaw.

The '%(key)s' forms do not behave this way.   They return str unless one
of the inputs are unicode.

People should be able to use Python and not have to deal with Unicode
unless that is an intentional part of their design.

Unless there is some compelling advantage to going beyond the PEP and
changing all the rules, it is a bug.


Raymond

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4