[stdlib-sig] Breaking out the stdlib

M.-A. Lemburg mal at egenix.com
Tue Sep 15 21:15:31 CEST 2009


Michael Foord wrote:
> M.-A. Lemburg wrote:
>> Michael Foord wrote:
>>> Modules are also deprecated wholesale where their functionality is
>>> replaced by an alternative API.
>>>
>>>    md5 -> hashlib
>>>    mimewriter -> email
>>>
>>> This is already a normal part of the evolution of the Python standard
>>> library.
>>>     
>>
>> And that's perfectly ok.
>>
>> If the change is a single import statement, then I don't have a
>> problem with that.
>>   
> 
> For md5 the API basically moved (although md5.new became hashlib.md5).

Right - you only have to write a line or two to support both
ways in your code.

> For MimeWriter there were (what looks like from a relatively casual
> look) fairly big API changes as well - even if they were only name
> changes (which is substantially similar to the requirements for moving
> from optparse to argparse).

True, but it's fairly easy writing a compatibility module which
does what MimeWriter did in terms of the email package.

I wonder why that wasn't added to the email package - I would
certainly have complained, but I've never used MimeWriter myself
and didn't notice the deprecation at the time.

Here's an example of migrating from MimeWriter to the email
package:

http://thomas.apestaart.org/moap/trac/changeset/401/trunk/moap/util/mail.py

Note that the MimeWriter module still exists in Python 2.7:

"""
This module is present only to maintain backward compatibility.
"""

and that's good.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Sep 15 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the stdlib-sig mailing list