[Python-Dev] Breaking undocumented API
exarkun at twistedmatrix.com
exarkun at twistedmatrix.com
Tue Nov 9 17:10:23 CET 2010
On 11:53 am, solipsis at pitrou.net wrote:
>On Tue, 09 Nov 2010 02:03:23 -0000
>exarkun at twistedmatrix.com wrote:
>>
>>I wonder if there are any actual technical arguments to be made
>>against
>>something like `deprecatedModuleAttribute`?
>
>For example, does it work well with import hacks such as Mercurial's
>demandimport?
I haven't tried before, but a quick experiment suggests that the two
happily co-exist (aside from demandimport getting the blame instead of
the true offending code, but that's really a problem with the warnings
module):
>>> import mercurial.demandimport as di
>>> di.enable()
>>> import twisted.python.threadpool as tp
>>> tp.ThreadSafeList
/usr/lib/pymodules/python2.6/mercurial/demandimport.py:76:
DeprecationWarning: twisted.python.threadpool.ThreadSafeList was
deprecated in Twisted 10.1.0: This was an internal implementation detail
of support for Jython 2.1, which is now obsolete.
return getattr(self._module, attr)
<class twisted.python.threadpool.ThreadSafeList at 0xb746decc>
>>>
Jean-Paul
More information about the Python-Dev
mailing list