Menu

#373 Duplicate signature on classlevel variables

open
nobody
None
5
2009-07-13
2009-07-13
Stefan C
No

I stumbled on a bug which would be nice to catch with either statement has no effeect or duplicate signature.
in a django application we had the following scenario

class MyClass(models.Model):
a_variable = models.BooleanField(default=False, null=False)
.... some stupid code that should have been moved lower due to someone doing a crappy merge ....
a_variable = models.BooleanField(default=True, null=True)

a_variable here is either duplicated (if they would be identical) or the first one has no effect (well, maybe it does if methods declared in between use this variable as their default parameter value, but that likely a bug anyway)

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.