edit
[Imported from Trac: page CodingStandards, version 3]
parent
a5a15063ea
commit
3a7b3a57ce
|
@ -73,7 +73,7 @@ The "error message" that will accompany a failed expression should be a statemen
|
||||||
|
|
||||||
==== class invariants ====
|
==== class invariants ====
|
||||||
|
|
||||||
If your class has internal state which is complicated enough that a bug in the class's implementation could lead to garbled internal state, then you should have a class invariant. A class invariant is a method like this (an actual example from BlockWrangler, but truncated for space):
|
If your class has internal state which is complicated enough that a bug in the class's implementation could lead to garbled internal state, then you should have a class invariant. A class invariant is a method like this (an actual example from !BlockWrangler, but truncated for space):
|
||||||
|
|
||||||
```
|
```
|
||||||
def _assert_consistency(self):
|
def _assert_consistency(self):
|
||||||
|
|
Loading…
Reference in a new issue