[wingide-users] method completion

ybastide ybastide at wanadoo.fr
Mon Mar 13 10:13:35 EST 2006

Martijn Pieters wrote:
> ybastide wrote:
>> Yep, there's a standard idiom::
>> if 0:
>>      assert isinstance(self.logger, Logger)
> No need to hide the statement in a if 0; assertions are, if your code is 
> correct, harmless.

I disagree: asserting isinstance's prevents duck typing.

> You can also instruct Python to not even compile 
> assertions (the only difference between 'optimized' and nonoptimized 
> python bytecode).

Yep, and this is generally a Bad Thing (as you said, assertions should 
be correct)

> Martijn Pieters


More information about the wingide-users mailing list