<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 11, 2014 at 12:57 PM, TP <span dir="ltr"><<a href="mailto:wingusr@gmail.com" target="_blank">wingusr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 11, 2014 at 11:40 AM, Peter Cacioppi <span dir="ltr"><<a href="mailto:peter.cacioppi@gmail.com" target="_blank">peter.cacioppi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I think one needs to take care with some basic assert coding - it's not a substitute for unit tests, it doesn't absolve you of normal exception responsibilities, and, most of all, it should be used for passive inspection and not action. But given these guidelines, I still find it very useful as "active comments".</blockquote></div><br><div style="font-size:small">I first came across asserts when using Wing IDE. See "Helping Wing Analyze Code" [1] explains why using assert and isinstance will let Wing IDE autocomplete things it otherwise couldn't.<br><br></div><div style="font-size:small">PyCharm uses docstrings to accomplish the same task [2] but can also use asserts/isinstance [3].<br></div><div style="font-size:small"><br>[1] <a style="color:rgb(51,102,255)" href="https://wingware.com/doc/edit/helping-wing-analyze-code" title="Linkificator: https://wingware.com/doc/edit/helping-wing-analyze-code" target="_blank">https://wingware.com/doc/edit/helping-wing-analyze-code</a><br><br>[2] <a style="color:rgb(51,102,255)" href="https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html#d232466e456" title="Linkificator: https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html#d232466e456" target="_blank">https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html</a><br><br>[3] <a style="color:#3366ff" href="http://stackoverflow.com/questions/9040387/is-there-a-way-to-explicitly-tell-pycharm-what-class-an-attribute-is-an-instance" title="Linkificator: http://stackoverflow.com/questions/9040387/is-there-a-way-to-explicitly-tell-pycharm-what-class-an-attribute-is-an-instance" target="_blank">http://stackoverflow.com/questions/9040387/is-there-a-way-to-explicitly-tell-pycharm-what-class-an-attribute-is-an-instance</a><br></div><br></div></div>
</blockquote></div><br></div><div class="gmail_extra">I use PyCharm. Thanks for [2], it's a keeper</div></div>