[Python-Dev] Easy codec access

Fredrik Lundh fredrik@effbot.org
Wed, 16 May 2001 17:07:18 +0200


skip wrote:

>     mal> pickle and marshal would also be a good to have wrapped as codecs.
> 
> Why?  They operate on much more than strings.

hypergeneralization, of course.

more candidates:

    "10".decode("int")
    "10.0".decode("float")
    "[1, 2, 3]".decode("list")
    "readme.txt".decode("file")
    "SyntaxError".decode("raise")
    (etc)

Cheers /F