[Python-3000] PEP 3138- String representation in Python 3000

Terry Reedy tjreedy at udel.edu
Mon May 19 20:12:54 CEST 2008


"M.-A. Lemburg" <mal at egenix.com> wrote in message 
news:4831B2F9.8040001 at egenix.com...
| Motivation: When was the last time you used a gzip compression
| option (ie. yes there are options, but do you use them in the
| general use case) ? Can you write code that applies UU encoding
| without looking up the details in the documentation (ie. there
| is a module for doing UU-encoding in the stdlib, but what's it's
| name, what's the function, does it need extra logic) ?

This suggests to me the possibility of two more packages for the 
reorganized stdlib: b2b and s2s.  Or of considating most transform 
functions into one module, just as math and cmath consolidate float and 
complex transforms -- some with inverses and some not.

IOW, I think .transform may be the wrong solution to library 
disorganization.

| The motivation is not driven by having the need to pass a
| configuration parameter to a .transform() method.
|
| It's being able to write
|
|     str.transform('gzip').transform('uu')

To me, this is to
    uu(gzip(s))
as
    somefloat.transform('cos').transform('sin')
is to
    sin(cos(somefloat))

| which doesn't require knowledge about the modules doing the actual
| work behind the scenes.

It does require knowledge of the registered name.

| We're not adding those methods because there's no other way
| to get the functionality. It's all about usability, readability
| and PEP20 ("Beautiful is better than ugly.").

I think I find the direct function call more readable and prettier.

tjr





More information about the Python-3000 mailing list