2 new comment-like characters in Python to aid development?

dbhbarton at googlemail.com dbhbarton at googlemail.com
Fri Mar 9 05:31:14 EST 2007


Thanks for the thoughts.

> This could be implemented without new syntax: just make your editor  
> recognize some special comments, and apply the highlighting to the  
> following block. By example,
>
>                 # XXX Remove this when FuruFaifa is fixed to always provide
>                 # XXX the names in the same order
>                 names.sort()
>                 names.reverse()

Yes I recognise that we can use existing comments for this purpose,
and if I was suitably gifted I guess I could try to make the IDE
recognise these 'special comments', and maybe even work out what block
they're meant to apply to. Of course I'll still argue that the WIP
character would be a more elegant, speedy and versatile alternative.


> You accidentally type a ! somewhere, and your module stops working - not  
> so good :( and worse, hard to find.

By my reckoning it would be very very easy to find. Even if the IDE
wasn't greying out everything after it. And how often do you
accidentally mistype a ! at the beginning of a line?


> I sometimes use '''this string marks''' to ignore whole blocks of code. It  
> works fine unless the block already contains the same kind of  
> triple-quoted string...

Indeed. Moreover those quotes have to be in pairs, so it's not exactly
a quick and dandy way of doing what I'd like.


> The main problem with new syntax is breaking compatibility with older  
> versions...

Agreed. But both characters are currently disallowed in the positions
concerned, and in the proposal they're optional extras. This can't
stop old scripts from working, it can only stop new scripts from
working on old installations- just like any new feature.

>, and I doubt it's worth the pain just for highlighting or playing  
> interactively

Ah well there's the issue!

>, so you don't have a great chance of them being  
> implemented...

Obviously I like the idea, but I never hold out much hope that people
will agree with me!




More information about the Python-list mailing list