[Python-Dev] XXX do we need a new policy?

Nick Coghlan ncoghlan at gmail.com
Tue Nov 4 10:36:05 CET 2008


Guido van Rossum wrote:
> On Mon, Nov 3, 2008 at 3:39 PM, Benjamin Peterson
> <musiccomposition at gmail.com> wrote:
>> Grepping through Python's sources tells me that we have over 2,000
>> "XXX" comments. The thing that irks me about them is that the have a
>> very slow rate of being resolved, since they usually act more as
>> "notes to self" rather than easily attainable tasks.
>>
>> So, I propose that we adopt a policy similar to Twisted's: All "XXX"
>> comments must have an issue in the tracker and an accompanying link
>> with the source code. That way we'll have a forum for discussing the
>> changes and deciding whether they are reasonable enough to
>> implemented.
> 
> That seems excessively draconian. Even at Google we don't have a rule
> like that, and we're sure big on process and interlinked tools. If you
> want to, you could add a different magic keyword, but personally, I
> don't see XXX comments necessarily as "to be resolved" -- merely as
> flags for someone perusing the code looking to change it or digging
> for the cause of some problem to pay special attention.
> 

That's the way I generally use them (e.g. there's one in runpy.py
pointing out why _run_module_as_main isn't part of the module's public API).

Ben's right that any XXX comments that actually turn out to be real
problems should be placed in the issue tracker, but those that are just
"here be dragons!" warnings or "could we do this better?" musings aren't
really a problem. Even the "is this portable?" questions are OK until we
find a platform where the relevant code doesn't work.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------


More information about the Python-Dev mailing list