cogu/cfile

Redundant boolean operations

abel1502 opened this issue · 2 comments

In several places I have found highly redundant boolean opertions. For example:

self.sys=True if sys==True else False
can be rewritten as self.sys=sys, or self.sys=bool(sys) if you're paranoid about imprecise types. Also, in general, x == True is eqivalent to x, and x == False - to not x. I think refactoring this would make your code a lot clearer

cogu commented

The part of the code you mention was written more than 3 years ago. I agree that the cfile module as a whole needs refactoring.

cogu commented

Resolved in v0.3.0