Le 30 août 09 à 17:34, Frank Niessink a écrit :

> Hi,
>
> I've activated pylint in Eclipse/PyDev and I'm going through the
> hundreds of pyline errors and warnings. That's really useful.
>

Personally, I prefer pychecker, it's not as anal as pylint when it  
comes to perfectly valid but a bit too smart constructs. But it has  
some issues with wx last time I checked, and pylint is much more  
configurable.

> For
> example, it complained about the use of category in taskfile.py,
> TaskFile.onCategoryChanged:
>
> def onCategoryChanged(self, event):
> if self.__loading:
> return
> categories = [category for category in event.sources() if \
> category in self.categories()]
> if categories:
> self.markDirty()
> for categorizable in category.categorizables():
> categorizable.markDirty()
>
> What is the last loop supposed to do? Mark the categories dirty, or
> mark all the categorizables belonging to the changed categories as
> dirty? In either case, the loop as it is now is clearly wrong.
>

I think it's supposed to mark all categorizables belonging to the  
changed category dirty; that's because in SyncML/vcard world,  
categories are not first-class objects. Instead, each task/contact/etc  
has a categories property which is a comma-separated list of category  
names. So, when a category name changes, every associated  
categorizable changes.

Cheers
Jérôme

Reply via email to