How to get get_body() to work? (about email)

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Mar 19 17:59:03 EDT 2023


On 20/03/23 7:07 am, Jon Ribbens wrote:
> Ah, apparently it got removed in Python 3, which is a bit odd as the
> last I heard it was added in Python 2.2 in order to achieve consistency
> with other types.

As far as I remember, the file type came into existence
with type/class unification, and "open" became an alias
for the file type, so you could use open() and file()
interchangeably.

With the Unicode revolution in Python 3, file handling got
a lot more complicated. Rather than a single file type,
there are now a bunch of classes that handle low-level I/O,
encoding/decoding, etc, and open() is a function again
that builds the appropriate combination of underlying
objects.

-- 
Greg





More information about the Python-list mailing list