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/2013-November/130197.html below:

[Python-Dev] Add transform() and untranform() methods

[Python-Dev] Add transform() and untranform() methodsTerry Reedy tjreedy at udel.edu
Fri Nov 15 02:10:32 CET 2013
On 11/14/2013 5:32 PM, Victor Stinner wrote:

> I don't like the functions codecs.encode() and codecs.decode() because
> the type of the result depends on the encoding (second parameter). We
> try to avoid this in Python.

Such dependence is common with arithmetic.

 >>> 1 + 2
3
 >>> 1 + 2.0
3.0
 >>> 1 + 2+0j
(3+0j)

 >>> sum((1,2,3), 0)
6
 >>> sum((1,2,3), 0.0)
6.0
 >>> sum((1,2,3), 0.0+0j)
(6+0j)

for f in (compile, eval, getattr, iter, max, min, next, open, pow, 
round, type, vars):
   type(f(*args)) # depends on the inputs
That is a large fraction of the non-class builtin functions.

-- 
Terry Jan Reedy

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