On Tue, Nov 11, 2014 at 11:40 AM, Peter Cacioppi <peter.cacio...@gmail.com>
wrote:

> 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".


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.

PyCharm uses docstrings to accomplish the same task [2] but can also use
asserts/isinstance [3].

[1] https://wingware.com/doc/edit/helping-wing-analyze-code

[2] https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html
<https://www.jetbrains.com/pycharm/webhelp/type-hinting-in-pycharm.html#d232466e456>

[3]
http://stackoverflow.com/questions/9040387/is-there-a-way-to-explicitly-tell-pycharm-what-class-an-attribute-is-an-instance
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to