[issue4184] Remove use of private attributes in smtpd

Giampaolo Rodola' report at bugs.python.org
Fri Jul 9 03:58:48 CEST 2010


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

> If the attributes were of the "__private" kind, they weren't meant to 
> be used by other classes, and so there's no problem in making them 
> public.

Generally I would agree with you but this case is different, imho.
The problem here is that those items didn't have to be declared "__private" in the first place. As a consequence of this I think it's reasonable to expect that during the years some code out there might got to rely on them by using name-mangling hack.
After all smtpd module is very old and SMTPHandler class likely to be subclassed because of its basic implementation, and that is why I see some similarities with issue 8483.
I was of the opinion that just removing the __getattr___ ugliness without passing through the usual DeprecationWarning period supposed to be applied in such circumstances would cause no harm, until I realized I was relying on that very functionality in pyftpdlib and I didn't even know it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4184>
_______________________________________


More information about the Python-bugs-list mailing list